|
|
!(function(){var Kp=Math.pow;var wm=(Wr,Ti,j)=>new Promise((Nt,At)=>{var vt=ft=>{try{gt(j.next(ft))}catch(ct){At(ct)}},Et=ft=>{try{gt(j.throw(ft))}catch(ct){At(ct)}},gt=ft=>ft.done?Nt(ft.value):Promise.resolve(ft.value).then(vt,Et);gt((j=j.apply(Wr,Ti)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[3572],{71749:function(){"use strict"},30483:function(){"use strict"},9708:function(Wr,Ti,j){"use strict";j.d(Ti,{F:function(){return gt},Z:function(){return Et}});var Nt=j(94184),At=j.n(Nt);const vt=null;function Et(ft,ct,ot){return At()({[`${ft}-status-success`]:ct==="success",[`${ft}-status-warning`]:ct==="warning",[`${ft}-status-error`]:ct==="error",[`${ft}-status-validating`]:ct==="validating",[`${ft}-has-feedback`]:ot})}const gt=(ft,ct)=>ct||ft},88258:function(Wr,Ti,j){"use strict";var Nt=j(67294),At=j(53124),vt=j(32983);const Et=gt=>{const{componentName:ft}=gt,{getPrefixCls:ct}=(0,Nt.useContext)(At.E_),ot=ct("empty");switch(ft){case"Table":case"List":return Nt.createElement(vt.Z,{image:vt.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Nt.createElement(vt.Z,{image:vt.Z.PRESENTED_IMAGE_SIMPLE,className:`${ot}-small`});default:return Nt.createElement(vt.Z,null)}};Ti.Z=Et},32983:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return Vt}});var Nt=j(94184),At=j.n(Nt),vt=j(67294),Et=j(53124),gt=j(10110),ft=j(84780),ct=j(46605),F=()=>{const[,Wt]=(0,ct.Z)(),it=new ft.C(Wt.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return vt.createElement("svg",{style:it,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},vt.createElement("g",{fill:"none",fillRule:"evenodd"},vt.createElement("g",{transform:"translate(24 31.67)"},vt.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),vt.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),vt.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),vt.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),vt.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),vt.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),vt.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},vt.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),vt.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},ee=()=>{const[,Wt]=(0,ct.Z)(),{colorFill:kt,colorFillTertiary:it,colorFillQuaternary:Ot,colorBgContainer:qt}=Wt,{borderColor:Te,shadowColor:_e,contentColor:fi}=(0,vt.useMemo)(()=>({borderColor:new ft.C(kt).onBackground(qt).toHexShortString(),shadowColor:new ft.C(it).onBackground(qt).toHexShortString(),contentColor:new ft.C(Ot).onBackground(qt).toHexShortString()}),[kt,it,Ot,qt]);return vt.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},vt.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},vt.createElement("ellipse",{fill:_e,cx:"32",cy:"33",rx:"32",ry:"7"}),vt.createElement("g",{fillRule:"nonzero",stroke:Te},vt.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),vt.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:fi}))))},ne=j(67968),Fe=j(45503);const le=Wt=>{const{componentCls:kt,margin:it,marginXS:Ot,marginXL:qt,fontSize:Te,lineHeight:_e}=Wt;return{[kt]:{marginInline:Ot,fontSize:Te,lineHeight:_e,textAlign:"center",[`${kt}-image`]:{height:Wt.emptyImgHeight,marginBottom:Ot,opacity:Wt.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${kt}-description`]:{color:Wt.colorText},[`${kt}-footer`]:{marginTop:it},"&-normal":{marginBlock:qt,color:Wt.colorTextDisabled,[`${kt}-description`]:{color:Wt.colorTextDisabled},[`${kt}-image`]:{height:Wt.emptyImgHeightMD}},"&-small":{marginBlock:Ot,color:Wt.colorTextDisabled,[`${kt}-image`]:{height:Wt.emptyImgHeightSM}}}}};var Zt=(0,ne.Z)("Empty",Wt=>{const{componentCls:kt,controlHeightLG:it}=Wt,Ot=(0,Fe.TS)(Wt,{emptyImgCls:`${kt}-img`,emptyImgHeight:it*2.5,emptyImgHeightMD:it,emptyImgHeightSM:it*.875});return[le(Ot)]}),zt=function(Wt,kt){var it={};for(var Ot in Wt)Object.prototype.hasOwnProperty.call(Wt,Ot)&&kt.indexOf(Ot)<0&&(it[Ot]=Wt[Ot]);if(Wt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qt=0,Ot=Object.getOwnPropertySymbols(Wt);qt<Ot.length;qt++)kt.indexOf(Ot[qt])<0&&Object.prototype.propertyIsEnumerable.call(Wt,Ot[qt])&&(it[Ot[qt]]=Wt[Ot[qt]]);return it};const Q=vt.createElement(F,null),se=vt.createElement(ee,null),$e=Wt=>{var{className:kt,rootClassName:it,prefixCls:Ot,image:qt=Q,description:Te,children:_e,imageStyle:fi,style:Ht}=Wt,pe=zt(Wt,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:Ke,direction:ki,empty:pi}=vt.useContext(Et.E_),Sn=Ke("empty",Ot),[Sr,Ki]=Zt(Sn),[It]=(0,gt.Z)("Empty"),tt=typeof Te!="undefined"?Te:It==null?void 0:It.description,de=typeof tt=="string"?tt:"empty";let hi=null;return typeof qt=="string"?hi=vt.createElement("img",{alt:de,src:qt}):hi=qt,Sr(vt.createElement("div",Object.assign({className:At()(Ki,Sn,pi==null?void 0:pi.className,{[`${Sn}-normal`]:qt===se,[`${Sn}-rtl`]:ki==="rtl"},kt,it),style:Object.assign(Object.assign({},pi==null?void 0:pi.style),Ht)},pe),vt.createElement("div",{className:`${Sn}-image`,style:fi},hi),tt&&vt.createElement("div",{className:`${Sn}-description`},tt),_e&&vt.createElement("div",{className:`${Sn}-footer`},_e)))};$e.PRESENTED_IMAGE_DEFAULT=Q,$e.PRESENTED_IMAGE_SIMPLE=se;var Vt=$e},91773:function(Wr,Ti,j){"use strict";j.d(Ti,{default:function(){return Kt}});var Nt=j(74902),At=j(94184),vt=j.n(At),Et=j(38379),gt=j(67294),ft=j(33603),ct=j(65223);function ot(yt){const[me,Ce]=gt.useState(yt);return gt.useEffect(()=>{const we=setTimeout(()=>{Ce(yt)},yt.length?0:10);return()=>{clearTimeout(we)}},[yt]),me}var F=j(14747),Y=j(50438),ee=j(33507),ne=j(45503),Fe=j(67968),Zt=yt=>{const{componentCls:me}=yt,Ce=`${me}-show-help`,we=`${me}-show-help-item`;return{[Ce]:{transition:`opacity ${yt.motionDurationSlow} ${yt.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[we]:{overflow:"hidden",transition:`height ${yt.motionDurationSlow} ${yt.motionEaseInOut},
|
|
|
opacity ${yt.motionDurationSlow} ${yt.motionEaseInOut},
|
|
|
transform ${yt.motionDurationSlow} ${yt.motionEaseInOut} !important`,[`&${we}-appear, &${we}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${we}-leave-active`]:{transform:"translateY(-5px)"}}}}};const zt=yt=>({legend:{display:"block",width:"100%",marginBottom:yt.marginLG,padding:0,color:yt.colorTextDescription,fontSize:yt.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${yt.lineWidth}px ${yt.lineType} ${yt.colorBorder}`},label:{fontSize:yt.fontSize},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${yt.controlOutlineWidth}px ${yt.controlOutline}`},output:{display:"block",paddingTop:15,color:yt.colorText,fontSize:yt.fontSize,lineHeight:yt.lineHeight}}),Q=(yt,me)=>{const{formItemCls:Ce}=yt;return{[Ce]:{[`${Ce}-label > label`]:{height:me},[`${Ce}-control-input`]:{minHeight:me}}}},se=yt=>{const{componentCls:me}=yt;return{[yt.componentCls]:Object.assign(Object.assign(Object.assign({},(0,F.Wf)(yt)),zt(yt)),{[`${me}-text`]:{display:"inline-block",paddingInlineEnd:yt.paddingSM},"&-small":Object.assign({},Q(yt,yt.controlHeightSM)),"&-large":Object.assign({},Q(yt,yt.controlHeightLG))})}},$e=yt=>{const{formItemCls:me,iconCls:Ce,componentCls:we,rootPrefixCls:Mt,labelRequiredMarkColor:ie,labelColor:Re,labelFontSize:_i,labelHeight:Qt,labelColonMarginInlineStart:ui,labelColonMarginInlineEnd:vr,itemMarginBottom:Mr}=yt;return{[me]:Object.assign(Object.assign({},(0,F.Wf)(yt)),{marginBottom:Mr,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
|
|
|
&-hidden.${Mt}-row`]:{display:"none"},"&-has-warning":{[`${me}-split`]:{color:yt.colorError}},"&-has-error":{[`${me}-split`]:{color:yt.colorWarning}},[`${me}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${yt.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Qt,color:Re,fontSize:_i,[`> ${Ce}`]:{fontSize:yt.fontSize,verticalAlign:"top"},[`&${me}-required:not(${me}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:yt.marginXXS,color:ie,fontSize:yt.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${we}-hide-required-mark &`]:{display:"none"}},[`${me}-optional`]:{display:"inline-block",marginInlineStart:yt.marginXXS,color:yt.colorTextDescription,[`${we}-hide-required-mark &`]:{display:"none"}},[`${me}-tooltip`]:{color:yt.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:yt.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:ui,marginInlineEnd:vr},[`&${me}-no-colon::after`]:{content:'"\\a0"'}}},[`${me}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Mt}-col-'"]):not([class*="' ${Mt}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:yt.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[me]:{"&-explain, &-extra":{clear:"both",color:yt.colorTextDescription,fontSize:yt.fontSize,lineHeight:yt.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:yt.controlHeightSM,transition:`color ${yt.motionDurationMid} ${yt.motionEaseOut}`},"&-explain":{"&-error":{color:yt.colorError},"&-warning":{color:yt.colorWarning}}},[`&-with-help ${me}-explain`]:{height:"auto",opacity:1},[`${me}-feedback-icon`]:{fontSize:yt.fontSize,textAlign:"center",visibility:"visible",animationName:Y.kr,animationDuration:yt.motionDurationMid,animationTimingFunction:yt.motionEaseOutBack,pointerEvents:"none","&-success":{color:yt.colorSuccess},"&-error":{color:yt.colorError},"&-warning":{color:yt.colorWarning},"&-validating":{color:yt.colorPrimary}}})}},Vt=yt=>{const{componentCls:me,formItemCls:Ce}=yt;return{[`${me}-horizontal`]:{[`${Ce}-label`]:{flexGrow:0},[`${Ce}-control`]:{flex:"1 1 0",minWidth:0},[`${Ce}-label[class$='-24'], ${Ce}-label[class*='-24 ']`]:{[`& + ${Ce}-control`]:{minWidth:"unset"}}}}},Wt=yt=>{const{componentCls:me,formItemCls:Ce}=yt;return{[`${me}-inline`]:{display:"flex",flexWrap:"wrap",[Ce]:{flex:"none",marginInlineEnd:yt.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Ce}-label,
|
|
|
> ${Ce}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Ce}-label`]:{flex:"none"},[`${me}-text`]:{display:"inline-block"},[`${Ce}-has-feedback`]:{display:"inline-block"}}}}},kt=yt=>({padding:yt.verticalLabelPadding,margin:yt.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),it=yt=>{const{componentCls:me,formItemCls:Ce,rootPrefixCls:we}=yt;return{[`${Ce} ${Ce}-label`]:kt(yt),[me]:{[Ce]:{flexWrap:"wrap",[`${Ce}-label, ${Ce}-control`]:{[`&:not([class*=" ${we}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Ot=yt=>{const{componentCls:me,formItemCls:Ce,rootPrefixCls:we}=yt;return{[`${me}-vertical`]:{[Ce]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${me}-item-control`]:{width:"100%"}}},[`${me}-vertical ${Ce}-label,
|
|
|
.${we}-col-24${Ce}-label,
|
|
|
.${we}-col-xl-24${Ce}-label`]:kt(yt),[`@media (max-width: ${yt.screenXSMax}px)`]:[it(yt),{[me]:{[`.${we}-col-xs-24${Ce}-label`]:kt(yt)}}],[`@media (max-width: ${yt.screenSMMax}px)`]:{[me]:{[`.${we}-col-sm-24${Ce}-label`]:kt(yt)}},[`@media (max-width: ${yt.screenMDMax}px)`]:{[me]:{[`.${we}-col-md-24${Ce}-label`]:kt(yt)}},[`@media (max-width: ${yt.screenLGMax}px)`]:{[me]:{[`.${we}-col-lg-24${Ce}-label`]:kt(yt)}}}},qt=(yt,me)=>(0,ne.TS)(yt,{formItemCls:`${yt.componentCls}-item`,rootPrefixCls:me});var Te=(0,Fe.Z)("Form",(yt,me)=>{let{rootPrefixCls:Ce}=me;const we=qt(yt,Ce);return[se(we),$e(we),Zt(we),Vt(we),Wt(we),Ot(we),(0,ee.Z)(we),Y.kr]},yt=>({labelRequiredMarkColor:yt.colorError,labelColor:yt.colorTextHeading,labelFontSize:yt.fontSize,labelHeight:yt.controlHeight,labelColonMarginInlineStart:yt.marginXXS/2,labelColonMarginInlineEnd:yt.marginXS,itemMarginBottom:yt.marginLG,verticalLabelPadding:`0 0 ${yt.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const _e=[];function fi(yt,me,Ce){let we=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof yt=="string"?yt:`${me}-${we}`,error:yt,errorStatus:Ce}}var pe=yt=>{let{help:me,helpStatus:Ce,errors:we=_e,warnings:Mt=_e,className:ie,fieldId:Re,onVisibleChanged:_i}=yt;const{prefixCls:Qt}=gt.useContext(ct.Rk),ui=`${Qt}-item-explain`,[,vr]=Te(Qt),Mr=(0,gt.useMemo)(()=>(0,ft.Z)(Qt),[Qt]),Lr=ot(we),gi=ot(Mt),Ji=gt.useMemo(()=>me!=null?[fi(me,"help",Ce)]:[].concat((0,Nt.Z)(Lr.map((zr,ho)=>fi(zr,"error","error",ho))),(0,Nt.Z)(gi.map((zr,ho)=>fi(zr,"warning","warning",ho)))),[me,Ce,Lr,gi]),Xi={};return Re&&(Xi.id=`${Re}_help`),gt.createElement(Et.default,{motionDeadline:Mr.motionDeadline,motionName:`${Qt}-show-help`,visible:!!Ji.length,onVisibleChanged:_i},zr=>{const{className:ho,style:Tn}=zr;return gt.createElement("div",Object.assign({},Xi,{className:vt()(ui,ho,ie,vr),style:Tn,role:"alert"}),gt.createElement(Et.CSSMotionList,Object.assign({keys:Ji},(0,ft.Z)(Qt),{motionName:`${Qt}-show-help-item`,component:!1}),Pi=>{const{key:os,error:qr,errorStatus:bo,className:he,style:ss}=Pi;return gt.createElement("div",{key:os,className:vt()(he,{[`${ui}-${bo}`]:bo}),style:ss},qr)}))})},Ke=j(58083),ki=j(53124),pi=j(98866),Sn=j(97647),Sr=j(98675),Ki=j(17423);const It=["parentNode"],tt="form_item";function de(yt){return yt===void 0||yt===!1?[]:Array.isArray(yt)?yt:[yt]}function hi(yt,me){if(!yt.length)return;const Ce=yt.join("_");return me?`${me}_${Ce}`:It.includes(Ce)?`${tt}_${Ce}`:Ce}function Ze(yt,me,Ce,we,Mt,ie){let Re=we;return ie!==void 0?Re=ie:Ce.validating?Re="validating":yt.length?Re="error":me.length?Re="warning":(Ce.touched||Mt&&Ce.validated)&&(Re="success"),Re}function Ye(yt){return de(yt).join("_")}function Ae(yt){const[me]=(0,Ke.useForm)(),Ce=gt.useRef({}),we=gt.useMemo(()=>yt!=null?yt:Object.assign(Object.assign({},me),{__INTERNAL__:{itemRef:Mt=>ie=>{const Re=Ye(Mt);ie?Ce.current[Re]=ie:delete Ce.current[Re]}},scrollToField:function(Mt){let ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Re=de(Mt),_i=hi(Re,we.__INTERNAL__.name),Qt=_i?document.getElementById(_i):null;Qt&&(0,Ki.Z)(Qt,Object.assign({scrollMode:"if-needed",block:"nearest"},ie))},getFieldInstance:Mt=>{const ie=Ye(Mt);return Ce.current[ie]}}),[yt,me]);return[we]}var Wi=j(37920),En=function(yt,me){var Ce={};for(var we in yt)Object.prototype.hasOwnProperty.call(yt,we)&&me.indexOf(we)<0&&(Ce[we]=yt[we]);if(yt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Mt=0,we=Object.getOwnPropertySymbols(yt);Mt<we.length;Mt++)me.indexOf(we[Mt])<0&&Object.prototype.propertyIsEnumerable.call(yt,we[Mt])&&(Ce[we[Mt]]=yt[we[Mt]]);return Ce};const an=(yt,me)=>{const Ce=gt.useContext(pi.Z),{getPrefixCls:we,direction:Mt,form:ie}=gt.useContext(ki.E_),{prefixCls:Re,className:_i,rootClassName:Qt,size:ui,disabled:vr=Ce,form:Mr,colon:Lr,labelAlign:gi,labelWrap:Ji,labelCol:Xi,wrapperCol:zr,hideRequiredMark:ho,layout:Tn="horizontal",scrollToFirstError:Pi,requiredMark:os,onFinishFailed:qr,name:bo,style:he,feedbackIcons:ss}=yt,Aa=En(yt,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),Bo=(0,Sr.Z)(ui),Ma=gt.useContext(Wi.Z),Lo=(0,gt.useMemo)(()=>os!==void 0?os:ie&&ie.requiredMark!==void 0?ie.requiredMark:!ho,[ho,os,ie]),Tr=Lr!=null?Lr:ie==null?void 0:ie.colon,yr=we("form",Re),[$r,dr]=Te(yr),ue=vt()(yr,`${yr}-${Tn}`,{[`${yr}-hide-required-mark`]:Lo===!1,[`${yr}-rtl`]:Mt==="rtl",[`${yr}-${Bo}`]:Bo},dr,ie==null?void 0:ie.className,_i,Qt),[Wo]=Ae(Mr),{__INTERNAL__:te}=Wo;te.name=bo;const Do=(0,gt.useMemo)(()=>({name:bo,labelAlign:gi,labelCol:Xi,labelWrap:Ji,wrapperCol:zr,vertical:Tn==="vertical",colon:Tr,requiredMark:Lo,itemRef:te.itemRef,form:Wo,feedbackIcons:ss}),[bo,gi,Xi,zr,Tn,Tr,Lo,Wo,ss]);gt.useImperativeHandle(me,()=>Wo);const Co=(ea,Nr)=>{if(ea){let Xn={block:"nearest"};typeof ea=="object"&&(Xn=ea),Wo.scrollToField(Nr,Xn)}},Io=ea=>{if(qr==null||qr(ea),ea.errorFields.length){const Nr=ea.errorFields[0].name;if(Pi!==void 0){Co(Pi,Nr);return}ie&&ie.scrollToFirstError!==void 0&&Co(ie.scrollToFirstError,Nr)}};return $r(gt.createElement(pi.n,{disabled:vr},gt.createElement(Sn.q,{size:Bo},gt.createElement(ct.RV,Object.assign({},{validateMessages:Ma}),gt.createElement(ct.q3.Provider,{value:Do},gt.createElement(Ke.default,Object.assign({id:bo},Aa,{name:bo,onFinishFailed:Io,form:Wo,style:Object.assign(Object.assign({},ie==null?void 0:ie.style),he),className:ue})))))))};var ai=gt.forwardRef(an),zi=j(9475),$i=j(17799),q=j(96159),D=j(37419);function _(yt){if(typeof yt=="function")return yt;const me=(0,D.Z)(yt);return me.length<=1?me[0]:me}const K=()=>{const{status:yt,errors:me=[],warnings:Ce=[]}=(0,gt.useContext)(ct.aM);return{status:yt,errors:me,warnings:Ce}};K.Context=ct.aM;var z=K,P=j(96523);function bt(yt){const[me,Ce]=gt.useState(yt),we=(0,gt.useRef)(null),Mt=(0,gt.useRef)([]),ie=(0,gt.useRef)(!1);gt.useEffect(()=>(ie.current=!1,()=>{ie.current=!0,P.Z.cancel(we.current),we.current=null}),[]);function Re(_i){ie.current||(we.current===null&&(Mt.current=[],we.current=(0,P.Z)(()=>{we.current=null,Ce(Qt=>{let ui=Qt;return Mt.current.forEach(vr=>{ui=vr(ui)}),ui})})),Mt.current.push(_i))}return[me,Re]}function Gt(){const{itemRef:yt}=gt.useContext(ct.q3),me=gt.useRef({});function Ce(we,Mt){const ie=Mt&&typeof Mt=="object"&&Mt.ref,Re=we.join("_");return(me.current.name!==Re||me.current.originRef!==ie)&&(me.current.name=Re,me.current.originRef=ie,me.current.ref=(0,$i.sQ)(yt(we),ie)),me.current.ref}return Ce}var Pe=j(48130),He=j(14075),ei=j(10366),si=j(92820),Gi=j(21584);const er=yt=>{const{formItemCls:me}=yt;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${me}-control`]:{display:"flex"}}}};var rr=(0,Fe.b)(["Form","item-item"],(yt,me)=>{let{rootPrefixCls:Ce}=me;const we=qt(yt,Ce);return[er(we)]}),We=yt=>{const{prefixCls:me,status:Ce,wrapperCol:we,children:Mt,errors:ie,warnings:Re,_internalItemRender:_i,extra:Qt,help:ui,fieldId:vr,marginBottom:Mr,onErrorVisibleChanged:Lr}=yt,gi=`${me}-item`,Ji=gt.useContext(ct.q3),Xi=we||Ji.wrapperCol||{},zr=vt()(`${gi}-control`,Xi.className),ho=gt.useMemo(()=>Object.assign({},Ji),[Ji]);delete ho.labelCol,delete ho.wrapperCol;const Tn=gt.createElement("div",{className:`${gi}-control-input`},gt.createElement("div",{className:`${gi}-control-input-content`},Mt)),Pi=gt.useMemo(()=>({prefixCls:me,status:Ce}),[me,Ce]),os=Mr!==null||ie.length||Re.length?gt.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},gt.createElement(ct.Rk.Provider,{value:Pi},gt.createElement(pe,{fieldId:vr,errors:ie,warnings:Re,help:ui,helpStatus:Ce,className:`${gi}-explain-connected`,onVisibleChanged:Lr})),!!Mr&>.createElement("div",{style:{width:0,height:Mr}})):null,qr={};vr&&(qr.id=`${vr}_extra`);const bo=Qt?gt.createElement("div",Object.assign({},qr,{className:`${gi}-extra`}),Qt):null,he=_i&&_i.mark==="pro_table_render"&&_i.render?_i.render(yt,{input:Tn,errorList:os,extra:bo}):gt.createElement(gt.Fragment,null,Tn,os,bo);return gt.createElement(ct.q3.Provider,{value:ho},gt.createElement(Gi.Z,Object.assign({},Xi,{className:zr}),he),gt.createElement(rr,{prefixCls:me}))},Go=j(87462),$o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},yo=$o,Fr=j(44327),Ro=function(me,Ce){return gt.createElement(Fr.Z,(0,Go.Z)({},me,{ref:Ce,icon:yo}))},uo=gt.forwardRef(Ro),Ao=j(24457),fs=j(10110),Ya=j(83062),Ja=function(yt,me){var Ce={};for(var we in yt)Object.prototype.hasOwnProperty.call(yt,we)&&me.indexOf(we)<0&&(Ce[we]=yt[we]);if(yt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Mt=0,we=Object.getOwnPropertySymbols(yt);Mt<we.length;Mt++)me.indexOf(we[Mt])<0&&Object.prototype.propertyIsEnumerable.call(yt,we[Mt])&&(Ce[we[Mt]]=yt[we[Mt]]);return Ce};function jl(yt){return yt?typeof yt=="object"&&!gt.isValidElement(yt)?yt:{title:yt}:null}var xo=yt=>{let{prefixCls:me,label:Ce,htmlFor:we,labelCol:Mt,labelAlign:ie,colon:Re,required:_i,requiredMark:Qt,tooltip:ui}=yt;var vr;const[Mr]=(0,fs.Z)("Form"),{vertical:Lr,labelAlign:gi,labelCol:Ji,labelWrap:Xi,colon:zr}=gt.useContext(ct.q3);if(!Ce)return null;const ho=Mt||Ji||{},Tn=ie||gi,Pi=`${me}-item-label`,os=vt()(Pi,Tn==="left"&&`${Pi}-left`,ho.className,{[`${Pi}-wrap`]:!!Xi});let qr=Ce;const bo=Re===!0||zr!==!1&&Re!==!1;bo&&!Lr&&typeof Ce=="string"&&Ce.trim()!==""&&(qr=Ce.replace(/[:|:]\s*$/,""));const ss=jl(ui);if(ss){const{icon:Lo=gt.createElement(uo,null)}=ss,Tr=Ja(ss,["icon"]),yr=gt.createElement(Ya.Z,Object.assign({},Tr),gt.cloneElement(Lo,{className:`${me}-item-tooltip`,title:""}));qr=gt.createElement(gt.Fragment,null,qr,yr)}const Aa=Qt==="optional",Bo=typeof Qt=="function";Bo?qr=Qt(qr,{required:!!_i}):Aa&&!_i&&(qr=gt.createElement(gt.Fragment,null,qr,gt.createElement("span",{className:`${me}-item-optional`,title:""},(Mr==null?void 0:Mr.optional)||((vr=Ao.Z.Form)===null||vr===void 0?void 0:vr.optional))));const Ma=vt()({[`${me}-item-required`]:_i,[`${me}-item-required-mark-optional`]:Aa||Bo,[`${me}-item-no-colon`]:!bo});return gt.createElement(Gi.Z,Object.assign({},ho,{className:os}),gt.createElement("label",{htmlFor:we,className:Ma,title:typeof Ce=="string"?Ce:""},qr))},rl=j(23526),Va=j(30186),Kl=j(39291),ga=j(77322);const Xs={success:rl.Z,warning:Kl.Z,error:Va.Z,validating:ga.Z};function Me(yt){let{children:me,errors:Ce,warnings:we,hasFeedback:Mt,validateStatus:ie,prefixCls:Re,meta:_i,noStyle:Qt}=yt;const ui=`${Re}-item`,{feedbackIcons:vr}=gt.useContext(ct.q3),Mr=Ze(Ce,we,_i,null,!!Mt,ie),{isFormItemInput:Lr,status:gi}=gt.useContext(ct.aM),Ji=gt.useMemo(()=>{var Xi;let zr;if(Mt){const Pi=Mt!==!0&&Mt.icons||vr,os=Mr&&((Xi=Pi==null?void 0:Pi({status:Mr,errors:Ce,warnings:we}))===null||Xi===void 0?void 0:Xi[Mr]),qr=Mr&&Xs[Mr];zr=os!==!1&&qr?gt.createElement("span",{className:vt()(`${ui}-feedback-icon`,`${ui}-feedback-icon-${Mr}`)},os||gt.createElement(qr,null)):null}let ho=!0,Tn=Mr||"";return Qt&&(ho=Lr,Tn=(Mr!=null?Mr:gi)||""),{status:Tn,errors:Ce,warnings:we,hasFeedback:!!Mt,feedbackIcon:zr,isFormItemInput:ho}},[Mr,Mt,Qt,Lr,gi]);return gt.createElement(ct.aM.Provider,{value:Ji},me)}var L=function(yt,me){var Ce={};for(var we in yt)Object.prototype.hasOwnProperty.call(yt,we)&&me.indexOf(we)<0&&(Ce[we]=yt[we]);if(yt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Mt=0,we=Object.getOwnPropertySymbols(yt);Mt<we.length;Mt++)me.indexOf(we[Mt])<0&&Object.prototype.propertyIsEnumerable.call(yt,we[Mt])&&(Ce[we[Mt]]=yt[we[Mt]]);return Ce};function yi(yt){const{prefixCls:me,className:Ce,rootClassName:we,style:Mt,help:ie,errors:Re,warnings:_i,validateStatus:Qt,meta:ui,hasFeedback:vr,hidden:Mr,children:Lr,fieldId:gi,required:Ji,isRequired:Xi,onSubItemMetaChange:zr}=yt,ho=L(yt,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),Tn=`${me}-item`,{requiredMark:Pi}=gt.useContext(ct.q3),os=gt.useRef(null),qr=ot(Re),bo=ot(_i),he=ie!=null,ss=!!(he||Re.length||_i.length),Aa=!!os.current&&(0,Pe.Z)(os.current),[Bo,Ma]=gt.useState(null);(0,He.Z)(()=>{if(ss&&os.current){const dr=getComputedStyle(os.current);Ma(parseInt(dr.marginBottom,10))}},[ss,Aa]);const Lo=dr=>{dr||Ma(null)},yr=function(){let dr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const ue=dr?qr:ui.errors,Wo=dr?bo:ui.warnings;return Ze(ue,Wo,ui,"",!!vr,Qt)}(),$r=vt()(Tn,Ce,we,{[`${Tn}-with-help`]:he||qr.length||bo.length,[`${Tn}-has-feedback`]:yr&&vr,[`${Tn}-has-success`]:yr==="success",[`${Tn}-has-warning`]:yr==="warning",[`${Tn}-has-error`]:yr==="error",[`${Tn}-is-validating`]:yr==="validating",[`${Tn}-hidden`]:Mr});return gt.createElement("div",{className:$r,style:Mt,ref:os},gt.createElement(si.Z,Object.assign({className:`${Tn}-row`},(0,ei.Z)(ho,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),gt.createElement(xo,Object.assign({htmlFor:gi},yt,{requiredMark:Pi,required:Ji!=null?Ji:Xi,prefixCls:me})),gt.createElement(We,Object.assign({},yt,ui,{errors:qr,warnings:bo,prefixCls:me,status:yr,help:ie,marginBottom:Bo,onErrorVisibleChanged:Lo}),gt.createElement(ct.qI.Provider,{value:zr},gt.createElement(Me,{prefixCls:me,meta:ui,errors:ui.errors,warnings:ui.warnings,hasFeedback:vr,validateStatus:yr},Lr)))),!!Bo&>.createElement("div",{className:`${Tn}-margin-offset`,style:{marginBottom:-Bo}}))}const qe="__SPLIT__",Si=null,Vi=gt.memo(yt=>{let{children:me}=yt;return me},(yt,me)=>yt.value===me.value&&yt.update===me.update&&yt.childProps.length===me.childProps.length&&yt.childProps.every((Ce,we)=>Ce===me.childProps[we]));function ln(yt){return yt!=null}function fr(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function no(yt){const{name:me,noStyle:Ce,className:we,dependencies:Mt,prefixCls:ie,shouldUpdate:Re,rules:_i,children:Qt,required:ui,label:vr,messageVariables:Mr,trigger:Lr="onChange",validateTrigger:gi,hidden:Ji,help:Xi}=yt,{getPrefixCls:zr}=gt.useContext(ki.E_),{name:ho}=gt.useContext(ct.q3),Tn=_(Qt),Pi=typeof Tn=="function",os=gt.useContext(ct.qI),{validateTrigger:qr}=gt.useContext(Ke.FieldContext),bo=gi!==void 0?gi:qr,he=ln(me),ss=zr("form",ie),[Aa,Bo]=Te(ss),Ma=gt.useContext(Ke.ListContext),Lo=gt.useRef(),[Tr,yr]=bt({}),[$r,dr]=(0,zi.Z)(()=>fr()),ue=Nr=>{const Xn=Ma==null?void 0:Ma.getKey(Nr.name);if(dr(Nr.destroy?fr():Nr,!0),Ce&&Xi!==!1&&os){let fo=Nr.name;if(Nr.destroy)fo=Lo.current||fo;else if(Xn!==void 0){const[Ys,Xo]=Xn;fo=[Ys].concat((0,Nt.Z)(Xo)),Lo.current=fo}os(Nr,fo)}},Wo=(Nr,Xn)=>{yr(fo=>{const Ys=Object.assign({},fo),ci=[].concat((0,Nt.Z)(Nr.name.slice(0,-1)),(0,Nt.Z)(Xn)).join(qe);return Nr.destroy?delete Ys[ci]:Ys[ci]=Nr,Ys})},[te,Do]=gt.useMemo(()=>{const Nr=(0,Nt.Z)($r.errors),Xn=(0,Nt.Z)($r.warnings);return Object.values(Tr).forEach(fo=>{Nr.push.apply(Nr,(0,Nt.Z)(fo.errors||[])),Xn.push.apply(Xn,(0,Nt.Z)(fo.warnings||[]))}),[Nr,Xn]},[Tr,$r.errors,$r.warnings]),Co=Gt();function Io(Nr,Xn,fo){return Ce&&!Ji?gt.createElement(Me,{prefixCls:ss,hasFeedback:yt.hasFeedback,validateStatus:yt.validateStatus,meta:$r,errors:te,warnings:Do,noStyle:!0},Nr):gt.createElement(yi,Object.assign({key:"row"},yt,{className:vt()(we,Bo),prefixCls:ss,fieldId:Xn,isRequired:fo,errors:te,warnings:Do,meta:$r,onSubItemMetaChange:Wo}),Nr)}if(!he&&!Pi&&!Mt)return Aa(Io(Tn));let ea={};return typeof vr=="string"?ea.label=vr:me&&(ea.label=String(me)),Mr&&(ea=Object.assign(Object.assign({},ea),Mr)),Aa(gt.createElement(Ke.Field,Object.assign({},yt,{messageVariables:ea,trigger:Lr,validateTrigger:bo,onMetaChange:ue}),(Nr,Xn,fo)=>{const Ys=de(me).length&&Xn?Xn.name:[],Xo=hi(Ys,ho),ci=ui!==void 0?ui:!!(_i&&_i.some(zs=>{if(zs&&typeof zs=="object"&&zs.required&&!zs.warningOnly)return!0;if(typeof zs=="function"){const Fa=zs(fo);return Fa&&Fa.required&&!Fa.warningOnly}return!1})),G=Object.assign({},Nr);let Wa=null;if(Array.isArray(Tn)&&he)Wa=Tn;else if(!(Pi&&(!(Re||Mt)||he))){if(!(Mt&&!Pi&&!he))if((0,q.l$)(Tn)){const zs=Object.assign(Object.assign({},Tn.props),G);if(zs.id||(zs.id=Xo),Xi||te.length>0||Do.length>0||yt.extra){const iu=[];(Xi||te.length>0)&&iu.push(`${Xo}_help`),yt.extra&&iu.push(`${Xo}_extra`),zs["aria-describedby"]=iu.join(" ")}te.length>0&&(zs["aria-invalid"]="true"),ci&&(zs["aria-required"]="true"),(0,$i.Yr)(Tn)&&(zs.ref=Co(Ys,Tn)),new Set([].concat((0,Nt.Z)(de(Lr)),(0,Nt.Z)(de(bo)))).forEach(iu=>{zs[iu]=function(){for(var Pu,Th,rt,ut,re,be=arguments.length,Ge=new Array(be),ni=0;ni<be;ni++)Ge[ni]=arguments[ni];(rt=G[iu])===null||rt===void 0||(Pu=rt).call.apply(Pu,[G].concat(Ge)),(re=(ut=Tn.props)[iu])===null||re===void 0||(Th=re).call.apply(Th,[ut].concat(Ge))}});const ia=[zs["aria-required"],zs["aria-invalid"],zs["aria-describedby"]];Wa=gt.createElement(Vi,{value:G[yt.valuePropName||"value"],update:Tn,childProps:ia},(0,q.Tm)(Tn,zs))}else Pi&&(Re||Mt)&&!he?Wa=Tn(fo):Wa=Tn}return Io(Wa,Xo,ci)}))}const wo=no;wo.useStatus=z;var ro=wo,li=function(yt,me){var Ce={};for(var we in yt)Object.prototype.hasOwnProperty.call(yt,we)&&me.indexOf(we)<0&&(Ce[we]=yt[we]);if(yt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Mt=0,we=Object.getOwnPropertySymbols(yt);Mt<we.length;Mt++)me.indexOf(we[Mt])<0&&Object.prototype.propertyIsEnumerable.call(yt,we[Mt])&&(Ce[we[Mt]]=yt[we[Mt]]);return Ce},$t=yt=>{var{prefixCls:me,children:Ce}=yt,we=li(yt,["prefixCls","children"]);const{getPrefixCls:Mt}=gt.useContext(ki.E_),ie=Mt("form",me),Re=gt.useMemo(()=>({prefixCls:ie,status:"error"}),[ie]);return gt.createElement(Ke.List,Object.assign({},we),(_i,Qt,ui)=>gt.createElement(ct.Rk.Provider,{value:Re},Ce(_i.map(vr=>Object.assign(Object.assign({},vr),{fieldKey:vr.key})),Qt,{errors:ui.errors,warnings:ui.warnings})))};function xe(){const{form:yt}=(0,gt.useContext)(ct.q3);return yt}const Ue=ai;Ue.Item=ro,Ue.List=$t,Ue.ErrorList=pe,Ue.useForm=Ae,Ue.useFormInstance=xe,Ue.useWatch=Ke.useWatch,Ue.Provider=ct.RV,Ue.create=()=>{};var Kt=Ue},42405:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return li}});var Nt=j(15558),At=j(87462),vt=j(67294),Et={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},gt=Et,ft=j(44327),ct=function($t,xe){return vt.createElement(ft.Z,(0,At.Z)({},$t,{ref:xe,icon:gt}))},ot=vt.forwardRef(ct),F=j(94184),Y=j.n(F),ee=j(4942),ne=j(71002),Fe=j(97685),le=j(45987),Zt=j(15671),zt=j(43144);function Q(){return typeof BigInt=="function"}function se(St){return!St&&St!==0&&!Number.isNaN(St)||!String(St).trim()}function $e(St){var $t=St.trim(),xe=$t.startsWith("-");xe&&($t=$t.slice(1)),$t=$t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),$t.startsWith(".")&&($t="0".concat($t));var Ue=$t||"0",Kt=Ue.split("."),yt=Kt[0]||"0",me=Kt[1]||"0";yt==="0"&&me==="0"&&(xe=!1);var Ce=xe?"-":"";return{negative:xe,negativeStr:Ce,trimStr:Ue,integerStr:yt,decimalStr:me,fullStr:"".concat(Ce).concat(Ue)}}function Vt(St){var $t=String(St);return!Number.isNaN(Number($t))&&$t.includes("e")}function Wt(St){var $t=String(St);if(Vt(St)){var xe=Number($t.slice($t.indexOf("e-")+2)),Ue=$t.match(/\.(\d+)/);return Ue!=null&&Ue[1]&&(xe+=Ue[1].length),xe}return $t.includes(".")&&it($t)?$t.length-$t.indexOf(".")-1:0}function kt(St){var $t=String(St);if(Vt(St)){if(St>Number.MAX_SAFE_INTEGER)return String(Q()?BigInt(St).toString():Number.MAX_SAFE_INTEGER);if(St<Number.MIN_SAFE_INTEGER)return String(Q()?BigInt(St).toString():Number.MIN_SAFE_INTEGER);$t=St.toFixed(Wt($t))}return $e($t).fullStr}function it(St){return typeof St=="number"?!Number.isNaN(St):St?/^\s*-?\d+(\.\d+)?\s*$/.test(St)||/^\s*-?\d+\.\s*$/.test(St)||/^\s*-?\.\d+\s*$/.test(St):!1}var Ot=function(){function St($t){if((0,Zt.Z)(this,St),(0,ee.Z)(this,"origin",""),(0,ee.Z)(this,"negative",void 0),(0,ee.Z)(this,"integer",void 0),(0,ee.Z)(this,"decimal",void 0),(0,ee.Z)(this,"decimalLen",void 0),(0,ee.Z)(this,"empty",void 0),(0,ee.Z)(this,"nan",void 0),se($t)){this.empty=!0;return}if(this.origin=String($t),$t==="-"||Number.isNaN($t)){this.nan=!0;return}var xe=$t;if(Vt(xe)&&(xe=Number(xe)),xe=typeof xe=="string"?xe:kt(xe),it(xe)){var Ue=$e(xe);this.negative=Ue.negative;var Kt=Ue.trimStr.split(".");this.integer=BigInt(Kt[0]);var yt=Kt[1]||"0";this.decimal=BigInt(yt),this.decimalLen=yt.length}else this.nan=!0}return(0,zt.Z)(St,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(xe){var Ue="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(xe,"0"));return BigInt(Ue)}},{key:"negate",value:function(){var xe=new St(this.toString());return xe.negative=!xe.negative,xe}},{key:"cal",value:function(xe,Ue,Kt){var yt=Math.max(this.getDecimalStr().length,xe.getDecimalStr().length),me=this.alignDecimal(yt),Ce=xe.alignDecimal(yt),we=Ue(me,Ce).toString(),Mt=Kt(yt),ie=$e(we),Re=ie.negativeStr,_i=ie.trimStr,Qt="".concat(Re).concat(_i.padStart(Mt+1,"0"));return new St("".concat(Qt.slice(0,-Mt),".").concat(Qt.slice(-Mt)))}},{key:"add",value:function(xe){if(this.isInvalidate())return new St(xe);var Ue=new St(xe);return Ue.isInvalidate()?this:this.cal(Ue,function(Kt,yt){return Kt+yt},function(Kt){return Kt})}},{key:"multi",value:function(xe){var Ue=new St(xe);return this.isInvalidate()||Ue.isInvalidate()?new St(NaN):this.cal(Ue,function(Kt,yt){return Kt*yt},function(Kt){return Kt*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(xe){return this.toString()===(xe==null?void 0:xe.toString())}},{key:"lessEquals",value:function(xe){return this.add(xe.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return xe?this.isInvalidate()?"":$e("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),St}(),qt=function(){function St($t){if((0,Zt.Z)(this,St),(0,ee.Z)(this,"origin",""),(0,ee.Z)(this,"number",void 0),(0,ee.Z)(this,"empty",void 0),se($t)){this.empty=!0;return}this.origin=String($t),this.number=Number($t)}return(0,zt.Z)(St,[{key:"negate",value:function(){return new St(-this.toNumber())}},{key:"add",value:function(xe){if(this.isInvalidate())return new St(xe);var Ue=Number(xe);if(Number.isNaN(Ue))return this;var Kt=this.number+Ue;if(Kt>Number.MAX_SAFE_INTEGER)return new St(Number.MAX_SAFE_INTEGER);if(Kt<Number.MIN_SAFE_INTEGER)return new St(Number.MIN_SAFE_INTEGER);var yt=Math.max(Wt(this.number),Wt(Ue));return new St(Kt.toFixed(yt))}},{key:"multi",value:function(xe){var Ue=Number(xe);if(this.isInvalidate()||Number.isNaN(Ue))return new St(NaN);var Kt=this.number*Ue;if(Kt>Number.MAX_SAFE_INTEGER)return new St(Number.MAX_SAFE_INTEGER);if(Kt<Number.MIN_SAFE_INTEGER)return new St(Number.MIN_SAFE_INTEGER);var yt=Math.max(Wt(this.number),Wt(Ue));return new St(Kt.toFixed(yt))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(xe){return this.toNumber()===(xe==null?void 0:xe.toNumber())}},{key:"lessEquals",value:function(xe){return this.add(xe.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return xe?this.isInvalidate()?"":kt(this.number):this.origin}}]),St}();function Te(St){return Q()?new Ot(St):new qt(St)}function _e(St,$t,xe){var Ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(St==="")return"";var Kt=$e(St),yt=Kt.negativeStr,me=Kt.integerStr,Ce=Kt.decimalStr,we="".concat($t).concat(Ce),Mt="".concat(yt).concat(me);if(xe>=0){var ie=Number(Ce[xe]);if(ie>=5&&!Ue){var Re=Te(St).add("".concat(yt,"0.").concat("0".repeat(xe)).concat(10-ie));return _e(Re.toString(),$t,xe,Ue)}return xe===0?Mt:"".concat(Mt).concat($t).concat(Ce.padEnd(xe,"0").slice(0,xe))}return we===".0"?Mt:"".concat(Mt).concat(we)}var fi=Te,Ht=j(67656);function pe(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ke=pe()?vt.useLayoutEffect:vt.useEffect,ki=function($t,xe){var Ue=vt.useRef(!0);Ke(function(){return $t(Ue.current)},xe),Ke(function(){return Ue.current=!1,function(){Ue.current=!0}},[])},pi=function($t,xe){ki(function(Ue){if(!Ue)return $t()},xe)},Sn=ki,Sr=j(27183);function Ki(St,$t,xe){var Ue=React.useRef({});return(!("value"in Ue.current)||xe(Ue.current.condition,$t))&&(Ue.current.value=St(),Ue.current.condition=$t),Ue.current.value}function It(St,$t){typeof St=="function"?St($t):(0,ne.Z)(St)==="object"&&St&&"current"in St&&(St.current=$t)}function tt(){for(var St=arguments.length,$t=new Array(St),xe=0;xe<St;xe++)$t[xe]=arguments[xe];var Ue=$t.filter(function(Kt){return Kt});return Ue.length<=1?Ue[0]:function(Kt){$t.forEach(function(yt){It(yt,Kt)})}}function de(){for(var St=arguments.length,$t=new Array(St),xe=0;xe<St;xe++)$t[xe]=arguments[xe];return useMemo(function(){return tt.apply(void 0,$t)},$t,function(Ue,Kt){return Ue.length!==Kt.length||Ue.every(function(yt,me){return yt!==Kt[me]})})}function hi(St){var $t,xe,Ue=isMemo(St)?St.type.type:St.type;return!(typeof Ue=="function"&&!(($t=Ue.prototype)!==null&&$t!==void 0&&$t.render)||typeof St=="function"&&!((xe=St.prototype)!==null&&xe!==void 0&&xe.render))}function Ze(St){return!isValidElement(St)||isFragment(St)?!1:hi(St)}var Ye={},Ae=[],Wi=function($t){Ae.push($t)};function En(St,$t){if(0)var xe}function an(St,$t){if(0)var xe}function vi(){Ye={}}function ai(St,$t,xe){!$t&&!Ye[xe]&&(St(!1,xe),Ye[xe]=!0)}function zi(St,$t){ai(En,St,$t)}function $i(St,$t){ai(an,St,$t)}zi.preMessage=Wi,zi.resetWarned=vi,zi.noteOnce=$i;var q=zi;function D(St,$t){var xe=(0,vt.useRef)(null);function Ue(){try{var yt=St.selectionStart,me=St.selectionEnd,Ce=St.value,we=Ce.substring(0,yt),Mt=Ce.substring(me);xe.current={start:yt,end:me,value:Ce,beforeTxt:we,afterTxt:Mt}}catch(ie){}}function Kt(){if(St&&xe.current&&$t)try{var yt=St.value,me=xe.current,Ce=me.beforeTxt,we=me.afterTxt,Mt=me.start,ie=yt.length;if(yt.endsWith(we))ie=yt.length-xe.current.afterTxt.length;else if(yt.startsWith(Ce))ie=Ce.length;else{var Re=Ce[Mt-1],_i=yt.indexOf(Re,Mt-1);_i!==-1&&(ie=_i+1)}St.setSelectionRange(ie,ie)}catch(Qt){q(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Qt.message))}}return[Ue,Kt]}var _=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var St=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(St)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(St==null?void 0:St.substr(0,4))},K=function(){var $t=(0,vt.useState)(!1),xe=(0,Fe.Z)($t,2),Ue=xe[0],Kt=xe[1];return Sn(function(){Kt(_())},[]),Ue},z=K,P=function($t){return+setTimeout($t,16)},bt=function($t){return clearTimeout($t)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(P=function($t){return window.requestAnimationFrame($t)},bt=function($t){return window.cancelAnimationFrame($t)});var Gt=0,Pe=new Map;function He(St){Pe.delete(St)}var ei=function($t){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Gt+=1;var Ue=Gt;function Kt(yt){if(yt===0)He(Ue),$t();else{var me=P(function(){Kt(yt-1)});Pe.set(Ue,me)}}return Kt(xe),Ue};ei.cancel=function(St){var $t=Pe.get(St);return He($t),bt($t)};var si=ei,Gi=200,er=600;function rr(St){var $t=St.prefixCls,xe=St.upNode,Ue=St.downNode,Kt=St.upDisabled,yt=St.downDisabled,me=St.onStep,Ce=vt.useRef(),we=vt.useRef([]),Mt=vt.useRef();Mt.current=me;var ie=function(){clearTimeout(Ce.current)},Re=function(Ji,Xi){Ji.preventDefault(),ie(),Mt.current(Xi);function zr(){Mt.current(Xi),Ce.current=setTimeout(zr,Gi)}Ce.current=setTimeout(zr,er)};vt.useEffect(function(){return function(){ie(),we.current.forEach(function(gi){return si.cancel(gi)})}},[]);var _i=z();if(_i)return null;var Qt="".concat($t,"-handler"),ui=Y()(Qt,"".concat(Qt,"-up"),(0,ee.Z)({},"".concat(Qt,"-up-disabled"),Kt)),vr=Y()(Qt,"".concat(Qt,"-down"),(0,ee.Z)({},"".concat(Qt,"-down-disabled"),yt)),Mr=function(){return we.current.push(si(ie))},Lr={unselectable:"on",role:"button",onMouseUp:Mr,onMouseLeave:Mr};return vt.createElement("div",{className:"".concat(Qt,"-wrap")},vt.createElement("span",(0,At.Z)({},Lr,{onMouseDown:function(Ji){Re(Ji,!0)},"aria-label":"Increase Value","aria-disabled":Kt,className:ui}),xe||vt.createElement("span",{unselectable:"on",className:"".concat($t,"-handler-up-inner")})),vt.createElement("span",(0,At.Z)({},Lr,{onMouseDown:function(Ji){Re(Ji,!1)},"aria-label":"Decrease Value","aria-disabled":yt,className:vr}),Ue||vt.createElement("span",{unselectable:"on",className:"".concat($t,"-handler-down-inner")})))}function Se(St){var $t=typeof St=="number"?kt(St):$e(St).fullStr,xe=$t.includes(".");return xe?$e($t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:St+"0"}var We=j(87887),Go=function(){var St=(0,vt.useRef)(0),$t=function(){si.cancel(St.current)};return(0,vt.useEffect)(function(){return $t},[]),function(xe){$t(),St.current=si(function(){xe()})}},$o=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],yo=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],Fr=function($t,xe){return $t||xe.isEmpty()?xe.toString():xe.toNumber()},Ro=function($t){var xe=fi($t);return xe.isInvalidate()?null:xe},uo=vt.forwardRef(function(St,$t){var xe,Ue=St.prefixCls,Kt=Ue===void 0?"rc-input-number":Ue,yt=St.className,me=St.style,Ce=St.min,we=St.max,Mt=St.step,ie=Mt===void 0?1:Mt,Re=St.defaultValue,_i=St.value,Qt=St.disabled,ui=St.readOnly,vr=St.upHandler,Mr=St.downHandler,Lr=St.keyboard,gi=St.controls,Ji=gi===void 0?!0:gi,Xi=St.classNames,zr=St.stringMode,ho=St.parser,Tn=St.formatter,Pi=St.precision,os=St.decimalSeparator,qr=St.onChange,bo=St.onInput,he=St.onPressEnter,ss=St.onStep,Aa=(0,le.Z)(St,$o),Bo="".concat(Kt,"-input"),Ma=vt.useRef(null),Lo=vt.useState(!1),Tr=(0,Fe.Z)(Lo,2),yr=Tr[0],$r=Tr[1],dr=vt.useRef(!1),ue=vt.useRef(!1),Wo=vt.useRef(!1),te=vt.useState(function(){return fi(_i!=null?_i:Re)}),Do=(0,Fe.Z)(te,2),Co=Do[0],Io=Do[1];function ea(Tt){_i===void 0&&Io(Tt)}var Nr=vt.useCallback(function(Tt,yn){if(!yn)return Pi>=0?Pi:Math.max(Wt(Tt),Wt(ie))},[Pi,ie]),Xn=vt.useCallback(function(Tt){var yn=String(Tt);if(ho)return ho(yn);var Yn=yn;return os&&(Yn=Yn.replace(os,".")),Yn.replace(/[^\w.-]+/g,"")},[ho,os]),fo=vt.useRef(""),Ys=vt.useCallback(function(Tt,yn){if(Tn)return Tn(Tt,{userTyping:yn,input:String(fo.current)});var Yn=typeof Tt=="number"?kt(Tt):Tt;if(!yn){var Ir=Nr(Yn,yn);if(it(Yn)&&(os||Ir>=0)){var ls=os||".";Yn=_e(Yn,ls,Ir)}}return Yn},[Tn,Nr,os]),Xo=vt.useState(function(){var Tt=Re!=null?Re:_i;return Co.isInvalidate()&&["string","number"].includes((0,ne.Z)(Tt))?Number.isNaN(Tt)?"":Tt:Ys(Co.toString(),!1)}),ci=(0,Fe.Z)(Xo,2),G=ci[0],Wa=ci[1];fo.current=G;function zs(Tt,yn){Wa(Ys(Tt.isInvalidate()?Tt.toString(!1):Tt.toString(!yn),yn))}var Fa=vt.useMemo(function(){return Ro(we)},[we,Pi]),ia=vt.useMemo(function(){return Ro(Ce)},[Ce,Pi]),iu=vt.useMemo(function(){return!Fa||!Co||Co.isInvalidate()?!1:Fa.lessEquals(Co)},[Fa,Co]),Pu=vt.useMemo(function(){return!ia||!Co||Co.isInvalidate()?!1:Co.lessEquals(ia)},[ia,Co]),Th=D(Ma.current,yr),rt=(0,Fe.Z)(Th,2),ut=rt[0],re=rt[1],be=function(yn){return Fa&&!yn.lessEquals(Fa)?Fa:ia&&!ia.lessEquals(yn)?ia:null},Ge=function(yn){return!be(yn)},ni=function(yn,Yn){var Ir=yn,ls=Ge(Ir)||Ir.isEmpty();if(!Ir.isEmpty()&&!Yn&&(Ir=be(Ir)||Ir,ls=!0),!ui&&!Qt&&ls){var Jo=Ir.toString(),ra=Nr(Jo,Yn);return ra>=0&&(Ir=fi(_e(Jo,".",ra)),Ge(Ir)||(Ir=fi(_e(Jo,".",ra,!0)))),Ir.equals(Co)||(ea(Ir),qr==null||qr(Ir.isEmpty()?null:Fr(zr,Ir)),_i===void 0&&zs(Ir,Yn)),Ir}return Co},fe=Go(),un=function Tt(yn){if(ut(),fo.current=yn,Wa(yn),!ue.current){var Yn=Xn(yn),Ir=fi(Yn);Ir.isNaN()||ni(Ir,!0)}bo==null||bo(yn),fe(function(){var ls=yn;ho||(ls=yn.replace(/。/g,".")),ls!==yn&&Tt(ls)})},An=function(){ue.current=!0},xr=function(){ue.current=!1,un(Ma.current.value)},Ur=function(yn){un(yn.target.value)},Zn=function(yn){var Yn;if(!(yn&&iu||!yn&&Pu)){dr.current=!1;var Ir=fi(Wo.current?Se(ie):ie);yn||(Ir=Ir.negate());var ls=(Co||fi(0)).add(Ir.toString()),Jo=ni(ls,!1);ss==null||ss(Fr(zr,Jo),{offset:Wo.current?Se(ie):ie,type:yn?"up":"down"}),(Yn=Ma.current)===null||Yn===void 0||Yn.focus()}},ko=function(yn){var Yn=fi(Xn(G)),Ir=Yn;Yn.isNaN()?Ir=ni(Co,yn):Ir=ni(Yn,yn),_i!==void 0?zs(Co,!1):Ir.isNaN()||zs(Ir,!1)},Yo=function(){dr.current=!0},Oo=function(yn){var Yn=yn.key,Ir=yn.shiftKey;dr.current=!0,Wo.current=Ir,Yn==="Enter"&&(ue.current||(dr.current=!1),ko(!1),he==null||he(yn)),Lr!==!1&&!ue.current&&["Up","ArrowUp","Down","ArrowDown"].includes(Yn)&&(Zn(Yn==="Up"||Yn==="ArrowUp"),yn.preventDefault())},Ms=function(){dr.current=!1,Wo.current=!1},na=function(){ko(!1),$r(!1),dr.current=!1};return pi(function(){Co.isInvalidate()||zs(Co,!1)},[Pi]),pi(function(){var Tt=fi(_i);Io(Tt);var yn=fi(Xn(G));(!Tt.equals(yn)||!dr.current||Tn)&&zs(Tt,dr.current)},[_i]),pi(function(){Tn&&re()},[G]),vt.createElement("div",{className:Y()(Kt,Xi==null?void 0:Xi.input,yt,(xe={},(0,ee.Z)(xe,"".concat(Kt,"-focused"),yr),(0,ee.Z)(xe,"".concat(Kt,"-disabled"),Qt),(0,ee.Z)(xe,"".concat(Kt,"-readonly"),ui),(0,ee.Z)(xe,"".concat(Kt,"-not-a-number"),Co.isNaN()),(0,ee.Z)(xe,"".concat(Kt,"-out-of-range"),!Co.isInvalidate()&&!Ge(Co)),xe)),style:me,onFocus:function(){$r(!0)},onBlur:na,onKeyDown:Oo,onKeyUp:Ms,onCompositionStart:An,onCompositionEnd:xr,onBeforeInput:Yo},Ji&&vt.createElement(rr,{prefixCls:Kt,upNode:vr,downNode:Mr,upDisabled:iu,downDisabled:Pu,onStep:Zn}),vt.createElement("div",{className:"".concat(Bo,"-wrap")},vt.createElement("input",(0,At.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":Ce,"aria-valuemax":we,"aria-valuenow":Co.isInvalidate()?null:Co.toString(),step:ie},Aa,{ref:tt(Ma,$t),className:Bo,value:G,onChange:Ur,disabled:Qt,readOnly:ui}))))}),Ao=vt.forwardRef(function(St,$t){var xe=St.disabled,Ue=St.style,Kt=St.prefixCls,yt=St.value,me=St.prefix,Ce=St.suffix,we=St.addonBefore,Mt=St.addonAfter,ie=St.classes,Re=St.className,_i=St.classNames,Qt=(0,le.Z)(St,yo),ui=vt.useRef(null),vr=function(Lr){ui.current&&(0,We.nH)(ui.current,Lr)};return vt.createElement(Ht.BaseInput,{inputElement:vt.createElement(uo,(0,At.Z)({prefixCls:Kt,disabled:xe,classNames:_i,ref:tt(ui,$t)},Qt)),className:Re,triggerFocus:vr,prefixCls:Kt,value:yt,disabled:xe,style:Ue,prefix:me,suffix:Ce,addonAfter:Mt,addonBefore:we,classes:ie,classNames:_i,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});Ao.displayName="InputNumber";var fs=Ao,Ya=fs,Ja=j(9708),jl=j(53124),Na=j(46735),xo=j(98866),rl=j(98675),Va=j(65223),Kl=j(4173),ga=j(47673),Xs=j(14747),Me=j(80110),L=j(67968),yi=j(45503);const qe=(St,$t)=>{let{componentCls:xe,borderRadiusSM:Ue,borderRadiusLG:Kt}=St;const yt=$t==="lg"?Kt:Ue;return{[`&-${$t}`]:{[`${xe}-handler-wrap`]:{borderStartEndRadius:yt,borderEndEndRadius:yt},[`${xe}-handler-up`]:{borderStartEndRadius:yt},[`${xe}-handler-down`]:{borderEndEndRadius:yt}}}},Si=St=>{const{componentCls:$t,lineWidth:xe,lineType:Ue,colorBorder:Kt,borderRadius:yt,fontSizeLG:me,controlHeightLG:Ce,controlHeightSM:we,colorError:Mt,paddingInlineSM:ie,colorTextDescription:Re,motionDurationMid:_i,handleHoverColor:Qt,paddingInline:ui,paddingBlock:vr,handleBg:Mr,handleActiveBg:Lr,colorTextDisabled:gi,borderRadiusSM:Ji,borderRadiusLG:Xi,controlWidth:zr,handleVisible:ho,handleBorderColor:Tn}=St;return[{[$t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Xs.Wf)(St)),(0,ga.ik)(St)),(0,ga.bi)(St,$t)),{display:"inline-block",width:zr,margin:0,padding:0,border:`${xe}px ${Ue} ${Kt}`,borderRadius:yt,"&-rtl":{direction:"rtl",[`${$t}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:me,borderRadius:Xi,[`input${$t}-input`]:{height:Ce-2*xe}},"&-sm":{padding:0,borderRadius:Ji,[`input${$t}-input`]:{height:we-2*xe,padding:`0 ${ie}px`}},"&:hover":Object.assign({},(0,ga.pU)(St)),"&-focused":Object.assign({},(0,ga.M1)(St)),"&-out-of-range":{[`${$t}-input-wrap`]:{input:{color:Mt}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,Xs.Wf)(St)),(0,ga.s7)(St)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${$t}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${$t}-group-addon`]:{borderRadius:Xi,fontSize:St.fontSizeLG}},"&-sm":{[`${$t}-group-addon`]:{borderRadius:Ji}},[`${$t}-wrapper-disabled > ${$t}-group-addon`]:Object.assign({},(0,ga.Xy)(St))}}),[`&-disabled ${$t}-input`]:{cursor:"not-allowed"},[$t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,Xs.Wf)(St)),{width:"100%",padding:`${vr}px ${ui}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:yt,outline:0,transition:`all ${_i} linear`,appearance:"textfield",fontSize:"inherit"}),(0,ga.nz)(St.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[$t]:Object.assign(Object.assign(Object.assign({[`&:hover ${$t}-handler-wrap, &-focused ${$t}-handler-wrap`]:{opacity:1},[`${$t}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:St.handleWidth,height:"100%",background:Mr,borderStartStartRadius:0,borderStartEndRadius:yt,borderEndEndRadius:yt,borderEndStartRadius:0,opacity:ho===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${_i} linear ${_i}`,[`${$t}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
|
|
|
${$t}-handler-up-inner,
|
|
|
${$t}-handler-down-inner
|
|
|
`]:{marginInlineEnd:0,fontSize:St.handleFontSize}}},[`${$t}-handler`]:{height:"50%",overflow:"hidden",color:Re,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${xe}px ${Ue} ${Tn}`,transition:`all ${_i} linear`,"&:active":{background:Lr},"&:hover":{height:"60%",[`
|
|
|
${$t}-handler-up-inner,
|
|
|
${$t}-handler-down-inner
|
|
|
`]:{color:Qt}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,Xs.Ro)()),{color:Re,transition:`all ${_i} linear`,userSelect:"none"})},[`${$t}-handler-up`]:{borderStartEndRadius:yt},[`${$t}-handler-down`]:{borderBlockStart:`${xe}px ${Ue} ${Tn}`,borderEndEndRadius:yt}},qe(St,"lg")),qe(St,"sm")),{"&-disabled, &-readonly":{[`${$t}-handler-wrap`]:{display:"none"},[`${$t}-input`]:{color:"inherit"}},[`
|
|
|
${$t}-handler-up-disabled,
|
|
|
${$t}-handler-down-disabled
|
|
|
`]:{cursor:"not-allowed"},[`
|
|
|
${$t}-handler-up-disabled:hover &-handler-up-inner,
|
|
|
${$t}-handler-down-disabled:hover &-handler-down-inner
|
|
|
`]:{color:gi}})},{[`${$t}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${$t}-handler-down`]:{borderBlockStartWidth:0}}}]},Vi=St=>{const{componentCls:$t,paddingBlock:xe,paddingInline:Ue,inputAffixPadding:Kt,controlWidth:yt,borderRadiusLG:me,borderRadiusSM:Ce}=St;return{[`${$t}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,ga.ik)(St)),(0,ga.bi)(St,`${$t}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:yt,padding:0,paddingInlineStart:Ue,"&-lg":{borderRadius:me},"&-sm":{borderRadius:Ce},[`&:not(${$t}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,ga.pU)(St)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${$t}-disabled`]:{background:"transparent"},[`> div${$t}`]:{width:"100%",border:"none",outline:"none",[`&${$t}-focused`]:{boxShadow:"none !important"}},[`input${$t}-input`]:{padding:`${xe}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${$t}-handler-wrap`]:{zIndex:2},[$t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:Kt},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Ue,marginInlineStart:Kt}}})}};var ln=(0,L.Z)("InputNumber",St=>{const $t=(0,yi.TS)(St,(0,ga.e5)(St));return[Si($t),Vi($t),(0,Me.c)($t)]},St=>Object.assign(Object.assign({},(0,ga.TM)(St)),{controlWidth:90,handleWidth:St.controlHeightSM-St.lineWidth*2,handleFontSize:St.fontSize/2,handleVisible:"auto",handleActiveBg:St.colorFillAlter,handleBg:St.colorBgContainer,handleHoverColor:St.colorPrimary,handleBorderColor:St.colorBorder})),fr=function(St,$t){var xe={};for(var Ue in St)Object.prototype.hasOwnProperty.call(St,Ue)&&$t.indexOf(Ue)<0&&(xe[Ue]=St[Ue]);if(St!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Kt=0,Ue=Object.getOwnPropertySymbols(St);Kt<Ue.length;Kt++)$t.indexOf(Ue[Kt])<0&&Object.prototype.propertyIsEnumerable.call(St,Ue[Kt])&&(xe[Ue[Kt]]=St[Ue[Kt]]);return xe};const no=vt.forwardRef((St,$t)=>{const{getPrefixCls:xe,direction:Ue}=vt.useContext(jl.E_),Kt=vt.useRef(null);vt.useImperativeHandle($t,()=>Kt.current);const{className:yt,rootClassName:me,size:Ce,disabled:we,prefixCls:Mt,addonBefore:ie,addonAfter:Re,prefix:_i,bordered:Qt=!0,readOnly:ui,status:vr,controls:Mr}=St,Lr=fr(St,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),gi=xe("input-number",Mt),[Ji,Xi]=ln(gi),{compactSize:zr,compactItemClassnames:ho}=(0,Kl.ri)(gi,Ue);let Tn=vt.createElement(ot,{className:`${gi}-handler-up-inner`}),Pi=vt.createElement(Nt.Z,{className:`${gi}-handler-down-inner`});const os=typeof Mr=="boolean"?Mr:void 0;typeof Mr=="object"&&(Tn=typeof Mr.upIcon=="undefined"?Tn:vt.createElement("span",{className:`${gi}-handler-up-inner`},Mr.upIcon),Pi=typeof Mr.downIcon=="undefined"?Pi:vt.createElement("span",{className:`${gi}-handler-down-inner`},Mr.downIcon));const{hasFeedback:qr,status:bo,isFormItemInput:he,feedbackIcon:ss}=vt.useContext(Va.aM),Aa=(0,Ja.F)(bo,vr),Bo=(0,rl.Z)(dr=>{var ue;return(ue=Ce!=null?Ce:zr)!==null&&ue!==void 0?ue:dr}),Ma=vt.useContext(xo.Z),Lo=we!=null?we:Ma,Tr=Y()({[`${gi}-lg`]:Bo==="large",[`${gi}-sm`]:Bo==="small",[`${gi}-rtl`]:Ue==="rtl",[`${gi}-borderless`]:!Qt,[`${gi}-in-form-item`]:he},(0,Ja.Z)(gi,Aa),ho,Xi),yr=`${gi}-group`,$r=vt.createElement(Ya,Object.assign({ref:Kt,disabled:Lo,className:Y()(yt,me),upHandler:Tn,downHandler:Pi,prefixCls:gi,readOnly:ui,controls:os,prefix:_i,suffix:qr&&ss,addonAfter:Re&&vt.createElement(Kl.BR,null,vt.createElement(Va.Ux,{override:!0,status:!0},Re)),addonBefore:ie&&vt.createElement(Kl.BR,null,vt.createElement(Va.Ux,{override:!0,status:!0},ie)),classNames:{input:Tr},classes:{affixWrapper:Y()((0,Ja.Z)(`${gi}-affix-wrapper`,Aa,qr),{[`${gi}-affix-wrapper-sm`]:Bo==="small",[`${gi}-affix-wrapper-lg`]:Bo==="large",[`${gi}-affix-wrapper-rtl`]:Ue==="rtl",[`${gi}-affix-wrapper-borderless`]:!Qt},Xi),wrapper:Y()({[`${yr}-rtl`]:Ue==="rtl",[`${gi}-wrapper-disabled`]:Lo},Xi),group:Y()({[`${gi}-group-wrapper-sm`]:Bo==="small",[`${gi}-group-wrapper-lg`]:Bo==="large",[`${gi}-group-wrapper-rtl`]:Ue==="rtl"},(0,Ja.Z)(`${gi}-group-wrapper`,Aa,qr),Xi)}},Lr));return Ji($r)}),wo=no,ro=St=>vt.createElement(Na.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},vt.createElement(no,Object.assign({},St)));wo._InternalPanelDoNotUseOrYouWillBeFired=ro;var li=wo},82586:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return $e},n:function(){return Q}});var Nt=j(30186),At=j(94184),vt=j.n(At),Et=j(67656),gt=j(17799),ft=j(67294),ct=j(9708),ot=j(53124),F=j(98866),Y=j(98675),ee=j(65223),ne=j(4173),Fe=j(72922),le=j(47673);function Zt(Vt){return!!(Vt.prefix||Vt.suffix||Vt.allowClear)}var zt=function(Vt,Wt){var kt={};for(var it in Vt)Object.prototype.hasOwnProperty.call(Vt,it)&&Wt.indexOf(it)<0&&(kt[it]=Vt[it]);if(Vt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ot=0,it=Object.getOwnPropertySymbols(Vt);Ot<it.length;Ot++)Wt.indexOf(it[Ot])<0&&Object.prototype.propertyIsEnumerable.call(Vt,it[Ot])&&(kt[it[Ot]]=Vt[it[Ot]]);return kt};function Q(Vt,Wt){if(!Vt)return;Vt.focus(Wt);const{cursor:kt}=Wt||{};if(kt){const it=Vt.value.length;switch(kt){case"start":Vt.setSelectionRange(0,0);break;case"end":Vt.setSelectionRange(it,it);break;default:Vt.setSelectionRange(0,it);break}}}var $e=(0,ft.forwardRef)((Vt,Wt)=>{var kt;const{prefixCls:it,bordered:Ot=!0,status:qt,size:Te,disabled:_e,onBlur:fi,onFocus:Ht,suffix:pe,allowClear:Ke,addonAfter:ki,addonBefore:pi,className:Sn,style:Sr,styles:Ki,rootClassName:It,onChange:tt,classNames:de}=Vt,hi=zt(Vt,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Ze,direction:Ye,input:Ae}=ft.useContext(ot.E_),Wi=Ze("input",it),En=(0,ft.useRef)(null),[an,vi]=(0,le.ZP)(Wi),{compactSize:ai,compactItemClassnames:zi}=(0,ne.ri)(Wi,Ye),$i=(0,Y.Z)(rr=>{var Se;return(Se=Te!=null?Te:ai)!==null&&Se!==void 0?Se:rr}),q=ft.useContext(F.Z),D=_e!=null?_e:q,{status:_,hasFeedback:K,feedbackIcon:z}=(0,ft.useContext)(ee.aM),P=(0,ct.F)(_,qt),bt=Zt(Vt)||!!K,Gt=(0,ft.useRef)(bt);(0,ft.useEffect)(()=>{var rr;bt&&Gt.current,Gt.current=bt},[bt]);const Pe=(0,Fe.Z)(En,!0),He=rr=>{Pe(),fi==null||fi(rr)},ei=rr=>{Pe(),Ht==null||Ht(rr)},si=rr=>{Pe(),tt==null||tt(rr)},Gi=(K||pe)&&ft.createElement(ft.Fragment,null,pe,K&&z);let er;return typeof Ke=="object"&&(Ke!=null&&Ke.clearIcon)?er=Ke:Ke&&(er={clearIcon:ft.createElement(Nt.Z,null)}),an(ft.createElement(Et.default,Object.assign({ref:(0,gt.sQ)(Wt,En),prefixCls:Wi,autoComplete:Ae==null?void 0:Ae.autoComplete},hi,{disabled:D,onBlur:He,onFocus:ei,style:Object.assign(Object.assign({},Ae==null?void 0:Ae.style),Sr),styles:Object.assign(Object.assign({},Ae==null?void 0:Ae.styles),Ki),suffix:Gi,allowClear:er,className:vt()(Sn,It,zi,Ae==null?void 0:Ae.className),onChange:si,addonAfter:ki&&ft.createElement(ne.BR,null,ft.createElement(ee.Ux,{override:!0,status:!0},ki)),addonBefore:pi&&ft.createElement(ne.BR,null,ft.createElement(ee.Ux,{override:!0,status:!0},pi)),classNames:Object.assign(Object.assign(Object.assign({},de),Ae==null?void 0:Ae.classNames),{input:vt()({[`${Wi}-sm`]:$i==="small",[`${Wi}-lg`]:$i==="large",[`${Wi}-rtl`]:Ye==="rtl",[`${Wi}-borderless`]:!Ot},!bt&&(0,ct.Z)(Wi,P),de==null?void 0:de.input,(kt=Ae==null?void 0:Ae.classNames)===null||kt===void 0?void 0:kt.input,vi)}),classes:{affixWrapper:vt()({[`${Wi}-affix-wrapper-sm`]:$i==="small",[`${Wi}-affix-wrapper-lg`]:$i==="large",[`${Wi}-affix-wrapper-rtl`]:Ye==="rtl",[`${Wi}-affix-wrapper-borderless`]:!Ot},(0,ct.Z)(`${Wi}-affix-wrapper`,P,K),vi),wrapper:vt()({[`${Wi}-group-rtl`]:Ye==="rtl"},vi),group:vt()({[`${Wi}-group-wrapper-sm`]:$i==="small",[`${Wi}-group-wrapper-lg`]:$i==="large",[`${Wi}-group-wrapper-rtl`]:Ye==="rtl",[`${Wi}-group-wrapper-disabled`]:D},(0,ct.Z)(`${Wi}-group-wrapper`,P,K),vi)}})))})},96330:function(Wr,Ti,j){"use strict";var Nt=j(30186),At=j(94184),vt=j.n(At),Et=j(64701),gt=j(67294),ft=j(9708),ct=j(53124),ot=j(98866),F=j(98675),Y=j(65223),ee=j(82586),ne=j(47673),Fe=function(Zt,zt){var Q={};for(var se in Zt)Object.prototype.hasOwnProperty.call(Zt,se)&&zt.indexOf(se)<0&&(Q[se]=Zt[se]);if(Zt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,se=Object.getOwnPropertySymbols(Zt);$e<se.length;$e++)zt.indexOf(se[$e])<0&&Object.prototype.propertyIsEnumerable.call(Zt,se[$e])&&(Q[se[$e]]=Zt[se[$e]]);return Q};const le=(0,gt.forwardRef)((Zt,zt)=>{const{prefixCls:Q,bordered:se=!0,size:$e,disabled:Vt,status:Wt,allowClear:kt,showCount:it,classNames:Ot,rootClassName:qt,className:Te}=Zt,_e=Fe(Zt,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:fi,direction:Ht}=gt.useContext(ct.E_),pe=(0,F.Z)($e),Ke=gt.useContext(ot.Z),ki=Vt!=null?Vt:Ke,{status:pi,hasFeedback:Sn,feedbackIcon:Sr}=gt.useContext(Y.aM),Ki=(0,ft.F)(pi,Wt),It=gt.useRef(null);gt.useImperativeHandle(zt,()=>{var Ye;return{resizableTextArea:(Ye=It.current)===null||Ye===void 0?void 0:Ye.resizableTextArea,focus:Ae=>{var Wi,En;(0,ee.n)((En=(Wi=It.current)===null||Wi===void 0?void 0:Wi.resizableTextArea)===null||En===void 0?void 0:En.textArea,Ae)},blur:()=>{var Ae;return(Ae=It.current)===null||Ae===void 0?void 0:Ae.blur()}}});const tt=fi("input",Q);let de;typeof kt=="object"&&(kt!=null&&kt.clearIcon)?de=kt:kt&&(de={clearIcon:gt.createElement(Nt.Z,null)});const[hi,Ze]=(0,ne.ZP)(tt);return hi(gt.createElement(Et.default,Object.assign({},_e,{disabled:ki,allowClear:de,className:vt()(Te,qt),classes:{affixWrapper:vt()(`${tt}-textarea-affix-wrapper`,{[`${tt}-affix-wrapper-rtl`]:Ht==="rtl",[`${tt}-affix-wrapper-borderless`]:!se,[`${tt}-affix-wrapper-sm`]:pe==="small",[`${tt}-affix-wrapper-lg`]:pe==="large",[`${tt}-textarea-show-count`]:it},(0,ft.Z)(`${tt}-affix-wrapper`,Ki),Ze)},classNames:Object.assign(Object.assign({},Ot),{textarea:vt()({[`${tt}-borderless`]:!se,[`${tt}-sm`]:pe==="small",[`${tt}-lg`]:pe==="large"},(0,ft.Z)(tt,Ki),Ze,Ot==null?void 0:Ot.textarea)}),prefixCls:tt,suffix:Sn&>.createElement("span",{className:`${tt}-textarea-suffix`},Sr),showCount:it,ref:It})))});Ti.Z=le},72922:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return At}});var Nt=j(67294);function At(vt,Et){const gt=(0,Nt.useRef)([]),ft=()=>{gt.current.push(setTimeout(()=>{var ct,ot,F,Y;!((ct=vt.current)===null||ct===void 0)&&ct.input&&((ot=vt.current)===null||ot===void 0?void 0:ot.input.getAttribute("type"))==="password"&&(!((F=vt.current)===null||F===void 0)&&F.input.hasAttribute("value"))&&((Y=vt.current)===null||Y===void 0||Y.input.removeAttribute("value"))}))};return(0,Nt.useEffect)(()=>(Et&&ft(),()=>gt.current.forEach(ct=>{ct&&clearTimeout(ct)})),[]),ft}},11486:function(Wr,Ti,j){"use strict";j.d(Ti,{default:function(){return Sr}});var Nt=j(94184),At=j.n(Nt),vt=j(67294),Et=j(53124),gt=j(65223),ft=j(47673),ot=Ki=>{const{getPrefixCls:It,direction:tt}=(0,vt.useContext)(Et.E_),{prefixCls:de,className:hi}=Ki,Ze=It("input-group",de),Ye=It("input"),[Ae,Wi]=(0,ft.ZP)(Ye),En=At()(Ze,{[`${Ze}-lg`]:Ki.size==="large",[`${Ze}-sm`]:Ki.size==="small",[`${Ze}-compact`]:Ki.compact,[`${Ze}-rtl`]:tt==="rtl"},Wi,hi),an=(0,vt.useContext)(gt.aM),vi=(0,vt.useMemo)(()=>Object.assign(Object.assign({},an),{isFormItemInput:!1}),[an]);return Ae(vt.createElement("span",{className:En,style:Ki.style,onMouseEnter:Ki.onMouseEnter,onMouseLeave:Ki.onMouseLeave,onFocus:Ki.onFocus,onBlur:Ki.onBlur},vt.createElement(gt.aM.Provider,{value:vi},Ki.children)))},F=j(82586),Y=j(87462),ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},ne=ee,Fe=j(44327),le=function(It,tt){return vt.createElement(Fe.Z,(0,Y.Z)({},It,{ref:tt,icon:ne}))},Zt=vt.forwardRef(le),zt=j(43481),Q=j(10366),se=j(17799),$e=j(72922),Vt=function(Ki,It){var tt={};for(var de in Ki)Object.prototype.hasOwnProperty.call(Ki,de)&&It.indexOf(de)<0&&(tt[de]=Ki[de]);if(Ki!=null&&typeof Object.getOwnPropertySymbols=="function")for(var hi=0,de=Object.getOwnPropertySymbols(Ki);hi<de.length;hi++)It.indexOf(de[hi])<0&&Object.prototype.propertyIsEnumerable.call(Ki,de[hi])&&(tt[de[hi]]=Ki[de[hi]]);return tt};const Wt=Ki=>Ki?vt.createElement(zt.Z,null):vt.createElement(Zt,null),kt={click:"onClick",hover:"onMouseOver"};var Ot=vt.forwardRef((Ki,It)=>{const{visibilityToggle:tt=!0}=Ki,de=typeof tt=="object"&&tt.visible!==void 0,[hi,Ze]=(0,vt.useState)(()=>de?tt.visible:!1),Ye=(0,vt.useRef)(null);vt.useEffect(()=>{de&&Ze(tt.visible)},[de,tt]);const Ae=(0,$e.Z)(Ye),Wi=()=>{const{disabled:bt}=Ki;bt||(hi&&Ae(),Ze(Gt=>{var Pe;const He=!Gt;return typeof tt=="object"&&((Pe=tt.onVisibleChange)===null||Pe===void 0||Pe.call(tt,He)),He}))},En=bt=>{const{action:Gt="click",iconRender:Pe=Wt}=Ki,He=kt[Gt]||"",ei=Pe(hi),si={[He]:Wi,className:`${bt}-icon`,key:"passwordIcon",onMouseDown:Gi=>{Gi.preventDefault()},onMouseUp:Gi=>{Gi.preventDefault()}};return vt.cloneElement(vt.isValidElement(ei)?ei:vt.createElement("span",null,ei),si)},{className:an,prefixCls:vi,inputPrefixCls:ai,size:zi}=Ki,$i=Vt(Ki,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:q}=vt.useContext(Et.E_),D=q("input",ai),_=q("input-password",vi),K=tt&&En(_),z=At()(_,an,{[`${_}-${zi}`]:!!zi}),P=Object.assign(Object.assign({},(0,Q.Z)($i,["suffix","iconRender","visibilityToggle"])),{type:hi?"text":"password",className:z,prefixCls:D,suffix:K});return zi&&(P.size=zi),vt.createElement(F.Z,Object.assign({ref:(0,se.sQ)(It,Ye)},P))}),qt=j(47880),Te=j(96159),_e=j(71577),fi=j(98675),Ht=j(4173),pe=function(Ki,It){var tt={};for(var de in Ki)Object.prototype.hasOwnProperty.call(Ki,de)&&It.indexOf(de)<0&&(tt[de]=Ki[de]);if(Ki!=null&&typeof Object.getOwnPropertySymbols=="function")for(var hi=0,de=Object.getOwnPropertySymbols(Ki);hi<de.length;hi++)It.indexOf(de[hi])<0&&Object.prototype.propertyIsEnumerable.call(Ki,de[hi])&&(tt[de[hi]]=Ki[de[hi]]);return tt},ki=vt.forwardRef((Ki,It)=>{const{prefixCls:tt,inputPrefixCls:de,className:hi,size:Ze,suffix:Ye,enterButton:Ae=!1,addonAfter:Wi,loading:En,disabled:an,onSearch:vi,onChange:ai,onCompositionStart:zi,onCompositionEnd:$i}=Ki,q=pe(Ki,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:D,direction:_}=vt.useContext(Et.E_),K=vt.useRef(!1),z=D("input-search",tt),P=D("input",de),{compactSize:bt}=(0,Ht.ri)(z,_),Gt=(0,fi.Z)(Ro=>{var uo;return(uo=Ze!=null?Ze:bt)!==null&&uo!==void 0?uo:Ro}),Pe=vt.useRef(null),He=Ro=>{Ro&&Ro.target&&Ro.type==="click"&&vi&&vi(Ro.target.value,Ro,{source:"clear"}),ai&&ai(Ro)},ei=Ro=>{var uo;document.activeElement===((uo=Pe.current)===null||uo===void 0?void 0:uo.input)&&Ro.preventDefault()},si=Ro=>{var uo,Ao;vi&&vi((Ao=(uo=Pe.current)===null||uo===void 0?void 0:uo.input)===null||Ao===void 0?void 0:Ao.value,Ro,{source:"input"})},Gi=Ro=>{K.current||En||si(Ro)},er=typeof Ae=="boolean"?vt.createElement(qt.Z,null):null,rr=`${z}-button`;let Se;const We=Ae||{},Go=We.type&&We.type.__ANT_BUTTON===!0;Go||We.type==="button"?Se=(0,Te.Tm)(We,Object.assign({onMouseDown:ei,onClick:Ro=>{var uo,Ao;(Ao=(uo=We==null?void 0:We.props)===null||uo===void 0?void 0:uo.onClick)===null||Ao===void 0||Ao.call(uo,Ro),si(Ro)},key:"enterButton"},Go?{className:rr,size:Gt}:{})):Se=vt.createElement(_e.ZP,{className:rr,type:Ae?"primary":void 0,size:Gt,disabled:an,key:"enterButton",onMouseDown:ei,onClick:si,loading:En,icon:er},Ae),Wi&&(Se=[Se,(0,Te.Tm)(Wi,{key:"addonAfter"})]);const $o=At()(z,{[`${z}-rtl`]:_==="rtl",[`${z}-${Gt}`]:!!Gt,[`${z}-with-button`]:!!Ae},hi),yo=Ro=>{K.current=!0,zi==null||zi(Ro)},Fr=Ro=>{K.current=!1,$i==null||$i(Ro)};return vt.createElement(F.Z,Object.assign({ref:(0,se.sQ)(Pe,It),onPressEnter:Gi},q,{size:Gt,onCompositionStart:yo,onCompositionEnd:Fr,prefixCls:P,addonAfter:Se,suffix:Ye,onChange:He,className:$o,disabled:an}))}),pi=j(96330);const Sn=F.Z;Sn.Group=ot,Sn.Search=ki,Sn.TextArea=pi.Z,Sn.Password=Ot;var Sr=Sn},47673:function(Wr,Ti,j){"use strict";j.d(Ti,{M1:function(){return ct},TM:function(){return Wt},Xy:function(){return ot},bi:function(){return ee},e5:function(){return Vt},ik:function(){return ne},nz:function(){return gt},pU:function(){return ft},s7:function(){return Fe},x0:function(){return Y}});var Nt=j(14747),At=j(80110),vt=j(45503),Et=j(67968);const gt=kt=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:kt,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),ft=kt=>({borderColor:kt.hoverBorderColor}),ct=kt=>({borderColor:kt.activeBorderColor,boxShadow:kt.activeShadow,outline:0}),ot=kt=>({color:kt.colorTextDisabled,backgroundColor:kt.colorBgContainerDisabled,borderColor:kt.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},ft((0,vt.TS)(kt,{hoverBorderColor:kt.colorBorder})))}),F=kt=>{const{paddingBlockLG:it,fontSizeLG:Ot,lineHeightLG:qt,borderRadiusLG:Te,paddingInlineLG:_e}=kt;return{padding:`${it}px ${_e}px`,fontSize:Ot,lineHeight:qt,borderRadius:Te}},Y=kt=>({padding:`${kt.paddingBlockSM}px ${kt.paddingInlineSM}px`,borderRadius:kt.borderRadiusSM}),ee=(kt,it)=>{const{componentCls:Ot,colorError:qt,colorWarning:Te,errorActiveShadow:_e,warningActiveShadow:fi,colorErrorBorderHover:Ht,colorWarningBorderHover:pe}=kt;return{[`&-status-error:not(${it}-disabled):not(${it}-borderless)${it}`]:{borderColor:qt,"&:hover":{borderColor:Ht},"&:focus, &-focused":Object.assign({},ct((0,vt.TS)(kt,{activeBorderColor:qt,activeShadow:_e}))),[`${Ot}-prefix, ${Ot}-suffix`]:{color:qt}},[`&-status-warning:not(${it}-disabled):not(${it}-borderless)${it}`]:{borderColor:Te,"&:hover":{borderColor:pe},"&:focus, &-focused":Object.assign({},ct((0,vt.TS)(kt,{activeBorderColor:Te,activeShadow:fi}))),[`${Ot}-prefix, ${Ot}-suffix`]:{color:Te}}}},ne=kt=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${kt.paddingBlock}px ${kt.paddingInline}px`,color:kt.colorText,fontSize:kt.fontSize,lineHeight:kt.lineHeight,backgroundColor:kt.colorBgContainer,backgroundImage:"none",borderWidth:kt.lineWidth,borderStyle:kt.lineType,borderColor:kt.colorBorder,borderRadius:kt.borderRadius,transition:`all ${kt.motionDurationMid}`},gt(kt.colorTextPlaceholder)),{"&:hover":Object.assign({},ft(kt)),"&:focus, &-focused":Object.assign({},ct(kt)),"&-disabled, &[disabled]":Object.assign({},ot(kt)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:kt.controlHeight,lineHeight:kt.lineHeight,verticalAlign:"bottom",transition:`all ${kt.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},F(kt)),"&-sm":Object.assign({},Y(kt)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),Fe=kt=>{const{componentCls:it,antCls:Ot}=kt;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:kt.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${it}, &-lg > ${it}-group-addon`]:Object.assign({},F(kt)),[`&-sm ${it}, &-sm > ${it}-group-addon`]:Object.assign({},Y(kt)),[`&-lg ${Ot}-select-single ${Ot}-select-selector`]:{height:kt.controlHeightLG},[`&-sm ${Ot}-select-single ${Ot}-select-selector`]:{height:kt.controlHeightSM},[`> ${it}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${it}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${kt.paddingInline}px`,color:kt.colorText,fontWeight:"normal",fontSize:kt.fontSize,textAlign:"center",backgroundColor:kt.colorFillAlter,border:`${kt.lineWidth}px ${kt.lineType} ${kt.colorBorder}`,borderRadius:kt.borderRadius,transition:`all ${kt.motionDurationSlow}`,lineHeight:1,[`${Ot}-select`]:{margin:`-${kt.paddingBlock+1}px -${kt.paddingInline}px`,[`&${Ot}-select-single:not(${Ot}-select-customize-input)`]:{[`${Ot}-select-selector`]:{backgroundColor:"inherit",border:`${kt.lineWidth}px ${kt.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Ot}-select-selector`]:{color:kt.colorPrimary}}},[`${Ot}-cascader-picker`]:{margin:`-9px -${kt.paddingInline}px`,backgroundColor:"transparent",[`${Ot}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${it}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${it}-search-with-button &`]:{zIndex:0}}},[`> ${it}:first-child, ${it}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ot}-select ${Ot}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${it}-affix-wrapper`]:{[`&:not(:first-child) ${it}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${it}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${it}:last-child, ${it}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Ot}-select ${Ot}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${it}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${it}-search &`]:{borderStartStartRadius:kt.borderRadius,borderEndStartRadius:kt.borderRadius}},[`&:not(:first-child), ${it}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${it}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,Nt.dF)()),{[`${it}-group-addon, ${it}-group-wrap, > ${it}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:kt.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
|
& > ${it}-affix-wrapper,
|
|
|
& > ${it}-number-affix-wrapper,
|
|
|
& > ${Ot}-picker-range
|
|
|
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-kt.lineWidth,borderInlineEndWidth:kt.lineWidth},[`${it}`]:{float:"none"},[`& > ${Ot}-select > ${Ot}-select-selector,
|
|
|
& > ${Ot}-select-auto-complete ${it},
|
|
|
& > ${Ot}-cascader-picker ${it},
|
|
|
& > ${it}-group-wrapper ${it}`]:{borderInlineEndWidth:kt.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Ot}-select-focused`]:{zIndex:1},[`& > ${Ot}-select > ${Ot}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
|
& > ${Ot}-select:first-child > ${Ot}-select-selector,
|
|
|
& > ${Ot}-select-auto-complete:first-child ${it},
|
|
|
& > ${Ot}-cascader-picker:first-child ${it}`]:{borderStartStartRadius:kt.borderRadius,borderEndStartRadius:kt.borderRadius},[`& > *:last-child,
|
|
|
& > ${Ot}-select:last-child > ${Ot}-select-selector,
|
|
|
& > ${Ot}-cascader-picker:last-child ${it},
|
|
|
& > ${Ot}-cascader-picker-focused:last-child ${it}`]:{borderInlineEndWidth:kt.lineWidth,borderStartEndRadius:kt.borderRadius,borderEndEndRadius:kt.borderRadius},[`& > ${Ot}-select-auto-complete ${it}`]:{verticalAlign:"top"},[`${it}-group-wrapper + ${it}-group-wrapper`]:{marginInlineStart:-kt.lineWidth,[`${it}-affix-wrapper`]:{borderRadius:0}},[`${it}-group-wrapper:not(:last-child)`]:{[`&${it}-search > ${it}-group`]:{[`& > ${it}-group-addon > ${it}-search-button`]:{borderRadius:0},[`& > ${it}`]:{borderStartStartRadius:kt.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:kt.borderRadius}}}})}},le=kt=>{const{componentCls:it,controlHeightSM:Ot,lineWidth:qt}=kt,_e=(Ot-qt*2-16)/2;return{[it]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Nt.Wf)(kt)),ne(kt)),ee(kt,it)),{'&[type="color"]':{height:kt.controlHeight,[`&${it}-lg`]:{height:kt.controlHeightLG},[`&${it}-sm`]:{height:Ot,paddingTop:_e,paddingBottom:_e}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},Zt=kt=>{const{componentCls:it}=kt;return{[`${it}-clear-icon`]:{margin:0,color:kt.colorTextQuaternary,fontSize:kt.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${kt.motionDurationSlow}`,"&:hover":{color:kt.colorTextTertiary},"&:active":{color:kt.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${kt.inputAffixPadding}px`}}}},zt=kt=>{const{componentCls:it,inputAffixPadding:Ot,colorTextDescription:qt,motionDurationSlow:Te,colorIcon:_e,colorIconHover:fi,iconCls:Ht}=kt;return{[`${it}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ne(kt)),{display:"inline-flex",[`&:not(${it}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},ft(kt)),{zIndex:1,[`${it}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${it}[disabled]`]:{background:"transparent"}},[`> input${it}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${it}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:kt.paddingXS}},"&-show-count-suffix":{color:qt},"&-show-count-has-suffix":{marginInlineEnd:kt.paddingXXS},"&-prefix":{marginInlineEnd:Ot},"&-suffix":{marginInlineStart:Ot}}}),Zt(kt)),{[`${Ht}${it}-password-icon`]:{color:_e,cursor:"pointer",transition:`all ${Te}`,"&:hover":{color:fi}}}),ee(kt,`${it}-affix-wrapper`))}},Q=kt=>{const{componentCls:it,colorError:Ot,colorWarning:qt,borderRadiusLG:Te,borderRadiusSM:_e}=kt;return{[`${it}-group`]:Object.assign(Object.assign(Object.assign({},(0,Nt.Wf)(kt)),Fe(kt)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${it}-group-addon`]:{borderRadius:Te,fontSize:kt.fontSizeLG}},"&-sm":{[`${it}-group-addon`]:{borderRadius:_e}},"&-status-error":{[`${it}-group-addon`]:{color:Ot,borderColor:Ot}},"&-status-warning":{[`${it}-group-addon`]:{color:qt,borderColor:qt}},"&-disabled":{[`${it}-group-addon`]:Object.assign({},ot(kt))},[`&:not(${it}-compact-first-item):not(${it}-compact-last-item)${it}-compact-item`]:{[`${it}, ${it}-group-addon`]:{borderRadius:0}},[`&:not(${it}-compact-last-item)${it}-compact-first-item`]:{[`${it}, ${it}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${it}-compact-first-item)${it}-compact-last-item`]:{[`${it}, ${it}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},se=kt=>{const{componentCls:it,antCls:Ot}=kt,qt=`${it}-search`;return{[qt]:{[`${it}`]:{"&:hover, &:focus":{borderColor:kt.colorPrimaryHover,[`+ ${it}-group-addon ${qt}-button:not(${Ot}-btn-primary)`]:{borderInlineStartColor:kt.colorPrimaryHover}}},[`${it}-affix-wrapper`]:{borderRadius:0},[`${it}-lg`]:{lineHeight:kt.lineHeightLG-2e-4},[`> ${it}-group`]:{[`> ${it}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${qt}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:kt.borderRadius,borderEndEndRadius:kt.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${qt}-button:not(${Ot}-btn-primary)`]:{color:kt.colorTextDescription,"&:hover":{color:kt.colorPrimaryHover},"&:active":{color:kt.colorPrimaryActive},[`&${Ot}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${qt}-button`]:{height:kt.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${qt}-button`]:{height:kt.controlHeightLG},[`&-small ${qt}-button`]:{height:kt.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${it}-compact-item`]:{[`&:not(${it}-compact-last-item)`]:{[`${it}-group-addon`]:{[`${it}-search-button`]:{marginInlineEnd:-kt.lineWidth,borderRadius:0}}},[`&:not(${it}-compact-first-item)`]:{[`${it},${it}-affix-wrapper`]:{borderRadius:0}},[`> ${it}-group-addon ${it}-search-button,
|
|
|
> ${it},
|
|
|
${it}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${it}-affix-wrapper-focused`]:{zIndex:2}}}}},$e=kt=>{const{componentCls:it,paddingLG:Ot}=kt,qt=`${it}-textarea`;return{[qt]:{position:"relative","&-show-count":{[`> ${it}`]:{height:"100%"},[`${it}-data-count`]:{position:"absolute",bottom:-kt.fontSize*kt.lineHeight,insetInlineEnd:0,color:kt.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${it}`]:{paddingInlineEnd:Ot}},[`&-affix-wrapper${qt}-has-feedback`]:{[`${it}`]:{paddingInlineEnd:Ot}},[`&-affix-wrapper${it}-affix-wrapper`]:{padding:0,[`> textarea${it}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${it}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${it}-clear-icon`]:{position:"absolute",insetInlineEnd:kt.paddingXS,insetBlockStart:kt.paddingXS},[`${qt}-suffix`]:{position:"absolute",top:0,insetInlineEnd:kt.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function Vt(kt){return(0,vt.TS)(kt,{inputAffixPadding:kt.paddingXXS})}const Wt=kt=>{const{controlHeight:it,fontSize:Ot,lineHeight:qt,lineWidth:Te,controlHeightSM:_e,controlHeightLG:fi,fontSizeLG:Ht,lineHeightLG:pe,paddingSM:Ke,controlPaddingHorizontalSM:ki,controlPaddingHorizontal:pi,colorFillAlter:Sn,colorPrimaryHover:Sr,controlOutlineWidth:Ki,controlOutline:It,colorErrorOutline:tt,colorWarningOutline:de}=kt;return{paddingBlock:Math.max(Math.round((it-Ot*qt)/2*10)/10-Te,3),paddingBlockSM:Math.max(Math.round((_e-Ot*qt)/2*10)/10-Te,0),paddingBlockLG:Math.ceil((fi-Ht*pe)/2*10)/10-Te,paddingInline:Ke-Te,paddingInlineSM:ki-Te,paddingInlineLG:pi-Te,addonBg:Sn,activeBorderColor:Sr,hoverBorderColor:Sr,activeShadow:`0 0 0 ${Ki}px ${It}`,errorActiveShadow:`0 0 0 ${Ki}px ${tt}`,warningActiveShadow:`0 0 0 ${Ki}px ${de}`}};Ti.ZP=(0,Et.Z)("Input",kt=>{const it=(0,vt.TS)(kt,Vt(kt));return[le(it),$e(it),zt(it),Q(it),se(it),(0,At.c)(it)]},Wt)},78045:function(Wr,Ti,j){"use strict";j.d(Ti,{ZP:function(){return It}});var Nt=j(94184),At=j.n(Nt),vt=j(5663),Et=j(1337),gt=j(67294),ft=j(53124),ct=j(98675);const ot=gt.createContext(null),F=ot.Provider;var Y=ot;const ee=gt.createContext(null),ne=ee.Provider;var Fe=j(95860),le=j(17799),Zt=j(98866),zt=j(65223),Q=j(14747),se=j(67968),$e=j(45503);const Vt=tt=>{const{componentCls:de,antCls:hi}=tt,Ze=`${de}-group`;return{[Ze]:Object.assign(Object.assign({},(0,Q.Wf)(tt)),{display:"inline-block",fontSize:0,[`&${Ze}-rtl`]:{direction:"rtl"},[`${hi}-badge ${hi}-badge-count`]:{zIndex:1},[`> ${hi}-badge:not(:first-child) > ${hi}-button-wrapper`]:{borderInlineStart:"none"}})}},Wt=tt=>{const{componentCls:de,wrapperMarginInlineEnd:hi,colorPrimary:Ze,radioSize:Ye,motionDurationSlow:Ae,motionDurationMid:Wi,motionEaseInOutCirc:En,colorBgContainer:an,colorBorder:vi,lineWidth:ai,dotSize:zi,colorBgContainerDisabled:$i,colorTextDisabled:q,paddingXS:D,dotColorDisabled:_,lineType:K,radioDotDisabledSize:z,wireframe:P,colorWhite:bt}=tt,Gt=`${de}-inner`;return{[`${de}-wrapper`]:Object.assign(Object.assign({},(0,Q.Wf)(tt)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:hi,cursor:"pointer",[`&${de}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:tt.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${de}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${ai}px ${K} ${Ze}`,borderRadius:"50%",visibility:"hidden",content:'""'},[de]:Object.assign(Object.assign({},(0,Q.Wf)(tt)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${de}-wrapper:hover &,
|
|
|
&:hover ${Gt}`]:{borderColor:Ze},[`${de}-input:focus-visible + ${Gt}`]:Object.assign({},(0,Q.oN)(tt)),[`${de}:hover::after, ${de}-wrapper:hover &::after`]:{visibility:"visible"},[`${de}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:Ye,height:Ye,marginBlockStart:Ye/-2,marginInlineStart:Ye/-2,backgroundColor:P?Ze:bt,borderBlockStart:0,borderInlineStart:0,borderRadius:Ye,transform:"scale(0)",opacity:0,transition:`all ${Ae} ${En}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:Ye,height:Ye,backgroundColor:an,borderColor:vi,borderStyle:"solid",borderWidth:ai,borderRadius:"50%",transition:`all ${Wi}`},[`${de}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${de}-checked`]:{[Gt]:{borderColor:Ze,backgroundColor:P?an:Ze,"&::after":{transform:`scale(${zi/Ye})`,opacity:1,transition:`all ${Ae} ${En}`}}},[`${de}-disabled`]:{cursor:"not-allowed",[Gt]:{backgroundColor:$i,borderColor:vi,cursor:"not-allowed","&::after":{backgroundColor:_}},[`${de}-input`]:{cursor:"not-allowed"},[`${de}-disabled + span`]:{color:q,cursor:"not-allowed"},[`&${de}-checked`]:{[Gt]:{"&::after":{transform:`scale(${z/Ye})`}}}},[`span${de} + *`]:{paddingInlineStart:D,paddingInlineEnd:D}})}},kt=tt=>{const{buttonColor:de,controlHeight:hi,componentCls:Ze,lineWidth:Ye,lineType:Ae,colorBorder:Wi,motionDurationSlow:En,motionDurationMid:an,buttonPaddingInline:vi,fontSize:ai,buttonBg:zi,fontSizeLG:$i,controlHeightLG:q,controlHeightSM:D,paddingXS:_,borderRadius:K,borderRadiusSM:z,borderRadiusLG:P,buttonCheckedBg:bt,buttonSolidCheckedColor:Gt,colorTextDisabled:Pe,colorBgContainerDisabled:He,buttonCheckedBgDisabled:ei,buttonCheckedColorDisabled:si,colorPrimary:Gi,colorPrimaryHover:er,colorPrimaryActive:rr,buttonSolidCheckedBg:Se,buttonSolidCheckedHoverBg:We,buttonSolidCheckedActiveBg:Go}=tt;return{[`${Ze}-button-wrapper`]:{position:"relative",display:"inline-block",height:hi,margin:0,paddingInline:vi,paddingBlock:0,color:de,fontSize:ai,lineHeight:`${hi-Ye*2}px`,background:zi,border:`${Ye}px ${Ae} ${Wi}`,borderBlockStartWidth:Ye+.02,borderInlineStartWidth:0,borderInlineEndWidth:Ye,cursor:"pointer",transition:[`color ${an}`,`background ${an}`,`box-shadow ${an}`].join(","),a:{color:de},[`> ${Ze}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-Ye,insetInlineStart:-Ye,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:Ye,paddingInline:0,backgroundColor:Wi,transition:`background-color ${En}`,content:'""'}},"&:first-child":{borderInlineStart:`${Ye}px ${Ae} ${Wi}`,borderStartStartRadius:K,borderEndStartRadius:K},"&:last-child":{borderStartEndRadius:K,borderEndEndRadius:K},"&:first-child:last-child":{borderRadius:K},[`${Ze}-group-large &`]:{height:q,fontSize:$i,lineHeight:`${q-Ye*2}px`,"&:first-child":{borderStartStartRadius:P,borderEndStartRadius:P},"&:last-child":{borderStartEndRadius:P,borderEndEndRadius:P}},[`${Ze}-group-small &`]:{height:D,paddingInline:_-Ye,paddingBlock:0,lineHeight:`${D-Ye*2}px`,"&:first-child":{borderStartStartRadius:z,borderEndStartRadius:z},"&:last-child":{borderStartEndRadius:z,borderEndEndRadius:z}},"&:hover":{position:"relative",color:Gi},"&:has(:focus-visible)":Object.assign({},(0,Q.oN)(tt)),[`${Ze}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Ze}-button-wrapper-disabled)`]:{zIndex:1,color:Gi,background:bt,borderColor:Gi,"&::before":{backgroundColor:Gi},"&:first-child":{borderColor:Gi},"&:hover":{color:er,borderColor:er,"&::before":{backgroundColor:er}},"&:active":{color:rr,borderColor:rr,"&::before":{backgroundColor:rr}}},[`${Ze}-group-solid &-checked:not(${Ze}-button-wrapper-disabled)`]:{color:Gt,background:Se,borderColor:Se,"&:hover":{color:Gt,background:We,borderColor:We},"&:active":{color:Gt,background:Go,borderColor:Go}},"&-disabled":{color:Pe,backgroundColor:He,borderColor:Wi,cursor:"not-allowed","&:first-child, &:hover":{color:Pe,backgroundColor:He,borderColor:Wi}},[`&-disabled${Ze}-button-wrapper-checked`]:{color:si,backgroundColor:ei,borderColor:Wi,boxShadow:"none"}}}},it=tt=>tt-4*2;var Ot=(0,se.Z)("Radio",tt=>{const{controlOutline:de,controlOutlineWidth:hi,radioSize:Ze}=tt,Ye=`0 0 0 ${hi}px ${de}`,Ae=Ye,Wi=it(Ze),En=(0,$e.TS)(tt,{radioDotDisabledSize:Wi,radioFocusShadow:Ye,radioButtonFocusShadow:Ae});return[Vt(En),Wt(En),kt(En)]},tt=>{const{wireframe:de,padding:hi,marginXS:Ze,lineWidth:Ye,fontSizeLG:Ae,colorText:Wi,colorBgContainer:En,colorTextDisabled:an,controlItemBgActiveDisabled:vi,colorTextLightSolid:ai,colorPrimary:zi,colorPrimaryHover:$i,colorPrimaryActive:q}=tt,D=4,_=Ae,K=de?it(_):_-(D+Ye)*2;return{radioSize:_,dotSize:K,dotColorDisabled:an,buttonSolidCheckedColor:ai,buttonSolidCheckedBg:zi,buttonSolidCheckedHoverBg:$i,buttonSolidCheckedActiveBg:q,buttonBg:En,buttonCheckedBg:En,buttonColor:Wi,buttonCheckedBgDisabled:vi,buttonCheckedColorDisabled:an,buttonPaddingInline:hi-Ye,wrapperMarginInlineEnd:Ze}}),qt=j(45353),Te=j(92429),_e=function(tt,de){var hi={};for(var Ze in tt)Object.prototype.hasOwnProperty.call(tt,Ze)&&de.indexOf(Ze)<0&&(hi[Ze]=tt[Ze]);if(tt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ye=0,Ze=Object.getOwnPropertySymbols(tt);Ye<Ze.length;Ye++)de.indexOf(Ze[Ye])<0&&Object.prototype.propertyIsEnumerable.call(tt,Ze[Ye])&&(hi[Ze[Ye]]=tt[Ze[Ye]]);return hi};const fi=(tt,de)=>{var hi,Ze;const Ye=gt.useContext(Y),Ae=gt.useContext(ee),{getPrefixCls:Wi,direction:En,radio:an}=gt.useContext(ft.E_),vi=gt.useRef(null),ai=(0,le.sQ)(de,vi),{isFormItemInput:zi}=gt.useContext(zt.aM),$i=rr=>{var Se,We;(Se=tt.onChange)===null||Se===void 0||Se.call(tt,rr),(We=Ye==null?void 0:Ye.onChange)===null||We===void 0||We.call(Ye,rr)},{prefixCls:q,className:D,rootClassName:_,children:K,style:z}=tt,P=_e(tt,["prefixCls","className","rootClassName","children","style"]),bt=Wi("radio",q),Gt=((Ye==null?void 0:Ye.optionType)||Ae)==="button",Pe=Gt?`${bt}-button`:bt,[He,ei]=Ot(bt),si=Object.assign({},P),Gi=gt.useContext(Zt.Z);Ye&&(si.name=Ye.name,si.onChange=$i,si.checked=tt.value===Ye.value,si.disabled=(hi=si.disabled)!==null&&hi!==void 0?hi:Ye.disabled),si.disabled=(Ze=si.disabled)!==null&&Ze!==void 0?Ze:Gi;const er=At()(`${Pe}-wrapper`,{[`${Pe}-wrapper-checked`]:si.checked,[`${Pe}-wrapper-disabled`]:si.disabled,[`${Pe}-wrapper-rtl`]:En==="rtl",[`${Pe}-wrapper-in-form-item`]:zi},an==null?void 0:an.className,D,_,ei);return He(gt.createElement(qt.Z,{component:"Radio",disabled:si.disabled},gt.createElement("label",{className:er,style:Object.assign(Object.assign({},an==null?void 0:an.style),z),onMouseEnter:tt.onMouseEnter,onMouseLeave:tt.onMouseLeave},gt.createElement(Fe.Z,Object.assign({},si,{className:At()(si.className,!Gt&&Te.A),type:"radio",prefixCls:Pe,ref:ai})),K!==void 0?gt.createElement("span",null,K):null)))};var pe=gt.forwardRef(fi);const Ke=gt.forwardRef((tt,de)=>{const{getPrefixCls:hi,direction:Ze}=gt.useContext(ft.E_),[Ye,Ae]=(0,vt.Z)(tt.defaultValue,{value:tt.value}),Wi=Se=>{const We=Ye,Go=Se.target.value;"value"in tt||Ae(Go);const{onChange:$o}=tt;$o&&Go!==We&&$o(Se)},{prefixCls:En,className:an,rootClassName:vi,options:ai,buttonStyle:zi="outline",disabled:$i,children:q,size:D,style:_,id:K,onMouseEnter:z,onMouseLeave:P,onFocus:bt,onBlur:Gt}=tt,Pe=hi("radio",En),He=`${Pe}-group`,[ei,si]=Ot(Pe);let Gi=q;ai&&ai.length>0&&(Gi=ai.map(Se=>typeof Se=="string"||typeof Se=="number"?gt.createElement(pe,{key:Se.toString(),prefixCls:Pe,disabled:$i,value:Se,checked:Ye===Se},Se):gt.createElement(pe,{key:`radio-group-value-options-${Se.value}`,prefixCls:Pe,disabled:Se.disabled||$i,value:Se.value,checked:Ye===Se.value,title:Se.title,style:Se.style},Se.label)));const er=(0,ct.Z)(D),rr=At()(He,`${He}-${zi}`,{[`${He}-${er}`]:er,[`${He}-rtl`]:Ze==="rtl"},an,vi,si);return ei(gt.createElement("div",Object.assign({},(0,Et.Z)(tt,{aria:!0,data:!0}),{className:rr,style:_,onMouseEnter:z,onMouseLeave:P,onFocus:bt,onBlur:Gt,id:K,ref:de}),gt.createElement(F,{value:{onChange:Wi,value:Ye,disabled:tt.disabled,name:tt.name,optionType:tt.optionType}},Gi)))});var ki=gt.memo(Ke),pi=function(tt,de){var hi={};for(var Ze in tt)Object.prototype.hasOwnProperty.call(tt,Ze)&&de.indexOf(Ze)<0&&(hi[Ze]=tt[Ze]);if(tt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ye=0,Ze=Object.getOwnPropertySymbols(tt);Ye<Ze.length;Ye++)de.indexOf(Ze[Ye])<0&&Object.prototype.propertyIsEnumerable.call(tt,Ze[Ye])&&(hi[Ze[Ye]]=tt[Ze[Ye]]);return hi};const Sn=(tt,de)=>{const{getPrefixCls:hi}=gt.useContext(ft.E_),{prefixCls:Ze}=tt,Ye=pi(tt,["prefixCls"]),Ae=hi("radio",Ze);return gt.createElement(ne,{value:"button"},gt.createElement(pe,Object.assign({prefixCls:Ae},Ye,{type:"radio",ref:de})))};var Sr=gt.forwardRef(Sn);const Ki=pe;Ki.Button=Sr,Ki.Group=ki,Ki.__ANT_RADIO=!0;var It=Ki},42563:function(Wr,Ti,j){"use strict";j.d(Ti,{default:function(){return Es}});var Nt=j(94184),At=j.n(Nt),vt=j(87462),Et=j(74902),gt=j(4942),ft=j(1413),ct=j(97685),ot=j(45987),F=j(71002),Y=j(67294),ee=j.t(Y,2);function ne(R){var V=Y.useRef();V.current=R;var at=Y.useCallback(function(){for(var dt,Dt=arguments.length,_t=new Array(Dt),Xt=0;Xt<Dt;Xt++)_t[Xt]=arguments[Xt];return(dt=V.current)===null||dt===void 0?void 0:dt.call.apply(dt,[V].concat(_t))},[]);return at}function Fe(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var le=Fe()?Y.useLayoutEffect:Y.useEffect,Zt=le,zt=function(V,at){var dt=Y.useRef(!0);le(function(){if(!dt.current)return V()},at),le(function(){return dt.current=!1,function(){dt.current=!0}},[])};function Q(R){var V=Y.useRef(!1),at=Y.useState(R),dt=(0,ct.Z)(at,2),Dt=dt[0],_t=dt[1];Y.useEffect(function(){return V.current=!1,function(){V.current=!0}},[]);function Xt(Ne,Xe){Xe&&V.current||_t(Ne)}return[Dt,Xt]}function se(R){return R!==void 0}function $e(R,V){var at=V||{},dt=at.defaultValue,Dt=at.value,_t=at.onChange,Xt=at.postState,Ne=Q(function(){return se(Dt)?Dt:se(dt)?typeof dt=="function"?dt():dt:typeof R=="function"?R():R}),Xe=(0,ct.Z)(Ne,2),ze=Xe[0],Qe=Xe[1],Be=Dt!==void 0?Dt:ze,xi=Xt?Xt(Be):Be,Oe=ne(_t),wi=Q([Be]),ri=(0,ct.Z)(wi,2),Mi=ri[0],Bi=ri[1];zt(function(){var Ni=Mi[0];ze!==Ni&&Oe(ze,Ni)},[Mi]),zt(function(){se(Dt)||Qe(Dt)},[Dt]);var Li=ne(function(Ni,Hi){Qe(Ni,Hi),Bi([Be],Hi)});return[xi,Li]}var Vt={};function Wt(R,V){}function kt(R,V){}function it(){Vt={}}function Ot(R,V,at){!V&&!Vt[at]&&(R(!1,at),Vt[at]=!0)}function qt(R,V){Ot(Wt,R,V)}function Te(R,V){Ot(kt,R,V)}var _e=qt,fi=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var R=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(R)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(R==null?void 0:R.substr(0,4))},Ht={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(V){var at=V.keyCode;if(V.altKey&&!V.ctrlKey||V.metaKey||at>=Ht.F1&&at<=Ht.F12)return!1;switch(at){case Ht.ALT:case Ht.CAPS_LOCK:case Ht.CONTEXT_MENU:case Ht.CTRL:case Ht.DOWN:case Ht.END:case Ht.ESC:case Ht.HOME:case Ht.INSERT:case Ht.LEFT:case Ht.MAC_FF_META:case Ht.META:case Ht.NUMLOCK:case Ht.NUM_CENTER:case Ht.PAGE_DOWN:case Ht.PAGE_UP:case Ht.PAUSE:case Ht.PRINT_SCREEN:case Ht.RIGHT:case Ht.SHIFT:case Ht.UP:case Ht.WIN_KEY:case Ht.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(V){if(V>=Ht.ZERO&&V<=Ht.NINE||V>=Ht.NUM_ZERO&&V<=Ht.NUM_MULTIPLY||V>=Ht.A&&V<=Ht.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&V===0)return!0;switch(V){case Ht.SPACE:case Ht.QUESTION_MARK:case Ht.NUM_PLUS:case Ht.NUM_MINUS:case Ht.NUM_PERIOD:case Ht.NUM_DIVISION:case Ht.SEMICOLON:case Ht.DASH:case Ht.EQUALS:case Ht.COMMA:case Ht.PERIOD:case Ht.SLASH:case Ht.APOSTROPHE:case Ht.SINGLE_QUOTE:case Ht.OPEN_SQUARE_BRACKET:case Ht.BACKSLASH:case Ht.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},pe=Ht,Ke=j(47655);function ki(R,V,at){var dt=Y.useRef({});return(!("value"in dt.current)||at(dt.current.condition,V))&&(dt.current.value=R(),dt.current.condition=V),dt.current.value}function pi(R,V){typeof R=="function"?R(V):(0,F.Z)(R)==="object"&&R&&"current"in R&&(R.current=V)}function Sn(){for(var R=arguments.length,V=new Array(R),at=0;at<R;at++)V[at]=arguments[at];var dt=V.filter(function(Dt){return Dt});return dt.length<=1?dt[0]:function(Dt){V.forEach(function(_t){pi(_t,Dt)})}}function Sr(){for(var R=arguments.length,V=new Array(R),at=0;at<R;at++)V[at]=arguments[at];return ki(function(){return Sn.apply(void 0,V)},V,function(dt,Dt){return dt.length===Dt.length&&dt.every(function(_t,Xt){return _t===Dt[Xt]})})}function Ki(R){var V,at,dt=(0,Ke.isMemo)(R)?R.type.type:R.type;return!(typeof dt=="function"&&!((V=dt.prototype)!==null&&V!==void 0&&V.render)||typeof R=="function"&&!((at=R.prototype)!==null&&at!==void 0&&at.render))}var It=function(V){var at=V.className,dt=V.customizeIcon,Dt=V.customizeIconProps,_t=V.onMouseDown,Xt=V.onClick,Ne=V.children,Xe;return typeof dt=="function"?Xe=dt(Dt):Xe=dt,Y.createElement("span",{className:at,onMouseDown:function(Qe){Qe.preventDefault(),_t&&_t(Qe)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Xt,"aria-hidden":!0},Xe!==void 0?Xe:Y.createElement("span",{className:At()(at.split(/\s+/).map(function(ze){return"".concat(ze,"-icon")}))},Ne))},tt=It;function de(R,V,at,dt,Dt){var _t=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Xt=arguments.length>6?arguments[6]:void 0,Ne=arguments.length>7?arguments[7]:void 0,Xe=Y.useMemo(function(){if((0,F.Z)(dt)==="object")return dt.clearIcon;if(Dt)return Dt},[dt,Dt]),ze=Y.useMemo(function(){return!!(!_t&&dt&&(at.length||Xt)&&!(Ne==="combobox"&&Xt===""))},[dt,_t,at.length,Xt,Ne]);return{allowClear:ze,clearIcon:Y.createElement(tt,{className:"".concat(R,"-clear"),onMouseDown:V,customizeIcon:Xe},"\xD7")}}var hi=Y.createContext(null);function Ze(){return Y.useContext(hi)}function Ye(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,V=Y.useState(!1),at=(0,ct.Z)(V,2),dt=at[0],Dt=at[1],_t=Y.useRef(null),Xt=function(){window.clearTimeout(_t.current)};Y.useEffect(function(){return Xt},[]);var Ne=function(ze,Qe){Xt(),_t.current=window.setTimeout(function(){Dt(ze),Qe&&Qe()},R)};return[dt,Ne,Xt]}function Ae(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,V=Y.useRef(null),at=Y.useRef(null);Y.useEffect(function(){return function(){window.clearTimeout(at.current)}},[]);function dt(Dt){(Dt||V.current===null)&&(V.current=Dt),window.clearTimeout(at.current),at.current=window.setTimeout(function(){V.current=null},R)}return[function(){return V.current},dt]}function Wi(R,V,at,dt){var Dt=Y.useRef(null);Dt.current={open:V,triggerOpen:at,customizedTrigger:dt},Y.useEffect(function(){function _t(Xt){var Ne;if(!((Ne=Dt.current)!==null&&Ne!==void 0&&Ne.customizedTrigger)){var Xe=Xt.target;Xe.shadowRoot&&Xt.composed&&(Xe=Xt.composedPath()[0]||Xe),Dt.current.open&&R().filter(function(ze){return ze}).every(function(ze){return!ze.contains(Xe)&&ze!==Xe})&&Dt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",_t),function(){return window.removeEventListener("mousedown",_t)}},[])}var En=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,an=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,vi="".concat(En," ").concat(an).split(/[\s\n]+/),ai="aria-",zi="data-";function $i(R,V){return R.indexOf(V)===0}function q(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,at;V===!1?at={aria:!0,data:!0,attr:!0}:V===!0?at={aria:!0}:at=(0,ft.Z)({},V);var dt={};return Object.keys(R).forEach(function(Dt){(at.aria&&(Dt==="role"||$i(Dt,ai))||at.data&&$i(Dt,zi)||at.attr&&vi.includes(Dt))&&(dt[Dt]=R[Dt])}),dt}var D=j(48555),_=j(14075),K=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],z=void 0;function P(R,V){var at=R.prefixCls,dt=R.invalidate,Dt=R.item,_t=R.renderItem,Xt=R.responsive,Ne=R.responsiveDisabled,Xe=R.registerSize,ze=R.itemKey,Qe=R.className,Be=R.style,xi=R.children,Oe=R.display,wi=R.order,ri=R.component,Mi=ri===void 0?"div":ri,Bi=(0,ot.Z)(R,K),Li=Xt&&!Oe;function Ni(Qn){Xe(ze,Qn)}Y.useEffect(function(){return function(){Ni(null)}},[]);var Hi=_t&&Dt!==z?_t(Dt):xi,Gn;dt||(Gn={opacity:Li?0:1,height:Li?0:z,overflowY:Li?"hidden":z,order:Xt?wi:z,pointerEvents:Li?"none":z,position:Li?"absolute":z});var cn={};Li&&(cn["aria-hidden"]=!0);var ir=Y.createElement(Mi,(0,vt.Z)({className:At()(!dt&&at,Qe),style:(0,ft.Z)((0,ft.Z)({},Gn),Be)},cn,Bi,{ref:V}),Hi);return Xt&&(ir=Y.createElement(D.Z,{onResize:function(Xr){var In=Xr.offsetWidth;Ni(In)},disabled:Ne},ir)),ir}var bt=Y.forwardRef(P);bt.displayName="Item";var Gt=bt,Pe=j(77527),He=j(73935),ei=j(96523);function si(R){if(typeof MessageChannel=="undefined")(0,ei.Z)(R);else{var V=new MessageChannel;V.port1.onmessage=function(){return R()},V.port2.postMessage(void 0)}}function Gi(){var R=Y.useRef(null),V=function(dt){R.current||(R.current=[],si(function(){(0,He.unstable_batchedUpdates)(function(){R.current.forEach(function(Dt){Dt()}),R.current=null})})),R.current.push(dt)};return V}function er(R,V){var at=Y.useState(V),dt=(0,ct.Z)(at,2),Dt=dt[0],_t=dt[1],Xt=(0,Pe.Z)(function(Ne){R(function(){_t(Ne)})});return[Dt,Xt]}var rr=Y.createContext(null),Se=["component"],We=["className"],Go=["className"],$o=function(V,at){var dt=Y.useContext(rr);if(!dt){var Dt=V.component,_t=Dt===void 0?"div":Dt,Xt=(0,ot.Z)(V,Se);return Y.createElement(_t,(0,vt.Z)({},Xt,{ref:at}))}var Ne=dt.className,Xe=(0,ot.Z)(dt,We),ze=V.className,Qe=(0,ot.Z)(V,Go);return Y.createElement(rr.Provider,{value:null},Y.createElement(Gt,(0,vt.Z)({ref:at,className:At()(Ne,ze)},Xe,Qe)))},yo=Y.forwardRef($o);yo.displayName="RawItem";var Fr=yo,Ro=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],uo="responsive",Ao="invalidate";function fs(R){return"+ ".concat(R.length," ...")}function Ya(R,V){var at=R.prefixCls,dt=at===void 0?"rc-overflow":at,Dt=R.data,_t=Dt===void 0?[]:Dt,Xt=R.renderItem,Ne=R.renderRawItem,Xe=R.itemKey,ze=R.itemWidth,Qe=ze===void 0?10:ze,Be=R.ssr,xi=R.style,Oe=R.className,wi=R.maxCount,ri=R.renderRest,Mi=R.renderRawRest,Bi=R.suffix,Li=R.component,Ni=Li===void 0?"div":Li,Hi=R.itemComponent,Gn=R.onVisibleChange,cn=(0,ot.Z)(R,Ro),ir=Be==="full",Qn=Gi(),Xr=er(Qn,null),In=(0,ct.Z)(Xr,2),nn=In[0],vo=In[1],Kr=nn||0,gr=er(Qn,new Map),kn=(0,ct.Z)(gr,2),ji=kn[0],rn=kn[1],On=er(Qn,0),tr=(0,ct.Z)(On,2),Ws=tr[0],Ct=tr[1],_o=er(Qn,0),Mn=(0,ct.Z)(_o,2),jn=Mn[0],ws=Mn[1],Ea=er(Qn,0),Pn=(0,ct.Z)(Ea,2),vn=Pn[0],tn=Pn[1],so=(0,Y.useState)(null),Po=(0,ct.Z)(so,2),No=Po[0],ar=Po[1],Mo=(0,Y.useState)(null),qo=(0,ct.Z)(Mo,2),Je=qo[0],br=qo[1],wn=Y.useMemo(function(){return Je===null&&ir?Number.MAX_SAFE_INTEGER:Je||0},[Je,nn]),lr=(0,Y.useState)(!1),Rn=(0,ct.Z)(lr,2),kr=Rn[0],Ls=Rn[1],As="".concat(dt,"-item"),Gr=Math.max(Ws,jn),ma=wi===uo,Qo=_t.length&&ma,bs=wi===Ao,ua=Qo||typeof wi=="number"&&_t.length>wi,Ho=(0,Y.useMemo)(function(){var Yr=_t;return Qo?nn===null&&ir?Yr=_t:Yr=_t.slice(0,Math.min(_t.length,Kr/Qe)):typeof wi=="number"&&(Yr=_t.slice(0,wi)),Yr},[_t,Qe,nn,wi,Qo]),La=(0,Y.useMemo)(function(){return Qo?_t.slice(wn+1):_t.slice(Ho.length)},[_t,Ho,Qo,wn]),Eo=(0,Y.useCallback)(function(Yr,Fi){var Un;return typeof Xe=="function"?Xe(Yr):(Un=Xe&&(Yr==null?void 0:Yr[Xe]))!==null&&Un!==void 0?Un:Fi},[Xe]),Rs=(0,Y.useCallback)(Xt||function(Yr){return Yr},[Xt]);function Us(Yr,Fi,Un){Je===Yr&&(Fi===void 0||Fi===No)||(br(Yr),Un||(Ls(Yr<_t.length-1),Gn==null||Gn(Yr)),Fi!==void 0&&ar(Fi))}function Vo(Yr,Fi){vo(Fi.clientWidth)}function ha(Yr,Fi){rn(function(Un){var ae=new Map(Un);return Fi===null?ae.delete(Yr):ae.set(Yr,Fi),ae})}function Zs(Yr,Fi){ws(Fi),Ct(jn)}function Vl(Yr,Fi){tn(Fi)}function Ta(Yr){return ji.get(Eo(Ho[Yr],Yr))}(0,_.Z)(function(){if(Kr&&typeof Gr=="number"&&Ho){var Yr=vn,Fi=Ho.length,Un=Fi-1;if(!Fi){Us(0,null);return}for(var ae=0;ae<Fi;ae+=1){var to=Ta(ae);if(ir&&(to=to||0),to===void 0){Us(ae-1,void 0,!0);break}if(Yr+=to,Un===0&&Yr<=Kr||ae===Un-1&&Yr+Ta(Un)<=Kr){Us(Un,null);break}else if(Yr+Gr>Kr){Us(ae-1,Yr-to-vn+jn);break}}Bi&&Ta(0)+vn>Kr&&ar(null)}},[Kr,ji,jn,vn,Eo,Ho]);var Xa=kr&&!!La.length,Yu={};No!==null&&Qo&&(Yu={position:"absolute",left:No,top:0});var Ts={prefixCls:As,responsive:Qo,component:Hi,invalidate:bs},Cn=Ne?function(Yr,Fi){var Un=Eo(Yr,Fi);return Y.createElement(rr.Provider,{key:Un,value:(0,ft.Z)((0,ft.Z)({},Ts),{},{order:Fi,item:Yr,itemKey:Un,registerSize:ha,display:Fi<=wn})},Ne(Yr,Fi))}:function(Yr,Fi){var Un=Eo(Yr,Fi);return Y.createElement(Gt,(0,vt.Z)({},Ts,{order:Fi,key:Un,item:Yr,renderItem:Rs,itemKey:Un,registerSize:ha,display:Fi<=wn}))},Kn,Pr={order:Xa?wn:Number.MAX_SAFE_INTEGER,className:"".concat(As,"-rest"),registerSize:Zs,display:Xa};if(Mi)Mi&&(Kn=Y.createElement(rr.Provider,{value:(0,ft.Z)((0,ft.Z)({},Ts),Pr)},Mi(La)));else{var Ss=ri||fs;Kn=Y.createElement(Gt,(0,vt.Z)({},Ts,Pr),typeof Ss=="function"?Ss(La):Ss)}var Nn=Y.createElement(Ni,(0,vt.Z)({className:At()(!bs&&dt,Oe),style:xi,ref:V},cn),Ho.map(Cn),ua?Kn:null,Bi&&Y.createElement(Gt,(0,vt.Z)({},Ts,{responsive:ma,responsiveDisabled:!Qo,order:wn,className:"".concat(As,"-suffix"),registerSize:Vl,display:!0,style:Yu}),Bi));return ma&&(Nn=Y.createElement(D.Z,{onResize:Vo,disabled:!Qo},Nn)),Nn}var Ja=Y.forwardRef(Ya);Ja.displayName="Overflow",Ja.Item=Fr,Ja.RESPONSIVE=uo,Ja.INVALIDATE=Ao;var jl=Ja,Na=jl,xo=function(V,at){var dt,Dt,_t=V.prefixCls,Xt=V.id,Ne=V.inputElement,Xe=V.disabled,ze=V.tabIndex,Qe=V.autoFocus,Be=V.autoComplete,xi=V.editable,Oe=V.activeDescendantId,wi=V.value,ri=V.maxLength,Mi=V.onKeyDown,Bi=V.onMouseDown,Li=V.onChange,Ni=V.onPaste,Hi=V.onCompositionStart,Gn=V.onCompositionEnd,cn=V.open,ir=V.attrs,Qn=Ne||Y.createElement("input",null),Xr=Qn,In=Xr.ref,nn=Xr.props,vo=nn.onKeyDown,Kr=nn.onChange,gr=nn.onMouseDown,kn=nn.onCompositionStart,ji=nn.onCompositionEnd,rn=nn.style;return"maxLength"in Qn.props,Qn=Y.cloneElement(Qn,(0,ft.Z)((0,ft.Z)((0,ft.Z)({type:"search"},nn),{},{id:Xt,ref:Sn(at,In),disabled:Xe,tabIndex:ze,autoComplete:Be||"off",autoFocus:Qe,className:At()("".concat(_t,"-selection-search-input"),(dt=Qn)===null||dt===void 0||(Dt=dt.props)===null||Dt===void 0?void 0:Dt.className),role:"combobox","aria-label":"Search","aria-expanded":cn||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Xt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Xt,"_list"),"aria-activedescendant":cn?Oe:void 0},ir),{},{value:xi?wi:"",maxLength:ri,readOnly:!xi,unselectable:xi?null:"on",style:(0,ft.Z)((0,ft.Z)({},rn),{},{opacity:xi?null:0}),onKeyDown:function(tr){Mi(tr),vo&&vo(tr)},onMouseDown:function(tr){Bi(tr),gr&&gr(tr)},onChange:function(tr){Li(tr),Kr&&Kr(tr)},onCompositionStart:function(tr){Hi(tr),kn&&kn(tr)},onCompositionEnd:function(tr){Gn(tr),ji&&ji(tr)},onPaste:Ni})),Qn},rl=Y.forwardRef(xo);rl.displayName="Input";var Va=rl;function Kl(R){return Array.isArray(R)?R:R!==void 0?[R]:[]}var ga=typeof window!="undefined"&&window.document&&window.document.documentElement,Xs=ga;function Me(R){return R!=null}function L(R){return!R&&R!==0}function yi(R){return["string","number"].includes((0,F.Z)(R))}function qe(R){var V=void 0;return R&&(yi(R.title)?V=R.title.toString():yi(R.label)&&(V=R.label.toString())),V}function Si(R,V){Xs?Y.useLayoutEffect(R,V):Y.useEffect(R,V)}function Vi(R){var V;return(V=R.key)!==null&&V!==void 0?V:R.value}var ln=function(V){V.preventDefault(),V.stopPropagation()},fr=function(V){var at=V.id,dt=V.prefixCls,Dt=V.values,_t=V.open,Xt=V.searchValue,Ne=V.autoClearSearchValue,Xe=V.inputRef,ze=V.placeholder,Qe=V.disabled,Be=V.mode,xi=V.showSearch,Oe=V.autoFocus,wi=V.autoComplete,ri=V.activeDescendantId,Mi=V.tabIndex,Bi=V.removeIcon,Li=V.maxTagCount,Ni=V.maxTagTextLength,Hi=V.maxTagPlaceholder,Gn=Hi===void 0?function(ar){return"+ ".concat(ar.length," ...")}:Hi,cn=V.tagRender,ir=V.onToggleOpen,Qn=V.onRemove,Xr=V.onInputChange,In=V.onInputPaste,nn=V.onInputKeyDown,vo=V.onInputMouseDown,Kr=V.onInputCompositionStart,gr=V.onInputCompositionEnd,kn=Y.useRef(null),ji=(0,Y.useState)(0),rn=(0,ct.Z)(ji,2),On=rn[0],tr=rn[1],Ws=(0,Y.useState)(!1),Ct=(0,ct.Z)(Ws,2),_o=Ct[0],Mn=Ct[1],jn="".concat(dt,"-selection"),ws=_t||Be==="multiple"&&Ne===!1||Be==="tags"?Xt:"",Ea=Be==="tags"||Be==="multiple"&&Ne===!1||xi&&(_t||_o);Si(function(){tr(kn.current.scrollWidth)},[ws]);function Pn(ar,Mo,qo,Je,br){return Y.createElement("span",{className:At()("".concat(jn,"-item"),(0,gt.Z)({},"".concat(jn,"-item-disabled"),qo)),title:qe(ar)},Y.createElement("span",{className:"".concat(jn,"-item-content")},Mo),Je&&Y.createElement(tt,{className:"".concat(jn,"-item-remove"),onMouseDown:ln,onClick:br,customizeIcon:Bi},"\xD7"))}function vn(ar,Mo,qo,Je,br){var wn=function(Rn){ln(Rn),ir(!_t)};return Y.createElement("span",{onMouseDown:wn},cn({label:Mo,value:ar,disabled:qo,closable:Je,onClose:br}))}function tn(ar){var Mo=ar.disabled,qo=ar.label,Je=ar.value,br=!Qe&&!Mo,wn=qo;if(typeof Ni=="number"&&(typeof qo=="string"||typeof qo=="number")){var lr=String(wn);lr.length>Ni&&(wn="".concat(lr.slice(0,Ni),"..."))}var Rn=function(Ls){Ls&&Ls.stopPropagation(),Qn(ar)};return typeof cn=="function"?vn(Je,wn,Mo,br,Rn):Pn(ar,wn,Mo,br,Rn)}function so(ar){var Mo=typeof Gn=="function"?Gn(ar):Gn;return Pn({title:Mo},Mo,!1)}var Po=Y.createElement("div",{className:"".concat(jn,"-search"),style:{width:On},onFocus:function(){Mn(!0)},onBlur:function(){Mn(!1)}},Y.createElement(Va,{ref:Xe,open:_t,prefixCls:dt,id:at,inputElement:null,disabled:Qe,autoFocus:Oe,autoComplete:wi,editable:Ea,activeDescendantId:ri,value:ws,onKeyDown:nn,onMouseDown:vo,onChange:Xr,onPaste:In,onCompositionStart:Kr,onCompositionEnd:gr,tabIndex:Mi,attrs:q(V,!0)}),Y.createElement("span",{ref:kn,className:"".concat(jn,"-search-mirror"),"aria-hidden":!0},ws,"\xA0")),No=Y.createElement(Na,{prefixCls:"".concat(jn,"-overflow"),data:Dt,renderItem:tn,renderRest:so,suffix:Po,itemKey:Vi,maxCount:Li});return Y.createElement(Y.Fragment,null,No,!Dt.length&&!ws&&Y.createElement("span",{className:"".concat(jn,"-placeholder")},ze))},no=fr,wo=function(V){var at=V.inputElement,dt=V.prefixCls,Dt=V.id,_t=V.inputRef,Xt=V.disabled,Ne=V.autoFocus,Xe=V.autoComplete,ze=V.activeDescendantId,Qe=V.mode,Be=V.open,xi=V.values,Oe=V.placeholder,wi=V.tabIndex,ri=V.showSearch,Mi=V.searchValue,Bi=V.activeValue,Li=V.maxLength,Ni=V.onInputKeyDown,Hi=V.onInputMouseDown,Gn=V.onInputChange,cn=V.onInputPaste,ir=V.onInputCompositionStart,Qn=V.onInputCompositionEnd,Xr=V.title,In=Y.useState(!1),nn=(0,ct.Z)(In,2),vo=nn[0],Kr=nn[1],gr=Qe==="combobox",kn=gr||ri,ji=xi[0],rn=Mi||"";gr&&Bi&&!vo&&(rn=Bi),Y.useEffect(function(){gr&&Kr(!1)},[gr,Bi]);var On=Qe!=="combobox"&&!Be&&!ri?!1:!!rn,tr=Xr===void 0?qe(ji):Xr,Ws=function(){if(ji)return null;var _o=On?{visibility:"hidden"}:void 0;return Y.createElement("span",{className:"".concat(dt,"-selection-placeholder"),style:_o},Oe)};return Y.createElement(Y.Fragment,null,Y.createElement("span",{className:"".concat(dt,"-selection-search")},Y.createElement(Va,{ref:_t,prefixCls:dt,id:Dt,open:Be,inputElement:at,disabled:Xt,autoFocus:Ne,autoComplete:Xe,editable:kn,activeDescendantId:ze,value:rn,onKeyDown:Ni,onMouseDown:Hi,onChange:function(_o){Kr(!0),Gn(_o)},onPaste:cn,onCompositionStart:ir,onCompositionEnd:Qn,tabIndex:wi,attrs:q(V,!0),maxLength:gr?Li:void 0})),!gr&&ji?Y.createElement("span",{className:"".concat(dt,"-selection-item"),title:tr,style:On?{visibility:"hidden"}:void 0},ji.label):null,Ws())},ro=wo;function li(R){return![pe.ESC,pe.SHIFT,pe.BACKSPACE,pe.TAB,pe.WIN_KEY,pe.ALT,pe.META,pe.WIN_KEY_RIGHT,pe.CTRL,pe.SEMICOLON,pe.EQUALS,pe.CAPS_LOCK,pe.CONTEXT_MENU,pe.F1,pe.F2,pe.F3,pe.F4,pe.F5,pe.F6,pe.F7,pe.F8,pe.F9,pe.F10,pe.F11,pe.F12].includes(R)}var St=function(V,at){var dt=(0,Y.useRef)(null),Dt=(0,Y.useRef)(!1),_t=V.prefixCls,Xt=V.open,Ne=V.mode,Xe=V.showSearch,ze=V.tokenWithEnter,Qe=V.autoClearSearchValue,Be=V.onSearch,xi=V.onSearchSubmit,Oe=V.onToggleOpen,wi=V.onInputKeyDown,ri=V.domRef;Y.useImperativeHandle(at,function(){return{focus:function(){dt.current.focus()},blur:function(){dt.current.blur()}}});var Mi=Ae(0),Bi=(0,ct.Z)(Mi,2),Li=Bi[0],Ni=Bi[1],Hi=function(rn){var On=rn.which;(On===pe.UP||On===pe.DOWN)&&rn.preventDefault(),wi&&wi(rn),On===pe.ENTER&&Ne==="tags"&&!Dt.current&&!Xt&&(xi==null||xi(rn.target.value)),li(On)&&Oe(!0)},Gn=function(){Ni(!0)},cn=(0,Y.useRef)(null),ir=function(rn){Be(rn,!0,Dt.current)!==!1&&Oe(!0)},Qn=function(){Dt.current=!0},Xr=function(rn){Dt.current=!1,Ne!=="combobox"&&ir(rn.target.value)},In=function(rn){var On=rn.target.value;if(ze&&cn.current&&/[\r\n]/.test(cn.current)){var tr=cn.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");On=On.replace(tr,cn.current)}cn.current=null,ir(On)},nn=function(rn){var On=rn.clipboardData,tr=On.getData("text");cn.current=tr},vo=function(rn){var On=rn.target;if(On!==dt.current){var tr=document.body.style.msTouchAction!==void 0;tr?setTimeout(function(){dt.current.focus()}):dt.current.focus()}},Kr=function(rn){var On=Li();rn.target!==dt.current&&!On&&Ne!=="combobox"&&rn.preventDefault(),(Ne!=="combobox"&&(!Xe||!On)||!Xt)&&(Xt&&Qe!==!1&&Be("",!0,!1),Oe())},gr={inputRef:dt,onInputKeyDown:Hi,onInputMouseDown:Gn,onInputChange:In,onInputPaste:nn,onInputCompositionStart:Qn,onInputCompositionEnd:Xr},kn=Ne==="multiple"||Ne==="tags"?Y.createElement(no,(0,vt.Z)({},V,gr)):Y.createElement(ro,(0,vt.Z)({},V,gr));return Y.createElement("div",{ref:ri,className:"".concat(_t,"-selector"),onClick:vo,onMouseDown:Kr},kn)},$t=Y.forwardRef(St);$t.displayName="Selector";var xe=$t,Ue=Y.createContext(null),Kt=Ue,yt=[];function me(R,V){var at=Y.useState(function(){if(!Fe())return null;var wi=document.createElement("div");return wi}),dt=(0,ct.Z)(at,1),Dt=dt[0],_t=Y.useRef(!1),Xt=Y.useContext(Kt),Ne=Y.useState(yt),Xe=(0,ct.Z)(Ne,2),ze=Xe[0],Qe=Xe[1],Be=Xt||(_t.current?void 0:function(wi){Qe(function(ri){var Mi=[wi].concat((0,Et.Z)(ri));return Mi})});function xi(){Dt.parentElement||document.body.appendChild(Dt),_t.current=!0}function Oe(){var wi;(wi=Dt.parentElement)===null||wi===void 0||wi.removeChild(Dt),_t.current=!1}return Zt(function(){return R?Xt?Xt(xi):xi():Oe(),Oe},[R]),Zt(function(){ze.length&&(ze.forEach(function(wi){return wi()}),Qe(yt))},[ze]),[Dt,Be]}function Ce(R,V){if(!R)return!1;if(R.contains)return R.contains(V);for(var at=V;at;){if(at===R)return!0;at=at.parentNode}return!1}var we="data-rc-order",Mt="rc-util-key",ie=new Map;function Re(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=R.mark;return V?V.startsWith("data-")?V:"data-".concat(V):Mt}function _i(R){if(R.attachTo)return R.attachTo;var V=document.querySelector("head");return V||document.body}function Qt(R){return R==="queue"?"prependQueue":R?"prepend":"append"}function ui(R){return Array.from((ie.get(R)||R).children).filter(function(V){return V.tagName==="STYLE"})}function vr(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Fe())return null;var at=V.csp,dt=V.prepend,Dt=document.createElement("style");Dt.setAttribute(we,Qt(dt)),at!=null&&at.nonce&&(Dt.nonce=at==null?void 0:at.nonce),Dt.innerHTML=R;var _t=_i(V),Xt=_t.firstChild;if(dt){if(dt==="queue"){var Ne=ui(_t).filter(function(Xe){return["prepend","prependQueue"].includes(Xe.getAttribute(we))});if(Ne.length)return _t.insertBefore(Dt,Ne[Ne.length-1].nextSibling),Dt}_t.insertBefore(Dt,Xt)}else _t.appendChild(Dt);return Dt}function Mr(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},at=_i(V);return ui(at).find(function(dt){return dt.getAttribute(Re(V))===R})}function Lr(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},at=Mr(R,V);if(at){var dt=_i(V);dt.removeChild(at)}}function gi(R,V){var at=ie.get(R);if(!at||!Ce(document,at)){var dt=vr("",V),Dt=dt.parentNode;ie.set(R,Dt),R.removeChild(dt)}}function Ji(){ie.clear()}function Xi(R,V){var at=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},dt=_i(at);gi(dt,at);var Dt=Mr(V,at);if(Dt){var _t,Xt;if((_t=at.csp)!==null&&_t!==void 0&&_t.nonce&&Dt.nonce!==((Xt=at.csp)===null||Xt===void 0?void 0:Xt.nonce)){var Ne;Dt.nonce=(Ne=at.csp)===null||Ne===void 0?void 0:Ne.nonce}return Dt.innerHTML!==R&&(Dt.innerHTML=R),Dt}var Xe=vr(R,at);return Xe.setAttribute(Re(at),V),Xe}var zr;function ho(R){if(typeof document=="undefined")return 0;if(R||zr===void 0){var V=document.createElement("div");V.style.width="100%",V.style.height="200px";var at=document.createElement("div"),dt=at.style;dt.position="absolute",dt.top="0",dt.left="0",dt.pointerEvents="none",dt.visibility="hidden",dt.width="200px",dt.height="150px",dt.overflow="hidden",at.appendChild(V),document.body.appendChild(at);var Dt=V.offsetWidth;at.style.overflow="scroll";var _t=V.offsetWidth;Dt===_t&&(_t=at.clientWidth),document.body.removeChild(at),zr=Dt-_t}return zr}function Tn(R){var V=R.match(/^(.*)px$/),at=Number(V==null?void 0:V[1]);return Number.isNaN(at)?ho():at}function Pi(R){if(typeof document=="undefined"||!R||!(R instanceof Element))return{width:0,height:0};var V=getComputedStyle(R,"::-webkit-scrollbar"),at=V.width,dt=V.height;return{width:Tn(at),height:Tn(dt)}}function os(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var qr="rc-util-locker-".concat(Date.now()),bo=0;function he(R){var V=!!R,at=Y.useState(function(){return bo+=1,"".concat(qr,"_").concat(bo)}),dt=(0,ct.Z)(at,1),Dt=dt[0];Zt(function(){if(V){var _t=Pi(document.body).width,Xt=os();Xi(`
|
|
|
html body {
|
|
|
overflow-y: hidden;
|
|
|
`.concat(Xt?"width: calc(100% - ".concat(_t,"px);"):"",`
|
|
|
}`),Dt)}else Lr(Dt);return function(){Lr(Dt)}},[V,Dt])}var ss=!1;function Aa(R){return typeof R=="boolean"&&(ss=R),ss}var Bo=function(V){return V===!1?!1:!Fe()||!V?null:typeof V=="string"?document.querySelector(V):typeof V=="function"?V():V},Ma=Y.forwardRef(function(R,V){var at=R.open,dt=R.autoLock,Dt=R.getContainer,_t=R.debug,Xt=R.autoDestroy,Ne=Xt===void 0?!0:Xt,Xe=R.children,ze=Y.useState(at),Qe=(0,ct.Z)(ze,2),Be=Qe[0],xi=Qe[1],Oe=Be||at;Y.useEffect(function(){(Ne||at)&&xi(at)},[at,Ne]);var wi=Y.useState(function(){return Bo(Dt)}),ri=(0,ct.Z)(wi,2),Mi=ri[0],Bi=ri[1];Y.useEffect(function(){var vo=Bo(Dt);Bi(vo!=null?vo:null)});var Li=me(Oe&&!Mi,_t),Ni=(0,ct.Z)(Li,2),Hi=Ni[0],Gn=Ni[1],cn=Mi!=null?Mi:Hi;he(dt&&at&&Fe()&&(cn===Hi||cn===document.body));var ir=null;if(Xe&&Ki(Xe)&&V){var Qn=Xe;ir=Qn.ref}var Xr=Sr(ir,V);if(!Oe||!Fe()||Mi===void 0)return null;var In=cn===!1||Aa(),nn=Xe;return V&&(nn=Y.cloneElement(Xe,{ref:Xr})),Y.createElement(Kt.Provider,{value:Gn},In?nn:(0,He.createPortal)(nn,cn))}),Lo=Ma,Tr=Lo;function yr(R){return R instanceof HTMLElement||R instanceof SVGElement}function $r(R){return yr(R)?R:R instanceof React.Component?ReactDOM.findDOMNode(R):null}function dr(R){var V;return R==null||(V=R.getRootNode)===null||V===void 0?void 0:V.call(R)}function ue(R){return dr(R)instanceof ShadowRoot}function Wo(R){return ue(R)?dr(R):null}function te(R){var V=Y.useRef();V.current=R;var at=Y.useCallback(function(){for(var dt,Dt=arguments.length,_t=new Array(Dt),Xt=0;Xt<Dt;Xt++)_t[Xt]=arguments[Xt];return(dt=V.current)===null||dt===void 0?void 0:dt.call.apply(dt,[V].concat(_t))},[]);return at}function Do(){var R=(0,ft.Z)({},ee);return R.useId}var Co=0;function Io(){}var ea=Do(),Nr=ea?function(V){var at=ea();return V||at}:function(V){var at=Y.useState("ssr-id"),dt=(0,ct.Z)(at,2),Dt=dt[0],_t=dt[1];return Y.useEffect(function(){var Xt=Co;Co+=1,_t("rc_unique_".concat(Xt))},[]),V||Dt};function Xn(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var fo=Xn()?Y.useLayoutEffect:Y.useEffect,Ys=function(V,at){var dt=Y.useRef(!0);fo(function(){return V(dt.current)},at),fo(function(){return dt.current=!1,function(){dt.current=!0}},[])},Xo=function(V,at){Ys(function(dt){if(!dt)return V()},at)},ci=Ys,G=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var R=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(R)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(R==null?void 0:R.substr(0,4))},Wa=Y.createContext(null),zs=Wa;function Fa(R){return R?Array.isArray(R)?R:[R]:[]}function ia(R,V,at,dt){return Y.useMemo(function(){var Dt=Fa(at!=null?at:V),_t=Fa(dt!=null?dt:V),Xt=new Set(Dt),Ne=new Set(_t);return R&&(Xt.has("hover")&&(Xt.delete("hover"),Xt.add("click")),Ne.has("hover")&&(Ne.delete("hover"),Ne.add("click"))),[Xt,Ne]},[R,V,at,dt])}var iu=function(R){if(!R)return!1;if(R instanceof Element){if(R.offsetParent)return!0;if(R.getBBox){var V=R.getBBox(),at=V.width,dt=V.height;if(at||dt)return!0}if(R.getBoundingClientRect){var Dt=R.getBoundingClientRect(),_t=Dt.width,Xt=Dt.height;if(_t||Xt)return!0}}return!1};function Pu(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],at=arguments.length>2?arguments[2]:void 0;return at?R[0]===V[0]:R[0]===V[0]&&R[1]===V[1]}function Th(R,V,at,dt){for(var Dt=at.points,_t=Object.keys(R),Xt=0;Xt<_t.length;Xt+=1){var Ne,Xe=_t[Xt];if(Pu((Ne=R[Xe])===null||Ne===void 0?void 0:Ne.points,Dt,dt))return"".concat(V,"-placement-").concat(Xe)}return""}function rt(R,V,at,dt){return V||(at?{motionName:"".concat(R,"-").concat(at)}:dt?{motionName:dt}:null)}function ut(R){return R.ownerDocument.defaultView}function re(R){for(var V=[],at=R==null?void 0:R.parentElement,dt=["hidden","scroll","clip","auto"];at;){var Dt=ut(at).getComputedStyle(at),_t=Dt.overflowX,Xt=Dt.overflowY,Ne=Dt.overflow;[_t,Xt,Ne].some(function(Xe){return dt.includes(Xe)})&&V.push(at),at=at.parentElement}return V}function be(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(R)?V:R}function Ge(R){return be(parseFloat(R),0)}function ni(R,V){var at=(0,ft.Z)({},R);return(V||[]).forEach(function(dt){if(!(dt instanceof HTMLBodyElement||dt instanceof HTMLHtmlElement)){var Dt=ut(dt).getComputedStyle(dt),_t=Dt.overflow,Xt=Dt.overflowClipMargin,Ne=Dt.borderTopWidth,Xe=Dt.borderBottomWidth,ze=Dt.borderLeftWidth,Qe=Dt.borderRightWidth,Be=dt.getBoundingClientRect(),xi=dt.offsetHeight,Oe=dt.clientHeight,wi=dt.offsetWidth,ri=dt.clientWidth,Mi=Ge(Ne),Bi=Ge(Xe),Li=Ge(ze),Ni=Ge(Qe),Hi=be(Math.round(Be.width/wi*1e3)/1e3),Gn=be(Math.round(Be.height/xi*1e3)/1e3),cn=(wi-ri-Li-Ni)*Hi,ir=(xi-Oe-Mi-Bi)*Gn,Qn=Mi*Gn,Xr=Bi*Gn,In=Li*Hi,nn=Ni*Hi,vo=0,Kr=0;if(_t==="clip"){var gr=Ge(Xt);vo=gr*Hi,Kr=gr*Gn}var kn=Be.x+In-vo,ji=Be.y+Qn-Kr,rn=kn+Be.width+2*vo-In-nn-cn,On=ji+Be.height+2*Kr-Qn-Xr-ir;at.left=Math.max(at.left,kn),at.top=Math.max(at.top,ji),at.right=Math.min(at.right,rn),at.bottom=Math.min(at.bottom,On)}}),at}function fe(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,at="".concat(V),dt=at.match(/^(.*)\%$/);return dt?R*(parseFloat(dt[1])/100):parseFloat(at)}function un(R,V){var at=V||[],dt=(0,ct.Z)(at,2),Dt=dt[0],_t=dt[1];return[fe(R.width,Dt),fe(R.height,_t)]}function An(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[R[0],R[1]]}function xr(R,V){var at=V[0],dt=V[1],Dt,_t;return at==="t"?_t=R.y:at==="b"?_t=R.y+R.height:_t=R.y+R.height/2,dt==="l"?Dt=R.x:dt==="r"?Dt=R.x+R.width:Dt=R.x+R.width/2,{x:Dt,y:_t}}function Ur(R,V){var at={t:"b",b:"t",l:"r",r:"l"};return R.map(function(dt,Dt){return Dt===V?at[dt]||"c":dt}).join("")}function Zn(R,V,at,dt,Dt,_t,Xt){var Ne=Y.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Dt[dt]||{}}),Xe=(0,ct.Z)(Ne,2),ze=Xe[0],Qe=Xe[1],Be=Y.useRef(0),xi=Y.useMemo(function(){return V?re(V):[]},[V]),Oe=Y.useRef({}),wi=function(){Oe.current={}};R||wi();var ri=te(function(){if(V&&at&&R){let yh=function(Ka,Zh){var Ju=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lr,Eu=tr.x+Ka,qu=tr.y+Zh,h=Eu+vn,d=qu+Pn,x=Math.max(Eu,Ju.left),y=Math.max(qu,Ju.top),S=Math.min(h,Ju.right),E=Math.min(d,Ju.bottom);return Math.max(0,(S-x)*(E-y))},Qc=function(){cl=tr.y+Pr,Ds=cl+Pn,ku=tr.x+Kn,ah=ku+vn};var Li,Ni,Hi=V,Gn=Hi.ownerDocument,cn=ut(Hi),ir=cn.getComputedStyle(Hi),Qn=ir.width,Xr=ir.height,In=ir.position,nn=Hi.style.left,vo=Hi.style.top,Kr=Hi.style.right,gr=Hi.style.bottom,kn=(0,ft.Z)((0,ft.Z)({},Dt[dt]),_t),ji=Gn.createElement("div");(Li=Hi.parentElement)===null||Li===void 0||Li.appendChild(ji),ji.style.left="".concat(Hi.offsetLeft,"px"),ji.style.top="".concat(Hi.offsetTop,"px"),ji.style.position=In,ji.style.height="".concat(Hi.offsetHeight,"px"),ji.style.width="".concat(Hi.offsetWidth,"px"),Hi.style.left="0",Hi.style.top="0",Hi.style.right="auto",Hi.style.bottom="auto";var rn;if(Array.isArray(at))rn={x:at[0],y:at[1],width:0,height:0};else{var On=at.getBoundingClientRect();rn={x:On.x,y:On.y,width:On.width,height:On.height}}var tr=Hi.getBoundingClientRect(),Ws=Gn.documentElement,Ct=Ws.clientWidth,_o=Ws.clientHeight,Mn=Ws.scrollWidth,jn=Ws.scrollHeight,ws=Ws.scrollTop,Ea=Ws.scrollLeft,Pn=tr.height,vn=tr.width,tn=rn.height,so=rn.width,Po={left:0,top:0,right:Ct,bottom:_o},No={left:-Ea,top:-ws,right:Mn-Ea,bottom:jn-ws},ar=kn.htmlRegion,Mo="visible",qo="visibleFirst";ar!=="scroll"&&ar!==qo&&(ar=Mo);var Je=ar===qo,br=ni(No,xi),wn=ni(Po,xi),lr=ar===Mo?wn:br,Rn=Je?wn:lr;Hi.style.left="auto",Hi.style.top="auto",Hi.style.right="0",Hi.style.bottom="0";var kr=Hi.getBoundingClientRect();Hi.style.left=nn,Hi.style.top=vo,Hi.style.right=Kr,Hi.style.bottom=gr,(Ni=Hi.parentElement)===null||Ni===void 0||Ni.removeChild(ji);var Ls=be(Math.round(vn/parseFloat(Qn)*1e3)/1e3),As=be(Math.round(Pn/parseFloat(Xr)*1e3)/1e3);if(Ls===0||As===0||yr(at)&&!iu(at))return;var Gr=kn.offset,ma=kn.targetOffset,Qo=un(tr,Gr),bs=(0,ct.Z)(Qo,2),ua=bs[0],Ho=bs[1],La=un(rn,ma),Eo=(0,ct.Z)(La,2),Rs=Eo[0],Us=Eo[1];rn.x-=Rs,rn.y-=Us;var Vo=kn.points||[],ha=(0,ct.Z)(Vo,2),Zs=ha[0],Vl=ha[1],Ta=An(Vl),Xa=An(Zs),Yu=xr(rn,Ta),Ts=xr(tr,Xa),Cn=(0,ft.Z)({},kn),Kn=Yu.x-Ts.x+ua,Pr=Yu.y-Ts.y+Ho,Ss=yh(Kn,Pr),Nn=yh(Kn,Pr,wn),Yr=xr(rn,["t","l"]),Fi=xr(tr,["t","l"]),Un=xr(rn,["b","r"]),ae=xr(tr,["b","r"]),to=kn.overflow||{},Bs=to.adjustX,_a=to.adjustY,sh=to.shiftX,Wl=to.shiftY,Du=function(Zh){return typeof Zh=="boolean"?Zh:Zh>=0},cl,Ds,ku,ah;Qc();var Lc=Du(_a),Vh=Xa[0]===Ta[0];if(Lc&&Xa[0]==="t"&&(Ds>Rn.bottom||Oe.current.bt)){var mu=Pr;Vh?mu-=Pn-tn:mu=Yr.y-ae.y-Ho;var Nf=yh(Kn,mu),gu=yh(Kn,mu,wn);Nf>Ss||Nf===Ss&&(!Je||gu>=Nn)?(Oe.current.bt=!0,Pr=mu,Ho=-Ho,Cn.points=[Ur(Xa,0),Ur(Ta,0)]):Oe.current.bt=!1}if(Lc&&Xa[0]==="b"&&(cl<Rn.top||Oe.current.tb)){var Dh=Pr;Vh?Dh+=Pn-tn:Dh=Un.y-Fi.y-Ho;var ou=yh(Kn,Dh),Wh=yh(Kn,Dh,wn);ou>Ss||ou===Ss&&(!Je||Wh>=Nn)?(Oe.current.tb=!0,Pr=Dh,Ho=-Ho,Cn.points=[Ur(Xa,0),Ur(Ta,0)]):Oe.current.tb=!1}var Af=Du(Bs),Yc=Xa[1]===Ta[1];if(Af&&Xa[1]==="l"&&(ah>Rn.right||Oe.current.rl)){var Ku=Kn;Yc?Ku-=vn-so:Ku=Yr.x-ae.x-ua;var Df=yh(Ku,Pr),Jc=yh(Ku,Pr,wn);Df>Ss||Df===Ss&&(!Je||Jc>=Nn)?(Oe.current.rl=!0,Kn=Ku,ua=-ua,Cn.points=[Ur(Xa,1),Ur(Ta,1)]):Oe.current.rl=!1}if(Af&&Xa[1]==="r"&&(ku<Rn.left||Oe.current.lr)){var Bc=Kn;Yc?Bc+=vn-so:Bc=Un.x-Fi.x-ua;var Tc=yh(Bc,Pr),qc=yh(Bc,Pr,wn);Tc>Ss||Tc===Ss&&(!Je||qc>=Nn)?(Oe.current.lr=!0,Kn=Bc,ua=-ua,Cn.points=[Ur(Xa,1),Ur(Ta,1)]):Oe.current.lr=!1}Qc();var ur=sh===!0?0:sh;typeof ur=="number"&&(ku<wn.left&&(Kn-=ku-wn.left-ua,rn.x+so<wn.left+ur&&(Kn+=rn.x-wn.left+so-ur)),ah>wn.right&&(Kn-=ah-wn.right-ua,rn.x>wn.right-ur&&(Kn+=rn.x-wn.right+ur)));var Ih=Wl===!0?0:Wl;typeof Ih=="number"&&(cl<wn.top&&(Pr-=cl-wn.top-Ho,rn.y+tn<wn.top+Ih&&(Pr+=rn.y-wn.top+tn-Ih)),Ds>wn.bottom&&(Pr-=Ds-wn.bottom-Ho,rn.y>wn.bottom-Ih&&(Pr+=rn.y-wn.bottom+Ih)));var vh=tr.x+Kn,xa=vh+vn,Ul=tr.y+Pr,Iu=Ul+Pn,Uo=rn.x,ns=Uo+so,Zl=rn.y,Gl=Zl+tn,Cl=Math.max(vh,Uo),Ou=Math.min(xa,ns),Xl=(Cl+Ou)/2,Uh=Xl-vh,Ru=Math.max(Ul,Zl),Fs=Math.min(Iu,Gl),Oh=(Ru+Fs)/2,gf=Oh-Ul;Xt==null||Xt(V,Cn);var If=kr.right-tr.x-(Kn+tr.width),Of=kr.bottom-tr.y-(Pr+tr.height);Qe({ready:!0,offsetX:Kn/Ls,offsetY:Pr/As,offsetR:If/Ls,offsetB:Of/As,arrowX:Uh/Ls,arrowY:gf/As,scaleX:Ls,scaleY:As,align:Cn})}}),Mi=function(){Be.current+=1;var Ni=Be.current;Promise.resolve().then(function(){Be.current===Ni&&ri()})},Bi=function(){Qe(function(Ni){return(0,ft.Z)((0,ft.Z)({},Ni),{},{ready:!1})})};return ci(Bi,[dt]),ci(function(){R||Bi()},[R]),[ze.ready,ze.offsetX,ze.offsetY,ze.offsetR,ze.offsetB,ze.arrowX,ze.arrowY,ze.scaleX,ze.scaleY,ze.align,Mi]}function ko(R,V,at,dt,Dt){ci(function(){if(R&&V&&at){let Be=function(){dt(),Dt()};var _t=V,Xt=at,Ne=re(_t),Xe=re(Xt),ze=ut(Xt),Qe=new Set([ze].concat((0,Et.Z)(Ne),(0,Et.Z)(Xe)));return Qe.forEach(function(xi){xi.addEventListener("scroll",Be,{passive:!0})}),ze.addEventListener("resize",Be,{passive:!0}),dt(),function(){Qe.forEach(function(xi){xi.removeEventListener("scroll",Be),ze.removeEventListener("resize",Be)})}}},[R,V,at])}function Yo(R){var V=React.useRef(!1),at=React.useState(R),dt=_slicedToArray(at,2),Dt=dt[0],_t=dt[1];React.useEffect(function(){return V.current=!1,function(){V.current=!0}},[]);function Xt(Ne,Xe){Xe&&V.current||_t(Ne)}return[Dt,Xt]}function Oo(R){return R!==void 0}function Ms(R,V){var at=V||{},dt=at.defaultValue,Dt=at.value,_t=at.onChange,Xt=at.postState,Ne=useState(function(){return Oo(Dt)?Dt:Oo(dt)?typeof dt=="function"?dt():dt:typeof R=="function"?R():R}),Xe=_slicedToArray(Ne,2),ze=Xe[0],Qe=Xe[1],Be=Dt!==void 0?Dt:ze,xi=Xt?Xt(Be):Be,Oe=useEvent(_t),wi=useState([Be]),ri=_slicedToArray(wi,2),Mi=ri[0],Bi=ri[1];useLayoutUpdateEffect(function(){var Ni=Mi[0];ze!==Ni&&Oe(ze,Ni)},[Mi]),useLayoutUpdateEffect(function(){Oo(Dt)||Qe(Dt)},[Dt]);var Li=useEvent(function(Ni,Hi){Qe(Ni,Hi),Bi([Be],Hi)});return[xi,Li]}var na=j(71326);function Tt(R,V,at){var dt=Y.useRef({});return(!("value"in dt.current)||at(dt.current.condition,V))&&(dt.current.value=R(),dt.current.condition=V),dt.current.value}function yn(R,V){typeof R=="function"?R(V):(0,F.Z)(R)==="object"&&R&&"current"in R&&(R.current=V)}function Yn(){for(var R=arguments.length,V=new Array(R),at=0;at<R;at++)V[at]=arguments[at];var dt=V.filter(function(Dt){return Dt});return dt.length<=1?dt[0]:function(Dt){V.forEach(function(_t){yn(_t,Dt)})}}function Ir(){for(var R=arguments.length,V=new Array(R),at=0;at<R;at++)V[at]=arguments[at];return Tt(function(){return Yn.apply(void 0,V)},V,function(dt,Dt){return dt.length!==Dt.length||dt.every(function(_t,Xt){return _t!==Dt[Xt]})})}function ls(R){var V,at,dt=(0,na.isMemo)(R)?R.type.type:R.type;return!(typeof dt=="function"&&!((V=dt.prototype)!==null&&V!==void 0&&V.render)||typeof R=="function"&&!((at=R.prototype)!==null&&at!==void 0&&at.render))}function Jo(R){return!isValidElement(R)||isFragment(R)?!1:ls(R)}function ra(R,V,at,dt){if(!V.length)return at;var Dt=_toArray(V),_t=Dt[0],Xt=Dt.slice(1),Ne;return!R&&typeof _t=="number"?Ne=[]:Array.isArray(R)?Ne=_toConsumableArray(R):Ne=_objectSpread({},R),dt&&at===void 0&&Xt.length===1?delete Ne[_t][Xt[0]]:Ne[_t]=ra(Ne[_t],Xt,at,dt),Ne}function $s(R,V,at){var dt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return V.length&&dt&&at===void 0&&!get(R,V.slice(0,-1))?R:ra(R,V,at,dt)}function or(R){return _typeof(R)==="object"&&R!==null&&Object.getPrototypeOf(R)===Object.prototype}function eo(R){return Array.isArray(R)?[]:{}}var Fn=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function hn(){for(var R=arguments.length,V=new Array(R),at=0;at<R;at++)V[at]=arguments[at];var dt=eo(V[0]);return V.forEach(function(Dt){function _t(Xt,Ne){var Xe=new Set(Ne),ze=get(Dt,Xt),Qe=Array.isArray(ze);if(Qe||or(ze)){if(!Xe.has(ze)){Xe.add(ze);var Be=get(dt,Xt);Qe?dt=$s(dt,Xt,[]):(!Be||_typeof(Be)!=="object")&&(dt=$s(dt,Xt,eo(ze))),Fn(ze).forEach(function(xi){_t([].concat(_toConsumableArray(Xt),[xi]),Xe)})}}else dt=$s(dt,Xt,ze)}_t([])}),dt}var _r={},Or=[],Ai=function(V){Or.push(V)};function kl(R,V){if(0)var at}function El(R,V){if(0)var at}function Ua(){_r={}}function Sl(R,V,at){!V&&!_r[at]&&(R(!1,at),_r[at]=!0)}function xu(R,V){Sl(kl,R,V)}function di(R,V){Sl(El,R,V)}xu.preMessage=Ai,xu.resetWarned=Ua,xu.noteOnce=di;var jr=null,Fo=function(V){return+setTimeout(V,16)},Ca=function(V){return clearTimeout(V)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Fo=function(V){return window.requestAnimationFrame(V)},Ca=function(V){return window.cancelAnimationFrame(V)});var Ll=0,ol=new Map;function _n(R){ol.delete(R)}var Za=function(V){var at=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ll+=1;var dt=Ll;function Dt(_t){if(_t===0)_n(dt),V();else{var Xt=Fo(function(){Dt(_t-1)});ol.set(dt,Xt)}}return Dt(at),dt};Za.cancel=function(R){var V=ol.get(R);return _n(V),Ca(V)};var nu=Za;function Tl(R,V,at,dt,Dt,_t,Xt,Ne){var Xe=Y.useRef(R),ze=Y.useRef(!1);Xe.current!==R&&(ze.current=!0,Xe.current=R),Y.useEffect(function(){var Qe=nu(function(){ze.current=!1});return function(){nu.cancel(Qe)}},[R]),Y.useEffect(function(){if(V&&dt&&(!Dt||_t)){var Qe=function(){var In=!1,nn=function(gr){var kn=gr.target;In=Xt(kn)},vo=function(gr){var kn=gr.target;!ze.current&&Xe.current&&!In&&!Xt(kn)&&Ne(!1)};return[nn,vo]},Be=Qe(),xi=(0,ct.Z)(Be,2),Oe=xi[0],wi=xi[1],ri=Qe(),Mi=(0,ct.Z)(ri,2),Bi=Mi[0],Li=Mi[1],Ni=ut(dt);Ni.addEventListener("mousedown",Oe,!0),Ni.addEventListener("click",wi,!0),Ni.addEventListener("contextmenu",wi,!0);var Hi=Wo(at);if(Hi&&(Hi.addEventListener("mousedown",Bi,!0),Hi.addEventListener("click",Li,!0),Hi.addEventListener("contextmenu",Li,!0)),0)var Gn,cn,ir,Qn;return function(){Ni.removeEventListener("mousedown",Oe,!0),Ni.removeEventListener("click",wi,!0),Ni.removeEventListener("contextmenu",wi,!0),Hi&&(Hi.removeEventListener("mousedown",Bi,!0),Hi.removeEventListener("click",Li,!0),Hi.removeEventListener("contextmenu",Li,!0))}}},[V,at,dt,Dt,_t])}function uu(R){return R instanceof HTMLElement||R instanceof SVGElement}function _h(R){return uu(R)?R:R instanceof Y.Component?He.findDOMNode(R):null}function hu(R,V){var at={};return at[R.toLowerCase()]=V.toLowerCase(),at["Webkit".concat(R)]="webkit".concat(V),at["Moz".concat(R)]="moz".concat(V),at["ms".concat(R)]="MS".concat(V),at["O".concat(R)]="o".concat(V.toLowerCase()),at}function ml(R,V){var at={animationend:hu("Animation","AnimationEnd"),transitionend:hu("Transition","TransitionEnd")};return R&&("AnimationEvent"in V||delete at.animationend.animation,"TransitionEvent"in V||delete at.transitionend.transition),at}var sl=ml(Fe(),typeof window!="undefined"?window:{}),Js={};if(Fe()){var $u=document.createElement("div");Js=$u.style}var Nu={};function df(R){if(Nu[R])return Nu[R];var V=sl[R];if(V)for(var at=Object.keys(V),dt=at.length,Dt=0;Dt<dt;Dt+=1){var _t=at[Dt];if(Object.prototype.hasOwnProperty.call(V,_t)&&_t in Js)return Nu[R]=V[_t],Nu[R]}return""}var jh=df("animationend"),cu=df("transitionend"),Zu=!!(jh&&cu),js=jh||"animationend",gh=cu||"transitionend";function yc(R,V){if(!R)return null;if((0,F.Z)(R)==="object"){var at=V.replace(/-\w/g,function(dt){return dt[1].toUpperCase()});return R[at]}return"".concat(R,"-").concat(V)}var Gu="none",ds="appear",xc="enter",za="leave",wu="none",fu="prepare",al="start",gl="active",qa="end",ka=function(V){return+setTimeout(V,16)},bu=function(V){return clearTimeout(V)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ka=function(V){return window.requestAnimationFrame(V)},bu=function(V){return window.cancelAnimationFrame(V)});var rc=0,Hs=new Map;function Xc(R){Hs.delete(R)}var wc=function(V){var at=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;rc+=1;var dt=rc;function Dt(_t){if(_t===0)Xc(dt),V();else{var Xt=ka(function(){Dt(_t-1)});Hs.set(dt,Xt)}}return Dt(at),dt};wc.cancel=function(R){var V=Hs.get(R);return Xc(V),bu(V)};var bc=wc,dn=function(){var R=Y.useRef(null);function V(){bc.cancel(R.current)}function at(dt){var Dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;V();var _t=bc(function(){Dt<=1?dt({isCanceled:function(){return _t!==R.current}}):at(dt,Dt-1)});R.current=_t}return Y.useEffect(function(){return function(){V()}},[]),[at,V]},Oc=Fe()?Y.useLayoutEffect:Y.useEffect,xt=Oc,ve=[fu,al,gl,qa],Kh=!1,Sc=!0;function Ph(R){return R===gl||R===qa}var Nh=function(R,V){var at=Q(wu),dt=(0,ct.Z)(at,2),Dt=dt[0],_t=dt[1],Xt=dn(),Ne=(0,ct.Z)(Xt,2),Xe=Ne[0],ze=Ne[1];function Qe(){_t(fu,!0)}return xt(function(){if(Dt!==wu&&Dt!==qa){var Be=ve.indexOf(Dt),xi=ve[Be+1],Oe=V(Dt);Oe===Kh?_t(xi,!0):Xe(function(wi){function ri(){wi.isCanceled()||_t(xi,!0)}Oe===!0?ri():Promise.resolve(Oe).then(ri)})}},[R,Dt]),Y.useEffect(function(){return function(){ze()}},[]),[Qe,Dt]},Su=function(R){var V=(0,Y.useRef)(),at=(0,Y.useRef)(R);at.current=R;var dt=Y.useCallback(function(Xt){at.current(Xt)},[]);function Dt(Xt){Xt&&(Xt.removeEventListener(gh,dt),Xt.removeEventListener(js,dt))}function _t(Xt){V.current&&V.current!==Xt&&Dt(V.current),Xt&&Xt!==V.current&&(Xt.addEventListener(gh,dt),Xt.addEventListener(js,dt),V.current=Xt)}return Y.useEffect(function(){return function(){Dt(V.current)}},[]),[_t,Dt]};function Mc(R,V,at,dt){var Dt=dt.motionEnter,_t=Dt===void 0?!0:Dt,Xt=dt.motionAppear,Ne=Xt===void 0?!0:Xt,Xe=dt.motionLeave,ze=Xe===void 0?!0:Xe,Qe=dt.motionDeadline,Be=dt.motionLeaveImmediately,xi=dt.onAppearPrepare,Oe=dt.onEnterPrepare,wi=dt.onLeavePrepare,ri=dt.onAppearStart,Mi=dt.onEnterStart,Bi=dt.onLeaveStart,Li=dt.onAppearActive,Ni=dt.onEnterActive,Hi=dt.onLeaveActive,Gn=dt.onAppearEnd,cn=dt.onEnterEnd,ir=dt.onLeaveEnd,Qn=dt.onVisibleChanged,Xr=Q(),In=(0,ct.Z)(Xr,2),nn=In[0],vo=In[1],Kr=Q(Gu),gr=(0,ct.Z)(Kr,2),kn=gr[0],ji=gr[1],rn=Q(null),On=(0,ct.Z)(rn,2),tr=On[0],Ws=On[1],Ct=(0,Y.useRef)(!1),_o=(0,Y.useRef)(null);function Mn(){return at()}var jn=(0,Y.useRef)(!1);function ws(br){var wn=Mn();if(!(br&&!br.deadline&&br.target!==wn)){var lr=jn.current,Rn;kn===ds&&lr?Rn=Gn==null?void 0:Gn(wn,br):kn===xc&&lr?Rn=cn==null?void 0:cn(wn,br):kn===za&&lr&&(Rn=ir==null?void 0:ir(wn,br)),kn!==Gu&&lr&&Rn!==!1&&(ji(Gu,!0),Ws(null,!0))}}var Ea=Su(ws),Pn=(0,ct.Z)(Ea,1),vn=Pn[0],tn=Y.useMemo(function(){var br,wn,lr;switch(kn){case ds:return br={},(0,gt.Z)(br,fu,xi),(0,gt.Z)(br,al,ri),(0,gt.Z)(br,gl,Li),br;case xc:return wn={},(0,gt.Z)(wn,fu,Oe),(0,gt.Z)(wn,al,Mi),(0,gt.Z)(wn,gl,Ni),wn;case za:return lr={},(0,gt.Z)(lr,fu,wi),(0,gt.Z)(lr,al,Bi),(0,gt.Z)(lr,gl,Hi),lr;default:return{}}},[kn]),so=Nh(kn,function(br){if(br===fu){var wn=tn[fu];return wn?wn(Mn()):Kh}if(ar in tn){var lr;Ws(((lr=tn[ar])===null||lr===void 0?void 0:lr.call(tn,Mn(),null))||null)}return ar===gl&&(vn(Mn()),Qe>0&&(clearTimeout(_o.current),_o.current=setTimeout(function(){ws({deadline:!0})},Qe))),Sc}),Po=(0,ct.Z)(so,2),No=Po[0],ar=Po[1],Mo=Ph(ar);jn.current=Mo,xt(function(){vo(V);var br=Ct.current;if(Ct.current=!0,!!R){var wn;!br&&V&&Ne&&(wn=ds),br&&V&&_t&&(wn=xc),(br&&!V&&ze||!br&&Be&&!V&&ze)&&(wn=za),wn&&(ji(wn),No())}},[V]),(0,Y.useEffect)(function(){(kn===ds&&!Ne||kn===xc&&!_t||kn===za&&!ze)&&ji(Gu)},[Ne,_t,ze]),(0,Y.useEffect)(function(){return function(){Ct.current=!1,clearTimeout(_o.current)}},[]);var qo=Y.useRef(!1);(0,Y.useEffect)(function(){nn&&(qo.current=!0),nn!==void 0&&kn===Gu&&((qo.current||nn)&&(Qn==null||Qn(nn)),qo.current=!0)},[nn,kn]);var Je=tr;return tn[fu]&&ar===al&&(Je=(0,ft.Z)({transition:"none"},Je)),[kn,ar,Je,nn!=null?nn:V]}var Cc=j(15671),fa=j(43144),zn=j(60136),vl=j(51630),Al=function(R){(0,zn.Z)(at,R);var V=(0,vl.Z)(at);function at(){return(0,Cc.Z)(this,at),V.apply(this,arguments)}return(0,fa.Z)(at,[{key:"render",value:function(){return this.props.children}}]),at}(Y.Component),oa=Al;function po(R){var V=R;(0,F.Z)(R)==="object"&&(V=R.transitionSupport);function at(Dt){return!!(Dt.motionName&&V)}var dt=Y.forwardRef(function(Dt,_t){var Xt=Dt.visible,Ne=Xt===void 0?!0:Xt,Xe=Dt.removeOnLeave,ze=Xe===void 0?!0:Xe,Qe=Dt.forceRender,Be=Dt.children,xi=Dt.motionName,Oe=Dt.leavedClassName,wi=Dt.eventProps,ri=at(Dt),Mi=(0,Y.useRef)(),Bi=(0,Y.useRef)();function Li(){try{return Mi.current instanceof HTMLElement?Mi.current:_h(Bi.current)}catch(rn){return null}}var Ni=Mc(ri,Ne,Li,Dt),Hi=(0,ct.Z)(Ni,4),Gn=Hi[0],cn=Hi[1],ir=Hi[2],Qn=Hi[3],Xr=Y.useRef(Qn);Qn&&(Xr.current=!0);var In=Y.useCallback(function(rn){Mi.current=rn,pi(_t,rn)},[_t]),nn,vo=(0,ft.Z)((0,ft.Z)({},wi),{},{visible:Ne});if(!Be)nn=null;else if(Gn===Gu||!at(Dt))Qn?nn=Be((0,ft.Z)({},vo),In):!ze&&Xr.current&&Oe?nn=Be((0,ft.Z)((0,ft.Z)({},vo),{},{className:Oe}),In):Qe||!ze&&!Oe?nn=Be((0,ft.Z)((0,ft.Z)({},vo),{},{style:{display:"none"}}),In):nn=null;else{var Kr,gr;cn===fu?gr="prepare":Ph(cn)?gr="active":cn===al&&(gr="start"),nn=Be((0,ft.Z)((0,ft.Z)({},vo),{},{className:At()(yc(xi,Gn),(Kr={},(0,gt.Z)(Kr,yc(xi,"".concat(Gn,"-").concat(gr)),gr),(0,gt.Z)(Kr,xi,typeof xi=="string"),Kr)),style:ir}),In)}if(Y.isValidElement(nn)&&Ki(nn)){var kn=nn,ji=kn.ref;ji||(nn=Y.cloneElement(nn,{ref:In}))}return Y.createElement(oa,{ref:Bi},nn)});return dt.displayName="CSSMotion",dt}var $a=po(Zu),ps=j(97326),sr="add",Vs="keep",_s="remove",sa="removed";function mo(R){var V;return R&&(0,F.Z)(R)==="object"&&"key"in R?V=R:V={key:R},(0,ft.Z)((0,ft.Z)({},V),{},{key:String(V.key)})}function Hl(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return R.map(mo)}function us(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],at=[],dt=0,Dt=V.length,_t=Hl(R),Xt=Hl(V);_t.forEach(function(ze){for(var Qe=!1,Be=dt;Be<Dt;Be+=1){var xi=Xt[Be];if(xi.key===ze.key){dt<Be&&(at=at.concat(Xt.slice(dt,Be).map(function(Oe){return(0,ft.Z)((0,ft.Z)({},Oe),{},{status:sr})})),dt=Be),at.push((0,ft.Z)((0,ft.Z)({},xi),{},{status:Vs})),dt+=1,Qe=!0;break}}Qe||at.push((0,ft.Z)((0,ft.Z)({},ze),{},{status:_s}))}),dt<Dt&&(at=at.concat(Xt.slice(dt).map(function(ze){return(0,ft.Z)((0,ft.Z)({},ze),{},{status:sr})})));var Ne={};at.forEach(function(ze){var Qe=ze.key;Ne[Qe]=(Ne[Qe]||0)+1});var Xe=Object.keys(Ne).filter(function(ze){return Ne[ze]>1});return Xe.forEach(function(ze){at=at.filter(function(Qe){var Be=Qe.key,xi=Qe.status;return Be!==ze||xi!==_s}),at.forEach(function(Qe){Qe.key===ze&&(Qe.status=Vs)})}),at}var qs=["component","children","onVisibleChanged","onAllRemoved"],aa=["status"],Ga=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ms(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$a,at=function(dt){(0,zn.Z)(_t,dt);var Dt=(0,vl.Z)(_t);function _t(){var Xt;(0,Cc.Z)(this,_t);for(var Ne=arguments.length,Xe=new Array(Ne),ze=0;ze<Ne;ze++)Xe[ze]=arguments[ze];return Xt=Dt.call.apply(Dt,[this].concat(Xe)),(0,gt.Z)((0,ps.Z)(Xt),"state",{keyEntities:[]}),(0,gt.Z)((0,ps.Z)(Xt),"removeKey",function(Qe){var Be=Xt.state.keyEntities,xi=Be.map(function(Oe){return Oe.key!==Qe?Oe:(0,ft.Z)((0,ft.Z)({},Oe),{},{status:sa})});return Xt.setState({keyEntities:xi}),xi.filter(function(Oe){var wi=Oe.status;return wi!==sa}).length}),Xt}return(0,fa.Z)(_t,[{key:"render",value:function(){var Ne=this,Xe=this.state.keyEntities,ze=this.props,Qe=ze.component,Be=ze.children,xi=ze.onVisibleChanged,Oe=ze.onAllRemoved,wi=(0,ot.Z)(ze,qs),ri=Qe||Y.Fragment,Mi={};return Ga.forEach(function(Bi){Mi[Bi]=wi[Bi],delete wi[Bi]}),delete wi.keys,Y.createElement(ri,wi,Xe.map(function(Bi){var Li=Bi.status,Ni=(0,ot.Z)(Bi,aa),Hi=Li===sr||Li===Vs;return Y.createElement(V,(0,vt.Z)({},Mi,{key:Ni.key,visible:Hi,eventProps:Ni,onVisibleChanged:function(cn){if(xi==null||xi(cn,{key:Ni.key}),!cn){var ir=Ne.removeKey(Ni.key);ir===0&&Oe&&Oe()}}}),Be)}))}}],[{key:"getDerivedStateFromProps",value:function(Ne,Xe){var ze=Ne.keys,Qe=Xe.keyEntities,Be=Hl(ze),xi=us(Qe,Be);return{keyEntities:xi.filter(function(Oe){var wi=Qe.find(function(ri){var Mi=ri.key;return Oe.key===Mi});return!(wi&&wi.status===sa&&Oe.status===_s)})}}}]),_t}(Y.Component);return(0,gt.Z)(at,"defaultProps",{component:"div"}),at}var pf=ms(Zu),Jn=$a;function Ad(R){var V=R.prefixCls,at=R.align,dt=R.arrow,Dt=R.arrowPos,_t=dt||{},Xt=_t.className,Ne=_t.content,Xe=Dt.x,ze=Xe===void 0?0:Xe,Qe=Dt.y,Be=Qe===void 0?0:Qe,xi=Y.useRef();if(!at||!at.points)return null;var Oe={position:"absolute"};if(at.autoArrow!==!1){var wi=at.points[0],ri=at.points[1],Mi=wi[0],Bi=wi[1],Li=ri[0],Ni=ri[1];Mi===Li||!["t","b"].includes(Mi)?Oe.top=Be:Mi==="t"?Oe.top=0:Oe.bottom=0,Bi===Ni||!["l","r"].includes(Bi)?Oe.left=ze:Bi==="l"?Oe.left=0:Oe.right=0}return Y.createElement("div",{ref:xi,className:At()("".concat(V,"-arrow"),Xt),style:Oe},Ne)}function Rr(R){var V=R.prefixCls,at=R.open,dt=R.zIndex,Dt=R.mask,_t=R.motion;return Dt?Y.createElement(Jn,(0,vt.Z)({},_t,{motionAppear:!0,visible:at,removeOnLeave:!0}),function(Xt){var Ne=Xt.className;return Y.createElement("div",{style:{zIndex:dt},className:At()("".concat(V,"-mask"),Ne)})}):null}var kc=Y.memo(function(R){var V=R.children;return V},function(R,V){return V.cache}),Ah=kc,Pf=Y.forwardRef(function(R,V){var at=R.popup,dt=R.className,Dt=R.prefixCls,_t=R.style,Xt=R.target,Ne=R.onVisibleChanged,Xe=R.open,ze=R.keepDom,Qe=R.fresh,Be=R.onClick,xi=R.mask,Oe=R.arrow,wi=R.arrowPos,ri=R.align,Mi=R.motion,Bi=R.maskMotion,Li=R.forceRender,Ni=R.getPopupContainer,Hi=R.autoDestroy,Gn=R.portal,cn=R.zIndex,ir=R.onMouseEnter,Qn=R.onMouseLeave,Xr=R.onPointerEnter,In=R.ready,nn=R.offsetX,vo=R.offsetY,Kr=R.offsetR,gr=R.offsetB,kn=R.onAlign,ji=R.onPrepare,rn=R.stretch,On=R.targetWidth,tr=R.targetHeight,Ws=typeof at=="function"?at():at,Ct=Xe||ze,_o=(Ni==null?void 0:Ni.length)>0,Mn=Y.useState(!Ni||!_o),jn=(0,ct.Z)(Mn,2),ws=jn[0],Ea=jn[1];if(ci(function(){!ws&&_o&&Xt&&Ea(!0)},[ws,_o,Xt]),!ws)return null;var Pn="auto",vn={left:"-1000vw",top:"-1000vh",right:Pn,bottom:Pn};if(In||!Xe){var tn,so=ri.points,Po=ri.dynamicInset||((tn=ri._experimental)===null||tn===void 0?void 0:tn.dynamicInset),No=Po&&so[0][1]==="r",ar=Po&&so[0][0]==="b";No?(vn.right=Kr,vn.left=Pn):(vn.left=nn,vn.right=Pn),ar?(vn.bottom=gr,vn.top=Pn):(vn.top=vo,vn.bottom=Pn)}var Mo={};return rn&&(rn.includes("height")&&tr?Mo.height=tr:rn.includes("minHeight")&&tr&&(Mo.minHeight=tr),rn.includes("width")&&On?Mo.width=On:rn.includes("minWidth")&&On&&(Mo.minWidth=On)),Xe||(Mo.pointerEvents="none"),Y.createElement(Gn,{open:Li||Ct,getContainer:Ni&&function(){return Ni(Xt)},autoDestroy:Hi},Y.createElement(Rr,{prefixCls:Dt,open:Xe,zIndex:cn,mask:xi,motion:Bi}),Y.createElement(D.Z,{onResize:kn,disabled:!Xe},function(qo){return Y.createElement(Jn,(0,vt.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Li,leavedClassName:"".concat(Dt,"-hidden")},Mi,{onAppearPrepare:ji,onEnterPrepare:ji,visible:Xe,onVisibleChanged:function(br){var wn;Mi==null||(wn=Mi.onVisibleChanged)===null||wn===void 0||wn.call(Mi,br),Ne(br)}}),function(Je,br){var wn=Je.className,lr=Je.style,Rn=At()(Dt,wn,dt);return Y.createElement("div",{ref:Yn(qo,V,br),className:Rn,style:(0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)({"--arrow-x":"".concat(wi.x||0,"px"),"--arrow-y":"".concat(wi.y||0,"px")},vn),Mo),lr),{},{boxSizing:"border-box",zIndex:cn},_t),onMouseEnter:ir,onMouseLeave:Qn,onPointerEnter:Xr,onClick:Be},Oe&&Y.createElement(Ad,{prefixCls:Dt,arrow:Oe,arrowPos:wi,align:ri}),Y.createElement(Ah,{cache:!Xe&&!Qe},Ws))})}))}),Yf=Pf,mf=Y.forwardRef(function(R,V){var at=R.children,dt=R.getTriggerDOMNode,Dt=ls(at),_t=Y.useCallback(function(Ne){yn(V,dt?dt(Ne):Ne)},[dt]),Xt=Ir(_t,at.ref);return Dt?Y.cloneElement(at,{ref:Xt}):at}),Hh=mf,Rc=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function as(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tr,V=Y.forwardRef(function(at,dt){var Dt=at.prefixCls,_t=Dt===void 0?"rc-trigger-popup":Dt,Xt=at.children,Ne=at.action,Xe=Ne===void 0?"hover":Ne,ze=at.showAction,Qe=at.hideAction,Be=at.popupVisible,xi=at.defaultPopupVisible,Oe=at.onPopupVisibleChange,wi=at.afterPopupVisibleChange,ri=at.mouseEnterDelay,Mi=at.mouseLeaveDelay,Bi=Mi===void 0?.1:Mi,Li=at.focusDelay,Ni=at.blurDelay,Hi=at.mask,Gn=at.maskClosable,cn=Gn===void 0?!0:Gn,ir=at.getPopupContainer,Qn=at.forceRender,Xr=at.autoDestroy,In=at.destroyPopupOnHide,nn=at.popup,vo=at.popupClassName,Kr=at.popupStyle,gr=at.popupPlacement,kn=at.builtinPlacements,ji=kn===void 0?{}:kn,rn=at.popupAlign,On=at.zIndex,tr=at.stretch,Ws=at.getPopupClassNameFromAlign,Ct=at.fresh,_o=at.alignPoint,Mn=at.onPopupClick,jn=at.onPopupAlign,ws=at.arrow,Ea=at.popupMotion,Pn=at.maskMotion,vn=at.popupTransitionName,tn=at.popupAnimation,so=at.maskTransitionName,Po=at.maskAnimation,No=at.className,ar=at.getTriggerDOMNode,Mo=(0,ot.Z)(at,Rc),qo=Xr||In||!1,Je=Y.useState(!1),br=(0,ct.Z)(Je,2),wn=br[0],lr=br[1];ci(function(){lr(G())},[]);var Rn=Y.useRef({}),kr=Y.useContext(zs),Ls=Y.useMemo(function(){return{registerSubPopup:function(O,W){Rn.current[O]=W,kr==null||kr.registerSubPopup(O,W)}}},[kr]),As=Nr(),Gr=Y.useState(null),ma=(0,ct.Z)(Gr,2),Qo=ma[0],bs=ma[1],ua=te(function(E){yr(E)&&Qo!==E&&bs(E),kr==null||kr.registerSubPopup(As,E)}),Ho=Y.useState(null),La=(0,ct.Z)(Ho,2),Eo=La[0],Rs=La[1],Us=te(function(E){yr(E)&&Eo!==E&&Rs(E)}),Vo=Y.Children.only(Xt),ha=(Vo==null?void 0:Vo.props)||{},Zs={},Vl=te(function(E){var O,W,H=Eo;return(H==null?void 0:H.contains(E))||((O=Wo(H))===null||O===void 0?void 0:O.host)===E||E===H||(Qo==null?void 0:Qo.contains(E))||((W=Wo(Qo))===null||W===void 0?void 0:W.host)===E||E===Qo||Object.values(Rn.current).some(function(nt){return(nt==null?void 0:nt.contains(E))||E===nt})}),Ta=rt(_t,Ea,tn,vn),Xa=rt(_t,Pn,Po,so),Yu=Y.useState(xi||!1),Ts=(0,ct.Z)(Yu,2),Cn=Ts[0],Kn=Ts[1],Pr=Be!=null?Be:Cn,Ss=te(function(E){Be===void 0&&Kn(E)});ci(function(){Kn(Be||!1)},[Be]);var Nn=Y.useRef(Pr);Nn.current=Pr;var Yr=te(function(E){(0,He.flushSync)(function(){Pr!==E&&(Ss(E),Oe==null||Oe(E))})}),Fi=Y.useRef(),Un=function(){clearTimeout(Fi.current)},ae=function(O){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Un(),W===0?Yr(O):Fi.current=setTimeout(function(){Yr(O)},W*1e3)};Y.useEffect(function(){return Un},[]);var to=Y.useState(!1),Bs=(0,ct.Z)(to,2),_a=Bs[0],sh=Bs[1];ci(function(E){(!E||Pr)&&sh(!0)},[Pr]);var Wl=Y.useState(null),Du=(0,ct.Z)(Wl,2),cl=Du[0],Ds=Du[1],ku=Y.useState([0,0]),ah=(0,ct.Z)(ku,2),Lc=ah[0],Vh=ah[1],mu=function(O){Vh([O.clientX,O.clientY])},Nf=Zn(Pr,Qo,_o?Lc:Eo,gr,ji,rn,jn),gu=(0,ct.Z)(Nf,11),Dh=gu[0],ou=gu[1],Wh=gu[2],Af=gu[3],Yc=gu[4],Ku=gu[5],Df=gu[6],Jc=gu[7],Bc=gu[8],Tc=gu[9],qc=gu[10],ur=ia(wn,Xe,ze,Qe),Ih=(0,ct.Z)(ur,2),vh=Ih[0],xa=Ih[1],Ul=vh.has("click"),Iu=xa.has("click")||xa.has("contextMenu"),Uo=te(function(){_a||qc()}),ns=function(){Nn.current&&_o&&Iu&&ae(!1)};ko(Pr,Eo,Qo,Uo,ns),ci(function(){Uo()},[Lc,gr]),ci(function(){Pr&&!(ji!=null&&ji[gr])&&Uo()},[JSON.stringify(rn)]);var Zl=Y.useMemo(function(){var E=Th(ji,_t,Tc,_o);return At()(E,Ws==null?void 0:Ws(Tc))},[Tc,Ws,ji,_t,_o]);Y.useImperativeHandle(dt,function(){return{forceAlign:Uo}});var Gl=Y.useState(0),Cl=(0,ct.Z)(Gl,2),Ou=Cl[0],Xl=Cl[1],Uh=Y.useState(0),Ru=(0,ct.Z)(Uh,2),Fs=Ru[0],Oh=Ru[1],gf=function(){if(tr&&Eo){var O=Eo.getBoundingClientRect();Xl(O.width),Oh(O.height)}},If=function(){gf(),Uo()},Of=function(O){sh(!1),qc(),wi==null||wi(O)},yh=function(){return new Promise(function(O){gf(),Ds(function(){return O})})};ci(function(){cl&&(qc(),cl(),Ds(null))},[cl]);function Qc(E,O,W,H){Zs[E]=function(nt){var Rt;H==null||H(nt),ae(O,W);for(var pt=arguments.length,oe=new Array(pt>1?pt-1:0),Jt=1;Jt<pt;Jt++)oe[Jt-1]=arguments[Jt];(Rt=ha[E])===null||Rt===void 0||Rt.call.apply(Rt,[ha,nt].concat(oe))}}(Ul||Iu)&&(Zs.onClick=function(E){var O;Nn.current&&Iu?ae(!1):!Nn.current&&Ul&&(mu(E),ae(!0));for(var W=arguments.length,H=new Array(W>1?W-1:0),nt=1;nt<W;nt++)H[nt-1]=arguments[nt];(O=ha.onClick)===null||O===void 0||O.call.apply(O,[ha,E].concat(H))}),Tl(Pr,Iu,Eo,Qo,Hi,cn,Vl,ae);var Ka=vh.has("hover"),Zh=xa.has("hover"),Ju,Eu;Ka&&(Qc("onMouseEnter",!0,ri,function(E){mu(E)}),Qc("onPointerEnter",!0,ri,function(E){mu(E)}),Ju=function(){(Pr||_a)&&ae(!0,ri)},_o&&(Zs.onMouseMove=function(E){var O;(O=ha.onMouseMove)===null||O===void 0||O.call(ha,E)})),Zh&&(Qc("onMouseLeave",!1,Bi),Qc("onPointerLeave",!1,Bi),Eu=function(){ae(!1,Bi)}),vh.has("focus")&&Qc("onFocus",!0,Li),xa.has("focus")&&Qc("onBlur",!1,Ni),vh.has("contextMenu")&&(Zs.onContextMenu=function(E){var O;Nn.current&&xa.has("contextMenu")?ae(!1):(mu(E),ae(!0)),E.preventDefault();for(var W=arguments.length,H=new Array(W>1?W-1:0),nt=1;nt<W;nt++)H[nt-1]=arguments[nt];(O=ha.onContextMenu)===null||O===void 0||O.call.apply(O,[ha,E].concat(H))}),No&&(Zs.className=At()(ha.className,No));var qu=(0,ft.Z)((0,ft.Z)({},ha),Zs),h={},d=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];d.forEach(function(E){Mo[E]&&(h[E]=function(){for(var O,W=arguments.length,H=new Array(W),nt=0;nt<W;nt++)H[nt]=arguments[nt];(O=qu[E])===null||O===void 0||O.call.apply(O,[qu].concat(H)),Mo[E].apply(Mo,H)})});var x=Y.cloneElement(Vo,(0,ft.Z)((0,ft.Z)({},qu),h)),y={x:Ku,y:Df},S=ws?(0,ft.Z)({},ws!==!0?ws:{}):null;return Y.createElement(Y.Fragment,null,Y.createElement(D.Z,{disabled:!Pr,ref:Us,onResize:If},Y.createElement(Hh,{getTriggerDOMNode:ar},x)),Y.createElement(zs.Provider,{value:Ls},Y.createElement(Yf,{portal:R,ref:ua,prefixCls:_t,popup:nn,className:At()(vo,Zl),style:Kr,target:Eo,onMouseEnter:Ju,onMouseLeave:Eu,onPointerEnter:Ju,zIndex:On,open:Pr,keepDom:_a,fresh:Ct,onClick:Mn,mask:Hi,motion:Ta,maskMotion:Xa,onVisibleChanged:Of,onPrepare:yh,forceRender:Qn,autoDestroy:qo,getPopupContainer:ir,align:Tc,arrow:S,arrowPos:y,ready:Dh,offsetX:ou,offsetY:Wh,offsetR:Af,offsetB:Yc,onAlign:Uo,stretch:tr,targetWidth:Ou/Jc,targetHeight:Fs/Bc})))});return V}var oc=as(Tr),Jf=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],oh=function(V){var at=V===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:at,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:at,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:at,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:at,adjustY:1},htmlRegion:"scroll"}}},dd=function(V,at){var dt=V.prefixCls,Dt=V.disabled,_t=V.visible,Xt=V.children,Ne=V.popupElement,Xe=V.animation,ze=V.transitionName,Qe=V.dropdownStyle,Be=V.dropdownClassName,xi=V.direction,Oe=xi===void 0?"ltr":xi,wi=V.placement,ri=V.builtinPlacements,Mi=V.dropdownMatchSelectWidth,Bi=V.dropdownRender,Li=V.dropdownAlign,Ni=V.getPopupContainer,Hi=V.empty,Gn=V.getTriggerDOMNode,cn=V.onPopupVisibleChange,ir=V.onPopupMouseEnter,Qn=(0,ot.Z)(V,Jf),Xr="".concat(dt,"-dropdown"),In=Ne;Bi&&(In=Bi(Ne));var nn=Y.useMemo(function(){return ri||oh(Mi)},[ri,Mi]),vo=Xe?"".concat(Xr,"-").concat(Xe):ze,Kr=typeof Mi=="number",gr=Y.useMemo(function(){return Kr?null:Mi===!1?"minWidth":"width"},[Mi,Kr]),kn=Qe;Kr&&(kn=(0,ft.Z)((0,ft.Z)({},kn),{},{width:Mi}));var ji=Y.useRef(null);return Y.useImperativeHandle(at,function(){return{getPopupElement:function(){return ji.current}}}),Y.createElement(oc,(0,vt.Z)({},Qn,{showAction:cn?["click"]:[],hideAction:cn?["click"]:[],popupPlacement:wi||(Oe==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:nn,prefixCls:Xr,popupTransitionName:vo,popup:Y.createElement("div",{ref:ji,onMouseEnter:ir},In),stretch:gr,popupAlign:Li,popupVisible:_t,getPopupContainer:Ni,popupClassName:At()(Be,(0,gt.Z)({},"".concat(Xr,"-empty"),Hi)),popupStyle:kn,getTriggerDOMNode:Gn,onPopupVisibleChange:cn}),Xt)},sc=Y.forwardRef(dd);sc.displayName="SelectTrigger";var Mu=sc,Ec=j(84506);function Z(R,V){var at=R.key,dt;return"value"in R&&(dt=R.value),at!=null?at:dt!==void 0?dt:"rc-index-key-".concat(V)}function ht(R,V){var at=R||{},dt=at.label,Dt=at.value,_t=at.options,Xt=at.groupLabel,Ne=dt||(V?"children":"label");return{label:Ne,value:Dt||"value",options:_t||"options",groupLabel:Xt||Ne}}function wt(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},at=V.fieldNames,dt=V.childrenAsData,Dt=[],_t=ht(at,!1),Xt=_t.label,Ne=_t.value,Xe=_t.options,ze=_t.groupLabel;function Qe(Be,xi){Be.forEach(function(Oe){if(xi||!(Xe in Oe)){var wi=Oe[Ne];Dt.push({key:Z(Oe,Dt.length),groupOption:xi,data:Oe,label:Oe[Xt],value:wi})}else{var ri=Oe[ze];ri===void 0&&dt&&(ri=Oe.label),Dt.push({key:Z(Oe,Dt.length),group:!0,data:Oe,label:ri}),Qe(Oe[Xe],!0)}})}return Qe(R,!1),Dt}function Ft(R){var V=(0,ft.Z)({},R);return"props"in V||Object.defineProperty(V,"props",{get:function(){return _e(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),V}}),V}function Ut(R,V){if(!V||!V.length)return null;var at=!1;function dt(_t,Xt){var Ne=(0,Ec.Z)(Xt),Xe=Ne[0],ze=Ne.slice(1);if(!Xe)return[_t];var Qe=_t.split(Xe);return at=at||Qe.length>1,Qe.reduce(function(Be,xi){return[].concat((0,Et.Z)(Be),(0,Et.Z)(dt(xi,ze)))},[]).filter(function(Be){return Be})}var Dt=dt(R,V);return at?Dt:null}var Ie=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],ke=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function Ri(R){return R==="tags"||R==="multiple"}var qi=Y.forwardRef(function(R,V){var at,dt,Dt=R.id,_t=R.prefixCls,Xt=R.className,Ne=R.showSearch,Xe=R.tagRender,ze=R.direction,Qe=R.omitDomProps,Be=R.displayValues,xi=R.onDisplayValuesChange,Oe=R.emptyOptions,wi=R.notFoundContent,ri=wi===void 0?"Not Found":wi,Mi=R.onClear,Bi=R.mode,Li=R.disabled,Ni=R.loading,Hi=R.getInputElement,Gn=R.getRawInputElement,cn=R.open,ir=R.defaultOpen,Qn=R.onDropdownVisibleChange,Xr=R.activeValue,In=R.onActiveValueChange,nn=R.activeDescendantId,vo=R.searchValue,Kr=R.autoClearSearchValue,gr=R.onSearch,kn=R.onSearchSplit,ji=R.tokenSeparators,rn=R.allowClear,On=R.suffixIcon,tr=R.clearIcon,Ws=R.OptionList,Ct=R.animation,_o=R.transitionName,Mn=R.dropdownStyle,jn=R.dropdownClassName,ws=R.dropdownMatchSelectWidth,Ea=R.dropdownRender,Pn=R.dropdownAlign,vn=R.placement,tn=R.builtinPlacements,so=R.getPopupContainer,Po=R.showAction,No=Po===void 0?[]:Po,ar=R.onFocus,Mo=R.onBlur,qo=R.onKeyUp,Je=R.onKeyDown,br=R.onMouseDown,wn=(0,ot.Z)(R,Ie),lr=Ri(Bi),Rn=(Ne!==void 0?Ne:lr)||Bi==="combobox",kr=(0,ft.Z)({},wn);ke.forEach(function(Uo){delete kr[Uo]}),Qe==null||Qe.forEach(function(Uo){delete kr[Uo]});var Ls=Y.useState(!1),As=(0,ct.Z)(Ls,2),Gr=As[0],ma=As[1];Y.useEffect(function(){ma(fi())},[]);var Qo=Y.useRef(null),bs=Y.useRef(null),ua=Y.useRef(null),Ho=Y.useRef(null),La=Y.useRef(null),Eo=Ye(),Rs=(0,ct.Z)(Eo,3),Us=Rs[0],Vo=Rs[1],ha=Rs[2];Y.useImperativeHandle(V,function(){var Uo,ns;return{focus:(Uo=Ho.current)===null||Uo===void 0?void 0:Uo.focus,blur:(ns=Ho.current)===null||ns===void 0?void 0:ns.blur,scrollTo:function(Gl){var Cl;return(Cl=La.current)===null||Cl===void 0?void 0:Cl.scrollTo(Gl)}}});var Zs=Y.useMemo(function(){var Uo;if(Bi!=="combobox")return vo;var ns=(Uo=Be[0])===null||Uo===void 0?void 0:Uo.value;return typeof ns=="string"||typeof ns=="number"?String(ns):""},[vo,Bi,Be]),Vl=Bi==="combobox"&&typeof Hi=="function"&&Hi()||null,Ta=typeof Gn=="function"&&Gn(),Xa=Sr(bs,Ta==null||(at=Ta.props)===null||at===void 0?void 0:at.ref),Yu=Y.useState(!1),Ts=(0,ct.Z)(Yu,2),Cn=Ts[0],Kn=Ts[1];Zt(function(){Kn(!0)},[]);var Pr=$e(!1,{defaultValue:ir,value:cn}),Ss=(0,ct.Z)(Pr,2),Nn=Ss[0],Yr=Ss[1],Fi=Cn?Nn:!1,Un=!ri&&Oe;(Li||Un&&Fi&&Bi==="combobox")&&(Fi=!1);var ae=Un?!1:Fi,to=Y.useCallback(function(Uo){var ns=Uo!==void 0?Uo:!Fi;Li||(Yr(ns),Fi!==ns&&(Qn==null||Qn(ns)))},[Li,Fi,Yr,Qn]),Bs=Y.useMemo(function(){return(ji||[]).some(function(Uo){return[`
|
|
|
`,`\r
|
|
|
`].includes(Uo)})},[ji]),_a=function(ns,Zl,Gl){var Cl=!0,Ou=ns;In==null||In(null);var Xl=Gl?null:Ut(ns,ji);return Bi!=="combobox"&&Xl&&(Ou="",kn==null||kn(Xl),to(!1),Cl=!1),gr&&Zs!==Ou&&gr(Ou,{source:Zl?"typing":"effect"}),Cl},sh=function(ns){!ns||!ns.trim()||gr(ns,{source:"submit"})};Y.useEffect(function(){!Fi&&!lr&&Bi!=="combobox"&&_a("",!1,!1)},[Fi]),Y.useEffect(function(){Nn&&Li&&Yr(!1),Li&&Vo(!1)},[Li]);var Wl=Ae(),Du=(0,ct.Z)(Wl,2),cl=Du[0],Ds=Du[1],ku=function(ns){var Zl=cl(),Gl=ns.which;if(Gl===pe.ENTER&&(Bi!=="combobox"&&ns.preventDefault(),Fi||to(!0)),Ds(!!Zs),Gl===pe.BACKSPACE&&!Zl&&lr&&!Zs&&Be.length){for(var Cl=(0,Et.Z)(Be),Ou=null,Xl=Cl.length-1;Xl>=0;Xl-=1){var Uh=Cl[Xl];if(!Uh.disabled){Cl.splice(Xl,1),Ou=Uh;break}}Ou&&xi(Cl,{type:"remove",values:[Ou]})}for(var Ru=arguments.length,Fs=new Array(Ru>1?Ru-1:0),Oh=1;Oh<Ru;Oh++)Fs[Oh-1]=arguments[Oh];if(Fi&&La.current){var gf;(gf=La.current).onKeyDown.apply(gf,[ns].concat(Fs))}Je==null||Je.apply(void 0,[ns].concat(Fs))},ah=function(ns){for(var Zl=arguments.length,Gl=new Array(Zl>1?Zl-1:0),Cl=1;Cl<Zl;Cl++)Gl[Cl-1]=arguments[Cl];if(Fi&&La.current){var Ou;(Ou=La.current).onKeyUp.apply(Ou,[ns].concat(Gl))}qo==null||qo.apply(void 0,[ns].concat(Gl))},Lc=function(ns){var Zl=Be.filter(function(Gl){return Gl!==ns});xi(Zl,{type:"remove",values:[ns]})},Vh=Y.useRef(!1),mu=function(){Vo(!0),Li||(ar&&!Vh.current&&ar.apply(void 0,arguments),No.includes("focus")&&to(!0)),Vh.current=!0},Nf=function(){Vo(!1,function(){Vh.current=!1,to(!1)}),!Li&&(Zs&&(Bi==="tags"?gr(Zs,{source:"submit"}):Bi==="multiple"&&gr("",{source:"blur"})),Mo&&Mo.apply(void 0,arguments))},gu=[];Y.useEffect(function(){return function(){gu.forEach(function(Uo){return clearTimeout(Uo)}),gu.splice(0,gu.length)}},[]);var Dh=function(ns){var Zl,Gl=ns.target,Cl=(Zl=ua.current)===null||Zl===void 0?void 0:Zl.getPopupElement();if(Cl&&Cl.contains(Gl)){var Ou=setTimeout(function(){var Fs=gu.indexOf(Ou);if(Fs!==-1&&gu.splice(Fs,1),ha(),!Gr&&!Cl.contains(document.activeElement)){var Oh;(Oh=Ho.current)===null||Oh===void 0||Oh.focus()}});gu.push(Ou)}for(var Xl=arguments.length,Uh=new Array(Xl>1?Xl-1:0),Ru=1;Ru<Xl;Ru++)Uh[Ru-1]=arguments[Ru];br==null||br.apply(void 0,[ns].concat(Uh))},ou=Y.useState({}),Wh=(0,ct.Z)(ou,2),Af=Wh[1];function Yc(){Af({})}var Ku;Ta&&(Ku=function(ns){to(ns)}),Wi(function(){var Uo;return[Qo.current,(Uo=ua.current)===null||Uo===void 0?void 0:Uo.getPopupElement()]},ae,to,!!Ta);var Df=Y.useMemo(function(){return(0,ft.Z)((0,ft.Z)({},R),{},{notFoundContent:ri,open:Fi,triggerOpen:ae,id:Dt,showSearch:Rn,multiple:lr,toggleOpen:to})},[R,ri,ae,Fi,Dt,Rn,lr,to]),Jc=!!On||Ni,Bc;Jc&&(Bc=Y.createElement(tt,{className:At()("".concat(_t,"-arrow"),(0,gt.Z)({},"".concat(_t,"-arrow-loading"),Ni)),customizeIcon:On,customizeIconProps:{loading:Ni,searchValue:Zs,open:Fi,focused:Us,showSearch:Rn}}));var Tc=function(){var ns;Mi==null||Mi(),(ns=Ho.current)===null||ns===void 0||ns.focus(),xi([],{type:"clear",values:Be}),_a("",!1,!1)},qc=de(_t,Tc,Be,rn,tr,Li,Zs,Bi),ur=qc.allowClear,Ih=qc.clearIcon,vh=Y.createElement(Ws,{ref:La}),xa=At()(_t,Xt,(dt={},(0,gt.Z)(dt,"".concat(_t,"-focused"),Us),(0,gt.Z)(dt,"".concat(_t,"-multiple"),lr),(0,gt.Z)(dt,"".concat(_t,"-single"),!lr),(0,gt.Z)(dt,"".concat(_t,"-allow-clear"),rn),(0,gt.Z)(dt,"".concat(_t,"-show-arrow"),Jc),(0,gt.Z)(dt,"".concat(_t,"-disabled"),Li),(0,gt.Z)(dt,"".concat(_t,"-loading"),Ni),(0,gt.Z)(dt,"".concat(_t,"-open"),Fi),(0,gt.Z)(dt,"".concat(_t,"-customize-input"),Vl),(0,gt.Z)(dt,"".concat(_t,"-show-search"),Rn),dt)),Ul=Y.createElement(Mu,{ref:ua,disabled:Li,prefixCls:_t,visible:ae,popupElement:vh,animation:Ct,transitionName:_o,dropdownStyle:Mn,dropdownClassName:jn,direction:ze,dropdownMatchSelectWidth:ws,dropdownRender:Ea,dropdownAlign:Pn,placement:vn,builtinPlacements:tn,getPopupContainer:so,empty:Oe,getTriggerDOMNode:function(){return bs.current},onPopupVisibleChange:Ku,onPopupMouseEnter:Yc},Ta?Y.cloneElement(Ta,{ref:Xa}):Y.createElement(xe,(0,vt.Z)({},R,{domRef:bs,prefixCls:_t,inputElement:Vl,ref:Ho,id:Dt,showSearch:Rn,autoClearSearchValue:Kr,mode:Bi,activeDescendantId:nn,tagRender:Xe,values:Be,open:Fi,onToggleOpen:to,activeValue:Xr,searchValue:Zs,onSearch:_a,onSearchSubmit:sh,onRemove:Lc,tokenWithEnter:Bs}))),Iu;return Ta?Iu=Ul:Iu=Y.createElement("div",(0,vt.Z)({className:xa},kr,{ref:Qo,onMouseDown:Dh,onKeyDown:ku,onKeyUp:ah,onFocus:mu,onBlur:Nf}),Us&&!Fi&&Y.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(Be.map(function(Uo){var ns=Uo.label,Zl=Uo.value;return["number","string"].includes((0,F.Z)(ns))?ns:Zl}).join(", "))),Ul,Bc,ur&&Ih),Y.createElement(hi.Provider,{value:Df},Iu)}),fn=qi,Ar=function(R,V){var at=Y.useRef({values:new Map,options:new Map}),dt=Y.useMemo(function(){var _t=at.current,Xt=_t.values,Ne=_t.options,Xe=R.map(function(Be){if(Be.label===void 0){var xi;return(0,ft.Z)((0,ft.Z)({},Be),{},{label:(xi=Xt.get(Be.value))===null||xi===void 0?void 0:xi.label})}return Be}),ze=new Map,Qe=new Map;return Xe.forEach(function(Be){ze.set(Be.value,Be),Qe.set(Be.value,V.get(Be.value)||Ne.get(Be.value))}),at.current.values=ze,at.current.options=Qe,Xe},[R,V]),Dt=Y.useCallback(function(_t){return V.get(_t)||at.current.options.get(_t)},[V]);return[dt,Dt]};function qn(R,V){return Kl(R).join("").toUpperCase().includes(V)}var Dn=function(R,V,at,dt,Dt){return Y.useMemo(function(){if(!at||dt===!1)return R;var _t=V.options,Xt=V.label,Ne=V.value,Xe=[],ze=typeof dt=="function",Qe=at.toUpperCase(),Be=ze?dt:function(Oe,wi){return Dt?qn(wi[Dt],Qe):wi[_t]?qn(wi[Xt!=="children"?Xt:"label"],Qe):qn(wi[Ne],Qe)},xi=ze?function(Oe){return Ft(Oe)}:function(Oe){return Oe};return R.forEach(function(Oe){if(Oe[_t]){var wi=Be(at,xi(Oe));if(wi)Xe.push(Oe);else{var ri=Oe[_t].filter(function(Mi){return Be(at,xi(Mi))});ri.length&&Xe.push((0,ft.Z)((0,ft.Z)({},Oe),{},(0,gt.Z)({},_t,ri)))}return}Be(at,xi(Oe))&&Xe.push(Oe)}),Xe},[R,dt,Dt,at,V])},$n=0,Di=Fe();function Wn(){var R;return Di?(R=$n,$n+=1):R="TEST_OR_SSR",R}function Ln(R){var V=Y.useState(),at=(0,ct.Z)(V,2),dt=at[0],Dt=at[1];return Y.useEffect(function(){Dt("rc_select_".concat(Wn()))},[]),R||dt}function cr(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},at=[];return Y.Children.forEach(R,function(dt){dt==null&&!V.keepEmpty||(Array.isArray(dt)?at=at.concat(cr(dt)):(0,Ke.isFragment)(dt)&&dt.props?at=at.concat(cr(dt.props.children,V)):at.push(dt))}),at}var wr=["children","value"],xn=["children"];function Qi(R){var V=R,at=V.key,dt=V.props,Dt=dt.children,_t=dt.value,Xt=(0,ot.Z)(dt,wr);return(0,ft.Z)({key:at,value:_t!==void 0?_t:at,children:Dt},Xt)}function So(R){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return cr(R).map(function(at,dt){if(!Y.isValidElement(at)||!at.type)return null;var Dt=at,_t=Dt.type.isSelectOptGroup,Xt=Dt.key,Ne=Dt.props,Xe=Ne.children,ze=(0,ot.Z)(Ne,xn);return V||!_t?Qi(at):(0,ft.Z)((0,ft.Z)({key:"__RC_SELECT_GRP__".concat(Xt===null?dt:Xt,"__"),label:Xt},ze),{},{options:So(Xe)})}).filter(function(at){return at})}function jo(R,V,at,dt,Dt){return Y.useMemo(function(){var _t=R,Xt=!R;Xt&&(_t=So(V));var Ne=new Map,Xe=new Map,ze=function(xi,Oe,wi){wi&&typeof wi=="string"&&xi.set(Oe[wi],Oe)};function Qe(Be){for(var xi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=0;Oe<Be.length;Oe+=1){var wi=Be[Oe];!wi[at.options]||xi?(Ne.set(wi[at.value],wi),ze(Xe,wi,at.label),ze(Xe,wi,dt),ze(Xe,wi,Dt)):Qe(wi[at.options],!0)}}return Qe(_t),{options:_t,valueOptions:Ne,labelOptions:Xe}},[R,V,at,dt,Dt])}function go(R){var V=Y.useRef();V.current=R;var at=Y.useCallback(function(){return V.current.apply(V,arguments)},[]);return at}var Ko=function(){return null};Ko.isSelectOptGroup=!0;var Zr=Ko,zo=function(){return null};zo.isSelectOption=!0;var da=zo;function Cs(R,V){var at=(0,ft.Z)({},R);return Array.isArray(V)&&V.forEach(function(dt){delete at[dt]}),at}var ys=j(73299),pa=Y.createContext(null),Cr=pa;function Qr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var io=["disabled","title","children","style","className"];function Ps(R){return typeof R=="string"||typeof R=="number"}var xs=function(V,at){var dt=Ze(),Dt=dt.prefixCls,_t=dt.id,Xt=dt.open,Ne=dt.multiple,Xe=dt.mode,ze=dt.searchValue,Qe=dt.toggleOpen,Be=dt.notFoundContent,xi=dt.onPopupScroll,Oe=Y.useContext(Cr),wi=Oe.flattenOptions,ri=Oe.onActiveValue,Mi=Oe.defaultActiveFirstOption,Bi=Oe.onSelect,Li=Oe.menuItemSelectedIcon,Ni=Oe.rawValues,Hi=Oe.fieldNames,Gn=Oe.virtual,cn=Oe.direction,ir=Oe.listHeight,Qn=Oe.listItemHeight,Xr="".concat(Dt,"-item"),In=ki(function(){return wi},[Xt,wi],function(Pn,vn){return vn[0]&&Pn[1]!==vn[1]}),nn=Y.useRef(null),vo=function(vn){vn.preventDefault()},Kr=function(vn){nn.current&&nn.current.scrollTo(typeof vn=="number"?{index:vn}:vn)},gr=function(vn){for(var tn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,so=In.length,Po=0;Po<so;Po+=1){var No=(vn+Po*tn+so)%so,ar=In[No],Mo=ar.group,qo=ar.data;if(!Mo&&!qo.disabled)return No}return-1},kn=Y.useState(function(){return gr(0)}),ji=(0,ct.Z)(kn,2),rn=ji[0],On=ji[1],tr=function(vn){var tn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;On(vn);var so={source:tn?"keyboard":"mouse"},Po=In[vn];if(!Po){ri(null,-1,so);return}ri(Po.value,vn,so)};(0,Y.useEffect)(function(){tr(Mi!==!1?gr(0):-1)},[In.length,ze]);var Ws=Y.useCallback(function(Pn){return Ni.has(Pn)&&Xe!=="combobox"},[Xe,(0,Et.Z)(Ni).toString(),Ni.size]);(0,Y.useEffect)(function(){var Pn=setTimeout(function(){if(!Ne&&Xt&&Ni.size===1){var tn=Array.from(Ni)[0],so=In.findIndex(function(Po){var No=Po.data;return No.value===tn});so!==-1&&(tr(so),Kr(so))}});if(Xt){var vn;(vn=nn.current)===null||vn===void 0||vn.scrollTo(void 0)}return function(){return clearTimeout(Pn)}},[Xt,ze,wi.length]);var Ct=function(vn){vn!==void 0&&Bi(vn,{selected:!Ni.has(vn)}),Ne||Qe(!1)};if(Y.useImperativeHandle(at,function(){return{onKeyDown:function(vn){var tn=vn.which,so=vn.ctrlKey;switch(tn){case pe.N:case pe.P:case pe.UP:case pe.DOWN:{var Po=0;if(tn===pe.UP?Po=-1:tn===pe.DOWN?Po=1:Qr()&&so&&(tn===pe.N?Po=1:tn===pe.P&&(Po=-1)),Po!==0){var No=gr(rn+Po,Po);Kr(No),tr(No,!0)}break}case pe.ENTER:{var ar=In[rn];ar&&!ar.data.disabled?Ct(ar.value):Ct(void 0),Xt&&vn.preventDefault();break}case pe.ESC:Qe(!1),Xt&&vn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(vn){Kr(vn)}}}),In.length===0)return Y.createElement("div",{role:"listbox",id:"".concat(_t,"_list"),className:"".concat(Xr,"-empty"),onMouseDown:vo},Be);var _o=Object.keys(Hi).map(function(Pn){return Hi[Pn]}),Mn=function(vn){return vn.label};function jn(Pn,vn){var tn=Pn.group;return{role:tn?"presentation":"option",id:"".concat(_t,"_list_").concat(vn)}}var ws=function(vn){var tn=In[vn];if(!tn)return null;var so=tn.data||{},Po=so.value,No=tn.group,ar=q(so,!0),Mo=Mn(tn);return tn?Y.createElement("div",(0,vt.Z)({"aria-label":typeof Mo=="string"&&!No?Mo:null},ar,{key:vn},jn(tn,vn),{"aria-selected":Ws(Po)}),Po):null},Ea={role:"listbox",id:"".concat(_t,"_list")};return Y.createElement(Y.Fragment,null,Gn&&Y.createElement("div",(0,vt.Z)({},Ea,{style:{height:0,width:0,overflow:"hidden"}}),ws(rn-1),ws(rn),ws(rn+1)),Y.createElement(ys.Z,{itemKey:"key",ref:nn,data:In,height:ir,itemHeight:Qn,fullHeight:!1,onMouseDown:vo,onScroll:xi,virtual:Gn,direction:cn,innerProps:Gn?null:Ea},function(Pn,vn){var tn,so=Pn.group,Po=Pn.groupOption,No=Pn.data,ar=Pn.label,Mo=Pn.value,qo=No.key;if(so){var Je,br=(Je=No.title)!==null&&Je!==void 0?Je:Ps(ar)?ar.toString():void 0;return Y.createElement("div",{className:At()(Xr,"".concat(Xr,"-group")),title:br},ar!==void 0?ar:qo)}var wn=No.disabled,lr=No.title,Rn=No.children,kr=No.style,Ls=No.className,As=(0,ot.Z)(No,io),Gr=Cs(As,_o),ma=Ws(Mo),Qo="".concat(Xr,"-option"),bs=At()(Xr,Qo,Ls,(tn={},(0,gt.Z)(tn,"".concat(Qo,"-grouped"),Po),(0,gt.Z)(tn,"".concat(Qo,"-active"),rn===vn&&!wn),(0,gt.Z)(tn,"".concat(Qo,"-disabled"),wn),(0,gt.Z)(tn,"".concat(Qo,"-selected"),ma),tn)),ua=Mn(Pn),Ho=!Li||typeof Li=="function"||ma,La=typeof ua=="number"?ua:ua||Mo,Eo=Ps(La)?La.toString():void 0;return lr!==void 0&&(Eo=lr),Y.createElement("div",(0,vt.Z)({},q(Gr),Gn?{}:jn(Pn,vn),{"aria-selected":ma,className:bs,title:Eo,onMouseMove:function(){rn===vn||wn||tr(vn)},onClick:function(){wn||Ct(Mo)},style:kr}),Y.createElement("div",{className:"".concat(Qo,"-content")},La),Y.isValidElement(Li)||ma,Ho&&Y.createElement(tt,{className:"".concat(Xr,"-option-state"),customizeIcon:Li,customizeIconProps:{isSelected:ma}},ma?"\u2713":null))}))},Ns=Y.forwardRef(xs);Ns.displayName="OptionList";var gs=Ns;function la(R){var V=R.mode,at=R.options,dt=R.children,Dt=R.backfill,_t=R.allowClear,Xt=R.placeholder,Ne=R.getInputElement,Xe=R.showSearch,ze=R.onSearch,Qe=R.defaultOpen,Be=R.autoFocus,xi=R.labelInValue,Oe=R.value,wi=R.inputValue,ri=R.optionLabelProp,Mi=isMultiple(V),Bi=Xe!==void 0?Xe:Mi||V==="combobox",Li=at||convertChildrenToData(dt);if(warning(V!=="tags"||Li.every(function(cn){return!cn.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),V==="tags"||V==="combobox"){var Ni=Li.some(function(cn){return cn.options?cn.options.some(function(ir){return typeof("value"in ir?ir.value:ir.key)=="number"}):typeof("value"in cn?cn.value:cn.key)=="number"});warning(!Ni,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(V!=="combobox"||!ri,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(V==="combobox"||!Dt,"`backfill` only works with `combobox` mode."),warning(V==="combobox"||!Ne,"`getInputElement` only work with `combobox` mode."),noteOnce(V!=="combobox"||!Ne||!_t||!Xt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ze&&!Bi&&V!=="combobox"&&V!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Qe||Be,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Oe!=null){var Hi=toArray(Oe);warning(!xi||Hi.every(function(cn){return _typeof(cn)==="object"&&("key"in cn||"value"in cn)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Mi||Array.isArray(Oe),"`value` should be array when `mode` is `multiple` or `tags`")}if(dt){var Gn=null;toNodeArray(dt).some(function(cn){if(!React.isValidElement(cn)||!cn.type)return!1;var ir=cn,Qn=ir.type;if(Qn.isSelectOption)return!1;if(Qn.isSelectOptGroup){var Xr=toNodeArray(cn.props.children).every(function(In){return!React.isValidElement(In)||!cn.type||In.type.isSelectOption?!0:(Gn=In.type,!1)});return!Xr}return Gn=Qn,!0}),Gn&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Gn.displayName||Gn.name||Gn,"`.")),warning(wi===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Da(R,V){if(R){var at=function dt(Dt){for(var _t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xt=0;Xt<Dt.length;Xt++){var Ne=Dt[Xt];if(Ne[V==null?void 0:V.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!_t&&Array.isArray(Ne[V==null?void 0:V.options])&&dt(Ne[V==null?void 0:V.options],!0))break}};at(R)}}var Ks=null,va=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],oo=["inputValue"];function vs(R){return!R||(0,F.Z)(R)!=="object"}var ks=Y.forwardRef(function(R,V){var at=R.id,dt=R.mode,Dt=R.prefixCls,_t=Dt===void 0?"rc-select":Dt,Xt=R.backfill,Ne=R.fieldNames,Xe=R.inputValue,ze=R.searchValue,Qe=R.onSearch,Be=R.autoClearSearchValue,xi=Be===void 0?!0:Be,Oe=R.onSelect,wi=R.onDeselect,ri=R.dropdownMatchSelectWidth,Mi=ri===void 0?!0:ri,Bi=R.filterOption,Li=R.filterSort,Ni=R.optionFilterProp,Hi=R.optionLabelProp,Gn=R.options,cn=R.children,ir=R.defaultActiveFirstOption,Qn=R.menuItemSelectedIcon,Xr=R.virtual,In=R.direction,nn=R.listHeight,vo=nn===void 0?200:nn,Kr=R.listItemHeight,gr=Kr===void 0?20:Kr,kn=R.value,ji=R.defaultValue,rn=R.labelInValue,On=R.onChange,tr=(0,ot.Z)(R,va),Ws=Ln(at),Ct=Ri(dt),_o=!!(!Gn&&cn),Mn=Y.useMemo(function(){return Bi===void 0&&dt==="combobox"?!1:Bi},[Bi,dt]),jn=Y.useMemo(function(){return ht(Ne,_o)},[JSON.stringify(Ne),_o]),ws=$e("",{value:ze!==void 0?ze:Xe,postState:function(Un){return Un||""}}),Ea=(0,ct.Z)(ws,2),Pn=Ea[0],vn=Ea[1],tn=jo(Gn,cn,jn,Ni,Hi),so=tn.valueOptions,Po=tn.labelOptions,No=tn.options,ar=Y.useCallback(function(Fi){var Un=Kl(Fi);return Un.map(function(ae){var to,Bs,_a,sh,Wl;if(vs(ae))to=ae;else{var Du;_a=ae.key,Bs=ae.label,to=(Du=ae.value)!==null&&Du!==void 0?Du:_a}var cl=so.get(to);if(cl){var Ds;if(Bs===void 0&&(Bs=cl==null?void 0:cl[Hi||jn.label]),_a===void 0&&(_a=(Ds=cl==null?void 0:cl.key)!==null&&Ds!==void 0?Ds:to),sh=cl==null?void 0:cl.disabled,Wl=cl==null?void 0:cl.title,0)var ku}return{label:Bs,value:to,key:_a,disabled:sh,title:Wl}})},[jn,Hi,so]),Mo=$e(ji,{value:kn}),qo=(0,ct.Z)(Mo,2),Je=qo[0],br=qo[1],wn=Y.useMemo(function(){var Fi,Un=ar(Je);return dt==="combobox"&&L((Fi=Un[0])===null||Fi===void 0?void 0:Fi.value)?[]:Un},[Je,ar,dt]),lr=Ar(wn,so),Rn=(0,ct.Z)(lr,2),kr=Rn[0],Ls=Rn[1],As=Y.useMemo(function(){if(!dt&&kr.length===1){var Fi=kr[0];if(Fi.value===null&&(Fi.label===null||Fi.label===void 0))return[]}return kr.map(function(Un){var ae;return(0,ft.Z)((0,ft.Z)({},Un),{},{label:(ae=Un.label)!==null&&ae!==void 0?ae:Un.value})})},[dt,kr]),Gr=Y.useMemo(function(){return new Set(kr.map(function(Fi){return Fi.value}))},[kr]);Y.useEffect(function(){if(dt==="combobox"){var Fi,Un=(Fi=kr[0])===null||Fi===void 0?void 0:Fi.value;vn(Me(Un)?String(Un):"")}},[kr]);var ma=go(function(Fi,Un){var ae,to=Un!=null?Un:Fi;return ae={},(0,gt.Z)(ae,jn.value,Fi),(0,gt.Z)(ae,jn.label,to),ae}),Qo=Y.useMemo(function(){if(dt!=="tags")return No;var Fi=(0,Et.Z)(No),Un=function(to){return so.has(to)};return(0,Et.Z)(kr).sort(function(ae,to){return ae.value<to.value?-1:1}).forEach(function(ae){var to=ae.value;Un(to)||Fi.push(ma(to,ae.label))}),Fi},[ma,No,so,kr,dt]),bs=Dn(Qo,jn,Pn,Mn,Ni),ua=Y.useMemo(function(){return dt!=="tags"||!Pn||bs.some(function(Fi){return Fi[Ni||"value"]===Pn})||bs.some(function(Fi){return Fi[jn.value]===Pn})?bs:[ma(Pn)].concat((0,Et.Z)(bs))},[ma,Ni,dt,bs,Pn,jn]),Ho=Y.useMemo(function(){return Li?(0,Et.Z)(ua).sort(function(Fi,Un){return Li(Fi,Un)}):ua},[ua,Li]),La=Y.useMemo(function(){return wt(Ho,{fieldNames:jn,childrenAsData:_o})},[Ho,jn,_o]),Eo=function(Un){var ae=ar(Un);if(br(ae),On&&(ae.length!==kr.length||ae.some(function(_a,sh){var Wl;return((Wl=kr[sh])===null||Wl===void 0?void 0:Wl.value)!==(_a==null?void 0:_a.value)}))){var to=rn?ae:ae.map(function(_a){return _a.value}),Bs=ae.map(function(_a){return Ft(Ls(_a.value))});On(Ct?to:to[0],Ct?Bs:Bs[0])}},Rs=Y.useState(null),Us=(0,ct.Z)(Rs,2),Vo=Us[0],ha=Us[1],Zs=Y.useState(0),Vl=(0,ct.Z)(Zs,2),Ta=Vl[0],Xa=Vl[1],Yu=ir!==void 0?ir:dt!=="combobox",Ts=Y.useCallback(function(Fi,Un){var ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},to=ae.source,Bs=to===void 0?"keyboard":to;Xa(Un),Xt&&dt==="combobox"&&Fi!==null&&Bs==="keyboard"&&ha(String(Fi))},[Xt,dt]),Cn=function(Un,ae,to){var Bs=function(){var Vh,mu=Ls(Un);return[rn?{label:mu==null?void 0:mu[jn.label],value:Un,key:(Vh=mu==null?void 0:mu.key)!==null&&Vh!==void 0?Vh:Un}:Un,Ft(mu)]};if(ae&&Oe){var _a=Bs(),sh=(0,ct.Z)(_a,2),Wl=sh[0],Du=sh[1];Oe(Wl,Du)}else if(!ae&&wi&&to!=="clear"){var cl=Bs(),Ds=(0,ct.Z)(cl,2),ku=Ds[0],ah=Ds[1];wi(ku,ah)}},Kn=go(function(Fi,Un){var ae,to=Ct?Un.selected:!0;to?ae=Ct?[].concat((0,Et.Z)(kr),[Fi]):[Fi]:ae=kr.filter(function(Bs){return Bs.value!==Fi}),Eo(ae),Cn(Fi,to),dt==="combobox"?ha(""):(!Ri||xi)&&(vn(""),ha(""))}),Pr=function(Un,ae){Eo(Un);var to=ae.type,Bs=ae.values;(to==="remove"||to==="clear")&&Bs.forEach(function(_a){Cn(_a.value,!1,to)})},Ss=function(Un,ae){if(vn(Un),ha(null),ae.source==="submit"){var to=(Un||"").trim();if(to){var Bs=Array.from(new Set([].concat((0,Et.Z)(Gr),[to])));Eo(Bs),Cn(to,!0),vn("")}return}ae.source!=="blur"&&(dt==="combobox"&&Eo(Un),Qe==null||Qe(Un))},Nn=function(Un){var ae=Un;dt!=="tags"&&(ae=Un.map(function(Bs){var _a=Po.get(Bs);return _a==null?void 0:_a.value}).filter(function(Bs){return Bs!==void 0}));var to=Array.from(new Set([].concat((0,Et.Z)(Gr),(0,Et.Z)(ae))));Eo(to),to.forEach(function(Bs){Cn(Bs,!0)})},Yr=Y.useMemo(function(){var Fi=Xr!==!1&&Mi!==!1;return(0,ft.Z)((0,ft.Z)({},tn),{},{flattenOptions:La,onActiveValue:Ts,defaultActiveFirstOption:Yu,onSelect:Kn,menuItemSelectedIcon:Qn,rawValues:Gr,fieldNames:jn,virtual:Fi,direction:In,listHeight:vo,listItemHeight:gr,childrenAsData:_o})},[tn,La,Ts,Yu,Kn,Qn,Gr,jn,Xr,Mi,vo,gr,_o]);return Y.createElement(Cr.Provider,{value:Yr},Y.createElement(fn,(0,vt.Z)({},tr,{id:Ws,prefixCls:_t,ref:V,omitDomProps:oo,mode:dt,displayValues:As,onDisplayValuesChange:Pr,direction:In,searchValue:Pn,onSearch:Ss,autoClearSearchValue:xi,onSearchSplit:Nn,dropdownMatchSelectWidth:Mi,OptionList:gs,emptyOptions:!La.length,activeValue:Vo,activeDescendantId:"".concat(Ws,"_list_").concat(Ta)})))}),Ia=ks;Ia.Option=da,Ia.OptGroup=Zr;var ll=Ia,ja=ll,Oa=j(10366),Qa=j(8745),mr=j(33603),Dl=j(9708),ul=j(53124),Cu=j(98866),To=j(88258),Au=j(98675),Ml=j(65223),du=j(4173),pu=j(87244),yl=j(13458),Xu=j(78642),ru=j(46163),ya=function(R,V){var at={};for(var dt in R)Object.prototype.hasOwnProperty.call(R,dt)&&V.indexOf(dt)<0&&(at[dt]=R[dt]);if(R!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dt=0,dt=Object.getOwnPropertySymbols(R);Dt<dt.length;Dt++)V.indexOf(dt[Dt])<0&&Object.prototype.propertyIsEnumerable.call(R,dt[Dt])&&(at[dt[Dt]]=R[dt[Dt]]);return at};const ju="SECRET_COMBOBOX_MODE_DO_NOT_USE",hl=(R,V)=>{var at,{prefixCls:dt,bordered:Dt=!0,className:_t,rootClassName:Xt,getPopupContainer:Ne,popupClassName:Xe,dropdownClassName:ze,listHeight:Qe=256,placement:Be,listItemHeight:xi=24,size:Oe,disabled:wi,notFoundContent:ri,status:Mi,builtinPlacements:Bi,dropdownMatchSelectWidth:Li,popupMatchSelectWidth:Ni,direction:Hi,style:Gn,allowClear:cn}=R,ir=ya(R,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Qn,getPrefixCls:Xr,renderEmpty:In,direction:nn,virtual:vo,popupMatchSelectWidth:Kr,popupOverflow:gr,select:kn}=Y.useContext(ul.E_),ji=Xr("select",dt),rn=Xr(),On=Hi!=null?Hi:nn,{compactSize:tr,compactItemClassnames:Ws}=(0,du.ri)(ji,On),[Ct,_o]=(0,pu.Z)(ji),Mn=Y.useMemo(()=>{const{mode:Qo}=ir;if(Qo!=="combobox")return Qo===ju?"combobox":Qo},[ir.mode]),jn=Mn==="multiple"||Mn==="tags",ws=(0,Xu.Z)(ir.suffixIcon,ir.showArrow),Ea=(at=Ni!=null?Ni:Li)!==null&&at!==void 0?at:Kr,{status:Pn,hasFeedback:vn,isFormItemInput:tn,feedbackIcon:so}=Y.useContext(Ml.aM),Po=(0,Dl.F)(Pn,Mi);let No;ri!==void 0?No=ri:Mn==="combobox"?No=null:No=(In==null?void 0:In("Select"))||Y.createElement(To.Z,{componentName:"Select"});const{suffixIcon:ar,itemIcon:Mo,removeIcon:qo,clearIcon:Je}=(0,ru.Z)(Object.assign(Object.assign({},ir),{multiple:jn,hasFeedback:vn,feedbackIcon:so,showSuffixIcon:ws,prefixCls:ji,showArrow:ir.showArrow,componentName:"Select"})),br=cn===!0?{clearIcon:Je}:cn,wn=(0,Oa.Z)(ir,["suffixIcon","itemIcon"]),lr=At()(Xe||ze,{[`${ji}-dropdown-${On}`]:On==="rtl"},Xt,_o),Rn=(0,Au.Z)(Qo=>{var bs;return(bs=Oe!=null?Oe:tr)!==null&&bs!==void 0?bs:Qo}),kr=Y.useContext(Cu.Z),Ls=wi!=null?wi:kr,As=At()({[`${ji}-lg`]:Rn==="large",[`${ji}-sm`]:Rn==="small",[`${ji}-rtl`]:On==="rtl",[`${ji}-borderless`]:!Dt,[`${ji}-in-form-item`]:tn},(0,Dl.Z)(ji,Po,vn),Ws,kn==null?void 0:kn.className,_t,Xt,_o),Gr=Y.useMemo(()=>Be!==void 0?Be:On==="rtl"?"bottomRight":"bottomLeft",[Be,On]),ma=(0,yl.Z)(Bi,gr);return Ct(Y.createElement(ja,Object.assign({ref:V,virtual:vo,showSearch:kn==null?void 0:kn.showSearch},wn,{style:Object.assign(Object.assign({},kn==null?void 0:kn.style),Gn),dropdownMatchSelectWidth:Ea,builtinPlacements:ma,transitionName:(0,mr.m)(rn,"slide-up",ir.transitionName),listHeight:Qe,listItemHeight:xi,mode:Mn,prefixCls:ji,placement:Gr,direction:On,suffixIcon:ar,menuItemSelectedIcon:Mo,removeIcon:qo,allowClear:br,notFoundContent:No,className:As,getPopupContainer:Ne||Qn,dropdownClassName:lr,disabled:Ls})))},Qs=Y.forwardRef(hl),Il=(0,Qa.Z)(Qs);Qs.SECRET_COMBOBOX_MODE_DO_NOT_USE=ju,Qs.Option=da,Qs.OptGroup=Zr,Qs._InternalPanelDoNotUseOrYouWillBeFired=Il;var Es=Qs},87244:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return kt}});var Nt=j(14747),At=j(80110),vt=j(45503),Et=j(67968),gt=j(67771),ft=j(33297);const ct=it=>{const{optionHeight:Ot,optionFontSize:qt,optionLineHeight:Te,optionPadding:_e}=it;return{position:"relative",display:"block",minHeight:Ot,padding:_e,color:it.colorText,fontWeight:"normal",fontSize:qt,lineHeight:Te,boxSizing:"border-box"}};var F=it=>{const{antCls:Ot,componentCls:qt}=it,Te=`${qt}-item`,_e=`&${Ot}-slide-up-enter${Ot}-slide-up-enter-active`,fi=`&${Ot}-slide-up-appear${Ot}-slide-up-appear-active`,Ht=`&${Ot}-slide-up-leave${Ot}-slide-up-leave-active`,pe=`${qt}-dropdown-placement-`;return[{[`${qt}-dropdown`]:Object.assign(Object.assign({},(0,Nt.Wf)(it)),{position:"absolute",top:-9999,zIndex:it.zIndexPopup,boxSizing:"border-box",padding:it.paddingXXS,overflow:"hidden",fontSize:it.fontSize,fontVariant:"initial",backgroundColor:it.colorBgElevated,borderRadius:it.borderRadiusLG,outline:"none",boxShadow:it.boxShadowSecondary,[`
|
|
|
${_e}${pe}bottomLeft,
|
|
|
${fi}${pe}bottomLeft
|
|
|
`]:{animationName:gt.fJ},[`
|
|
|
${_e}${pe}topLeft,
|
|
|
${fi}${pe}topLeft,
|
|
|
${_e}${pe}topRight,
|
|
|
${fi}${pe}topRight
|
|
|
`]:{animationName:gt.Qt},[`${Ht}${pe}bottomLeft`]:{animationName:gt.Uw},[`
|
|
|
${Ht}${pe}topLeft,
|
|
|
${Ht}${pe}topRight
|
|
|
`]:{animationName:gt.ly},"&-hidden":{display:"none"},[`${Te}`]:Object.assign(Object.assign({},ct(it)),{cursor:"pointer",transition:`background ${it.motionDurationSlow} ease`,borderRadius:it.borderRadiusSM,"&-group":{color:it.colorTextDescription,fontSize:it.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},Nt.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${Te}-option-disabled)`]:{backgroundColor:it.optionActiveBg},[`&-selected:not(${Te}-option-disabled)`]:{color:it.optionSelectedColor,fontWeight:it.optionSelectedFontWeight,backgroundColor:it.optionSelectedBg,[`${Te}-option-state`]:{color:it.colorPrimary}},"&-disabled":{[`&${Te}-option-selected`]:{backgroundColor:it.colorBgContainerDisabled},color:it.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:it.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,gt.oN)(it,"slide-up"),(0,gt.oN)(it,"slide-down"),(0,ft.Fm)(it,"move-up"),(0,ft.Fm)(it,"move-down")]};const Y=2,ee=it=>{let{controlHeightSM:Ot,controlHeight:qt,lineWidth:Te}=it;const _e=(qt-Ot)/2-Te,fi=Math.ceil(_e/2);return[_e,fi]};function ne(it,Ot){const{componentCls:qt,iconCls:Te}=it,_e=`${qt}-selection-overflow`,fi=it.multipleSelectItemHeight,[Ht]=ee(it),pe=Ot?`${qt}-${Ot}`:"";return{[`${qt}-multiple${pe}`]:{fontSize:it.fontSize,[_e]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${qt}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${Ht-Y}px ${Y*2}px`,borderRadius:it.borderRadius,[`${qt}-show-search&`]:{cursor:"text"},[`${qt}-disabled&`]:{background:it.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Y}px 0`,lineHeight:`${fi}px`,visibility:"hidden",content:'"\\a0"'}},[`
|
|
|
&${qt}-show-arrow ${qt}-selector,
|
|
|
&${qt}-allow-clear ${qt}-selector
|
|
|
`]:{paddingInlineEnd:it.fontSizeIcon+it.controlPaddingHorizontal},[`${qt}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:fi,marginTop:Y,marginBottom:Y,lineHeight:`${fi-it.lineWidth*2}px`,background:it.multipleItemBg,border:`${it.lineWidth}px ${it.lineType} ${it.multipleItemBorderColor}`,borderRadius:it.borderRadiusSM,cursor:"default",transition:`font-size ${it.motionDurationSlow}, line-height ${it.motionDurationSlow}, height ${it.motionDurationSlow}`,userSelect:"none",marginInlineEnd:Y*2,paddingInlineStart:it.paddingXS,paddingInlineEnd:it.paddingXS/2,[`${qt}-disabled&`]:{color:it.multipleItemColorDisabled,borderColor:it.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:it.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,Nt.Ro)()),{display:"inline-flex",alignItems:"center",color:it.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${Te}`]:{verticalAlign:"-0.2em"},"&:hover":{color:it.colorIconHover}})},[`${_e}-item + ${_e}-item`]:{[`${qt}-selection-search`]:{marginInlineStart:0}},[`${qt}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:it.inputPaddingHorizontalBase-Ht,"\n &-input,\n &-mirror\n ":{height:fi,fontFamily:it.fontFamily,lineHeight:`${fi}px`,transition:`all ${it.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${qt}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:it.inputPaddingHorizontalBase,insetInlineEnd:it.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${it.motionDurationSlow}`}}}}var le=it=>{const{componentCls:Ot}=it,qt=(0,vt.TS)(it,{controlHeight:it.controlHeightSM,multipleSelectItemHeight:it.controlHeightXS,borderRadius:it.borderRadiusSM,borderRadiusSM:it.borderRadiusXS}),Te=(0,vt.TS)(it,{fontSize:it.fontSizeLG,controlHeight:it.controlHeightLG,multipleSelectItemHeight:it.multipleItemHeightLG,borderRadius:it.borderRadiusLG,borderRadiusSM:it.borderRadius}),[,_e]=ee(it);return[ne(it),ne(qt,"sm"),{[`${Ot}-multiple${Ot}-sm`]:{[`${Ot}-selection-placeholder`]:{insetInline:it.controlPaddingHorizontalSM-it.lineWidth},[`${Ot}-selection-search`]:{marginInlineStart:_e}}},ne(Te,"lg")]};function Zt(it,Ot){const{componentCls:qt,inputPaddingHorizontalBase:Te,borderRadius:_e}=it,fi=it.controlHeight-it.lineWidth*2,Ht=Math.ceil(it.fontSize*1.25),pe=Ot?`${qt}-${Ot}`:"";return{[`${qt}-single${pe}`]:{fontSize:it.fontSize,[`${qt}-selector`]:Object.assign(Object.assign({},(0,Nt.Wf)(it)),{display:"flex",borderRadius:_e,[`${qt}-selection-search`]:{position:"absolute",top:0,insetInlineStart:Te,insetInlineEnd:Te,bottom:0,"&-input":{width:"100%"}},[`
|
|
|
${qt}-selection-item,
|
|
|
${qt}-selection-placeholder
|
|
|
`]:{padding:0,lineHeight:`${fi}px`,transition:`all ${it.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${fi}px`}},[`${qt}-selection-item`]:{position:"relative",userSelect:"none"},[`${qt}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${qt}-selection-item:after`,`${qt}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
|
|
|
&${qt}-show-arrow ${qt}-selection-item,
|
|
|
&${qt}-show-arrow ${qt}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:Ht},[`&${qt}-open ${qt}-selection-item`]:{color:it.colorTextPlaceholder},[`&:not(${qt}-customize-input)`]:{[`${qt}-selector`]:{width:"100%",height:it.controlHeight,padding:`0 ${Te}px`,[`${qt}-selection-search-input`]:{height:fi},"&:after":{lineHeight:`${fi}px`}}},[`&${qt}-customize-input`]:{[`${qt}-selector`]:{"&:after":{display:"none"},[`${qt}-selection-search`]:{position:"static",width:"100%"},[`${qt}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Te}px`,"&:after":{display:"none"}}}}}}}function zt(it){const{componentCls:Ot}=it,qt=it.controlPaddingHorizontalSM-it.lineWidth;return[Zt(it),Zt((0,vt.TS)(it,{controlHeight:it.controlHeightSM,borderRadius:it.borderRadiusSM}),"sm"),{[`${Ot}-single${Ot}-sm`]:{[`&:not(${Ot}-customize-input)`]:{[`${Ot}-selection-search`]:{insetInlineStart:qt,insetInlineEnd:qt},[`${Ot}-selector`]:{padding:`0 ${qt}px`},[`&${Ot}-show-arrow ${Ot}-selection-search`]:{insetInlineEnd:qt+it.fontSize*1.5},[`
|
|
|
&${Ot}-show-arrow ${Ot}-selection-item,
|
|
|
&${Ot}-show-arrow ${Ot}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:it.fontSize*1.5}}}},Zt((0,vt.TS)(it,{controlHeight:it.singleItemHeightLG,fontSize:it.fontSizeLG,borderRadius:it.borderRadiusLG}),"lg")]}const Q=it=>{const{componentCls:Ot,selectorBg:qt}=it;return{position:"relative",backgroundColor:qt,border:`${it.lineWidth}px ${it.lineType} ${it.colorBorder}`,transition:`all ${it.motionDurationMid} ${it.motionEaseInOut}`,input:{cursor:"pointer"},[`${Ot}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Ot}-disabled&`]:{color:it.colorTextDisabled,background:it.colorBgContainerDisabled,cursor:"not-allowed",[`${Ot}-multiple&`]:{background:it.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},se=function(it,Ot){let qt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:Te,borderHoverColor:_e,outlineColor:fi,antCls:Ht}=Ot,pe=qt?{[`${Te}-selector`]:{borderColor:_e}}:{};return{[it]:{[`&:not(${Te}-disabled):not(${Te}-customize-input):not(${Ht}-pagination-size-changer)`]:Object.assign(Object.assign({},pe),{[`${Te}-focused& ${Te}-selector`]:{borderColor:_e,boxShadow:`0 0 0 ${Ot.controlOutlineWidth}px ${fi}`,outline:0},[`&:hover ${Te}-selector`]:{borderColor:_e}})}}},$e=it=>{const{componentCls:Ot}=it;return{[`${Ot}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},Vt=it=>{const{componentCls:Ot,inputPaddingHorizontalBase:qt,iconCls:Te}=it;return{[Ot]:Object.assign(Object.assign({},(0,Nt.Wf)(it)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Ot}-customize-input) ${Ot}-selector`]:Object.assign(Object.assign({},Q(it)),$e(it)),[`${Ot}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},Nt.vS),[`${Ot}-selection-placeholder`]:Object.assign(Object.assign({},Nt.vS),{flex:1,color:it.colorTextPlaceholder,pointerEvents:"none"}),[`${Ot}-arrow`]:Object.assign(Object.assign({},(0,Nt.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:qt,height:it.fontSizeIcon,marginTop:-it.fontSizeIcon/2,color:it.colorTextQuaternary,fontSize:it.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[Te]:{verticalAlign:"top",transition:`transform ${it.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Ot}-suffix)`]:{pointerEvents:"auto"}},[`${Ot}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Ot}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:qt,zIndex:1,display:"inline-block",width:it.fontSizeIcon,height:it.fontSizeIcon,marginTop:-it.fontSizeIcon/2,color:it.colorTextQuaternary,fontSize:it.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:it.clearBg,cursor:"pointer",opacity:0,transition:`color ${it.motionDurationMid} ease, opacity ${it.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:it.colorTextTertiary}},"&:hover":{[`${Ot}-clear`]:{opacity:1}}}),[`${Ot}-has-feedback`]:{[`${Ot}-clear`]:{insetInlineEnd:qt+it.fontSize+it.paddingXS}}}},Wt=it=>{const{componentCls:Ot}=it;return[{[Ot]:{[`&-borderless ${Ot}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Ot}-in-form-item`]:{width:"100%"}}},Vt(it),zt(it),le(it),F(it),{[`${Ot}-rtl`]:{direction:"rtl"}},se(Ot,(0,vt.TS)(it,{borderHoverColor:it.colorPrimaryHover,outlineColor:it.controlOutline})),se(`${Ot}-status-error`,(0,vt.TS)(it,{borderHoverColor:it.colorErrorHover,outlineColor:it.colorErrorOutline}),!0),se(`${Ot}-status-warning`,(0,vt.TS)(it,{borderHoverColor:it.colorWarningHover,outlineColor:it.colorWarningOutline}),!0),(0,At.c)(it,{borderElCls:`${Ot}-selector`,focusElCls:`${Ot}-focused`})]};var kt=(0,Et.Z)("Select",(it,Ot)=>{let{rootPrefixCls:qt}=Ot;const Te=(0,vt.TS)(it,{rootPrefixCls:qt,inputPaddingHorizontalBase:it.paddingSM-1,multipleSelectItemHeight:it.multipleItemHeight});return[Wt(Te)]},it=>{const{fontSize:Ot,lineHeight:qt,controlHeight:Te,controlPaddingHorizontal:_e,zIndexPopupBase:fi,colorText:Ht,fontWeightStrong:pe,controlItemBgActive:Ke,controlItemBgHover:ki,colorBgContainer:pi,colorFillSecondary:Sn,controlHeightLG:Sr,controlHeightSM:Ki,colorBgContainerDisabled:It,colorTextDisabled:tt}=it;return{zIndexPopup:fi+50,optionSelectedColor:Ht,optionSelectedFontWeight:pe,optionSelectedBg:Ke,optionActiveBg:ki,optionPadding:`${(Te-Ot*qt)/2}px ${_e}px`,optionFontSize:Ot,optionLineHeight:qt,optionHeight:Te,selectorBg:pi,clearBg:pi,singleItemHeightLG:Sr,multipleItemBg:Sn,multipleItemBorderColor:"transparent",multipleItemHeight:Ki,multipleItemHeightLG:Te,multipleSelectorBgDisabled:It,multipleItemColorDisabled:tt,multipleItemBorderColorDisabled:"transparent"}})},13458:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return At}});const Nt=vt=>{const gt={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:vt==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},gt),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},gt),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},gt),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},gt),{points:["br","tr"],offset:[0,-4]})}};function At(vt,Et){return vt||Nt(Et)}},78642:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return Nt}});function Nt(At,vt){return vt!==void 0?vt:At!==null}},46163:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ot}});var Nt=j(60068),At=j(30186),vt=j(85846),Et=j(15558),gt=j(77322),ft=j(47880),ct=j(67294);function ot(F){let{suffixIcon:Y,clearIcon:ee,menuItemSelectedIcon:ne,removeIcon:Fe,loading:le,multiple:Zt,hasFeedback:zt,prefixCls:Q,showSuffixIcon:se,feedbackIcon:$e,showArrow:Vt,componentName:Wt}=F;const kt=ee!=null?ee:ct.createElement(At.Z,null),it=_e=>Y===null&&!zt&&!Vt?null:ct.createElement(ct.Fragment,null,se!==!1&&_e,zt&&$e);let Ot=null;if(Y!==void 0)Ot=it(Y);else if(le)Ot=it(ct.createElement(gt.Z,{spin:!0}));else{const _e=`${Q}-suffix`;Ot=fi=>{let{open:Ht,showSearch:pe}=fi;return it(Ht&&pe?ct.createElement(ft.Z,{className:_e}):ct.createElement(Et.Z,{className:_e}))}}let qt=null;ne!==void 0?qt=ne:Zt?qt=ct.createElement(Nt.Z,null):qt=null;let Te=null;return Fe!==void 0?Te=Fe:Te=ct.createElement(vt.Z,null),{clearIcon:kt,suffixIcon:Ot,itemIcon:qt,removeIcon:Te}}},93421:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return Q}});var Nt=j(67294),At=j(94184),vt=j.n(At),Et=j(37419),gt=j(53124),ft=j(4173);const ct=Nt.createContext({latestIndex:0}),ot=ct.Provider;var Y=se=>{let{className:$e,index:Vt,children:Wt,split:kt,style:it}=se;const{latestIndex:Ot}=Nt.useContext(ct);return Wt==null?null:Nt.createElement(Nt.Fragment,null,Nt.createElement("div",{className:$e,style:it},Wt),Vt<Ot&&kt&&Nt.createElement("span",{className:`${$e}-split`},kt))},ee=j(51916);function ne(se){return["small","middle","large"].includes(se)}function Fe(se){return se?typeof se=="number"&&!Number.isNaN(se):!1}var le=function(se,$e){var Vt={};for(var Wt in se)Object.prototype.hasOwnProperty.call(se,Wt)&&$e.indexOf(Wt)<0&&(Vt[Wt]=se[Wt]);if(se!=null&&typeof Object.getOwnPropertySymbols=="function")for(var kt=0,Wt=Object.getOwnPropertySymbols(se);kt<Wt.length;kt++)$e.indexOf(Wt[kt])<0&&Object.prototype.propertyIsEnumerable.call(se,Wt[kt])&&(Vt[Wt[kt]]=se[Wt[kt]]);return Vt};const zt=Nt.forwardRef((se,$e)=>{var Vt,Wt;const{getPrefixCls:kt,space:it,direction:Ot}=Nt.useContext(gt.E_),{size:qt=(it==null?void 0:it.size)||"small",align:Te,className:_e,rootClassName:fi,children:Ht,direction:pe="horizontal",prefixCls:Ke,split:ki,style:pi,wrap:Sn=!1,classNames:Sr,styles:Ki}=se,It=le(se,["size","align","className","rootClassName","children","direction","prefixCls","split","style","wrap","classNames","styles"]),[tt,de]=Array.isArray(qt)?qt:[qt,qt],hi=ne(de),Ze=ne(tt),Ye=Fe(de),Ae=Fe(tt),Wi=(0,Et.Z)(Ht,{keepEmpty:!0}),En=Te===void 0&&pe==="horizontal"?"center":Te,an=kt("space",Ke),[vi,ai]=(0,ee.Z)(an),zi=vt()(an,it==null?void 0:it.className,ai,`${an}-${pe}`,{[`${an}-rtl`]:Ot==="rtl",[`${an}-align-${En}`]:En,[`${an}-gap-row-${de}`]:hi,[`${an}-gap-col-${tt}`]:Ze},_e,fi),$i=vt()(`${an}-item`,(Vt=Sr==null?void 0:Sr.item)!==null&&Vt!==void 0?Vt:(Wt=it==null?void 0:it.classNames)===null||Wt===void 0?void 0:Wt.item);let q=0;const D=Wi.map((z,P)=>{var bt,Gt;z!=null&&(q=P);const Pe=z&&z.key||`${$i}-${P}`;return Nt.createElement(Y,{className:$i,key:Pe,index:P,split:ki,style:(bt=Ki==null?void 0:Ki.item)!==null&&bt!==void 0?bt:(Gt=it==null?void 0:it.styles)===null||Gt===void 0?void 0:Gt.item},z)}),_=Nt.useMemo(()=>({latestIndex:q}),[q]);if(Wi.length===0)return null;const K={};return Sn&&(K.flexWrap="wrap"),!Ze&&Ae&&(K.columnGap=tt),!hi&&Ye&&(K.rowGap=de),vi(Nt.createElement("div",Object.assign({ref:$e,className:zi,style:Object.assign(Object.assign(Object.assign({},K),it==null?void 0:it.style),pi)},It),Nt.createElement(ot,{value:_},D)))});zt.Compact=ft.ZP;var Q=zt},33507:function(Wr,Ti){"use strict";const j=Nt=>({[Nt.componentCls]:{[`${Nt.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${Nt.motionDurationMid} ${Nt.motionEaseInOut},
|
|
|
opacity ${Nt.motionDurationMid} ${Nt.motionEaseInOut} !important`}},[`${Nt.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${Nt.motionDurationMid} ${Nt.motionEaseInOut},
|
|
|
opacity ${Nt.motionDurationMid} ${Nt.motionEaseInOut} !important`}}});Ti.Z=j},33297:function(Wr,Ti,j){"use strict";j.d(Ti,{Fm:function(){return ne}});var Nt=j(45930),At=j(93590);const vt=new Nt.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Et=new Nt.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),gt=new Nt.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ft=new Nt.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),ct=new Nt.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ot=new Nt.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),F=new Nt.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Y=new Nt.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),ee={"move-up":{inKeyframes:F,outKeyframes:Y},"move-down":{inKeyframes:vt,outKeyframes:Et},"move-left":{inKeyframes:gt,outKeyframes:ft},"move-right":{inKeyframes:ct,outKeyframes:ot}},ne=(Fe,le)=>{const{antCls:Zt}=Fe,zt=`${Zt}-${le}`,{inKeyframes:Q,outKeyframes:se}=ee[le];return[(0,At.R)(zt,Q,se,Fe.motionDurationMid),{[`
|
|
|
${zt}-enter,
|
|
|
${zt}-appear
|
|
|
`]:{opacity:0,animationTimingFunction:Fe.motionEaseOutCirc},[`${zt}-leave`]:{animationTimingFunction:Fe.motionEaseInOutCirc}}]}},67771:function(Wr,Ti,j){"use strict";j.d(Ti,{Qt:function(){return gt},Uw:function(){return Et},fJ:function(){return vt},ly:function(){return ft},oN:function(){return ne}});var Nt=j(45930),At=j(93590);const vt=new Nt.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Et=new Nt.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),gt=new Nt.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),ft=new Nt.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),ct=new Nt.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),ot=new Nt.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),F=new Nt.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Y=new Nt.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),ee={"slide-up":{inKeyframes:vt,outKeyframes:Et},"slide-down":{inKeyframes:gt,outKeyframes:ft},"slide-left":{inKeyframes:ct,outKeyframes:ot},"slide-right":{inKeyframes:F,outKeyframes:Y}},ne=(Fe,le)=>{const{antCls:Zt}=Fe,zt=`${Zt}-${le}`,{inKeyframes:Q,outKeyframes:se}=ee[le];return[(0,At.R)(zt,Q,se,Fe.motionDurationMid),{[`
|
|
|
${zt}-enter,
|
|
|
${zt}-appear
|
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:Fe.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${zt}-leave`]:{animationTimingFunction:Fe.motionEaseInQuint}}]}},47897:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return K}});var Nt=j(77322),At=j(94184),vt=j.n(At);function Et(){return Et=Object.assign?Object.assign.bind():function(z){for(var P=1;P<arguments.length;P++){var bt=arguments[P];for(var Gt in bt)Object.prototype.hasOwnProperty.call(bt,Gt)&&(z[Gt]=bt[Gt])}return z},Et.apply(this,arguments)}function gt(z){"@babel/helpers - typeof";return gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},gt(z)}function ft(z,P){if(gt(z)!=="object"||z===null)return z;var bt=z[Symbol.toPrimitive];if(bt!==void 0){var Gt=bt.call(z,P||"default");if(gt(Gt)!=="object")return Gt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(z)}function ct(z){var P=ft(z,"string");return gt(P)==="symbol"?P:String(P)}function ot(z,P,bt){return P=ct(P),P in z?Object.defineProperty(z,P,{value:bt,enumerable:!0,configurable:!0,writable:!0}):z[P]=bt,z}function F(z){if(Array.isArray(z))return z}function Y(z,P){var bt=z==null?null:typeof Symbol!="undefined"&&z[Symbol.iterator]||z["@@iterator"];if(bt!=null){var Gt,Pe,He,ei,si=[],Gi=!0,er=!1;try{if(He=(bt=bt.call(z)).next,P===0){if(Object(bt)!==bt)return;Gi=!1}else for(;!(Gi=(Gt=He.call(bt)).done)&&(si.push(Gt.value),si.length!==P);Gi=!0);}catch(rr){er=!0,Pe=rr}finally{try{if(!Gi&&bt.return!=null&&(ei=bt.return(),Object(ei)!==ei))return}finally{if(er)throw Pe}}return si}}function ee(z,P){(P==null||P>z.length)&&(P=z.length);for(var bt=0,Gt=new Array(P);bt<P;bt++)Gt[bt]=z[bt];return Gt}function ne(z,P){if(z){if(typeof z=="string")return ee(z,P);var bt=Object.prototype.toString.call(z).slice(8,-1);if(bt==="Object"&&z.constructor&&(bt=z.constructor.name),bt==="Map"||bt==="Set")return Array.from(z);if(bt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(bt))return ee(z,P)}}function Fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function le(z,P){return F(z)||Y(z,P)||ne(z,P)||Fe()}function Zt(z,P){if(z==null)return{};var bt={},Gt=Object.keys(z),Pe,He;for(He=0;He<Gt.length;He++)Pe=Gt[He],!(P.indexOf(Pe)>=0)&&(bt[Pe]=z[Pe]);return bt}function zt(z,P){if(z==null)return{};var bt=Zt(z,P),Gt,Pe;if(Object.getOwnPropertySymbols){var He=Object.getOwnPropertySymbols(z);for(Pe=0;Pe<He.length;Pe++)Gt=He[Pe],!(P.indexOf(Gt)>=0)&&Object.prototype.propertyIsEnumerable.call(z,Gt)&&(bt[Gt]=z[Gt])}return bt}var Q=j(67294);function se(z){if(Array.isArray(z))return z}function $e(z,P){var bt=z==null?null:typeof Symbol!="undefined"&&z[Symbol.iterator]||z["@@iterator"];if(bt!=null){var Gt,Pe,He,ei,si=[],Gi=!0,er=!1;try{if(He=(bt=bt.call(z)).next,P===0){if(Object(bt)!==bt)return;Gi=!1}else for(;!(Gi=(Gt=He.call(bt)).done)&&(si.push(Gt.value),si.length!==P);Gi=!0);}catch(rr){er=!0,Pe=rr}finally{try{if(!Gi&&bt.return!=null&&(ei=bt.return(),Object(ei)!==ei))return}finally{if(er)throw Pe}}return si}}function Vt(z,P){(P==null||P>z.length)&&(P=z.length);for(var bt=0,Gt=new Array(P);bt<P;bt++)Gt[bt]=z[bt];return Gt}function Wt(z,P){if(z){if(typeof z=="string")return Vt(z,P);var bt=Object.prototype.toString.call(z).slice(8,-1);if(bt==="Object"&&z.constructor&&(bt=z.constructor.name),bt==="Map"||bt==="Set")return Array.from(z);if(bt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(bt))return Vt(z,P)}}function kt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function it(z,P){return se(z)||$e(z,P)||Wt(z,P)||kt()}function Ot(z){var P=Q.useRef();P.current=z;var bt=Q.useCallback(function(){for(var Gt,Pe=arguments.length,He=new Array(Pe),ei=0;ei<Pe;ei++)He[ei]=arguments[ei];return(Gt=P.current)===null||Gt===void 0?void 0:Gt.call.apply(Gt,[P].concat(He))},[]);return bt}function qt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Te=qt()?Q.useLayoutEffect:Q.useEffect,_e=function(P,bt){var Gt=Q.useRef(!0);Te(function(){return P(Gt.current)},bt),Te(function(){return Gt.current=!1,function(){Gt.current=!0}},[])},fi=function(P,bt){_e(function(Gt){if(!Gt)return P()},bt)},Ht=null;function pe(z){var P=Q.useRef(!1),bt=Q.useState(z),Gt=it(bt,2),Pe=Gt[0],He=Gt[1];Q.useEffect(function(){return P.current=!1,function(){P.current=!0}},[]);function ei(si,Gi){Gi&&P.current||He(si)}return[Pe,ei]}function Ke(z){return z!==void 0}function ki(z,P){var bt=P||{},Gt=bt.defaultValue,Pe=bt.value,He=bt.onChange,ei=bt.postState,si=pe(function(){return Ke(Pe)?Pe:Ke(Gt)?typeof Gt=="function"?Gt():Gt:typeof z=="function"?z():z}),Gi=it(si,2),er=Gi[0],rr=Gi[1],Se=Pe!==void 0?Pe:er,We=ei?ei(Se):Se,Go=Ot(He),$o=pe([Se]),yo=it($o,2),Fr=yo[0],Ro=yo[1];fi(function(){var Ao=Fr[0];er!==Ao&&Go(er,Ao)},[Fr]),fi(function(){Ke(Pe)||rr(Pe)},[Pe]);var uo=Ot(function(Ao,fs){rr(Ao,fs),Ro([Se],fs)});return[We,uo]}var pi={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(P){var bt=P.keyCode;if(P.altKey&&!P.ctrlKey||P.metaKey||bt>=pi.F1&&bt<=pi.F12)return!1;switch(bt){case pi.ALT:case pi.CAPS_LOCK:case pi.CONTEXT_MENU:case pi.CTRL:case pi.DOWN:case pi.END:case pi.ESC:case pi.HOME:case pi.INSERT:case pi.LEFT:case pi.MAC_FF_META:case pi.META:case pi.NUMLOCK:case pi.NUM_CENTER:case pi.PAGE_DOWN:case pi.PAGE_UP:case pi.PAUSE:case pi.PRINT_SCREEN:case pi.RIGHT:case pi.SHIFT:case pi.UP:case pi.WIN_KEY:case pi.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(P){if(P>=pi.ZERO&&P<=pi.NINE||P>=pi.NUM_ZERO&&P<=pi.NUM_MULTIPLY||P>=pi.A&&P<=pi.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&P===0)return!0;switch(P){case pi.SPACE:case pi.QUESTION_MARK:case pi.NUM_PLUS:case pi.NUM_MINUS:case pi.NUM_PERIOD:case pi.NUM_DIVISION:case pi.SEMICOLON:case pi.DASH:case pi.EQUALS:case pi.COMMA:case pi.PERIOD:case pi.SLASH:case pi.APOSTROPHE:case pi.SINGLE_QUOTE:case pi.OPEN_SQUARE_BRACKET:case pi.BACKSLASH:case pi.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Sn=pi,Sr=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Ki=Q.forwardRef(function(z,P){var bt,Gt=z.prefixCls,Pe=Gt===void 0?"rc-switch":Gt,He=z.className,ei=z.checked,si=z.defaultChecked,Gi=z.disabled,er=z.loadingIcon,rr=z.checkedChildren,Se=z.unCheckedChildren,We=z.onClick,Go=z.onChange,$o=z.onKeyDown,yo=zt(z,Sr),Fr=ki(!1,{value:ei,defaultValue:si}),Ro=le(Fr,2),uo=Ro[0],Ao=Ro[1];function fs(Na,xo){var rl=uo;return Gi||(rl=Na,Ao(rl),Go==null||Go(rl,xo)),rl}function Ya(Na){Na.which===Sn.LEFT?fs(!1,Na):Na.which===Sn.RIGHT&&fs(!0,Na),$o==null||$o(Na)}function Ja(Na){var xo=fs(!uo,Na);We==null||We(xo,Na)}var jl=vt()(Pe,He,(bt={},ot(bt,"".concat(Pe,"-checked"),uo),ot(bt,"".concat(Pe,"-disabled"),Gi),bt));return Q.createElement("button",Et({},yo,{type:"button",role:"switch","aria-checked":uo,disabled:Gi,className:jl,ref:P,onKeyDown:Ya,onClick:Ja}),er,Q.createElement("span",{className:"".concat(Pe,"-inner")},Q.createElement("span",{className:"".concat(Pe,"-inner-checked")},rr),Q.createElement("span",{className:"".concat(Pe,"-inner-unchecked")},Se)))});Ki.displayName="Switch";var It=Ki,tt=j(45353),de=j(53124),hi=j(98866),Ze=j(98675),Ye=j(84780),Ae=j(14747),Wi=j(67968),En=j(45503);const an=z=>{const{componentCls:P,trackHeightSM:bt,trackPadding:Gt,trackMinWidthSM:Pe,innerMinMarginSM:He,innerMaxMarginSM:ei,handleSizeSM:si}=z,Gi=`${P}-inner`;return{[P]:{[`&${P}-small`]:{minWidth:Pe,height:bt,lineHeight:`${bt}px`,[`${P}-inner`]:{paddingInlineStart:ei,paddingInlineEnd:He,[`${Gi}-checked`]:{marginInlineStart:`calc(-100% + ${si+Gt*2}px - ${ei*2}px)`,marginInlineEnd:`calc(100% - ${si+Gt*2}px + ${ei*2}px)`},[`${Gi}-unchecked`]:{marginTop:-bt,marginInlineStart:0,marginInlineEnd:0}},[`${P}-handle`]:{width:si,height:si},[`${P}-loading-icon`]:{top:(si-z.switchLoadingIconSize)/2,fontSize:z.switchLoadingIconSize},[`&${P}-checked`]:{[`${P}-inner`]:{paddingInlineStart:He,paddingInlineEnd:ei,[`${Gi}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${Gi}-unchecked`]:{marginInlineStart:`calc(100% - ${si+Gt*2}px + ${ei*2}px)`,marginInlineEnd:`calc(-100% + ${si+Gt*2}px - ${ei*2}px)`}},[`${P}-handle`]:{insetInlineStart:`calc(100% - ${si+Gt}px)`}},[`&:not(${P}-disabled):active`]:{[`&:not(${P}-checked) ${Gi}`]:{[`${Gi}-unchecked`]:{marginInlineStart:z.marginXXS/2,marginInlineEnd:-z.marginXXS/2}},[`&${P}-checked ${Gi}`]:{[`${Gi}-checked`]:{marginInlineStart:-z.marginXXS/2,marginInlineEnd:z.marginXXS/2}}}}}}},vi=z=>{const{componentCls:P,handleSize:bt}=z;return{[P]:{[`${P}-loading-icon${z.iconCls}`]:{position:"relative",top:(bt-z.fontSize)/2,color:z.switchLoadingIconColor,verticalAlign:"top"},[`&${P}-checked ${P}-loading-icon`]:{color:z.switchColor}}}},ai=z=>{const{componentCls:P,motion:bt,trackPadding:Gt,handleBg:Pe,handleShadow:He,handleSize:ei}=z,si=`${P}-handle`;return{[P]:{[si]:{position:"absolute",top:Gt,insetInlineStart:Gt,width:ei,height:ei,transition:`all ${z.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Pe,borderRadius:ei/2,boxShadow:He,transition:`all ${z.switchDuration} ease-in-out`,content:'""'}},[`&${P}-checked ${si}`]:{insetInlineStart:`calc(100% - ${ei+Gt}px)`},[`&:not(${P}-disabled):active`]:bt?{[`${si}::before`]:{insetInlineEnd:z.switchHandleActiveInset,insetInlineStart:0},[`&${P}-checked ${si}::before`]:{insetInlineEnd:0,insetInlineStart:z.switchHandleActiveInset}}:{}}}},zi=z=>{const{componentCls:P,trackHeight:bt,trackPadding:Gt,innerMinMargin:Pe,innerMaxMargin:He,handleSize:ei}=z,si=`${P}-inner`;return{[P]:{[si]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:He,paddingInlineEnd:Pe,transition:`padding-inline-start ${z.switchDuration} ease-in-out, padding-inline-end ${z.switchDuration} ease-in-out`,[`${si}-checked, ${si}-unchecked`]:{display:"block",color:z.colorTextLightSolid,fontSize:z.fontSizeSM,transition:`margin-inline-start ${z.switchDuration} ease-in-out, margin-inline-end ${z.switchDuration} ease-in-out`,pointerEvents:"none"},[`${si}-checked`]:{marginInlineStart:`calc(-100% + ${ei+Gt*2}px - ${He*2}px)`,marginInlineEnd:`calc(100% - ${ei+Gt*2}px + ${He*2}px)`},[`${si}-unchecked`]:{marginTop:-bt,marginInlineStart:0,marginInlineEnd:0}},[`&${P}-checked ${si}`]:{paddingInlineStart:Pe,paddingInlineEnd:He,[`${si}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${si}-unchecked`]:{marginInlineStart:`calc(100% - ${ei+Gt*2}px + ${He*2}px)`,marginInlineEnd:`calc(-100% + ${ei+Gt*2}px - ${He*2}px)`}},[`&:not(${P}-disabled):active`]:{[`&:not(${P}-checked) ${si}`]:{[`${si}-unchecked`]:{marginInlineStart:Gt*2,marginInlineEnd:-Gt*2}},[`&${P}-checked ${si}`]:{[`${si}-checked`]:{marginInlineStart:-Gt*2,marginInlineEnd:Gt*2}}}}}},$i=z=>{const{componentCls:P,trackHeight:bt,trackMinWidth:Gt}=z;return{[P]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ae.Wf)(z)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Gt,height:bt,lineHeight:`${bt}px`,verticalAlign:"middle",background:z.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${z.motionDurationMid}`,userSelect:"none",[`&:hover:not(${P}-disabled)`]:{background:z.colorTextTertiary}}),(0,Ae.Qy)(z)),{[`&${P}-checked`]:{background:z.switchColor,[`&:hover:not(${P}-disabled)`]:{background:z.colorPrimaryHover}},[`&${P}-loading, &${P}-disabled`]:{cursor:"not-allowed",opacity:z.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${P}-rtl`]:{direction:"rtl"}})}};var q=(0,Wi.Z)("Switch",z=>{const P=(0,En.TS)(z,{switchDuration:z.motionDurationMid,switchColor:z.colorPrimary,switchDisabledOpacity:z.opacityLoading,switchLoadingIconSize:z.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${z.opacityLoading})`,switchHandleActiveInset:"-30%"});return[$i(P),zi(P),ai(P),vi(P),an(P)]},z=>{const{fontSize:P,lineHeight:bt,controlHeight:Gt,colorWhite:Pe}=z,He=P*bt,ei=Gt/2,si=2,Gi=He-si*2,er=ei-si*2;return{trackHeight:He,trackHeightSM:ei,trackMinWidth:Gi*2+si*4,trackMinWidthSM:er*2+si*2,trackPadding:si,handleBg:Pe,handleSize:Gi,handleSizeSM:er,handleShadow:`0 2px 4px 0 ${new Ye.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:Gi/2,innerMaxMargin:Gi+si+si*2,innerMinMarginSM:er/2,innerMaxMarginSM:er+si+si*2}}),D=function(z,P){var bt={};for(var Gt in z)Object.prototype.hasOwnProperty.call(z,Gt)&&P.indexOf(Gt)<0&&(bt[Gt]=z[Gt]);if(z!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Pe=0,Gt=Object.getOwnPropertySymbols(z);Pe<Gt.length;Pe++)P.indexOf(Gt[Pe])<0&&Object.prototype.propertyIsEnumerable.call(z,Gt[Pe])&&(bt[Gt[Pe]]=z[Gt[Pe]]);return bt};const _=Q.forwardRef((z,P)=>{const{prefixCls:bt,size:Gt,disabled:Pe,loading:He,className:ei,rootClassName:si,style:Gi}=z,er=D(z,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:rr,direction:Se,switch:We}=Q.useContext(de.E_),Go=Q.useContext(hi.Z),$o=(Pe!=null?Pe:Go)||He,yo=rr("switch",bt),Fr=Q.createElement("div",{className:`${yo}-handle`},He&&Q.createElement(Nt.Z,{className:`${yo}-loading-icon`})),[Ro,uo]=q(yo),Ao=(0,Ze.Z)(Gt),fs=vt()(We==null?void 0:We.className,{[`${yo}-small`]:Ao==="small",[`${yo}-loading`]:He,[`${yo}-rtl`]:Se==="rtl"},ei,si,uo),Ya=Object.assign(Object.assign({},We==null?void 0:We.style),Gi);return Ro(Q.createElement(tt.Z,{component:"Switch"},Q.createElement(It,Object.assign({},er,{prefixCls:yo,className:fs,style:Ya,disabled:$o,ref:P,loadingIcon:Fr}))))});_.__ANT_SWITCH=!0;var K=_},36182:function(Wr,Ti,j){"use strict";j.d(Ti,{default:function(){return Th}});var Nt=j(85846),At=j(64582),vt=j(87462),Et=j(67294),gt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},ft=gt,ct=j(44327),ot=function(ut,re){return Et.createElement(ct.Z,(0,vt.Z)({},ut,{ref:re,icon:ft}))},F=Et.forwardRef(ot),Y=j(94184),ee=j.n(Y),ne=j(4942),Fe=j(1413),le=j(97685),Zt=j(71002),zt=j(45987),Q=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var rt=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(rt)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(rt==null?void 0:rt.substr(0,4))};function se(rt){var ut=Et.useRef();ut.current=rt;var re=Et.useCallback(function(){for(var be,Ge=arguments.length,ni=new Array(Ge),fe=0;fe<Ge;fe++)ni[fe]=arguments[fe];return(be=ut.current)===null||be===void 0?void 0:be.call.apply(be,[ut].concat(ni))},[]);return re}function $e(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Vt=$e()?Et.useLayoutEffect:Et.useEffect,Wt=function(ut,re){var be=Et.useRef(!0);Vt(function(){return ut(be.current)},re),Vt(function(){return be.current=!1,function(){be.current=!0}},[])},kt=function(ut,re){Wt(function(be){if(!be)return ut()},re)},it=null;function Ot(rt){var ut=Et.useRef(!1),re=Et.useState(rt),be=(0,le.Z)(re,2),Ge=be[0],ni=be[1];Et.useEffect(function(){return ut.current=!1,function(){ut.current=!0}},[]);function fe(un,An){An&&ut.current||ni(un)}return[Ge,fe]}function qt(rt){return rt!==void 0}function Te(rt,ut){var re=ut||{},be=re.defaultValue,Ge=re.value,ni=re.onChange,fe=re.postState,un=Ot(function(){return qt(Ge)?Ge:qt(be)?typeof be=="function"?be():be:typeof rt=="function"?rt():rt}),An=(0,le.Z)(un,2),xr=An[0],Ur=An[1],Zn=Ge!==void 0?Ge:xr,ko=fe?fe(Zn):Zn,Yo=se(ni),Oo=Ot([Zn]),Ms=(0,le.Z)(Oo,2),na=Ms[0],Tt=Ms[1];kt(function(){var Yn=na[0];xr!==Yn&&Yo(xr,Yn)},[na]),kt(function(){qt(Ge)||Ur(Ge)},[Ge]);var yn=se(function(Yn,Ir){Ur(Yn,Ir),Tt([Zn],Ir)});return[ko,yn]}var _e=j(62874),fi=(0,Et.createContext)(null),Ht=Et.forwardRef(function(rt,ut){var re=rt.prefixCls,be=rt.className,Ge=rt.style,ni=rt.id,fe=rt.active,un=rt.tabKey,An=rt.children;return Et.createElement("div",{id:ni&&"".concat(ni,"-panel-").concat(un),role:"tabpanel",tabIndex:fe?0:-1,"aria-labelledby":ni&&"".concat(ni,"-tab-").concat(un),"aria-hidden":!fe,style:Ge,className:ee()(re,fe&&"".concat(re,"-active"),be),ref:ut},An)}),pe=Ht,Ke=["key","forceRender","style","className"];function ki(rt){var ut=rt.id,re=rt.activeKey,be=rt.animated,Ge=rt.tabPosition,ni=rt.destroyInactiveTabPane,fe=Et.useContext(fi),un=fe.prefixCls,An=fe.tabs,xr=be.tabPane,Ur="".concat(un,"-tabpane");return Et.createElement("div",{className:ee()("".concat(un,"-content-holder"))},Et.createElement("div",{className:ee()("".concat(un,"-content"),"".concat(un,"-content-").concat(Ge),(0,ne.Z)({},"".concat(un,"-content-animated"),xr))},An.map(function(Zn){var ko=Zn.key,Yo=Zn.forceRender,Oo=Zn.style,Ms=Zn.className,na=(0,zt.Z)(Zn,Ke),Tt=ko===re;return Et.createElement(_e.Z,(0,vt.Z)({key:ko,visible:Tt,forceRender:Yo,removeOnLeave:!!ni,leavedClassName:"".concat(Ur,"-hidden")},be.tabPaneMotion),function(yn,Yn){var Ir=yn.style,ls=yn.className;return Et.createElement(pe,(0,vt.Z)({},na,{prefixCls:Ur,id:ut,tabKey:ko,animated:xr,active:Tt,style:(0,Fe.Z)((0,Fe.Z)({},Oo),Ir),className:ee()(Ms,ls),ref:Yn}))})})))}var pi=j(74902),Sn=j(48555),Sr=j(59864);function Ki(rt,ut,re){var be=Et.useRef({});return(!("value"in be.current)||re(be.current.condition,ut))&&(be.current.value=rt(),be.current.condition=ut),be.current.value}function It(rt,ut){typeof rt=="function"?rt(ut):(0,Zt.Z)(rt)==="object"&&rt&&"current"in rt&&(rt.current=ut)}function tt(){for(var rt=arguments.length,ut=new Array(rt),re=0;re<rt;re++)ut[re]=arguments[re];var be=ut.filter(function(Ge){return Ge});return be.length<=1?be[0]:function(Ge){ut.forEach(function(ni){It(ni,Ge)})}}function de(){for(var rt=arguments.length,ut=new Array(rt),re=0;re<rt;re++)ut[re]=arguments[re];return Ki(function(){return tt.apply(void 0,ut)},ut,function(be,Ge){return be.length===Ge.length&&be.every(function(ni,fe){return ni===Ge[fe]})})}function hi(rt){var ut,re,be=isMemo(rt)?rt.type.type:rt.type;return!(typeof be=="function"&&!((ut=be.prototype)!==null&&ut!==void 0&&ut.render)||typeof rt=="function"&&!((re=rt.prototype)!==null&&re!==void 0&&re.render))}var Ze={width:0,height:0,left:0,top:0};function Ye(rt,ut,re){return(0,Et.useMemo)(function(){for(var be,Ge=new Map,ni=ut.get((be=rt[0])===null||be===void 0?void 0:be.key)||Ze,fe=ni.left+ni.width,un=0;un<rt.length;un+=1){var An=rt[un].key,xr=ut.get(An);if(!xr){var Ur;xr=ut.get((Ur=rt[un-1])===null||Ur===void 0?void 0:Ur.key)||Ze}var Zn=Ge.get(An)||(0,Fe.Z)({},xr);Zn.right=fe-Zn.left-Zn.width,Ge.set(An,Zn)}return Ge},[rt.map(function(be){return be.key}).join("_"),ut,re])}function Ae(rt,ut){var re=Et.useRef(rt),be=Et.useState({}),Ge=(0,le.Z)(be,2),ni=Ge[1];function fe(un){var An=typeof un=="function"?un(re.current):un;An!==re.current&&ut(An,re.current),re.current=An,ni({})}return[re.current,fe]}var Wi=.1,En=.01,an=20,vi=Math.pow(.995,an);function ai(rt,ut){var re=(0,Et.useState)(),be=(0,le.Z)(re,2),Ge=be[0],ni=be[1],fe=(0,Et.useState)(0),un=(0,le.Z)(fe,2),An=un[0],xr=un[1],Ur=(0,Et.useState)(0),Zn=(0,le.Z)(Ur,2),ko=Zn[0],Yo=Zn[1],Oo=(0,Et.useState)(),Ms=(0,le.Z)(Oo,2),na=Ms[0],Tt=Ms[1],yn=(0,Et.useRef)();function Yn(or){var eo=or.touches[0],Fn=eo.screenX,hn=eo.screenY;ni({x:Fn,y:hn}),window.clearInterval(yn.current)}function Ir(or){if(Ge){or.preventDefault();var eo=or.touches[0],Fn=eo.screenX,hn=eo.screenY;ni({x:Fn,y:hn});var _r=Fn-Ge.x,Or=hn-Ge.y;ut(_r,Or);var Ai=Date.now();xr(Ai),Yo(Ai-An),Tt({x:_r,y:Or})}}function ls(){if(Ge&&(ni(null),Tt(null),na)){var or=na.x/ko,eo=na.y/ko,Fn=Math.abs(or),hn=Math.abs(eo);if(Math.max(Fn,hn)<Wi)return;var _r=or,Or=eo;yn.current=window.setInterval(function(){if(Math.abs(_r)<En&&Math.abs(Or)<En){window.clearInterval(yn.current);return}_r*=vi,Or*=vi,ut(_r*an,Or*an)},an)}}var Jo=(0,Et.useRef)();function ra(or){var eo=or.deltaX,Fn=or.deltaY,hn=0,_r=Math.abs(eo),Or=Math.abs(Fn);_r===Or?hn=Jo.current==="x"?eo:Fn:_r>Or?(hn=eo,Jo.current="x"):(hn=Fn,Jo.current="y"),ut(-hn,-hn)&&or.preventDefault()}var $s=(0,Et.useRef)(null);$s.current={onTouchStart:Yn,onTouchMove:Ir,onTouchEnd:ls,onWheel:ra},Et.useEffect(function(){function or(_r){$s.current.onTouchStart(_r)}function eo(_r){$s.current.onTouchMove(_r)}function Fn(_r){$s.current.onTouchEnd(_r)}function hn(_r){$s.current.onWheel(_r)}return document.addEventListener("touchmove",eo,{passive:!1}),document.addEventListener("touchend",Fn,{passive:!1}),rt.current.addEventListener("touchstart",or,{passive:!1}),rt.current.addEventListener("wheel",hn),function(){document.removeEventListener("touchmove",eo),document.removeEventListener("touchend",Fn)}},[])}function zi(rt){var ut=(0,Et.useState)(0),re=(0,le.Z)(ut,2),be=re[0],Ge=re[1],ni=(0,Et.useRef)(0),fe=(0,Et.useRef)();return fe.current=rt,kt(function(){var un;(un=fe.current)===null||un===void 0||un.call(fe)},[be]),function(){ni.current===be&&(ni.current+=1,Ge(ni.current))}}function $i(rt){var ut=(0,Et.useRef)([]),re=(0,Et.useState)({}),be=(0,le.Z)(re,2),Ge=be[1],ni=(0,Et.useRef)(typeof rt=="function"?rt():rt),fe=zi(function(){var An=ni.current;ut.current.forEach(function(xr){An=xr(An)}),ut.current=[],ni.current=An,Ge({})});function un(An){ut.current.push(An),fe()}return[ni.current,un]}var q={width:0,height:0,left:0,top:0,right:0};function D(rt,ut,re,be,Ge,ni,fe){var un=fe.tabs,An=fe.tabPosition,xr=fe.rtl,Ur,Zn,ko;return["top","bottom"].includes(An)?(Ur="width",Zn=xr?"right":"left",ko=Math.abs(re)):(Ur="height",Zn="top",ko=-re),(0,Et.useMemo)(function(){if(!un.length)return[0,0];for(var Yo=un.length,Oo=Yo,Ms=0;Ms<Yo;Ms+=1){var na=rt.get(un[Ms].key)||q;if(na[Zn]+na[Ur]>ko+ut){Oo=Ms-1;break}}for(var Tt=0,yn=Yo-1;yn>=0;yn-=1){var Yn=rt.get(un[yn].key)||q;if(Yn[Zn]<ko){Tt=yn+1;break}}return Tt>=Oo?[0,0]:[Tt,Oo]},[rt,ut,be,Ge,ni,ko,An,un.map(function(Yo){return Yo.key}).join("_"),xr])}function _(rt){var ut;return rt instanceof Map?(ut={},rt.forEach(function(re,be){ut[be]=re})):ut=rt,JSON.stringify(ut)}var K="TABS_DQ";function z(rt){return String(rt).replace(/"/g,K)}function P(rt,ut,re,be){return!(!re||be||rt===!1||rt===void 0&&(ut===!1||ut===null))}function bt(rt,ut){var re=rt.prefixCls,be=rt.editable,Ge=rt.locale,ni=rt.style;return!be||be.showAdd===!1?null:Et.createElement("button",{ref:ut,type:"button",className:"".concat(re,"-nav-add"),style:ni,"aria-label":(Ge==null?void 0:Ge.addAriaLabel)||"Add tab",onClick:function(un){be.onEdit("add",{event:un})}},be.addIcon||"+")}var Gt=Et.forwardRef(bt),Pe=Et.forwardRef(function(rt,ut){var re=rt.position,be=rt.prefixCls,Ge=rt.extra;if(!Ge)return null;var ni,fe={};return(0,Zt.Z)(Ge)==="object"&&!Et.isValidElement(Ge)?fe=Ge:fe.right=Ge,re==="right"&&(ni=fe.right),re==="left"&&(ni=fe.left),ni?Et.createElement("div",{className:"".concat(be,"-extra-content"),ref:ut},ni):null}),He=Pe,ei=j(62709);function si(rt,ut,re){var be=React.useRef({});return(!("value"in be.current)||re(be.current.condition,ut))&&(be.current.value=rt(),be.current.condition=ut),be.current.value}function Gi(rt,ut){typeof rt=="function"?rt(ut):(0,Zt.Z)(rt)==="object"&&rt&&"current"in rt&&(rt.current=ut)}function er(){for(var rt=arguments.length,ut=new Array(rt),re=0;re<rt;re++)ut[re]=arguments[re];var be=ut.filter(function(Ge){return Ge});return be.length<=1?be[0]:function(Ge){ut.forEach(function(ni){Gi(ni,Ge)})}}function rr(){for(var rt=arguments.length,ut=new Array(rt),re=0;re<rt;re++)ut[re]=arguments[re];return useMemo(function(){return er.apply(void 0,ut)},ut,function(be,Ge){return be.length===Ge.length&&be.every(function(ni,fe){return ni===Ge[fe]})})}function Se(rt){var ut,re,be=(0,Sr.isMemo)(rt)?rt.type.type:rt.type;return!(typeof be=="function"&&!((ut=be.prototype)!==null&&ut!==void 0&&ut.render)||typeof rt=="function"&&!((re=rt.prototype)!==null&&re!==void 0&&re.render))}var We={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(ut){var re=ut.keyCode;if(ut.altKey&&!ut.ctrlKey||ut.metaKey||re>=We.F1&&re<=We.F12)return!1;switch(re){case We.ALT:case We.CAPS_LOCK:case We.CONTEXT_MENU:case We.CTRL:case We.DOWN:case We.END:case We.ESC:case We.HOME:case We.INSERT:case We.LEFT:case We.MAC_FF_META:case We.META:case We.NUMLOCK:case We.NUM_CENTER:case We.PAGE_DOWN:case We.PAGE_UP:case We.PAUSE:case We.PRINT_SCREEN:case We.RIGHT:case We.SHIFT:case We.UP:case We.WIN_KEY:case We.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(ut){if(ut>=We.ZERO&&ut<=We.NINE||ut>=We.NUM_ZERO&&ut<=We.NUM_MULTIPLY||ut>=We.A&&ut<=We.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&ut===0)return!0;switch(ut){case We.SPACE:case We.QUESTION_MARK:case We.NUM_PLUS:case We.NUM_MINUS:case We.NUM_PERIOD:case We.NUM_DIVISION:case We.SEMICOLON:case We.DASH:case We.EQUALS:case We.COMMA:case We.PERIOD:case We.SLASH:case We.APOSTROPHE:case We.SINGLE_QUOTE:case We.OPEN_SQUARE_BRACKET:case We.BACKSLASH:case We.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Go=We,$o=function(ut){return+setTimeout(ut,16)},yo=function(ut){return clearTimeout(ut)};typeof window!="undefined"&&"requestAnimationFrame"in window&&($o=function(ut){return window.requestAnimationFrame(ut)},yo=function(ut){return window.cancelAnimationFrame(ut)});var Fr=0,Ro=new Map;function uo(rt){Ro.delete(rt)}var Ao=function(ut){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Fr+=1;var be=Fr;function Ge(ni){if(ni===0)uo(be),ut();else{var fe=$o(function(){Ge(ni-1)});Ro.set(be,fe)}}return Ge(re),be};Ao.cancel=function(rt){var ut=Ro.get(rt);return uo(ut),yo(ut)};var fs=Ao,Ya=Go.ESC,Ja=Go.TAB;function jl(rt){var ut=rt.visible,re=rt.triggerRef,be=rt.onVisibleChange,Ge=rt.autoFocus,ni=rt.overlayRef,fe=Et.useRef(!1),un=function(){if(ut){var Zn,ko;(Zn=re.current)===null||Zn===void 0||(ko=Zn.focus)===null||ko===void 0||ko.call(Zn),be==null||be(!1)}},An=function(){var Zn;return(Zn=ni.current)!==null&&Zn!==void 0&&Zn.focus?(ni.current.focus(),fe.current=!0,!0):!1},xr=function(Zn){switch(Zn.keyCode){case Ya:un();break;case Ja:{var ko=!1;fe.current||(ko=An()),ko?Zn.preventDefault():un();break}}};Et.useEffect(function(){return ut?(window.addEventListener("keydown",xr),Ge&&fs(An,3),function(){window.removeEventListener("keydown",xr),fe.current=!1}):function(){fe.current=!1}},[ut])}var Na=(0,Et.forwardRef)(function(rt,ut){var re=rt.overlay,be=rt.arrow,Ge=rt.prefixCls,ni=(0,Et.useMemo)(function(){var un;return typeof re=="function"?un=re():un=re,un},[re]),fe=er(ut,ni==null?void 0:ni.ref);return Et.createElement(Et.Fragment,null,be&&Et.createElement("div",{className:"".concat(Ge,"-arrow")}),Et.cloneElement(ni,{ref:Se(ni)?fe:void 0}))}),xo=Na,rl={adjustX:1,adjustY:1},Va=[0,0],Kl={topLeft:{points:["bl","tl"],overflow:rl,offset:[0,-4],targetOffset:Va},top:{points:["bc","tc"],overflow:rl,offset:[0,-4],targetOffset:Va},topRight:{points:["br","tr"],overflow:rl,offset:[0,-4],targetOffset:Va},bottomLeft:{points:["tl","bl"],overflow:rl,offset:[0,4],targetOffset:Va},bottom:{points:["tc","bc"],overflow:rl,offset:[0,4],targetOffset:Va},bottomRight:{points:["tr","br"],overflow:rl,offset:[0,4],targetOffset:Va}},ga=Kl,Xs=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Me(rt,ut){var re,be=rt.arrow,Ge=be===void 0?!1:be,ni=rt.prefixCls,fe=ni===void 0?"rc-dropdown":ni,un=rt.transitionName,An=rt.animation,xr=rt.align,Ur=rt.placement,Zn=Ur===void 0?"bottomLeft":Ur,ko=rt.placements,Yo=ko===void 0?ga:ko,Oo=rt.getPopupContainer,Ms=rt.showAction,na=rt.hideAction,Tt=rt.overlayClassName,yn=rt.overlayStyle,Yn=rt.visible,Ir=rt.trigger,ls=Ir===void 0?["hover"]:Ir,Jo=rt.autoFocus,ra=rt.overlay,$s=rt.children,or=rt.onVisibleChange,eo=(0,zt.Z)(rt,Xs),Fn=Et.useState(),hn=(0,le.Z)(Fn,2),_r=hn[0],Or=hn[1],Ai="visible"in rt?Yn:_r,kl=Et.useRef(null),El=Et.useRef(null),Ua=Et.useRef(null);Et.useImperativeHandle(ut,function(){return kl.current});var Sl=function(Za){Or(Za),or==null||or(Za)};jl({visible:Ai,triggerRef:Ua,onVisibleChange:Sl,autoFocus:Jo,overlayRef:El});var xu=function(Za){var nu=rt.onOverlayClick;Or(!1),nu&&nu(Za)},di=function(){return Et.createElement(xo,{ref:El,overlay:ra,prefixCls:fe,arrow:Ge})},jr=function(){return typeof ra=="function"?di:di()},Fo=function(){var Za=rt.minOverlayWidthMatchTrigger,nu=rt.alignPoint;return"minOverlayWidthMatchTrigger"in rt?Za:!nu},Ca=function(){var Za=rt.openClassName;return Za!==void 0?Za:"".concat(fe,"-open")},Ll=Et.cloneElement($s,{className:ee()((re=$s.props)===null||re===void 0?void 0:re.className,Ai&&Ca()),ref:Se($s)?er(Ua,$s.ref):void 0}),ol=na;return!ol&&ls.indexOf("contextMenu")!==-1&&(ol=["click"]),Et.createElement(ei.Z,(0,vt.Z)({builtinPlacements:Yo},eo,{prefixCls:fe,ref:kl,popupClassName:ee()(Tt,(0,ne.Z)({},"".concat(fe,"-show-arrow"),Ge)),popupStyle:yn,action:ls,showAction:Ms,hideAction:ol,popupPlacement:Zn,popupAlign:xr,popupTransitionName:un,popupAnimation:An,popupVisible:Ai,stretch:Fo()?"minWidth":"",popup:jr(),onPopupVisibleChange:Sl,onPopupClick:xu,getPopupContainer:Oo}),Ll)}var L=Et.forwardRef(Me),yi=L,qe=j(52073),Si={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(ut){var re=ut.keyCode;if(ut.altKey&&!ut.ctrlKey||ut.metaKey||re>=Si.F1&&re<=Si.F12)return!1;switch(re){case Si.ALT:case Si.CAPS_LOCK:case Si.CONTEXT_MENU:case Si.CTRL:case Si.DOWN:case Si.END:case Si.ESC:case Si.HOME:case Si.INSERT:case Si.LEFT:case Si.MAC_FF_META:case Si.META:case Si.NUMLOCK:case Si.NUM_CENTER:case Si.PAGE_DOWN:case Si.PAGE_UP:case Si.PAUSE:case Si.PRINT_SCREEN:case Si.RIGHT:case Si.SHIFT:case Si.UP:case Si.WIN_KEY:case Si.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(ut){if(ut>=Si.ZERO&&ut<=Si.NINE||ut>=Si.NUM_ZERO&&ut<=Si.NUM_MULTIPLY||ut>=Si.A&&ut<=Si.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&ut===0)return!0;switch(ut){case Si.SPACE:case Si.QUESTION_MARK:case Si.NUM_PLUS:case Si.NUM_MINUS:case Si.NUM_PERIOD:case Si.NUM_DIVISION:case Si.SEMICOLON:case Si.DASH:case Si.EQUALS:case Si.COMMA:case Si.PERIOD:case Si.SLASH:case Si.APOSTROPHE:case Si.SINGLE_QUOTE:case Si.OPEN_SQUARE_BRACKET:case Si.BACKSLASH:case Si.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Vi=Si;function ln(rt,ut){var re=rt.prefixCls,be=rt.id,Ge=rt.tabs,ni=rt.locale,fe=rt.mobile,un=rt.moreIcon,An=un===void 0?"More":un,xr=rt.moreTransitionName,Ur=rt.style,Zn=rt.className,ko=rt.editable,Yo=rt.tabBarGutter,Oo=rt.rtl,Ms=rt.removeAriaLabel,na=rt.onTabClick,Tt=rt.getPopupContainer,yn=rt.popupClassName,Yn=(0,Et.useState)(!1),Ir=(0,le.Z)(Yn,2),ls=Ir[0],Jo=Ir[1],ra=(0,Et.useState)(null),$s=(0,le.Z)(ra,2),or=$s[0],eo=$s[1],Fn="".concat(be,"-more-popup"),hn="".concat(re,"-dropdown"),_r=or!==null?"".concat(Fn,"-").concat(or):null,Or=ni==null?void 0:ni.dropdownAriaLabel;function Ai(jr,Fo){jr.preventDefault(),jr.stopPropagation(),ko.onEdit("remove",{key:Fo,event:jr})}var kl=Et.createElement(qe.ZP,{onClick:function(Fo){var Ca=Fo.key,Ll=Fo.domEvent;na(Ca,Ll),Jo(!1)},prefixCls:"".concat(hn,"-menu"),id:Fn,tabIndex:-1,role:"listbox","aria-activedescendant":_r,selectedKeys:[or],"aria-label":Or!==void 0?Or:"expanded dropdown"},Ge.map(function(jr){var Fo=jr.closable,Ca=jr.disabled,Ll=jr.closeIcon,ol=jr.key,_n=jr.label,Za=P(Fo,Ll,ko,Ca);return Et.createElement(qe.sN,{key:ol,id:"".concat(Fn,"-").concat(ol),role:"option","aria-controls":be&&"".concat(be,"-panel-").concat(ol),disabled:Ca},Et.createElement("span",null,_n),Za&&Et.createElement("button",{type:"button","aria-label":Ms||"remove",tabIndex:0,className:"".concat(hn,"-menu-item-remove"),onClick:function(Tl){Tl.stopPropagation(),Ai(Tl,ol)}},Ll||ko.removeIcon||"\xD7"))}));function El(jr){for(var Fo=Ge.filter(function(Za){return!Za.disabled}),Ca=Fo.findIndex(function(Za){return Za.key===or})||0,Ll=Fo.length,ol=0;ol<Ll;ol+=1){Ca=(Ca+jr+Ll)%Ll;var _n=Fo[Ca];if(!_n.disabled){eo(_n.key);return}}}function Ua(jr){var Fo=jr.which;if(!ls){[Vi.DOWN,Vi.SPACE,Vi.ENTER].includes(Fo)&&(Jo(!0),jr.preventDefault());return}switch(Fo){case Vi.UP:El(-1),jr.preventDefault();break;case Vi.DOWN:El(1),jr.preventDefault();break;case Vi.ESC:Jo(!1);break;case Vi.SPACE:case Vi.ENTER:or!==null&&na(or,jr);break}}(0,Et.useEffect)(function(){var jr=document.getElementById(_r);jr&&jr.scrollIntoView&&jr.scrollIntoView(!1)},[or]),(0,Et.useEffect)(function(){ls||eo(null)},[ls]);var Sl=(0,ne.Z)({},Oo?"marginRight":"marginLeft",Yo);Ge.length||(Sl.visibility="hidden",Sl.order=1);var xu=ee()((0,ne.Z)({},"".concat(hn,"-rtl"),Oo)),di=fe?null:Et.createElement(yi,{prefixCls:hn,overlay:kl,trigger:["hover"],visible:Ge.length?ls:!1,transitionName:xr,onVisibleChange:Jo,overlayClassName:ee()(xu,yn),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Tt},Et.createElement("button",{type:"button",className:"".concat(re,"-nav-more"),style:Sl,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Fn,id:"".concat(be,"-more"),"aria-expanded":ls,onKeyDown:Ua},An));return Et.createElement("div",{className:ee()("".concat(re,"-nav-operations"),Zn),style:Ur,ref:ut},di,Et.createElement(Gt,{prefixCls:re,locale:ni,editable:ko}))}var fr=Et.memo(Et.forwardRef(ln),function(rt,ut){return ut.tabMoving});function no(rt){var ut,re=rt.prefixCls,be=rt.id,Ge=rt.active,ni=rt.tab,fe=ni.key,un=ni.label,An=ni.disabled,xr=ni.closeIcon,Ur=rt.closable,Zn=rt.renderWrapper,ko=rt.removeAriaLabel,Yo=rt.editable,Oo=rt.onClick,Ms=rt.onFocus,na=rt.style,Tt="".concat(re,"-tab"),yn=P(Ur,xr,Yo,An);function Yn(Jo){An||Oo(Jo)}function Ir(Jo){Jo.preventDefault(),Jo.stopPropagation(),Yo.onEdit("remove",{key:fe,event:Jo})}var ls=Et.createElement("div",{key:fe,"data-node-key":z(fe),className:ee()(Tt,(ut={},(0,ne.Z)(ut,"".concat(Tt,"-with-remove"),yn),(0,ne.Z)(ut,"".concat(Tt,"-active"),Ge),(0,ne.Z)(ut,"".concat(Tt,"-disabled"),An),ut)),style:na,onClick:Yn},Et.createElement("div",{role:"tab","aria-selected":Ge,id:be&&"".concat(be,"-tab-").concat(fe),className:"".concat(Tt,"-btn"),"aria-controls":be&&"".concat(be,"-panel-").concat(fe),"aria-disabled":An,tabIndex:An?null:0,onClick:function(ra){ra.stopPropagation(),Yn(ra)},onKeyDown:function(ra){[Vi.SPACE,Vi.ENTER].includes(ra.which)&&(ra.preventDefault(),Yn(ra))},onFocus:Ms},un),yn&&Et.createElement("button",{type:"button","aria-label":ko||"remove",tabIndex:0,className:"".concat(Tt,"-remove"),onClick:function(ra){ra.stopPropagation(),Ir(ra)}},xr||Yo.removeIcon||"\xD7"));return Zn?Zn(ls):ls}var wo=no,ro=function(ut){return+setTimeout(ut,16)},li=function(ut){return clearTimeout(ut)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ro=function(ut){return window.requestAnimationFrame(ut)},li=function(ut){return window.cancelAnimationFrame(ut)});var St=0,$t=new Map;function xe(rt){$t.delete(rt)}var Ue=function(ut){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;St+=1;var be=St;function Ge(ni){if(ni===0)xe(be),ut();else{var fe=ro(function(){Ge(ni-1)});$t.set(be,fe)}}return Ge(re),be};Ue.cancel=function(rt){var ut=$t.get(rt);return xe(ut),li(ut)};var Kt=Ue,yt=function(ut){var re=ut.activeTabOffset,be=ut.horizontal,Ge=ut.rtl,ni=ut.indicatorSize,fe=(0,Et.useState)(),un=(0,le.Z)(fe,2),An=un[0],xr=un[1],Ur=(0,Et.useRef)(),Zn=function(Oo){return typeof ni=="function"?ni(Oo):typeof ni=="number"?ni:Oo};function ko(){Kt.cancel(Ur.current)}return(0,Et.useEffect)(function(){var Yo={};return re&&(be?(Ge?(Yo.right=re.right+re.width/2,Yo.transform="translateX(50%)"):(Yo.left=re.left+re.width/2,Yo.transform="translateX(-50%)"),Yo.width=Zn(re.width)):(Yo.top=re.top+re.height/2,Yo.transform="translateY(-50%)",Yo.height=Zn(re.height))),ko(),Ur.current=Kt(function(){xr(Yo)}),ko},[re,be,Ge,ni]),{style:An}},me=yt,Ce=function(ut){var re=ut.current||{},be=re.offsetWidth,Ge=be===void 0?0:be,ni=re.offsetHeight,fe=ni===void 0?0:ni;return[Ge,fe]},we=function(ut,re){return ut[re?0:1]};function Mt(rt,ut){var re,be=Et.useContext(fi),Ge=be.prefixCls,ni=be.tabs,fe=rt.className,un=rt.style,An=rt.id,xr=rt.animated,Ur=rt.activeKey,Zn=rt.rtl,ko=rt.extra,Yo=rt.editable,Oo=rt.locale,Ms=rt.tabPosition,na=rt.tabBarGutter,Tt=rt.children,yn=rt.onTabClick,Yn=rt.onTabScroll,Ir=rt.indicatorSize,ls=(0,Et.useRef)(),Jo=(0,Et.useRef)(),ra=(0,Et.useRef)(),$s=(0,Et.useRef)(),or=(0,Et.useRef)(),eo=(0,Et.useRef)(),Fn=(0,Et.useRef)(),hn=Ms==="top"||Ms==="bottom",_r=Ae(0,function(ps,sr){hn&&Yn&&Yn({direction:ps>sr?"left":"right"})}),Or=(0,le.Z)(_r,2),Ai=Or[0],kl=Or[1],El=Ae(0,function(ps,sr){!hn&&Yn&&Yn({direction:ps>sr?"top":"bottom"})}),Ua=(0,le.Z)(El,2),Sl=Ua[0],xu=Ua[1],di=(0,Et.useState)([0,0]),jr=(0,le.Z)(di,2),Fo=jr[0],Ca=jr[1],Ll=(0,Et.useState)([0,0]),ol=(0,le.Z)(Ll,2),_n=ol[0],Za=ol[1],nu=(0,Et.useState)([0,0]),Tl=(0,le.Z)(nu,2),uu=Tl[0],_h=Tl[1],hu=(0,Et.useState)([0,0]),ml=(0,le.Z)(hu,2),sl=ml[0],Js=ml[1],$u=$i(new Map),Nu=(0,le.Z)($u,2),df=Nu[0],jh=Nu[1],cu=Ye(ni,df,_n[0]),Zu=we(Fo,hn),js=we(_n,hn),gh=we(uu,hn),yc=we(sl,hn),Gu=Zu<js+gh,ds=Gu?Zu-yc:Zu-gh,xc="".concat(Ge,"-nav-operations-hidden"),za=0,wu=0;hn&&Zn?(za=0,wu=Math.max(0,js-ds)):(za=Math.min(0,ds-js),wu=0);function fu(ps){return ps<za?za:ps>wu?wu:ps}var al=(0,Et.useRef)(),gl=(0,Et.useState)(),qa=(0,le.Z)(gl,2),ka=qa[0],bu=qa[1];function rc(){bu(Date.now())}function Hs(){window.clearTimeout(al.current)}ai($s,function(ps,sr){function Vs(_s,sa){_s(function(mo){var Hl=fu(mo+sa);return Hl})}return Gu?(hn?Vs(kl,ps):Vs(xu,sr),Hs(),rc(),!0):!1}),(0,Et.useEffect)(function(){return Hs(),ka&&(al.current=window.setTimeout(function(){bu(0)},100)),Hs},[ka]);var Xc=D(cu,ds,hn?Ai:Sl,js,gh,yc,(0,Fe.Z)((0,Fe.Z)({},rt),{},{tabs:ni})),wc=(0,le.Z)(Xc,2),bc=wc[0],dn=wc[1],Oc=se(function(){var ps=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ur,sr=cu.get(ps)||{width:0,height:0,left:0,right:0,top:0};if(hn){var Vs=Ai;Zn?sr.right<Ai?Vs=sr.right:sr.right+sr.width>Ai+ds&&(Vs=sr.right+sr.width-ds):sr.left<-Ai?Vs=-sr.left:sr.left+sr.width>-Ai+ds&&(Vs=-(sr.left+sr.width-ds)),xu(0),kl(fu(Vs))}else{var _s=Sl;sr.top<-Sl?_s=-sr.top:sr.top+sr.height>-Sl+ds&&(_s=-(sr.top+sr.height-ds)),kl(0),xu(fu(_s))}}),xt={};Ms==="top"||Ms==="bottom"?xt[Zn?"marginRight":"marginLeft"]=na:xt.marginTop=na;var ve=ni.map(function(ps,sr){var Vs=ps.key;return Et.createElement(wo,{id:An,prefixCls:Ge,key:Vs,tab:ps,style:sr===0?void 0:xt,closable:ps.closable,editable:Yo,active:Vs===Ur,renderWrapper:Tt,removeAriaLabel:Oo==null?void 0:Oo.removeAriaLabel,onClick:function(sa){yn(Vs,sa)},onFocus:function(){Oc(Vs),rc(),$s.current&&(Zn||($s.current.scrollLeft=0),$s.current.scrollTop=0)}})}),Kh=function(){return jh(function(){var sr=new Map;return ni.forEach(function(Vs){var _s,sa=Vs.key,mo=(_s=or.current)===null||_s===void 0?void 0:_s.querySelector('[data-node-key="'.concat(z(sa),'"]'));mo&&sr.set(sa,{width:mo.offsetWidth,height:mo.offsetHeight,left:mo.offsetLeft,top:mo.offsetTop})}),sr})};(0,Et.useEffect)(function(){Kh()},[ni.map(function(ps){return ps.key}).join("_")]);var Sc=zi(function(){var ps=Ce(ls),sr=Ce(Jo),Vs=Ce(ra);Ca([ps[0]-sr[0]-Vs[0],ps[1]-sr[1]-Vs[1]]);var _s=Ce(Fn);_h(_s);var sa=Ce(eo);Js(sa);var mo=Ce(or);Za([mo[0]-_s[0],mo[1]-_s[1]]),Kh()}),Ph=ni.slice(0,bc),Nh=ni.slice(dn+1),Su=[].concat((0,pi.Z)(Ph),(0,pi.Z)(Nh)),Mc=cu.get(Ur),Cc=me({activeTabOffset:Mc,horizontal:hn,rtl:Zn,indicatorSize:Ir}),fa=Cc.style;(0,Et.useEffect)(function(){Oc()},[Ur,za,wu,_(Mc),_(cu),hn]),(0,Et.useEffect)(function(){Sc()},[Zn]);var zn=!!Su.length,vl="".concat(Ge,"-nav-wrap"),Al,oa,po,$a;return hn?Zn?(oa=Ai>0,Al=Ai!==wu):(Al=Ai<0,oa=Ai!==za):(po=Sl<0,$a=Sl!==za),Et.createElement(Sn.Z,{onResize:Sc},Et.createElement("div",{ref:de(ut,ls),role:"tablist",className:ee()("".concat(Ge,"-nav"),fe),style:un,onKeyDown:function(){rc()}},Et.createElement(He,{ref:Jo,position:"left",extra:ko,prefixCls:Ge}),Et.createElement(Sn.Z,{onResize:Sc},Et.createElement("div",{className:ee()(vl,(re={},(0,ne.Z)(re,"".concat(vl,"-ping-left"),Al),(0,ne.Z)(re,"".concat(vl,"-ping-right"),oa),(0,ne.Z)(re,"".concat(vl,"-ping-top"),po),(0,ne.Z)(re,"".concat(vl,"-ping-bottom"),$a),re)),ref:$s},Et.createElement(Sn.Z,{onResize:Sc},Et.createElement("div",{ref:or,className:"".concat(Ge,"-nav-list"),style:{transform:"translate(".concat(Ai,"px, ").concat(Sl,"px)"),transition:ka?"none":void 0}},ve,Et.createElement(Gt,{ref:Fn,prefixCls:Ge,locale:Oo,editable:Yo,style:(0,Fe.Z)((0,Fe.Z)({},ve.length===0?void 0:xt),{},{visibility:zn?"hidden":null})}),Et.createElement("div",{className:ee()("".concat(Ge,"-ink-bar"),(0,ne.Z)({},"".concat(Ge,"-ink-bar-animated"),xr.inkBar)),style:fa}))))),Et.createElement(fr,(0,vt.Z)({},rt,{removeAriaLabel:Oo==null?void 0:Oo.removeAriaLabel,ref:eo,prefixCls:Ge,tabs:Su,className:!zn&&xc,tabMoving:!!ka})),Et.createElement(He,{ref:ra,position:"right",extra:ko,prefixCls:Ge})))}var ie=Et.forwardRef(Mt),Re=["renderTabBar"],_i=["label","key"];function Qt(rt){var ut=rt.renderTabBar,re=(0,zt.Z)(rt,Re),be=Et.useContext(fi),Ge=be.tabs;if(ut){var ni=(0,Fe.Z)((0,Fe.Z)({},re),{},{panes:Ge.map(function(fe){var un=fe.label,An=fe.key,xr=(0,zt.Z)(fe,_i);return Et.createElement(pe,(0,vt.Z)({tab:un,key:An,tabKey:An},xr))})});return ut(ni,ie)}return Et.createElement(ie,re)}var ui={},vr=[],Mr=function(ut){vr.push(ut)};function Lr(rt,ut){if(0)var re}function gi(rt,ut){if(0)var re}function Ji(){ui={}}function Xi(rt,ut,re){!ut&&!ui[re]&&(rt(!1,re),ui[re]=!0)}function zr(rt,ut){Xi(Lr,rt,ut)}function ho(rt,ut){Xi(gi,rt,ut)}zr.preMessage=Mr,zr.resetWarned=Ji,zr.noteOnce=ho;var Tn=null;function Pi(){var rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},ut;return rt===!1?ut={inkBar:!1,tabPane:!1}:rt===!0?ut={inkBar:!0,tabPane:!1}:ut=(0,Fe.Z)({inkBar:!0},(0,Zt.Z)(rt)==="object"?rt:{}),ut.tabPaneMotion&&ut.tabPane===void 0&&(ut.tabPane=!0),!ut.tabPaneMotion&&ut.tabPane&&(ut.tabPane=!1),ut}var os=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],qr=0;function bo(rt,ut){var re,be=rt.id,Ge=rt.prefixCls,ni=Ge===void 0?"rc-tabs":Ge,fe=rt.className,un=rt.items,An=rt.direction,xr=rt.activeKey,Ur=rt.defaultActiveKey,Zn=rt.editable,ko=rt.animated,Yo=rt.tabPosition,Oo=Yo===void 0?"top":Yo,Ms=rt.tabBarGutter,na=rt.tabBarStyle,Tt=rt.tabBarExtraContent,yn=rt.locale,Yn=rt.moreIcon,Ir=rt.moreTransitionName,ls=rt.destroyInactiveTabPane,Jo=rt.renderTabBar,ra=rt.onChange,$s=rt.onTabClick,or=rt.onTabScroll,eo=rt.getPopupContainer,Fn=rt.popupClassName,hn=rt.indicatorSize,_r=(0,zt.Z)(rt,os),Or=Et.useMemo(function(){return(un||[]).filter(function(Js){return Js&&(0,Zt.Z)(Js)==="object"&&"key"in Js})},[un]),Ai=An==="rtl",kl=Pi(ko),El=(0,Et.useState)(!1),Ua=(0,le.Z)(El,2),Sl=Ua[0],xu=Ua[1];(0,Et.useEffect)(function(){xu(Q())},[]);var di=Te(function(){var Js;return(Js=Or[0])===null||Js===void 0?void 0:Js.key},{value:xr,defaultValue:Ur}),jr=(0,le.Z)(di,2),Fo=jr[0],Ca=jr[1],Ll=(0,Et.useState)(function(){return Or.findIndex(function(Js){return Js.key===Fo})}),ol=(0,le.Z)(Ll,2),_n=ol[0],Za=ol[1];(0,Et.useEffect)(function(){var Js=Or.findIndex(function(Nu){return Nu.key===Fo});if(Js===-1){var $u;Js=Math.max(0,Math.min(_n,Or.length-1)),Ca(($u=Or[Js])===null||$u===void 0?void 0:$u.key)}Za(Js)},[Or.map(function(Js){return Js.key}).join("_"),Fo,_n]);var nu=Te(null,{value:be}),Tl=(0,le.Z)(nu,2),uu=Tl[0],_h=Tl[1];(0,Et.useEffect)(function(){be||(_h("rc-tabs-".concat(qr)),qr+=1)},[]);function hu(Js,$u){$s==null||$s(Js,$u);var Nu=Js!==Fo;Ca(Js),Nu&&(ra==null||ra(Js))}var ml={id:uu,activeKey:Fo,animated:kl,tabPosition:Oo,rtl:Ai,mobile:Sl},sl=(0,Fe.Z)((0,Fe.Z)({},ml),{},{editable:Zn,locale:yn,moreIcon:Yn,moreTransitionName:Ir,tabBarGutter:Ms,onTabClick:hu,onTabScroll:or,extra:Tt,style:na,panes:null,getPopupContainer:eo,popupClassName:Fn,indicatorSize:hn});return Et.createElement(fi.Provider,{value:{tabs:Or,prefixCls:ni}},Et.createElement("div",(0,vt.Z)({ref:ut,id:be,className:ee()(ni,"".concat(ni,"-").concat(Oo),(re={},(0,ne.Z)(re,"".concat(ni,"-mobile"),Sl),(0,ne.Z)(re,"".concat(ni,"-editable"),Zn),(0,ne.Z)(re,"".concat(ni,"-rtl"),Ai),re),fe)},_r),Et.createElement(Qt,(0,vt.Z)({},sl,{renderTabBar:Jo})),Et.createElement(ki,(0,vt.Z)({destroyInactiveTabPane:ls},ml,{animated:kl}))))}var he=Et.forwardRef(bo),ss=he,Aa=ss,Bo=j(53124),Ma=j(98675),Tr=()=>null,yr=j(33603);const $r={motionAppear:!1,motionEnter:!0,motionLeave:!0};function dr(rt){let ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},re;return ut===!1?re={inkBar:!1,tabPane:!1}:ut===!0?re={inkBar:!0,tabPane:!0}:re=Object.assign({inkBar:!0},typeof ut=="object"?ut:{}),re.tabPane&&(re.tabPaneMotion=Object.assign(Object.assign({},$r),{motionName:(0,yr.m)(rt,"switch")})),re}var ue=j(37419),Wo=function(rt,ut){var re={};for(var be in rt)Object.prototype.hasOwnProperty.call(rt,be)&&ut.indexOf(be)<0&&(re[be]=rt[be]);if(rt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,be=Object.getOwnPropertySymbols(rt);Ge<be.length;Ge++)ut.indexOf(be[Ge])<0&&Object.prototype.propertyIsEnumerable.call(rt,be[Ge])&&(re[be[Ge]]=rt[be[Ge]]);return re};function te(rt){return rt.filter(ut=>ut)}function Do(rt,ut){if(rt)return rt;const re=(0,ue.Z)(ut).map(be=>{if(Et.isValidElement(be)){const{key:Ge,props:ni}=be,fe=ni||{},{tab:un}=fe,An=Wo(fe,["tab"]);return Object.assign(Object.assign({key:String(Ge)},An),{label:un})}return null});return te(re)}var Co=j(14747),Io=j(67968),ea=j(45503),Nr=j(67771),fo=rt=>{const{componentCls:ut,motionDurationSlow:re}=rt;return[{[ut]:{[`${ut}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${re}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${re}`}}}}},[(0,Nr.oN)(rt,"slide-up"),(0,Nr.oN)(rt,"slide-down")]]};const Ys=rt=>{const{componentCls:ut,tabsCardPadding:re,cardBg:be,cardGutter:Ge,colorBorderSecondary:ni,itemSelectedColor:fe}=rt;return{[`${ut}-card`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{margin:0,padding:re,background:be,border:`${rt.lineWidth}px ${rt.lineType} ${ni}`,transition:`all ${rt.motionDurationSlow} ${rt.motionEaseInOut}`},[`${ut}-tab-active`]:{color:fe,background:rt.colorBgContainer},[`${ut}-ink-bar`]:{visibility:"hidden"}},[`&${ut}-top, &${ut}-bottom`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab + ${ut}-tab`]:{marginLeft:{_skip_check_:!0,value:`${Ge}px`}}}},[`&${ut}-top`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{borderRadius:`${rt.borderRadiusLG}px ${rt.borderRadiusLG}px 0 0`},[`${ut}-tab-active`]:{borderBottomColor:rt.colorBgContainer}}},[`&${ut}-bottom`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{borderRadius:`0 0 ${rt.borderRadiusLG}px ${rt.borderRadiusLG}px`},[`${ut}-tab-active`]:{borderTopColor:rt.colorBgContainer}}},[`&${ut}-left, &${ut}-right`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab + ${ut}-tab`]:{marginTop:`${Ge}px`}}},[`&${ut}-left`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt.borderRadiusLG}px 0 0 ${rt.borderRadiusLG}px`}},[`${ut}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:rt.colorBgContainer}}}},[`&${ut}-right`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt.borderRadiusLG}px ${rt.borderRadiusLG}px 0`}},[`${ut}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:rt.colorBgContainer}}}}}}},Xo=rt=>{const{componentCls:ut,itemHoverColor:re,dropdownEdgeChildVerticalPadding:be}=rt;return{[`${ut}-dropdown`]:Object.assign(Object.assign({},(0,Co.Wf)(rt)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:rt.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${ut}-dropdown-menu`]:{maxHeight:rt.tabsDropdownHeight,margin:0,padding:`${be}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:rt.colorBgContainer,backgroundClip:"padding-box",borderRadius:rt.borderRadiusLG,outline:"none",boxShadow:rt.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Co.vS),{display:"flex",alignItems:"center",minWidth:rt.tabsDropdownWidth,margin:0,padding:`${rt.paddingXXS}px ${rt.paddingSM}px`,color:rt.colorText,fontWeight:"normal",fontSize:rt.fontSize,lineHeight:rt.lineHeight,cursor:"pointer",transition:`all ${rt.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:rt.marginSM},color:rt.colorTextDescription,fontSize:rt.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:re}},"&:hover":{background:rt.controlItemBgHover},"&-disabled":{"&, &:hover":{color:rt.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},ci=rt=>{const{componentCls:ut,margin:re,colorBorderSecondary:be,horizontalMargin:Ge,verticalItemPadding:ni,verticalItemMargin:fe}=rt;return{[`${ut}-top, ${ut}-bottom`]:{flexDirection:"column",[`> ${ut}-nav, > div > ${ut}-nav`]:{margin:Ge,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${rt.lineWidth}px ${rt.lineType} ${be}`,content:"''"},[`${ut}-ink-bar`]:{height:rt.lineWidthBold,"&-animated":{transition:`width ${rt.motionDurationSlow}, left ${rt.motionDurationSlow},
|
|
|
right ${rt.motionDurationSlow}`}},[`${ut}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:rt.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:rt.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:rt.boxShadowTabsOverflowRight},[`&${ut}-nav-wrap-ping-left::before`]:{opacity:1},[`&${ut}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${ut}-top`]:{[`> ${ut}-nav,
|
|
|
> div > ${ut}-nav`]:{"&::before":{bottom:0},[`${ut}-ink-bar`]:{bottom:0}}},[`${ut}-bottom`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{order:1,marginTop:`${re}px`,marginBottom:0,"&::before":{top:0},[`${ut}-ink-bar`]:{top:0}},[`> ${ut}-content-holder, > div > ${ut}-content-holder`]:{order:0}},[`${ut}-left, ${ut}-right`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{flexDirection:"column",minWidth:rt.controlHeight*1.25,[`${ut}-tab`]:{padding:ni,textAlign:"center"},[`${ut}-tab + ${ut}-tab`]:{margin:fe},[`${ut}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:rt.controlHeight},"&::before":{top:0,boxShadow:rt.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:rt.boxShadowTabsOverflowBottom},[`&${ut}-nav-wrap-ping-top::before`]:{opacity:1},[`&${ut}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${ut}-ink-bar`]:{width:rt.lineWidthBold,"&-animated":{transition:`height ${rt.motionDurationSlow}, top ${rt.motionDurationSlow}`}},[`${ut}-nav-list, ${ut}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${ut}-left`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${ut}-content-holder, > div > ${ut}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${rt.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${rt.lineWidth}px ${rt.lineType} ${rt.colorBorder}`},[`> ${ut}-content > ${ut}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:rt.paddingLG}}}},[`${ut}-right`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{order:1,[`${ut}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${ut}-content-holder, > div > ${ut}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-rt.lineWidth},borderRight:{_skip_check_:!0,value:`${rt.lineWidth}px ${rt.lineType} ${rt.colorBorder}`},[`> ${ut}-content > ${ut}-tabpane`]:{paddingRight:{_skip_check_:!0,value:rt.paddingLG}}}}}},G=rt=>{const{componentCls:ut,cardPaddingSM:re,cardPaddingLG:be,horizontalItemPaddingSM:Ge,horizontalItemPaddingLG:ni}=rt;return{[ut]:{"&-small":{[`> ${ut}-nav`]:{[`${ut}-tab`]:{padding:Ge,fontSize:rt.titleFontSizeSM}}},"&-large":{[`> ${ut}-nav`]:{[`${ut}-tab`]:{padding:ni,fontSize:rt.titleFontSizeLG}}}},[`${ut}-card`]:{[`&${ut}-small`]:{[`> ${ut}-nav`]:{[`${ut}-tab`]:{padding:re}},[`&${ut}-bottom`]:{[`> ${ut}-nav ${ut}-tab`]:{borderRadius:`0 0 ${rt.borderRadius}px ${rt.borderRadius}px`}},[`&${ut}-top`]:{[`> ${ut}-nav ${ut}-tab`]:{borderRadius:`${rt.borderRadius}px ${rt.borderRadius}px 0 0`}},[`&${ut}-right`]:{[`> ${ut}-nav ${ut}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${rt.borderRadius}px ${rt.borderRadius}px 0`}}},[`&${ut}-left`]:{[`> ${ut}-nav ${ut}-tab`]:{borderRadius:{_skip_check_:!0,value:`${rt.borderRadius}px 0 0 ${rt.borderRadius}px`}}}},[`&${ut}-large`]:{[`> ${ut}-nav`]:{[`${ut}-tab`]:{padding:be}}}}}},Wa=rt=>{const{componentCls:ut,itemActiveColor:re,itemHoverColor:be,iconCls:Ge,tabsHorizontalItemMargin:ni,horizontalItemPadding:fe,itemSelectedColor:un,itemColor:An}=rt,xr=`${ut}-tab`;return{[xr]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:fe,fontSize:rt.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:An,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:re}},(0,Co.Qy)(rt)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-rt.marginXXS},marginLeft:{_skip_check_:!0,value:rt.marginXS},color:rt.colorTextDescription,fontSize:rt.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${rt.motionDurationSlow}`,"&:hover":{color:rt.colorTextHeading}},"&:hover":{color:be},[`&${xr}-active ${xr}-btn`]:{color:un,textShadow:rt.tabsActiveTextShadow},[`&${xr}-disabled`]:{color:rt.colorTextDisabled,cursor:"not-allowed"},[`&${xr}-disabled ${xr}-btn, &${xr}-disabled ${ut}-remove`]:{"&:focus, &:active":{color:rt.colorTextDisabled}},[`& ${xr}-remove ${Ge}`]:{margin:0},[Ge]:{marginRight:{_skip_check_:!0,value:rt.marginSM}}},[`${xr} + ${xr}`]:{margin:{_skip_check_:!0,value:ni}}}},zs=rt=>{const{componentCls:ut,tabsHorizontalItemMarginRTL:re,iconCls:be,cardGutter:Ge}=rt;return{[`${ut}-rtl`]:{direction:"rtl",[`${ut}-nav`]:{[`${ut}-tab`]:{margin:{_skip_check_:!0,value:re},[`${ut}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[be]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${rt.marginSM}px`}},[`${ut}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${rt.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${rt.marginXXS}px`},[be]:{margin:0}}}},[`&${ut}-left`]:{[`> ${ut}-nav`]:{order:1},[`> ${ut}-content-holder`]:{order:0}},[`&${ut}-right`]:{[`> ${ut}-nav`]:{order:0},[`> ${ut}-content-holder`]:{order:1}},[`&${ut}-card${ut}-top, &${ut}-card${ut}-bottom`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-tab + ${ut}-tab`]:{marginRight:{_skip_check_:!0,value:Ge},marginLeft:{_skip_check_:!0,value:0}}}}},[`${ut}-dropdown-rtl`]:{direction:"rtl"},[`${ut}-menu-item`]:{[`${ut}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},Fa=rt=>{const{componentCls:ut,tabsCardPadding:re,cardHeight:be,cardGutter:Ge,itemHoverColor:ni,itemActiveColor:fe,colorBorderSecondary:un}=rt;return{[ut]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Co.Wf)(rt)),{display:"flex",[`> ${ut}-nav, > div > ${ut}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${ut}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${rt.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${ut}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${rt.motionDurationSlow}`},[`${ut}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${ut}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${ut}-nav-more`]:{position:"relative",padding:re,background:"transparent",border:0,color:rt.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:rt.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${ut}-nav-add`]:Object.assign({minWidth:be,marginLeft:{_skip_check_:!0,value:Ge},padding:`0 ${rt.paddingXS}px`,background:"transparent",border:`${rt.lineWidth}px ${rt.lineType} ${un}`,borderRadius:`${rt.borderRadiusLG}px ${rt.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:rt.colorText,transition:`all ${rt.motionDurationSlow} ${rt.motionEaseInOut}`,"&:hover":{color:ni},"&:active, &:focus:not(:focus-visible)":{color:fe}},(0,Co.Qy)(rt))},[`${ut}-extra-content`]:{flex:"none"},[`${ut}-ink-bar`]:{position:"absolute",background:rt.inkBarColor,pointerEvents:"none"}}),Wa(rt)),{[`${ut}-content`]:{position:"relative",width:"100%"},[`${ut}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${ut}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${ut}-centered`]:{[`> ${ut}-nav, > div > ${ut}-nav`]:{[`${ut}-nav-wrap`]:{[`&:not([class*='${ut}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var ia=(0,Io.Z)("Tabs",rt=>{const ut=(0,ea.TS)(rt,{tabsCardPadding:rt.cardPadding||`${(rt.cardHeight-Math.round(rt.fontSize*rt.lineHeight))/2-rt.lineWidth}px ${rt.padding}px`,dropdownEdgeChildVerticalPadding:rt.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${rt.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${rt.horizontalItemGutter}px`});return[G(ut),zs(ut),ci(ut),Xo(ut),Ys(ut),Fa(ut),fo(ut)]},rt=>{const ut=rt.controlHeightLG;return{zIndexPopup:rt.zIndexPopupBase+50,cardBg:rt.colorFillAlter,cardHeight:ut,cardPadding:"",cardPaddingSM:`${rt.paddingXXS*1.5}px ${rt.padding}px`,cardPaddingLG:`${rt.paddingXS}px ${rt.padding}px ${rt.paddingXXS*1.5}px`,titleFontSize:rt.fontSize,titleFontSizeLG:rt.fontSizeLG,titleFontSizeSM:rt.fontSize,inkBarColor:rt.colorPrimary,horizontalMargin:`0 0 ${rt.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${rt.paddingSM}px 0`,horizontalItemPaddingSM:`${rt.paddingXS}px 0`,horizontalItemPaddingLG:`${rt.padding}px 0`,verticalItemPadding:`${rt.paddingXS}px ${rt.paddingLG}px`,verticalItemMargin:`${rt.margin}px 0 0 0`,itemColor:rt.colorText,itemSelectedColor:rt.colorPrimary,itemHoverColor:rt.colorPrimaryHover,itemActiveColor:rt.colorPrimaryActive,cardGutter:rt.marginXXS/2}}),iu=function(rt,ut){var re={};for(var be in rt)Object.prototype.hasOwnProperty.call(rt,be)&&ut.indexOf(be)<0&&(re[be]=rt[be]);if(rt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,be=Object.getOwnPropertySymbols(rt);Ge<be.length;Ge++)ut.indexOf(be[Ge])<0&&Object.prototype.propertyIsEnumerable.call(rt,be[Ge])&&(re[be[Ge]]=rt[be[Ge]]);return re};const Pu=rt=>{const{type:ut,className:re,rootClassName:be,size:Ge,onEdit:ni,hideAdd:fe,centered:un,addIcon:An,popupClassName:xr,children:Ur,items:Zn,animated:ko,style:Yo,indicatorSize:Oo}=rt,Ms=iu(rt,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:na,moreIcon:Tt=Et.createElement(At.Z,null)}=Ms,{direction:yn,tabs:Yn,getPrefixCls:Ir,getPopupContainer:ls}=Et.useContext(Bo.E_),Jo=Ir("tabs",na),[ra,$s]=ia(Jo);let or;ut==="editable-card"&&(or={onEdit:(Ai,kl)=>{let{key:El,event:Ua}=kl;ni==null||ni(Ai==="add"?Ua:El,Ai)},removeIcon:Et.createElement(Nt.Z,null),addIcon:An||Et.createElement(F,null),showAdd:fe!==!0});const eo=Ir(),Fn=Do(Zn,Ur),hn=dr(Jo,ko),_r=(0,Ma.Z)(Ge),Or=Object.assign(Object.assign({},Yn==null?void 0:Yn.style),Yo);return ra(Et.createElement(Aa,Object.assign({direction:yn,getPopupContainer:ls,moreTransitionName:`${eo}-slide-up`},Ms,{items:Fn,className:ee()({[`${Jo}-${_r}`]:_r,[`${Jo}-card`]:["card","editable-card"].includes(ut),[`${Jo}-editable-card`]:ut==="editable-card",[`${Jo}-centered`]:un},Yn==null?void 0:Yn.className,re,be,$s),popupClassName:ee()(xr,$s),style:Or,editable:or,moreIcon:Tt,prefixCls:Jo,animated:hn,indicatorSize:Oo!=null?Oo:Yn==null?void 0:Yn.indicatorSize})))};Pu.TabPane=Tr;var Th=Pu},60068:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ct}});var Nt=j(87462),At=j(67294),vt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},Et=vt,gt=j(44327),ft=function(F,Y){return At.createElement(gt.Z,(0,Nt.Z)({},F,{ref:Y,icon:Et}))},ct=At.forwardRef(ft)},15558:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ct}});var Nt=j(87462),At=j(67294),vt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},Et=vt,gt=j(44327),ft=function(F,Y){return At.createElement(gt.Z,(0,Nt.Z)({},F,{ref:Y,icon:Et}))},ct=At.forwardRef(ft)},64582:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ct}});var Nt=j(87462),At=j(67294),vt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},Et=vt,gt=j(44327),ft=function(F,Y){return At.createElement(gt.Z,(0,Nt.Z)({},F,{ref:Y,icon:Et}))},ct=At.forwardRef(ft)},43481:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ct}});var Nt=j(87462),At=j(67294),vt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},Et=vt,gt=j(44327),ft=function(F,Y){return At.createElement(gt.Z,(0,Nt.Z)({},F,{ref:Y,icon:Et}))},ct=At.forwardRef(ft)},47880:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ct}});var Nt=j(87462),At=j(67294),vt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},Et=vt,gt=j(44327),ft=function(F,Y){return At.createElement(gt.Z,(0,Nt.Z)({},F,{ref:Y,icon:Et}))},ct=At.forwardRef(ft)},56396:function(Wr,Ti){"use strict";var j;var Nt=Symbol.for("react.element"),At=Symbol.for("react.portal"),vt=Symbol.for("react.fragment"),Et=Symbol.for("react.strict_mode"),gt=Symbol.for("react.profiler"),ft=Symbol.for("react.provider"),ct=Symbol.for("react.context"),ot=Symbol.for("react.server_context"),F=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),Fe=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),Zt;Zt=Symbol.for("react.module.reference");function zt(Q){if(typeof Q=="object"&&Q!==null){var se=Q.$$typeof;switch(se){case Nt:switch(Q=Q.type,Q){case vt:case gt:case Et:case Y:case ee:return Q;default:switch(Q=Q&&Q.$$typeof,Q){case ot:case ct:case F:case Fe:case ne:case ft:return Q;default:return se}}case At:return se}}}j=ct,j=ft,j=Nt,j=F,j=vt,j=Fe,j=ne,j=At,j=gt,j=Et,j=Y,j=ee,j=function(){return!1},j=function(){return!1},j=function(Q){return zt(Q)===ct},j=function(Q){return zt(Q)===ft},j=function(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===Nt},j=function(Q){return zt(Q)===F},j=function(Q){return zt(Q)===vt},j=function(Q){return zt(Q)===Fe},Ti.isMemo=function(Q){return zt(Q)===ne},j=function(Q){return zt(Q)===At},j=function(Q){return zt(Q)===gt},j=function(Q){return zt(Q)===Et},j=function(Q){return zt(Q)===Y},j=function(Q){return zt(Q)===ee},j=function(Q){return typeof Q=="string"||typeof Q=="function"||Q===vt||Q===gt||Q===Et||Q===Y||Q===ee||Q===le||typeof Q=="object"&&Q!==null&&(Q.$$typeof===Fe||Q.$$typeof===ne||Q.$$typeof===ft||Q.$$typeof===ct||Q.$$typeof===F||Q.$$typeof===Zt||Q.getModuleId!==void 0)},j=zt},71326:function(Wr,Ti,j){"use strict";Wr.exports=j(56396)},41771:function(Wr,Ti){"use strict";var j;var Nt=typeof Symbol=="function"&&Symbol.for,At=Nt?Symbol.for("react.element"):60103,vt=Nt?Symbol.for("react.portal"):60106,Et=Nt?Symbol.for("react.fragment"):60107,gt=Nt?Symbol.for("react.strict_mode"):60108,ft=Nt?Symbol.for("react.profiler"):60114,ct=Nt?Symbol.for("react.provider"):60109,ot=Nt?Symbol.for("react.context"):60110,F=Nt?Symbol.for("react.async_mode"):60111,Y=Nt?Symbol.for("react.concurrent_mode"):60111,ee=Nt?Symbol.for("react.forward_ref"):60112,ne=Nt?Symbol.for("react.suspense"):60113,Fe=Nt?Symbol.for("react.suspense_list"):60120,le=Nt?Symbol.for("react.memo"):60115,Zt=Nt?Symbol.for("react.lazy"):60116,zt=Nt?Symbol.for("react.block"):60121,Q=Nt?Symbol.for("react.fundamental"):60117,se=Nt?Symbol.for("react.responder"):60118,$e=Nt?Symbol.for("react.scope"):60119;function Vt(kt){if(typeof kt=="object"&&kt!==null){var it=kt.$$typeof;switch(it){case At:switch(kt=kt.type,kt){case F:case Y:case Et:case ft:case gt:case ne:return kt;default:switch(kt=kt&&kt.$$typeof,kt){case ot:case ee:case Zt:case le:case ct:return kt;default:return it}}case vt:return it}}}function Wt(kt){return Vt(kt)===Y}j=F,j=Y,j=ot,j=ct,j=At,j=ee,j=Et,j=Zt,j=le,j=vt,j=ft,j=gt,j=ne,j=function(kt){return Wt(kt)||Vt(kt)===F},j=Wt,j=function(kt){return Vt(kt)===ot},j=function(kt){return Vt(kt)===ct},j=function(kt){return typeof kt=="object"&&kt!==null&&kt.$$typeof===At},j=function(kt){return Vt(kt)===ee},Ti.isFragment=function(kt){return Vt(kt)===Et},j=function(kt){return Vt(kt)===Zt},Ti.isMemo=function(kt){return Vt(kt)===le},j=function(kt){return Vt(kt)===vt},j=function(kt){return Vt(kt)===ft},j=function(kt){return Vt(kt)===gt},j=function(kt){return Vt(kt)===ne},j=function(kt){return typeof kt=="string"||typeof kt=="function"||kt===Et||kt===Y||kt===ft||kt===gt||kt===ne||kt===Fe||typeof kt=="object"&&kt!==null&&(kt.$$typeof===Zt||kt.$$typeof===le||kt.$$typeof===ct||kt.$$typeof===ot||kt.$$typeof===ee||kt.$$typeof===Q||kt.$$typeof===se||kt.$$typeof===$e||kt.$$typeof===zt)},j=Vt},47655:function(Wr,Ti,j){"use strict";Wr.exports=j(41771)},64701:function(Wr,Ti,j){"use strict";j.r(Ti),j.d(Ti,{ResizableTextArea:function(){return hi},default:function(){return an}});var Nt=j(87462),At=j(1413),vt=j(4942),Et=j(71002),gt=j(97685),ft=j(45987),ct=j(74902),ot=j(94184),F=j.n(ot),Y=j(67656),ee=j(87887),ne=j(67294);function Fe(vi){var ai=ne.useRef();ai.current=vi;var zi=ne.useCallback(function(){for(var $i,q=arguments.length,D=new Array(q),_=0;_<q;_++)D[_]=arguments[_];return($i=ai.current)===null||$i===void 0?void 0:$i.call.apply($i,[ai].concat(D))},[]);return zi}function le(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Zt=le()?ne.useLayoutEffect:ne.useEffect,zt=Zt,Q=function(ai,zi){var $i=ne.useRef(!0);Zt(function(){if(!$i.current)return ai()},zi),Zt(function(){return $i.current=!1,function(){$i.current=!0}},[])};function se(vi){var ai=ne.useRef(!1),zi=ne.useState(vi),$i=(0,gt.Z)(zi,2),q=$i[0],D=$i[1];ne.useEffect(function(){return ai.current=!1,function(){ai.current=!0}},[]);function _(K,z){z&&ai.current||D(K)}return[q,_]}function $e(vi){return vi!==void 0}function Vt(vi,ai){var zi=ai||{},$i=zi.defaultValue,q=zi.value,D=zi.onChange,_=zi.postState,K=se(function(){return $e(q)?q:$e($i)?typeof $i=="function"?$i():$i:typeof vi=="function"?vi():vi}),z=(0,gt.Z)(K,2),P=z[0],bt=z[1],Gt=q!==void 0?q:P,Pe=_?_(Gt):Gt,He=Fe(D),ei=se([Gt]),si=(0,gt.Z)(ei,2),Gi=si[0],er=si[1];Q(function(){var Se=Gi[0];P!==Se&&He(P,Se)},[Gi]),Q(function(){$e(q)||bt(q)},[q]);var rr=Fe(function(Se,We){bt(Se,We),er([Gt],We)});return[Pe,rr]}var Wt=j(48555),kt=function(ai){return+setTimeout(ai,16)},it=function(ai){return clearTimeout(ai)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(kt=function(ai){return window.requestAnimationFrame(ai)},it=function(ai){return window.cancelAnimationFrame(ai)});var Ot=0,qt=new Map;function Te(vi){qt.delete(vi)}var _e=function(ai){var zi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ot+=1;var $i=Ot;function q(D){if(D===0)Te($i),ai();else{var _=kt(function(){q(D-1)});qt.set($i,_)}}return q(zi),$i};_e.cancel=function(vi){var ai=qt.get(vi);return Te(ai),it(ai)};var fi=_e,Ht=`
|
|
|
min-height:0 !important;
|
|
|
max-height:none !important;
|
|
|
height:0 !important;
|
|
|
visibility:hidden !important;
|
|
|
overflow:hidden !important;
|
|
|
position:absolute !important;
|
|
|
z-index:-1000 !important;
|
|
|
top:0 !important;
|
|
|
right:0 !important;
|
|
|
pointer-events: none !important;
|
|
|
`,pe=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Ke={},ki;function pi(vi){var ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,zi=vi.getAttribute("id")||vi.getAttribute("data-reactid")||vi.getAttribute("name");if(ai&&Ke[zi])return Ke[zi];var $i=window.getComputedStyle(vi),q=$i.getPropertyValue("box-sizing")||$i.getPropertyValue("-moz-box-sizing")||$i.getPropertyValue("-webkit-box-sizing"),D=parseFloat($i.getPropertyValue("padding-bottom"))+parseFloat($i.getPropertyValue("padding-top")),_=parseFloat($i.getPropertyValue("border-bottom-width"))+parseFloat($i.getPropertyValue("border-top-width")),K=pe.map(function(P){return"".concat(P,":").concat($i.getPropertyValue(P))}).join(";"),z={sizingStyle:K,paddingSize:D,borderSize:_,boxSizing:q};return ai&&zi&&(Ke[zi]=z),z}function Sn(vi){var ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,zi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,$i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ki||(ki=document.createElement("textarea"),ki.setAttribute("tab-index","-1"),ki.setAttribute("aria-hidden","true"),document.body.appendChild(ki)),vi.getAttribute("wrap")?ki.setAttribute("wrap",vi.getAttribute("wrap")):ki.removeAttribute("wrap");var q=pi(vi,ai),D=q.paddingSize,_=q.borderSize,K=q.boxSizing,z=q.sizingStyle;ki.setAttribute("style","".concat(z,";").concat(Ht)),ki.value=vi.value||vi.placeholder||"";var P=void 0,bt=void 0,Gt,Pe=ki.scrollHeight;if(K==="border-box"?Pe+=_:K==="content-box"&&(Pe-=D),zi!==null||$i!==null){ki.value=" ";var He=ki.scrollHeight-D;zi!==null&&(P=He*zi,K==="border-box"&&(P=P+D+_),Pe=Math.max(P,Pe)),$i!==null&&(bt=He*$i,K==="border-box"&&(bt=bt+D+_),Gt=Pe>bt?"":"hidden",Pe=Math.min(bt,Pe))}var ei={height:Pe,overflowY:Gt,resize:"none"};return P&&(ei.minHeight=P),bt&&(ei.maxHeight=bt),ei}var Sr=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Ki=0,It=1,tt=2,de=ne.forwardRef(function(vi,ai){var zi=vi,$i=zi.prefixCls,q=zi.onPressEnter,D=zi.defaultValue,_=zi.value,K=zi.autoSize,z=zi.onResize,P=zi.className,bt=zi.style,Gt=zi.disabled,Pe=zi.onChange,He=zi.onInternalAutoSize,ei=(0,ft.Z)(zi,Sr),si=Vt(D,{value:_,postState:function(qe){return qe!=null?qe:""}}),Gi=(0,gt.Z)(si,2),er=Gi[0],rr=Gi[1],Se=function(qe){rr(qe.target.value),Pe==null||Pe(qe)},We=ne.useRef();ne.useImperativeHandle(ai,function(){return{textArea:We.current}});var Go=ne.useMemo(function(){return K&&(0,Et.Z)(K)==="object"?[K.minRows,K.maxRows]:[]},[K]),$o=(0,gt.Z)(Go,2),yo=$o[0],Fr=$o[1],Ro=!!K,uo=function(){try{if(document.activeElement===We.current){var qe=We.current,Si=qe.selectionStart,Vi=qe.selectionEnd,ln=qe.scrollTop;We.current.setSelectionRange(Si,Vi),We.current.scrollTop=ln}}catch(fr){}},Ao=ne.useState(tt),fs=(0,gt.Z)(Ao,2),Ya=fs[0],Ja=fs[1],jl=ne.useState(),Na=(0,gt.Z)(jl,2),xo=Na[0],rl=Na[1],Va=function(){Ja(Ki)};zt(function(){Ro&&Va()},[_,yo,Fr,Ro]),zt(function(){if(Ya===Ki)Ja(It);else if(Ya===It){var yi=Sn(We.current,!1,yo,Fr);Ja(tt),rl(yi)}else uo()},[Ya]);var Kl=ne.useRef(),ga=function(){fi.cancel(Kl.current)},Xs=function(qe){Ya===tt&&(z==null||z(qe),K&&(ga(),Kl.current=fi(function(){Va()})))};ne.useEffect(function(){return ga},[]);var Me=Ro?xo:null,L=(0,At.Z)((0,At.Z)({},bt),Me);return(Ya===Ki||Ya===It)&&(L.overflowY="hidden",L.overflowX="hidden"),ne.createElement(Wt.Z,{onResize:Xs,disabled:!(K||z)},ne.createElement("textarea",(0,Nt.Z)({},ei,{ref:We,style:L,className:F()($i,P,(0,vt.Z)({},"".concat($i,"-disabled"),Gt)),disabled:Gt,value:er,onChange:Se})))}),hi=de,Ze=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function Ye(vi,ai){return(0,ct.Z)(vi||"").slice(0,ai).join("")}function Ae(vi,ai,zi,$i){var q=zi;return vi?q=Ye(zi,$i):(0,ct.Z)(ai||"").length<zi.length&&(0,ct.Z)(zi||"").length>$i&&(q=ai),q}var Wi=ne.forwardRef(function(vi,ai){var zi,$i=vi.defaultValue,q=vi.value,D=vi.onFocus,_=vi.onBlur,K=vi.onChange,z=vi.allowClear,P=vi.maxLength,bt=vi.onCompositionStart,Gt=vi.onCompositionEnd,Pe=vi.suffix,He=vi.prefixCls,ei=He===void 0?"rc-textarea":He,si=vi.classes,Gi=vi.showCount,er=vi.className,rr=vi.style,Se=vi.disabled,We=vi.hidden,Go=vi.classNames,$o=vi.styles,yo=vi.onResize,Fr=(0,ft.Z)(vi,Ze),Ro=Vt($i,{value:q,defaultValue:$i}),uo=(0,gt.Z)(Ro,2),Ao=uo[0],fs=uo[1],Ya=(0,ne.useRef)(null),Ja=ne.useState(!1),jl=(0,gt.Z)(Ja,2),Na=jl[0],xo=jl[1],rl=ne.useState(!1),Va=(0,gt.Z)(rl,2),Kl=Va[0],ga=Va[1],Xs=ne.useRef(),Me=ne.useRef(0),L=ne.useState(null),yi=(0,gt.Z)(L,2),qe=yi[0],Si=yi[1],Vi=function(){var ie;(ie=Ya.current)===null||ie===void 0||ie.textArea.focus()};(0,ne.useImperativeHandle)(ai,function(){return{resizableTextArea:Ya.current,focus:Vi,blur:function(){var ie;(ie=Ya.current)===null||ie===void 0||ie.textArea.blur()}}}),(0,ne.useEffect)(function(){xo(function(Mt){return!Se&&Mt})},[Se]);var ln=Number(P)>0,fr=function(ie){ga(!0),Xs.current=Ao,Me.current=ie.currentTarget.selectionStart,bt==null||bt(ie)},no=function(ie){ga(!1);var Re=ie.currentTarget.value;if(ln){var _i,Qt=Me.current>=P+1||Me.current===((_i=Xs.current)===null||_i===void 0?void 0:_i.length);Re=Ae(Qt,Xs.current,Re,P)}Re!==Ao&&(fs(Re),(0,ee.rJ)(ie.currentTarget,ie,K,Re)),Gt==null||Gt(ie)},wo=function(ie){var Re=ie.target.value;if(!Kl&&ln){var _i=ie.target.selectionStart>=P+1||ie.target.selectionStart===Re.length||!ie.target.selectionStart;Re=Ae(_i,Ao,Re,P)}fs(Re),(0,ee.rJ)(ie.currentTarget,ie,K,Re)},ro=function(ie){var Re=Fr.onPressEnter,_i=Fr.onKeyDown;ie.key==="Enter"&&Re&&Re(ie),_i==null||_i(ie)},li=function(ie){xo(!0),D==null||D(ie)},St=function(ie){xo(!1),_==null||_(ie)},$t=function(ie){var Re;fs(""),Vi(),(0,ee.rJ)((Re=Ya.current)===null||Re===void 0?void 0:Re.textArea,ie,K)},xe=(0,ee.D7)(Ao);!Kl&&ln&&q==null&&(xe=Ye(xe,P));var Ue=Pe,Kt;if(Gi){var yt=(0,ct.Z)(xe).length;(0,Et.Z)(Gi)==="object"?Kt=Gi.formatter({value:xe,count:yt,maxLength:P}):Kt="".concat(yt).concat(ln?" / ".concat(P):""),Ue=ne.createElement(ne.Fragment,null,Ue,ne.createElement("span",{className:F()("".concat(ei,"-data-count"),Go==null?void 0:Go.count),style:$o==null?void 0:$o.count},Kt))}var me=function(ie){var Re;yo==null||yo(ie),(Re=Ya.current)!==null&&Re!==void 0&&Re.textArea.style.height&&Si(!0)},Ce=!Fr.autoSize&&!Gi&&!z,we=ne.createElement(Y.BaseInput,{value:xe,allowClear:z,handleReset:$t,suffix:Ue,prefixCls:ei,classes:{affixWrapper:F()(si==null?void 0:si.affixWrapper,(zi={},(0,vt.Z)(zi,"".concat(ei,"-show-count"),Gi),(0,vt.Z)(zi,"".concat(ei,"-textarea-allow-clear"),z),zi))},disabled:Se,focused:Na,className:er,style:(0,At.Z)((0,At.Z)({},rr),qe&&!Ce?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Kt=="string"?Kt:void 0}},hidden:We,inputElement:ne.createElement(hi,(0,Nt.Z)({},Fr,{onKeyDown:ro,onChange:wo,onFocus:li,onBlur:St,onCompositionStart:fr,onCompositionEnd:no,className:Go==null?void 0:Go.textarea,style:(0,At.Z)((0,At.Z)({},$o==null?void 0:$o.textarea),{},{resize:rr==null?void 0:rr.resize}),disabled:Se,prefixCls:ei,onResize:me,ref:Ya}))});return we}),En=Wi,an=En},1337:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ot}});var Nt=j(1413),At=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
|
summary tabIndex target title type useMap value width wmode wrap`,vt=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Et="".concat(At," ").concat(vt).split(/[\s\n]+/),gt="aria-",ft="data-";function ct(F,Y){return F.indexOf(Y)===0}function ot(F){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ee;Y===!1?ee={aria:!0,data:!0,attr:!0}:Y===!0?ee={aria:!0}:ee=(0,Nt.Z)({},Y);var ne={};return Object.keys(F).forEach(function(Fe){(ee.aria&&(Fe==="role"||ct(Fe,gt))||ee.data&&ct(Fe,ft)||ee.attr&&Et.includes(Fe))&&(ne[Fe]=F[Fe])}),ne}},88386:function(Wr,Ti,j){(function(Nt){Nt(j(4631))})(function(Nt){Nt.defineOption("placeholder","",function(ot,F,Y){var ee=Y&&Y!=Nt.Init;if(F&&!ee)ot.on("blur",gt),ot.on("change",ft),ot.on("swapDoc",ft),Nt.on(ot.getInputField(),"compositionupdate",ot.state.placeholderCompose=function(){Et(ot)}),ft(ot);else if(!F&&ee){ot.off("blur",gt),ot.off("change",ft),ot.off("swapDoc",ft),Nt.off(ot.getInputField(),"compositionupdate",ot.state.placeholderCompose),At(ot);var ne=ot.getWrapperElement();ne.className=ne.className.replace(" CodeMirror-empty","")}F&&!ot.hasFocus()&>(ot)});function At(ot){ot.state.placeholder&&(ot.state.placeholder.parentNode.removeChild(ot.state.placeholder),ot.state.placeholder=null)}function vt(ot){At(ot);var F=ot.state.placeholder=document.createElement("pre");F.style.cssText="height: 0; overflow: visible",F.style.direction=ot.getOption("direction"),F.className="CodeMirror-placeholder CodeMirror-line-like";var Y=ot.getOption("placeholder");typeof Y=="string"&&(Y=document.createTextNode(Y)),F.appendChild(Y),ot.display.lineSpace.insertBefore(F,ot.display.lineSpace.firstChild)}function Et(ot){setTimeout(function(){var F=!1,Y=ot.getInputField();Y.nodeName=="TEXTAREA"?F=!Y.value:ot.lineCount()==1&&(F=!/[^\u200b]/.test(Y.querySelector(".CodeMirror-line").textContent)),F?vt(ot):At(ot)},20)}function gt(ot){ct(ot)&&vt(ot)}function ft(ot){var F=ot.getWrapperElement(),Y=ct(ot);F.className=F.className.replace(" CodeMirror-empty","")+(Y?" CodeMirror-empty":""),Y?vt(ot):At(ot)}function ct(ot){return ot.lineCount()===1&&ot.getLine(0)===""}})},82801:function(Wr,Ti,j){(function(Nt){Nt(j(4631))})(function(Nt){var At={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},vt=Nt.Pos;Nt.defineOption("autoCloseBrackets",!1,function(Zt,zt,Q){Q&&Q!=Nt.Init&&(Zt.removeKeyMap(gt),Zt.state.closeBrackets=null),zt&&(ft(Et(zt,"pairs")),Zt.state.closeBrackets=zt,Zt.addKeyMap(gt))});function Et(Zt,zt){return zt=="pairs"&&typeof Zt=="string"?Zt:typeof Zt=="object"&&Zt[zt]!=null?Zt[zt]:At[zt]}var gt={Backspace:F,Enter:Y};function ft(Zt){for(var zt=0;zt<Zt.length;zt++){var Q=Zt.charAt(zt),se="'"+Q+"'";gt[se]||(gt[se]=ct(Q))}}ft(At.pairs+"`");function ct(Zt){return function(zt){return ne(zt,Zt)}}function ot(Zt){var zt=Zt.state.closeBrackets;if(!zt||zt.override)return zt;var Q=Zt.getModeAt(Zt.getCursor());return Q.closeBrackets||zt}function F(Zt){var zt=ot(Zt);if(!zt||Zt.getOption("disableInput"))return Nt.Pass;for(var Q=Et(zt,"pairs"),se=Zt.listSelections(),$e=0;$e<se.length;$e++){if(!se[$e].empty())return Nt.Pass;var Vt=Fe(Zt,se[$e].head);if(!Vt||Q.indexOf(Vt)%2!=0)return Nt.Pass}for(var $e=se.length-1;$e>=0;$e--){var Wt=se[$e].head;Zt.replaceRange("",vt(Wt.line,Wt.ch-1),vt(Wt.line,Wt.ch+1),"+delete")}}function Y(Zt){var zt=ot(Zt),Q=zt&&Et(zt,"explode");if(!Q||Zt.getOption("disableInput"))return Nt.Pass;for(var se=Zt.listSelections(),$e=0;$e<se.length;$e++){if(!se[$e].empty())return Nt.Pass;var Vt=Fe(Zt,se[$e].head);if(!Vt||Q.indexOf(Vt)%2!=0)return Nt.Pass}Zt.operation(function(){var Wt=Zt.lineSeparator()||`
|
|
|
`;Zt.replaceSelection(Wt+Wt,null),Zt.execCommand("goCharLeft"),se=Zt.listSelections();for(var kt=0;kt<se.length;kt++){var it=se[kt].head.line;Zt.indentLine(it,null,!0),Zt.indentLine(it+1,null,!0)}})}function ee(Zt){var zt=Nt.cmpPos(Zt.anchor,Zt.head)>0;return{anchor:new vt(Zt.anchor.line,Zt.anchor.ch+(zt?-1:1)),head:new vt(Zt.head.line,Zt.head.ch+(zt?1:-1))}}function ne(Zt,zt){var Q=ot(Zt);if(!Q||Zt.getOption("disableInput"))return Nt.Pass;var se=Et(Q,"pairs"),$e=se.indexOf(zt);if($e==-1)return Nt.Pass;for(var Vt=Et(Q,"closeBefore"),Wt=Et(Q,"triples"),kt=se.charAt($e+1)==zt,it=Zt.listSelections(),Ot=$e%2==0,qt,Te=0;Te<it.length;Te++){var _e=it[Te],fi=_e.head,Ht,pe=Zt.getRange(fi,vt(fi.line,fi.ch+1));if(Ot&&!_e.empty())Ht="surround";else if((kt||!Ot)&&pe==zt)kt&&le(Zt,fi)?Ht="both":Wt.indexOf(zt)>=0&&Zt.getRange(fi,vt(fi.line,fi.ch+3))==zt+zt+zt?Ht="skipThree":Ht="skip";else if(kt&&fi.ch>1&&Wt.indexOf(zt)>=0&&Zt.getRange(vt(fi.line,fi.ch-2),fi)==zt+zt){if(fi.ch>2&&/\bstring/.test(Zt.getTokenTypeAt(vt(fi.line,fi.ch-2))))return Nt.Pass;Ht="addFour"}else if(kt){var Ke=fi.ch==0?" ":Zt.getRange(vt(fi.line,fi.ch-1),fi);if(!Nt.isWordChar(pe)&&Ke!=zt&&!Nt.isWordChar(Ke))Ht="both";else return Nt.Pass}else if(Ot&&(pe.length===0||/\s/.test(pe)||Vt.indexOf(pe)>-1))Ht="both";else return Nt.Pass;if(!qt)qt=Ht;else if(qt!=Ht)return Nt.Pass}var ki=$e%2?se.charAt($e-1):zt,pi=$e%2?zt:se.charAt($e+1);Zt.operation(function(){if(qt=="skip")Zt.execCommand("goCharRight");else if(qt=="skipThree")for(var Sn=0;Sn<3;Sn++)Zt.execCommand("goCharRight");else if(qt=="surround"){for(var Sr=Zt.getSelections(),Sn=0;Sn<Sr.length;Sn++)Sr[Sn]=ki+Sr[Sn]+pi;Zt.replaceSelections(Sr,"around"),Sr=Zt.listSelections().slice();for(var Sn=0;Sn<Sr.length;Sn++)Sr[Sn]=ee(Sr[Sn]);Zt.setSelections(Sr)}else qt=="both"?(Zt.replaceSelection(ki+pi,null),Zt.triggerElectric(ki+pi),Zt.execCommand("goCharLeft")):qt=="addFour"&&(Zt.replaceSelection(ki+ki+ki+ki,"before"),Zt.execCommand("goCharRight"))})}function Fe(Zt,zt){var Q=Zt.getRange(vt(zt.line,zt.ch-1),vt(zt.line,zt.ch+1));return Q.length==2?Q:null}function le(Zt,zt){var Q=Zt.getTokenAt(vt(zt.line,zt.ch+1));return/\bstring/.test(Q.type)&&Q.start==zt.ch&&(zt.ch==0||!/\bstring/.test(Zt.getTokenTypeAt(zt)))}})},57341:function(Wr,Ti,j){(function(Nt){Nt(j(4631),j(4786))})(function(Nt){Nt.defineOption("autoCloseTags",!1,function(F,Y,ee){if(ee!=Nt.Init&&ee&&F.removeKeyMap("autoCloseTags"),!!Y){var ne={name:"autoCloseTags"};(typeof Y!="object"||Y.whenClosing!==!1)&&(ne["'/'"]=function(Fe){return ft(Fe)}),(typeof Y!="object"||Y.whenOpening!==!1)&&(ne["'>'"]=function(Fe){return Et(Fe)}),F.addKeyMap(ne)}});var At=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],vt=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Et(F){if(F.getOption("disableInput"))return Nt.Pass;for(var Y=F.listSelections(),ee=[],ne=F.getOption("autoCloseTags"),Fe=0;Fe<Y.length;Fe++){if(!Y[Fe].empty())return Nt.Pass;var le=Y[Fe].head,Zt=F.getTokenAt(le),zt=Nt.innerMode(F.getMode(),Zt.state),Q=zt.state,se=zt.mode.xmlCurrentTag&&zt.mode.xmlCurrentTag(Q),$e=se&&se.name;if(!$e)return Nt.Pass;var Vt=zt.mode.configuration=="html",Wt=typeof ne=="object"&&ne.dontCloseTags||Vt&&At,kt=typeof ne=="object"&&ne.indentTags||Vt&&vt;Zt.end>le.ch&&($e=$e.slice(0,$e.length-Zt.end+le.ch));var it=$e.toLowerCase();if(!$e||Zt.type=="string"&&(Zt.end!=le.ch||!/[\"\']/.test(Zt.string.charAt(Zt.string.length-1))||Zt.string.length==1)||Zt.type=="tag"&&se.close||Zt.string.indexOf("/")==le.ch-Zt.start-1||Wt&&ct(Wt,it)>-1||ot(F,zt.mode.xmlCurrentContext&&zt.mode.xmlCurrentContext(Q)||[],$e,le,!0))return Nt.Pass;var Ot=typeof ne=="object"&&ne.emptyTags;if(Ot&&ct(Ot,$e)>-1){ee[Fe]={text:"/>",newPos:Nt.Pos(le.line,le.ch+2)};continue}var qt=kt&&ct(kt,it)>-1;ee[Fe]={indent:qt,text:">"+(qt?`
|
|
|
|
|
|
`:"")+"</"+$e+">",newPos:qt?Nt.Pos(le.line+1,0):Nt.Pos(le.line,le.ch+1)}}for(var Te=typeof ne=="object"&&ne.dontIndentOnAutoClose,Fe=Y.length-1;Fe>=0;Fe--){var _e=ee[Fe];F.replaceRange(_e.text,Y[Fe].head,Y[Fe].anchor,"+insert");var fi=F.listSelections().slice(0);fi[Fe]={head:_e.newPos,anchor:_e.newPos},F.setSelections(fi),!Te&&_e.indent&&(F.indentLine(_e.newPos.line,null,!0),F.indentLine(_e.newPos.line+1,null,!0))}}function gt(F,Y){for(var ee=F.listSelections(),ne=[],Fe=Y?"/":"</",le=F.getOption("autoCloseTags"),Zt=typeof le=="object"&&le.dontIndentOnSlash,zt=0;zt<ee.length;zt++){if(!ee[zt].empty())return Nt.Pass;var Q=ee[zt].head,se=F.getTokenAt(Q),$e=Nt.innerMode(F.getMode(),se.state),Vt=$e.state;if(Y&&(se.type=="string"||se.string.charAt(0)!="<"||se.start!=Q.ch-1))return Nt.Pass;var Wt,kt=$e.mode.name!="xml"&&F.getMode().name=="htmlmixed";if(kt&&$e.mode.name=="javascript")Wt=Fe+"script";else if(kt&&$e.mode.name=="css")Wt=Fe+"style";else{var it=$e.mode.xmlCurrentContext&&$e.mode.xmlCurrentContext(Vt);if(!it||it.length&&ot(F,it,it[it.length-1],Q))return Nt.Pass;Wt=Fe+it[it.length-1]}F.getLine(Q.line).charAt(se.end)!=">"&&(Wt+=">"),ne[zt]=Wt}if(F.replaceSelections(ne),ee=F.listSelections(),!Zt)for(var zt=0;zt<ee.length;zt++)(zt==ee.length-1||ee[zt].head.line<ee[zt+1].head.line)&&F.indentLine(ee[zt].head.line)}function ft(F){return F.getOption("disableInput")?Nt.Pass:gt(F,!0)}Nt.commands.closeTag=function(F){return gt(F)};function ct(F,Y){if(F.indexOf)return F.indexOf(Y);for(var ee=0,ne=F.length;ee<ne;++ee)if(F[ee]==Y)return ee;return-1}function ot(F,Y,ee,ne,Fe){if(!Nt.scanForClosingTag)return!1;var le=Math.min(F.lastLine()+1,ne.line+500),Zt=Nt.scanForClosingTag(F,ne,null,le);if(!Zt||Zt.tag!=ee)return!1;for(var zt=Fe?1:0,Q=Y.length-1;Q>=0&&Y[Q]==ee;Q--)++zt;ne=Zt.to;for(var Q=1;Q<zt;Q++){var se=Nt.scanForClosingTag(F,ne,null,le);if(!se||se.tag!=ee)return!1;ne=se.to}return!0}})},4786:function(Wr,Ti,j){(function(Nt){Nt(j(4631))})(function(Nt){"use strict";var At=Nt.Pos;function vt(Q,se){return Q.line-se.line||Q.ch-se.ch}var Et="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",gt=Et+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ft=new RegExp("<(/?)(["+Et+"]["+gt+"]*)","g");function ct(Q,se,$e,Vt){this.line=se,this.ch=$e,this.cm=Q,this.text=Q.getLine(se),this.min=Vt?Math.max(Vt.from,Q.firstLine()):Q.firstLine(),this.max=Vt?Math.min(Vt.to-1,Q.lastLine()):Q.lastLine()}function ot(Q,se){var $e=Q.cm.getTokenTypeAt(At(Q.line,se));return $e&&/\btag\b/.test($e)}function F(Q){if(!(Q.line>=Q.max))return Q.ch=0,Q.text=Q.cm.getLine(++Q.line),!0}function Y(Q){if(!(Q.line<=Q.min))return Q.text=Q.cm.getLine(--Q.line),Q.ch=Q.text.length,!0}function ee(Q){for(;;){var se=Q.text.indexOf(">",Q.ch);if(se==-1){if(F(Q))continue;return}if(!ot(Q,se+1)){Q.ch=se+1;continue}var $e=Q.text.lastIndexOf("/",se),Vt=$e>-1&&!/\S/.test(Q.text.slice($e+1,se));return Q.ch=se+1,Vt?"selfClose":"regular"}}function ne(Q){for(;;){var se=Q.ch?Q.text.lastIndexOf("<",Q.ch-1):-1;if(se==-1){if(Y(Q))continue;return}if(!ot(Q,se+1)){Q.ch=se;continue}ft.lastIndex=se,Q.ch=se;var $e=ft.exec(Q.text);if($e&&$e.index==se)return $e}}function Fe(Q){for(;;){ft.lastIndex=Q.ch;var se=ft.exec(Q.text);if(!se){if(F(Q))continue;return}if(!ot(Q,se.index+1)){Q.ch=se.index+1;continue}return Q.ch=se.index+se[0].length,se}}function le(Q){for(;;){var se=Q.ch?Q.text.lastIndexOf(">",Q.ch-1):-1;if(se==-1){if(Y(Q))continue;return}if(!ot(Q,se+1)){Q.ch=se;continue}var $e=Q.text.lastIndexOf("/",se),Vt=$e>-1&&!/\S/.test(Q.text.slice($e+1,se));return Q.ch=se+1,Vt?"selfClose":"regular"}}function Zt(Q,se){for(var $e=[];;){var Vt=Fe(Q),Wt,kt=Q.line,it=Q.ch-(Vt?Vt[0].length:0);if(!Vt||!(Wt=ee(Q)))return;if(Wt!="selfClose")if(Vt[1]){for(var Ot=$e.length-1;Ot>=0;--Ot)if($e[Ot]==Vt[2]){$e.length=Ot;break}if(Ot<0&&(!se||se==Vt[2]))return{tag:Vt[2],from:At(kt,it),to:At(Q.line,Q.ch)}}else $e.push(Vt[2])}}function zt(Q,se){for(var $e=[];;){var Vt=le(Q);if(!Vt)return;if(Vt=="selfClose"){ne(Q);continue}var Wt=Q.line,kt=Q.ch,it=ne(Q);if(!it)return;if(it[1])$e.push(it[2]);else{for(var Ot=$e.length-1;Ot>=0;--Ot)if($e[Ot]==it[2]){$e.length=Ot;break}if(Ot<0&&(!se||se==it[2]))return{tag:it[2],from:At(Q.line,Q.ch),to:At(Wt,kt)}}}}Nt.registerHelper("fold","xml",function(Q,se){for(var $e=new ct(Q,se.line,0);;){var Vt=Fe($e);if(!Vt||$e.line!=se.line)return;var Wt=ee($e);if(!Wt)return;if(!Vt[1]&&Wt!="selfClose"){var kt=At($e.line,$e.ch),it=Zt($e,Vt[2]);return it&&vt(it.from,kt)>0?{from:kt,to:it.from}:null}}}),Nt.findMatchingTag=function(Q,se,$e){var Vt=new ct(Q,se.line,se.ch,$e);if(!(Vt.text.indexOf(">")==-1&&Vt.text.indexOf("<")==-1)){var Wt=ee(Vt),kt=Wt&&At(Vt.line,Vt.ch),it=Wt&&ne(Vt);if(!(!Wt||!it||vt(Vt,se)>0)){var Ot={from:At(Vt.line,Vt.ch),to:kt,tag:it[2]};return Wt=="selfClose"?{open:Ot,close:null,at:"open"}:it[1]?{open:zt(Vt,it[2]),close:Ot,at:"close"}:(Vt=new ct(Q,kt.line,kt.ch,$e),{open:Ot,close:Zt(Vt,it[2]),at:"open"})}}},Nt.findEnclosingTag=function(Q,se,$e,Vt){for(var Wt=new ct(Q,se.line,se.ch,$e);;){var kt=zt(Wt,Vt);if(!kt)break;var it=new ct(Q,se.line,se.ch,$e),Ot=Zt(it,kt.tag);if(Ot)return{open:kt,close:Ot}}},Nt.scanForClosingTag=function(Q,se,$e,Vt){var Wt=new ct(Q,se.line,se.ch,Vt?{from:0,to:Vt}:null);return Zt(Wt,$e)}})},4631:function(Wr){(function(Ti,j){Wr.exports=j()})(this,function(){"use strict";var Ti=navigator.userAgent,j=navigator.platform,Nt=/gecko\/\d/i.test(Ti),At=/MSIE \d/.test(Ti),vt=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ti),Et=/Edge\/(\d+)/.exec(Ti),gt=At||vt||Et,ft=gt&&(At?document.documentMode||6:+(Et||vt)[1]),ct=!Et&&/WebKit\//.test(Ti),ot=ct&&/Qt\/\d+\.\d+/.test(Ti),F=!Et&&/Chrome\//.test(Ti),Y=/Opera\//.test(Ti),ee=/Apple Computer/.test(navigator.vendor),ne=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Ti),Fe=/PhantomJS/.test(Ti),le=!Et&&/AppleWebKit/.test(Ti)&&/Mobile\/\w+/.test(Ti),Zt=/Android/.test(Ti),zt=le||Zt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Ti),Q=le||/Mac/.test(j),se=/\bCrOS\b/.test(Ti),$e=/win/i.test(j),Vt=Y&&Ti.match(/Version\/(\d*\.\d*)/);Vt&&(Vt=Number(Vt[1])),Vt&&Vt>=15&&(Y=!1,ct=!0);var Wt=Q&&(ot||Y&&(Vt==null||Vt<12.11)),kt=Nt||gt&&ft>=9;function it(h){return new RegExp("(^|\\s)"+h+"(?:$|\\s)\\s*")}var Ot=function(h,d){var x=h.className,y=it(d).exec(x);if(y){var S=x.slice(y.index+y[0].length);h.className=x.slice(0,y.index)+(S?y[1]+S:"")}};function qt(h){for(var d=h.childNodes.length;d>0;--d)h.removeChild(h.firstChild);return h}function Te(h,d){return qt(h).appendChild(d)}function _e(h,d,x,y){var S=document.createElement(h);if(x&&(S.className=x),y&&(S.style.cssText=y),typeof d=="string")S.appendChild(document.createTextNode(d));else if(d)for(var E=0;E<d.length;++E)S.appendChild(d[E]);return S}function fi(h,d,x,y){var S=_e(h,d,x,y);return S.setAttribute("role","presentation"),S}var Ht;document.createRange?Ht=function(h,d,x,y){var S=document.createRange();return S.setEnd(y||h,x),S.setStart(h,d),S}:Ht=function(h,d,x){var y=document.body.createTextRange();try{y.moveToElementText(h.parentNode)}catch(S){return y}return y.collapse(!0),y.moveEnd("character",x),y.moveStart("character",d),y};function pe(h,d){if(d.nodeType==3&&(d=d.parentNode),h.contains)return h.contains(d);do if(d.nodeType==11&&(d=d.host),d==h)return!0;while(d=d.parentNode)}function Ke(){var h;try{h=document.activeElement}catch(d){h=document.body||null}for(;h&&h.shadowRoot&&h.shadowRoot.activeElement;)h=h.shadowRoot.activeElement;return h}function ki(h,d){var x=h.className;it(d).test(x)||(h.className+=(x?" ":"")+d)}function pi(h,d){for(var x=h.split(" "),y=0;y<x.length;y++)x[y]&&!it(x[y]).test(d)&&(d+=" "+x[y]);return d}var Sn=function(h){h.select()};le?Sn=function(h){h.selectionStart=0,h.selectionEnd=h.value.length}:gt&&(Sn=function(h){try{h.select()}catch(d){}});function Sr(h){var d=Array.prototype.slice.call(arguments,1);return function(){return h.apply(null,d)}}function Ki(h,d,x){d||(d={});for(var y in h)h.hasOwnProperty(y)&&(x!==!1||!d.hasOwnProperty(y))&&(d[y]=h[y]);return d}function It(h,d,x,y,S){d==null&&(d=h.search(/[^\s\u00a0]/),d==-1&&(d=h.length));for(var E=y||0,O=S||0;;){var W=h.indexOf(" ",E);if(W<0||W>=d)return O+(d-E);O+=W-E,O+=x-O%x,E=W+1}}var tt=function(){this.id=null,this.f=null,this.time=0,this.handler=Sr(this.onTimeout,this)};tt.prototype.onTimeout=function(h){h.id=0,h.time<=+new Date?h.f():setTimeout(h.handler,h.time-+new Date)},tt.prototype.set=function(h,d){this.f=d;var x=+new Date+h;(!this.id||x<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,h),this.time=x)};function de(h,d){for(var x=0;x<h.length;++x)if(h[x]==d)return x;return-1}var hi=50,Ze={toString:function(){return"CodeMirror.Pass"}},Ye={scroll:!1},Ae={origin:"*mouse"},Wi={origin:"+move"};function En(h,d,x){for(var y=0,S=0;;){var E=h.indexOf(" ",y);E==-1&&(E=h.length);var O=E-y;if(E==h.length||S+O>=d)return y+Math.min(O,d-S);if(S+=E-y,S+=x-S%x,y=E+1,S>=d)return y}}var an=[""];function vi(h){for(;an.length<=h;)an.push(ai(an)+" ");return an[h]}function ai(h){return h[h.length-1]}function zi(h,d){for(var x=[],y=0;y<h.length;y++)x[y]=d(h[y],y);return x}function $i(h,d,x){for(var y=0,S=x(d);y<h.length&&x(h[y])<=S;)y++;h.splice(y,0,d)}function q(){}function D(h,d){var x;return Object.create?x=Object.create(h):(q.prototype=h,x=new q),d&&Ki(d,x),x}var _=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function K(h){return/\w/.test(h)||h>"\x80"&&(h.toUpperCase()!=h.toLowerCase()||_.test(h))}function z(h,d){return d?d.source.indexOf("\\w")>-1&&K(h)?!0:d.test(h):K(h)}function P(h){for(var d in h)if(h.hasOwnProperty(d)&&h[d])return!1;return!0}var bt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Gt(h){return h.charCodeAt(0)>=768&&bt.test(h)}function Pe(h,d,x){for(;(x<0?d>0:d<h.length)&&Gt(h.charAt(d));)d+=x;return d}function He(h,d,x){for(var y=d>x?-1:1;;){if(d==x)return d;var S=(d+x)/2,E=y<0?Math.ceil(S):Math.floor(S);if(E==d)return h(E)?d:x;h(E)?x=E:d=E+y}}function ei(h,d,x,y){if(!h)return y(d,x,"ltr",0);for(var S=!1,E=0;E<h.length;++E){var O=h[E];(O.from<x&&O.to>d||d==x&&O.to==d)&&(y(Math.max(O.from,d),Math.min(O.to,x),O.level==1?"rtl":"ltr",E),S=!0)}S||y(d,x,"ltr")}var si=null;function Gi(h,d,x){var y;si=null;for(var S=0;S<h.length;++S){var E=h[S];if(E.from<d&&E.to>d)return S;E.to==d&&(E.from!=E.to&&x=="before"?y=S:si=S),E.from==d&&(E.from!=E.to&&x!="before"?y=S:si=S)}return y!=null?y:si}var er=function(){var h="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function x(nt){return nt<=247?h.charAt(nt):1424<=nt&&nt<=1524?"R":1536<=nt&&nt<=1785?d.charAt(nt-1536):1774<=nt&&nt<=2220?"r":8192<=nt&&nt<=8203?"w":nt==8204?"b":"L"}var y=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,S=/[stwN]/,E=/[LRr]/,O=/[Lb1n]/,W=/[1n]/;function H(nt,Rt,pt){this.level=nt,this.from=Rt,this.to=pt}return function(nt,Rt){var pt=Rt=="ltr"?"L":"R";if(nt.length==0||Rt=="ltr"&&!y.test(nt))return!1;for(var oe=nt.length,Jt=[],oi=0;oi<oe;++oi)Jt.push(x(nt.charCodeAt(oi)));for(var mi=0,Ii=pt;mi<oe;++mi){var on=Jt[mi];on=="m"?Jt[mi]=Ii:Ii=on}for(var Bn=0,gn=pt;Bn<oe;++Bn){var Vn=Jt[Bn];Vn=="1"&&gn=="r"?Jt[Bn]="n":E.test(Vn)&&(gn=Vn,Vn=="r"&&(Jt[Bn]="R"))}for(var Hr=1,bn=Jt[0];Hr<oe-1;++Hr){var rs=Jt[Hr];rs=="+"&&bn=="1"&&Jt[Hr+1]=="1"?Jt[Hr]="1":rs==","&&bn==Jt[Hr+1]&&(bn=="1"||bn=="n")&&(Jt[Hr]=bn),bn=rs}for(var xl=0;xl<oe;++xl){var Hu=Jt[xl];if(Hu==",")Jt[xl]="N";else if(Hu=="%"){var Ol=void 0;for(Ol=xl+1;Ol<oe&&Jt[Ol]=="%";++Ol);for(var Rh=xl&&Jt[xl-1]=="!"||Ol<oe&&Jt[Ol]=="1"?"1":"N",xh=xl;xh<Ol;++xh)Jt[xh]=Rh;xl=Ol-1}}for(var Bu=0,ac=pt;Bu<oe;++Bu){var ts=Jt[Bu];ac=="L"&&ts=="1"?Jt[Bu]="L":E.test(ts)&&(ac=ts)}for(var su=0;su<oe;++su)if(S.test(Jt[su])){var Gs=void 0;for(Gs=su+1;Gs<oe&&S.test(Jt[Gs]);++Gs);for(var Yl=(su?Jt[su-1]:pt)=="L",Rl=(Gs<oe?Jt[Gs]:pt)=="L",Qu=Yl==Rl?Yl?"L":"R":pt,wh=su;wh<Gs;++wh)Jt[wh]=Qu;su=Gs-1}for(var _l=[],wa,Jl=0;Jl<oe;)if(O.test(Jt[Jl])){var np=Jl;for(++Jl;Jl<oe&&O.test(Jt[Jl]);++Jl);_l.push(new H(0,np,Jl))}else{var _c=Jl,Gh=_l.length,lh=Rt=="rtl"?1:0;for(++Jl;Jl<oe&&Jt[Jl]!="L";++Jl);for(var ba=_c;ba<Jl;)if(W.test(Jt[ba])){_c<ba&&(_l.splice(Gh,0,new H(1,_c,ba)),Gh+=lh);var Vu=ba;for(++ba;ba<Jl&&W.test(Jt[ba]);++ba);_l.splice(Gh,0,new H(2,Vu,ba)),Gh+=lh,_c=ba}else++ba;_c<Jl&&_l.splice(Gh,0,new H(1,_c,Jl))}return Rt=="ltr"&&(_l[0].level==1&&(wa=nt.match(/^\s+/))&&(_l[0].from=wa[0].length,_l.unshift(new H(0,0,wa[0].length))),ai(_l).level==1&&(wa=nt.match(/\s+$/))&&(ai(_l).to-=wa[0].length,_l.push(new H(0,oe-wa[0].length,oe)))),Rt=="rtl"?_l.reverse():_l}}();function rr(h,d){var x=h.order;return x==null&&(x=h.order=er(h.text,d)),x}var Se=[],We=function(h,d,x){if(h.addEventListener)h.addEventListener(d,x,!1);else if(h.attachEvent)h.attachEvent("on"+d,x);else{var y=h._handlers||(h._handlers={});y[d]=(y[d]||Se).concat(x)}};function Go(h,d){return h._handlers&&h._handlers[d]||Se}function $o(h,d,x){if(h.removeEventListener)h.removeEventListener(d,x,!1);else if(h.detachEvent)h.detachEvent("on"+d,x);else{var y=h._handlers,S=y&&y[d];if(S){var E=de(S,x);E>-1&&(y[d]=S.slice(0,E).concat(S.slice(E+1)))}}}function yo(h,d){var x=Go(h,d);if(x.length)for(var y=Array.prototype.slice.call(arguments,2),S=0;S<x.length;++S)x[S].apply(null,y)}function Fr(h,d,x){return typeof d=="string"&&(d={type:d,preventDefault:function(){this.defaultPrevented=!0}}),yo(h,x||d.type,h,d),Ja(d)||d.codemirrorIgnore}function Ro(h){var d=h._handlers&&h._handlers.cursorActivity;if(d)for(var x=h.curOp.cursorActivityHandlers||(h.curOp.cursorActivityHandlers=[]),y=0;y<d.length;++y)de(x,d[y])==-1&&x.push(d[y])}function uo(h,d){return Go(h,d).length>0}function Ao(h){h.prototype.on=function(d,x){We(this,d,x)},h.prototype.off=function(d,x){$o(this,d,x)}}function fs(h){h.preventDefault?h.preventDefault():h.returnValue=!1}function Ya(h){h.stopPropagation?h.stopPropagation():h.cancelBubble=!0}function Ja(h){return h.defaultPrevented!=null?h.defaultPrevented:h.returnValue==!1}function jl(h){fs(h),Ya(h)}function Na(h){return h.target||h.srcElement}function xo(h){var d=h.which;return d==null&&(h.button&1?d=1:h.button&2?d=3:h.button&4&&(d=2)),Q&&h.ctrlKey&&d==1&&(d=3),d}var rl=function(){if(gt&&ft<9)return!1;var h=_e("div");return"draggable"in h||"dragDrop"in h}(),Va;function Kl(h){if(Va==null){var d=_e("span","\u200B");Te(h,_e("span",[d,document.createTextNode("x")])),h.firstChild.offsetHeight!=0&&(Va=d.offsetWidth<=1&&d.offsetHeight>2&&!(gt&&ft<8))}var x=Va?_e("span","\u200B"):_e("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return x.setAttribute("cm-text",""),x}var ga;function Xs(h){if(ga!=null)return ga;var d=Te(h,document.createTextNode("A\u062EA")),x=Ht(d,0,1).getBoundingClientRect(),y=Ht(d,1,2).getBoundingClientRect();return qt(h),!x||x.left==x.right?!1:ga=y.right-x.right<3}var Me=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(h){for(var d=0,x=[],y=h.length;d<=y;){var S=h.indexOf(`
|
|
|
`,d);S==-1&&(S=h.length);var E=h.slice(d,h.charAt(S-1)=="\r"?S-1:S),O=E.indexOf("\r");O!=-1?(x.push(E.slice(0,O)),d+=O+1):(x.push(E),d=S+1)}return x}:function(h){return h.split(/\r\n?|\n/)},L=window.getSelection?function(h){try{return h.selectionStart!=h.selectionEnd}catch(d){return!1}}:function(h){var d;try{d=h.ownerDocument.selection.createRange()}catch(x){}return!d||d.parentElement()!=h?!1:d.compareEndPoints("StartToEnd",d)!=0},yi=function(){var h=_e("div");return"oncopy"in h?!0:(h.setAttribute("oncopy","return;"),typeof h.oncopy=="function")}(),qe=null;function Si(h){if(qe!=null)return qe;var d=Te(h,_e("span","x")),x=d.getBoundingClientRect(),y=Ht(d,0,1).getBoundingClientRect();return qe=Math.abs(x.left-y.left)>1}var Vi={},ln={};function fr(h,d){arguments.length>2&&(d.dependencies=Array.prototype.slice.call(arguments,2)),Vi[h]=d}function no(h,d){ln[h]=d}function wo(h){if(typeof h=="string"&&ln.hasOwnProperty(h))h=ln[h];else if(h&&typeof h.name=="string"&&ln.hasOwnProperty(h.name)){var d=ln[h.name];typeof d=="string"&&(d={name:d}),h=D(d,h),h.name=d.name}else{if(typeof h=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(h))return wo("application/xml");if(typeof h=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(h))return wo("application/json")}return typeof h=="string"?{name:h}:h||{name:"null"}}function ro(h,d){d=wo(d);var x=Vi[d.name];if(!x)return ro(h,"text/plain");var y=x(h,d);if(li.hasOwnProperty(d.name)){var S=li[d.name];for(var E in S)S.hasOwnProperty(E)&&(y.hasOwnProperty(E)&&(y["_"+E]=y[E]),y[E]=S[E])}if(y.name=d.name,d.helperType&&(y.helperType=d.helperType),d.modeProps)for(var O in d.modeProps)y[O]=d.modeProps[O];return y}var li={};function St(h,d){var x=li.hasOwnProperty(h)?li[h]:li[h]={};Ki(d,x)}function $t(h,d){if(d===!0)return d;if(h.copyState)return h.copyState(d);var x={};for(var y in d){var S=d[y];S instanceof Array&&(S=S.concat([])),x[y]=S}return x}function xe(h,d){for(var x;h.innerMode&&(x=h.innerMode(d),!(!x||x.mode==h));)d=x.state,h=x.mode;return x||{mode:h,state:d}}function Ue(h,d,x){return h.startState?h.startState(d,x):!0}var Kt=function(h,d,x){this.pos=this.start=0,this.string=h,this.tabSize=d||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=x};Kt.prototype.eol=function(){return this.pos>=this.string.length},Kt.prototype.sol=function(){return this.pos==this.lineStart},Kt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Kt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Kt.prototype.eat=function(h){var d=this.string.charAt(this.pos),x;if(typeof h=="string"?x=d==h:x=d&&(h.test?h.test(d):h(d)),x)return++this.pos,d},Kt.prototype.eatWhile=function(h){for(var d=this.pos;this.eat(h););return this.pos>d},Kt.prototype.eatSpace=function(){for(var h=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>h},Kt.prototype.skipToEnd=function(){this.pos=this.string.length},Kt.prototype.skipTo=function(h){var d=this.string.indexOf(h,this.pos);if(d>-1)return this.pos=d,!0},Kt.prototype.backUp=function(h){this.pos-=h},Kt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=It(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?It(this.string,this.lineStart,this.tabSize):0)},Kt.prototype.indentation=function(){return It(this.string,null,this.tabSize)-(this.lineStart?It(this.string,this.lineStart,this.tabSize):0)},Kt.prototype.match=function(h,d,x){if(typeof h=="string"){var y=function(O){return x?O.toLowerCase():O},S=this.string.substr(this.pos,h.length);if(y(S)==y(h))return d!==!1&&(this.pos+=h.length),!0}else{var E=this.string.slice(this.pos).match(h);return E&&E.index>0?null:(E&&d!==!1&&(this.pos+=E[0].length),E)}},Kt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Kt.prototype.hideFirstChars=function(h,d){this.lineStart+=h;try{return d()}finally{this.lineStart-=h}},Kt.prototype.lookAhead=function(h){var d=this.lineOracle;return d&&d.lookAhead(h)},Kt.prototype.baseToken=function(){var h=this.lineOracle;return h&&h.baseToken(this.pos)};function yt(h,d){if(d-=h.first,d<0||d>=h.size)throw new Error("There is no line "+(d+h.first)+" in the document.");for(var x=h;!x.lines;)for(var y=0;;++y){var S=x.children[y],E=S.chunkSize();if(d<E){x=S;break}d-=E}return x.lines[d]}function me(h,d,x){var y=[],S=d.line;return h.iter(d.line,x.line+1,function(E){var O=E.text;S==x.line&&(O=O.slice(0,x.ch)),S==d.line&&(O=O.slice(d.ch)),y.push(O),++S}),y}function Ce(h,d,x){var y=[];return h.iter(d,x,function(S){y.push(S.text)}),y}function we(h,d){var x=d-h.height;if(x)for(var y=h;y;y=y.parent)y.height+=x}function Mt(h){if(h.parent==null)return null;for(var d=h.parent,x=de(d.lines,h),y=d.parent;y;d=y,y=y.parent)for(var S=0;y.children[S]!=d;++S)x+=y.children[S].chunkSize();return x+d.first}function ie(h,d){var x=h.first;t:do{for(var y=0;y<h.children.length;++y){var S=h.children[y],E=S.height;if(d<E){h=S;continue t}d-=E,x+=S.chunkSize()}return x}while(!h.lines);for(var O=0;O<h.lines.length;++O){var W=h.lines[O],H=W.height;if(d<H)break;d-=H}return x+O}function Re(h,d){return d>=h.first&&d<h.first+h.size}function _i(h,d){return String(h.lineNumberFormatter(d+h.firstLineNumber))}function Qt(h,d,x){if(x===void 0&&(x=null),!(this instanceof Qt))return new Qt(h,d,x);this.line=h,this.ch=d,this.sticky=x}function ui(h,d){return h.line-d.line||h.ch-d.ch}function vr(h,d){return h.sticky==d.sticky&&ui(h,d)==0}function Mr(h){return Qt(h.line,h.ch)}function Lr(h,d){return ui(h,d)<0?d:h}function gi(h,d){return ui(h,d)<0?h:d}function Ji(h,d){return Math.max(h.first,Math.min(d,h.first+h.size-1))}function Xi(h,d){if(d.line<h.first)return Qt(h.first,0);var x=h.first+h.size-1;return d.line>x?Qt(x,yt(h,x).text.length):zr(d,yt(h,d.line).text.length)}function zr(h,d){var x=h.ch;return x==null||x>d?Qt(h.line,d):x<0?Qt(h.line,0):h}function ho(h,d){for(var x=[],y=0;y<d.length;y++)x[y]=Xi(h,d[y]);return x}var Tn=function(h,d){this.state=h,this.lookAhead=d},Pi=function(h,d,x,y){this.state=d,this.doc=h,this.line=x,this.maxLookAhead=y||0,this.baseTokens=null,this.baseTokenPos=1};Pi.prototype.lookAhead=function(h){var d=this.doc.getLine(this.line+h);return d!=null&&h>this.maxLookAhead&&(this.maxLookAhead=h),d},Pi.prototype.baseToken=function(h){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=h;)this.baseTokenPos+=2;var d=this.baseTokens[this.baseTokenPos+1];return{type:d&&d.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-h}},Pi.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Pi.fromSaved=function(h,d,x){return d instanceof Tn?new Pi(h,$t(h.mode,d.state),x,d.lookAhead):new Pi(h,$t(h.mode,d),x)},Pi.prototype.save=function(h){var d=h!==!1?$t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Tn(d,this.maxLookAhead):d};function os(h,d,x,y){var S=[h.state.modeGen],E={};Tr(h,d.text,h.doc.mode,x,function(nt,Rt){return S.push(nt,Rt)},E,y);for(var O=x.state,W=function(nt){x.baseTokens=S;var Rt=h.state.overlays[nt],pt=1,oe=0;x.state=!0,Tr(h,d.text,Rt.mode,x,function(Jt,oi){for(var mi=pt;oe<Jt;){var Ii=S[pt];Ii>Jt&&S.splice(pt,1,Jt,S[pt+1],Ii),pt+=2,oe=Math.min(Jt,Ii)}if(oi)if(Rt.opaque)S.splice(mi,pt-mi,Jt,"overlay "+oi),pt=mi+2;else for(;mi<pt;mi+=2){var on=S[mi+1];S[mi+1]=(on?on+" ":"")+"overlay "+oi}},E),x.state=O,x.baseTokens=null,x.baseTokenPos=1},H=0;H<h.state.overlays.length;++H)W(H);return{styles:S,classes:E.bgClass||E.textClass?E:null}}function qr(h,d,x){if(!d.styles||d.styles[0]!=h.state.modeGen){var y=bo(h,Mt(d)),S=d.text.length>h.options.maxHighlightLength&&$t(h.doc.mode,y.state),E=os(h,d,y);S&&(y.state=S),d.stateAfter=y.save(!S),d.styles=E.styles,E.classes?d.styleClasses=E.classes:d.styleClasses&&(d.styleClasses=null),x===h.doc.highlightFrontier&&(h.doc.modeFrontier=Math.max(h.doc.modeFrontier,++h.doc.highlightFrontier))}return d.styles}function bo(h,d,x){var y=h.doc,S=h.display;if(!y.mode.startState)return new Pi(y,!0,d);var E=yr(h,d,x),O=E>y.first&&yt(y,E-1).stateAfter,W=O?Pi.fromSaved(y,O,E):new Pi(y,Ue(y.mode),E);return y.iter(E,d,function(H){he(h,H.text,W);var nt=W.line;H.stateAfter=nt==d-1||nt%5==0||nt>=S.viewFrom&&nt<S.viewTo?W.save():null,W.nextLine()}),x&&(y.modeFrontier=W.line),W}function he(h,d,x,y){var S=h.doc.mode,E=new Kt(d,h.options.tabSize,x);for(E.start=E.pos=y||0,d==""&&ss(S,x.state);!E.eol();)Aa(S,E,x.state),E.start=E.pos}function ss(h,d){if(h.blankLine)return h.blankLine(d);if(h.innerMode){var x=xe(h,d);if(x.mode.blankLine)return x.mode.blankLine(x.state)}}function Aa(h,d,x,y){for(var S=0;S<10;S++){y&&(y[0]=xe(h,x).mode);var E=h.token(d,x);if(d.pos>d.start)return E}throw new Error("Mode "+h.name+" failed to advance stream.")}var Bo=function(h,d,x){this.start=h.start,this.end=h.pos,this.string=h.current(),this.type=d||null,this.state=x};function Ma(h,d,x,y){var S=h.doc,E=S.mode,O;d=Xi(S,d);var W=yt(S,d.line),H=bo(h,d.line,x),nt=new Kt(W.text,h.options.tabSize,H),Rt;for(y&&(Rt=[]);(y||nt.pos<d.ch)&&!nt.eol();)nt.start=nt.pos,O=Aa(E,nt,H.state),y&&Rt.push(new Bo(nt,O,$t(S.mode,H.state)));return y?Rt:new Bo(nt,O,H.state)}function Lo(h,d){if(h)for(;;){var x=h.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!x)break;h=h.slice(0,x.index)+h.slice(x.index+x[0].length);var y=x[1]?"bgClass":"textClass";d[y]==null?d[y]=x[2]:new RegExp("(?:^|\\s)"+x[2]+"(?:$|\\s)").test(d[y])||(d[y]+=" "+x[2])}return h}function Tr(h,d,x,y,S,E,O){var W=x.flattenSpans;W==null&&(W=h.options.flattenSpans);var H=0,nt=null,Rt=new Kt(d,h.options.tabSize,y),pt,oe=h.options.addModeClass&&[null];for(d==""&&Lo(ss(x,y.state),E);!Rt.eol();){if(Rt.pos>h.options.maxHighlightLength?(W=!1,O&&he(h,d,y,Rt.pos),Rt.pos=d.length,pt=null):pt=Lo(Aa(x,Rt,y.state,oe),E),oe){var Jt=oe[0].name;Jt&&(pt="m-"+(pt?Jt+" "+pt:Jt))}if(!W||nt!=pt){for(;H<Rt.start;)H=Math.min(Rt.start,H+5e3),S(H,nt);nt=pt}Rt.start=Rt.pos}for(;H<Rt.pos;){var oi=Math.min(Rt.pos,H+5e3);S(oi,nt),H=oi}}function yr(h,d,x){for(var y,S,E=h.doc,O=x?-1:d-(h.doc.mode.innerMode?1e3:100),W=d;W>O;--W){if(W<=E.first)return E.first;var H=yt(E,W-1),nt=H.stateAfter;if(nt&&(!x||W+(nt instanceof Tn?nt.lookAhead:0)<=E.modeFrontier))return W;var Rt=It(H.text,null,h.options.tabSize);(S==null||y>Rt)&&(S=W-1,y=Rt)}return S}function $r(h,d){if(h.modeFrontier=Math.min(h.modeFrontier,d),!(h.highlightFrontier<d-10)){for(var x=h.first,y=d-1;y>x;y--){var S=yt(h,y).stateAfter;if(S&&(!(S instanceof Tn)||y+S.lookAhead<d)){x=y+1;break}}h.highlightFrontier=Math.min(h.highlightFrontier,x)}}var dr=!1,ue=!1;function Wo(){dr=!0}function te(){ue=!0}function Do(h,d,x){this.marker=h,this.from=d,this.to=x}function Co(h,d){if(h)for(var x=0;x<h.length;++x){var y=h[x];if(y.marker==d)return y}}function Io(h,d){for(var x,y=0;y<h.length;++y)h[y]!=d&&(x||(x=[])).push(h[y]);return x}function ea(h,d){h.markedSpans=h.markedSpans?h.markedSpans.concat([d]):[d],d.marker.attachLine(h)}function Nr(h,d,x){var y;if(h)for(var S=0;S<h.length;++S){var E=h[S],O=E.marker,W=E.from==null||(O.inclusiveLeft?E.from<=d:E.from<d);if(W||E.from==d&&O.type=="bookmark"&&(!x||!E.marker.insertLeft)){var H=E.to==null||(O.inclusiveRight?E.to>=d:E.to>d);(y||(y=[])).push(new Do(O,E.from,H?null:E.to))}}return y}function Xn(h,d,x){var y;if(h)for(var S=0;S<h.length;++S){var E=h[S],O=E.marker,W=E.to==null||(O.inclusiveRight?E.to>=d:E.to>d);if(W||E.from==d&&O.type=="bookmark"&&(!x||E.marker.insertLeft)){var H=E.from==null||(O.inclusiveLeft?E.from<=d:E.from<d);(y||(y=[])).push(new Do(O,H?null:E.from-d,E.to==null?null:E.to-d))}}return y}function fo(h,d){if(d.full)return null;var x=Re(h,d.from.line)&&yt(h,d.from.line).markedSpans,y=Re(h,d.to.line)&&yt(h,d.to.line).markedSpans;if(!x&&!y)return null;var S=d.from.ch,E=d.to.ch,O=ui(d.from,d.to)==0,W=Nr(x,S,O),H=Xn(y,E,O),nt=d.text.length==1,Rt=ai(d.text).length+(nt?S:0);if(W)for(var pt=0;pt<W.length;++pt){var oe=W[pt];if(oe.to==null){var Jt=Co(H,oe.marker);Jt?nt&&(oe.to=Jt.to==null?null:Jt.to+Rt):oe.to=S}}if(H)for(var oi=0;oi<H.length;++oi){var mi=H[oi];if(mi.to!=null&&(mi.to+=Rt),mi.from==null){var Ii=Co(W,mi.marker);Ii||(mi.from=Rt,nt&&(W||(W=[])).push(mi))}else mi.from+=Rt,nt&&(W||(W=[])).push(mi)}W&&(W=Ys(W)),H&&H!=W&&(H=Ys(H));var on=[W];if(!nt){var Bn=d.text.length-2,gn;if(Bn>0&&W)for(var Vn=0;Vn<W.length;++Vn)W[Vn].to==null&&(gn||(gn=[])).push(new Do(W[Vn].marker,null,null));for(var Hr=0;Hr<Bn;++Hr)on.push(gn);on.push(H)}return on}function Ys(h){for(var d=0;d<h.length;++d){var x=h[d];x.from!=null&&x.from==x.to&&x.marker.clearWhenEmpty!==!1&&h.splice(d--,1)}return h.length?h:null}function Xo(h,d,x){var y=null;if(h.iter(d.line,x.line+1,function(Jt){if(Jt.markedSpans)for(var oi=0;oi<Jt.markedSpans.length;++oi){var mi=Jt.markedSpans[oi].marker;mi.readOnly&&(!y||de(y,mi)==-1)&&(y||(y=[])).push(mi)}}),!y)return null;for(var S=[{from:d,to:x}],E=0;E<y.length;++E)for(var O=y[E],W=O.find(0),H=0;H<S.length;++H){var nt=S[H];if(!(ui(nt.to,W.from)<0||ui(nt.from,W.to)>0)){var Rt=[H,1],pt=ui(nt.from,W.from),oe=ui(nt.to,W.to);(pt<0||!O.inclusiveLeft&&!pt)&&Rt.push({from:nt.from,to:W.from}),(oe>0||!O.inclusiveRight&&!oe)&&Rt.push({from:W.to,to:nt.to}),S.splice.apply(S,Rt),H+=Rt.length-3}}return S}function ci(h){var d=h.markedSpans;if(d){for(var x=0;x<d.length;++x)d[x].marker.detachLine(h);h.markedSpans=null}}function G(h,d){if(d){for(var x=0;x<d.length;++x)d[x].marker.attachLine(h);h.markedSpans=d}}function Wa(h){return h.inclusiveLeft?-1:0}function zs(h){return h.inclusiveRight?1:0}function Fa(h,d){var x=h.lines.length-d.lines.length;if(x!=0)return x;var y=h.find(),S=d.find(),E=ui(y.from,S.from)||Wa(h)-Wa(d);if(E)return-E;var O=ui(y.to,S.to)||zs(h)-zs(d);return O||d.id-h.id}function ia(h,d){var x=ue&&h.markedSpans,y;if(x)for(var S=void 0,E=0;E<x.length;++E)S=x[E],S.marker.collapsed&&(d?S.from:S.to)==null&&(!y||Fa(y,S.marker)<0)&&(y=S.marker);return y}function iu(h){return ia(h,!0)}function Pu(h){return ia(h,!1)}function Th(h,d){var x=ue&&h.markedSpans,y;if(x)for(var S=0;S<x.length;++S){var E=x[S];E.marker.collapsed&&(E.from==null||E.from<d)&&(E.to==null||E.to>d)&&(!y||Fa(y,E.marker)<0)&&(y=E.marker)}return y}function rt(h,d,x,y,S){var E=yt(h,d),O=ue&&E.markedSpans;if(O)for(var W=0;W<O.length;++W){var H=O[W];if(H.marker.collapsed){var nt=H.marker.find(0),Rt=ui(nt.from,x)||Wa(H.marker)-Wa(S),pt=ui(nt.to,y)||zs(H.marker)-zs(S);if(!(Rt>=0&&pt<=0||Rt<=0&&pt>=0)&&(Rt<=0&&(H.marker.inclusiveRight&&S.inclusiveLeft?ui(nt.to,x)>=0:ui(nt.to,x)>0)||Rt>=0&&(H.marker.inclusiveRight&&S.inclusiveLeft?ui(nt.from,y)<=0:ui(nt.from,y)<0)))return!0}}}function ut(h){for(var d;d=iu(h);)h=d.find(-1,!0).line;return h}function re(h){for(var d;d=Pu(h);)h=d.find(1,!0).line;return h}function be(h){for(var d,x;d=Pu(h);)h=d.find(1,!0).line,(x||(x=[])).push(h);return x}function Ge(h,d){var x=yt(h,d),y=ut(x);return x==y?d:Mt(y)}function ni(h,d){if(d>h.lastLine())return d;var x=yt(h,d),y;if(!fe(h,x))return d;for(;y=Pu(x);)x=y.find(1,!0).line;return Mt(x)+1}function fe(h,d){var x=ue&&d.markedSpans;if(x){for(var y=void 0,S=0;S<x.length;++S)if(y=x[S],!!y.marker.collapsed){if(y.from==null)return!0;if(!y.marker.widgetNode&&y.from==0&&y.marker.inclusiveLeft&&un(h,d,y))return!0}}}function un(h,d,x){if(x.to==null){var y=x.marker.find(1,!0);return un(h,y.line,Co(y.line.markedSpans,x.marker))}if(x.marker.inclusiveRight&&x.to==d.text.length)return!0;for(var S=void 0,E=0;E<d.markedSpans.length;++E)if(S=d.markedSpans[E],S.marker.collapsed&&!S.marker.widgetNode&&S.from==x.to&&(S.to==null||S.to!=x.from)&&(S.marker.inclusiveLeft||x.marker.inclusiveRight)&&un(h,d,S))return!0}function An(h){h=ut(h);for(var d=0,x=h.parent,y=0;y<x.lines.length;++y){var S=x.lines[y];if(S==h)break;d+=S.height}for(var E=x.parent;E;x=E,E=x.parent)for(var O=0;O<E.children.length;++O){var W=E.children[O];if(W==x)break;d+=W.height}return d}function xr(h){if(h.height==0)return 0;for(var d=h.text.length,x,y=h;x=iu(y);){var S=x.find(0,!0);y=S.from.line,d+=S.from.ch-S.to.ch}for(y=h;x=Pu(y);){var E=x.find(0,!0);d-=y.text.length-E.from.ch,y=E.to.line,d+=y.text.length-E.to.ch}return d}function Ur(h){var d=h.display,x=h.doc;d.maxLine=yt(x,x.first),d.maxLineLength=xr(d.maxLine),d.maxLineChanged=!0,x.iter(function(y){var S=xr(y);S>d.maxLineLength&&(d.maxLineLength=S,d.maxLine=y)})}var Zn=function(h,d,x){this.text=h,G(this,d),this.height=x?x(this):1};Zn.prototype.lineNo=function(){return Mt(this)},Ao(Zn);function ko(h,d,x,y){h.text=d,h.stateAfter&&(h.stateAfter=null),h.styles&&(h.styles=null),h.order!=null&&(h.order=null),ci(h),G(h,x);var S=y?y(h):1;S!=h.height&&we(h,S)}function Yo(h){h.parent=null,ci(h)}var Oo={},Ms={};function na(h,d){if(!h||/^\s*$/.test(h))return null;var x=d.addModeClass?Ms:Oo;return x[h]||(x[h]=h.replace(/\S+/g,"cm-$&"))}function Tt(h,d){var x=fi("span",null,null,ct?"padding-right: .1px":null),y={pre:fi("pre",[x],"CodeMirror-line"),content:x,col:0,pos:0,cm:h,trailingSpace:!1,splitSpaces:h.getOption("lineWrapping")};d.measure={};for(var S=0;S<=(d.rest?d.rest.length:0);S++){var E=S?d.rest[S-1]:d.line,O=void 0;y.pos=0,y.addToken=Yn,Xs(h.display.measure)&&(O=rr(E,h.doc.direction))&&(y.addToken=ls(y.addToken,O)),y.map=[];var W=d!=h.display.externalMeasured&&Mt(E);ra(E,y,qr(h,E,W)),E.styleClasses&&(E.styleClasses.bgClass&&(y.bgClass=pi(E.styleClasses.bgClass,y.bgClass||"")),E.styleClasses.textClass&&(y.textClass=pi(E.styleClasses.textClass,y.textClass||""))),y.map.length==0&&y.map.push(0,0,y.content.appendChild(Kl(h.display.measure))),S==0?(d.measure.map=y.map,d.measure.cache={}):((d.measure.maps||(d.measure.maps=[])).push(y.map),(d.measure.caches||(d.measure.caches=[])).push({}))}if(ct){var H=y.content.lastChild;(/\bcm-tab\b/.test(H.className)||H.querySelector&&H.querySelector(".cm-tab"))&&(y.content.className="cm-tab-wrap-hack")}return yo(h,"renderLine",h,d.line,y.pre),y.pre.className&&(y.textClass=pi(y.pre.className,y.textClass||"")),y}function yn(h){var d=_e("span","\u2022","cm-invalidchar");return d.title="\\u"+h.charCodeAt(0).toString(16),d.setAttribute("aria-label",d.title),d}function Yn(h,d,x,y,S,E,O){if(d){var W=h.splitSpaces?Ir(d,h.trailingSpace):d,H=h.cm.state.specialChars,nt=!1,Rt;if(!H.test(d))h.col+=d.length,Rt=document.createTextNode(W),h.map.push(h.pos,h.pos+d.length,Rt),gt&&ft<9&&(nt=!0),h.pos+=d.length;else{Rt=document.createDocumentFragment();for(var pt=0;;){H.lastIndex=pt;var oe=H.exec(d),Jt=oe?oe.index-pt:d.length-pt;if(Jt){var oi=document.createTextNode(W.slice(pt,pt+Jt));gt&&ft<9?Rt.appendChild(_e("span",[oi])):Rt.appendChild(oi),h.map.push(h.pos,h.pos+Jt,oi),h.col+=Jt,h.pos+=Jt}if(!oe)break;pt+=Jt+1;var mi=void 0;if(oe[0]==" "){var Ii=h.cm.options.tabSize,on=Ii-h.col%Ii;mi=Rt.appendChild(_e("span",vi(on),"cm-tab")),mi.setAttribute("role","presentation"),mi.setAttribute("cm-text"," "),h.col+=on}else oe[0]=="\r"||oe[0]==`
|
|
|
`?(mi=Rt.appendChild(_e("span",oe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),mi.setAttribute("cm-text",oe[0]),h.col+=1):(mi=h.cm.options.specialCharPlaceholder(oe[0]),mi.setAttribute("cm-text",oe[0]),gt&&ft<9?Rt.appendChild(_e("span",[mi])):Rt.appendChild(mi),h.col+=1);h.map.push(h.pos,h.pos+1,mi),h.pos++}}if(h.trailingSpace=W.charCodeAt(d.length-1)==32,x||y||S||nt||E||O){var Bn=x||"";y&&(Bn+=y),S&&(Bn+=S);var gn=_e("span",[Rt],Bn,E);if(O)for(var Vn in O)O.hasOwnProperty(Vn)&&Vn!="style"&&Vn!="class"&&gn.setAttribute(Vn,O[Vn]);return h.content.appendChild(gn)}h.content.appendChild(Rt)}}function Ir(h,d){if(h.length>1&&!/ /.test(h))return h;for(var x=d,y="",S=0;S<h.length;S++){var E=h.charAt(S);E==" "&&x&&(S==h.length-1||h.charCodeAt(S+1)==32)&&(E="\xA0"),y+=E,x=E==" "}return y}function ls(h,d){return function(x,y,S,E,O,W,H){S=S?S+" cm-force-border":"cm-force-border";for(var nt=x.pos,Rt=nt+y.length;;){for(var pt=void 0,oe=0;oe<d.length&&(pt=d[oe],!(pt.to>nt&&pt.from<=nt));oe++);if(pt.to>=Rt)return h(x,y,S,E,O,W,H);h(x,y.slice(0,pt.to-nt),S,E,null,W,H),E=null,y=y.slice(pt.to-nt),nt=pt.to}}}function Jo(h,d,x,y){var S=!y&&x.widgetNode;S&&h.map.push(h.pos,h.pos+d,S),!y&&h.cm.display.input.needsContentAttribute&&(S||(S=h.content.appendChild(document.createElement("span"))),S.setAttribute("cm-marker",x.id)),S&&(h.cm.display.input.setUneditable(S),h.content.appendChild(S)),h.pos+=d,h.trailingSpace=!1}function ra(h,d,x){var y=h.markedSpans,S=h.text,E=0;if(!y){for(var O=1;O<x.length;O+=2)d.addToken(d,S.slice(E,E=x[O]),na(x[O+1],d.cm.options));return}for(var W=S.length,H=0,nt=1,Rt="",pt,oe,Jt=0,oi,mi,Ii,on,Bn;;){if(Jt==H){oi=mi=Ii=oe="",Bn=null,on=null,Jt=1/0;for(var gn=[],Vn=void 0,Hr=0;Hr<y.length;++Hr){var bn=y[Hr],rs=bn.marker;if(rs.type=="bookmark"&&bn.from==H&&rs.widgetNode)gn.push(rs);else if(bn.from<=H&&(bn.to==null||bn.to>H||rs.collapsed&&bn.to==H&&bn.from==H)){if(bn.to!=null&&bn.to!=H&&Jt>bn.to&&(Jt=bn.to,mi=""),rs.className&&(oi+=" "+rs.className),rs.css&&(oe=(oe?oe+";":"")+rs.css),rs.startStyle&&bn.from==H&&(Ii+=" "+rs.startStyle),rs.endStyle&&bn.to==Jt&&(Vn||(Vn=[])).push(rs.endStyle,bn.to),rs.title&&((Bn||(Bn={})).title=rs.title),rs.attributes)for(var xl in rs.attributes)(Bn||(Bn={}))[xl]=rs.attributes[xl];rs.collapsed&&(!on||Fa(on.marker,rs)<0)&&(on=bn)}else bn.from>H&&Jt>bn.from&&(Jt=bn.from)}if(Vn)for(var Hu=0;Hu<Vn.length;Hu+=2)Vn[Hu+1]==Jt&&(mi+=" "+Vn[Hu]);if(!on||on.from==H)for(var Ol=0;Ol<gn.length;++Ol)Jo(d,0,gn[Ol]);if(on&&(on.from||0)==H){if(Jo(d,(on.to==null?W+1:on.to)-H,on.marker,on.from==null),on.to==null)return;on.to==H&&(on=!1)}}if(H>=W)break;for(var Rh=Math.min(W,Jt);;){if(Rt){var xh=H+Rt.length;if(!on){var Bu=xh>Rh?Rt.slice(0,Rh-H):Rt;d.addToken(d,Bu,pt?pt+oi:oi,Ii,H+Bu.length==Jt?mi:"",oe,Bn)}if(xh>=Rh){Rt=Rt.slice(Rh-H),H=Rh;break}H=xh,Ii=""}Rt=S.slice(E,E=x[nt++]),pt=na(x[nt++],d.cm.options)}}}function $s(h,d,x){this.line=d,this.rest=be(d),this.size=this.rest?Mt(ai(this.rest))-x+1:1,this.node=this.text=null,this.hidden=fe(h,d)}function or(h,d,x){for(var y=[],S,E=d;E<x;E=S){var O=new $s(h.doc,yt(h.doc,E),E);S=E+O.size,y.push(O)}return y}var eo=null;function Fn(h){eo?eo.ops.push(h):h.ownsGroup=eo={ops:[h],delayedCallbacks:[]}}function hn(h){var d=h.delayedCallbacks,x=0;do{for(;x<d.length;x++)d[x].call(null);for(var y=0;y<h.ops.length;y++){var S=h.ops[y];if(S.cursorActivityHandlers)for(;S.cursorActivityCalled<S.cursorActivityHandlers.length;)S.cursorActivityHandlers[S.cursorActivityCalled++].call(null,S.cm)}}while(x<d.length)}function _r(h,d){var x=h.ownsGroup;if(x)try{hn(x)}finally{eo=null,d(x)}}var Or=null;function Ai(h,d){var x=Go(h,d);if(x.length){var y=Array.prototype.slice.call(arguments,2),S;eo?S=eo.delayedCallbacks:Or?S=Or:(S=Or=[],setTimeout(kl,0));for(var E=function(W){S.push(function(){return x[W].apply(null,y)})},O=0;O<x.length;++O)E(O)}}function kl(){var h=Or;Or=null;for(var d=0;d<h.length;++d)h[d]()}function El(h,d,x,y){for(var S=0;S<d.changes.length;S++){var E=d.changes[S];E=="text"?di(h,d):E=="gutter"?Fo(h,d,x,y):E=="class"?jr(h,d):E=="widget"&&Ca(h,d,y)}d.changes=null}function Ua(h){return h.node==h.text&&(h.node=_e("div",null,null,"position: relative"),h.text.parentNode&&h.text.parentNode.replaceChild(h.node,h.text),h.node.appendChild(h.text),gt&&ft<8&&(h.node.style.zIndex=2)),h.node}function Sl(h,d){var x=d.bgClass?d.bgClass+" "+(d.line.bgClass||""):d.line.bgClass;if(x&&(x+=" CodeMirror-linebackground"),d.background)x?d.background.className=x:(d.background.parentNode.removeChild(d.background),d.background=null);else if(x){var y=Ua(d);d.background=y.insertBefore(_e("div",null,x),y.firstChild),h.display.input.setUneditable(d.background)}}function xu(h,d){var x=h.display.externalMeasured;return x&&x.line==d.line?(h.display.externalMeasured=null,d.measure=x.measure,x.built):Tt(h,d)}function di(h,d){var x=d.text.className,y=xu(h,d);d.text==d.node&&(d.node=y.pre),d.text.parentNode.replaceChild(y.pre,d.text),d.text=y.pre,y.bgClass!=d.bgClass||y.textClass!=d.textClass?(d.bgClass=y.bgClass,d.textClass=y.textClass,jr(h,d)):x&&(d.text.className=x)}function jr(h,d){Sl(h,d),d.line.wrapClass?Ua(d).className=d.line.wrapClass:d.node!=d.text&&(d.node.className="");var x=d.textClass?d.textClass+" "+(d.line.textClass||""):d.line.textClass;d.text.className=x||""}function Fo(h,d,x,y){if(d.gutter&&(d.node.removeChild(d.gutter),d.gutter=null),d.gutterBackground&&(d.node.removeChild(d.gutterBackground),d.gutterBackground=null),d.line.gutterClass){var S=Ua(d);d.gutterBackground=_e("div",null,"CodeMirror-gutter-background "+d.line.gutterClass,"left: "+(h.options.fixedGutter?y.fixedPos:-y.gutterTotalWidth)+"px; width: "+y.gutterTotalWidth+"px"),h.display.input.setUneditable(d.gutterBackground),S.insertBefore(d.gutterBackground,d.text)}var E=d.line.gutterMarkers;if(h.options.lineNumbers||E){var O=Ua(d),W=d.gutter=_e("div",null,"CodeMirror-gutter-wrapper","left: "+(h.options.fixedGutter?y.fixedPos:-y.gutterTotalWidth)+"px");if(h.display.input.setUneditable(W),O.insertBefore(W,d.text),d.line.gutterClass&&(W.className+=" "+d.line.gutterClass),h.options.lineNumbers&&(!E||!E["CodeMirror-linenumbers"])&&(d.lineNumber=W.appendChild(_e("div",_i(h.options,x),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+y.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+h.display.lineNumInnerWidth+"px"))),E)for(var H=0;H<h.display.gutterSpecs.length;++H){var nt=h.display.gutterSpecs[H].className,Rt=E.hasOwnProperty(nt)&&E[nt];Rt&&W.appendChild(_e("div",[Rt],"CodeMirror-gutter-elt","left: "+y.gutterLeft[nt]+"px; width: "+y.gutterWidth[nt]+"px"))}}}function Ca(h,d,x){d.alignable&&(d.alignable=null);for(var y=it("CodeMirror-linewidget"),S=d.node.firstChild,E=void 0;S;S=E)E=S.nextSibling,y.test(S.className)&&d.node.removeChild(S);ol(h,d,x)}function Ll(h,d,x,y){var S=xu(h,d);return d.text=d.node=S.pre,S.bgClass&&(d.bgClass=S.bgClass),S.textClass&&(d.textClass=S.textClass),jr(h,d),Fo(h,d,x,y),ol(h,d,y),d.node}function ol(h,d,x){if(_n(h,d.line,d,x,!0),d.rest)for(var y=0;y<d.rest.length;y++)_n(h,d.rest[y],d,x,!1)}function _n(h,d,x,y,S){if(d.widgets)for(var E=Ua(x),O=0,W=d.widgets;O<W.length;++O){var H=W[O],nt=_e("div",[H.node],"CodeMirror-linewidget"+(H.className?" "+H.className:""));H.handleMouseEvents||nt.setAttribute("cm-ignore-events","true"),Za(H,nt,x,y),h.display.input.setUneditable(nt),S&&H.above?E.insertBefore(nt,x.gutter||x.text):E.appendChild(nt),Ai(H,"redraw")}}function Za(h,d,x,y){if(h.noHScroll){(x.alignable||(x.alignable=[])).push(d);var S=y.wrapperWidth;d.style.left=y.fixedPos+"px",h.coverGutter||(S-=y.gutterTotalWidth,d.style.paddingLeft=y.gutterTotalWidth+"px"),d.style.width=S+"px"}h.coverGutter&&(d.style.zIndex=5,d.style.position="relative",h.noHScroll||(d.style.marginLeft=-y.gutterTotalWidth+"px"))}function nu(h){if(h.height!=null)return h.height;var d=h.doc.cm;if(!d)return 0;if(!pe(document.body,h.node)){var x="position: relative;";h.coverGutter&&(x+="margin-left: -"+d.display.gutters.offsetWidth+"px;"),h.noHScroll&&(x+="width: "+d.display.wrapper.clientWidth+"px;"),Te(d.display.measure,_e("div",[h.node],null,x))}return h.height=h.node.parentNode.offsetHeight}function Tl(h,d){for(var x=Na(d);x!=h.wrapper;x=x.parentNode)if(!x||x.nodeType==1&&x.getAttribute("cm-ignore-events")=="true"||x.parentNode==h.sizer&&x!=h.mover)return!0}function uu(h){return h.lineSpace.offsetTop}function _h(h){return h.mover.offsetHeight-h.lineSpace.offsetHeight}function hu(h){if(h.cachedPaddingH)return h.cachedPaddingH;var d=Te(h.measure,_e("pre","x","CodeMirror-line-like")),x=window.getComputedStyle?window.getComputedStyle(d):d.currentStyle,y={left:parseInt(x.paddingLeft),right:parseInt(x.paddingRight)};return!isNaN(y.left)&&!isNaN(y.right)&&(h.cachedPaddingH=y),y}function ml(h){return hi-h.display.nativeBarWidth}function sl(h){return h.display.scroller.clientWidth-ml(h)-h.display.barWidth}function Js(h){return h.display.scroller.clientHeight-ml(h)-h.display.barHeight}function $u(h,d,x){var y=h.options.lineWrapping,S=y&&sl(h);if(!d.measure.heights||y&&d.measure.width!=S){var E=d.measure.heights=[];if(y){d.measure.width=S;for(var O=d.text.firstChild.getClientRects(),W=0;W<O.length-1;W++){var H=O[W],nt=O[W+1];Math.abs(H.bottom-nt.bottom)>2&&E.push((H.bottom+nt.top)/2-x.top)}}E.push(x.bottom-x.top)}}function Nu(h,d,x){if(h.line==d)return{map:h.measure.map,cache:h.measure.cache};for(var y=0;y<h.rest.length;y++)if(h.rest[y]==d)return{map:h.measure.maps[y],cache:h.measure.caches[y]};for(var S=0;S<h.rest.length;S++)if(Mt(h.rest[S])>x)return{map:h.measure.maps[S],cache:h.measure.caches[S],before:!0}}function df(h,d){d=ut(d);var x=Mt(d),y=h.display.externalMeasured=new $s(h.doc,d,x);y.lineN=x;var S=y.built=Tt(h,y);return y.text=S.pre,Te(h.display.lineMeasure,S.pre),y}function jh(h,d,x,y){return js(h,Zu(h,d),x,y)}function cu(h,d){if(d>=h.display.viewFrom&&d<h.display.viewTo)return h.display.view[Al(h,d)];var x=h.display.externalMeasured;if(x&&d>=x.lineN&&d<x.lineN+x.size)return x}function Zu(h,d){var x=Mt(d),y=cu(h,x);y&&!y.text?y=null:y&&y.changes&&(El(h,y,x,Mc(h)),h.curOp.forceUpdate=!0),y||(y=df(h,d));var S=Nu(y,d,x);return{line:d,view:y,rect:null,map:S.map,cache:S.cache,before:S.before,hasHeights:!1}}function js(h,d,x,y,S){d.before&&(x=-1);var E=x+(y||""),O;return d.cache.hasOwnProperty(E)?O=d.cache[E]:(d.rect||(d.rect=d.view.text.getBoundingClientRect()),d.hasHeights||($u(h,d.view,d.rect),d.hasHeights=!0),O=ds(h,d,x,y),O.bogus||(d.cache[E]=O)),{left:O.left,right:O.right,top:S?O.rtop:O.top,bottom:S?O.rbottom:O.bottom}}var gh={left:0,right:0,top:0,bottom:0};function yc(h,d,x){for(var y,S,E,O,W,H,nt=0;nt<h.length;nt+=3)if(W=h[nt],H=h[nt+1],d<W?(S=0,E=1,O="left"):d<H?(S=d-W,E=S+1):(nt==h.length-3||d==H&&h[nt+3]>d)&&(E=H-W,S=E-1,d>=H&&(O="right")),S!=null){if(y=h[nt+2],W==H&&x==(y.insertLeft?"left":"right")&&(O=x),x=="left"&&S==0)for(;nt&&h[nt-2]==h[nt-3]&&h[nt-1].insertLeft;)y=h[(nt-=3)+2],O="left";if(x=="right"&&S==H-W)for(;nt<h.length-3&&h[nt+3]==h[nt+4]&&!h[nt+5].insertLeft;)y=h[(nt+=3)+2],O="right";break}return{node:y,start:S,end:E,collapse:O,coverStart:W,coverEnd:H}}function Gu(h,d){var x=gh;if(d=="left")for(var y=0;y<h.length&&(x=h[y]).left==x.right;y++);else for(var S=h.length-1;S>=0&&(x=h[S]).left==x.right;S--);return x}function ds(h,d,x,y){var S=yc(d.map,x,y),E=S.node,O=S.start,W=S.end,H=S.collapse,nt;if(E.nodeType==3){for(var Rt=0;Rt<4;Rt++){for(;O&&Gt(d.line.text.charAt(S.coverStart+O));)--O;for(;S.coverStart+W<S.coverEnd&&Gt(d.line.text.charAt(S.coverStart+W));)++W;if(gt&&ft<9&&O==0&&W==S.coverEnd-S.coverStart?nt=E.parentNode.getBoundingClientRect():nt=Gu(Ht(E,O,W).getClientRects(),y),nt.left||nt.right||O==0)break;W=O,O=O-1,H="right"}gt&&ft<11&&(nt=xc(h.display.measure,nt))}else{O>0&&(H=y="right");var pt;h.options.lineWrapping&&(pt=E.getClientRects()).length>1?nt=pt[y=="right"?pt.length-1:0]:nt=E.getBoundingClientRect()}if(gt&&ft<9&&!O&&(!nt||!nt.left&&!nt.right)){var oe=E.parentNode.getClientRects()[0];oe?nt={left:oe.left,right:oe.left+Su(h.display),top:oe.top,bottom:oe.bottom}:nt=gh}for(var Jt=nt.top-d.rect.top,oi=nt.bottom-d.rect.top,mi=(Jt+oi)/2,Ii=d.view.measure.heights,on=0;on<Ii.length-1&&!(mi<Ii[on]);on++);var Bn=on?Ii[on-1]:0,gn=Ii[on],Vn={left:(H=="right"?nt.right:nt.left)-d.rect.left,right:(H=="left"?nt.left:nt.right)-d.rect.left,top:Bn,bottom:gn};return!nt.left&&!nt.right&&(Vn.bogus=!0),h.options.singleCursorHeightPerLine||(Vn.rtop=Jt,Vn.rbottom=oi),Vn}function xc(h,d){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Si(h))return d;var x=screen.logicalXDPI/screen.deviceXDPI,y=screen.logicalYDPI/screen.deviceYDPI;return{left:d.left*x,right:d.right*x,top:d.top*y,bottom:d.bottom*y}}function za(h){if(h.measure&&(h.measure.cache={},h.measure.heights=null,h.rest))for(var d=0;d<h.rest.length;d++)h.measure.caches[d]={}}function wu(h){h.display.externalMeasure=null,qt(h.display.lineMeasure);for(var d=0;d<h.display.view.length;d++)za(h.display.view[d])}function fu(h){wu(h),h.display.cachedCharWidth=h.display.cachedTextHeight=h.display.cachedPaddingH=null,h.options.lineWrapping||(h.display.maxLineChanged=!0),h.display.lineNumChars=null}function al(){return F&&Zt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function gl(){return F&&Zt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qa(h){var d=0;if(h.widgets)for(var x=0;x<h.widgets.length;++x)h.widgets[x].above&&(d+=nu(h.widgets[x]));return d}function ka(h,d,x,y,S){if(!S){var E=qa(d);x.top+=E,x.bottom+=E}if(y=="line")return x;y||(y="local");var O=An(d);if(y=="local"?O+=uu(h.display):O-=h.display.viewOffset,y=="page"||y=="window"){var W=h.display.lineSpace.getBoundingClientRect();O+=W.top+(y=="window"?0:gl());var H=W.left+(y=="window"?0:al());x.left+=H,x.right+=H}return x.top+=O,x.bottom+=O,x}function bu(h,d,x){if(x=="div")return d;var y=d.left,S=d.top;if(x=="page")y-=al(),S-=gl();else if(x=="local"||!x){var E=h.display.sizer.getBoundingClientRect();y+=E.left,S+=E.top}var O=h.display.lineSpace.getBoundingClientRect();return{left:y-O.left,top:S-O.top}}function rc(h,d,x,y,S){return y||(y=yt(h.doc,d.line)),ka(h,y,jh(h,y,d.ch,S),x)}function Hs(h,d,x,y,S,E){y=y||yt(h.doc,d.line),S||(S=Zu(h,y));function O(oi,mi){var Ii=js(h,S,oi,mi?"right":"left",E);return mi?Ii.left=Ii.right:Ii.right=Ii.left,ka(h,y,Ii,x)}var W=rr(y,h.doc.direction),H=d.ch,nt=d.sticky;if(H>=y.text.length?(H=y.text.length,nt="before"):H<=0&&(H=0,nt="after"),!W)return O(nt=="before"?H-1:H,nt=="before");function Rt(oi,mi,Ii){var on=W[mi],Bn=on.level==1;return O(Ii?oi-1:oi,Bn!=Ii)}var pt=Gi(W,H,nt),oe=si,Jt=Rt(H,pt,nt=="before");return oe!=null&&(Jt.other=Rt(H,oe,nt!="before")),Jt}function Xc(h,d){var x=0;d=Xi(h.doc,d),h.options.lineWrapping||(x=Su(h.display)*d.ch);var y=yt(h.doc,d.line),S=An(y)+uu(h.display);return{left:x,right:x,top:S,bottom:S+y.height}}function wc(h,d,x,y,S){var E=Qt(h,d,x);return E.xRel=S,y&&(E.outside=y),E}function bc(h,d,x){var y=h.doc;if(x+=h.display.viewOffset,x<0)return wc(y.first,0,null,-1,-1);var S=ie(y,x),E=y.first+y.size-1;if(S>E)return wc(y.first+y.size-1,yt(y,E).text.length,null,1,1);d<0&&(d=0);for(var O=yt(y,S);;){var W=ve(h,O,S,d,x),H=Th(O,W.ch+(W.xRel>0||W.outside>0?1:0));if(!H)return W;var nt=H.find(1);if(nt.line==S)return nt;O=yt(y,S=nt.line)}}function dn(h,d,x,y){y-=qa(d);var S=d.text.length,E=He(function(O){return js(h,x,O-1).bottom<=y},S,0);return S=He(function(O){return js(h,x,O).top>y},E,S),{begin:E,end:S}}function Oc(h,d,x,y){x||(x=Zu(h,d));var S=ka(h,d,js(h,x,y),"line").top;return dn(h,d,x,S)}function xt(h,d,x,y){return h.bottom<=x?!1:h.top>x?!0:(y?h.left:h.right)>d}function ve(h,d,x,y,S){S-=An(d);var E=Zu(h,d),O=qa(d),W=0,H=d.text.length,nt=!0,Rt=rr(d,h.doc.direction);if(Rt){var pt=(h.options.lineWrapping?Sc:Kh)(h,d,x,E,Rt,y,S);nt=pt.level!=1,W=nt?pt.from:pt.to-1,H=nt?pt.to:pt.from-1}var oe=null,Jt=null,oi=He(function(Hr){var bn=js(h,E,Hr);return bn.top+=O,bn.bottom+=O,xt(bn,y,S,!1)?(bn.top<=S&&bn.left<=y&&(oe=Hr,Jt=bn),!0):!1},W,H),mi,Ii,on=!1;if(Jt){var Bn=y-Jt.left<Jt.right-y,gn=Bn==nt;oi=oe+(gn?0:1),Ii=gn?"after":"before",mi=Bn?Jt.left:Jt.right}else{!nt&&(oi==H||oi==W)&&oi++,Ii=oi==0?"after":oi==d.text.length?"before":js(h,E,oi-(nt?1:0)).bottom+O<=S==nt?"after":"before";var Vn=Hs(h,Qt(x,oi,Ii),"line",d,E);mi=Vn.left,on=S<Vn.top?-1:S>=Vn.bottom?1:0}return oi=Pe(d.text,oi,1),wc(x,oi,Ii,on,y-mi)}function Kh(h,d,x,y,S,E,O){var W=He(function(pt){var oe=S[pt],Jt=oe.level!=1;return xt(Hs(h,Qt(x,Jt?oe.to:oe.from,Jt?"before":"after"),"line",d,y),E,O,!0)},0,S.length-1),H=S[W];if(W>0){var nt=H.level!=1,Rt=Hs(h,Qt(x,nt?H.from:H.to,nt?"after":"before"),"line",d,y);xt(Rt,E,O,!0)&&Rt.top>O&&(H=S[W-1])}return H}function Sc(h,d,x,y,S,E,O){var W=dn(h,d,y,O),H=W.begin,nt=W.end;/\s/.test(d.text.charAt(nt-1))&&nt--;for(var Rt=null,pt=null,oe=0;oe<S.length;oe++){var Jt=S[oe];if(!(Jt.from>=nt||Jt.to<=H)){var oi=Jt.level!=1,mi=js(h,y,oi?Math.min(nt,Jt.to)-1:Math.max(H,Jt.from)).right,Ii=mi<E?E-mi+1e9:mi-E;(!Rt||pt>Ii)&&(Rt=Jt,pt=Ii)}}return Rt||(Rt=S[S.length-1]),Rt.from<H&&(Rt={from:H,to:Rt.to,level:Rt.level}),Rt.to>nt&&(Rt={from:Rt.from,to:nt,level:Rt.level}),Rt}var Ph;function Nh(h){if(h.cachedTextHeight!=null)return h.cachedTextHeight;if(Ph==null){Ph=_e("pre",null,"CodeMirror-line-like");for(var d=0;d<49;++d)Ph.appendChild(document.createTextNode("x")),Ph.appendChild(_e("br"));Ph.appendChild(document.createTextNode("x"))}Te(h.measure,Ph);var x=Ph.offsetHeight/50;return x>3&&(h.cachedTextHeight=x),qt(h.measure),x||1}function Su(h){if(h.cachedCharWidth!=null)return h.cachedCharWidth;var d=_e("span","xxxxxxxxxx"),x=_e("pre",[d],"CodeMirror-line-like");Te(h.measure,x);var y=d.getBoundingClientRect(),S=(y.right-y.left)/10;return S>2&&(h.cachedCharWidth=S),S||10}function Mc(h){for(var d=h.display,x={},y={},S=d.gutters.clientLeft,E=d.gutters.firstChild,O=0;E;E=E.nextSibling,++O){var W=h.display.gutterSpecs[O].className;x[W]=E.offsetLeft+E.clientLeft+S,y[W]=E.clientWidth}return{fixedPos:Cc(d),gutterTotalWidth:d.gutters.offsetWidth,gutterLeft:x,gutterWidth:y,wrapperWidth:d.wrapper.clientWidth}}function Cc(h){return h.scroller.getBoundingClientRect().left-h.sizer.getBoundingClientRect().left}function fa(h){var d=Nh(h.display),x=h.options.lineWrapping,y=x&&Math.max(5,h.display.scroller.clientWidth/Su(h.display)-3);return function(S){if(fe(h.doc,S))return 0;var E=0;if(S.widgets)for(var O=0;O<S.widgets.length;O++)S.widgets[O].height&&(E+=S.widgets[O].height);return x?E+(Math.ceil(S.text.length/y)||1)*d:E+d}}function zn(h){var d=h.doc,x=fa(h);d.iter(function(y){var S=x(y);S!=y.height&&we(y,S)})}function vl(h,d,x,y){var S=h.display;if(!x&&Na(d).getAttribute("cm-not-content")=="true")return null;var E,O,W=S.lineSpace.getBoundingClientRect();try{E=d.clientX-W.left,O=d.clientY-W.top}catch(pt){return null}var H=bc(h,E,O),nt;if(y&&H.xRel>0&&(nt=yt(h.doc,H.line).text).length==H.ch){var Rt=It(nt,nt.length,h.options.tabSize)-nt.length;H=Qt(H.line,Math.max(0,Math.round((E-hu(h.display).left)/Su(h.display))-Rt))}return H}function Al(h,d){if(d>=h.display.viewTo||(d-=h.display.viewFrom,d<0))return null;for(var x=h.display.view,y=0;y<x.length;y++)if(d-=x[y].size,d<0)return y}function oa(h,d,x,y){d==null&&(d=h.doc.first),x==null&&(x=h.doc.first+h.doc.size),y||(y=0);var S=h.display;if(y&&x<S.viewTo&&(S.updateLineNumbers==null||S.updateLineNumbers>d)&&(S.updateLineNumbers=d),h.curOp.viewChanged=!0,d>=S.viewTo)ue&&Ge(h.doc,d)<S.viewTo&&$a(h);else if(x<=S.viewFrom)ue&&ni(h.doc,x+y)>S.viewFrom?$a(h):(S.viewFrom+=y,S.viewTo+=y);else if(d<=S.viewFrom&&x>=S.viewTo)$a(h);else if(d<=S.viewFrom){var E=ps(h,x,x+y,1);E?(S.view=S.view.slice(E.index),S.viewFrom=E.lineN,S.viewTo+=y):$a(h)}else if(x>=S.viewTo){var O=ps(h,d,d,-1);O?(S.view=S.view.slice(0,O.index),S.viewTo=O.lineN):$a(h)}else{var W=ps(h,d,d,-1),H=ps(h,x,x+y,1);W&&H?(S.view=S.view.slice(0,W.index).concat(or(h,W.lineN,H.lineN)).concat(S.view.slice(H.index)),S.viewTo+=y):$a(h)}var nt=S.externalMeasured;nt&&(x<nt.lineN?nt.lineN+=y:d<nt.lineN+nt.size&&(S.externalMeasured=null))}function po(h,d,x){h.curOp.viewChanged=!0;var y=h.display,S=h.display.externalMeasured;if(S&&d>=S.lineN&&d<S.lineN+S.size&&(y.externalMeasured=null),!(d<y.viewFrom||d>=y.viewTo)){var E=y.view[Al(h,d)];if(E.node!=null){var O=E.changes||(E.changes=[]);de(O,x)==-1&&O.push(x)}}}function $a(h){h.display.viewFrom=h.display.viewTo=h.doc.first,h.display.view=[],h.display.viewOffset=0}function ps(h,d,x,y){var S=Al(h,d),E,O=h.display.view;if(!ue||x==h.doc.first+h.doc.size)return{index:S,lineN:x};for(var W=h.display.viewFrom,H=0;H<S;H++)W+=O[H].size;if(W!=d){if(y>0){if(S==O.length-1)return null;E=W+O[S].size-d,S++}else E=W-d;d+=E,x+=E}for(;Ge(h.doc,x)!=x;){if(S==(y<0?0:O.length-1))return null;x+=y*O[S-(y<0?1:0)].size,S+=y}return{index:S,lineN:x}}function sr(h,d,x){var y=h.display,S=y.view;S.length==0||d>=y.viewTo||x<=y.viewFrom?(y.view=or(h,d,x),y.viewFrom=d):(y.viewFrom>d?y.view=or(h,d,y.viewFrom).concat(y.view):y.viewFrom<d&&(y.view=y.view.slice(Al(h,d))),y.viewFrom=d,y.viewTo<x?y.view=y.view.concat(or(h,y.viewTo,x)):y.viewTo>x&&(y.view=y.view.slice(0,Al(h,x)))),y.viewTo=x}function Vs(h){for(var d=h.display.view,x=0,y=0;y<d.length;y++){var S=d[y];!S.hidden&&(!S.node||S.changes)&&++x}return x}function _s(h){h.display.input.showSelection(h.display.input.prepareSelection())}function sa(h,d){d===void 0&&(d=!0);for(var x=h.doc,y={},S=y.cursors=document.createDocumentFragment(),E=y.selection=document.createDocumentFragment(),O=0;O<x.sel.ranges.length;O++)if(!(!d&&O==x.sel.primIndex)){var W=x.sel.ranges[O];if(!(W.from().line>=h.display.viewTo||W.to().line<h.display.viewFrom)){var H=W.empty();(H||h.options.showCursorWhenSelecting)&&mo(h,W.head,S),H||us(h,W,E)}}return y}function mo(h,d,x){var y=Hs(h,d,"div",null,null,!h.options.singleCursorHeightPerLine),S=x.appendChild(_e("div","\xA0","CodeMirror-cursor"));if(S.style.left=y.left+"px",S.style.top=y.top+"px",S.style.height=Math.max(0,y.bottom-y.top)*h.options.cursorHeight+"px",y.other){var E=x.appendChild(_e("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));E.style.display="",E.style.left=y.other.left+"px",E.style.top=y.other.top+"px",E.style.height=(y.other.bottom-y.other.top)*.85+"px"}}function Hl(h,d){return h.top-d.top||h.left-d.left}function us(h,d,x){var y=h.display,S=h.doc,E=document.createDocumentFragment(),O=hu(h.display),W=O.left,H=Math.max(y.sizerWidth,sl(h)-y.sizer.offsetLeft)-O.right,nt=S.direction=="ltr";function Rt(gn,Vn,Hr,bn){Vn<0&&(Vn=0),Vn=Math.round(Vn),bn=Math.round(bn),E.appendChild(_e("div",null,"CodeMirror-selected","position: absolute; left: "+gn+`px;
|
|
|
top: `+Vn+"px; width: "+(Hr==null?H-gn:Hr)+`px;
|
|
|
height: `+(bn-Vn)+"px"))}function pt(gn,Vn,Hr){var bn=yt(S,gn),rs=bn.text.length,xl,Hu;function Ol(Bu,ac){return rc(h,Qt(gn,Bu),"div",bn,ac)}function Rh(Bu,ac,ts){var su=Oc(h,bn,null,Bu),Gs=ac=="ltr"==(ts=="after")?"left":"right",Yl=ts=="after"?su.begin:su.end-(/\s/.test(bn.text.charAt(su.end-1))?2:1);return Ol(Yl,Gs)[Gs]}var xh=rr(bn,S.direction);return ei(xh,Vn||0,Hr==null?rs:Hr,function(Bu,ac,ts,su){var Gs=ts=="ltr",Yl=Ol(Bu,Gs?"left":"right"),Rl=Ol(ac-1,Gs?"right":"left"),Qu=Vn==null&&Bu==0,wh=Hr==null&&ac==rs,_l=su==0,wa=!xh||su==xh.length-1;if(Rl.top-Yl.top<=3){var Jl=(nt?Qu:wh)&&_l,np=(nt?wh:Qu)&&wa,_c=Jl?W:(Gs?Yl:Rl).left,Gh=np?H:(Gs?Rl:Yl).right;Rt(_c,Yl.top,Gh-_c,Yl.bottom)}else{var lh,ba,Vu,au;Gs?(lh=nt&&Qu&&_l?W:Yl.left,ba=nt?H:Rh(Bu,ts,"before"),Vu=nt?W:Rh(ac,ts,"after"),au=nt&&wh&&wa?H:Rl.right):(lh=nt?Rh(Bu,ts,"before"):W,ba=!nt&&Qu&&_l?H:Yl.right,Vu=!nt&&wh&&wa?W:Rl.left,au=nt?Rh(ac,ts,"after"):H),Rt(lh,Yl.top,ba-lh,Yl.bottom),Yl.bottom<Rl.top&&Rt(W,Yl.bottom,null,Rl.top),Rt(Vu,Rl.top,au-Vu,Rl.bottom)}(!xl||Hl(Yl,xl)<0)&&(xl=Yl),Hl(Rl,xl)<0&&(xl=Rl),(!Hu||Hl(Yl,Hu)<0)&&(Hu=Yl),Hl(Rl,Hu)<0&&(Hu=Rl)}),{start:xl,end:Hu}}var oe=d.from(),Jt=d.to();if(oe.line==Jt.line)pt(oe.line,oe.ch,Jt.ch);else{var oi=yt(S,oe.line),mi=yt(S,Jt.line),Ii=ut(oi)==ut(mi),on=pt(oe.line,oe.ch,Ii?oi.text.length+1:null).end,Bn=pt(Jt.line,Ii?0:null,Jt.ch).start;Ii&&(on.top<Bn.top-2?(Rt(on.right,on.top,null,on.bottom),Rt(W,Bn.top,Bn.left,Bn.bottom)):Rt(on.right,on.top,Bn.left-on.right,on.bottom)),on.bottom<Bn.top&&Rt(W,on.bottom,null,Bn.top)}x.appendChild(E)}function qs(h){if(h.state.focused){var d=h.display;clearInterval(d.blinker);var x=!0;d.cursorDiv.style.visibility="",h.options.cursorBlinkRate>0?d.blinker=setInterval(function(){h.hasFocus()||pf(h),d.cursorDiv.style.visibility=(x=!x)?"":"hidden"},h.options.cursorBlinkRate):h.options.cursorBlinkRate<0&&(d.cursorDiv.style.visibility="hidden")}}function aa(h){h.state.focused||(h.display.input.focus(),ms(h))}function Ga(h){h.state.delayingBlurEvent=!0,setTimeout(function(){h.state.delayingBlurEvent&&(h.state.delayingBlurEvent=!1,pf(h))},100)}function ms(h,d){h.state.delayingBlurEvent&&(h.state.delayingBlurEvent=!1),h.options.readOnly!="nocursor"&&(h.state.focused||(yo(h,"focus",h,d),h.state.focused=!0,ki(h.display.wrapper,"CodeMirror-focused"),!h.curOp&&h.display.selForContextMenu!=h.doc.sel&&(h.display.input.reset(),ct&&setTimeout(function(){return h.display.input.reset(!0)},20)),h.display.input.receivedFocus()),qs(h))}function pf(h,d){h.state.delayingBlurEvent||(h.state.focused&&(yo(h,"blur",h,d),h.state.focused=!1,Ot(h.display.wrapper,"CodeMirror-focused")),clearInterval(h.display.blinker),setTimeout(function(){h.state.focused||(h.display.shift=!1)},150))}function Jn(h){for(var d=h.display,x=d.lineDiv.offsetTop,y=0;y<d.view.length;y++){var S=d.view[y],E=h.options.lineWrapping,O=void 0,W=0;if(!S.hidden){if(gt&&ft<8){var H=S.node.offsetTop+S.node.offsetHeight;O=H-x,x=H}else{var nt=S.node.getBoundingClientRect();O=nt.bottom-nt.top,!E&&S.text.firstChild&&(W=S.text.firstChild.getBoundingClientRect().right-nt.left-1)}var Rt=S.line.height-O;if((Rt>.005||Rt<-.005)&&(we(S.line,O),Ad(S.line),S.rest))for(var pt=0;pt<S.rest.length;pt++)Ad(S.rest[pt]);if(W>h.display.sizerWidth){var oe=Math.ceil(W/Su(h.display));oe>h.display.maxLineLength&&(h.display.maxLineLength=oe,h.display.maxLine=S.line,h.display.maxLineChanged=!0)}}}}function Ad(h){if(h.widgets)for(var d=0;d<h.widgets.length;++d){var x=h.widgets[d],y=x.node.parentNode;y&&(x.height=y.offsetHeight)}}function Rr(h,d,x){var y=x&&x.top!=null?Math.max(0,x.top):h.scroller.scrollTop;y=Math.floor(y-uu(h));var S=x&&x.bottom!=null?x.bottom:y+h.wrapper.clientHeight,E=ie(d,y),O=ie(d,S);if(x&&x.ensure){var W=x.ensure.from.line,H=x.ensure.to.line;W<E?(E=W,O=ie(d,An(yt(d,W))+h.wrapper.clientHeight)):Math.min(H,d.lastLine())>=O&&(E=ie(d,An(yt(d,H))-h.wrapper.clientHeight),O=H)}return{from:E,to:Math.max(O,E+1)}}function kc(h,d){if(!Fr(h,"scrollCursorIntoView")){var x=h.display,y=x.sizer.getBoundingClientRect(),S=null;if(d.top+y.top<0?S=!0:d.bottom+y.top>(window.innerHeight||document.documentElement.clientHeight)&&(S=!1),S!=null&&!Fe){var E=_e("div","\u200B",null,`position: absolute;
|
|
|
top: `+(d.top-x.viewOffset-uu(h.display))+`px;
|
|
|
height: `+(d.bottom-d.top+ml(h)+x.barHeight)+`px;
|
|
|
left: `+d.left+"px; width: "+Math.max(2,d.right-d.left)+"px;");h.display.lineSpace.appendChild(E),E.scrollIntoView(S),h.display.lineSpace.removeChild(E)}}}function Ah(h,d,x,y){y==null&&(y=0);var S;!h.options.lineWrapping&&d==x&&(d=d.ch?Qt(d.line,d.sticky=="before"?d.ch-1:d.ch,"after"):d,x=d.sticky=="before"?Qt(d.line,d.ch+1,"before"):d);for(var E=0;E<5;E++){var O=!1,W=Hs(h,d),H=!x||x==d?W:Hs(h,x);S={left:Math.min(W.left,H.left),top:Math.min(W.top,H.top)-y,right:Math.max(W.left,H.left),bottom:Math.max(W.bottom,H.bottom)+y};var nt=Yf(h,S),Rt=h.doc.scrollTop,pt=h.doc.scrollLeft;if(nt.scrollTop!=null&&(oh(h,nt.scrollTop),Math.abs(h.doc.scrollTop-Rt)>1&&(O=!0)),nt.scrollLeft!=null&&(sc(h,nt.scrollLeft),Math.abs(h.doc.scrollLeft-pt)>1&&(O=!0)),!O)break}return S}function Pf(h,d){var x=Yf(h,d);x.scrollTop!=null&&oh(h,x.scrollTop),x.scrollLeft!=null&&sc(h,x.scrollLeft)}function Yf(h,d){var x=h.display,y=Nh(h.display);d.top<0&&(d.top=0);var S=h.curOp&&h.curOp.scrollTop!=null?h.curOp.scrollTop:x.scroller.scrollTop,E=Js(h),O={};d.bottom-d.top>E&&(d.bottom=d.top+E);var W=h.doc.height+_h(x),H=d.top<y,nt=d.bottom>W-y;if(d.top<S)O.scrollTop=H?0:d.top;else if(d.bottom>S+E){var Rt=Math.min(d.top,(nt?W:d.bottom)-E);Rt!=S&&(O.scrollTop=Rt)}var pt=h.options.fixedGutter?0:x.gutters.offsetWidth,oe=h.curOp&&h.curOp.scrollLeft!=null?h.curOp.scrollLeft:x.scroller.scrollLeft-pt,Jt=sl(h)-x.gutters.offsetWidth,oi=d.right-d.left>Jt;return oi&&(d.right=d.left+Jt),d.left<10?O.scrollLeft=0:d.left<oe?O.scrollLeft=Math.max(0,d.left+pt-(oi?0:10)):d.right>Jt+oe-3&&(O.scrollLeft=d.right+(oi?0:10)-Jt),O}function mf(h,d){d!=null&&(oc(h),h.curOp.scrollTop=(h.curOp.scrollTop==null?h.doc.scrollTop:h.curOp.scrollTop)+d)}function Hh(h){oc(h);var d=h.getCursor();h.curOp.scrollToPos={from:d,to:d,margin:h.options.cursorScrollMargin}}function Rc(h,d,x){(d!=null||x!=null)&&oc(h),d!=null&&(h.curOp.scrollLeft=d),x!=null&&(h.curOp.scrollTop=x)}function as(h,d){oc(h),h.curOp.scrollToPos=d}function oc(h){var d=h.curOp.scrollToPos;if(d){h.curOp.scrollToPos=null;var x=Xc(h,d.from),y=Xc(h,d.to);Jf(h,x,y,d.margin)}}function Jf(h,d,x,y){var S=Yf(h,{left:Math.min(d.left,x.left),top:Math.min(d.top,x.top)-y,right:Math.max(d.right,x.right),bottom:Math.max(d.bottom,x.bottom)+y});Rc(h,S.scrollLeft,S.scrollTop)}function oh(h,d){Math.abs(h.doc.scrollTop-d)<2||(Nt||zo(h,{top:d}),dd(h,d,!0),Nt&&zo(h),wr(h,100))}function dd(h,d,x){d=Math.max(0,Math.min(h.display.scroller.scrollHeight-h.display.scroller.clientHeight,d)),!(h.display.scroller.scrollTop==d&&!x)&&(h.doc.scrollTop=d,h.display.scrollbars.setScrollTop(d),h.display.scroller.scrollTop!=d&&(h.display.scroller.scrollTop=d))}function sc(h,d,x,y){d=Math.max(0,Math.min(d,h.display.scroller.scrollWidth-h.display.scroller.clientWidth)),!((x?d==h.doc.scrollLeft:Math.abs(h.doc.scrollLeft-d)<2)&&!y)&&(h.doc.scrollLeft=d,pa(h),h.display.scroller.scrollLeft!=d&&(h.display.scroller.scrollLeft=d),h.display.scrollbars.setScrollLeft(d))}function Mu(h){var d=h.display,x=d.gutters.offsetWidth,y=Math.round(h.doc.height+_h(h.display));return{clientHeight:d.scroller.clientHeight,viewHeight:d.wrapper.clientHeight,scrollWidth:d.scroller.scrollWidth,clientWidth:d.scroller.clientWidth,viewWidth:d.wrapper.clientWidth,barLeft:h.options.fixedGutter?x:0,docHeight:y,scrollHeight:y+ml(h)+d.barHeight,nativeBarWidth:d.nativeBarWidth,gutterWidth:x}}var Ec=function(h,d,x){this.cm=x;var y=this.vert=_e("div",[_e("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),S=this.horiz=_e("div",[_e("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");y.tabIndex=S.tabIndex=-1,h(y),h(S),We(y,"scroll",function(){y.clientHeight&&d(y.scrollTop,"vertical")}),We(S,"scroll",function(){S.clientWidth&&d(S.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,gt&&ft<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ec.prototype.update=function(h){var d=h.scrollWidth>h.clientWidth+1,x=h.scrollHeight>h.clientHeight+1,y=h.nativeBarWidth;if(x){this.vert.style.display="block",this.vert.style.bottom=d?y+"px":"0";var S=h.viewHeight-(d?y:0);this.vert.firstChild.style.height=Math.max(0,h.scrollHeight-h.clientHeight+S)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(d){this.horiz.style.display="block",this.horiz.style.right=x?y+"px":"0",this.horiz.style.left=h.barLeft+"px";var E=h.viewWidth-h.barLeft-(x?y:0);this.horiz.firstChild.style.width=Math.max(0,h.scrollWidth-h.clientWidth+E)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&h.clientHeight>0&&(y==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:x?y:0,bottom:d?y:0}},Ec.prototype.setScrollLeft=function(h){this.horiz.scrollLeft!=h&&(this.horiz.scrollLeft=h),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ec.prototype.setScrollTop=function(h){this.vert.scrollTop!=h&&(this.vert.scrollTop=h),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ec.prototype.zeroWidthHack=function(){var h=Q&&!ne?"12px":"18px";this.horiz.style.height=this.vert.style.width=h,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new tt,this.disableVert=new tt},Ec.prototype.enableZeroWidthBar=function(h,d,x){h.style.pointerEvents="auto";function y(){var S=h.getBoundingClientRect(),E=x=="vert"?document.elementFromPoint(S.right-1,(S.top+S.bottom)/2):document.elementFromPoint((S.right+S.left)/2,S.bottom-1);E!=h?h.style.pointerEvents="none":d.set(1e3,y)}d.set(1e3,y)},Ec.prototype.clear=function(){var h=this.horiz.parentNode;h.removeChild(this.horiz),h.removeChild(this.vert)};var Z=function(){};Z.prototype.update=function(){return{bottom:0,right:0}},Z.prototype.setScrollLeft=function(){},Z.prototype.setScrollTop=function(){},Z.prototype.clear=function(){};function ht(h,d){d||(d=Mu(h));var x=h.display.barWidth,y=h.display.barHeight;wt(h,d);for(var S=0;S<4&&x!=h.display.barWidth||y!=h.display.barHeight;S++)x!=h.display.barWidth&&h.options.lineWrapping&&Jn(h),wt(h,Mu(h)),x=h.display.barWidth,y=h.display.barHeight}function wt(h,d){var x=h.display,y=x.scrollbars.update(d);x.sizer.style.paddingRight=(x.barWidth=y.right)+"px",x.sizer.style.paddingBottom=(x.barHeight=y.bottom)+"px",x.heightForcer.style.borderBottom=y.bottom+"px solid transparent",y.right&&y.bottom?(x.scrollbarFiller.style.display="block",x.scrollbarFiller.style.height=y.bottom+"px",x.scrollbarFiller.style.width=y.right+"px"):x.scrollbarFiller.style.display="",y.bottom&&h.options.coverGutterNextToScrollbar&&h.options.fixedGutter?(x.gutterFiller.style.display="block",x.gutterFiller.style.height=y.bottom+"px",x.gutterFiller.style.width=d.gutterWidth+"px"):x.gutterFiller.style.display=""}var Ft={native:Ec,null:Z};function Ut(h){h.display.scrollbars&&(h.display.scrollbars.clear(),h.display.scrollbars.addClass&&Ot(h.display.wrapper,h.display.scrollbars.addClass)),h.display.scrollbars=new Ft[h.options.scrollbarStyle](function(d){h.display.wrapper.insertBefore(d,h.display.scrollbarFiller),We(d,"mousedown",function(){h.state.focused&&setTimeout(function(){return h.display.input.focus()},0)}),d.setAttribute("cm-not-content","true")},function(d,x){x=="horizontal"?sc(h,d):oh(h,d)},h),h.display.scrollbars.addClass&&ki(h.display.wrapper,h.display.scrollbars.addClass)}var Ie=0;function ke(h){h.curOp={cm:h,viewChanged:!1,startHeight:h.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ie},Fn(h.curOp)}function Ri(h){var d=h.curOp;d&&_r(d,function(x){for(var y=0;y<x.ops.length;y++)x.ops[y].cm.curOp=null;qi(x)})}function qi(h){for(var d=h.ops,x=0;x<d.length;x++)fn(d[x]);for(var y=0;y<d.length;y++)Ar(d[y]);for(var S=0;S<d.length;S++)qn(d[S]);for(var E=0;E<d.length;E++)Dn(d[E]);for(var O=0;O<d.length;O++)$n(d[O])}function fn(h){var d=h.cm,x=d.display;So(d),h.updateMaxLine&&Ur(d),h.mustUpdate=h.viewChanged||h.forceUpdate||h.scrollTop!=null||h.scrollToPos&&(h.scrollToPos.from.line<x.viewFrom||h.scrollToPos.to.line>=x.viewTo)||x.maxLineChanged&&d.options.lineWrapping,h.update=h.mustUpdate&&new Qi(d,h.mustUpdate&&{top:h.scrollTop,ensure:h.scrollToPos},h.forceUpdate)}function Ar(h){h.updatedDisplay=h.mustUpdate&&Ko(h.cm,h.update)}function qn(h){var d=h.cm,x=d.display;h.updatedDisplay&&Jn(d),h.barMeasure=Mu(d),x.maxLineChanged&&!d.options.lineWrapping&&(h.adjustWidthTo=jh(d,x.maxLine,x.maxLine.text.length).left+3,d.display.sizerWidth=h.adjustWidthTo,h.barMeasure.scrollWidth=Math.max(x.scroller.clientWidth,x.sizer.offsetLeft+h.adjustWidthTo+ml(d)+d.display.barWidth),h.maxScrollLeft=Math.max(0,x.sizer.offsetLeft+h.adjustWidthTo-sl(d))),(h.updatedDisplay||h.selectionChanged)&&(h.preparedSelection=x.input.prepareSelection())}function Dn(h){var d=h.cm;h.adjustWidthTo!=null&&(d.display.sizer.style.minWidth=h.adjustWidthTo+"px",h.maxScrollLeft<d.doc.scrollLeft&&sc(d,Math.min(d.display.scroller.scrollLeft,h.maxScrollLeft),!0),d.display.maxLineChanged=!1);var x=h.focus&&h.focus==Ke();h.preparedSelection&&d.display.input.showSelection(h.preparedSelection,x),(h.updatedDisplay||h.startHeight!=d.doc.height)&&ht(d,h.barMeasure),h.updatedDisplay&&ys(d,h.barMeasure),h.selectionChanged&&qs(d),d.state.focused&&h.updateInput&&d.display.input.reset(h.typing),x&&aa(h.cm)}function $n(h){var d=h.cm,x=d.display,y=d.doc;if(h.updatedDisplay&&Zr(d,h.update),x.wheelStartX!=null&&(h.scrollTop!=null||h.scrollLeft!=null||h.scrollToPos)&&(x.wheelStartX=x.wheelStartY=null),h.scrollTop!=null&&dd(d,h.scrollTop,h.forceScroll),h.scrollLeft!=null&&sc(d,h.scrollLeft,!0,!0),h.scrollToPos){var S=Ah(d,Xi(y,h.scrollToPos.from),Xi(y,h.scrollToPos.to),h.scrollToPos.margin);kc(d,S)}var E=h.maybeHiddenMarkers,O=h.maybeUnhiddenMarkers;if(E)for(var W=0;W<E.length;++W)E[W].lines.length||yo(E[W],"hide");if(O)for(var H=0;H<O.length;++H)O[H].lines.length&&yo(O[H],"unhide");x.wrapper.offsetHeight&&(y.scrollTop=d.display.scroller.scrollTop),h.changeObjs&&yo(d,"changes",d,h.changeObjs),h.update&&h.update.finish()}function Di(h,d){if(h.curOp)return d();ke(h);try{return d()}finally{Ri(h)}}function Wn(h,d){return function(){if(h.curOp)return d.apply(h,arguments);ke(h);try{return d.apply(h,arguments)}finally{Ri(h)}}}function Ln(h){return function(){if(this.curOp)return h.apply(this,arguments);ke(this);try{return h.apply(this,arguments)}finally{Ri(this)}}}function cr(h){return function(){var d=this.cm;if(!d||d.curOp)return h.apply(this,arguments);ke(d);try{return h.apply(this,arguments)}finally{Ri(d)}}}function wr(h,d){h.doc.highlightFrontier<h.display.viewTo&&h.state.highlight.set(d,Sr(xn,h))}function xn(h){var d=h.doc;if(!(d.highlightFrontier>=h.display.viewTo)){var x=+new Date+h.options.workTime,y=bo(h,d.highlightFrontier),S=[];d.iter(y.line,Math.min(d.first+d.size,h.display.viewTo+500),function(E){if(y.line>=h.display.viewFrom){var O=E.styles,W=E.text.length>h.options.maxHighlightLength?$t(d.mode,y.state):null,H=os(h,E,y,!0);W&&(y.state=W),E.styles=H.styles;var nt=E.styleClasses,Rt=H.classes;Rt?E.styleClasses=Rt:nt&&(E.styleClasses=null);for(var pt=!O||O.length!=E.styles.length||nt!=Rt&&(!nt||!Rt||nt.bgClass!=Rt.bgClass||nt.textClass!=Rt.textClass),oe=0;!pt&&oe<O.length;++oe)pt=O[oe]!=E.styles[oe];pt&&S.push(y.line),E.stateAfter=y.save(),y.nextLine()}else E.text.length<=h.options.maxHighlightLength&&he(h,E.text,y),E.stateAfter=y.line%5==0?y.save():null,y.nextLine();if(+new Date>x)return wr(h,h.options.workDelay),!0}),d.highlightFrontier=y.line,d.modeFrontier=Math.max(d.modeFrontier,y.line),S.length&&Di(h,function(){for(var E=0;E<S.length;E++)po(h,S[E],"text")})}}var Qi=function(h,d,x){var y=h.display;this.viewport=d,this.visible=Rr(y,h.doc,d),this.editorIsHidden=!y.wrapper.offsetWidth,this.wrapperHeight=y.wrapper.clientHeight,this.wrapperWidth=y.wrapper.clientWidth,this.oldDisplayWidth=sl(h),this.force=x,this.dims=Mc(h),this.events=[]};Qi.prototype.signal=function(h,d){uo(h,d)&&this.events.push(arguments)},Qi.prototype.finish=function(){for(var h=0;h<this.events.length;h++)yo.apply(null,this.events[h])};function So(h){var d=h.display;!d.scrollbarsClipped&&d.scroller.offsetWidth&&(d.nativeBarWidth=d.scroller.offsetWidth-d.scroller.clientWidth,d.heightForcer.style.height=ml(h)+"px",d.sizer.style.marginBottom=-d.nativeBarWidth+"px",d.sizer.style.borderRightWidth=ml(h)+"px",d.scrollbarsClipped=!0)}function jo(h){if(h.hasFocus())return null;var d=Ke();if(!d||!pe(h.display.lineDiv,d))return null;var x={activeElt:d};if(window.getSelection){var y=window.getSelection();y.anchorNode&&y.extend&&pe(h.display.lineDiv,y.anchorNode)&&(x.anchorNode=y.anchorNode,x.anchorOffset=y.anchorOffset,x.focusNode=y.focusNode,x.focusOffset=y.focusOffset)}return x}function go(h){if(!(!h||!h.activeElt||h.activeElt==Ke())&&(h.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(h.activeElt.nodeName)&&h.anchorNode&&pe(document.body,h.anchorNode)&&pe(document.body,h.focusNode))){var d=window.getSelection(),x=document.createRange();x.setEnd(h.anchorNode,h.anchorOffset),x.collapse(!1),d.removeAllRanges(),d.addRange(x),d.extend(h.focusNode,h.focusOffset)}}function Ko(h,d){var x=h.display,y=h.doc;if(d.editorIsHidden)return $a(h),!1;if(!d.force&&d.visible.from>=x.viewFrom&&d.visible.to<=x.viewTo&&(x.updateLineNumbers==null||x.updateLineNumbers>=x.viewTo)&&x.renderedView==x.view&&Vs(h)==0)return!1;Cr(h)&&($a(h),d.dims=Mc(h));var S=y.first+y.size,E=Math.max(d.visible.from-h.options.viewportMargin,y.first),O=Math.min(S,d.visible.to+h.options.viewportMargin);x.viewFrom<E&&E-x.viewFrom<20&&(E=Math.max(y.first,x.viewFrom)),x.viewTo>O&&x.viewTo-O<20&&(O=Math.min(S,x.viewTo)),ue&&(E=Ge(h.doc,E),O=ni(h.doc,O));var W=E!=x.viewFrom||O!=x.viewTo||x.lastWrapHeight!=d.wrapperHeight||x.lastWrapWidth!=d.wrapperWidth;sr(h,E,O),x.viewOffset=An(yt(h.doc,x.viewFrom)),h.display.mover.style.top=x.viewOffset+"px";var H=Vs(h);if(!W&&H==0&&!d.force&&x.renderedView==x.view&&(x.updateLineNumbers==null||x.updateLineNumbers>=x.viewTo))return!1;var nt=jo(h);return H>4&&(x.lineDiv.style.display="none"),da(h,x.updateLineNumbers,d.dims),H>4&&(x.lineDiv.style.display=""),x.renderedView=x.view,go(nt),qt(x.cursorDiv),qt(x.selectionDiv),x.gutters.style.height=x.sizer.style.minHeight=0,W&&(x.lastWrapHeight=d.wrapperHeight,x.lastWrapWidth=d.wrapperWidth,wr(h,400)),x.updateLineNumbers=null,!0}function Zr(h,d){for(var x=d.viewport,y=!0;;y=!1){if(!y||!h.options.lineWrapping||d.oldDisplayWidth==sl(h)){if(x&&x.top!=null&&(x={top:Math.min(h.doc.height+_h(h.display)-Js(h),x.top)}),d.visible=Rr(h.display,h.doc,x),d.visible.from>=h.display.viewFrom&&d.visible.to<=h.display.viewTo)break}else y&&(d.visible=Rr(h.display,h.doc,x));if(!Ko(h,d))break;Jn(h);var S=Mu(h);_s(h),ht(h,S),ys(h,S),d.force=!1}d.signal(h,"update",h),(h.display.viewFrom!=h.display.reportedViewFrom||h.display.viewTo!=h.display.reportedViewTo)&&(d.signal(h,"viewportChange",h,h.display.viewFrom,h.display.viewTo),h.display.reportedViewFrom=h.display.viewFrom,h.display.reportedViewTo=h.display.viewTo)}function zo(h,d){var x=new Qi(h,d);if(Ko(h,x)){Jn(h),Zr(h,x);var y=Mu(h);_s(h),ht(h,y),ys(h,y),x.finish()}}function da(h,d,x){var y=h.display,S=h.options.lineNumbers,E=y.lineDiv,O=E.firstChild;function W(oi){var mi=oi.nextSibling;return ct&&Q&&h.display.currentWheelTarget==oi?oi.style.display="none":oi.parentNode.removeChild(oi),mi}for(var H=y.view,nt=y.viewFrom,Rt=0;Rt<H.length;Rt++){var pt=H[Rt];if(!pt.hidden)if(!pt.node||pt.node.parentNode!=E){var oe=Ll(h,pt,nt,x);E.insertBefore(oe,O)}else{for(;O!=pt.node;)O=W(O);var Jt=S&&d!=null&&d<=nt&&pt.lineNumber;pt.changes&&(de(pt.changes,"gutter")>-1&&(Jt=!1),El(h,pt,nt,x)),Jt&&(qt(pt.lineNumber),pt.lineNumber.appendChild(document.createTextNode(_i(h.options,nt)))),O=pt.node.nextSibling}nt+=pt.size}for(;O;)O=W(O)}function Cs(h){var d=h.gutters.offsetWidth;h.sizer.style.marginLeft=d+"px"}function ys(h,d){h.display.sizer.style.minHeight=d.docHeight+"px",h.display.heightForcer.style.top=d.docHeight+"px",h.display.gutters.style.height=d.docHeight+h.display.barHeight+ml(h)+"px"}function pa(h){var d=h.display,x=d.view;if(!(!d.alignWidgets&&(!d.gutters.firstChild||!h.options.fixedGutter))){for(var y=Cc(d)-d.scroller.scrollLeft+h.doc.scrollLeft,S=d.gutters.offsetWidth,E=y+"px",O=0;O<x.length;O++)if(!x[O].hidden){h.options.fixedGutter&&(x[O].gutter&&(x[O].gutter.style.left=E),x[O].gutterBackground&&(x[O].gutterBackground.style.left=E));var W=x[O].alignable;if(W)for(var H=0;H<W.length;H++)W[H].style.left=E}h.options.fixedGutter&&(d.gutters.style.left=y+S+"px")}}function Cr(h){if(!h.options.lineNumbers)return!1;var d=h.doc,x=_i(h.options,d.first+d.size-1),y=h.display;if(x.length!=y.lineNumChars){var S=y.measure.appendChild(_e("div",[_e("div",x)],"CodeMirror-linenumber CodeMirror-gutter-elt")),E=S.firstChild.offsetWidth,O=S.offsetWidth-E;return y.lineGutter.style.width="",y.lineNumInnerWidth=Math.max(E,y.lineGutter.offsetWidth-O)+1,y.lineNumWidth=y.lineNumInnerWidth+O,y.lineNumChars=y.lineNumInnerWidth?x.length:-1,y.lineGutter.style.width=y.lineNumWidth+"px",Cs(h.display),!0}return!1}function Qr(h,d){for(var x=[],y=!1,S=0;S<h.length;S++){var E=h[S],O=null;if(typeof E!="string"&&(O=E.style,E=E.className),E=="CodeMirror-linenumbers")if(d)y=!0;else continue;x.push({className:E,style:O})}return d&&!y&&x.push({className:"CodeMirror-linenumbers",style:null}),x}function io(h){var d=h.gutters,x=h.gutterSpecs;qt(d),h.lineGutter=null;for(var y=0;y<x.length;++y){var S=x[y],E=S.className,O=S.style,W=d.appendChild(_e("div",null,"CodeMirror-gutter "+E));O&&(W.style.cssText=O),E=="CodeMirror-linenumbers"&&(h.lineGutter=W,W.style.width=(h.lineNumWidth||1)+"px")}d.style.display=x.length?"":"none",Cs(h)}function Ps(h){io(h.display),oa(h),pa(h)}function xs(h,d,x,y){var S=this;this.input=x,S.scrollbarFiller=_e("div",null,"CodeMirror-scrollbar-filler"),S.scrollbarFiller.setAttribute("cm-not-content","true"),S.gutterFiller=_e("div",null,"CodeMirror-gutter-filler"),S.gutterFiller.setAttribute("cm-not-content","true"),S.lineDiv=fi("div",null,"CodeMirror-code"),S.selectionDiv=_e("div",null,null,"position: relative; z-index: 1"),S.cursorDiv=_e("div",null,"CodeMirror-cursors"),S.measure=_e("div",null,"CodeMirror-measure"),S.lineMeasure=_e("div",null,"CodeMirror-measure"),S.lineSpace=fi("div",[S.measure,S.lineMeasure,S.selectionDiv,S.cursorDiv,S.lineDiv],null,"position: relative; outline: none");var E=fi("div",[S.lineSpace],"CodeMirror-lines");S.mover=_e("div",[E],null,"position: relative"),S.sizer=_e("div",[S.mover],"CodeMirror-sizer"),S.sizerWidth=null,S.heightForcer=_e("div",null,null,"position: absolute; height: "+hi+"px; width: 1px;"),S.gutters=_e("div",null,"CodeMirror-gutters"),S.lineGutter=null,S.scroller=_e("div",[S.sizer,S.heightForcer,S.gutters],"CodeMirror-scroll"),S.scroller.setAttribute("tabIndex","-1"),S.wrapper=_e("div",[S.scrollbarFiller,S.gutterFiller,S.scroller],"CodeMirror"),gt&&ft<8&&(S.gutters.style.zIndex=-1,S.scroller.style.paddingRight=0),!ct&&!(Nt&&zt)&&(S.scroller.draggable=!0),h&&(h.appendChild?h.appendChild(S.wrapper):h(S.wrapper)),S.viewFrom=S.viewTo=d.first,S.reportedViewFrom=S.reportedViewTo=d.first,S.view=[],S.renderedView=null,S.externalMeasured=null,S.viewOffset=0,S.lastWrapHeight=S.lastWrapWidth=0,S.updateLineNumbers=null,S.nativeBarWidth=S.barHeight=S.barWidth=0,S.scrollbarsClipped=!1,S.lineNumWidth=S.lineNumInnerWidth=S.lineNumChars=null,S.alignWidgets=!1,S.cachedCharWidth=S.cachedTextHeight=S.cachedPaddingH=null,S.maxLine=null,S.maxLineLength=0,S.maxLineChanged=!1,S.wheelDX=S.wheelDY=S.wheelStartX=S.wheelStartY=null,S.shift=!1,S.selForContextMenu=null,S.activeTouch=null,S.gutterSpecs=Qr(y.gutters,y.lineNumbers),io(S),x.init(S)}var Ns=0,gs=null;gt?gs=-.53:Nt?gs=15:F?gs=-.7:ee&&(gs=-1/3);function la(h){var d=h.wheelDeltaX,x=h.wheelDeltaY;return d==null&&h.detail&&h.axis==h.HORIZONTAL_AXIS&&(d=h.detail),x==null&&h.detail&&h.axis==h.VERTICAL_AXIS?x=h.detail:x==null&&(x=h.wheelDelta),{x:d,y:x}}function Da(h){var d=la(h);return d.x*=gs,d.y*=gs,d}function Ks(h,d){var x=la(d),y=x.x,S=x.y,E=h.display,O=E.scroller,W=O.scrollWidth>O.clientWidth,H=O.scrollHeight>O.clientHeight;if(y&&W||S&&H){if(S&&Q&&ct){t:for(var nt=d.target,Rt=E.view;nt!=O;nt=nt.parentNode)for(var pt=0;pt<Rt.length;pt++)if(Rt[pt].node==nt){h.display.currentWheelTarget=nt;break t}}if(y&&!Nt&&!Y&&gs!=null){S&&H&&oh(h,Math.max(0,O.scrollTop+S*gs)),sc(h,Math.max(0,O.scrollLeft+y*gs)),(!S||S&&H)&&fs(d),E.wheelStartX=null;return}if(S&&gs!=null){var oe=S*gs,Jt=h.doc.scrollTop,oi=Jt+E.wrapper.clientHeight;oe<0?Jt=Math.max(0,Jt+oe-50):oi=Math.min(h.doc.height,oi+oe+50),zo(h,{top:Jt,bottom:oi})}Ns<20&&(E.wheelStartX==null?(E.wheelStartX=O.scrollLeft,E.wheelStartY=O.scrollTop,E.wheelDX=y,E.wheelDY=S,setTimeout(function(){if(E.wheelStartX!=null){var mi=O.scrollLeft-E.wheelStartX,Ii=O.scrollTop-E.wheelStartY,on=Ii&&E.wheelDY&&Ii/E.wheelDY||mi&&E.wheelDX&&mi/E.wheelDX;E.wheelStartX=E.wheelStartY=null,on&&(gs=(gs*Ns+on)/(Ns+1),++Ns)}},200)):(E.wheelDX+=y,E.wheelDY+=S))}}var va=function(h,d){this.ranges=h,this.primIndex=d};va.prototype.primary=function(){return this.ranges[this.primIndex]},va.prototype.equals=function(h){if(h==this)return!0;if(h.primIndex!=this.primIndex||h.ranges.length!=this.ranges.length)return!1;for(var d=0;d<this.ranges.length;d++){var x=this.ranges[d],y=h.ranges[d];if(!vr(x.anchor,y.anchor)||!vr(x.head,y.head))return!1}return!0},va.prototype.deepCopy=function(){for(var h=[],d=0;d<this.ranges.length;d++)h[d]=new oo(Mr(this.ranges[d].anchor),Mr(this.ranges[d].head));return new va(h,this.primIndex)},va.prototype.somethingSelected=function(){for(var h=0;h<this.ranges.length;h++)if(!this.ranges[h].empty())return!0;return!1},va.prototype.contains=function(h,d){d||(d=h);for(var x=0;x<this.ranges.length;x++){var y=this.ranges[x];if(ui(d,y.from())>=0&&ui(h,y.to())<=0)return x}return-1};var oo=function(h,d){this.anchor=h,this.head=d};oo.prototype.from=function(){return gi(this.anchor,this.head)},oo.prototype.to=function(){return Lr(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function vs(h,d,x){var y=h&&h.options.selectionsMayTouch,S=d[x];d.sort(function(oe,Jt){return ui(oe.from(),Jt.from())}),x=de(d,S);for(var E=1;E<d.length;E++){var O=d[E],W=d[E-1],H=ui(W.to(),O.from());if(y&&!O.empty()?H>0:H>=0){var nt=gi(W.from(),O.from()),Rt=Lr(W.to(),O.to()),pt=W.empty()?O.from()==O.head:W.from()==W.head;E<=x&&--x,d.splice(--E,2,new oo(pt?Rt:nt,pt?nt:Rt))}}return new va(d,x)}function ks(h,d){return new va([new oo(h,d||h)],0)}function Ia(h){return h.text?Qt(h.from.line+h.text.length-1,ai(h.text).length+(h.text.length==1?h.from.ch:0)):h.to}function ll(h,d){if(ui(h,d.from)<0)return h;if(ui(h,d.to)<=0)return Ia(d);var x=h.line+d.text.length-(d.to.line-d.from.line)-1,y=h.ch;return h.line==d.to.line&&(y+=Ia(d).ch-d.to.ch),Qt(x,y)}function ja(h,d){for(var x=[],y=0;y<h.sel.ranges.length;y++){var S=h.sel.ranges[y];x.push(new oo(ll(S.anchor,d),ll(S.head,d)))}return vs(h.cm,x,h.sel.primIndex)}function Oa(h,d,x){return h.line==d.line?Qt(x.line,h.ch-d.ch+x.ch):Qt(x.line+(h.line-d.line),h.ch)}function Qa(h,d,x){for(var y=[],S=Qt(h.first,0),E=S,O=0;O<d.length;O++){var W=d[O],H=Oa(W.from,S,E),nt=Oa(Ia(W),S,E);if(S=W.to,E=nt,x=="around"){var Rt=h.sel.ranges[O],pt=ui(Rt.head,Rt.anchor)<0;y[O]=new oo(pt?nt:H,pt?H:nt)}else y[O]=new oo(H,H)}return new va(y,h.sel.primIndex)}function mr(h){h.doc.mode=ro(h.options,h.doc.modeOption),Dl(h)}function Dl(h){h.doc.iter(function(d){d.stateAfter&&(d.stateAfter=null),d.styles&&(d.styles=null)}),h.doc.modeFrontier=h.doc.highlightFrontier=h.doc.first,wr(h,100),h.state.modeGen++,h.curOp&&oa(h)}function ul(h,d){return d.from.ch==0&&d.to.ch==0&&ai(d.text)==""&&(!h.cm||h.cm.options.wholeLineUpdateBefore)}function Cu(h,d,x,y){function S(Bn){return x?x[Bn]:null}function E(Bn,gn,Vn){ko(Bn,gn,Vn,y),Ai(Bn,"change",Bn,d)}function O(Bn,gn){for(var Vn=[],Hr=Bn;Hr<gn;++Hr)Vn.push(new Zn(nt[Hr],S(Hr),y));return Vn}var W=d.from,H=d.to,nt=d.text,Rt=yt(h,W.line),pt=yt(h,H.line),oe=ai(nt),Jt=S(nt.length-1),oi=H.line-W.line;if(d.full)h.insert(0,O(0,nt.length)),h.remove(nt.length,h.size-nt.length);else if(ul(h,d)){var mi=O(0,nt.length-1);E(pt,pt.text,Jt),oi&&h.remove(W.line,oi),mi.length&&h.insert(W.line,mi)}else if(Rt==pt)if(nt.length==1)E(Rt,Rt.text.slice(0,W.ch)+oe+Rt.text.slice(H.ch),Jt);else{var Ii=O(1,nt.length-1);Ii.push(new Zn(oe+Rt.text.slice(H.ch),Jt,y)),E(Rt,Rt.text.slice(0,W.ch)+nt[0],S(0)),h.insert(W.line+1,Ii)}else if(nt.length==1)E(Rt,Rt.text.slice(0,W.ch)+nt[0]+pt.text.slice(H.ch),S(0)),h.remove(W.line+1,oi);else{E(Rt,Rt.text.slice(0,W.ch)+nt[0],S(0)),E(pt,oe+pt.text.slice(H.ch),Jt);var on=O(1,nt.length-1);oi>1&&h.remove(W.line+1,oi-1),h.insert(W.line+1,on)}Ai(h,"change",h,d)}function To(h,d,x){function y(S,E,O){if(S.linked)for(var W=0;W<S.linked.length;++W){var H=S.linked[W];if(H.doc!=E){var nt=O&&H.sharedHist;x&&!nt||(d(H.doc,nt),y(H.doc,S,nt))}}}y(h,null,!0)}function Au(h,d){if(d.cm)throw new Error("This document is already in use.");h.doc=d,d.cm=h,zn(h),mr(h),Ml(h),h.options.lineWrapping||Ur(h),h.options.mode=d.modeOption,oa(h)}function Ml(h){(h.doc.direction=="rtl"?ki:Ot)(h.display.lineDiv,"CodeMirror-rtl")}function du(h){Di(h,function(){Ml(h),oa(h)})}function pu(h){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=h||1}function yl(h,d){var x={from:Mr(d.from),to:Ia(d),text:me(h,d.from,d.to)};return Il(h,x,d.from.line,d.to.line+1),To(h,function(y){return Il(y,x,d.from.line,d.to.line+1)},!0),x}function Xu(h){for(;h.length;){var d=ai(h);if(d.ranges)h.pop();else break}}function ru(h,d){if(d)return Xu(h.done),ai(h.done);if(h.done.length&&!ai(h.done).ranges)return ai(h.done);if(h.done.length>1&&!h.done[h.done.length-2].ranges)return h.done.pop(),ai(h.done)}function ya(h,d,x,y){var S=h.history;S.undone.length=0;var E=+new Date,O,W;if((S.lastOp==y||S.lastOrigin==d.origin&&d.origin&&(d.origin.charAt(0)=="+"&&S.lastModTime>E-(h.cm?h.cm.options.historyEventDelay:500)||d.origin.charAt(0)=="*"))&&(O=ru(S,S.lastOp==y)))W=ai(O.changes),ui(d.from,d.to)==0&&ui(d.from,W.to)==0?W.to=Ia(d):O.changes.push(yl(h,d));else{var H=ai(S.done);for((!H||!H.ranges)&&Qs(h.sel,S.done),O={changes:[yl(h,d)],generation:S.generation},S.done.push(O);S.done.length>S.undoDepth;)S.done.shift(),S.done[0].ranges||S.done.shift()}S.done.push(x),S.generation=++S.maxGeneration,S.lastModTime=S.lastSelTime=E,S.lastOp=S.lastSelOp=y,S.lastOrigin=S.lastSelOrigin=d.origin,W||yo(h,"historyAdded")}function ju(h,d,x,y){var S=d.charAt(0);return S=="*"||S=="+"&&x.ranges.length==y.ranges.length&&x.somethingSelected()==y.somethingSelected()&&new Date-h.history.lastSelTime<=(h.cm?h.cm.options.historyEventDelay:500)}function hl(h,d,x,y){var S=h.history,E=y&&y.origin;x==S.lastSelOp||E&&S.lastSelOrigin==E&&(S.lastModTime==S.lastSelTime&&S.lastOrigin==E||ju(h,E,ai(S.done),d))?S.done[S.done.length-1]=d:Qs(d,S.done),S.lastSelTime=+new Date,S.lastSelOrigin=E,S.lastSelOp=x,y&&y.clearRedo!==!1&&Xu(S.undone)}function Qs(h,d){var x=ai(d);x&&x.ranges&&x.equals(h)||d.push(h)}function Il(h,d,x,y){var S=d["spans_"+h.id],E=0;h.iter(Math.max(h.first,x),Math.min(h.first+h.size,y),function(O){O.markedSpans&&((S||(S=d["spans_"+h.id]={}))[E]=O.markedSpans),++E})}function Es(h){if(!h)return null;for(var d,x=0;x<h.length;++x)h[x].marker.explicitlyCleared?d||(d=h.slice(0,x)):d&&d.push(h[x]);return d?d.length?d:null:h}function R(h,d){var x=d["spans_"+h.id];if(!x)return null;for(var y=[],S=0;S<d.text.length;++S)y.push(Es(x[S]));return y}function V(h,d){var x=R(h,d),y=fo(h,d);if(!x)return y;if(!y)return x;for(var S=0;S<x.length;++S){var E=x[S],O=y[S];if(E&&O)t:for(var W=0;W<O.length;++W){for(var H=O[W],nt=0;nt<E.length;++nt)if(E[nt].marker==H.marker)continue t;E.push(H)}else O&&(x[S]=O)}return x}function at(h,d,x){for(var y=[],S=0;S<h.length;++S){var E=h[S];if(E.ranges){y.push(x?va.prototype.deepCopy.call(E):E);continue}var O=E.changes,W=[];y.push({changes:W});for(var H=0;H<O.length;++H){var nt=O[H],Rt=void 0;if(W.push({from:nt.from,to:nt.to,text:nt.text}),d)for(var pt in nt)(Rt=pt.match(/^spans_(\d+)$/))&&de(d,Number(Rt[1]))>-1&&(ai(W)[pt]=nt[pt],delete nt[pt])}}return y}function dt(h,d,x,y){if(y){var S=h.anchor;if(x){var E=ui(d,S)<0;E!=ui(x,S)<0?(S=d,d=x):E!=ui(d,x)<0&&(d=x)}return new oo(S,d)}else return new oo(x||d,d)}function Dt(h,d,x,y,S){S==null&&(S=h.cm&&(h.cm.display.shift||h.extend)),Qe(h,new va([dt(h.sel.primary(),d,x,S)],0),y)}function _t(h,d,x){for(var y=[],S=h.cm&&(h.cm.display.shift||h.extend),E=0;E<h.sel.ranges.length;E++)y[E]=dt(h.sel.ranges[E],d[E],null,S);var O=vs(h.cm,y,h.sel.primIndex);Qe(h,O,x)}function Xt(h,d,x,y){var S=h.sel.ranges.slice(0);S[d]=x,Qe(h,vs(h.cm,S,h.sel.primIndex),y)}function Ne(h,d,x,y){Qe(h,ks(d,x),y)}function Xe(h,d,x){var y={ranges:d.ranges,update:function(S){this.ranges=[];for(var E=0;E<S.length;E++)this.ranges[E]=new oo(Xi(h,S[E].anchor),Xi(h,S[E].head))},origin:x&&x.origin};return yo(h,"beforeSelectionChange",h,y),h.cm&&yo(h.cm,"beforeSelectionChange",h.cm,y),y.ranges!=d.ranges?vs(h.cm,y.ranges,y.ranges.length-1):d}function ze(h,d,x){var y=h.history.done,S=ai(y);S&&S.ranges?(y[y.length-1]=d,Be(h,d,x)):Qe(h,d,x)}function Qe(h,d,x){Be(h,d,x),hl(h,h.sel,h.cm?h.cm.curOp.id:NaN,x)}function Be(h,d,x){(uo(h,"beforeSelectionChange")||h.cm&&uo(h.cm,"beforeSelectionChange"))&&(d=Xe(h,d,x));var y=x&&x.bias||(ui(d.primary().head,h.sel.primary().head)<0?-1:1);xi(h,wi(h,d,y,!0)),!(x&&x.scroll===!1)&&h.cm&&Hh(h.cm)}function xi(h,d){d.equals(h.sel)||(h.sel=d,h.cm&&(h.cm.curOp.updateInput=1,h.cm.curOp.selectionChanged=!0,Ro(h.cm)),Ai(h,"cursorActivity",h))}function Oe(h){xi(h,wi(h,h.sel,null,!1))}function wi(h,d,x,y){for(var S,E=0;E<d.ranges.length;E++){var O=d.ranges[E],W=d.ranges.length==h.sel.ranges.length&&h.sel.ranges[E],H=Mi(h,O.anchor,W&&W.anchor,x,y),nt=Mi(h,O.head,W&&W.head,x,y);(S||H!=O.anchor||nt!=O.head)&&(S||(S=d.ranges.slice(0,E)),S[E]=new oo(H,nt))}return S?vs(h.cm,S,d.primIndex):d}function ri(h,d,x,y,S){var E=yt(h,d.line);if(E.markedSpans)for(var O=0;O<E.markedSpans.length;++O){var W=E.markedSpans[O],H=W.marker,nt="selectLeft"in H?!H.selectLeft:H.inclusiveLeft,Rt="selectRight"in H?!H.selectRight:H.inclusiveRight;if((W.from==null||(nt?W.from<=d.ch:W.from<d.ch))&&(W.to==null||(Rt?W.to>=d.ch:W.to>d.ch))){if(S&&(yo(H,"beforeCursorEnter"),H.explicitlyCleared))if(E.markedSpans){--O;continue}else break;if(!H.atomic)continue;if(x){var pt=H.find(y<0?1:-1),oe=void 0;if((y<0?Rt:nt)&&(pt=Bi(h,pt,-y,pt&&pt.line==d.line?E:null)),pt&&pt.line==d.line&&(oe=ui(pt,x))&&(y<0?oe<0:oe>0))return ri(h,pt,d,y,S)}var Jt=H.find(y<0?-1:1);return(y<0?nt:Rt)&&(Jt=Bi(h,Jt,y,Jt.line==d.line?E:null)),Jt?ri(h,Jt,d,y,S):null}}return d}function Mi(h,d,x,y,S){var E=y||1,O=ri(h,d,x,E,S)||!S&&ri(h,d,x,E,!0)||ri(h,d,x,-E,S)||!S&&ri(h,d,x,-E,!0);return O||(h.cantEdit=!0,Qt(h.first,0))}function Bi(h,d,x,y){return x<0&&d.ch==0?d.line>h.first?Xi(h,Qt(d.line-1)):null:x>0&&d.ch==(y||yt(h,d.line)).text.length?d.line<h.first+h.size-1?Qt(d.line+1,0):null:new Qt(d.line,d.ch+x)}function Li(h){h.setSelection(Qt(h.firstLine(),0),Qt(h.lastLine()),Ye)}function Ni(h,d,x){var y={canceled:!1,from:d.from,to:d.to,text:d.text,origin:d.origin,cancel:function(){return y.canceled=!0}};return x&&(y.update=function(S,E,O,W){S&&(y.from=Xi(h,S)),E&&(y.to=Xi(h,E)),O&&(y.text=O),W!==void 0&&(y.origin=W)}),yo(h,"beforeChange",h,y),h.cm&&yo(h.cm,"beforeChange",h.cm,y),y.canceled?(h.cm&&(h.cm.curOp.updateInput=2),null):{from:y.from,to:y.to,text:y.text,origin:y.origin}}function Hi(h,d,x){if(h.cm){if(!h.cm.curOp)return Wn(h.cm,Hi)(h,d,x);if(h.cm.state.suppressEdits)return}if(!((uo(h,"beforeChange")||h.cm&&uo(h.cm,"beforeChange"))&&(d=Ni(h,d,!0),!d))){var y=dr&&!x&&Xo(h,d.from,d.to);if(y)for(var S=y.length-1;S>=0;--S)Gn(h,{from:y[S].from,to:y[S].to,text:S?[""]:d.text,origin:d.origin});else Gn(h,d)}}function Gn(h,d){if(!(d.text.length==1&&d.text[0]==""&&ui(d.from,d.to)==0)){var x=ja(h,d);ya(h,d,x,h.cm?h.cm.curOp.id:NaN),Qn(h,d,x,fo(h,d));var y=[];To(h,function(S,E){!E&&de(y,S.history)==-1&&(Kr(S.history,d),y.push(S.history)),Qn(S,d,null,fo(S,d))})}}function cn(h,d,x){var y=h.cm&&h.cm.state.suppressEdits;if(!(y&&!x)){for(var S=h.history,E,O=h.sel,W=d=="undo"?S.done:S.undone,H=d=="undo"?S.undone:S.done,nt=0;nt<W.length&&(E=W[nt],!(x?E.ranges&&!E.equals(h.sel):!E.ranges));nt++);if(nt!=W.length){for(S.lastOrigin=S.lastSelOrigin=null;;)if(E=W.pop(),E.ranges){if(Qs(E,H),x&&!E.equals(h.sel)){Qe(h,E,{clearRedo:!1});return}O=E}else if(y){W.push(E);return}else break;var Rt=[];Qs(O,H),H.push({changes:Rt,generation:S.generation}),S.generation=E.generation||++S.maxGeneration;for(var pt=uo(h,"beforeChange")||h.cm&&uo(h.cm,"beforeChange"),oe=function(mi){var Ii=E.changes[mi];if(Ii.origin=d,pt&&!Ni(h,Ii,!1))return W.length=0,{};Rt.push(yl(h,Ii));var on=mi?ja(h,Ii):ai(W);Qn(h,Ii,on,V(h,Ii)),!mi&&h.cm&&h.cm.scrollIntoView({from:Ii.from,to:Ia(Ii)});var Bn=[];To(h,function(gn,Vn){!Vn&&de(Bn,gn.history)==-1&&(Kr(gn.history,Ii),Bn.push(gn.history)),Qn(gn,Ii,null,V(gn,Ii))})},Jt=E.changes.length-1;Jt>=0;--Jt){var oi=oe(Jt);if(oi)return oi.v}}}}function ir(h,d){if(d!=0&&(h.first+=d,h.sel=new va(zi(h.sel.ranges,function(S){return new oo(Qt(S.anchor.line+d,S.anchor.ch),Qt(S.head.line+d,S.head.ch))}),h.sel.primIndex),h.cm)){oa(h.cm,h.first,h.first-d,d);for(var x=h.cm.display,y=x.viewFrom;y<x.viewTo;y++)po(h.cm,y,"gutter")}}function Qn(h,d,x,y){if(h.cm&&!h.cm.curOp)return Wn(h.cm,Qn)(h,d,x,y);if(d.to.line<h.first){ir(h,d.text.length-1-(d.to.line-d.from.line));return}if(!(d.from.line>h.lastLine())){if(d.from.line<h.first){var S=d.text.length-1-(h.first-d.from.line);ir(h,S),d={from:Qt(h.first,0),to:Qt(d.to.line+S,d.to.ch),text:[ai(d.text)],origin:d.origin}}var E=h.lastLine();d.to.line>E&&(d={from:d.from,to:Qt(E,yt(h,E).text.length),text:[d.text[0]],origin:d.origin}),d.removed=me(h,d.from,d.to),x||(x=ja(h,d)),h.cm?Xr(h.cm,d,y):Cu(h,d,y),Be(h,x,Ye),h.cantEdit&&Mi(h,Qt(h.firstLine(),0))&&(h.cantEdit=!1)}}function Xr(h,d,x){var y=h.doc,S=h.display,E=d.from,O=d.to,W=!1,H=E.line;h.options.lineWrapping||(H=Mt(ut(yt(y,E.line))),y.iter(H,O.line+1,function(Jt){if(Jt==S.maxLine)return W=!0,!0})),y.sel.contains(d.from,d.to)>-1&&Ro(h),Cu(y,d,x,fa(h)),h.options.lineWrapping||(y.iter(H,E.line+d.text.length,function(Jt){var oi=xr(Jt);oi>S.maxLineLength&&(S.maxLine=Jt,S.maxLineLength=oi,S.maxLineChanged=!0,W=!1)}),W&&(h.curOp.updateMaxLine=!0)),$r(y,E.line),wr(h,400);var nt=d.text.length-(O.line-E.line)-1;d.full?oa(h):E.line==O.line&&d.text.length==1&&!ul(h.doc,d)?po(h,E.line,"text"):oa(h,E.line,O.line+1,nt);var Rt=uo(h,"changes"),pt=uo(h,"change");if(pt||Rt){var oe={from:E,to:O,text:d.text,removed:d.removed,origin:d.origin};pt&&Ai(h,"change",h,oe),Rt&&(h.curOp.changeObjs||(h.curOp.changeObjs=[])).push(oe)}h.display.selForContextMenu=null}function In(h,d,x,y,S){var E;y||(y=x),ui(y,x)<0&&(E=[y,x],x=E[0],y=E[1]),typeof d=="string"&&(d=h.splitLines(d)),Hi(h,{from:x,to:y,text:d,origin:S})}function nn(h,d,x,y){x<h.line?h.line+=y:d<h.line&&(h.line=d,h.ch=0)}function vo(h,d,x,y){for(var S=0;S<h.length;++S){var E=h[S],O=!0;if(E.ranges){E.copied||(E=h[S]=E.deepCopy(),E.copied=!0);for(var W=0;W<E.ranges.length;W++)nn(E.ranges[W].anchor,d,x,y),nn(E.ranges[W].head,d,x,y);continue}for(var H=0;H<E.changes.length;++H){var nt=E.changes[H];if(x<nt.from.line)nt.from=Qt(nt.from.line+y,nt.from.ch),nt.to=Qt(nt.to.line+y,nt.to.ch);else if(d<=nt.to.line){O=!1;break}}O||(h.splice(0,S+1),S=0)}}function Kr(h,d){var x=d.from.line,y=d.to.line,S=d.text.length-(y-x)-1;vo(h.done,x,y,S),vo(h.undone,x,y,S)}function gr(h,d,x,y){var S=d,E=d;return typeof d=="number"?E=yt(h,Ji(h,d)):S=Mt(d),S==null?null:(y(E,S)&&h.cm&&po(h.cm,S,x),E)}function kn(h){this.lines=h,this.parent=null;for(var d=0,x=0;x<h.length;++x)h[x].parent=this,d+=h[x].height;this.height=d}kn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(h,d){for(var x=h,y=h+d;x<y;++x){var S=this.lines[x];this.height-=S.height,Yo(S),Ai(S,"delete")}this.lines.splice(h,d)},collapse:function(h){h.push.apply(h,this.lines)},insertInner:function(h,d,x){this.height+=x,this.lines=this.lines.slice(0,h).concat(d).concat(this.lines.slice(h));for(var y=0;y<d.length;++y)d[y].parent=this},iterN:function(h,d,x){for(var y=h+d;h<y;++h)if(x(this.lines[h]))return!0}};function ji(h){this.children=h;for(var d=0,x=0,y=0;y<h.length;++y){var S=h[y];d+=S.chunkSize(),x+=S.height,S.parent=this}this.size=d,this.height=x,this.parent=null}ji.prototype={chunkSize:function(){return this.size},removeInner:function(h,d){this.size-=d;for(var x=0;x<this.children.length;++x){var y=this.children[x],S=y.chunkSize();if(h<S){var E=Math.min(d,S-h),O=y.height;if(y.removeInner(h,E),this.height-=O-y.height,S==E&&(this.children.splice(x--,1),y.parent=null),(d-=E)==0)break;h=0}else h-=S}if(this.size-d<25&&(this.children.length>1||!(this.children[0]instanceof kn))){var W=[];this.collapse(W),this.children=[new kn(W)],this.children[0].parent=this}},collapse:function(h){for(var d=0;d<this.children.length;++d)this.children[d].collapse(h)},insertInner:function(h,d,x){this.size+=d.length,this.height+=x;for(var y=0;y<this.children.length;++y){var S=this.children[y],E=S.chunkSize();if(h<=E){if(S.insertInner(h,d,x),S.lines&&S.lines.length>50){for(var O=S.lines.length%25+25,W=O;W<S.lines.length;){var H=new kn(S.lines.slice(W,W+=25));S.height-=H.height,this.children.splice(++y,0,H),H.parent=this}S.lines=S.lines.slice(0,O),this.maybeSpill()}break}h-=E}},maybeSpill:function(){if(!(this.children.length<=10)){var h=this;do{var d=h.children.splice(h.children.length-5,5),x=new ji(d);if(h.parent){h.size-=x.size,h.height-=x.height;var S=de(h.parent.children,h);h.parent.children.splice(S+1,0,x)}else{var y=new ji(h.children);y.parent=h,h.children=[y,x],h=y}x.parent=h.parent}while(h.children.length>10);h.parent.maybeSpill()}},iterN:function(h,d,x){for(var y=0;y<this.children.length;++y){var S=this.children[y],E=S.chunkSize();if(h<E){var O=Math.min(d,E-h);if(S.iterN(h,O,x))return!0;if((d-=O)==0)break;h=0}else h-=E}}};var rn=function(h,d,x){if(x)for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);this.doc=h,this.node=d};rn.prototype.clear=function(){var h=this.doc.cm,d=this.line.widgets,x=this.line,y=Mt(x);if(!(y==null||!d)){for(var S=0;S<d.length;++S)d[S]==this&&d.splice(S--,1);d.length||(x.widgets=null);var E=nu(this);we(x,Math.max(0,x.height-E)),h&&(Di(h,function(){On(h,x,-E),po(h,y,"widget")}),Ai(h,"lineWidgetCleared",h,this,y))}},rn.prototype.changed=function(){var h=this,d=this.height,x=this.doc.cm,y=this.line;this.height=null;var S=nu(this)-d;S&&(fe(this.doc,y)||we(y,y.height+S),x&&Di(x,function(){x.curOp.forceUpdate=!0,On(x,y,S),Ai(x,"lineWidgetChanged",x,h,Mt(y))}))},Ao(rn);function On(h,d,x){An(d)<(h.curOp&&h.curOp.scrollTop||h.doc.scrollTop)&&mf(h,x)}function tr(h,d,x,y){var S=new rn(h,x,y),E=h.cm;return E&&S.noHScroll&&(E.display.alignWidgets=!0),gr(h,d,"widget",function(O){var W=O.widgets||(O.widgets=[]);if(S.insertAt==null?W.push(S):W.splice(Math.min(W.length-1,Math.max(0,S.insertAt)),0,S),S.line=O,E&&!fe(h,O)){var H=An(O)<h.scrollTop;we(O,O.height+nu(S)),H&&mf(E,S.height),E.curOp.forceUpdate=!0}return!0}),E&&Ai(E,"lineWidgetAdded",E,S,typeof d=="number"?d:Mt(d)),S}var Ws=0,Ct=function(h,d){this.lines=[],this.type=d,this.doc=h,this.id=++Ws};Ct.prototype.clear=function(){if(!this.explicitlyCleared){var h=this.doc.cm,d=h&&!h.curOp;if(d&&ke(h),uo(this,"clear")){var x=this.find();x&&Ai(this,"clear",x.from,x.to)}for(var y=null,S=null,E=0;E<this.lines.length;++E){var O=this.lines[E],W=Co(O.markedSpans,this);h&&!this.collapsed?po(h,Mt(O),"text"):h&&(W.to!=null&&(S=Mt(O)),W.from!=null&&(y=Mt(O))),O.markedSpans=Io(O.markedSpans,W),W.from==null&&this.collapsed&&!fe(this.doc,O)&&h&&we(O,Nh(h.display))}if(h&&this.collapsed&&!h.options.lineWrapping)for(var H=0;H<this.lines.length;++H){var nt=ut(this.lines[H]),Rt=xr(nt);Rt>h.display.maxLineLength&&(h.display.maxLine=nt,h.display.maxLineLength=Rt,h.display.maxLineChanged=!0)}y!=null&&h&&this.collapsed&&oa(h,y,S+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,h&&Oe(h.doc)),h&&Ai(h,"markerCleared",h,this,y,S),d&&Ri(h),this.parent&&this.parent.clear()}},Ct.prototype.find=function(h,d){h==null&&this.type=="bookmark"&&(h=1);for(var x,y,S=0;S<this.lines.length;++S){var E=this.lines[S],O=Co(E.markedSpans,this);if(O.from!=null&&(x=Qt(d?E:Mt(E),O.from),h==-1))return x;if(O.to!=null&&(y=Qt(d?E:Mt(E),O.to),h==1))return y}return x&&{from:x,to:y}},Ct.prototype.changed=function(){var h=this,d=this.find(-1,!0),x=this,y=this.doc.cm;!d||!y||Di(y,function(){var S=d.line,E=Mt(d.line),O=cu(y,E);if(O&&(za(O),y.curOp.selectionChanged=y.curOp.forceUpdate=!0),y.curOp.updateMaxLine=!0,!fe(x.doc,S)&&x.height!=null){var W=x.height;x.height=null;var H=nu(x)-W;H&&we(S,S.height+H)}Ai(y,"markerChanged",y,h)})},Ct.prototype.attachLine=function(h){if(!this.lines.length&&this.doc.cm){var d=this.doc.cm.curOp;(!d.maybeHiddenMarkers||de(d.maybeHiddenMarkers,this)==-1)&&(d.maybeUnhiddenMarkers||(d.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(h)},Ct.prototype.detachLine=function(h){if(this.lines.splice(de(this.lines,h),1),!this.lines.length&&this.doc.cm){var d=this.doc.cm.curOp;(d.maybeHiddenMarkers||(d.maybeHiddenMarkers=[])).push(this)}},Ao(Ct);function _o(h,d,x,y,S){if(y&&y.shared)return jn(h,d,x,y,S);if(h.cm&&!h.cm.curOp)return Wn(h.cm,_o)(h,d,x,y,S);var E=new Ct(h,S),O=ui(d,x);if(y&&Ki(y,E,!1),O>0||O==0&&E.clearWhenEmpty!==!1)return E;if(E.replacedWith&&(E.collapsed=!0,E.widgetNode=fi("span",[E.replacedWith],"CodeMirror-widget"),y.handleMouseEvents||E.widgetNode.setAttribute("cm-ignore-events","true"),y.insertLeft&&(E.widgetNode.insertLeft=!0)),E.collapsed){if(rt(h,d.line,d,x,E)||d.line!=x.line&&rt(h,x.line,d,x,E))throw new Error("Inserting collapsed marker partially overlapping an existing one");te()}E.addToHistory&&ya(h,{from:d,to:x,origin:"markText"},h.sel,NaN);var W=d.line,H=h.cm,nt;if(h.iter(W,x.line+1,function(pt){H&&E.collapsed&&!H.options.lineWrapping&&ut(pt)==H.display.maxLine&&(nt=!0),E.collapsed&&W!=d.line&&we(pt,0),ea(pt,new Do(E,W==d.line?d.ch:null,W==x.line?x.ch:null)),++W}),E.collapsed&&h.iter(d.line,x.line+1,function(pt){fe(h,pt)&&we(pt,0)}),E.clearOnEnter&&We(E,"beforeCursorEnter",function(){return E.clear()}),E.readOnly&&(Wo(),(h.history.done.length||h.history.undone.length)&&h.clearHistory()),E.collapsed&&(E.id=++Ws,E.atomic=!0),H){if(nt&&(H.curOp.updateMaxLine=!0),E.collapsed)oa(H,d.line,x.line+1);else if(E.className||E.startStyle||E.endStyle||E.css||E.attributes||E.title)for(var Rt=d.line;Rt<=x.line;Rt++)po(H,Rt,"text");E.atomic&&Oe(H.doc),Ai(H,"markerAdded",H,E)}return E}var Mn=function(h,d){this.markers=h,this.primary=d;for(var x=0;x<h.length;++x)h[x].parent=this};Mn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var h=0;h<this.markers.length;++h)this.markers[h].clear();Ai(this,"clear")}},Mn.prototype.find=function(h,d){return this.primary.find(h,d)},Ao(Mn);function jn(h,d,x,y,S){y=Ki(y),y.shared=!1;var E=[_o(h,d,x,y,S)],O=E[0],W=y.widgetNode;return To(h,function(H){W&&(y.widgetNode=W.cloneNode(!0)),E.push(_o(H,Xi(H,d),Xi(H,x),y,S));for(var nt=0;nt<H.linked.length;++nt)if(H.linked[nt].isParent)return;O=ai(E)}),new Mn(E,O)}function ws(h){return h.findMarks(Qt(h.first,0),h.clipPos(Qt(h.lastLine())),function(d){return d.parent})}function Ea(h,d){for(var x=0;x<d.length;x++){var y=d[x],S=y.find(),E=h.clipPos(S.from),O=h.clipPos(S.to);if(ui(E,O)){var W=_o(h,E,O,y.primary,y.primary.type);y.markers.push(W),W.parent=y}}}function Pn(h){for(var d=function(y){var S=h[y],E=[S.primary.doc];To(S.primary.doc,function(H){return E.push(H)});for(var O=0;O<S.markers.length;O++){var W=S.markers[O];de(E,W.doc)==-1&&(W.parent=null,S.markers.splice(O--,1))}},x=0;x<h.length;x++)d(x)}var vn=0,tn=function(h,d,x,y,S){if(!(this instanceof tn))return new tn(h,d,x,y,S);x==null&&(x=0),ji.call(this,[new kn([new Zn("",null)])]),this.first=x,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=x;var E=Qt(x,0);this.sel=ks(E),this.history=new pu(null),this.id=++vn,this.modeOption=d,this.lineSep=y,this.direction=S=="rtl"?"rtl":"ltr",this.extend=!1,typeof h=="string"&&(h=this.splitLines(h)),Cu(this,{from:E,to:E,text:h}),Qe(this,ks(E),Ye)};tn.prototype=D(ji.prototype,{constructor:tn,iter:function(h,d,x){x?this.iterN(h-this.first,d-h,x):this.iterN(this.first,this.first+this.size,h)},insert:function(h,d){for(var x=0,y=0;y<d.length;++y)x+=d[y].height;this.insertInner(h-this.first,d,x)},remove:function(h,d){this.removeInner(h-this.first,d)},getValue:function(h){var d=Ce(this,this.first,this.first+this.size);return h===!1?d:d.join(h||this.lineSeparator())},setValue:cr(function(h){var d=Qt(this.first,0),x=this.first+this.size-1;Hi(this,{from:d,to:Qt(x,yt(this,x).text.length),text:this.splitLines(h),origin:"setValue",full:!0},!0),this.cm&&Rc(this.cm,0,0),Qe(this,ks(d),Ye)}),replaceRange:function(h,d,x,y){d=Xi(this,d),x=x?Xi(this,x):d,In(this,h,d,x,y)},getRange:function(h,d,x){var y=me(this,Xi(this,h),Xi(this,d));return x===!1?y:y.join(x||this.lineSeparator())},getLine:function(h){var d=this.getLineHandle(h);return d&&d.text},getLineHandle:function(h){if(Re(this,h))return yt(this,h)},getLineNumber:function(h){return Mt(h)},getLineHandleVisualStart:function(h){return typeof h=="number"&&(h=yt(this,h)),ut(h)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(h){return Xi(this,h)},getCursor:function(h){var d=this.sel.primary(),x;return h==null||h=="head"?x=d.head:h=="anchor"?x=d.anchor:h=="end"||h=="to"||h===!1?x=d.to():x=d.from(),x},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:cr(function(h,d,x){Ne(this,Xi(this,typeof h=="number"?Qt(h,d||0):h),null,x)}),setSelection:cr(function(h,d,x){Ne(this,Xi(this,h),Xi(this,d||h),x)}),extendSelection:cr(function(h,d,x){Dt(this,Xi(this,h),d&&Xi(this,d),x)}),extendSelections:cr(function(h,d){_t(this,ho(this,h),d)}),extendSelectionsBy:cr(function(h,d){var x=zi(this.sel.ranges,h);_t(this,ho(this,x),d)}),setSelections:cr(function(h,d,x){if(h.length){for(var y=[],S=0;S<h.length;S++)y[S]=new oo(Xi(this,h[S].anchor),Xi(this,h[S].head));d==null&&(d=Math.min(h.length-1,this.sel.primIndex)),Qe(this,vs(this.cm,y,d),x)}}),addSelection:cr(function(h,d,x){var y=this.sel.ranges.slice(0);y.push(new oo(Xi(this,h),Xi(this,d||h))),Qe(this,vs(this.cm,y,y.length-1),x)}),getSelection:function(h){for(var d=this.sel.ranges,x,y=0;y<d.length;y++){var S=me(this,d[y].from(),d[y].to());x=x?x.concat(S):S}return h===!1?x:x.join(h||this.lineSeparator())},getSelections:function(h){for(var d=[],x=this.sel.ranges,y=0;y<x.length;y++){var S=me(this,x[y].from(),x[y].to());h!==!1&&(S=S.join(h||this.lineSeparator())),d[y]=S}return d},replaceSelection:function(h,d,x){for(var y=[],S=0;S<this.sel.ranges.length;S++)y[S]=h;this.replaceSelections(y,d,x||"+input")},replaceSelections:cr(function(h,d,x){for(var y=[],S=this.sel,E=0;E<S.ranges.length;E++){var O=S.ranges[E];y[E]={from:O.from(),to:O.to(),text:this.splitLines(h[E]),origin:x}}for(var W=d&&d!="end"&&Qa(this,y,d),H=y.length-1;H>=0;H--)Hi(this,y[H]);W?ze(this,W):this.cm&&Hh(this.cm)}),undo:cr(function(){cn(this,"undo")}),redo:cr(function(){cn(this,"redo")}),undoSelection:cr(function(){cn(this,"undo",!0)}),redoSelection:cr(function(){cn(this,"redo",!0)}),setExtending:function(h){this.extend=h},getExtending:function(){return this.extend},historySize:function(){for(var h=this.history,d=0,x=0,y=0;y<h.done.length;y++)h.done[y].ranges||++d;for(var S=0;S<h.undone.length;S++)h.undone[S].ranges||++x;return{undo:d,redo:x}},clearHistory:function(){var h=this;this.history=new pu(this.history.maxGeneration),To(this,function(d){return d.history=h.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(h){return h&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(h){return this.history.generation==(h||this.cleanGeneration)},getHistory:function(){return{done:at(this.history.done),undone:at(this.history.undone)}},setHistory:function(h){var d=this.history=new pu(this.history.maxGeneration);d.done=at(h.done.slice(0),null,!0),d.undone=at(h.undone.slice(0),null,!0)},setGutterMarker:cr(function(h,d,x){return gr(this,h,"gutter",function(y){var S=y.gutterMarkers||(y.gutterMarkers={});return S[d]=x,!x&&P(S)&&(y.gutterMarkers=null),!0})}),clearGutter:cr(function(h){var d=this;this.iter(function(x){x.gutterMarkers&&x.gutterMarkers[h]&&gr(d,x,"gutter",function(){return x.gutterMarkers[h]=null,P(x.gutterMarkers)&&(x.gutterMarkers=null),!0})})}),lineInfo:function(h){var d;if(typeof h=="number"){if(!Re(this,h)||(d=h,h=yt(this,h),!h))return null}else if(d=Mt(h),d==null)return null;return{line:d,handle:h,text:h.text,gutterMarkers:h.gutterMarkers,textClass:h.textClass,bgClass:h.bgClass,wrapClass:h.wrapClass,widgets:h.widgets}},addLineClass:cr(function(h,d,x){return gr(this,h,d=="gutter"?"gutter":"class",function(y){var S=d=="text"?"textClass":d=="background"?"bgClass":d=="gutter"?"gutterClass":"wrapClass";if(!y[S])y[S]=x;else{if(it(x).test(y[S]))return!1;y[S]+=" "+x}return!0})}),removeLineClass:cr(function(h,d,x){return gr(this,h,d=="gutter"?"gutter":"class",function(y){var S=d=="text"?"textClass":d=="background"?"bgClass":d=="gutter"?"gutterClass":"wrapClass",E=y[S];if(E)if(x==null)y[S]=null;else{var O=E.match(it(x));if(!O)return!1;var W=O.index+O[0].length;y[S]=E.slice(0,O.index)+(!O.index||W==E.length?"":" ")+E.slice(W)||null}else return!1;return!0})}),addLineWidget:cr(function(h,d,x){return tr(this,h,d,x)}),removeLineWidget:function(h){h.clear()},markText:function(h,d,x){return _o(this,Xi(this,h),Xi(this,d),x,x&&x.type||"range")},setBookmark:function(h,d){var x={replacedWith:d&&(d.nodeType==null?d.widget:d),insertLeft:d&&d.insertLeft,clearWhenEmpty:!1,shared:d&&d.shared,handleMouseEvents:d&&d.handleMouseEvents};return h=Xi(this,h),_o(this,h,h,x,"bookmark")},findMarksAt:function(h){h=Xi(this,h);var d=[],x=yt(this,h.line).markedSpans;if(x)for(var y=0;y<x.length;++y){var S=x[y];(S.from==null||S.from<=h.ch)&&(S.to==null||S.to>=h.ch)&&d.push(S.marker.parent||S.marker)}return d},findMarks:function(h,d,x){h=Xi(this,h),d=Xi(this,d);var y=[],S=h.line;return this.iter(h.line,d.line+1,function(E){var O=E.markedSpans;if(O)for(var W=0;W<O.length;W++){var H=O[W];!(H.to!=null&&S==h.line&&h.ch>=H.to||H.from==null&&S!=h.line||H.from!=null&&S==d.line&&H.from>=d.ch)&&(!x||x(H.marker))&&y.push(H.marker.parent||H.marker)}++S}),y},getAllMarks:function(){var h=[];return this.iter(function(d){var x=d.markedSpans;if(x)for(var y=0;y<x.length;++y)x[y].from!=null&&h.push(x[y].marker)}),h},posFromIndex:function(h){var d,x=this.first,y=this.lineSeparator().length;return this.iter(function(S){var E=S.text.length+y;if(E>h)return d=h,!0;h-=E,++x}),Xi(this,Qt(x,d))},indexFromPos:function(h){h=Xi(this,h);var d=h.ch;if(h.line<this.first||h.ch<0)return 0;var x=this.lineSeparator().length;return this.iter(this.first,h.line,function(y){d+=y.text.length+x}),d},copy:function(h){var d=new tn(Ce(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return d.scrollTop=this.scrollTop,d.scrollLeft=this.scrollLeft,d.sel=this.sel,d.extend=!1,h&&(d.history.undoDepth=this.history.undoDepth,d.setHistory(this.getHistory())),d},linkedDoc:function(h){h||(h={});var d=this.first,x=this.first+this.size;h.from!=null&&h.from>d&&(d=h.from),h.to!=null&&h.to<x&&(x=h.to);var y=new tn(Ce(this,d,x),h.mode||this.modeOption,d,this.lineSep,this.direction);return h.sharedHist&&(y.history=this.history),(this.linked||(this.linked=[])).push({doc:y,sharedHist:h.sharedHist}),y.linked=[{doc:this,isParent:!0,sharedHist:h.sharedHist}],Ea(y,ws(this)),y},unlinkDoc:function(h){if(h instanceof ur&&(h=h.doc),this.linked)for(var d=0;d<this.linked.length;++d){var x=this.linked[d];if(x.doc==h){this.linked.splice(d,1),h.unlinkDoc(this),Pn(ws(this));break}}if(h.history==this.history){var y=[h.id];To(h,function(S){return y.push(S.id)},!0),h.history=new pu(null),h.history.done=at(this.history.done,y),h.history.undone=at(this.history.undone,y)}},iterLinkedDocs:function(h){To(this,h)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(h){return this.lineSep?h.split(this.lineSep):Me(h)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:cr(function(h){h!="rtl"&&(h="ltr"),h!=this.direction&&(this.direction=h,this.iter(function(d){return d.order=null}),this.cm&&du(this.cm))})}),tn.prototype.eachLine=tn.prototype.iter;var so=0;function Po(h){var d=this;if(Mo(d),!(Fr(d,h)||Tl(d.display,h))){fs(h),gt&&(so=+new Date);var x=vl(d,h,!0),y=h.dataTransfer.files;if(!(!x||d.isReadOnly()))if(y&&y.length&&window.FileReader&&window.File)for(var S=y.length,E=Array(S),O=0,W=function(){++O==S&&Wn(d,function(){x=Xi(d.doc,x);var Jt={from:x,to:x,text:d.doc.splitLines(E.filter(function(oi){return oi!=null}).join(d.doc.lineSeparator())),origin:"paste"};Hi(d.doc,Jt),ze(d.doc,ks(Xi(d.doc,x),Xi(d.doc,Ia(Jt))))})()},H=function(Jt,oi){if(d.options.allowDropFileTypes&&de(d.options.allowDropFileTypes,Jt.type)==-1){W();return}var mi=new FileReader;mi.onerror=function(){return W()},mi.onload=function(){var Ii=mi.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ii)){W();return}E[oi]=Ii,W()},mi.readAsText(Jt)},nt=0;nt<y.length;nt++)H(y[nt],nt);else{if(d.state.draggingText&&d.doc.sel.contains(x)>-1){d.state.draggingText(h),setTimeout(function(){return d.display.input.focus()},20);return}try{var Rt=h.dataTransfer.getData("Text");if(Rt){var pt;if(d.state.draggingText&&!d.state.draggingText.copy&&(pt=d.listSelections()),Be(d.doc,ks(x,x)),pt)for(var oe=0;oe<pt.length;++oe)In(d.doc,"",pt[oe].anchor,pt[oe].head,"drag");d.replaceSelection(Rt,"around","paste"),d.display.input.focus()}}catch(Jt){}}}}function No(h,d){if(gt&&(!h.state.draggingText||+new Date-so<100)){jl(d);return}if(!(Fr(h,d)||Tl(h.display,d))&&(d.dataTransfer.setData("Text",h.getSelection()),d.dataTransfer.effectAllowed="copyMove",d.dataTransfer.setDragImage&&!ee)){var x=_e("img",null,null,"position: fixed; left: 0; top: 0;");x.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Y&&(x.width=x.height=1,h.display.wrapper.appendChild(x),x._top=x.offsetTop),d.dataTransfer.setDragImage(x,0,0),Y&&x.parentNode.removeChild(x)}}function ar(h,d){var x=vl(h,d);if(x){var y=document.createDocumentFragment();mo(h,x,y),h.display.dragCursor||(h.display.dragCursor=_e("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),h.display.lineSpace.insertBefore(h.display.dragCursor,h.display.cursorDiv)),Te(h.display.dragCursor,y)}}function Mo(h){h.display.dragCursor&&(h.display.lineSpace.removeChild(h.display.dragCursor),h.display.dragCursor=null)}function qo(h){if(document.getElementsByClassName){for(var d=document.getElementsByClassName("CodeMirror"),x=[],y=0;y<d.length;y++){var S=d[y].CodeMirror;S&&x.push(S)}x.length&&x[0].operation(function(){for(var E=0;E<x.length;E++)h(x[E])})}}var Je=!1;function br(){Je||(wn(),Je=!0)}function wn(){var h;We(window,"resize",function(){h==null&&(h=setTimeout(function(){h=null,qo(lr)},100))}),We(window,"blur",function(){return qo(pf)})}function lr(h){var d=h.display;d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.scrollbarsClipped=!1,h.setSize()}for(var Rn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},kr=0;kr<10;kr++)Rn[kr+48]=Rn[kr+96]=String(kr);for(var Ls=65;Ls<=90;Ls++)Rn[Ls]=String.fromCharCode(Ls);for(var As=1;As<=12;As++)Rn[As+111]=Rn[As+63235]="F"+As;var Gr={};Gr.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Gr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Gr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Gr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Gr.default=Q?Gr.macDefault:Gr.pcDefault;function ma(h){var d=h.split(/-(?!$)/);h=d[d.length-1];for(var x,y,S,E,O=0;O<d.length-1;O++){var W=d[O];if(/^(cmd|meta|m)$/i.test(W))E=!0;else if(/^a(lt)?$/i.test(W))x=!0;else if(/^(c|ctrl|control)$/i.test(W))y=!0;else if(/^s(hift)?$/i.test(W))S=!0;else throw new Error("Unrecognized modifier name: "+W)}return x&&(h="Alt-"+h),y&&(h="Ctrl-"+h),E&&(h="Cmd-"+h),S&&(h="Shift-"+h),h}function Qo(h){var d={};for(var x in h)if(h.hasOwnProperty(x)){var y=h[x];if(/^(name|fallthrough|(de|at)tach)$/.test(x))continue;if(y=="..."){delete h[x];continue}for(var S=zi(x.split(" "),ma),E=0;E<S.length;E++){var O=void 0,W=void 0;E==S.length-1?(W=S.join(" "),O=y):(W=S.slice(0,E+1).join(" "),O="...");var H=d[W];if(!H)d[W]=O;else if(H!=O)throw new Error("Inconsistent bindings for "+W)}delete h[x]}for(var nt in d)h[nt]=d[nt];return h}function bs(h,d,x,y){d=Eo(d);var S=d.call?d.call(h,y):d[h];if(S===!1)return"nothing";if(S==="...")return"multi";if(S!=null&&x(S))return"handled";if(d.fallthrough){if(Object.prototype.toString.call(d.fallthrough)!="[object Array]")return bs(h,d.fallthrough,x,y);for(var E=0;E<d.fallthrough.length;E++){var O=bs(h,d.fallthrough[E],x,y);if(O)return O}}}function ua(h){var d=typeof h=="string"?h:Rn[h.keyCode];return d=="Ctrl"||d=="Alt"||d=="Shift"||d=="Mod"}function Ho(h,d,x){var y=h;return d.altKey&&y!="Alt"&&(h="Alt-"+h),(Wt?d.metaKey:d.ctrlKey)&&y!="Ctrl"&&(h="Ctrl-"+h),(Wt?d.ctrlKey:d.metaKey)&&y!="Mod"&&(h="Cmd-"+h),!x&&d.shiftKey&&y!="Shift"&&(h="Shift-"+h),h}function La(h,d){if(Y&&h.keyCode==34&&h.char)return!1;var x=Rn[h.keyCode];return x==null||h.altGraphKey?!1:(h.keyCode==3&&h.code&&(x=h.code),Ho(x,h,d))}function Eo(h){return typeof h=="string"?Gr[h]:h}function Rs(h,d){for(var x=h.doc.sel.ranges,y=[],S=0;S<x.length;S++){for(var E=d(x[S]);y.length&&ui(E.from,ai(y).to)<=0;){var O=y.pop();if(ui(O.from,E.from)<0){E.from=O.from;break}}y.push(E)}Di(h,function(){for(var W=y.length-1;W>=0;W--)In(h.doc,"",y[W].from,y[W].to,"+delete");Hh(h)})}function Us(h,d,x){var y=Pe(h.text,d+x,x);return y<0||y>h.text.length?null:y}function Vo(h,d,x){var y=Us(h,d.ch,x);return y==null?null:new Qt(d.line,y,x<0?"after":"before")}function ha(h,d,x,y,S){if(h){d.doc.direction=="rtl"&&(S=-S);var E=rr(x,d.doc.direction);if(E){var O=S<0?ai(E):E[0],W=S<0==(O.level==1),H=W?"after":"before",nt;if(O.level>0||d.doc.direction=="rtl"){var Rt=Zu(d,x);nt=S<0?x.text.length-1:0;var pt=js(d,Rt,nt).top;nt=He(function(oe){return js(d,Rt,oe).top==pt},S<0==(O.level==1)?O.from:O.to-1,nt),H=="before"&&(nt=Us(x,nt,1))}else nt=S<0?O.to:O.from;return new Qt(y,nt,H)}}return new Qt(y,S<0?x.text.length:0,S<0?"before":"after")}function Zs(h,d,x,y){var S=rr(d,h.doc.direction);if(!S)return Vo(d,x,y);x.ch>=d.text.length?(x.ch=d.text.length,x.sticky="before"):x.ch<=0&&(x.ch=0,x.sticky="after");var E=Gi(S,x.ch,x.sticky),O=S[E];if(h.doc.direction=="ltr"&&O.level%2==0&&(y>0?O.to>x.ch:O.from<x.ch))return Vo(d,x,y);var W=function(on,Bn){return Us(d,on instanceof Qt?on.ch:on,Bn)},H,nt=function(on){return h.options.lineWrapping?(H=H||Zu(h,d),Oc(h,d,H,on)):{begin:0,end:d.text.length}},Rt=nt(x.sticky=="before"?W(x,-1):x.ch);if(h.doc.direction=="rtl"||O.level==1){var pt=O.level==1==y<0,oe=W(x,pt?1:-1);if(oe!=null&&(pt?oe<=O.to&&oe<=Rt.end:oe>=O.from&&oe>=Rt.begin)){var Jt=pt?"before":"after";return new Qt(x.line,oe,Jt)}}var oi=function(on,Bn,gn){for(var Vn=function(xl,Hu){return Hu?new Qt(x.line,W(xl,1),"before"):new Qt(x.line,xl,"after")};on>=0&&on<S.length;on+=Bn){var Hr=S[on],bn=Bn>0==(Hr.level!=1),rs=bn?gn.begin:W(gn.end,-1);if(Hr.from<=rs&&rs<Hr.to||(rs=bn?Hr.from:W(Hr.to,-1),gn.begin<=rs&&rs<gn.end))return Vn(rs,bn)}},mi=oi(E+y,y,Rt);if(mi)return mi;var Ii=y>0?Rt.end:W(Rt.begin,-1);return Ii!=null&&!(y>0&&Ii==d.text.length)&&(mi=oi(y>0?0:S.length-1,y,nt(Ii)),mi)?mi:null}var Vl={selectAll:Li,singleSelection:function(h){return h.setSelection(h.getCursor("anchor"),h.getCursor("head"),Ye)},killLine:function(h){return Rs(h,function(d){if(d.empty()){var x=yt(h.doc,d.head.line).text.length;return d.head.ch==x&&d.head.line<h.lastLine()?{from:d.head,to:Qt(d.head.line+1,0)}:{from:d.head,to:Qt(d.head.line,x)}}else return{from:d.from(),to:d.to()}})},deleteLine:function(h){return Rs(h,function(d){return{from:Qt(d.from().line,0),to:Xi(h.doc,Qt(d.to().line+1,0))}})},delLineLeft:function(h){return Rs(h,function(d){return{from:Qt(d.from().line,0),to:d.from()}})},delWrappedLineLeft:function(h){return Rs(h,function(d){var x=h.charCoords(d.head,"div").top+5,y=h.coordsChar({left:0,top:x},"div");return{from:y,to:d.from()}})},delWrappedLineRight:function(h){return Rs(h,function(d){var x=h.charCoords(d.head,"div").top+5,y=h.coordsChar({left:h.display.lineDiv.offsetWidth+100,top:x},"div");return{from:d.from(),to:y}})},undo:function(h){return h.undo()},redo:function(h){return h.redo()},undoSelection:function(h){return h.undoSelection()},redoSelection:function(h){return h.redoSelection()},goDocStart:function(h){return h.extendSelection(Qt(h.firstLine(),0))},goDocEnd:function(h){return h.extendSelection(Qt(h.lastLine()))},goLineStart:function(h){return h.extendSelectionsBy(function(d){return Ta(h,d.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(h){return h.extendSelectionsBy(function(d){return Yu(h,d.head)},{origin:"+move",bias:1})},goLineEnd:function(h){return h.extendSelectionsBy(function(d){return Xa(h,d.head.line)},{origin:"+move",bias:-1})},goLineRight:function(h){return h.extendSelectionsBy(function(d){var x=h.cursorCoords(d.head,"div").top+5;return h.coordsChar({left:h.display.lineDiv.offsetWidth+100,top:x},"div")},Wi)},goLineLeft:function(h){return h.extendSelectionsBy(function(d){var x=h.cursorCoords(d.head,"div").top+5;return h.coordsChar({left:0,top:x},"div")},Wi)},goLineLeftSmart:function(h){return h.extendSelectionsBy(function(d){var x=h.cursorCoords(d.head,"div").top+5,y=h.coordsChar({left:0,top:x},"div");return y.ch<h.getLine(y.line).search(/\S/)?Yu(h,d.head):y},Wi)},goLineUp:function(h){return h.moveV(-1,"line")},goLineDown:function(h){return h.moveV(1,"line")},goPageUp:function(h){return h.moveV(-1,"page")},goPageDown:function(h){return h.moveV(1,"page")},goCharLeft:function(h){return h.moveH(-1,"char")},goCharRight:function(h){return h.moveH(1,"char")},goColumnLeft:function(h){return h.moveH(-1,"column")},goColumnRight:function(h){return h.moveH(1,"column")},goWordLeft:function(h){return h.moveH(-1,"word")},goGroupRight:function(h){return h.moveH(1,"group")},goGroupLeft:function(h){return h.moveH(-1,"group")},goWordRight:function(h){return h.moveH(1,"word")},delCharBefore:function(h){return h.deleteH(-1,"codepoint")},delCharAfter:function(h){return h.deleteH(1,"char")},delWordBefore:function(h){return h.deleteH(-1,"word")},delWordAfter:function(h){return h.deleteH(1,"word")},delGroupBefore:function(h){return h.deleteH(-1,"group")},delGroupAfter:function(h){return h.deleteH(1,"group")},indentAuto:function(h){return h.indentSelection("smart")},indentMore:function(h){return h.indentSelection("add")},indentLess:function(h){return h.indentSelection("subtract")},insertTab:function(h){return h.replaceSelection(" ")},insertSoftTab:function(h){for(var d=[],x=h.listSelections(),y=h.options.tabSize,S=0;S<x.length;S++){var E=x[S].from(),O=It(h.getLine(E.line),E.ch,y);d.push(vi(y-O%y))}h.replaceSelections(d)},defaultTab:function(h){h.somethingSelected()?h.indentSelection("add"):h.execCommand("insertTab")},transposeChars:function(h){return Di(h,function(){for(var d=h.listSelections(),x=[],y=0;y<d.length;y++)if(d[y].empty()){var S=d[y].head,E=yt(h.doc,S.line).text;if(E){if(S.ch==E.length&&(S=new Qt(S.line,S.ch-1)),S.ch>0)S=new Qt(S.line,S.ch+1),h.replaceRange(E.charAt(S.ch-1)+E.charAt(S.ch-2),Qt(S.line,S.ch-2),S,"+transpose");else if(S.line>h.doc.first){var O=yt(h.doc,S.line-1).text;O&&(S=new Qt(S.line,1),h.replaceRange(E.charAt(0)+h.doc.lineSeparator()+O.charAt(O.length-1),Qt(S.line-1,O.length-1),S,"+transpose"))}}x.push(new oo(S,S))}h.setSelections(x)})},newlineAndIndent:function(h){return Di(h,function(){for(var d=h.listSelections(),x=d.length-1;x>=0;x--)h.replaceRange(h.doc.lineSeparator(),d[x].anchor,d[x].head,"+input");d=h.listSelections();for(var y=0;y<d.length;y++)h.indentLine(d[y].from().line,null,!0);Hh(h)})},openLine:function(h){return h.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(h){return h.toggleOverwrite()}};function Ta(h,d){var x=yt(h.doc,d),y=ut(x);return y!=x&&(d=Mt(y)),ha(!0,h,y,d,1)}function Xa(h,d){var x=yt(h.doc,d),y=re(x);return y!=x&&(d=Mt(y)),ha(!0,h,x,d,-1)}function Yu(h,d){var x=Ta(h,d.line),y=yt(h.doc,x.line),S=rr(y,h.doc.direction);if(!S||S[0].level==0){var E=Math.max(x.ch,y.text.search(/\S/)),O=d.line==x.line&&d.ch<=E&&d.ch;return Qt(x.line,O?0:E,x.sticky)}return x}function Ts(h,d,x){if(typeof d=="string"&&(d=Vl[d],!d))return!1;h.display.input.ensurePolled();var y=h.display.shift,S=!1;try{h.isReadOnly()&&(h.state.suppressEdits=!0),x&&(h.display.shift=!1),S=d(h)!=Ze}finally{h.display.shift=y,h.state.suppressEdits=!1}return S}function Cn(h,d,x){for(var y=0;y<h.state.keyMaps.length;y++){var S=bs(d,h.state.keyMaps[y],x,h);if(S)return S}return h.options.extraKeys&&bs(d,h.options.extraKeys,x,h)||bs(d,h.options.keyMap,x,h)}var Kn=new tt;function Pr(h,d,x,y){var S=h.state.keySeq;if(S){if(ua(d))return"handled";if(/\'$/.test(d)?h.state.keySeq=null:Kn.set(50,function(){h.state.keySeq==S&&(h.state.keySeq=null,h.display.input.reset())}),Ss(h,S+" "+d,x,y))return!0}return Ss(h,d,x,y)}function Ss(h,d,x,y){var S=Cn(h,d,y);return S=="multi"&&(h.state.keySeq=d),S=="handled"&&Ai(h,"keyHandled",h,d,x),(S=="handled"||S=="multi")&&(fs(x),qs(h)),!!S}function Nn(h,d){var x=La(d,!0);return x?d.shiftKey&&!h.state.keySeq?Pr(h,"Shift-"+x,d,function(y){return Ts(h,y,!0)})||Pr(h,x,d,function(y){if(typeof y=="string"?/^go[A-Z]/.test(y):y.motion)return Ts(h,y)}):Pr(h,x,d,function(y){return Ts(h,y)}):!1}function Yr(h,d,x){return Pr(h,"'"+x+"'",d,function(y){return Ts(h,y,!0)})}var Fi=null;function Un(h){var d=this;if(!(h.target&&h.target!=d.display.input.getField())&&(d.curOp.focus=Ke(),!Fr(d,h))){gt&&ft<11&&h.keyCode==27&&(h.returnValue=!1);var x=h.keyCode;d.display.shift=x==16||h.shiftKey;var y=Nn(d,h);Y&&(Fi=y?x:null,!y&&x==88&&!yi&&(Q?h.metaKey:h.ctrlKey)&&d.replaceSelection("",null,"cut")),Nt&&!Q&&!y&&x==46&&h.shiftKey&&!h.ctrlKey&&document.execCommand&&document.execCommand("cut"),x==18&&!/\bCodeMirror-crosshair\b/.test(d.display.lineDiv.className)&&ae(d)}}function ae(h){var d=h.display.lineDiv;ki(d,"CodeMirror-crosshair");function x(y){(y.keyCode==18||!y.altKey)&&(Ot(d,"CodeMirror-crosshair"),$o(document,"keyup",x),$o(document,"mouseover",x))}We(document,"keyup",x),We(document,"mouseover",x)}function to(h){h.keyCode==16&&(this.doc.sel.shift=!1),Fr(this,h)}function Bs(h){var d=this;if(!(h.target&&h.target!=d.display.input.getField())&&!(Tl(d.display,h)||Fr(d,h)||h.ctrlKey&&!h.altKey||Q&&h.metaKey)){var x=h.keyCode,y=h.charCode;if(Y&&x==Fi){Fi=null,fs(h);return}if(!(Y&&(!h.which||h.which<10)&&Nn(d,h))){var S=String.fromCharCode(y==null?x:y);S!="\b"&&(Yr(d,h,S)||d.display.input.onKeyPress(h))}}}var _a=400,sh=function(h,d,x){this.time=h,this.pos=d,this.button=x};sh.prototype.compare=function(h,d,x){return this.time+_a>h&&ui(d,this.pos)==0&&x==this.button};var Wl,Du;function cl(h,d){var x=+new Date;return Du&&Du.compare(x,h,d)?(Wl=Du=null,"triple"):Wl&&Wl.compare(x,h,d)?(Du=new sh(x,h,d),Wl=null,"double"):(Wl=new sh(x,h,d),Du=null,"single")}function Ds(h){var d=this,x=d.display;if(!(Fr(d,h)||x.activeTouch&&x.input.supportsTouch())){if(x.input.ensurePolled(),x.shift=h.shiftKey,Tl(x,h)){ct||(x.scroller.draggable=!1,setTimeout(function(){return x.scroller.draggable=!0},100));return}if(!ou(d,h)){var y=vl(d,h),S=xo(h),E=y?cl(y,S):"single";window.focus(),S==1&&d.state.selectingText&&d.state.selectingText(h),!(y&&ku(d,S,y,E,h))&&(S==1?y?Lc(d,y,E,h):Na(h)==x.scroller&&fs(h):S==2?(y&&Dt(d.doc,y),setTimeout(function(){return x.input.focus()},20)):S==3&&(kt?d.display.input.onContextMenu(h):Ga(d)))}}}function ku(h,d,x,y,S){var E="Click";return y=="double"?E="Double"+E:y=="triple"&&(E="Triple"+E),E=(d==1?"Left":d==2?"Middle":"Right")+E,Pr(h,Ho(E,S),S,function(O){if(typeof O=="string"&&(O=Vl[O]),!O)return!1;var W=!1;try{h.isReadOnly()&&(h.state.suppressEdits=!0),W=O(h,x)!=Ze}finally{h.state.suppressEdits=!1}return W})}function ah(h,d,x){var y=h.getOption("configureMouse"),S=y?y(h,d,x):{};if(S.unit==null){var E=se?x.shiftKey&&x.metaKey:x.altKey;S.unit=E?"rectangle":d=="single"?"char":d=="double"?"word":"line"}return(S.extend==null||h.doc.extend)&&(S.extend=h.doc.extend||x.shiftKey),S.addNew==null&&(S.addNew=Q?x.metaKey:x.ctrlKey),S.moveOnDrag==null&&(S.moveOnDrag=!(Q?x.altKey:x.ctrlKey)),S}function Lc(h,d,x,y){gt?setTimeout(Sr(aa,h),0):h.curOp.focus=Ke();var S=ah(h,x,y),E=h.doc.sel,O;h.options.dragDrop&&rl&&!h.isReadOnly()&&x=="single"&&(O=E.contains(d))>-1&&(ui((O=E.ranges[O]).from(),d)<0||d.xRel>0)&&(ui(O.to(),d)>0||d.xRel<0)?Vh(h,y,d,S):Nf(h,y,d,S)}function Vh(h,d,x,y){var S=h.display,E=!1,O=Wn(h,function(nt){ct&&(S.scroller.draggable=!1),h.state.draggingText=!1,$o(S.wrapper.ownerDocument,"mouseup",O),$o(S.wrapper.ownerDocument,"mousemove",W),$o(S.scroller,"dragstart",H),$o(S.scroller,"drop",O),E||(fs(nt),y.addNew||Dt(h.doc,x,null,null,y.extend),ct&&!ee||gt&&ft==9?setTimeout(function(){S.wrapper.ownerDocument.body.focus({preventScroll:!0}),S.input.focus()},20):S.input.focus())}),W=function(nt){E=E||Math.abs(d.clientX-nt.clientX)+Math.abs(d.clientY-nt.clientY)>=10},H=function(){return E=!0};ct&&(S.scroller.draggable=!0),h.state.draggingText=O,O.copy=!y.moveOnDrag,S.scroller.dragDrop&&S.scroller.dragDrop(),We(S.wrapper.ownerDocument,"mouseup",O),We(S.wrapper.ownerDocument,"mousemove",W),We(S.scroller,"dragstart",H),We(S.scroller,"drop",O),Ga(h),setTimeout(function(){return S.input.focus()},20)}function mu(h,d,x){if(x=="char")return new oo(d,d);if(x=="word")return h.findWordAt(d);if(x=="line")return new oo(Qt(d.line,0),Xi(h.doc,Qt(d.line+1,0)));var y=x(h,d);return new oo(y.from,y.to)}function Nf(h,d,x,y){var S=h.display,E=h.doc;fs(d);var O,W,H=E.sel,nt=H.ranges;if(y.addNew&&!y.extend?(W=E.sel.contains(x),W>-1?O=nt[W]:O=new oo(x,x)):(O=E.sel.primary(),W=E.sel.primIndex),y.unit=="rectangle")y.addNew||(O=new oo(x,x)),x=vl(h,d,!0,!0),W=-1;else{var Rt=mu(h,x,y.unit);y.extend?O=dt(O,Rt.anchor,Rt.head,y.extend):O=Rt}y.addNew?W==-1?(W=nt.length,Qe(E,vs(h,nt.concat([O]),W),{scroll:!1,origin:"*mouse"})):nt.length>1&&nt[W].empty()&&y.unit=="char"&&!y.extend?(Qe(E,vs(h,nt.slice(0,W).concat(nt.slice(W+1)),0),{scroll:!1,origin:"*mouse"}),H=E.sel):Xt(E,W,O,Ae):(W=0,Qe(E,new va([O],0),Ae),H=E.sel);var pt=x;function oe(gn){if(ui(pt,gn)!=0)if(pt=gn,y.unit=="rectangle"){for(var Vn=[],Hr=h.options.tabSize,bn=It(yt(E,x.line).text,x.ch,Hr),rs=It(yt(E,gn.line).text,gn.ch,Hr),xl=Math.min(bn,rs),Hu=Math.max(bn,rs),Ol=Math.min(x.line,gn.line),Rh=Math.min(h.lastLine(),Math.max(x.line,gn.line));Ol<=Rh;Ol++){var xh=yt(E,Ol).text,Bu=En(xh,xl,Hr);xl==Hu?Vn.push(new oo(Qt(Ol,Bu),Qt(Ol,Bu))):xh.length>Bu&&Vn.push(new oo(Qt(Ol,Bu),Qt(Ol,En(xh,Hu,Hr))))}Vn.length||Vn.push(new oo(x,x)),Qe(E,vs(h,H.ranges.slice(0,W).concat(Vn),W),{origin:"*mouse",scroll:!1}),h.scrollIntoView(gn)}else{var ac=O,ts=mu(h,gn,y.unit),su=ac.anchor,Gs;ui(ts.anchor,su)>0?(Gs=ts.head,su=gi(ac.from(),ts.anchor)):(Gs=ts.anchor,su=Lr(ac.to(),ts.head));var Yl=H.ranges.slice(0);Yl[W]=gu(h,new oo(Xi(E,su),Gs)),Qe(E,vs(h,Yl,W),Ae)}}var Jt=S.wrapper.getBoundingClientRect(),oi=0;function mi(gn){var Vn=++oi,Hr=vl(h,gn,!0,y.unit=="rectangle");if(Hr)if(ui(Hr,pt)!=0){h.curOp.focus=Ke(),oe(Hr);var bn=Rr(S,E);(Hr.line>=bn.to||Hr.line<bn.from)&&setTimeout(Wn(h,function(){oi==Vn&&mi(gn)}),150)}else{var rs=gn.clientY<Jt.top?-20:gn.clientY>Jt.bottom?20:0;rs&&setTimeout(Wn(h,function(){oi==Vn&&(S.scroller.scrollTop+=rs,mi(gn))}),50)}}function Ii(gn){h.state.selectingText=!1,oi=1/0,gn&&(fs(gn),S.input.focus()),$o(S.wrapper.ownerDocument,"mousemove",on),$o(S.wrapper.ownerDocument,"mouseup",Bn),E.history.lastSelOrigin=null}var on=Wn(h,function(gn){gn.buttons===0||!xo(gn)?Ii(gn):mi(gn)}),Bn=Wn(h,Ii);h.state.selectingText=Bn,We(S.wrapper.ownerDocument,"mousemove",on),We(S.wrapper.ownerDocument,"mouseup",Bn)}function gu(h,d){var x=d.anchor,y=d.head,S=yt(h.doc,x.line);if(ui(x,y)==0&&x.sticky==y.sticky)return d;var E=rr(S);if(!E)return d;var O=Gi(E,x.ch,x.sticky),W=E[O];if(W.from!=x.ch&&W.to!=x.ch)return d;var H=O+(W.from==x.ch==(W.level!=1)?0:1);if(H==0||H==E.length)return d;var nt;if(y.line!=x.line)nt=(y.line-x.line)*(h.doc.direction=="ltr"?1:-1)>0;else{var Rt=Gi(E,y.ch,y.sticky),pt=Rt-O||(y.ch-x.ch)*(W.level==1?-1:1);Rt==H-1||Rt==H?nt=pt<0:nt=pt>0}var oe=E[H+(nt?-1:0)],Jt=nt==(oe.level==1),oi=Jt?oe.from:oe.to,mi=Jt?"after":"before";return x.ch==oi&&x.sticky==mi?d:new oo(new Qt(x.line,oi,mi),y)}function Dh(h,d,x,y){var S,E;if(d.touches)S=d.touches[0].clientX,E=d.touches[0].clientY;else try{S=d.clientX,E=d.clientY}catch(oe){return!1}if(S>=Math.floor(h.display.gutters.getBoundingClientRect().right))return!1;y&&fs(d);var O=h.display,W=O.lineDiv.getBoundingClientRect();if(E>W.bottom||!uo(h,x))return Ja(d);E-=W.top-O.viewOffset;for(var H=0;H<h.display.gutterSpecs.length;++H){var nt=O.gutters.childNodes[H];if(nt&&nt.getBoundingClientRect().right>=S){var Rt=ie(h.doc,E),pt=h.display.gutterSpecs[H];return yo(h,x,h,Rt,pt.className,d),Ja(d)}}}function ou(h,d){return Dh(h,d,"gutterClick",!0)}function Wh(h,d){Tl(h.display,d)||Af(h,d)||Fr(h,d,"contextmenu")||kt||h.display.input.onContextMenu(d)}function Af(h,d){return uo(h,"gutterContextMenu")?Dh(h,d,"gutterContextMenu",!1):!1}function Yc(h){h.display.wrapper.className=h.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+h.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fu(h)}var Ku={toString:function(){return"CodeMirror.Init"}},Df={},Jc={};function Bc(h){var d=h.optionHandlers;function x(y,S,E,O){h.defaults[y]=S,E&&(d[y]=O?function(W,H,nt){nt!=Ku&&E(W,H,nt)}:E)}h.defineOption=x,h.Init=Ku,x("value","",function(y,S){return y.setValue(S)},!0),x("mode",null,function(y,S){y.doc.modeOption=S,mr(y)},!0),x("indentUnit",2,mr,!0),x("indentWithTabs",!1),x("smartIndent",!0),x("tabSize",4,function(y){Dl(y),fu(y),oa(y)},!0),x("lineSeparator",null,function(y,S){if(y.doc.lineSep=S,!!S){var E=[],O=y.doc.first;y.doc.iter(function(H){for(var nt=0;;){var Rt=H.text.indexOf(S,nt);if(Rt==-1)break;nt=Rt+S.length,E.push(Qt(O,Rt))}O++});for(var W=E.length-1;W>=0;W--)In(y.doc,S,E[W],Qt(E[W].line,E[W].ch+S.length))}}),x("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(y,S,E){y.state.specialChars=new RegExp(S.source+(S.test(" ")?"":"| "),"g"),E!=Ku&&y.refresh()}),x("specialCharPlaceholder",yn,function(y){return y.refresh()},!0),x("electricChars",!0),x("inputStyle",zt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),x("spellcheck",!1,function(y,S){return y.getInputField().spellcheck=S},!0),x("autocorrect",!1,function(y,S){return y.getInputField().autocorrect=S},!0),x("autocapitalize",!1,function(y,S){return y.getInputField().autocapitalize=S},!0),x("rtlMoveVisually",!$e),x("wholeLineUpdateBefore",!0),x("theme","default",function(y){Yc(y),Ps(y)},!0),x("keyMap","default",function(y,S,E){var O=Eo(S),W=E!=Ku&&Eo(E);W&&W.detach&&W.detach(y,O),O.attach&&O.attach(y,W||null)}),x("extraKeys",null),x("configureMouse",null),x("lineWrapping",!1,qc,!0),x("gutters",[],function(y,S){y.display.gutterSpecs=Qr(S,y.options.lineNumbers),Ps(y)},!0),x("fixedGutter",!0,function(y,S){y.display.gutters.style.left=S?Cc(y.display)+"px":"0",y.refresh()},!0),x("coverGutterNextToScrollbar",!1,function(y){return ht(y)},!0),x("scrollbarStyle","native",function(y){Ut(y),ht(y),y.display.scrollbars.setScrollTop(y.doc.scrollTop),y.display.scrollbars.setScrollLeft(y.doc.scrollLeft)},!0),x("lineNumbers",!1,function(y,S){y.display.gutterSpecs=Qr(y.options.gutters,S),Ps(y)},!0),x("firstLineNumber",1,Ps,!0),x("lineNumberFormatter",function(y){return y},Ps,!0),x("showCursorWhenSelecting",!1,_s,!0),x("resetSelectionOnContextMenu",!0),x("lineWiseCopyCut",!0),x("pasteLinesPerSelection",!0),x("selectionsMayTouch",!1),x("readOnly",!1,function(y,S){S=="nocursor"&&(pf(y),y.display.input.blur()),y.display.input.readOnlyChanged(S)}),x("screenReaderLabel",null,function(y,S){S=S===""?null:S,y.display.input.screenReaderLabelChanged(S)}),x("disableInput",!1,function(y,S){S||y.display.input.reset()},!0),x("dragDrop",!0,Tc),x("allowDropFileTypes",null),x("cursorBlinkRate",530),x("cursorScrollMargin",0),x("cursorHeight",1,_s,!0),x("singleCursorHeightPerLine",!0,_s,!0),x("workTime",100),x("workDelay",100),x("flattenSpans",!0,Dl,!0),x("addModeClass",!1,Dl,!0),x("pollInterval",100),x("undoDepth",200,function(y,S){return y.doc.history.undoDepth=S}),x("historyEventDelay",1250),x("viewportMargin",10,function(y){return y.refresh()},!0),x("maxHighlightLength",1e4,Dl,!0),x("moveInputWithCursor",!0,function(y,S){S||y.display.input.resetPosition()}),x("tabindex",null,function(y,S){return y.display.input.getField().tabIndex=S||""}),x("autofocus",null),x("direction","ltr",function(y,S){return y.doc.setDirection(S)},!0),x("phrases",null)}function Tc(h,d,x){var y=x&&x!=Ku;if(!d!=!y){var S=h.display.dragFunctions,E=d?We:$o;E(h.display.scroller,"dragstart",S.start),E(h.display.scroller,"dragenter",S.enter),E(h.display.scroller,"dragover",S.over),E(h.display.scroller,"dragleave",S.leave),E(h.display.scroller,"drop",S.drop)}}function qc(h){h.options.lineWrapping?(ki(h.display.wrapper,"CodeMirror-wrap"),h.display.sizer.style.minWidth="",h.display.sizerWidth=null):(Ot(h.display.wrapper,"CodeMirror-wrap"),Ur(h)),zn(h),oa(h),fu(h),setTimeout(function(){return ht(h)},100)}function ur(h,d){var x=this;if(!(this instanceof ur))return new ur(h,d);this.options=d=d?Ki(d):{},Ki(Df,d,!1);var y=d.value;typeof y=="string"?y=new tn(y,d.mode,null,d.lineSeparator,d.direction):d.mode&&(y.modeOption=d.mode),this.doc=y;var S=new ur.inputStyles[d.inputStyle](this),E=this.display=new xs(h,y,S,d);E.wrapper.CodeMirror=this,Yc(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ut(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new tt,keySeq:null,specialChars:null},d.autofocus&&!zt&&E.input.focus(),gt&&ft<11&&setTimeout(function(){return x.display.input.reset(!0)},20),Ih(this),br(),ke(this),this.curOp.forceUpdate=!0,Au(this,y),d.autofocus&&!zt||this.hasFocus()?setTimeout(function(){x.hasFocus()&&!x.state.focused&&ms(x)},20):pf(this);for(var O in Jc)Jc.hasOwnProperty(O)&&Jc[O](this,d[O],Ku);Cr(this),d.finishInit&&d.finishInit(this);for(var W=0;W<vh.length;++W)vh[W](this);Ri(this),ct&&d.lineWrapping&&getComputedStyle(E.lineDiv).textRendering=="optimizelegibility"&&(E.lineDiv.style.textRendering="auto")}ur.defaults=Df,ur.optionHandlers=Jc;function Ih(h){var d=h.display;We(d.scroller,"mousedown",Wn(h,Ds)),gt&&ft<11?We(d.scroller,"dblclick",Wn(h,function(H){if(!Fr(h,H)){var nt=vl(h,H);if(!(!nt||ou(h,H)||Tl(h.display,H))){fs(H);var Rt=h.findWordAt(nt);Dt(h.doc,Rt.anchor,Rt.head)}}})):We(d.scroller,"dblclick",function(H){return Fr(h,H)||fs(H)}),We(d.scroller,"contextmenu",function(H){return Wh(h,H)}),We(d.input.getField(),"contextmenu",function(H){d.scroller.contains(H.target)||Wh(h,H)});var x,y={end:0};function S(){d.activeTouch&&(x=setTimeout(function(){return d.activeTouch=null},1e3),y=d.activeTouch,y.end=+new Date)}function E(H){if(H.touches.length!=1)return!1;var nt=H.touches[0];return nt.radiusX<=1&&nt.radiusY<=1}function O(H,nt){if(nt.left==null)return!0;var Rt=nt.left-H.left,pt=nt.top-H.top;return Rt*Rt+pt*pt>20*20}We(d.scroller,"touchstart",function(H){if(!Fr(h,H)&&!E(H)&&!ou(h,H)){d.input.ensurePolled(),clearTimeout(x);var nt=+new Date;d.activeTouch={start:nt,moved:!1,prev:nt-y.end<=300?y:null},H.touches.length==1&&(d.activeTouch.left=H.touches[0].pageX,d.activeTouch.top=H.touches[0].pageY)}}),We(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)}),We(d.scroller,"touchend",function(H){var nt=d.activeTouch;if(nt&&!Tl(d,H)&&nt.left!=null&&!nt.moved&&new Date-nt.start<300){var Rt=h.coordsChar(d.activeTouch,"page"),pt;!nt.prev||O(nt,nt.prev)?pt=new oo(Rt,Rt):!nt.prev.prev||O(nt,nt.prev.prev)?pt=h.findWordAt(Rt):pt=new oo(Qt(Rt.line,0),Xi(h.doc,Qt(Rt.line+1,0))),h.setSelection(pt.anchor,pt.head),h.focus(),fs(H)}S()}),We(d.scroller,"touchcancel",S),We(d.scroller,"scroll",function(){d.scroller.clientHeight&&(oh(h,d.scroller.scrollTop),sc(h,d.scroller.scrollLeft,!0),yo(h,"scroll",h))}),We(d.scroller,"mousewheel",function(H){return Ks(h,H)}),We(d.scroller,"DOMMouseScroll",function(H){return Ks(h,H)}),We(d.wrapper,"scroll",function(){return d.wrapper.scrollTop=d.wrapper.scrollLeft=0}),d.dragFunctions={enter:function(H){Fr(h,H)||jl(H)},over:function(H){Fr(h,H)||(ar(h,H),jl(H))},start:function(H){return No(h,H)},drop:Wn(h,Po),leave:function(H){Fr(h,H)||Mo(h)}};var W=d.input.getField();We(W,"keyup",function(H){return to.call(h,H)}),We(W,"keydown",Wn(h,Un)),We(W,"keypress",Wn(h,Bs)),We(W,"focus",function(H){return ms(h,H)}),We(W,"blur",function(H){return pf(h,H)})}var vh=[];ur.defineInitHook=function(h){return vh.push(h)};function xa(h,d,x,y){var S=h.doc,E;x==null&&(x="add"),x=="smart"&&(S.mode.indent?E=bo(h,d).state:x="prev");var O=h.options.tabSize,W=yt(S,d),H=It(W.text,null,O);W.stateAfter&&(W.stateAfter=null);var nt=W.text.match(/^\s*/)[0],Rt;if(!y&&!/\S/.test(W.text))Rt=0,x="not";else if(x=="smart"&&(Rt=S.mode.indent(E,W.text.slice(nt.length),W.text),Rt==Ze||Rt>150)){if(!y)return;x="prev"}x=="prev"?d>S.first?Rt=It(yt(S,d-1).text,null,O):Rt=0:x=="add"?Rt=H+h.options.indentUnit:x=="subtract"?Rt=H-h.options.indentUnit:typeof x=="number"&&(Rt=H+x),Rt=Math.max(0,Rt);var pt="",oe=0;if(h.options.indentWithTabs)for(var Jt=Math.floor(Rt/O);Jt;--Jt)oe+=O,pt+=" ";if(oe<Rt&&(pt+=vi(Rt-oe)),pt!=nt)return In(S,pt,Qt(d,0),Qt(d,nt.length),"+input"),W.stateAfter=null,!0;for(var oi=0;oi<S.sel.ranges.length;oi++){var mi=S.sel.ranges[oi];if(mi.head.line==d&&mi.head.ch<nt.length){var Ii=Qt(d,nt.length);Xt(S,oi,new oo(Ii,Ii));break}}}var Ul=null;function Iu(h){Ul=h}function Uo(h,d,x,y,S){var E=h.doc;h.display.shift=!1,y||(y=E.sel);var O=+new Date-200,W=S=="paste"||h.state.pasteIncoming>O,H=Me(d),nt=null;if(W&&y.ranges.length>1)if(Ul&&Ul.text.join(`
|
|
|
`)==d){if(y.ranges.length%Ul.text.length==0){nt=[];for(var Rt=0;Rt<Ul.text.length;Rt++)nt.push(E.splitLines(Ul.text[Rt]))}}else H.length==y.ranges.length&&h.options.pasteLinesPerSelection&&(nt=zi(H,function(on){return[on]}));for(var pt=h.curOp.updateInput,oe=y.ranges.length-1;oe>=0;oe--){var Jt=y.ranges[oe],oi=Jt.from(),mi=Jt.to();Jt.empty()&&(x&&x>0?oi=Qt(oi.line,oi.ch-x):h.state.overwrite&&!W?mi=Qt(mi.line,Math.min(yt(E,mi.line).text.length,mi.ch+ai(H).length)):W&&Ul&&Ul.lineWise&&Ul.text.join(`
|
|
|
`)==H.join(`
|
|
|
`)&&(oi=mi=Qt(oi.line,0)));var Ii={from:oi,to:mi,text:nt?nt[oe%nt.length]:H,origin:S||(W?"paste":h.state.cutIncoming>O?"cut":"+input")};Hi(h.doc,Ii),Ai(h,"inputRead",h,Ii)}d&&!W&&Zl(h,d),Hh(h),h.curOp.updateInput<2&&(h.curOp.updateInput=pt),h.curOp.typing=!0,h.state.pasteIncoming=h.state.cutIncoming=-1}function ns(h,d){var x=h.clipboardData&&h.clipboardData.getData("Text");if(x)return h.preventDefault(),!d.isReadOnly()&&!d.options.disableInput&&Di(d,function(){return Uo(d,x,0,null,"paste")}),!0}function Zl(h,d){if(!(!h.options.electricChars||!h.options.smartIndent))for(var x=h.doc.sel,y=x.ranges.length-1;y>=0;y--){var S=x.ranges[y];if(!(S.head.ch>100||y&&x.ranges[y-1].head.line==S.head.line)){var E=h.getModeAt(S.head),O=!1;if(E.electricChars){for(var W=0;W<E.electricChars.length;W++)if(d.indexOf(E.electricChars.charAt(W))>-1){O=xa(h,S.head.line,"smart");break}}else E.electricInput&&E.electricInput.test(yt(h.doc,S.head.line).text.slice(0,S.head.ch))&&(O=xa(h,S.head.line,"smart"));O&&Ai(h,"electricInput",h,S.head.line)}}}function Gl(h){for(var d=[],x=[],y=0;y<h.doc.sel.ranges.length;y++){var S=h.doc.sel.ranges[y].head.line,E={anchor:Qt(S,0),head:Qt(S+1,0)};x.push(E),d.push(h.getRange(E.anchor,E.head))}return{text:d,ranges:x}}function Cl(h,d,x,y){h.setAttribute("autocorrect",x?"":"off"),h.setAttribute("autocapitalize",y?"":"off"),h.setAttribute("spellcheck",!!d)}function Ou(){var h=_e("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),d=_e("div",[h],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ct?h.style.width="1000px":h.setAttribute("wrap","off"),le&&(h.style.border="1px solid black"),Cl(h),d}function Xl(h){var d=h.optionHandlers,x=h.helpers={};h.prototype={constructor:h,focus:function(){window.focus(),this.display.input.focus()},setOption:function(y,S){var E=this.options,O=E[y];E[y]==S&&y!="mode"||(E[y]=S,d.hasOwnProperty(y)&&Wn(this,d[y])(this,S,O),yo(this,"optionChange",this,y))},getOption:function(y){return this.options[y]},getDoc:function(){return this.doc},addKeyMap:function(y,S){this.state.keyMaps[S?"push":"unshift"](Eo(y))},removeKeyMap:function(y){for(var S=this.state.keyMaps,E=0;E<S.length;++E)if(S[E]==y||S[E].name==y)return S.splice(E,1),!0},addOverlay:Ln(function(y,S){var E=y.token?y:h.getMode(this.options,y);if(E.startState)throw new Error("Overlays may not be stateful.");$i(this.state.overlays,{mode:E,modeSpec:y,opaque:S&&S.opaque,priority:S&&S.priority||0},function(O){return O.priority}),this.state.modeGen++,oa(this)}),removeOverlay:Ln(function(y){for(var S=this.state.overlays,E=0;E<S.length;++E){var O=S[E].modeSpec;if(O==y||typeof y=="string"&&O.name==y){S.splice(E,1),this.state.modeGen++,oa(this);return}}}),indentLine:Ln(function(y,S,E){typeof S!="string"&&typeof S!="number"&&(S==null?S=this.options.smartIndent?"smart":"prev":S=S?"add":"subtract"),Re(this.doc,y)&&xa(this,y,S,E)}),indentSelection:Ln(function(y){for(var S=this.doc.sel.ranges,E=-1,O=0;O<S.length;O++){var W=S[O];if(W.empty())W.head.line>E&&(xa(this,W.head.line,y,!0),E=W.head.line,O==this.doc.sel.primIndex&&Hh(this));else{var H=W.from(),nt=W.to(),Rt=Math.max(E,H.line);E=Math.min(this.lastLine(),nt.line-(nt.ch?0:1))+1;for(var pt=Rt;pt<E;++pt)xa(this,pt,y);var oe=this.doc.sel.ranges;H.ch==0&&S.length==oe.length&&oe[O].from().ch>0&&Xt(this.doc,O,new oo(H,oe[O].to()),Ye)}}}),getTokenAt:function(y,S){return Ma(this,y,S)},getLineTokens:function(y,S){return Ma(this,Qt(y),S,!0)},getTokenTypeAt:function(y){y=Xi(this.doc,y);var S=qr(this,yt(this.doc,y.line)),E=0,O=(S.length-1)/2,W=y.ch,H;if(W==0)H=S[2];else for(;;){var nt=E+O>>1;if((nt?S[nt*2-1]:0)>=W)O=nt;else if(S[nt*2+1]<W)E=nt+1;else{H=S[nt*2+2];break}}var Rt=H?H.indexOf("overlay "):-1;return Rt<0?H:Rt==0?null:H.slice(0,Rt-1)},getModeAt:function(y){var S=this.doc.mode;return S.innerMode?h.innerMode(S,this.getTokenAt(y).state).mode:S},getHelper:function(y,S){return this.getHelpers(y,S)[0]},getHelpers:function(y,S){var E=[];if(!x.hasOwnProperty(S))return E;var O=x[S],W=this.getModeAt(y);if(typeof W[S]=="string")O[W[S]]&&E.push(O[W[S]]);else if(W[S])for(var H=0;H<W[S].length;H++){var nt=O[W[S][H]];nt&&E.push(nt)}else W.helperType&&O[W.helperType]?E.push(O[W.helperType]):O[W.name]&&E.push(O[W.name]);for(var Rt=0;Rt<O._global.length;Rt++){var pt=O._global[Rt];pt.pred(W,this)&&de(E,pt.val)==-1&&E.push(pt.val)}return E},getStateAfter:function(y,S){var E=this.doc;return y=Ji(E,y==null?E.first+E.size-1:y),bo(this,y+1,S).state},cursorCoords:function(y,S){var E,O=this.doc.sel.primary();return y==null?E=O.head:typeof y=="object"?E=Xi(this.doc,y):E=y?O.from():O.to(),Hs(this,E,S||"page")},charCoords:function(y,S){return rc(this,Xi(this.doc,y),S||"page")},coordsChar:function(y,S){return y=bu(this,y,S||"page"),bc(this,y.left,y.top)},lineAtHeight:function(y,S){return y=bu(this,{top:y,left:0},S||"page").top,ie(this.doc,y+this.display.viewOffset)},heightAtLine:function(y,S,E){var O=!1,W;if(typeof y=="number"){var H=this.doc.first+this.doc.size-1;y<this.doc.first?y=this.doc.first:y>H&&(y=H,O=!0),W=yt(this.doc,y)}else W=y;return ka(this,W,{top:0,left:0},S||"page",E||O).top+(O?this.doc.height-An(W):0)},defaultTextHeight:function(){return Nh(this.display)},defaultCharWidth:function(){return Su(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(y,S,E,O,W){var H=this.display;y=Hs(this,Xi(this.doc,y));var nt=y.bottom,Rt=y.left;if(S.style.position="absolute",S.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(S),H.sizer.appendChild(S),O=="over")nt=y.top;else if(O=="above"||O=="near"){var pt=Math.max(H.wrapper.clientHeight,this.doc.height),oe=Math.max(H.sizer.clientWidth,H.lineSpace.clientWidth);(O=="above"||y.bottom+S.offsetHeight>pt)&&y.top>S.offsetHeight?nt=y.top-S.offsetHeight:y.bottom+S.offsetHeight<=pt&&(nt=y.bottom),Rt+S.offsetWidth>oe&&(Rt=oe-S.offsetWidth)}S.style.top=nt+"px",S.style.left=S.style.right="",W=="right"?(Rt=H.sizer.clientWidth-S.offsetWidth,S.style.right="0px"):(W=="left"?Rt=0:W=="middle"&&(Rt=(H.sizer.clientWidth-S.offsetWidth)/2),S.style.left=Rt+"px"),E&&Pf(this,{left:Rt,top:nt,right:Rt+S.offsetWidth,bottom:nt+S.offsetHeight})},triggerOnKeyDown:Ln(Un),triggerOnKeyPress:Ln(Bs),triggerOnKeyUp:to,triggerOnMouseDown:Ln(Ds),execCommand:function(y){if(Vl.hasOwnProperty(y))return Vl[y].call(null,this)},triggerElectric:Ln(function(y){Zl(this,y)}),findPosH:function(y,S,E,O){var W=1;S<0&&(W=-1,S=-S);for(var H=Xi(this.doc,y),nt=0;nt<S&&(H=Uh(this.doc,H,W,E,O),!H.hitSide);++nt);return H},moveH:Ln(function(y,S){var E=this;this.extendSelectionsBy(function(O){return E.display.shift||E.doc.extend||O.empty()?Uh(E.doc,O.head,y,S,E.options.rtlMoveVisually):y<0?O.from():O.to()},Wi)}),deleteH:Ln(function(y,S){var E=this.doc.sel,O=this.doc;E.somethingSelected()?O.replaceSelection("",null,"+delete"):Rs(this,function(W){var H=Uh(O,W.head,y,S,!1);return y<0?{from:H,to:W.head}:{from:W.head,to:H}})}),findPosV:function(y,S,E,O){var W=1,H=O;S<0&&(W=-1,S=-S);for(var nt=Xi(this.doc,y),Rt=0;Rt<S;++Rt){var pt=Hs(this,nt,"div");if(H==null?H=pt.left:pt.left=H,nt=Ru(this,pt,W,E),nt.hitSide)break}return nt},moveV:Ln(function(y,S){var E=this,O=this.doc,W=[],H=!this.display.shift&&!O.extend&&O.sel.somethingSelected();if(O.extendSelectionsBy(function(Rt){if(H)return y<0?Rt.from():Rt.to();var pt=Hs(E,Rt.head,"div");Rt.goalColumn!=null&&(pt.left=Rt.goalColumn),W.push(pt.left);var oe=Ru(E,pt,y,S);return S=="page"&&Rt==O.sel.primary()&&mf(E,rc(E,oe,"div").top-pt.top),oe},Wi),W.length)for(var nt=0;nt<O.sel.ranges.length;nt++)O.sel.ranges[nt].goalColumn=W[nt]}),findWordAt:function(y){var S=this.doc,E=yt(S,y.line).text,O=y.ch,W=y.ch;if(E){var H=this.getHelper(y,"wordChars");(y.sticky=="before"||W==E.length)&&O?--O:++W;for(var nt=E.charAt(O),Rt=z(nt,H)?function(pt){return z(pt,H)}:/\s/.test(nt)?function(pt){return/\s/.test(pt)}:function(pt){return!/\s/.test(pt)&&!z(pt)};O>0&&Rt(E.charAt(O-1));)--O;for(;W<E.length&&Rt(E.charAt(W));)++W}return new oo(Qt(y.line,O),Qt(y.line,W))},toggleOverwrite:function(y){y!=null&&y==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ki(this.display.cursorDiv,"CodeMirror-overwrite"):Ot(this.display.cursorDiv,"CodeMirror-overwrite"),yo(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Ke()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ln(function(y,S){Rc(this,y,S)}),getScrollInfo:function(){var y=this.display.scroller;return{left:y.scrollLeft,top:y.scrollTop,height:y.scrollHeight-ml(this)-this.display.barHeight,width:y.scrollWidth-ml(this)-this.display.barWidth,clientHeight:Js(this),clientWidth:sl(this)}},scrollIntoView:Ln(function(y,S){y==null?(y={from:this.doc.sel.primary().head,to:null},S==null&&(S=this.options.cursorScrollMargin)):typeof y=="number"?y={from:Qt(y,0),to:null}:y.from==null&&(y={from:y,to:null}),y.to||(y.to=y.from),y.margin=S||0,y.from.line!=null?as(this,y):Jf(this,y.from,y.to,y.margin)}),setSize:Ln(function(y,S){var E=this,O=function(H){return typeof H=="number"||/^\d+$/.test(String(H))?H+"px":H};y!=null&&(this.display.wrapper.style.width=O(y)),S!=null&&(this.display.wrapper.style.height=O(S)),this.options.lineWrapping&&wu(this);var W=this.display.viewFrom;this.doc.iter(W,this.display.viewTo,function(H){if(H.widgets){for(var nt=0;nt<H.widgets.length;nt++)if(H.widgets[nt].noHScroll){po(E,W,"widget");break}}++W}),this.curOp.forceUpdate=!0,yo(this,"refresh",this)}),operation:function(y){return Di(this,y)},startOperation:function(){return ke(this)},endOperation:function(){return Ri(this)},refresh:Ln(function(){var y=this.display.cachedTextHeight;oa(this),this.curOp.forceUpdate=!0,fu(this),Rc(this,this.doc.scrollLeft,this.doc.scrollTop),Cs(this.display),(y==null||Math.abs(y-Nh(this.display))>.5||this.options.lineWrapping)&&zn(this),yo(this,"refresh",this)}),swapDoc:Ln(function(y){var S=this.doc;return S.cm=null,this.state.selectingText&&this.state.selectingText(),Au(this,y),fu(this),this.display.input.reset(),Rc(this,y.scrollLeft,y.scrollTop),this.curOp.forceScroll=!0,Ai(this,"swapDoc",this,S),S}),phrase:function(y){var S=this.options.phrases;return S&&Object.prototype.hasOwnProperty.call(S,y)?S[y]:y},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ao(h),h.registerHelper=function(y,S,E){x.hasOwnProperty(y)||(x[y]=h[y]={_global:[]}),x[y][S]=E},h.registerGlobalHelper=function(y,S,E,O){h.registerHelper(y,S,O),x[y]._global.push({pred:E,val:O})}}function Uh(h,d,x,y,S){var E=d,O=x,W=yt(h,d.line),H=S&&h.direction=="rtl"?-x:x;function nt(){var Bn=d.line+H;return Bn<h.first||Bn>=h.first+h.size?!1:(d=new Qt(Bn,d.ch,d.sticky),W=yt(h,Bn))}function Rt(Bn){var gn;if(y=="codepoint"){var Vn=W.text.charCodeAt(d.ch+(y>0?0:-1));isNaN(Vn)?gn=null:gn=new Qt(d.line,Math.max(0,Math.min(W.text.length,d.ch+x*(Vn>=55296&&Vn<56320?2:1))),-x)}else S?gn=Zs(h.cm,W,d,x):gn=Vo(W,d,x);if(gn==null)if(!Bn&&nt())d=ha(S,h.cm,W,d.line,H);else return!1;else d=gn;return!0}if(y=="char"||y=="codepoint")Rt();else if(y=="column")Rt(!0);else if(y=="word"||y=="group")for(var pt=null,oe=y=="group",Jt=h.cm&&h.cm.getHelper(d,"wordChars"),oi=!0;!(x<0&&!Rt(!oi));oi=!1){var mi=W.text.charAt(d.ch)||`
|
|
|
`,Ii=z(mi,Jt)?"w":oe&&mi==`
|
|
|
`?"n":!oe||/\s/.test(mi)?null:"p";if(oe&&!oi&&!Ii&&(Ii="s"),pt&&pt!=Ii){x<0&&(x=1,Rt(),d.sticky="after");break}if(Ii&&(pt=Ii),x>0&&!Rt(!oi))break}var on=Mi(h,d,E,O,!0);return vr(E,on)&&(on.hitSide=!0),on}function Ru(h,d,x,y){var S=h.doc,E=d.left,O;if(y=="page"){var W=Math.min(h.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),H=Math.max(W-.5*Nh(h.display),3);O=(x>0?d.bottom:d.top)+x*H}else y=="line"&&(O=x>0?d.bottom+3:d.top-3);for(var nt;nt=bc(h,E,O),!!nt.outside;){if(x<0?O<=0:O>=S.height){nt.hitSide=!0;break}O+=x*5}return nt}var Fs=function(h){this.cm=h,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new tt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Fs.prototype.init=function(h){var d=this,x=this,y=x.cm,S=x.div=h.lineDiv;Cl(S,y.options.spellcheck,y.options.autocorrect,y.options.autocapitalize);function E(W){for(var H=W.target;H;H=H.parentNode){if(H==S)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(H.className))break}return!1}We(S,"paste",function(W){!E(W)||Fr(y,W)||ns(W,y)||ft<=11&&setTimeout(Wn(y,function(){return d.updateFromDOM()}),20)}),We(S,"compositionstart",function(W){d.composing={data:W.data,done:!1}}),We(S,"compositionupdate",function(W){d.composing||(d.composing={data:W.data,done:!1})}),We(S,"compositionend",function(W){d.composing&&(W.data!=d.composing.data&&d.readFromDOMSoon(),d.composing.done=!0)}),We(S,"touchstart",function(){return x.forceCompositionEnd()}),We(S,"input",function(){d.composing||d.readFromDOMSoon()});function O(W){if(!(!E(W)||Fr(y,W))){if(y.somethingSelected())Iu({lineWise:!1,text:y.getSelections()}),W.type=="cut"&&y.replaceSelection("",null,"cut");else if(y.options.lineWiseCopyCut){var H=Gl(y);Iu({lineWise:!0,text:H.text}),W.type=="cut"&&y.operation(function(){y.setSelections(H.ranges,0,Ye),y.replaceSelection("",null,"cut")})}else return;if(W.clipboardData){W.clipboardData.clearData();var nt=Ul.text.join(`
|
|
|
`);if(W.clipboardData.setData("Text",nt),W.clipboardData.getData("Text")==nt){W.preventDefault();return}}var Rt=Ou(),pt=Rt.firstChild;y.display.lineSpace.insertBefore(Rt,y.display.lineSpace.firstChild),pt.value=Ul.text.join(`
|
|
|
`);var oe=document.activeElement;Sn(pt),setTimeout(function(){y.display.lineSpace.removeChild(Rt),oe.focus(),oe==S&&x.showPrimarySelection()},50)}}We(S,"copy",O),We(S,"cut",O)},Fs.prototype.screenReaderLabelChanged=function(h){h?this.div.setAttribute("aria-label",h):this.div.removeAttribute("aria-label")},Fs.prototype.prepareSelection=function(){var h=sa(this.cm,!1);return h.focus=document.activeElement==this.div,h},Fs.prototype.showSelection=function(h,d){!h||!this.cm.display.view.length||((h.focus||d)&&this.showPrimarySelection(),this.showMultipleSelections(h))},Fs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fs.prototype.showPrimarySelection=function(){var h=this.getSelection(),d=this.cm,x=d.doc.sel.primary(),y=x.from(),S=x.to();if(d.display.viewTo==d.display.viewFrom||y.line>=d.display.viewTo||S.line<d.display.viewFrom){h.removeAllRanges();return}var E=yh(d,h.anchorNode,h.anchorOffset),O=yh(d,h.focusNode,h.focusOffset);if(!(E&&!E.bad&&O&&!O.bad&&ui(gi(E,O),y)==0&&ui(Lr(E,O),S)==0)){var W=d.display.view,H=y.line>=d.display.viewFrom&&Oh(d,y)||{node:W[0].measure.map[2],offset:0},nt=S.line<d.display.viewTo&&Oh(d,S);if(!nt){var Rt=W[W.length-1].measure,pt=Rt.maps?Rt.maps[Rt.maps.length-1]:Rt.map;nt={node:pt[pt.length-1],offset:pt[pt.length-2]-pt[pt.length-3]}}if(!H||!nt){h.removeAllRanges();return}var oe=h.rangeCount&&h.getRangeAt(0),Jt;try{Jt=Ht(H.node,H.offset,nt.offset,nt.node)}catch(oi){}Jt&&(!Nt&&d.state.focused?(h.collapse(H.node,H.offset),Jt.collapsed||(h.removeAllRanges(),h.addRange(Jt))):(h.removeAllRanges(),h.addRange(Jt)),oe&&h.anchorNode==null?h.addRange(oe):Nt&&this.startGracePeriod()),this.rememberSelection()}},Fs.prototype.startGracePeriod=function(){var h=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){h.gracePeriod=!1,h.selectionChanged()&&h.cm.operation(function(){return h.cm.curOp.selectionChanged=!0})},20)},Fs.prototype.showMultipleSelections=function(h){Te(this.cm.display.cursorDiv,h.cursors),Te(this.cm.display.selectionDiv,h.selection)},Fs.prototype.rememberSelection=function(){var h=this.getSelection();this.lastAnchorNode=h.anchorNode,this.lastAnchorOffset=h.anchorOffset,this.lastFocusNode=h.focusNode,this.lastFocusOffset=h.focusOffset},Fs.prototype.selectionInEditor=function(){var h=this.getSelection();if(!h.rangeCount)return!1;var d=h.getRangeAt(0).commonAncestorContainer;return pe(this.div,d)},Fs.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fs.prototype.blur=function(){this.div.blur()},Fs.prototype.getField=function(){return this.div},Fs.prototype.supportsTouch=function(){return!0},Fs.prototype.receivedFocus=function(){var h=this;this.selectionInEditor()?this.pollSelection():Di(this.cm,function(){return h.cm.curOp.selectionChanged=!0});function d(){h.cm.state.focused&&(h.pollSelection(),h.polling.set(h.cm.options.pollInterval,d))}this.polling.set(this.cm.options.pollInterval,d)},Fs.prototype.selectionChanged=function(){var h=this.getSelection();return h.anchorNode!=this.lastAnchorNode||h.anchorOffset!=this.lastAnchorOffset||h.focusNode!=this.lastFocusNode||h.focusOffset!=this.lastFocusOffset},Fs.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var h=this.getSelection(),d=this.cm;if(Zt&&F&&this.cm.display.gutterSpecs.length&&gf(h.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var x=yh(d,h.anchorNode,h.anchorOffset),y=yh(d,h.focusNode,h.focusOffset);x&&y&&Di(d,function(){Qe(d.doc,ks(x,y),Ye),(x.bad||y.bad)&&(d.curOp.selectionChanged=!0)})}}},Fs.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var h=this.cm,d=h.display,x=h.doc.sel.primary(),y=x.from(),S=x.to();if(y.ch==0&&y.line>h.firstLine()&&(y=Qt(y.line-1,yt(h.doc,y.line-1).length)),S.ch==yt(h.doc,S.line).text.length&&S.line<h.lastLine()&&(S=Qt(S.line+1,0)),y.line<d.viewFrom||S.line>d.viewTo-1)return!1;var E,O,W;y.line==d.viewFrom||(E=Al(h,y.line))==0?(O=Mt(d.view[0].line),W=d.view[0].node):(O=Mt(d.view[E].line),W=d.view[E-1].node.nextSibling);var H=Al(h,S.line),nt,Rt;if(H==d.view.length-1?(nt=d.viewTo-1,Rt=d.lineDiv.lastChild):(nt=Mt(d.view[H+1].line)-1,Rt=d.view[H+1].node.previousSibling),!W)return!1;for(var pt=h.doc.splitLines(Of(h,W,Rt,O,nt)),oe=me(h.doc,Qt(O,0),Qt(nt,yt(h.doc,nt).text.length));pt.length>1&&oe.length>1;)if(ai(pt)==ai(oe))pt.pop(),oe.pop(),nt--;else if(pt[0]==oe[0])pt.shift(),oe.shift(),O++;else break;for(var Jt=0,oi=0,mi=pt[0],Ii=oe[0],on=Math.min(mi.length,Ii.length);Jt<on&&mi.charCodeAt(Jt)==Ii.charCodeAt(Jt);)++Jt;for(var Bn=ai(pt),gn=ai(oe),Vn=Math.min(Bn.length-(pt.length==1?Jt:0),gn.length-(oe.length==1?Jt:0));oi<Vn&&Bn.charCodeAt(Bn.length-oi-1)==gn.charCodeAt(gn.length-oi-1);)++oi;if(pt.length==1&&oe.length==1&&O==y.line)for(;Jt&&Jt>y.ch&&Bn.charCodeAt(Bn.length-oi-1)==gn.charCodeAt(gn.length-oi-1);)Jt--,oi++;pt[pt.length-1]=Bn.slice(0,Bn.length-oi).replace(/^\u200b+/,""),pt[0]=pt[0].slice(Jt).replace(/\u200b+$/,"");var Hr=Qt(O,Jt),bn=Qt(nt,oe.length?ai(oe).length-oi:0);if(pt.length>1||pt[0]||ui(Hr,bn))return In(h.doc,pt,Hr,bn,"+input"),!0},Fs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fs.prototype.reset=function(){this.forceCompositionEnd()},Fs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fs.prototype.readFromDOMSoon=function(){var h=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(h.readDOMTimeout=null,h.composing)if(h.composing.done)h.composing=null;else return;h.updateFromDOM()},80))},Fs.prototype.updateFromDOM=function(){var h=this;(this.cm.isReadOnly()||!this.pollContent())&&Di(this.cm,function(){return oa(h.cm)})},Fs.prototype.setUneditable=function(h){h.contentEditable="false"},Fs.prototype.onKeyPress=function(h){h.charCode==0||this.composing||(h.preventDefault(),this.cm.isReadOnly()||Wn(this.cm,Uo)(this.cm,String.fromCharCode(h.charCode==null?h.keyCode:h.charCode),0))},Fs.prototype.readOnlyChanged=function(h){this.div.contentEditable=String(h!="nocursor")},Fs.prototype.onContextMenu=function(){},Fs.prototype.resetPosition=function(){},Fs.prototype.needsContentAttribute=!0;function Oh(h,d){var x=cu(h,d.line);if(!x||x.hidden)return null;var y=yt(h.doc,d.line),S=Nu(x,y,d.line),E=rr(y,h.doc.direction),O="left";if(E){var W=Gi(E,d.ch);O=W%2?"right":"left"}var H=yc(S.map,d.ch,O);return H.offset=H.collapse=="right"?H.end:H.start,H}function gf(h){for(var d=h;d;d=d.parentNode)if(/CodeMirror-gutter-wrapper/.test(d.className))return!0;return!1}function If(h,d){return d&&(h.bad=!0),h}function Of(h,d,x,y,S){var E="",O=!1,W=h.doc.lineSeparator(),H=!1;function nt(Jt){return function(oi){return oi.id==Jt}}function Rt(){O&&(E+=W,H&&(E+=W),O=H=!1)}function pt(Jt){Jt&&(Rt(),E+=Jt)}function oe(Jt){if(Jt.nodeType==1){var oi=Jt.getAttribute("cm-text");if(oi){pt(oi);return}var mi=Jt.getAttribute("cm-marker"),Ii;if(mi){var on=h.findMarks(Qt(y,0),Qt(S+1,0),nt(+mi));on.length&&(Ii=on[0].find(0))&&pt(me(h.doc,Ii.from,Ii.to).join(W));return}if(Jt.getAttribute("contenteditable")=="false")return;var Bn=/^(pre|div|p|li|table|br)$/i.test(Jt.nodeName);if(!/^br$/i.test(Jt.nodeName)&&Jt.textContent.length==0)return;Bn&&Rt();for(var gn=0;gn<Jt.childNodes.length;gn++)oe(Jt.childNodes[gn]);/^(pre|p)$/i.test(Jt.nodeName)&&(H=!0),Bn&&(O=!0)}else Jt.nodeType==3&&pt(Jt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;oe(d),d!=x;)d=d.nextSibling,H=!1;return E}function yh(h,d,x){var y;if(d==h.display.lineDiv){if(y=h.display.lineDiv.childNodes[x],!y)return If(h.clipPos(Qt(h.display.viewTo-1)),!0);d=null,x=0}else for(y=d;;y=y.parentNode){if(!y||y==h.display.lineDiv)return null;if(y.parentNode&&y.parentNode==h.display.lineDiv)break}for(var S=0;S<h.display.view.length;S++){var E=h.display.view[S];if(E.node==y)return Qc(E,d,x)}}function Qc(h,d,x){var y=h.text.firstChild,S=!1;if(!d||!pe(y,d))return If(Qt(Mt(h.line),0),!0);if(d==y&&(S=!0,d=y.childNodes[x],x=0,!d)){var E=h.rest?ai(h.rest):h.line;return If(Qt(Mt(E),E.text.length),S)}var O=d.nodeType==3?d:null,W=d;for(!O&&d.childNodes.length==1&&d.firstChild.nodeType==3&&(O=d.firstChild,x&&(x=O.nodeValue.length));W.parentNode!=y;)W=W.parentNode;var H=h.measure,nt=H.maps;function Rt(Ii,on,Bn){for(var gn=-1;gn<(nt?nt.length:0);gn++)for(var Vn=gn<0?H.map:nt[gn],Hr=0;Hr<Vn.length;Hr+=3){var bn=Vn[Hr+2];if(bn==Ii||bn==on){var rs=Mt(gn<0?h.line:h.rest[gn]),xl=Vn[Hr]+Bn;return(Bn<0||bn!=Ii)&&(xl=Vn[Hr+(Bn?1:0)]),Qt(rs,xl)}}}var pt=Rt(O,W,x);if(pt)return If(pt,S);for(var oe=W.nextSibling,Jt=O?O.nodeValue.length-x:0;oe;oe=oe.nextSibling){if(pt=Rt(oe,oe.firstChild,0),pt)return If(Qt(pt.line,pt.ch-Jt),S);Jt+=oe.textContent.length}for(var oi=W.previousSibling,mi=x;oi;oi=oi.previousSibling){if(pt=Rt(oi,oi.firstChild,-1),pt)return If(Qt(pt.line,pt.ch+mi),S);mi+=oi.textContent.length}}var Ka=function(h){this.cm=h,this.prevInput="",this.pollingFast=!1,this.polling=new tt,this.hasSelection=!1,this.composing=null};Ka.prototype.init=function(h){var d=this,x=this,y=this.cm;this.createField(h);var S=this.textarea;h.wrapper.insertBefore(this.wrapper,h.wrapper.firstChild),le&&(S.style.width="0px"),We(S,"input",function(){gt&&ft>=9&&d.hasSelection&&(d.hasSelection=null),x.poll()}),We(S,"paste",function(O){Fr(y,O)||ns(O,y)||(y.state.pasteIncoming=+new Date,x.fastPoll())});function E(O){if(!Fr(y,O)){if(y.somethingSelected())Iu({lineWise:!1,text:y.getSelections()});else if(y.options.lineWiseCopyCut){var W=Gl(y);Iu({lineWise:!0,text:W.text}),O.type=="cut"?y.setSelections(W.ranges,null,Ye):(x.prevInput="",S.value=W.text.join(`
|
|
|
`),Sn(S))}else return;O.type=="cut"&&(y.state.cutIncoming=+new Date)}}We(S,"cut",E),We(S,"copy",E),We(h.scroller,"paste",function(O){if(!(Tl(h,O)||Fr(y,O))){if(!S.dispatchEvent){y.state.pasteIncoming=+new Date,x.focus();return}var W=new Event("paste");W.clipboardData=O.clipboardData,S.dispatchEvent(W)}}),We(h.lineSpace,"selectstart",function(O){Tl(h,O)||fs(O)}),We(S,"compositionstart",function(){var O=y.getCursor("from");x.composing&&x.composing.range.clear(),x.composing={start:O,range:y.markText(O,y.getCursor("to"),{className:"CodeMirror-composing"})}}),We(S,"compositionend",function(){x.composing&&(x.poll(),x.composing.range.clear(),x.composing=null)})},Ka.prototype.createField=function(h){this.wrapper=Ou(),this.textarea=this.wrapper.firstChild},Ka.prototype.screenReaderLabelChanged=function(h){h?this.textarea.setAttribute("aria-label",h):this.textarea.removeAttribute("aria-label")},Ka.prototype.prepareSelection=function(){var h=this.cm,d=h.display,x=h.doc,y=sa(h);if(h.options.moveInputWithCursor){var S=Hs(h,x.sel.primary().head,"div"),E=d.wrapper.getBoundingClientRect(),O=d.lineDiv.getBoundingClientRect();y.teTop=Math.max(0,Math.min(d.wrapper.clientHeight-10,S.top+O.top-E.top)),y.teLeft=Math.max(0,Math.min(d.wrapper.clientWidth-10,S.left+O.left-E.left))}return y},Ka.prototype.showSelection=function(h){var d=this.cm,x=d.display;Te(x.cursorDiv,h.cursors),Te(x.selectionDiv,h.selection),h.teTop!=null&&(this.wrapper.style.top=h.teTop+"px",this.wrapper.style.left=h.teLeft+"px")},Ka.prototype.reset=function(h){if(!(this.contextMenuPending||this.composing)){var d=this.cm;if(d.somethingSelected()){this.prevInput="";var x=d.getSelection();this.textarea.value=x,d.state.focused&&Sn(this.textarea),gt&&ft>=9&&(this.hasSelection=x)}else h||(this.prevInput=this.textarea.value="",gt&&ft>=9&&(this.hasSelection=null))}},Ka.prototype.getField=function(){return this.textarea},Ka.prototype.supportsTouch=function(){return!1},Ka.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!zt||Ke()!=this.textarea))try{this.textarea.focus()}catch(h){}},Ka.prototype.blur=function(){this.textarea.blur()},Ka.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ka.prototype.receivedFocus=function(){this.slowPoll()},Ka.prototype.slowPoll=function(){var h=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){h.poll(),h.cm.state.focused&&h.slowPoll()})},Ka.prototype.fastPoll=function(){var h=!1,d=this;d.pollingFast=!0;function x(){var y=d.poll();!y&&!h?(h=!0,d.polling.set(60,x)):(d.pollingFast=!1,d.slowPoll())}d.polling.set(20,x)},Ka.prototype.poll=function(){var h=this,d=this.cm,x=this.textarea,y=this.prevInput;if(this.contextMenuPending||!d.state.focused||L(x)&&!y&&!this.composing||d.isReadOnly()||d.options.disableInput||d.state.keySeq)return!1;var S=x.value;if(S==y&&!d.somethingSelected())return!1;if(gt&&ft>=9&&this.hasSelection===S||Q&&/[\uf700-\uf7ff]/.test(S))return d.display.input.reset(),!1;if(d.doc.sel==d.display.selForContextMenu){var E=S.charCodeAt(0);if(E==8203&&!y&&(y="\u200B"),E==8666)return this.reset(),this.cm.execCommand("undo")}for(var O=0,W=Math.min(y.length,S.length);O<W&&y.charCodeAt(O)==S.charCodeAt(O);)++O;return Di(d,function(){Uo(d,S.slice(O),y.length-O,null,h.composing?"*compose":null),S.length>1e3||S.indexOf(`
|
|
|
`)>-1?x.value=h.prevInput="":h.prevInput=S,h.composing&&(h.composing.range.clear(),h.composing.range=d.markText(h.composing.start,d.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ka.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ka.prototype.onKeyPress=function(){gt&&ft>=9&&(this.hasSelection=null),this.fastPoll()},Ka.prototype.onContextMenu=function(h){var d=this,x=d.cm,y=x.display,S=d.textarea;d.contextMenuPending&&d.contextMenuPending();var E=vl(x,h),O=y.scroller.scrollTop;if(!E||Y)return;var W=x.options.resetSelectionOnContextMenu;W&&x.doc.sel.contains(E)==-1&&Wn(x,Qe)(x.doc,ks(E),Ye);var H=S.style.cssText,nt=d.wrapper.style.cssText,Rt=d.wrapper.offsetParent.getBoundingClientRect();d.wrapper.style.cssText="position: static",S.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(h.clientY-Rt.top-5)+"px; left: "+(h.clientX-Rt.left-5)+`px;
|
|
|
z-index: 1000; background: `+(gt?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var pt;ct&&(pt=window.scrollY),y.input.focus(),ct&&window.scrollTo(null,pt),y.input.reset(),x.somethingSelected()||(S.value=d.prevInput=" "),d.contextMenuPending=Jt,y.selForContextMenu=x.doc.sel,clearTimeout(y.detectingSelectAll);function oe(){if(S.selectionStart!=null){var mi=x.somethingSelected(),Ii="\u200B"+(mi?S.value:"");S.value="\u21DA",S.value=Ii,d.prevInput=mi?"":"\u200B",S.selectionStart=1,S.selectionEnd=Ii.length,y.selForContextMenu=x.doc.sel}}function Jt(){if(d.contextMenuPending==Jt&&(d.contextMenuPending=!1,d.wrapper.style.cssText=nt,S.style.cssText=H,gt&&ft<9&&y.scrollbars.setScrollTop(y.scroller.scrollTop=O),S.selectionStart!=null)){(!gt||gt&&ft<9)&&oe();var mi=0,Ii=function(){y.selForContextMenu==x.doc.sel&&S.selectionStart==0&&S.selectionEnd>0&&d.prevInput=="\u200B"?Wn(x,Li)(x):mi++<10?y.detectingSelectAll=setTimeout(Ii,500):(y.selForContextMenu=null,y.input.reset())};y.detectingSelectAll=setTimeout(Ii,200)}}if(gt&&ft>=9&&oe(),kt){jl(h);var oi=function(){$o(window,"mouseup",oi),setTimeout(Jt,20)};We(window,"mouseup",oi)}else setTimeout(Jt,50)},Ka.prototype.readOnlyChanged=function(h){h||this.reset(),this.textarea.disabled=h=="nocursor",this.textarea.readOnly=!!h},Ka.prototype.setUneditable=function(){},Ka.prototype.needsContentAttribute=!1;function Zh(h,d){if(d=d?Ki(d):{},d.value=h.value,!d.tabindex&&h.tabIndex&&(d.tabindex=h.tabIndex),!d.placeholder&&h.placeholder&&(d.placeholder=h.placeholder),d.autofocus==null){var x=Ke();d.autofocus=x==h||h.getAttribute("autofocus")!=null&&x==document.body}function y(){h.value=W.getValue()}var S;if(h.form&&(We(h.form,"submit",y),!d.leaveSubmitMethodAlone)){var E=h.form;S=E.submit;try{var O=E.submit=function(){y(),E.submit=S,E.submit(),E.submit=O}}catch(H){}}d.finishInit=function(H){H.save=y,H.getTextArea=function(){return h},H.toTextArea=function(){H.toTextArea=isNaN,y(),h.parentNode.removeChild(H.getWrapperElement()),h.style.display="",h.form&&($o(h.form,"submit",y),!d.leaveSubmitMethodAlone&&typeof h.form.submit=="function"&&(h.form.submit=S))}},h.style.display="none";var W=ur(function(H){return h.parentNode.insertBefore(H,h.nextSibling)},d);return W}function Ju(h){h.off=$o,h.on=We,h.wheelEventPixels=Da,h.Doc=tn,h.splitLines=Me,h.countColumn=It,h.findColumn=En,h.isWordChar=K,h.Pass=Ze,h.signal=yo,h.Line=Zn,h.changeEnd=Ia,h.scrollbarModel=Ft,h.Pos=Qt,h.cmpPos=ui,h.modes=Vi,h.mimeModes=ln,h.resolveMode=wo,h.getMode=ro,h.modeExtensions=li,h.extendMode=St,h.copyState=$t,h.startState=Ue,h.innerMode=xe,h.commands=Vl,h.keyMap=Gr,h.keyName=La,h.isModifierKey=ua,h.lookupKey=bs,h.normalizeKeyMap=Qo,h.StringStream=Kt,h.SharedTextMarker=Mn,h.TextMarker=Ct,h.LineWidget=rn,h.e_preventDefault=fs,h.e_stopPropagation=Ya,h.e_stop=jl,h.addClass=ki,h.contains=pe,h.rmClass=Ot,h.keyNames=Rn}Bc(ur),Xl(ur);var Eu="iter insert remove copy getEditor constructor".split(" ");for(var qu in tn.prototype)tn.prototype.hasOwnProperty(qu)&&de(Eu,qu)<0&&(ur.prototype[qu]=function(h){return function(){return h.apply(this.doc,arguments)}}(tn.prototype[qu]));return Ao(tn),ur.inputStyles={textarea:Ka,contenteditable:Fs},ur.defineMode=function(h){!ur.defaults.mode&&h!="null"&&(ur.defaults.mode=h),fr.apply(this,arguments)},ur.defineMIME=no,ur.defineMode("null",function(){return{token:function(h){return h.skipToEnd()}}}),ur.defineMIME("text/plain","null"),ur.defineExtension=function(h,d){ur.prototype[h]=d},ur.defineDocExtension=function(h,d){tn.prototype[h]=d},ur.fromTextArea=Zh,Ju(ur),ur.version="5.58.2",ur})},49047:function(Wr,Ti,j){(function(Nt){Nt(j(4631),j(29589),j(52539))})(function(Nt){"use strict";Nt.defineMode("markdown",function(At,vt){var Et=Nt.getMode(At,"text/html"),gt=Et.name=="null";function ft(It){if(Nt.findModeByName){var tt=Nt.findModeByName(It);tt&&(It=tt.mime||tt.mimes[0])}var de=Nt.getMode(At,It);return de.name=="null"?null:de}vt.highlightFormatting===void 0&&(vt.highlightFormatting=!1),vt.maxBlockquoteDepth===void 0&&(vt.maxBlockquoteDepth=0),vt.taskLists===void 0&&(vt.taskLists=!1),vt.strikethrough===void 0&&(vt.strikethrough=!1),vt.emoji===void 0&&(vt.emoji=!1),vt.fencedCodeBlockHighlighting===void 0&&(vt.fencedCodeBlockHighlighting=!0),vt.fencedCodeBlockDefaultMode===void 0&&(vt.fencedCodeBlockDefaultMode="text/plain"),vt.xml===void 0&&(vt.xml=!0),vt.tokenTypeOverrides===void 0&&(vt.tokenTypeOverrides={});var ct={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var ot in ct)ct.hasOwnProperty(ot)&&vt.tokenTypeOverrides[ot]&&(ct[ot]=vt.tokenTypeOverrides[ot]);var F=/^([*\-_])(?:\s*\1){2,}\s*$/,Y=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,ee=/^\[(x| )\](?=\s)/i,ne=vt.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Fe=/^ {0,3}(?:\={1,}|-{2,})\s*$/,le=/^[^#!\[\]*_\\<>` "'(~:]+/,Zt=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,zt=/^\s*\[[^\]]+?\]:.*$/,Q=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,se=" ";function $e(It,tt,de){return tt.f=tt.inline=de,de(It,tt)}function Vt(It,tt,de){return tt.f=tt.block=de,de(It,tt)}function Wt(It){return!It||!/\S/.test(It.string)}function kt(It){if(It.linkTitle=!1,It.linkHref=!1,It.linkText=!1,It.em=!1,It.strong=!1,It.strikethrough=!1,It.quote=0,It.indentedCode=!1,It.f==Ot){var tt=gt;if(!tt){var de=Nt.innerMode(Et,It.htmlState);tt=de.mode.name=="xml"&&de.state.tagStart===null&&!de.state.context&&de.state.tokenize.isInText}tt&&(It.f=fi,It.block=it,It.htmlState=null)}return It.trailingSpace=0,It.trailingSpaceNewLine=!1,It.prevLine=It.thisLine,It.thisLine={stream:null},null}function it(It,tt){var de=It.column()===tt.indentation,hi=Wt(tt.prevLine.stream),Ze=tt.indentedCode,Ye=tt.prevLine.hr,Ae=tt.list!==!1,Wi=(tt.listStack[tt.listStack.length-1]||0)+3;tt.indentedCode=!1;var En=tt.indentation;if(tt.indentationDiff===null&&(tt.indentationDiff=tt.indentation,Ae)){for(tt.list=null;En<tt.listStack[tt.listStack.length-1];)tt.listStack.pop(),tt.listStack.length?tt.indentation=tt.listStack[tt.listStack.length-1]:tt.list=!1;tt.list!==!1&&(tt.indentationDiff=En-tt.listStack[tt.listStack.length-1])}var an=!hi&&!Ye&&!tt.prevLine.header&&(!Ae||!Ze)&&!tt.prevLine.fencedCodeEnd,vi=(tt.list===!1||Ye||hi)&&tt.indentation<=Wi&&It.match(F),ai=null;if(tt.indentationDiff>=4&&(Ze||tt.prevLine.fencedCodeEnd||tt.prevLine.header||hi))return It.skipToEnd(),tt.indentedCode=!0,ct.code;if(It.eatSpace())return null;if(de&&tt.indentation<=Wi&&(ai=It.match(ne))&&ai[1].length<=6)return tt.quote=0,tt.header=ai[1].length,tt.thisLine.header=!0,vt.highlightFormatting&&(tt.formatting="header"),tt.f=tt.inline,Te(tt);if(tt.indentation<=Wi&&It.eat(">"))return tt.quote=de?1:tt.quote+1,vt.highlightFormatting&&(tt.formatting="quote"),It.eatSpace(),Te(tt);if(!vi&&!tt.setext&&de&&tt.indentation<=Wi&&(ai=It.match(Y))){var zi=ai[1]?"ol":"ul";return tt.indentation=En+It.current().length,tt.list=!0,tt.quote=0,tt.listStack.push(tt.indentation),tt.em=!1,tt.strong=!1,tt.code=!1,tt.strikethrough=!1,vt.taskLists&&It.match(ee,!1)&&(tt.taskList=!0),tt.f=tt.inline,vt.highlightFormatting&&(tt.formatting=["list","list-"+zi]),Te(tt)}else{if(de&&tt.indentation<=Wi&&(ai=It.match(Zt,!0)))return tt.quote=0,tt.fencedEndRE=new RegExp(ai[1]+"+ *$"),tt.localMode=vt.fencedCodeBlockHighlighting&&ft(ai[2]||vt.fencedCodeBlockDefaultMode),tt.localMode&&(tt.localState=Nt.startState(tt.localMode)),tt.f=tt.block=qt,vt.highlightFormatting&&(tt.formatting="code-block"),tt.code=-1,Te(tt);if(tt.setext||(!an||!Ae)&&!tt.quote&&tt.list===!1&&!tt.code&&!vi&&!zt.test(It.string)&&(ai=It.lookAhead(1))&&(ai=ai.match(Fe)))return tt.setext?(tt.header=tt.setext,tt.setext=0,It.skipToEnd(),vt.highlightFormatting&&(tt.formatting="header")):(tt.header=ai[0].charAt(0)=="="?1:2,tt.setext=tt.header),tt.thisLine.header=!0,tt.f=tt.inline,Te(tt);if(vi)return It.skipToEnd(),tt.hr=!0,tt.thisLine.hr=!0,ct.hr;if(It.peek()==="[")return $e(It,tt,pi)}return $e(It,tt,tt.inline)}function Ot(It,tt){var de=Et.token(It,tt.htmlState);if(!gt){var hi=Nt.innerMode(Et,tt.htmlState);(hi.mode.name=="xml"&&hi.state.tagStart===null&&!hi.state.context&&hi.state.tokenize.isInText||tt.md_inside&&It.current().indexOf(">")>-1)&&(tt.f=fi,tt.block=it,tt.htmlState=null)}return de}function qt(It,tt){var de=tt.listStack[tt.listStack.length-1]||0,hi=tt.indentation<de,Ze=de+3;if(tt.fencedEndRE&&tt.indentation<=Ze&&(hi||It.match(tt.fencedEndRE))){vt.highlightFormatting&&(tt.formatting="code-block");var Ye;return hi||(Ye=Te(tt)),tt.localMode=tt.localState=null,tt.block=it,tt.f=fi,tt.fencedEndRE=null,tt.code=0,tt.thisLine.fencedCodeEnd=!0,hi?Vt(It,tt,tt.block):Ye}else return tt.localMode?tt.localMode.token(It,tt.localState):(It.skipToEnd(),ct.code)}function Te(It){var tt=[];if(It.formatting){tt.push(ct.formatting),typeof It.formatting=="string"&&(It.formatting=[It.formatting]);for(var de=0;de<It.formatting.length;de++)tt.push(ct.formatting+"-"+It.formatting[de]),It.formatting[de]==="header"&&tt.push(ct.formatting+"-"+It.formatting[de]+"-"+It.header),It.formatting[de]==="quote"&&(!vt.maxBlockquoteDepth||vt.maxBlockquoteDepth>=It.quote?tt.push(ct.formatting+"-"+It.formatting[de]+"-"+It.quote):tt.push("error"))}if(It.taskOpen)return tt.push("meta"),tt.length?tt.join(" "):null;if(It.taskClosed)return tt.push("property"),tt.length?tt.join(" "):null;if(It.linkHref?tt.push(ct.linkHref,"url"):(It.strong&&tt.push(ct.strong),It.em&&tt.push(ct.em),It.strikethrough&&tt.push(ct.strikethrough),It.emoji&&tt.push(ct.emoji),It.linkText&&tt.push(ct.linkText),It.code&&tt.push(ct.code),It.image&&tt.push(ct.image),It.imageAltText&&tt.push(ct.imageAltText,"link"),It.imageMarker&&tt.push(ct.imageMarker)),It.header&&tt.push(ct.header,ct.header+"-"+It.header),It.quote&&(tt.push(ct.quote),!vt.maxBlockquoteDepth||vt.maxBlockquoteDepth>=It.quote?tt.push(ct.quote+"-"+It.quote):tt.push(ct.quote+"-"+vt.maxBlockquoteDepth)),It.list!==!1){var hi=(It.listStack.length-1)%3;hi?hi===1?tt.push(ct.list2):tt.push(ct.list3):tt.push(ct.list1)}return It.trailingSpaceNewLine?tt.push("trailing-space-new-line"):It.trailingSpace&&tt.push("trailing-space-"+(It.trailingSpace%2?"a":"b")),tt.length?tt.join(" "):null}function _e(It,tt){if(It.match(le,!0))return Te(tt)}function fi(It,tt){var de=tt.text(It,tt);if(typeof de!="undefined")return de;if(tt.list)return tt.list=null,Te(tt);if(tt.taskList){var hi=It.match(ee,!0)[1]===" ";return hi?tt.taskOpen=!0:tt.taskClosed=!0,vt.highlightFormatting&&(tt.formatting="task"),tt.taskList=!1,Te(tt)}if(tt.taskOpen=!1,tt.taskClosed=!1,tt.header&&It.match(/^#+$/,!0))return vt.highlightFormatting&&(tt.formatting="header"),Te(tt);var Ze=It.next();if(tt.linkTitle){tt.linkTitle=!1;var Ye=Ze;Ze==="("&&(Ye=")"),Ye=(Ye+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ae="^\\s*(?:[^"+Ye+"\\\\]+|\\\\\\\\|\\\\.)"+Ye;if(It.match(new RegExp(Ae),!0))return ct.linkHref}if(Ze==="`"){var Wi=tt.formatting;vt.highlightFormatting&&(tt.formatting="code"),It.eatWhile("`");var En=It.current().length;if(tt.code==0&&(!tt.quote||En==1))return tt.code=En,Te(tt);if(En==tt.code){var an=Te(tt);return tt.code=0,an}else return tt.formatting=Wi,Te(tt)}else if(tt.code)return Te(tt);if(Ze==="\\"&&(It.next(),vt.highlightFormatting)){var vi=Te(tt),ai=ct.formatting+"-escape";return vi?vi+" "+ai:ai}if(Ze==="!"&&It.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return tt.imageMarker=!0,tt.image=!0,vt.highlightFormatting&&(tt.formatting="image"),Te(tt);if(Ze==="["&&tt.imageMarker&&It.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return tt.imageMarker=!1,tt.imageAltText=!0,vt.highlightFormatting&&(tt.formatting="image"),Te(tt);if(Ze==="]"&&tt.imageAltText){vt.highlightFormatting&&(tt.formatting="image");var vi=Te(tt);return tt.imageAltText=!1,tt.image=!1,tt.inline=tt.f=pe,vi}if(Ze==="["&&!tt.image)return tt.linkText&&It.match(/^.*?\]/)||(tt.linkText=!0,vt.highlightFormatting&&(tt.formatting="link")),Te(tt);if(Ze==="]"&&tt.linkText){vt.highlightFormatting&&(tt.formatting="link");var vi=Te(tt);return tt.linkText=!1,tt.inline=tt.f=It.match(/\(.*?\)| ?\[.*?\]/,!1)?pe:fi,vi}if(Ze==="<"&&It.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){tt.f=tt.inline=Ht,vt.highlightFormatting&&(tt.formatting="link");var vi=Te(tt);return vi?vi+=" ":vi="",vi+ct.linkInline}if(Ze==="<"&&It.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){tt.f=tt.inline=Ht,vt.highlightFormatting&&(tt.formatting="link");var vi=Te(tt);return vi?vi+=" ":vi="",vi+ct.linkEmail}if(vt.xml&&Ze==="<"&&It.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var zi=It.string.indexOf(">",It.pos);if(zi!=-1){var $i=It.string.substring(It.start,zi);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test($i)&&(tt.md_inside=!0)}return It.backUp(1),tt.htmlState=Nt.startState(Et),Vt(It,tt,Ot)}if(vt.xml&&Ze==="<"&&It.match(/^\/\w*?>/))return tt.md_inside=!1,"tag";if(Ze==="*"||Ze==="_"){for(var q=1,D=It.pos==1?" ":It.string.charAt(It.pos-2);q<3&&It.eat(Ze);)q++;var _=It.peek()||" ",K=!/\s/.test(_)&&(!Q.test(_)||/\s/.test(D)||Q.test(D)),z=!/\s/.test(D)&&(!Q.test(D)||/\s/.test(_)||Q.test(_)),P=null,bt=null;if(q%2&&(!tt.em&&K&&(Ze==="*"||!z||Q.test(D))?P=!0:tt.em==Ze&&z&&(Ze==="*"||!K||Q.test(_))&&(P=!1)),q>1&&(!tt.strong&&K&&(Ze==="*"||!z||Q.test(D))?bt=!0:tt.strong==Ze&&z&&(Ze==="*"||!K||Q.test(_))&&(bt=!1)),bt!=null||P!=null){vt.highlightFormatting&&(tt.formatting=P==null?"strong":bt==null?"em":"strong em"),P===!0&&(tt.em=Ze),bt===!0&&(tt.strong=Ze);var an=Te(tt);return P===!1&&(tt.em=!1),bt===!1&&(tt.strong=!1),an}}else if(Ze===" "&&(It.eat("*")||It.eat("_"))){if(It.peek()===" ")return Te(tt);It.backUp(1)}if(vt.strikethrough){if(Ze==="~"&&It.eatWhile(Ze)){if(tt.strikethrough){vt.highlightFormatting&&(tt.formatting="strikethrough");var an=Te(tt);return tt.strikethrough=!1,an}else if(It.match(/^[^\s]/,!1))return tt.strikethrough=!0,vt.highlightFormatting&&(tt.formatting="strikethrough"),Te(tt)}else if(Ze===" "&&It.match(/^~~/,!0)){if(It.peek()===" ")return Te(tt);It.backUp(2)}}if(vt.emoji&&Ze===":"&&It.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){tt.emoji=!0,vt.highlightFormatting&&(tt.formatting="emoji");var Gt=Te(tt);return tt.emoji=!1,Gt}return Ze===" "&&(It.match(/^ +$/,!1)?tt.trailingSpace++:tt.trailingSpace&&(tt.trailingSpaceNewLine=!0)),Te(tt)}function Ht(It,tt){var de=It.next();if(de===">"){tt.f=tt.inline=fi,vt.highlightFormatting&&(tt.formatting="link");var hi=Te(tt);return hi?hi+=" ":hi="",hi+ct.linkInline}return It.match(/^[^>]+/,!0),ct.linkInline}function pe(It,tt){if(It.eatSpace())return null;var de=It.next();return de==="("||de==="["?(tt.f=tt.inline=ki(de==="("?")":"]"),vt.highlightFormatting&&(tt.formatting="link-string"),tt.linkHref=!0,Te(tt)):"error"}var Ke={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function ki(It){return function(tt,de){var hi=tt.next();if(hi===It){de.f=de.inline=fi,vt.highlightFormatting&&(de.formatting="link-string");var Ze=Te(de);return de.linkHref=!1,Ze}return tt.match(Ke[It]),de.linkHref=!0,Te(de)}}function pi(It,tt){return It.match(/^([^\]\\]|\\.)*\]:/,!1)?(tt.f=Sn,It.next(),vt.highlightFormatting&&(tt.formatting="link"),tt.linkText=!0,Te(tt)):$e(It,tt,fi)}function Sn(It,tt){if(It.match(/^\]:/,!0)){tt.f=tt.inline=Sr,vt.highlightFormatting&&(tt.formatting="link");var de=Te(tt);return tt.linkText=!1,de}return It.match(/^([^\]\\]|\\.)+/,!0),ct.linkText}function Sr(It,tt){return It.eatSpace()?null:(It.match(/^[^\s]+/,!0),It.peek()===void 0?tt.linkTitle=!0:It.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),tt.f=tt.inline=fi,ct.linkHref+" url")}var Ki={startState:function(){return{f:it,prevLine:{stream:null},thisLine:{stream:null},block:it,htmlState:null,indentation:0,inline:fi,text:_e,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(It){return{f:It.f,prevLine:It.prevLine,thisLine:It.thisLine,block:It.block,htmlState:It.htmlState&&Nt.copyState(Et,It.htmlState),indentation:It.indentation,localMode:It.localMode,localState:It.localMode?Nt.copyState(It.localMode,It.localState):null,inline:It.inline,text:It.text,formatting:!1,linkText:It.linkText,linkTitle:It.linkTitle,linkHref:It.linkHref,code:It.code,em:It.em,strong:It.strong,strikethrough:It.strikethrough,emoji:It.emoji,header:It.header,setext:It.setext,hr:It.hr,taskList:It.taskList,list:It.list,listStack:It.listStack.slice(0),quote:It.quote,indentedCode:It.indentedCode,trailingSpace:It.trailingSpace,trailingSpaceNewLine:It.trailingSpaceNewLine,md_inside:It.md_inside,fencedEndRE:It.fencedEndRE}},token:function(It,tt){if(tt.formatting=!1,It!=tt.thisLine.stream){if(tt.header=0,tt.hr=!1,It.match(/^\s*$/,!0))return kt(tt),null;if(tt.prevLine=tt.thisLine,tt.thisLine={stream:It},tt.taskList=!1,tt.trailingSpace=0,tt.trailingSpaceNewLine=!1,!tt.localState&&(tt.f=tt.block,tt.f!=Ot)){var de=It.match(/^\s*/,!0)[0].replace(/\t/g,se).length;if(tt.indentation=de,tt.indentationDiff=null,de>0)return null}}return tt.f(It,tt)},innerMode:function(It){return It.block==Ot?{state:It.htmlState,mode:Et}:It.localState?{state:It.localState,mode:It.localMode}:{state:It,mode:Ki}},indent:function(It,tt,de){return It.block==Ot&&Et.indent?Et.indent(It.htmlState,tt,de):It.localState&&It.localMode.indent?It.localMode.indent(It.localState,tt,de):Nt.Pass},blankLine:kt,getType:Te,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ki},"xml"),Nt.defineMIME("text/markdown","markdown"),Nt.defineMIME("text/x-markdown","markdown")})},52539:function(Wr,Ti,j){(function(Nt){Nt(j(4631))})(function(Nt){"use strict";Nt.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var At=0;At<Nt.modeInfo.length;At++){var vt=Nt.modeInfo[At];vt.mimes&&(vt.mime=vt.mimes[0])}Nt.findModeByMIME=function(Et){Et=Et.toLowerCase();for(var gt=0;gt<Nt.modeInfo.length;gt++){var ft=Nt.modeInfo[gt];if(ft.mime==Et)return ft;if(ft.mimes){for(var ct=0;ct<ft.mimes.length;ct++)if(ft.mimes[ct]==Et)return ft}}if(/\+xml$/.test(Et))return Nt.findModeByMIME("application/xml");if(/\+json$/.test(Et))return Nt.findModeByMIME("application/json")},Nt.findModeByExtension=function(Et){Et=Et.toLowerCase();for(var gt=0;gt<Nt.modeInfo.length;gt++){var ft=Nt.modeInfo[gt];if(ft.ext){for(var ct=0;ct<ft.ext.length;ct++)if(ft.ext[ct]==Et)return ft}}},Nt.findModeByFileName=function(Et){for(var gt=0;gt<Nt.modeInfo.length;gt++){var ft=Nt.modeInfo[gt];if(ft.file&&ft.file.test(Et))return ft}var ct=Et.lastIndexOf("."),ot=ct>-1&&Et.substring(ct+1,Et.length);if(ot)return Nt.findModeByExtension(ot)},Nt.findModeByName=function(Et){Et=Et.toLowerCase();for(var gt=0;gt<Nt.modeInfo.length;gt++){var ft=Nt.modeInfo[gt];if(ft.name.toLowerCase()==Et)return ft;if(ft.alias){for(var ct=0;ct<ft.alias.length;ct++)if(ft.alias[ct].toLowerCase()==Et)return ft}}}})},80785:function(Wr,Ti,j){(function(Nt){Nt(j(4631))})(function(Nt){"use strict";Nt.defineMode("stex",function(At,vt){"use strict";function Et(le,Zt){le.cmdState.push(Zt)}function gt(le){return le.cmdState.length>0?le.cmdState[le.cmdState.length-1]:null}function ft(le){var Zt=le.cmdState.pop();Zt&&Zt.closeBracket()}function ct(le){for(var Zt=le.cmdState,zt=Zt.length-1;zt>=0;zt--){var Q=Zt[zt];if(Q.name!="DEFAULT")return Q}return{styleIdentifier:function(){return null}}}function ot(le,Zt,zt){return function(){this.name=le,this.bracketNo=0,this.style=Zt,this.styles=zt,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var F={};F.importmodule=ot("importmodule","tag",["string","builtin"]),F.documentclass=ot("documentclass","tag",["","atom"]),F.usepackage=ot("usepackage","tag",["atom"]),F.begin=ot("begin","tag",["atom"]),F.end=ot("end","tag",["atom"]),F.label=ot("label","tag",["atom"]),F.ref=ot("ref","tag",["atom"]),F.eqref=ot("eqref","tag",["atom"]),F.cite=ot("cite","tag",["atom"]),F.bibitem=ot("bibitem","tag",["atom"]),F.Bibitem=ot("Bibitem","tag",["atom"]),F.RBibitem=ot("RBibitem","tag",["atom"]),F.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Y(le,Zt){le.f=Zt}function ee(le,Zt){var zt;if(le.match(/^\\[a-zA-Z@]+/)){var Q=le.current().slice(1);return zt=F.hasOwnProperty(Q)?F[Q]:F.DEFAULT,zt=new zt,Et(Zt,zt),Y(Zt,Fe),zt.style}if(le.match(/^\\[$&%#{}_]/)||le.match(/^\\[,;!\/\\]/))return"tag";if(le.match("\\["))return Y(Zt,function($e,Vt){return ne($e,Vt,"\\]")}),"keyword";if(le.match("\\("))return Y(Zt,function($e,Vt){return ne($e,Vt,"\\)")}),"keyword";if(le.match("$$"))return Y(Zt,function($e,Vt){return ne($e,Vt,"$$")}),"keyword";if(le.match("$"))return Y(Zt,function($e,Vt){return ne($e,Vt,"$")}),"keyword";var se=le.next();if(se=="%")return le.skipToEnd(),"comment";if(se=="}"||se=="]"){if(zt=gt(Zt),zt)zt.closeBracket(se),Y(Zt,Fe);else return"error";return"bracket"}else return se=="{"||se=="["?(zt=F.DEFAULT,zt=new zt,Et(Zt,zt),"bracket"):/\d/.test(se)?(le.eatWhile(/[\w.%]/),"atom"):(le.eatWhile(/[\w\-_]/),zt=ct(Zt),zt.name=="begin"&&(zt.argument=le.current()),zt.styleIdentifier())}function ne(le,Zt,zt){if(le.eatSpace())return null;if(zt&&le.match(zt))return Y(Zt,ee),"keyword";if(le.match(/^\\[a-zA-Z@]+/))return"tag";if(le.match(/^[a-zA-Z]+/))return"variable-2";if(le.match(/^\\[$&%#{}_]/)||le.match(/^\\[,;!\/]/)||le.match(/^[\^_&]/))return"tag";if(le.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(le.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var Q=le.next();return Q=="{"||Q=="}"||Q=="["||Q=="]"||Q=="("||Q==")"?"bracket":Q=="%"?(le.skipToEnd(),"comment"):"error"}function Fe(le,Zt){var zt=le.peek(),Q;return zt=="{"||zt=="["?(Q=gt(Zt),Q.openBracket(zt),le.eat(zt),Y(Zt,ee),"bracket"):/[ \t\r]/.test(zt)?(le.eat(zt),null):(Y(Zt,ee),ft(Zt),ee(le,Zt))}return{startState:function(){var le=vt.inMathMode?function(Zt,zt){return ne(Zt,zt)}:ee;return{cmdState:[],f:le}},copyState:function(le){return{cmdState:le.cmdState.slice(),f:le.f}},token:function(le,Zt){return Zt.f(le,Zt)},blankLine:function(le){le.f=ee,le.cmdState.length=0},lineComment:"%"}}),Nt.defineMIME("text/x-stex","stex"),Nt.defineMIME("text/x-latex","stex")})},29589:function(Wr,Ti,j){(function(Nt){Nt(j(4631))})(function(Nt){"use strict";var At={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},vt={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Nt.defineMode("xml",function(Et,gt){var ft=Et.indentUnit,ct={},ot=gt.htmlMode?At:vt;for(var F in ot)ct[F]=ot[F];for(var F in gt)ct[F]=gt[F];var Y,ee;function ne(Ht,pe){function Ke(Sn){return pe.tokenize=Sn,Sn(Ht,pe)}var ki=Ht.next();if(ki=="<")return Ht.eat("!")?Ht.eat("[")?Ht.match("CDATA[")?Ke(Zt("atom","]]>")):null:Ht.match("--")?Ke(Zt("comment","-->")):Ht.match("DOCTYPE",!0,!0)?(Ht.eatWhile(/[\w\._\-]/),Ke(zt(1))):null:Ht.eat("?")?(Ht.eatWhile(/[\w\._\-]/),pe.tokenize=Zt("meta","?>"),"meta"):(Y=Ht.eat("/")?"closeTag":"openTag",pe.tokenize=Fe,"tag bracket");if(ki=="&"){var pi;return Ht.eat("#")?Ht.eat("x")?pi=Ht.eatWhile(/[a-fA-F\d]/)&&Ht.eat(";"):pi=Ht.eatWhile(/[\d]/)&&Ht.eat(";"):pi=Ht.eatWhile(/[\w\.\-:]/)&&Ht.eat(";"),pi?"atom":"error"}else return Ht.eatWhile(/[^&<]/),null}ne.isInText=!0;function Fe(Ht,pe){var Ke=Ht.next();if(Ke==">"||Ke=="/"&&Ht.eat(">"))return pe.tokenize=ne,Y=Ke==">"?"endTag":"selfcloseTag","tag bracket";if(Ke=="=")return Y="equals",null;if(Ke=="<"){pe.tokenize=ne,pe.state=Vt,pe.tagName=pe.tagStart=null;var ki=pe.tokenize(Ht,pe);return ki?ki+" tag error":"tag error"}else return/[\'\"]/.test(Ke)?(pe.tokenize=le(Ke),pe.stringStartCol=Ht.column(),pe.tokenize(Ht,pe)):(Ht.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function le(Ht){var pe=function(Ke,ki){for(;!Ke.eol();)if(Ke.next()==Ht){ki.tokenize=Fe;break}return"string"};return pe.isInAttribute=!0,pe}function Zt(Ht,pe){return function(Ke,ki){for(;!Ke.eol();){if(Ke.match(pe)){ki.tokenize=ne;break}Ke.next()}return Ht}}function zt(Ht){return function(pe,Ke){for(var ki;(ki=pe.next())!=null;){if(ki=="<")return Ke.tokenize=zt(Ht+1),Ke.tokenize(pe,Ke);if(ki==">")if(Ht==1){Ke.tokenize=ne;break}else return Ke.tokenize=zt(Ht-1),Ke.tokenize(pe,Ke)}return"meta"}}function Q(Ht,pe,Ke){this.prev=Ht.context,this.tagName=pe,this.indent=Ht.indented,this.startOfLine=Ke,(ct.doNotIndent.hasOwnProperty(pe)||Ht.context&&Ht.context.noIndent)&&(this.noIndent=!0)}function se(Ht){Ht.context&&(Ht.context=Ht.context.prev)}function $e(Ht,pe){for(var Ke;;){if(!Ht.context||(Ke=Ht.context.tagName,!ct.contextGrabbers.hasOwnProperty(Ke)||!ct.contextGrabbers[Ke].hasOwnProperty(pe)))return;se(Ht)}}function Vt(Ht,pe,Ke){return Ht=="openTag"?(Ke.tagStart=pe.column(),Wt):Ht=="closeTag"?kt:Vt}function Wt(Ht,pe,Ke){return Ht=="word"?(Ke.tagName=pe.current(),ee="tag",qt):ct.allowMissingTagName&&Ht=="endTag"?(ee="tag bracket",qt(Ht,pe,Ke)):(ee="error",Wt)}function kt(Ht,pe,Ke){if(Ht=="word"){var ki=pe.current();return Ke.context&&Ke.context.tagName!=ki&&ct.implicitlyClosed.hasOwnProperty(Ke.context.tagName)&&se(Ke),Ke.context&&Ke.context.tagName==ki||ct.matchClosing===!1?(ee="tag",it):(ee="tag error",Ot)}else return ct.allowMissingTagName&&Ht=="endTag"?(ee="tag bracket",it(Ht,pe,Ke)):(ee="error",Ot)}function it(Ht,pe,Ke){return Ht!="endTag"?(ee="error",it):(se(Ke),Vt)}function Ot(Ht,pe,Ke){return ee="error",it(Ht,pe,Ke)}function qt(Ht,pe,Ke){if(Ht=="word")return ee="attribute",Te;if(Ht=="endTag"||Ht=="selfcloseTag"){var ki=Ke.tagName,pi=Ke.tagStart;return Ke.tagName=Ke.tagStart=null,Ht=="selfcloseTag"||ct.autoSelfClosers.hasOwnProperty(ki)?$e(Ke,ki):($e(Ke,ki),Ke.context=new Q(Ke,ki,pi==Ke.indented)),Vt}return ee="error",qt}function Te(Ht,pe,Ke){return Ht=="equals"?_e:(ct.allowMissing||(ee="error"),qt(Ht,pe,Ke))}function _e(Ht,pe,Ke){return Ht=="string"?fi:Ht=="word"&&ct.allowUnquoted?(ee="string",qt):(ee="error",qt(Ht,pe,Ke))}function fi(Ht,pe,Ke){return Ht=="string"?fi:qt(Ht,pe,Ke)}return{startState:function(Ht){var pe={tokenize:ne,state:Vt,indented:Ht||0,tagName:null,tagStart:null,context:null};return Ht!=null&&(pe.baseIndent=Ht),pe},token:function(Ht,pe){if(!pe.tagName&&Ht.sol()&&(pe.indented=Ht.indentation()),Ht.eatSpace())return null;Y=null;var Ke=pe.tokenize(Ht,pe);return(Ke||Y)&&Ke!="comment"&&(ee=null,pe.state=pe.state(Y||Ke,Ht,pe),ee&&(Ke=ee=="error"?Ke+" error":ee)),Ke},indent:function(Ht,pe,Ke){var ki=Ht.context;if(Ht.tokenize.isInAttribute)return Ht.tagStart==Ht.indented?Ht.stringStartCol+1:Ht.indented+ft;if(ki&&ki.noIndent)return Nt.Pass;if(Ht.tokenize!=Fe&&Ht.tokenize!=ne)return Ke?Ke.match(/^(\s*)/)[0].length:0;if(Ht.tagName)return ct.multilineTagIndentPastTag!==!1?Ht.tagStart+Ht.tagName.length+2:Ht.tagStart+ft*(ct.multilineTagIndentFactor||1);if(ct.alignCDATA&&/<!\[CDATA\[/.test(pe))return 0;var pi=pe&&/^<(\/)?([\w_:\.-]*)/.exec(pe);if(pi&&pi[1])for(;ki;)if(ki.tagName==pi[2]){ki=ki.prev;break}else if(ct.implicitlyClosed.hasOwnProperty(ki.tagName))ki=ki.prev;else break;else if(pi)for(;ki;){var Sn=ct.contextGrabbers[ki.tagName];if(Sn&&Sn.hasOwnProperty(pi[2]))ki=ki.prev;else break}for(;ki&&ki.prev&&!ki.startOfLine;)ki=ki.prev;return ki?ki.indent+ft:Ht.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:ct.htmlMode?"html":"xml",helperType:ct.htmlMode?"html":"xml",skipAttribute:function(Ht){Ht.state==_e&&(Ht.state=qt)},xmlCurrentTag:function(Ht){return Ht.tagName?{name:Ht.tagName,close:Ht.type=="closeTag"}:null},xmlCurrentContext:function(Ht){for(var pe=[],Ke=Ht.context;Ke;Ke=Ke.prev)Ke.tagName&&pe.push(Ke.tagName);return pe.reverse()}}}),Nt.defineMIME("text/xml","xml"),Nt.defineMIME("application/xml","xml"),Nt.mimeModes.hasOwnProperty("text/html")||Nt.defineMIME("text/html",{name:"xml",htmlMode:!0})})},23495:function(Wr,Ti,j){"use strict";j.d(Ti,{$u:function(){return F},BD:function(){return q},E9:function(){return ot},FF:function(){return Va},FJ:function(){return Vt},Hn:function(){return $e},KX:function(){return kt},NB:function(){return ei},S0:function(){return ai},UL:function(){return Y},Vk:function(){return se},Vm:function(){return Gi},YI:function(){return zi},ZA:function(){return vt},Zt:function(){return ee},al:function(){return P},bn:function(){return z},bx:function(){return D},g2:function(){return $i},h1:function(){return _e},hD:function(){return Ao},l4:function(){return ft},rU:function(){return si},s_:function(){return _},uz:function(){return He},z6:function(){return ne}}),Wr=j.hmd(Wr),function(){var L;function yi(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function qe(t){var e=typeof Symbol!="undefined"&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:yi(t)}}function Si(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}var Vi=typeof Object.create=="function"?Object.create:function(t){function e(){}return e.prototype=t,new e},ln;if(typeof Object.setPrototypeOf=="function")ln=Object.setPrototypeOf;else{var fr;t:{var no={a:!0},wo={};try{wo.__proto__=no,fr=wo.a;break t}catch(t){}fr=!1}ln=fr?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var ro=ln;function li(t,e){if(t.prototype=Vi(e.prototype),t.prototype.constructor=t,ro)ro(t,e);else for(var i in e)if(i!="prototype")if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(e,i);n&&Object.defineProperty(t,i,n)}else t[i]=e[i];t.QA=e.prototype}var St=typeof j.g!="undefined"&&j.g!=null?j.g:self,$t=typeof Object.assign=="function"?Object.assign:function(t,e){for(var i=1;i<arguments.length;i++){var n=arguments[i];if(n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},xe=typeof Object.defineProperties=="function"?Object.defineProperty:function(t,e,i){t!=Array.prototype&&t!=Object.prototype&&(t[e]=i.value)};function Ue(t,e){if(e){var i=St;t=t.split(".");for(var n=0;n<t.length-1;n++){var s=t[n];s in i||(i[s]={}),i=i[s]}t=t[t.length-1],n=i[t],e=e(n),e!=n&&e!=null&&xe(i,t,{writable:!0,value:e})}}Ue("Object.assign",function(t){return t||$t}),Ue("Array.prototype.fill",function(t){return t||function(e,i,n){var s=this.length||0;for(0>i&&(i=Math.max(0,s+i)),(n==null||n>s)&&(n=s),n=Number(n),0>n&&(n=Math.max(0,s+n)),i=Number(i||0);i<n;i++)this[i]=e;return this}});var Kt=typeof globalThis=="object"&&globalThis||typeof j.g=="object"&&j.g.global===j.g&&j.g||typeof self=="object"&&self.self===self&&self||{};Kt.requestAnimationFrame===void 0&&(Kt.setImmediate===void 0?Kt.requestAnimationFrame=function(t){Kt.setTimeout(t,0)}:Kt.requestAnimationFrame=Kt.setImmediate);function yt(){}function me(t,e){var i=-1;return function(){var n=this,s=arguments;i!==-1&&Kt.clearTimeout(i),i=Ce(function(){i=-1,t.apply(n,s)},e)}}function Ce(t,e){return Kt.setTimeout(t,e)}function we(t){return Kt.document.createElement(t)}function Mt(t){throw Error(t)}function ie(t,e){t="The object is frozen, so its properties cannot be set: "+t.toString(),e!==void 0&&(t+=" to value: "+e),Mt(t)}function Re(t,e,i,n){i=i===null?"*":typeof i=="string"?i:typeof i=="function"&&typeof i.className=="string"?i.className:"",n!==void 0&&(i+="."+n),Mt(i+" is not in the range "+e+": "+t)}function _i(t){Kt.console&&Kt.console.log(t)}function Qt(t){return typeof t=="object"&&t!==null}function ui(t){return Array.isArray(t)||Kt.NodeList&&t instanceof Kt.NodeList||Kt.HTMLCollection&&t instanceof Kt.HTMLCollection}function vr(t){return Array.prototype.slice.call(t)}function Mr(t,e,i){Array.isArray(t)?e>=t.length?t.push(i):t.splice(e,0,i):Mt("Cannot insert an object into an HTMLCollection or NodeList: "+i+" at "+e)}function Lr(t,e){Array.isArray(t)?e>=t.length?t.pop():t.splice(e,1):Mt("Cannot remove an object from an HTMLCollection or NodeList at "+e)}function gi(){var t=bo.pop();return t===void 0?[]:t}function Ji(t){t.length=0,bo.push(t)}function Xi(t){if(typeof t=="function"){if(t.className)return t.className;if(t.name)return t.name;var e=t.toString();if(e=e.substring(9,e.indexOf("(")).trim(),e!=="")return t._className=e}else if(Qt(t)&&t.constructor)return Xi(t.constructor);return typeof t}function zr(t){var e=t;return Qt(t)&&(t.text?e=t.text:t.name?e=t.name:t.key!==void 0?e=t.key:t.id!==void 0?e=t.id:t.constructor===Object&&(t.Text?e=t.Text:t.Name?e=t.Name:t.Key!==void 0?e=t.Key:t.Id!==void 0?e=t.Id:t.ID!==void 0&&(e=t.ID))),e===void 0?"undefined":e===null?"null":e.toString()}function ho(t,e){if(t.hasOwnProperty(e))return!0;for(t=Object.getPrototypeOf(t);t&&t!==Function;){if(t.hasOwnProperty(e))return!0;var i=t.CA;if(i&&i[e])return!0;t=Object.getPrototypeOf(t)}return!1}function Tn(t,e,i){Object.defineProperty(Rr.prototype,t,{get:e,set:i})}function Pi(t){for(var e=[],i=0;256>i;i++)e["0123456789abcdef".charAt(i>>4)+"0123456789abcdef".charAt(i&15)]=String.fromCharCode(i);t.length%2&&(t="0"+t),i=[];for(var n=0,s=0;s<t.length;s+=2)i[n++]=e[t.substr(s,2)];for(t=i.join(""),t=t===""?"0":t,e=[],i=0;256>i;i++)e[i]=i;for(i=n=0;256>i;i++)n=(n+e[i]+119)%256,s=e[i],e[i]=e[n],e[n]=s;n=i=0;for(var a="",l=0;l<t.length;l++)i=(i+1)%256,n=(n+e[i])%256,s=e[i],e[i]=e[n],e[n]=s,a+=String.fromCharCode(t.charCodeAt(l)^e[(e[i]+e[n])%256]);return a.indexOf("GoJS 2.1 evaluation")>-1||a.indexOf("\xA9 1998-2021 Northwoods Software")>-1||a.indexOf("Not for distribution or production use")>-1||a.indexOf("gojs.net")>-1?"":a}var os=Kt.navigator!==void 0&&0<Kt.navigator.userAgent.indexOf("Trident/7"),qr=Kt.navigator!==void 0&&Kt.navigator.platform!==void 0&&Kt.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,bo=[];Object.freeze([]),yt.className="Util",yt.Dx="32ab5ff3b26f42dc0ed90f21472913b5",yt.adym="gojs.net",yt.vfo="28e645fdb266",yt.className="Util";function he(t,e,i){Do(this),this.j=t,this.xa=e,this.o=i}he.prototype.toString=function(){return"EnumValue."+this.xa};function ss(t,e){return e==null||e===""?null:t[e]}St.Object.defineProperties(he.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),he.className="EnumValue";function Aa(){this.ew=[]}Aa.prototype.toString=function(){return this.ew.join("")},Aa.prototype.add=function(t){t!==""&&this.ew.push(t)},Aa.className="StringBuilder";function Bo(){}Bo.className="PropertyCollection";var Ma={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(t){Kt.console&&Kt.console.log(t)},HA:function(t,e,i,n){t.strokeStyle="red",t.fillStyle="red",t.font="8px sans-serif",t.beginPath(),t.moveTo(-10,0),t.lineTo(10,0),t.moveTo(0,-10),t.lineTo(0,10),t.stroke(),t.setTransform(1,0,0,1,0,0),t.scale(i,i),t.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),t.lineWidth=2,t.beginPath(),t.moveTo(n.left,n.top+20),t.lineTo(n.left,n.top),t.lineTo(n.left+20,n.top),t.moveTo(n.right,n.bottom-20),t.lineTo(n.right,n.bottom),t.lineTo(n.right-20,n.bottom),t.stroke(),t.fillText("DB: "+Math.round(n.x)+", "+Math.round(n.y)+", "+Math.round(n.width)+", "+Math.round(n.height),n.left,n.top-5)},DA:function(t){var e={},i;for(i in t){if(e.x=i,e.x!=="licenseKey"){var n=t[e.x];if(n.prototype!==void 0){e.Zl=Object.getOwnPropertyNames(n.prototype);for(var s={Tj:0};s.Tj<e.Zl.length;s={Tj:s.Tj},s.Tj++){var a=Object.getOwnPropertyDescriptor(n.prototype,e.Zl[s.Tj]);a.get!==void 0&&a.set===void 0&&Object.defineProperty(n.prototype,e.Zl[s.Tj],{set:function(l,c){return function(){throw Error("Property "+l.Zl[c.Tj]+" of "+l.x+" is read-only.")}}(e,s)})}}}e={Zl:e.Zl,x:e.x}}}};function Lo(){}Lo.prototype.reset=function(){},Lo.prototype.next=function(){return!1},Lo.prototype.Ad=function(){return!1},Lo.prototype.first=function(){return null},Lo.prototype.any=function(){return!1},Lo.prototype.all=function(){return!0},Lo.prototype.each=function(){return this},Lo.prototype.map=function(){return this},Lo.prototype.filter=function(){return this},Lo.prototype.de=function(){},Lo.prototype.toString=function(){return"EmptyIterator"},St.Object.defineProperties(Lo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Lo.prototype.first=Lo.prototype.first,Lo.prototype.hasNext=Lo.prototype.Ad,Lo.prototype.next=Lo.prototype.next,Lo.prototype.reset=Lo.prototype.reset;var Tr=null;Lo.className="EmptyIterator",Tr=new Lo;function yr(t){this.key=-1,this.value=t}yr.prototype.reset=function(){this.key=-1},yr.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},yr.prototype.Ad=function(){return this.next()},yr.prototype.first=function(){return this.key=0,this.value},yr.prototype.any=function(t){return this.key=-1,t(this.value)},yr.prototype.all=function(t){return this.key=-1,t(this.value)},yr.prototype.each=function(t){return this.key=-1,t(this.value),this},yr.prototype.map=function(t){return new yr(t(this.value))},yr.prototype.filter=function(t){return t(this.value)?new yr(this.value):Tr},yr.prototype.de=function(){this.value=null},yr.prototype.toString=function(){return"SingletonIterator("+this.value+")"},St.Object.defineProperties(yr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),yr.prototype.first=yr.prototype.first,yr.prototype.hasNext=yr.prototype.Ad,yr.prototype.next=yr.prototype.next,yr.prototype.reset=yr.prototype.reset,yr.className="SingletonIterator";function $r(t){this.Bb=t,this.qf=null,t.Sa=null,this.qa=t.Ja,this.Za=-1}$r.prototype.reset=function(){var t=this.Bb;t.Sa=null,this.qa=t.Ja,this.Za=-1},$r.prototype.next=function(){var t=this.Bb;if(t.Ja!==this.qa&&0>this.key)return!1;t=t.s;var e=t.length,i=++this.Za,n=this.qf;if(n!==null)for(;i<e;){var s=t[i];if(n(s))return this.key=this.Za=i,this.value=s,!0;i++}else{if(i<e)return this.key=i,this.value=t[i],!0;this.de()}return!1},$r.prototype.Ad=function(){return this.next()},$r.prototype.first=function(){var t=this.Bb;this.qa=t.Ja,this.Za=0,t=t.s;var e=t.length,i=this.qf;if(i!==null){for(var n=0;n<e;){var s=t[n];if(i(s))return this.key=this.Za=n,this.value=s;n++}return null}return 0<e?(t=t[0],this.key=0,this.value=t):null},$r.prototype.any=function(t){var e=this.Bb;e.Sa=null,this.Za=-1,e=e.s;for(var i=e.length,n=this.qf,s=0;s<i;s++){var a=e[s];if((n===null||n(a))&&t(a))return!0}return!1},$r.prototype.all=function(t){var e=this.Bb;e.Sa=null,this.Za=-1,e=e.s;for(var i=e.length,n=this.qf,s=0;s<i;s++){var a=e[s];if((n===null||n(a))&&!t(a))return!1}return!0},$r.prototype.each=function(t){var e=this.Bb;e.Sa=null,this.Za=-1,e=e.s;for(var i=e.length,n=this.qf,s=0;s<i;s++){var a=e[s];(n===null||n(a))&&t(a)}return this},$r.prototype.map=function(t){var e=this.Bb;e.Sa=null,this.Za=-1;var i=[];e=e.s;for(var n=e.length,s=this.qf,a=0;a<n;a++){var l=e[a];(s===null||s(l))&&i.push(t(l))}return t=new ue,t.s=i,t.xb(),t.iterator},$r.prototype.filter=function(t){var e=this.Bb;e.Sa=null,this.Za=-1;var i=[];e=e.s;for(var n=e.length,s=this.qf,a=0;a<n;a++){var l=e[a];(s===null||s(l))&&t(l)&&i.push(l)}return t=new ue,t.s=i,t.xb(),t.iterator},$r.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},$r.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},St.Object.defineProperties($r.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.qf},set:function(t){this.qf=t}},count:{get:function(){var t=this.qf;if(t!==null){for(var e=0,i=this.Bb.s,n=i.length,s=0;s<n;s++)t(i[s])&&e++;return e}return this.Bb.s.length}}}),$r.prototype.first=$r.prototype.first,$r.prototype.hasNext=$r.prototype.Ad,$r.prototype.next=$r.prototype.next,$r.prototype.reset=$r.prototype.reset,$r.className="ListIterator";function dr(t){this.Bb=t,t.Hg=null,this.qa=t.Ja,this.Za=t.s.length}dr.prototype.reset=function(){var t=this.Bb;t.Hg=null,this.qa=t.Ja,this.Za=t.s.length},dr.prototype.next=function(){var t=this.Bb;if(t.Ja!==this.qa&&0>this.key)return!1;var e=--this.Za;return 0<=e?(this.key=e,this.value=t.s[e],!0):(this.de(),!1)},dr.prototype.Ad=function(){return this.next()},dr.prototype.first=function(){var t=this.Bb;this.qa=t.Ja;var e=t.s;return this.Za=t=e.length-1,0<=t?(e=e[t],this.key=t,this.value=e):null},dr.prototype.any=function(t){var e=this.Bb;e.Hg=null,e=e.s;var i=e.length;for(this.Za=i,--i;0<=i;i--)if(t(e[i]))return!0;return!1},dr.prototype.all=function(t){var e=this.Bb;e.Hg=null,e=e.s;var i=e.length;for(this.Za=i,--i;0<=i;i--)if(!t(e[i]))return!1;return!0},dr.prototype.each=function(t){var e=this.Bb;e.Hg=null,e=e.s;var i=e.length;for(this.Za=i,--i;0<=i;i--)t(e[i]);return this},dr.prototype.map=function(t){var e=this.Bb;e.Hg=null;var i=[];e=e.s;var n=e.length;for(this.Za=n,--n;0<=n;n--)i.push(t(e[n]));return t=new ue,t.s=i,t.xb(),t.iterator},dr.prototype.filter=function(t){var e=this.Bb;e.Hg=null;var i=[];e=e.s;var n=e.length;for(this.Za=n,--n;0<=n;n--){var s=e[n];t(s)&&i.push(s)}return t=new ue,t.s=i,t.xb(),t.iterator},dr.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},dr.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},St.Object.defineProperties(dr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),dr.prototype.first=dr.prototype.first,dr.prototype.hasNext=dr.prototype.Ad,dr.prototype.next=dr.prototype.next,dr.prototype.reset=dr.prototype.reset,dr.className="ListIteratorBackwards";function ue(t){Do(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof t=="string"&&Mt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),t!==void 0&&this.addAll(t)}L=ue.prototype,L.xb=function(){var t=this.Ja;t++,999999999<t&&(t=0),this.Ja=t},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.toString=function(){return"List()#"+Io(this)},L.add=function(t){return t===null?this:(this._isFrozen&&ie(this,t),this.s.push(t),this.xb(),this)},L.push=function(t){this.add(t)},L.addAll=function(t){if(t===null)return this;this._isFrozen&&ie(this);var e=this.s;if(ui(t))for(var i=t.length,n=0;n<i;n++)e.push(t[n]);else for(t=t.iterator;t.next();)e.push(t.value);return this.xb(),this},L.clear=function(){this._isFrozen&&ie(this),this.s.length=0,this.xb()},L.contains=function(t){return t===null?!1:this.s.indexOf(t)!==-1},L.has=function(t){return this.contains(t)},L.indexOf=function(t){return t===null?-1:this.s.indexOf(t)},L.M=function(t){var e=this.s;return(0>t||t>=e.length)&&Re(t,"0 <= i < length",ue,"elt:i"),e[t]},L.get=function(t){return this.M(t)},L.cd=function(t,e){var i=this.s;(0>t||t>=i.length)&&Re(t,"0 <= i < length",ue,"setElt:i"),this._isFrozen&&ie(this,t),i[t]=e},L.set=function(t,e){this.cd(t,e)},L.first=function(){var t=this.s;return t.length===0?null:t[0]},L.jc=function(){var t=this.s,e=t.length;return 0<e?t[e-1]:null},L.pop=function(){this._isFrozen&&ie(this);var t=this.s;return 0<t.length?t.pop():null},ue.prototype.any=function(t){for(var e=this.s,i=e.length,n=0;n<i;n++)if(t(e[n]))return!0;return!1},ue.prototype.all=function(t){for(var e=this.s,i=e.length,n=0;n<i;n++)if(!t(e[n]))return!1;return!0},ue.prototype.each=function(t){for(var e=this.s,i=e.length,n=0;n<i;n++)t(e[n]);return this},ue.prototype.map=function(t){for(var e=new ue,i=[],n=this.s,s=n.length,a=0;a<s;a++)i.push(t(n[a]));return e.s=i,e.xb(),e},ue.prototype.filter=function(t){for(var e=new ue,i=[],n=this.s,s=n.length,a=0;a<s;a++){var l=n[a];t(l)&&i.push(l)}return e.s=i,e.xb(),e},L=ue.prototype,L.Gb=function(t,e){0>t&&Re(t,">= 0",ue,"insertAt:i"),this._isFrozen&&ie(this,t);var i=this.s;t>=i.length?i.push(e):i.splice(t,0,e),this.xb()},L.remove=function(t){if(t===null)return!1;this._isFrozen&&ie(this,t);var e=this.s;return t=e.indexOf(t),t===-1?!1:(t===e.length-1?e.pop():e.splice(t,1),this.xb(),!0)},L.delete=function(t){return this.remove(t)},L.mb=function(t){var e=this.s;(0>t||t>=e.length)&&Re(t,"0 <= i < length",ue,"removeAt:i"),this._isFrozen&&ie(this,t),t===e.length-1?e.pop():e.splice(t,1),this.xb()},L.removeRange=function(t,e){var i=this.s,n=i.length;if(0>t)t=0;else if(t>=n)return this;if(0>e)return this;if(e>=n&&(e=n-1),t>e)return this;this._isFrozen&&ie(this);for(var s=t,a=e+1;a<n;)i[s++]=i[a++];return i.length=n-(e-t+1),this.xb(),this},ue.prototype.copy=function(){var t=new ue,e=this.s;return 0<e.length&&(t.s=Array.prototype.slice.call(e)),t},L=ue.prototype,L.Fa=function(){for(var t=this.s,e=this.count,i=Array(e),n=0;n<e;n++)i[n]=t[n];return i},L.Iv=function(){for(var t=new te,e=this.s,i=this.count,n=0;n<i;n++)t.add(e[n]);return t},L.sort=function(t){return this._isFrozen&&ie(this),this.s.sort(t),this.xb(),this},L.zi=function(t,e,i){var n=this.s,s=n.length;e===void 0&&(e=0),i===void 0&&(i=s),this._isFrozen&&ie(this);var a=i-e;if(1>=a)return this;if((0>e||e>=s-1)&&Re(e,"0 <= from < length",ue,"sortRange:from"),a===2)return i=n[e],s=n[e+1],0<t(i,s)&&(n[e]=s,n[e+1]=i,this.xb()),this;if(e===0)if(i>=s)n.sort(t);else for(e=n.slice(0,i),e.sort(t),t=0;t<i;t++)n[t]=e[t];else if(i>=s)for(i=n.slice(e),i.sort(t),t=e;t<s;t++)n[t]=i[t-e];else for(s=n.slice(e,i),s.sort(t),t=e;t<i;t++)n[t]=s[t-e];return this.xb(),this},L.reverse=function(){return this._isFrozen&&ie(this),this.s.reverse(),this.xb(),this},St.Object.defineProperties(ue.prototype,{_dataArray:{get:function(){return this.s}},count:{get:function(){return this.s.length}},size:{get:function(){return this.s.length}},length:{get:function(){return this.s.length}},iterator:{get:function(){if(0>=this.s.length)return Tr;var t=this.Sa;return t!==null?(t.reset(),t):new $r(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return Tr;var t=this.Hg;return t!==null?(t.reset(),t):new dr(this)}}}),ue.prototype.reverse=ue.prototype.reverse,ue.prototype.sortRange=ue.prototype.zi,ue.prototype.sort=ue.prototype.sort,ue.prototype.toSet=ue.prototype.Iv,ue.prototype.toArray=ue.prototype.Fa,ue.prototype.removeRange=ue.prototype.removeRange,ue.prototype.removeAt=ue.prototype.mb,ue.prototype.delete=ue.prototype.delete,ue.prototype.remove=ue.prototype.remove,ue.prototype.insertAt=ue.prototype.Gb,ue.prototype.pop=ue.prototype.pop,ue.prototype.last=ue.prototype.jc,ue.prototype.first=ue.prototype.first,ue.prototype.set=ue.prototype.set,ue.prototype.setElt=ue.prototype.cd,ue.prototype.get=ue.prototype.get,ue.prototype.elt=ue.prototype.M,ue.prototype.indexOf=ue.prototype.indexOf,ue.prototype.has=ue.prototype.has,ue.prototype.contains=ue.prototype.contains,ue.prototype.clear=ue.prototype.clear,ue.prototype.addAll=ue.prototype.addAll,ue.prototype.push=ue.prototype.push,ue.prototype.add=ue.prototype.add,ue.prototype.thaw=ue.prototype.ka,ue.prototype.freeze=ue.prototype.freeze,ue.className="List";function Wo(t){this.eg=t,t.Sa=null,this.qa=t.Ja,this.sa=null}Wo.prototype.reset=function(){var t=this.eg;t.Sa=null,this.qa=t.Ja,this.sa=null},Wo.prototype.next=function(){var t=this.eg;if(t.Ja!==this.qa&&this.key===null)return!1;var e=this.sa;return e=e===null?t.ea:e.va,e!==null?(this.sa=e,this.value=e.value,this.key=e.key,!0):(this.de(),!1)},Wo.prototype.Ad=function(){return this.next()},Wo.prototype.first=function(){var t=this.eg;if(this.qa=t.Ja,t=t.ea,t!==null){this.sa=t;var e=t.value;return this.key=t.key,this.value=e}return null},Wo.prototype.any=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;e!==null;){if(t(e.value))return!0;e=e.va}return!1},Wo.prototype.all=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;e!==null;){if(!t(e.value))return!1;e=e.va}return!0},Wo.prototype.each=function(t){var e=this.eg;for(this.sa=e.Sa=null,e=e.ea;e!==null;)t(e.value),e=e.va;return this},Wo.prototype.map=function(t){var e=this.eg;e.Sa=null;var i=new ue;for(e=e.ea;e!==null;)i.add(t(e.value)),e=e.va;return i.iterator},Wo.prototype.filter=function(t){var e=this.eg;e.Sa=null;var i=new ue;for(e=e.ea;e!==null;){var n=e.value;t(n)&&i.add(n),e=e.va}return i.iterator},Wo.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},Wo.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},St.Object.defineProperties(Wo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),Wo.prototype.first=Wo.prototype.first,Wo.prototype.hasNext=Wo.prototype.Ad,Wo.prototype.next=Wo.prototype.next,Wo.prototype.reset=Wo.prototype.reset,Wo.className="SetIterator";function te(t){Do(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof t=="string"&&Mt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),t!==void 0&&this.addAll(t)}L=te.prototype,L.xb=function(){var t=this.Ja;t++,999999999<t&&(t=0),this.Ja=t},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.toString=function(){return"Set()#"+Io(this)},L.add=function(t){if(t===null)return this;this._isFrozen&&ie(this,t);var e=t;return Qt(t)&&(e=Co(t)),this.Tb[e]===void 0&&(this.Sb++,t=new Ys(t,t),this.Tb[e]=t,e=this.kf,e===null?this.ea=t:(t.ll=e,e.va=t),this.kf=t,this.xb()),this},L.addAll=function(t){if(t===null)return this;if(this._isFrozen&&ie(this),ui(t))for(var e=t.length,i=0;i<e;i++)this.add(t[i]);else for(t=t.iterator;t.next();)this.add(t.value);return this},L.contains=function(t){if(t===null)return!1;var e=t;return Qt(t)&&(e=Io(t),e===void 0)?!1:this.Tb[e]!==void 0},L.has=function(t){return this.contains(t)},L.Sy=function(t){if(t===null)return!0;for(t=t.iterator;t.next();)if(!this.contains(t.value))return!1;return!0},L.Ty=function(t){if(t===null)return!0;for(t=t.iterator;t.next();)if(this.contains(t.value))return!0;return!1},L.first=function(){var t=this.ea;return t===null?null:t.value},te.prototype.any=function(t){for(var e=this.ea;e!==null;){if(t(e.value))return!0;e=e.va}return!1},te.prototype.all=function(t){for(var e=this.ea;e!==null;){if(!t(e.value))return!1;e=e.va}return!0},te.prototype.each=function(t){for(var e=this.ea;e!==null;)t(e.value),e=e.va;return this},te.prototype.map=function(t){for(var e=new te,i=this.ea;i!==null;)e.add(t(i.value)),i=i.va;return e},te.prototype.filter=function(t){for(var e=new te,i=this.ea;i!==null;){var n=i.value;t(n)&&e.add(n),i=i.va}return e},L=te.prototype,L.remove=function(t){if(t===null)return!1;this._isFrozen&&ie(this,t);var e=t;if(Qt(t)&&(e=Io(t),e===void 0)||(t=this.Tb[e],t===void 0))return!1;var i=t.va,n=t.ll;return i!==null&&(i.ll=n),n!==null&&(n.va=i),this.ea===t&&(this.ea=i),this.kf===t&&(this.kf=n),delete this.Tb[e],this.Sb--,this.xb(),!0},L.delete=function(t){return this.remove(t)},L.hp=function(t){if(t===null)return this;if(this._isFrozen&&ie(this),ui(t))for(var e=t.length,i=0;i<e;i++)this.remove(t[i]);else for(t=t.iterator;t.next();)this.remove(t.value);return this},L.pA=function(t){if(t===null||this.count===0)return this;this._isFrozen&&ie(this);var e=new te;e.addAll(t),t=[];for(var i=this.iterator;i.next();){var n=i.value;e.contains(n)||t.push(n)}return this.hp(t),this},L.clear=function(){this._isFrozen&&ie(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},te.prototype.copy=function(){var t=new te,e=this.Tb,i;for(i in e)t.add(e[i].value);return t},te.prototype.Fa=function(){var t=Array(this.Sb),e=this.Tb,i=0,n;for(n in e)t[i]=e[n].value,i++;return t},te.prototype.Hv=function(){var t=new ue,e=this.Tb,i;for(i in e)t.add(e[i].value);return t};function Do(t){t.__gohashid=ea++}function Co(t){var e=t.__gohashid;return e===void 0&&(e=ea++,t.__gohashid=e),e}function Io(t){return t.__gohashid}St.Object.defineProperties(te.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return Tr;var t=this.Sa;return t!==null?(t.reset(),t):new Wo(this)}}}),te.prototype.toList=te.prototype.Hv,te.prototype.toArray=te.prototype.Fa,te.prototype.clear=te.prototype.clear,te.prototype.retainAll=te.prototype.pA,te.prototype.removeAll=te.prototype.hp,te.prototype.delete=te.prototype.delete,te.prototype.remove=te.prototype.remove,te.prototype.first=te.prototype.first,te.prototype.containsAny=te.prototype.Ty,te.prototype.containsAll=te.prototype.Sy,te.prototype.has=te.prototype.has,te.prototype.contains=te.prototype.contains,te.prototype.addAll=te.prototype.addAll,te.prototype.add=te.prototype.add,te.prototype.thaw=te.prototype.ka,te.prototype.freeze=te.prototype.freeze;var ea=1;te.className="Set",te.uniqueHash=Do,te.hashIdUnique=Co,te.hashId=Io;function Nr(t){this.ma=t,this.qa=t.Ja,this.sa=null}Nr.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Nr.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&this.key===null)return!1;var e=this.sa;return e=e===null?t.ea:e.va,e!==null?(this.sa=e,this.value=this.key=t=e.key,!0):(this.de(),!1)},Nr.prototype.Ad=function(){return this.next()},Nr.prototype.first=function(){var t=this.ma;return this.qa=t.Ja,t=t.ea,t!==null?(this.sa=t,this.value=this.key=t=t.key):null},Nr.prototype.any=function(t){var e=this.ma;for(this.sa=null,e=e.ea;e!==null;){if(t(e.key))return!0;e=e.va}return!1},Nr.prototype.all=function(t){var e=this.ma;for(this.sa=null,e=e.ea;e!==null;){if(!t(e.key))return!1;e=e.va}return!0},Nr.prototype.each=function(t){var e=this.ma;for(this.sa=null,e=e.ea;e!==null;)t(e.key),e=e.va;return this},Nr.prototype.map=function(t){var e=this.ma;this.sa=null;var i=new ue;for(e=e.ea;e!==null;)i.add(t(e.key)),e=e.va;return i.iterator},Nr.prototype.filter=function(t){var e=this.ma;this.sa=null;var i=new ue;for(e=e.ea;e!==null;){var n=e.key;t(n)&&i.add(n),e=e.va}return i.iterator},Nr.prototype.de=function(){this.value=this.key=null,this.qa=-1},Nr.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},St.Object.defineProperties(Nr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Nr.prototype.first=Nr.prototype.first,Nr.prototype.hasNext=Nr.prototype.Ad,Nr.prototype.next=Nr.prototype.next,Nr.prototype.reset=Nr.prototype.reset,Nr.className="MapKeySetIterator";function Xn(t){te.call(this),Do(this),this._isFrozen=!0,this.ma=t}li(Xn,te),L=Xn.prototype,L.freeze=function(){return this},L.ka=function(){return this},L.toString=function(){return"MapKeySet("+this.ma.toString()+")"},L.add=function(){Mt("This Set is read-only: "+this.toString())},L.contains=function(t){return this.ma.contains(t)},L.has=function(t){return this.contains(t)},L.remove=function(){Mt("This Set is read-only: "+this.toString())},L.delete=function(t){return this.remove(t)},L.clear=function(){Mt("This Set is read-only: "+this.toString())},L.first=function(){var t=this.ma.ea;return t!==null?t.key:null},Xn.prototype.any=function(t){for(var e=this.ma.ea;e!==null;){if(t(e.key))return!0;e=e.va}return!1},Xn.prototype.all=function(t){for(var e=this.ma.ea;e!==null;){if(!t(e.key))return!1;e=e.va}return!0},Xn.prototype.each=function(t){for(var e=this.ma.ea;e!==null;)t(e.key),e=e.va;return this},Xn.prototype.map=function(t){for(var e=new te,i=this.ma.ea;i!==null;)e.add(t(i.key)),i=i.va;return e},Xn.prototype.filter=function(t){for(var e=new te,i=this.ma.ea;i!==null;){var n=i.key;t(n)&&e.add(n),i=i.va}return e},Xn.prototype.copy=function(){return new Xn(this.ma)},Xn.prototype.Iv=function(){var t=new te,e=this.ma.Tb,i;for(i in e)t.add(e[i].key);return t},Xn.prototype.Fa=function(){var t=this.ma.Tb,e=Array(this.ma.Sb),i=0,n;for(n in t)e[i]=t[n].key,i++;return e},Xn.prototype.Hv=function(){var t=new ue,e=this.ma.Tb,i;for(i in e)t.add(e[i].key);return t},St.Object.defineProperties(Xn.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?Tr:new Nr(this.ma)}}}),Xn.prototype.toList=Xn.prototype.Hv,Xn.prototype.toArray=Xn.prototype.Fa,Xn.prototype.toSet=Xn.prototype.Iv,Xn.prototype.first=Xn.prototype.first,Xn.prototype.clear=Xn.prototype.clear,Xn.prototype.delete=Xn.prototype.delete,Xn.prototype.remove=Xn.prototype.remove,Xn.prototype.has=Xn.prototype.has,Xn.prototype.contains=Xn.prototype.contains,Xn.prototype.add=Xn.prototype.add,Xn.prototype.thaw=Xn.prototype.ka,Xn.prototype.freeze=Xn.prototype.freeze,Xn.className="MapKeySet";function fo(t){this.ma=t,t.jf=null,this.qa=t.Ja,this.sa=null}fo.prototype.reset=function(){var t=this.ma;t.jf=null,this.qa=t.Ja,this.sa=null},fo.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&this.key===null)return!1;var e=this.sa;return e=e===null?t.ea:e.va,e!==null?(this.sa=e,this.value=e.value,this.key=e.key,!0):(this.de(),!1)},fo.prototype.Ad=function(){return this.next()},fo.prototype.first=function(){var t=this.ma;if(this.qa=t.Ja,t=t.ea,t!==null){this.sa=t;var e=t.value;return this.key=t.key,this.value=e}return null},fo.prototype.any=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;e!==null;){if(t(e.value))return!0;e=e.va}return!1},fo.prototype.all=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;e!==null;){if(!t(e.value))return!1;e=e.va}return!0},fo.prototype.each=function(t){var e=this.ma;for(this.sa=e.jf=null,e=e.ea;e!==null;)t(e.value),e=e.va;return this},fo.prototype.map=function(t){var e=this.ma;this.sa=e.jf=null;var i=new ue;for(e=e.ea;e!==null;)i.add(t(e.value)),e=e.va;return i.iterator},fo.prototype.filter=function(t){var e=this.ma;this.sa=e.jf=null;var i=new ue;for(e=e.ea;e!==null;){var n=e.value;t(n)&&i.add(n),e=e.va}return i.iterator},fo.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},fo.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},St.Object.defineProperties(fo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),fo.prototype.first=fo.prototype.first,fo.prototype.hasNext=fo.prototype.Ad,fo.prototype.next=fo.prototype.next,fo.prototype.reset=fo.prototype.reset,fo.className="MapValueSetIterator";function Ys(t,e){this.key=t,this.value=e,this.ll=this.va=null}Ys.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},Ys.className="KeyValuePair";function Xo(t){this.ma=t,t.Sa=null,this.qa=t.Ja,this.sa=null}Xo.prototype.reset=function(){var t=this.ma;t.Sa=null,this.qa=t.Ja,this.sa=null},Xo.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&this.key===null)return!1;var e=this.sa;return e=e===null?t.ea:e.va,e!==null?(this.sa=e,this.key=e.key,this.value=e.value,!0):(this.de(),!1)},Xo.prototype.Ad=function(){return this.next()},Xo.prototype.first=function(){var t=this.ma;return this.qa=t.Ja,t=t.ea,t!==null?(this.sa=t,this.key=t.key,this.value=t.value,t):null},Xo.prototype.any=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;e!==null;){if(t(e))return!0;e=e.va}return!1},Xo.prototype.all=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;e!==null;){if(!t(e))return!1;e=e.va}return!0},Xo.prototype.each=function(t){var e=this.ma;for(this.sa=e.Sa=null,e=e.ea;e!==null;)t(e),e=e.va;return this},Xo.prototype.map=function(t){var e=this.ma;this.sa=e.Sa=null;var i=new ue;for(e=e.ea;e!==null;)i.add(t(e)),e=e.va;return i.iterator},Xo.prototype.filter=function(t){var e=this.ma;this.sa=e.Sa=null;var i=new ue;for(e=e.ea;e!==null;)t(e)&&i.add(e),e=e.va;return i.iterator},Xo.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},Xo.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},St.Object.defineProperties(Xo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Xo.prototype.first=Xo.prototype.first,Xo.prototype.hasNext=Xo.prototype.Ad,Xo.prototype.next=Xo.prototype.next,Xo.prototype.reset=Xo.prototype.reset,Xo.className="MapIterator";function ci(t){Do(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.jf=this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof t=="string"&&Mt("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),t!==void 0&&this.addAll(t)}L=ci.prototype,L.xb=function(){var t=this.Ja;t++,999999999<t&&(t=0),this.Ja=t},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.toString=function(){return"Map()#"+Io(this)},L.add=function(t,e){this._isFrozen&&ie(this,t);var i=t;Qt(t)&&(i=Co(t));var n=this.Tb[i];return n===void 0?(this.Sb++,t=new Ys(t,e),this.Tb[i]=t,i=this.kf,i===null?this.ea=t:(t.ll=i,i.va=t),this.kf=t,this.xb()):n.value=e,this},L.set=function(t,e){return this.add(t,e)},L.addAll=function(t){if(t===null)return this;if(ui(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];this.add(n.key,n.value)}else if(t instanceof ci)for(t=t.iterator;t.next();)this.add(t.key,t.value);else for(t=t.iterator;t.next();)e=t.value,this.add(e.key,e.value);return this},L.first=function(){return this.ea},ci.prototype.any=function(t){for(var e=this.ea;e!==null;){if(t(e))return!0;e=e.va}return!1},ci.prototype.all=function(t){for(var e=this.ea;e!==null;){if(!t(e))return!1;e=e.va}return!0},ci.prototype.each=function(t){for(var e=this.ea;e!==null;)t(e),e=e.va;return this},ci.prototype.map=function(t){for(var e=new ci,i=this.ea;i!==null;)e.add(i.key,t(i)),i=i.va;return e},ci.prototype.filter=function(t){for(var e=new ci,i=this.ea;i!==null;)t(i)&&e.add(i.key,i.value),i=i.va;return e},L=ci.prototype,L.contains=function(t){var e=t;return Qt(t)&&(e=Io(t),e===void 0)?!1:this.Tb[e]!==void 0},L.has=function(t){return this.contains(t)},L.I=function(t){var e=t;return Qt(t)&&(e=Io(t),e===void 0)?null:(t=this.Tb[e],t===void 0?null:t.value)},L.get=function(t){return this.I(t)},L.remove=function(t){if(t===null)return!1;this._isFrozen&&ie(this,t);var e=t;if(Qt(t)&&(e=Io(t),e===void 0)||(t=this.Tb[e],t===void 0))return!1;var i=t.va,n=t.ll;return i!==null&&(i.ll=n),n!==null&&(n.va=i),this.ea===t&&(this.ea=i),this.kf===t&&(this.kf=n),delete this.Tb[e],this.Sb--,this.xb(),!0},L.delete=function(t){return this.remove(t)},L.clear=function(){this._isFrozen&&ie(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.jf!==null&&this.jf.reset(),this.kf=this.ea=null,this.xb()},ci.prototype.copy=function(){var t=new ci,e=this.Tb,i;for(i in e){var n=e[i];t.add(n.key,n.value)}return t},ci.prototype.Fa=function(){var t=this.Tb,e=Array(this.Sb),i=0,n;for(n in t){var s=t[n];e[i]=new Ys(s.key,s.value),i++}return e},ci.prototype.Lf=function(){return new Xn(this)},St.Object.defineProperties(ci.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return Tr;var t=this.Sa;return t!==null?(t.reset(),t):new Xo(this)}},iteratorKeys:{get:function(){return 0>=this.count?Tr:new Nr(this)}},iteratorValues:{get:function(){if(0>=this.count)return Tr;var t=this.jf;return t!==null?(t.reset(),t):new fo(this)}}}),ci.prototype.toKeySet=ci.prototype.Lf,ci.prototype.toArray=ci.prototype.Fa,ci.prototype.clear=ci.prototype.clear,ci.prototype.delete=ci.prototype.delete,ci.prototype.remove=ci.prototype.remove,ci.prototype.get=ci.prototype.get,ci.prototype.getValue=ci.prototype.I,ci.prototype.has=ci.prototype.has,ci.prototype.contains=ci.prototype.contains,ci.prototype.first=ci.prototype.first,ci.prototype.addAll=ci.prototype.addAll,ci.prototype.set=ci.prototype.set,ci.prototype.add=ci.prototype.add,ci.prototype.thaw=ci.prototype.ka,ci.prototype.freeze=ci.prototype.freeze,ci.className="Map";function G(t,e){t===void 0?this.y=this.x=0:typeof t=="number"&&typeof e=="number"?(this.x=t,this.y=e):Mt("Invalid arguments to Point constructor: "+t+", "+e),this._isFrozen=!1}var Wa,zs,Fa,ia,iu;G.prototype.assign=function(t){return this.x=t.x,this.y=t.y,this},G.prototype.h=function(t,e){return this.x=t,this.y=e,this},G.prototype.sg=function(t,e){return this.x=t,this.y=e,this},G.prototype.set=function(t){return this.x=t.x,this.y=t.y,this},G.prototype.copy=function(){var t=new G;return t.x=this.x,t.y=this.y,t},L=G.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&Mt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Pu(t){if(typeof t=="string"){t=t.split(" ");for(var e=0,i=0;t[e]==="";)e++;var n=t[e++];n&&(i=parseFloat(n));for(var s=0;t[e]==="";)e++;return(n=t[e++])&&(s=parseFloat(n)),new G(i,s)}return new G}function Th(t){return t.x.toString()+" "+t.y.toString()}L.toString=function(){return"Point("+this.x+","+this.y+")"},L.D=function(t){return t instanceof G?this.x===t.x&&this.y===t.y:!1},L.hi=function(t,e){return this.x===t&&this.y===e},L.Xa=function(t){return xt.B(this.x,t.x)&&xt.B(this.y,t.y)},L.add=function(t){return this.x+=t.x,this.y+=t.y,this},L.re=function(t){return this.x-=t.x,this.y-=t.y,this},L.offset=function(t,e){return this.x+=t,this.y+=e,this},G.prototype.rotate=function(t){if(t===0)return this;var e=this.x,i=this.y;if(e===0&&i===0)return this;if(360<=t?t-=360:0>t&&(t+=360),t===90){t=0;var n=1}else t===180?(t=-1,n=0):t===270?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));return this.x=t*e-n*i,this.y=n*e+t*i,this},L=G.prototype,L.scale=function(t,e){return this.x*=t,this.y*=e,this},L.Bf=function(t){var e=t.x-this.x;return t=t.y-this.y,e*e+t*t},L.zd=function(t,e){return t-=this.x,e-=this.y,t*t+e*e},L.normalize=function(){var t=this.x,e=this.y,i=Math.sqrt(t*t+e*e);return 0<i&&(this.x=t/i,this.y=e/i),this},L.ab=function(t){return rt(t.x-this.x,t.y-this.y)},L.direction=function(t,e){return rt(t-this.x,e-this.y)};function rt(t,e){if(t===0)return 0<e?90:0>e?270:0;if(e===0)return 0<t?0:180;if(isNaN(t)||isNaN(e))return 0;var i=180*Math.atan(Math.abs(e/t))/Math.PI;return 0>t?i=0>e?i+180:180-i:0>e&&(i=360-i),i}L.Ry=function(t,e){return xt.Fl(t.x,t.y,e.x,e.y,this.x,this.y)},L.fA=function(t,e,i,n){return xt.qh(t,e,i,n,this.x,this.y,this),this},L.gA=function(t,e){return xt.qh(t.x,t.y,e.x,e.y,this.x,this.y,this),this},L.uA=function(t,e,i,n){return xt.No(this.x,this.y,t,e,i,n,this),this},L.vA=function(t,e){return xt.No(this.x,this.y,t.x,t.y,e.width,e.height,this),this},L.xi=function(t,e){return this.x=t.x+e.x*t.width+e.offsetX,this.y=t.y+e.y*t.height+e.offsetY,this},L.yi=function(t,e,i,n,s){return this.x=t+s.x*i+s.offsetX,this.y=e+s.y*n+s.offsetY,this},L.transform=function(t){return t.Ga(this),this};function ut(t,e){return e.Cd(t),t}function re(t,e,i,n,s,a){var l=s-i,c=a-n,p=l*l+c*c;i-=t,n-=e;var m=-i*l-n*c;return 0>=m||m>=p?(l=s-t,c=a-e,Math.min(i*i+n*n,l*l+c*c)):(t=l*n-c*i,t*t/p)}function be(t,e,i,n){return t=i-t,e=n-e,t*t+e*e}function Ge(t,e,i,n){return t=i-t,e=n-e,t===0?0<e?90:0>e?270:0:e===0?0<t?0:180:isNaN(t)||isNaN(e)?0:(n=180*Math.atan(Math.abs(e/t))/Math.PI,0>t?n=0>e?n+180:180-n:0>e&&(n=360-n),n)}L.w=function(){return isFinite(this.x)&&isFinite(this.y)},G.alloc=function(){var t=ni.pop();return t===void 0?new G:t},G.allocAt=function(t,e){var i=ni.pop();return i===void 0?new G(t,e):(i.x=t,i.y=e,i)},G.free=function(t){ni.push(t)},G.prototype.isReal=G.prototype.w,G.prototype.setSpot=G.prototype.yi,G.prototype.setRectSpot=G.prototype.xi,G.prototype.snapToGridPoint=G.prototype.vA,G.prototype.snapToGrid=G.prototype.uA,G.prototype.projectOntoLineSegmentPoint=G.prototype.gA,G.prototype.projectOntoLineSegment=G.prototype.fA,G.intersectingLineSegments=function(t,e,i,n,s,a,l,c){return xt.Rl(t,e,i,n,s,a,l,c)},G.prototype.compareWithLineSegmentPoint=G.prototype.Ry,G.compareWithLineSegment=function(t,e,i,n,s,a){return xt.Fl(t,e,i,n,s,a)},G.prototype.direction=G.prototype.direction,G.prototype.directionPoint=G.prototype.ab,G.prototype.normalize=G.prototype.normalize,G.prototype.distanceSquared=G.prototype.zd,G.prototype.distanceSquaredPoint=G.prototype.Bf,G.prototype.scale=G.prototype.scale,G.prototype.rotate=G.prototype.rotate,G.prototype.offset=G.prototype.offset,G.prototype.subtract=G.prototype.re,G.prototype.add=G.prototype.add,G.prototype.equalsApprox=G.prototype.Xa,G.prototype.equalTo=G.prototype.hi,G.prototype.equals=G.prototype.D,G.prototype.set=G.prototype.set,G.prototype.setTo=G.prototype.sg;var ni=[];G.className="Point",G.parse=Pu,G.stringify=Th,G.distanceLineSegmentSquared=re,G.distanceSquared=be,G.direction=Ge,G.Origin=Wa=new G(0,0).ja(),G.InfiniteTopLeft=zs=new G(-1/0,-1/0).ja(),G.InfiniteBottomRight=Fa=new G(1/0,1/0).ja(),G.SixPoint=ia=new G(6,6).ja(),G.NoPoint=iu=new G(NaN,NaN).ja(),G.parse=Pu,G.stringify=Th,G.distanceLineSegmentSquared=re,G.distanceSquared=be,G.direction=Ge;function fe(t,e){t===void 0?this.height=this.width=0:typeof t=="number"&&(0<=t||isNaN(t))&&typeof e=="number"&&(0<=e||isNaN(e))?(this.width=t,this.height=e):Mt("Invalid arguments to Size constructor: "+t+", "+e),this._isFrozen=!1}var un,An,xr,Ur,Zn,ko,Yo;fe.prototype.assign=function(t){return this.width=t.width,this.height=t.height,this},fe.prototype.h=function(t,e){return this.width=t,this.height=e,this},fe.prototype.sg=function(t,e){return this.width=t,this.height=e,this},fe.prototype.set=function(t){return this.width=t.width,this.height=t.height,this},fe.prototype.copy=function(){var t=new fe;return t.width=this.width,t.height=this.height,t},L=fe.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&Mt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Oo(t){if(typeof t=="string"){t=t.split(" ");for(var e=0,i=0;t[e]==="";)e++;var n=t[e++];n&&(i=parseFloat(n));for(var s=0;t[e]==="";)e++;return(n=t[e++])&&(s=parseFloat(n)),new fe(i,s)}return new fe}function Ms(t){return t.width.toString()+" "+t.height.toString()}L.toString=function(){return"Size("+this.width+","+this.height+")"},L.D=function(t){return t instanceof fe?this.width===t.width&&this.height===t.height:!1},L.hi=function(t,e){return this.width===t&&this.height===e},L.Xa=function(t){return xt.B(this.width,t.width)&&xt.B(this.height,t.height)},L.Bc=function(t,e){return t=this.width+t,this.width=0<=t?t:0,e=this.height+e,this.height=0<=e?e:0,this},L.w=function(){return isFinite(this.width)&&isFinite(this.height)},fe.alloc=function(){var t=na.pop();return t===void 0?new fe:t},fe.free=function(t){na.push(t)},fe.prototype.isReal=fe.prototype.w,fe.prototype.inflate=fe.prototype.Bc,fe.prototype.equalsApprox=fe.prototype.Xa,fe.prototype.equalTo=fe.prototype.hi,fe.prototype.equals=fe.prototype.D,fe.prototype.set=fe.prototype.set,fe.prototype.setTo=fe.prototype.sg;var na=[];fe.className="Size",fe.parse=Oo,fe.stringify=Ms,fe.ZeroSize=un=new fe(0,0).ja(),fe.OneSize=An=new fe(1,1).ja(),fe.SixSize=xr=new fe(6,6).ja(),fe.EightSize=Ur=new fe(8,8).ja(),fe.TenSize=Zn=new fe(10,10).ja(),fe.InfiniteSize=ko=new fe(1/0,1/0).ja(),fe.NoSize=Yo=new fe(NaN,NaN).ja(),fe.parse=Oo,fe.stringify=Ms;function Tt(t,e,i,n){t===void 0?this.height=this.width=this.y=this.x=0:typeof t=="number"&&typeof e=="number"&&typeof i=="number"&&(0<=i||isNaN(i))&&typeof n=="number"&&(0<=n||isNaN(n))?(this.x=t,this.y=e,this.width=i,this.height=n):t instanceof G?(i=t.x,t=t.y,e instanceof G?(n=e.x,e=e.y,this.x=Math.min(i,n),this.y=Math.min(t,e),this.width=Math.abs(i-n),this.height=Math.abs(t-e)):e instanceof fe?(this.x=i,this.y=t,this.width=e.width,this.height=e.height):Mt("Incorrect second argument supplied to Rect constructor "+e)):Mt("Invalid arguments to Rect constructor: "+t+", "+e+", "+i+", "+n),this._isFrozen=!1}L=Tt.prototype,L.assign=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},L.h=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this};function yn(t,e,i){t.width=e,t.height=i}L.sg=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},L.set=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},L.dd=function(t){return this.x=t.x,this.y=t.y,this},L.tA=function(t){return this.width=t.width,this.height=t.height,this},Tt.prototype.copy=function(){var t=new Tt;return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},L=Tt.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&Mt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Yn(t){if(typeof t=="string"){t=t.split(" ");for(var e=0,i=0;t[e]==="";)e++;var n=t[e++];n&&(i=parseFloat(n));for(var s=0;t[e]==="";)e++;(n=t[e++])&&(s=parseFloat(n));for(var a=0;t[e]==="";)e++;(n=t[e++])&&(a=parseFloat(n));for(var l=0;t[e]==="";)e++;return(n=t[e++])&&(l=parseFloat(n)),new Tt(i,s,a,l)}return new Tt}function Ir(t){return t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}L.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},L.D=function(t){return t instanceof Tt?this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height:!1},L.hi=function(t,e,i,n){return this.x===t&&this.y===e&&this.width===i&&this.height===n},L.Xa=function(t){return xt.B(this.x,t.x)&&xt.B(this.y,t.y)&&xt.B(this.width,t.width)&&xt.B(this.height,t.height)};function ls(t,e){return xt.$(t.x,e.x)&&xt.$(t.y,e.y)&&xt.$(t.width,e.width)&&xt.$(t.height,e.height)}L.ca=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},L.Re=function(t){return this.x<=t.x&&t.x+t.width<=this.x+this.width&&this.y<=t.y&&t.y+t.height<=this.y+this.height},L.contains=function(t,e,i,n){return i===void 0&&(i=0),n===void 0&&(n=0),this.x<=t&&t+i<=this.x+this.width&&this.y<=e&&e+n<=this.y+this.height},L.offset=function(t,e){return this.x+=t,this.y+=e,this},L.Bc=function(t,e){return Jo(this,e,t,e,t)},L.Co=function(t){return Jo(this,t.top,t.right,t.bottom,t.left)},L.Fv=function(t){return Jo(this,-t.top,-t.right,-t.bottom,-t.left)},L.Hz=function(t,e,i,n){return Jo(this,t,e,i,n)};function Jo(t,e,i,n,s){var a=t.width;return i+s<=-a?(t.x+=a/2,t.width=0):(t.x-=s,t.width+=i+s),i=t.height,e+n<=-i?(t.y+=i/2,t.height=0):(t.y-=e,t.height+=e+n),t}L.Ex=function(t){return ra(this,t.x,t.y,t.width,t.height)},L.Uu=function(t,e,i,n){return ra(this,t,e,i,n)};function ra(t,e,i,n,s){var a=Math.max(t.x,e),l=Math.max(t.y,i);return e=Math.min(t.x+t.width,e+n),i=Math.min(t.y+t.height,i+s),t.x=a,t.y=l,t.width=Math.max(0,e-a),t.height=Math.max(0,i-l),t}L.Yc=function(t){return this.Vu(t.x,t.y,t.width,t.height)},L.Vu=function(t,e,i,n){var s=this.width,a=this.x;return s!==1/0&&i!==1/0&&(s+=a,i+=t,isNaN(i)||isNaN(s)||a>i||t>s)?!1:(t=this.height,i=this.y,!(t!==1/0&&n!==1/0&&(t+=i,n+=e,isNaN(n)||isNaN(t)||i>n||e>t)))};function $s(t,e){var i=t.width,n=t.x,s=e.x-10;return n>e.width+10+10+s||s>i+n?!1:(i=t.height,t=t.y,n=e.y-10,!(t>e.height+10+10+n||n>i+t))}L.Ye=function(t){return or(this,t.x,t.y,0,0)},L.ed=function(t){return or(this,t.x,t.y,t.width,t.height)},L.Kv=function(t,e,i,n){return i===void 0&&(i=0),n===void 0&&(n=0),or(this,t,e,i,n)};function or(t,e,i,n,s){var a=Math.min(t.x,e),l=Math.min(t.y,i);return e=Math.max(t.x+t.width,e+n),i=Math.max(t.y+t.height,i+s),t.x=a,t.y=l,t.width=e-a,t.height=i-l,t}L.yi=function(t,e,i){return this.x=t-i.offsetX-i.x*this.width,this.y=e-i.offsetY-i.y*this.height,this};function eo(t,e,i,n,s,a,l,c){return l===void 0&&(l=0),c===void 0&&(c=0),t<=s&&s+l<=t+i&&e<=a&&a+c<=e+n}function Fn(t,e,i,n,s,a,l,c){return t>l+s||s>i+t?!1:!(e>c+a||a>n+e)}L.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},L.Mz=function(){return this.width===0&&this.height===0},Tt.alloc=function(){var t=Or.pop();return t===void 0?new Tt:t},Tt.allocAt=function(t,e,i,n){var s=Or.pop();return s===void 0?new Tt(t,e,i,n):s.h(t,e,i,n)},Tt.free=function(t){Or.push(t)},St.Object.defineProperties(Tt.prototype,{left:{get:function(){return this.x},set:function(t){this.x=t}},top:{get:function(){return this.y},set:function(t){this.y=t}},right:{get:function(){return this.x+this.width},set:function(t){this.x+=t-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(t){this.y+=t-(this.y+this.height)}},position:{get:function(){return new G(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}},size:{get:function(){return new fe(this.width,this.height)},set:function(t){this.width=t.width,this.height=t.height}},center:{get:function(){return new G(this.x+this.width/2,this.y+this.height/2)},set:function(t){this.x=t.x-this.width/2,this.y=t.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}}),Tt.prototype.isEmpty=Tt.prototype.Mz,Tt.prototype.isReal=Tt.prototype.w,Tt.intersectsLineSegment=function(t,e,i,n,s,a,l,c){return xt.Fx(t,e,i,n,s,a,l,c)},Tt.prototype.setSpot=Tt.prototype.yi,Tt.prototype.union=Tt.prototype.Kv,Tt.prototype.unionRect=Tt.prototype.ed,Tt.prototype.unionPoint=Tt.prototype.Ye,Tt.prototype.intersects=Tt.prototype.Vu,Tt.prototype.intersectsRect=Tt.prototype.Yc,Tt.prototype.intersect=Tt.prototype.Uu,Tt.prototype.intersectRect=Tt.prototype.Ex,Tt.prototype.grow=Tt.prototype.Hz,Tt.prototype.subtractMargin=Tt.prototype.Fv,Tt.prototype.addMargin=Tt.prototype.Co,Tt.prototype.inflate=Tt.prototype.Bc,Tt.prototype.offset=Tt.prototype.offset,Tt.prototype.contains=Tt.prototype.contains,Tt.prototype.containsRect=Tt.prototype.Re,Tt.prototype.containsPoint=Tt.prototype.ca,Tt.prototype.equalsApprox=Tt.prototype.Xa,Tt.prototype.equalTo=Tt.prototype.hi,Tt.prototype.equals=Tt.prototype.D,Tt.prototype.setSize=Tt.prototype.tA,Tt.prototype.setPoint=Tt.prototype.dd,Tt.prototype.set=Tt.prototype.set,Tt.prototype.setTo=Tt.prototype.sg;var hn=null,_r=null,Or=[];Tt.className="Rect",Tt.parse=Yn,Tt.stringify=Ir,Tt.contains=eo,Tt.intersects=Fn,Tt.ZeroRect=hn=new Tt(0,0,0,0).ja(),Tt.NoRect=_r=new Tt(NaN,NaN,NaN,NaN).ja(),Tt.parse=Yn,Tt.stringify=Ir,Tt.contains=eo,Tt.intersects=Fn;function Ai(t,e,i,n){t===void 0?this.left=this.bottom=this.right=this.top=0:e===void 0?this.left=this.bottom=this.right=this.top=t:i===void 0?(this.top=t,this.right=e,this.bottom=t,this.left=e):n!==void 0?(this.top=t,this.right=e,this.bottom=i,this.left=n):Mt("Invalid arguments to Margin constructor: "+t+", "+e+", "+i+", "+n),this._isFrozen=!1}Ai.prototype.assign=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},Ai.prototype.sg=function(t,e,i,n){return this.top=t,this.right=e,this.bottom=i,this.left=n,this},Ai.prototype.set=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},Ai.prototype.copy=function(){var t=new Ai;return t.top=this.top,t.right=this.right,t.bottom=this.bottom,t.left=this.left,t},L=Ai.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&Mt("cannot thaw constant: "+this),this._isFrozen=!1,this};function kl(t){if(typeof t=="string"){t=t.split(" ");for(var e=0,i=NaN;t[e]==="";)e++;var n=t[e++];if(n&&(i=parseFloat(n)),isNaN(i))return new Ai;for(var s=NaN;t[e]==="";)e++;if((n=t[e++])&&(s=parseFloat(n)),isNaN(s))return new Ai(i);for(var a=NaN;t[e]==="";)e++;if((n=t[e++])&&(a=parseFloat(n)),isNaN(a))return new Ai(i,s);for(var l=NaN;t[e]==="";)e++;return(n=t[e++])&&(l=parseFloat(n)),isNaN(l)?new Ai(i,s):new Ai(i,s,a,l)}return new Ai}function El(t){return t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}L.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},L.D=function(t){return t instanceof Ai?this.top===t.top&&this.right===t.right&&this.bottom===t.bottom&&this.left===t.left:!1},L.hi=function(t,e,i,n){return this.top===t&&this.right===e&&this.bottom===i&&this.left===n},L.Xa=function(t){return xt.B(this.top,t.top)&&xt.B(this.right,t.right)&&xt.B(this.bottom,t.bottom)&&xt.B(this.left,t.left)},L.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},Ai.alloc=function(){var t=xu.pop();return t===void 0?new Ai:t},Ai.free=function(t){xu.push(t)},Ai.prototype.isReal=Ai.prototype.w,Ai.prototype.equalsApprox=Ai.prototype.Xa,Ai.prototype.equalTo=Ai.prototype.hi,Ai.prototype.equals=Ai.prototype.D,Ai.prototype.set=Ai.prototype.set,Ai.prototype.setTo=Ai.prototype.sg;var Ua=null,Sl=null,xu=[];Ai.className="Margin",Ai.parse=kl,Ai.stringify=El,Ai.ZeroMargin=Ua=new Ai(0,0,0,0).ja(),Ai.TwoMargin=Sl=new Ai(2,2,2,2).ja(),Ai.parse=kl,Ai.stringify=El;function di(t,e,i,n){t===void 0?this.offsetY=this.offsetX=this.y=this.x=0:(e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=t,this.y=e,this.offsetX=i,this.offsetY=n),this._isFrozen=!1}var jr,Fo,Ca,Ll,ol,_n,Za,nu,Tl,uu,_h,hu,ml,sl,Js,$u,Nu,df,jh,cu,Zu,js,gh,yc,Gu,ds,xc,za,wu,fu,al,gl,qa,ka,bu,rc;di.prototype.assign=function(t){return this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this},di.prototype.sg=function(t,e,i,n){return this.x=t,this.y=e,this.offsetX=i,this.offsetY=n,this},di.prototype.set=function(t){return this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this},di.prototype.copy=function(){var t=new di;return t.x=this.x,t.y=this.y,t.offsetX=this.offsetX,t.offsetY=this.offsetY,t},L=di.prototype,L.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},L.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return Object.isFrozen(this)&&Mt("cannot thaw constant: "+this),this._isFrozen=!1,this};function Hs(t,e){return t.x=NaN,t.y=NaN,t.offsetX=e,t}function Xc(t){if(typeof t=="string"){if(t=t.trim(),t==="None")return jr;if(t==="TopLeft")return Fo;if(t==="Top"||t==="TopCenter"||t==="MiddleTop")return Ca;if(t==="TopRight")return Ll;if(t==="Left"||t==="LeftCenter"||t==="MiddleLeft")return ol;if(t==="Center")return _n;if(t==="Right"||t==="RightCenter"||t==="MiddleRight")return Za;if(t==="BottomLeft")return nu;if(t==="Bottom"||t==="BottomCenter"||t==="MiddleBottom")return Tl;if(t==="BottomRight")return uu;if(t==="TopSide")return _h;if(t==="LeftSide")return hu;if(t==="RightSide")return ml;if(t==="BottomSide")return sl;if(t==="TopBottomSides")return Js;if(t==="LeftRightSides")return $u;if(t==="TopLeftSides")return Nu;if(t==="TopRightSides")return df;if(t==="BottomLeftSides")return jh;if(t==="BottomRightSides")return cu;if(t==="NotTopSide")return Zu;if(t==="NotLeftSide")return js;if(t==="NotRightSide")return gh;if(t==="NotBottomSide")return yc;if(t==="AllSides")return Gu;if(t==="Default")return ds;t=t.split(" ");for(var e=0,i=0;t[e]==="";)e++;var n=t[e++];n!==void 0&&0<n.length&&(i=parseFloat(n));for(var s=0;t[e]==="";)e++;n=t[e++],n!==void 0&&0<n.length&&(s=parseFloat(n));for(var a=0;t[e]==="";)e++;n=t[e++],n!==void 0&&0<n.length&&(a=parseFloat(n));for(var l=0;t[e]==="";)e++;return n=t[e++],n!==void 0&&0<n.length&&(l=parseFloat(n)),new di(i,s,a,l)}return new di}function wc(t){return t.sb()?t.x.toString()+" "+t.y.toString()+" "+t.offsetX.toString()+" "+t.offsetY.toString():t.toString()}L.toString=function(){return this.sb()?this.offsetX===0&&this.offsetY===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.D(jr)?"None":this.D(Fo)?"TopLeft":this.D(Ca)?"Top":this.D(Ll)?"TopRight":this.D(ol)?"Left":this.D(_n)?"Center":this.D(Za)?"Right":this.D(nu)?"BottomLeft":this.D(Tl)?"Bottom":this.D(uu)?"BottomRight":this.D(_h)?"TopSide":this.D(hu)?"LeftSide":this.D(ml)?"RightSide":this.D(sl)?"BottomSide":this.D(Js)?"TopBottomSides":this.D($u)?"LeftRightSides":this.D(Nu)?"TopLeftSides":this.D(df)?"TopRightSides":this.D(jh)?"BottomLeftSides":this.D(cu)?"BottomRightSides":this.D(Zu)?"NotTopSide":this.D(js)?"NotLeftSide":this.D(gh)?"NotRightSide":this.D(yc)?"NotBottomSide":this.D(Gu)?"AllSides":this.D(ds)?"Default":"None"},L.D=function(t){return t instanceof di?(this.x===t.x||isNaN(this.x)&&isNaN(t.x))&&(this.y===t.y||isNaN(this.y)&&isNaN(t.y))&&this.offsetX===t.offsetX&&this.offsetY===t.offsetY:!1},L.gv=function(){return new di(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},L.Hf=function(t){if(!this.$c())return!1;if(!t.$c())if(t.D(xc))t=hu;else if(t.D(za))t=ml;else if(t.D(wu))t=_h;else if(t.D(fu))t=sl;else return!1;return t=t.offsetY,(this.offsetY&t)===t},L.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},L.Mc=function(){return isNaN(this.x)||isNaN(this.y)},L.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},L.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},L.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},di.alloc=function(){var t=bc.pop();return t===void 0?new di:t},di.free=function(t){bc.push(t)},di.prototype.isDefault=di.prototype.Xb,di.prototype.isNone=di.prototype.ys,di.prototype.isSide=di.prototype.$c,di.prototype.isNoSpot=di.prototype.Mc,di.prototype.isSpot=di.prototype.sb,di.prototype.includesSide=di.prototype.Hf,di.prototype.opposite=di.prototype.gv,di.prototype.equals=di.prototype.D,di.prototype.set=di.prototype.set,di.prototype.setTo=di.prototype.sg;var bc=[];di.className="Spot",di.parse=Xc,di.stringify=wc,di.None=jr=Hs(new di(0,0,0,0),0).ja(),di.Default=ds=Hs(new di(0,0,-1,0),-1).ja(),di.TopLeft=Fo=new di(0,0,0,0).ja(),di.TopCenter=Ca=new di(.5,0,0,0).ja(),di.TopRight=Ll=new di(1,0,0,0).ja(),di.LeftCenter=ol=new di(0,.5,0,0).ja(),di.Center=_n=new di(.5,.5,0,0).ja(),di.RightCenter=Za=new di(1,.5,0,0).ja(),di.BottomLeft=nu=new di(0,1,0,0).ja(),di.BottomCenter=Tl=new di(.5,1,0,0).ja(),di.BottomRight=uu=new di(1,1,0,0).ja(),di.MiddleTop=al=Ca,di.MiddleLeft=gl=ol,di.MiddleRight=qa=Za,di.MiddleBottom=ka=Tl,di.Top=wu=Ca,di.Left=xc=ol,di.Right=za=Za,di.Bottom=fu=Tl,di.TopSide=_h=Hs(new di(0,0,1,1),1).ja(),di.LeftSide=hu=Hs(new di(0,0,1,2),1).ja(),di.RightSide=ml=Hs(new di(0,0,1,4),1).ja(),di.BottomSide=sl=Hs(new di(0,0,1,8),1).ja(),di.TopBottomSides=Js=Hs(new di(0,0,1,9),1).ja(),di.LeftRightSides=$u=Hs(new di(0,0,1,6),1).ja(),di.TopLeftSides=Nu=Hs(new di(0,0,1,3),1).ja(),di.TopRightSides=df=Hs(new di(0,0,1,5),1).ja(),di.BottomLeftSides=jh=Hs(new di(0,0,1,10),1).ja(),di.BottomRightSides=cu=Hs(new di(0,0,1,12),1).ja(),di.NotTopSide=Zu=Hs(new di(0,0,1,14),1).ja(),di.NotLeftSide=js=Hs(new di(0,0,1,13),1).ja(),di.NotRightSide=gh=Hs(new di(0,0,1,11),1).ja(),di.NotBottomSide=yc=Hs(new di(0,0,1,7),1).ja(),di.AllSides=Gu=Hs(new di(0,0,1,15),1).ja(),bu=new di(.156,.156).ja(),rc=new di(.844,.844).ja(),di.parse=Xc,di.stringify=wc;function dn(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}dn.prototype.set=function(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.dx=t.dx,this.dy=t.dy,this},dn.prototype.setTransform=function(t,e,i,n,s,a){return this.m11=t,this.m12=e,this.m21=i,this.m22=n,this.dx=s,this.dy=a,this},dn.prototype.copy=function(){var t=new dn;return t.m11=this.m11,t.m12=this.m12,t.m21=this.m21,t.m22=this.m22,t.dx=this.dx,t.dy=this.dy,t},dn.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},dn.prototype.D=function(t){return this.m11===t.m11&&this.m12===t.m12&&this.m21===t.m21&&this.m22===t.m22&&this.dx===t.dx&&this.dy===t.dy},dn.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},dn.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},dn.prototype.multiply=function(t){var e=this.m11*t.m11+this.m21*t.m12,i=this.m12*t.m11+this.m22*t.m12,n=this.m11*t.m21+this.m21*t.m22,s=this.m12*t.m21+this.m22*t.m22;return this.dx=this.m11*t.dx+this.m21*t.dy+this.dx,this.dy=this.m12*t.dx+this.m22*t.dy+this.dy,this.m11=e,this.m12=i,this.m21=n,this.m22=s,this},dn.prototype.bv=function(t){var e=1/(t.m11*t.m22-t.m12*t.m21),i=t.m22*e,n=-t.m12*e,s=-t.m21*e,a=t.m11*e,l=e*(t.m21*t.dy-t.m22*t.dx);return t=e*(t.m12*t.dx-t.m11*t.dy),e=this.m11*i+this.m21*n,i=this.m12*i+this.m22*n,n=this.m11*s+this.m21*a,s=this.m12*s+this.m22*a,this.dx=this.m11*l+this.m21*t+this.dx,this.dy=this.m12*l+this.m22*t+this.dy,this.m11=e,this.m12=i,this.m21=n,this.m22=s,this},dn.prototype.Vj=function(){var t=1/(this.m11*this.m22-this.m12*this.m21),e=-this.m12*t,i=-this.m21*t,n=this.m11*t,s=t*(this.m21*this.dy-this.m22*this.dx),a=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=this.m22*t,this.m12=e,this.m21=i,this.m22=n,this.dx=s,this.dy=a,this},dn.prototype.rotate=function(t,e,i){if(360<=t?t-=360:0>t&&(t+=360),t===0)return this;if(this.translate(e,i),t===90){t=0;var n=1}else t===180?(t=-1,n=0):t===270?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));var s=this.m12*t+this.m22*n,a=this.m11*-n+this.m21*t,l=this.m12*-n+this.m22*t;return this.m11=this.m11*t+this.m21*n,this.m12=s,this.m21=a,this.m22=l,this.translate(-e,-i),this},L=dn.prototype,L.translate=function(t,e){return this.dx+=this.m11*t+this.m21*e,this.dy+=this.m12*t+this.m22*e,this},L.scale=function(t,e){return e===void 0&&(e=t),this.m11*=t,this.m12*=t,this.m21*=e,this.m22*=e,this},L.Ga=function(t){var e=t.x,i=t.y;return t.h(e*this.m11+i*this.m21+this.dx,e*this.m12+i*this.m22+this.dy)},L.Cd=function(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=t.x,n=t.y;return t.h(i*this.m22*e+n*-this.m21*e+e*(this.m21*this.dy-this.m22*this.dx),i*-this.m12*e+n*this.m11*e+e*(this.m12*this.dx-this.m11*this.dy))},L.Eu=function(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=1.25*t.x,n=1.2*t.y;return t.h(i*this.m22*e+n*-this.m21*e+e*(this.m21*this.dy-this.m22*this.dx),i*-this.m12*e+n*this.m11*e+e*(this.m12*this.dx-this.m11*this.dy))},L.pp=function(t){var e=t.x,i=t.y,n=e+t.width,s=i+t.height,a=this.m11,l=this.m12,c=this.m21,p=this.m22,m=this.dx,v=this.dy,w=e*a+i*c+m,C=e*l+i*p+v,k=n*a+i*c+m,T=n*l+i*p+v;return i=e*a+s*c+m,e=e*l+s*p+v,a=n*a+s*c+m,n=n*l+s*p+v,s=Math.min(w,k),w=Math.max(w,k),k=Math.min(C,T),C=Math.max(C,T),s=Math.min(s,i),w=Math.max(w,i),k=Math.min(k,e),C=Math.max(C,e),s=Math.min(s,a),w=Math.max(w,a),k=Math.min(k,n),C=Math.max(C,n),t.h(s,k,w-s,C-k),t},dn.alloc=function(){var t=Oc.pop();return t===void 0?new dn:t},dn.free=function(t){Oc.push(t)},dn.prototype.transformRect=dn.prototype.pp,dn.prototype.transformPoint=dn.prototype.Ga,dn.prototype.scale=dn.prototype.scale,dn.prototype.translate=dn.prototype.translate,dn.prototype.rotate=dn.prototype.rotate,dn.prototype.invert=dn.prototype.Vj,dn.prototype.multiplyInverted=dn.prototype.bv,dn.prototype.multiply=dn.prototype.multiply,dn.prototype.reset=dn.prototype.reset,dn.prototype.isIdentity=dn.prototype.ws,dn.prototype.equals=dn.prototype.D,dn.prototype.setTransform=dn.prototype.setTransform,dn.prototype.set=dn.prototype.set;var Oc=[];dn.className="Transform",dn.xF="54a702f3e53909c447824c6706603faf4c";var xt={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(t){if(0>=t)return 0;var e=xt.Uv;if(e===null){e=[];for(var i=0;2e3>=i;i++)e[i]=Math.sqrt(i);xt.Uv=e}return 1>t?(i=1/t,2e3>=i?1/e[i|0]:Math.sqrt(t)):2e3>=t?e[t|0]:Math.sqrt(t)},B:function(t,e){return t-=e,.5>t&&-.5<t},$:function(t,e){return t-=e,5e-8>t&&-5e-8<t},Yb:function(t,e,i,n,s,a,l){if(0>=s&&(s=1e-6),t<i)var c=t,p=i;else c=i,p=t;if(e<n)var m=e,v=n;else m=n,v=e;if(t===i)return m<=l&&l<=v&&t-s<=a&&a<=t+s;if(e===n)return c<=a&&a<=p&&e-s<=l&&l<=e+s;if(p+=s,c-=s,c<=a&&a<=p&&(v+=s,m-=s,m<=l&&l<=v))if(p-c>v-m)if(t-i>s||i-t>s){if(a=(n-e)/(i-t)*(a-t)+e,a-s<=l&&l<=a+s)return!0}else return!0;else if(e-n>s||n-e>s){if(l=(i-t)/(n-e)*(l-e)+t,l-s<=a&&a<=l+s)return!0}else return!0;return!1},cs:function(t,e,i,n,s,a,l,c,p,m,v,w){if(xt.Yb(t,e,l,c,w,i,n)&&xt.Yb(t,e,l,c,w,s,a))return xt.Yb(t,e,l,c,w,m,v);var C=(t+i)/2,k=(e+n)/2,T=(i+s)/2,A=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(C+T)/2,i=(k+A)/2,T=(T+s)/2,A=(A+a)/2;var X=(n+T)/2,$=(i+A)/2;return xt.cs(t,e,C,k,n,i,X,$,p,m,v,w)||xt.cs(X,$,T,A,s,a,l,c,p,m,v,w)},ax:function(t,e,i,n,s,a,l,c,p){var m=(i+s)/2,v=(n+a)/2;return p.h((((t+i)/2+m)/2+(m+(s+l)/2)/2)/2,(((e+n)/2+v)/2+(v+(a+c)/2)/2)/2),p},My:function(t,e,i,n,s,a,l,c){var p=(i+s)/2,m=(n+a)/2;return Ge(((t+i)/2+p)/2,((e+n)/2+m)/2,(p+(s+l)/2)/2,(m+(a+c)/2)/2)},Dl:function(t,e,i,n,s,a,l,c,p,m){if(xt.Yb(t,e,l,c,p,i,n)&&xt.Yb(t,e,l,c,p,s,a))or(m,t,e,0,0),or(m,l,c,0,0);else{var v=(t+i)/2,w=(e+n)/2,C=(i+s)/2,k=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(v+C)/2,i=(w+k)/2,C=(C+s)/2,k=(k+a)/2;var T=(n+C)/2,A=(i+k)/2;xt.Dl(t,e,v,w,n,i,T,A,p,m),xt.Dl(T,A,C,k,s,a,l,c,p,m)}return m},Qe:function(t,e,i,n,s,a,l,c,p,m){if(xt.Yb(t,e,l,c,p,i,n)&&xt.Yb(t,e,l,c,p,s,a))m.length===0&&(m.push(t),m.push(e)),m.push(l),m.push(c);else{var v=(t+i)/2,w=(e+n)/2,C=(i+s)/2,k=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(v+C)/2,i=(w+k)/2,C=(C+s)/2,k=(k+a)/2;var T=(n+C)/2,A=(i+k)/2;xt.Qe(t,e,v,w,n,i,T,A,p,m),xt.Qe(T,A,C,k,s,a,l,c,p,m)}return m},jv:function(t,e,i,n,s,a,l,c,p,m){if(xt.Yb(t,e,s,a,m,i,n))return xt.Yb(t,e,s,a,m,c,p);var v=(t+i)/2,w=(e+n)/2;i=(i+s)/2,n=(n+a)/2;var C=(v+i)/2,k=(w+n)/2;return xt.jv(t,e,v,w,C,k,l,c,p,m)||xt.jv(C,k,i,n,s,a,l,c,p,m)},OA:function(t,e,i,n,s,a,l){return l.h(((t+i)/2+(i+s)/2)/2,((e+n)/2+(n+a)/2)/2),l},iv:function(t,e,i,n,s,a,l,c){if(xt.Yb(t,e,s,a,l,i,n))or(c,t,e,0,0),or(c,s,a,0,0);else{var p=(t+i)/2,m=(e+n)/2;i=(i+s)/2,n=(n+a)/2;var v=(p+i)/2,w=(m+n)/2;xt.iv(t,e,p,m,v,w,l,c),xt.iv(v,w,i,n,s,a,l,c)}return c},ep:function(t,e,i,n,s,a,l,c){if(xt.Yb(t,e,s,a,l,i,n))c.length===0&&(c.push(t),c.push(e)),c.push(s),c.push(a);else{var p=(t+i)/2,m=(e+n)/2;i=(i+s)/2,n=(n+a)/2;var v=(p+i)/2,w=(m+n)/2;xt.ep(t,e,p,m,v,w,l,c),xt.ep(v,w,i,n,s,a,l,c)}return c},Eo:function(t,e,i,n,s,a,l,c,p,m,v,w,C,k){if(xt.Yb(t,e,l,c,C,i,n)&&xt.Yb(t,e,l,c,C,s,a))return!xt.Rl(t,e,l,c,p,m,v,w)||(C=(t-l)*(m-w)-(e-c)*(p-v),C===0)?!1:(k.h(((t*c-e*l)*(p-v)-(t-l)*(p*w-m*v))/C,((t*c-e*l)*(m-w)-(e-c)*(p*w-m*v))/C),!0);var T=(t+i)/2,A=(e+n)/2,X=(i+s)/2,$=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(T+X)/2,i=(A+$)/2,X=(X+s)/2,$=($+a)/2;var J=(n+X)/2,et=(i+$)/2,st=1/0,mt=!1,Pt=0,De=0;return xt.Eo(t,e,T,A,n,i,J,et,p,m,v,w,C,k)&&(t=(k.x-p)*(k.x-p)+(k.y-m)*(k.y-m),t<st&&(st=t,mt=!0,Pt=k.x,De=k.y)),xt.Eo(J,et,X,$,s,a,l,c,p,m,v,w,C,k)&&(k.x-p)*(k.x-p)+(k.y-m)*(k.y-m)<st&&(mt=!0,Pt=k.x,De=k.y),mt&&(k.x=Pt,k.y=De),mt},Fo:function(t,e,i,n,s,a,l,c,p,m,v,w,C){var k=0;if(xt.Yb(t,e,l,c,C,i,n)&&xt.Yb(t,e,l,c,C,s,a)){if(C=(t-l)*(m-w)-(e-c)*(p-v),C===0)return k;var T=((t*c-e*l)*(p-v)-(t-l)*(p*w-m*v))/C,A=((t*c-e*l)*(m-w)-(e-c)*(p*w-m*v))/C;if(T>=v)return k;if((p>v?p-v:v-p)<(m>w?m-w:w-m)){if(e<c?(p=e,t=c):(p=c,t=e),A<p||A>t)return k}else if(t<l?(p=t,t=l):p=l,T<p||T>t)return k;0<C?k++:0>C&&k--}else{T=(t+i)/2,A=(e+n)/2;var X=(i+s)/2,$=(n+a)/2;s=(s+l)/2,a=(a+c)/2,n=(T+X)/2,i=(A+$)/2,X=(X+s)/2,$=($+a)/2;var J=(n+X)/2,et=(i+$)/2;k+=xt.Fo(t,e,T,A,n,i,J,et,p,m,v,w,C),k+=xt.Fo(J,et,X,$,s,a,l,c,p,m,v,w,C)}return k},qh:function(t,e,i,n,s,a,l){return xt.$(t,i)?(e<n?(i=e,e=n):i=n,a<i?(l.h(t,i),!1):a>e?(l.h(t,e),!1):(l.h(t,a),!0)):xt.$(e,n)?(t<i?(n=t,t=i):n=i,s<n?(l.h(n,e),!1):s>t?(l.h(t,e),!1):(l.h(s,e),!0)):(s=((t-s)*(t-i)+(e-a)*(e-n))/((i-t)*(i-t)+(n-e)*(n-e)),-5e-6>s?(l.h(t,e),!1):1.000005<s?(l.h(i,n),!1):(l.h(t+s*(i-t),e+s*(n-e)),!0))},Ve:function(t,e,i,n,s,a,l,c,p){return xt.B(t,i)&&xt.B(e,n)?(p.h(t,e),!1):xt.$(s,l)?xt.$(t,i)?(xt.qh(t,e,i,n,s,a,p),!1):xt.qh(t,e,i,n,s,(n-e)/(i-t)*(s-t)+e,p):(c=(c-a)/(l-s),xt.$(t,i)?(i=c*(t-s)+a,e<n?(s=e,e=n):s=n,i<s?(p.h(t,s),!1):i>e?(p.h(t,e),!1):(p.h(t,i),!0)):(l=(n-e)/(i-t),xt.$(c,l)?(xt.qh(t,e,i,n,s,a,p),!1):(s=(l*t-c*s+a-e)/(l-c),xt.$(l,0)?(t<i?(n=t,t=i):n=i,s<n?(p.h(n,e),!1):s>t?(p.h(t,e),!1):(p.h(s,e),!0)):xt.qh(t,e,i,n,s,l*(s-t)+e,p))))},MA:function(t,e,i,n,s){return xt.Ve(i.x,i.y,n.x,n.y,t.x,t.y,e.x,e.y,s)},KA:function(t,e,i,n,s,a,l,c,p,m){function v(X,$){var J=(X-t)*(X-t)+($-e)*($-e);J<w&&(w=J,p.h(X,$))}var w=1/0;v(p.x,p.y);var C=0,k=0,T=0,A=0;if(s<l?(C=s,k=l):(C=l,k=s),a<c?(T=s,A=l):(T=l,A=s),C=(k-C)/2+m,m=(A-T)/2+m,s=(s+l)/2,a=(a+c)/2,C===0||m===0)return p;if(.5>(i>t?i-t:t-i)){if(C=1-(i-s)*(i-s)/(C*C),0>C)return p;C=Math.sqrt(C),n=-m*C+a,v(i,m*C+a),v(i,n)}else{if(i=(n-e)/(i-t),n=1/(C*C)+i*i/(m*m),c=2*i*(e-i*t)/(m*m)-2*i*a/(m*m)-2*s/(C*C),C=c*c-4*n*(2*i*t*a/(m*m)-2*e*a/(m*m)+a*a/(m*m)+s*s/(C*C)-1+(e-i*t)*(e-i*t)/(m*m)),0>C)return p;C=Math.sqrt(C),m=(-c+C)/(2*n),v(m,i*m-i*t+e),C=(-c-C)/(2*n),v(C,i*C-i*t+e)}return p},Ff:function(t,e,i,n,s,a,l,c,p){var m=1e21,v=t,w=e;if(xt.Ve(t,e,t,n,s,a,l,c,p)){var C=(p.x-s)*(p.x-s)+(p.y-a)*(p.y-a);C<m&&(m=C,v=p.x,w=p.y)}return xt.Ve(i,e,i,n,s,a,l,c,p)&&(C=(p.x-s)*(p.x-s)+(p.y-a)*(p.y-a),C<m&&(m=C,v=p.x,w=p.y)),xt.Ve(t,e,i,e,s,a,l,c,p)&&(e=(p.x-s)*(p.x-s)+(p.y-a)*(p.y-a),e<m&&(m=e,v=p.x,w=p.y)),xt.Ve(t,n,i,n,s,a,l,c,p)&&(t=(p.x-s)*(p.x-s)+(p.y-a)*(p.y-a),t<m&&(m=t,v=p.x,w=p.y)),p.h(v,w),1e21>m},us:function(t,e,i){return xt.Fx(t.x,t.y,t.width,t.height,e.x,e.y,i.x,i.y)},Fx:function(t,e,i,n,s,a,l,c){var p=t+i,m=e+n;return s===l?(a<c?(l=a,a=c):l=c,t<=s&&s<=p&&l<=m&&a>=e):a===c?(s<l?(c=s,s=l):c=l,e<=a&&a<=m&&c<=p&&s>=t):!!(eo(t,e,i,n,s,a)||eo(t,e,i,n,l,c)||xt.Rl(t,e,p,e,s,a,l,c)||xt.Rl(p,e,p,m,s,a,l,c)||xt.Rl(p,m,t,m,s,a,l,c)||xt.Rl(t,m,t,e,s,a,l,c))},Rl:function(t,e,i,n,s,a,l,c){return t===i&&e===n&&s===l&&a===c?t===s&&e===a:0>=xt.Fl(t,e,i,n,s,a)*xt.Fl(t,e,i,n,l,c)&&0>=xt.Fl(s,a,l,c,t,e)*xt.Fl(s,a,l,c,i,n)},Fl:function(t,e,i,n,s,a){return i-=t,n-=e,t=s-t,e=a-e,a=t*n-e*i,a===0&&(a=t*i+e*n,0<a&&(a=(t-i)*i+(e-n)*n,0>a&&(a=0))),a},bp:function(t){return 0>t&&(t+=360),360<=t&&(t-=360),t},jx:function(t,e,i,n,s,a){var l=Math.PI;a||(n*=l/180,s*=l/180);var c=n>s?-1:1;a=[];var p=l/2,m=n;if(n=Math.min(2*l,Math.abs(s-n)),1e-5>n)return p=m+c*Math.min(n,p),c=t+i*Math.cos(m),m=e+i*Math.sin(m),t+=i*Math.cos(p),e+=i*Math.sin(p),i=(c+t)/2,p=(m+e)/2,a.push([c,m,i,p,i,p,t,e]),a;for(;1e-5<n;)s=m+c*Math.min(n,p),a.push(xt.Vy(i,m,s,t,e)),n-=Math.abs(s-m),m=s;return a},Vy:function(t,e,i,n,s){var a=(i-e)/2,l=t*Math.cos(a),c=t*Math.sin(a),p=-c,m=l*l+p*p,v=m+l*l+p*c;return m=4/3*(Math.sqrt(2*m*v)-v)/(l*c-p*l),c=l-m*p,l=p+m*l,p=-l,m=a+e,a=Math.cos(m),m=Math.sin(m),[n+t*Math.cos(e),s+t*Math.sin(e),n+c*a-l*m,s+c*m+l*a,n+c*a-p*m,s+c*m+p*a,n+t*Math.cos(i),s+t*Math.sin(i)]},No:function(t,e,i,n,s,a,l){i=Math.floor((t-i)/s)*s+i,n=Math.floor((e-n)/a)*a+n;var c=i;return i+s-t<s/2&&(c=i+s),t=n,n+a-e<a/2&&(t=n+a),l.h(c,t),l},vx:function(t,e){var i=Math.max(t,e);t=Math.min(t,e);var n;do e=i%t,i=n=t,t=e;while(0<e);return n},$y:function(t,e,i,n){var s=0>i,a=0>n;if(t<e)var l=1,c=0;else l=0,c=1;var p=l===0?t:e,m=l===0?i:n;return(l===0?s:a)&&(m=-m),l=c,i=l===0?i:n,(l===0?s:a)&&(i=-i),xt.az(p,l===0?t:e,m,i,0,0)},az:function(t,e,i,n,s,a){if(0<n)if(0<i){s=t*t,a=e*e,t*=i;var l=e*n,c=-a+l,p=-a+Math.sqrt(t*t+l*l);e=c;for(var m=0;9999999999>m&&(e=.5*(c+p),!(e===c||e===p));++m){var v=t/(e+s),w=l/(e+a);if(v=v*v+w*w-1,0<v)c=e;else if(0>v)p=e;else break}i=s*i/(e+s)-i,n=a*n/(e+a)-n,i=Math.sqrt(i*i+n*n)}else i=Math.abs(n-e);else n=t*t-e*e,a=t*i,a<n?(n=a/n,a=e*Math.sqrt(Math.abs(1-n*n)),i=t*n-i,i=Math.sqrt(i*i+a*a)):i=Math.abs(i-t);return i},Ze:new Bo,um:new Bo,Mf:new Bo,Nf:0,vm:100};xt.za=xt.AA;function ve(t){Do(this),this.l=2,t===void 0&&(t=ve.o),this.na=t,this.Ec=this.Dc=this.pd=this.od=0,t===ve.o?this.ee=new ue:(ve.V===null&&(ve.V=new ue().freeze()),this.ee=ve.V),this.aq=this.ee.Ja,this.Ip=new Tt().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=Fo,this.gg=uu,this.Rk=this.Sk=NaN,this.Uf=oe}ve.prototype.copy=function(){var t=new ve;if(t.l=this.l&-2,t.na=this.na,t.od=this.od,t.pd=this.pd,t.Dc=this.Dc,t.Ec=this.Ec,this.na===ve.o){for(var e=this.ee.s,i=t.ee,n=0;n<e.length;n++)i.add(e[n].copy());t.ee=i}else t.ee=this.ee;return t.aq=this.aq,t.Ip.assign(this.Ip),t.tk=this.tk,t.ym=this.ym,t.zm=this.zm,t.fg=this.fg.J(),t.gg=this.gg.J(),t.Sk=this.Sk,t.Rk=this.Rk,t.Uf=this.Uf,t},ve.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},ve.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==ve.o)return this;var t=this.figures;t.freeze(),t=t.s;for(var e=t.length,i=0;i<e;i++)t[i].freeze();return this},ve.prototype.ka=function(){if(Object.isFrozen(this)&&Mt("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==ve.o)return this;var t=this.figures;t.ka(),t=t.s;for(var e=t.length,i=0;i<e;i++)t[i].ka();return this},ve.prototype.Xa=function(t){if(!(t instanceof ve))return!1;if(this.type!==t.type)return this.type===ve.j&&t.type===ve.o?Kh(this,t):t.type===ve.j&&this.type===ve.o?Kh(t,this):!1;if(this.type===ve.o){var e=this.figures.s;t=t.figures.s;var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(!e[n].Xa(t[n]))return!1;return!0}return xt.B(this.startX,t.startX)&&xt.B(this.startY,t.startY)&&xt.B(this.endX,t.endX)&&xt.B(this.endY,t.endY)};function Kh(t,e){return t.type!==ve.j||e.type!==ve.o?!1:!!(e.figures.count===1&&(e=e.figures.M(0),e.segments.count===1&&xt.B(t.startX,e.startX)&&xt.B(t.startY,e.startY)&&(e=e.segments.M(0),e.type===po&&xt.B(t.endX,e.endX)&&xt.B(t.endY,e.endY))))}ve.ia=function(t){return t.toString()},ve.prototype.qb=function(t){t.classType===ve&&(this.type=t)},ve.prototype.toString=function(t){switch(t===void 0&&(t=-1),this.type){case ve.j:return 0>t?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t)+"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);case ve.u:var e=new Tt(this.startX,this.startY,0,0);return e.Kv(this.endX,this.endY,0,0),0>t?"M"+e.x.toString()+" "+e.y.toString()+"H"+e.right.toString()+"V"+e.bottom.toString()+"H"+e.left.toString()+"z":"M"+e.x.toFixed(t)+" "+e.y.toFixed(t)+"H"+e.right.toFixed(t)+"V"+e.bottom.toFixed(t)+"H"+e.left.toFixed(t)+"z";case ve.F:if(e=new Tt(this.startX,this.startY,0,0),e.Kv(this.endX,this.endY,0,0),0>t)return t=e.left.toString()+" "+(e.y+e.height/2).toString(),"M"+t+"A"+(e.width/2).toString()+" "+(e.height/2).toString()+" 0 0 1 "+(e.right.toString()+" "+(e.y+e.height/2).toString())+"A"+(e.width/2).toString()+" "+(e.height/2).toString()+" 0 0 1 "+t;var i=e.left.toFixed(t)+" "+(e.y+e.height/2).toFixed(t);return"M"+i+"A"+(e.width/2).toFixed(t)+" "+(e.height/2).toFixed(t)+" 0 0 1 "+(e.right.toFixed(t)+" "+(e.y+e.height/2).toFixed(t))+"A"+(e.width/2).toFixed(t)+" "+(e.height/2).toFixed(t)+" 0 0 1 "+i;case ve.o:e="",i=this.figures.s;for(var n=i.length,s=0;s<n;s++){var a=i[s];0<s&&(e+=" x "),a.isFilled&&(e+="F "),e+=a.toString(t)}return e;default:return this.type.toString()}},ve.nb=function(t){t=t.split(/[Xx]/);for(var e=t.length,i="",n=0;n<e;n++){var s=t[n];i=s.match(/[Ff]/)!==null?n===0?i+s:i+("X"+(s[0]===" "?"":" ")+s):i+((n===0?"":"X ")+"F"+(s[0]===" "?"":" ")+s)}return i},ve.parse=function(t,e){function i(){return A>=st-1?!0:m[A+1].match(mt)!==null}function n(){return A++,m[A]}function s(sn){var Ui=parseFloat(n()),Vr=parseFloat(n());X===X.toLowerCase()&&(Ui=et.x+Ui,Vr=et.y+Vr),sn.h(Ui,Vr)}function a(){return s(et),et}function l(){return s(J),J}function c(){var sn=$.toLowerCase();return sn!=="c"&&sn!=="s"&&sn!=="q"&&sn!=="t"?et:new G(2*et.x-J.x,2*et.y-J.y)}e===void 0&&(e=!1);var p=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;t=t.replace(/,/gm," "),t=t.replace(p,"$1 $2"),t=t.replace(p,"$1 $2"),t=t.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2"),t=t.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2"),t=t.replace(/([0-9])([+\-])/gm,"$1 $2"),t=t.replace(/[\s\r\t\n]+/gm," "),t=t.replace(/^\s+|\s+$/g,"");var m=t.split(" ");for(t=0;t<m.length;t++){var v=m[t];if(v.match(/(\.[0-9]*)(\.)/gm)!==null){p=gi();for(var w="",C=!1,k=0;k<v.length;k++){var T=v[k];T!=="."||C?T==="."?(p.push(w),w="."):w+=T:(C=!0,w+=T)}for(p.push(w),m.splice(t,1),v=0;v<p.length;v++)m.splice(t+v,0,p[v]);t+=p.length-1,Ji(p)}}var A=-1,X="",$="";p=new G(0,0);var J=new G(0,0),et=new G(0,0),st=m.length;t=ny(null),C=w=v=!1,k=!0,T=null;for(var mt=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(A>=st-1);)if($=X,X=n(),X!=="")switch(X.toUpperCase()){case"X":k=!0,w=v=!1;break;case"M":for(T=a(),t.mc===null||k===!0?(mp(t,T.x,T.y,v,!w,C),k=!1):t.moveTo(T.x,T.y),p.assign(et);!i();)T=a(),t.lineTo(T.x,T.y);break;case"L":for(;!i();)T=a(),t.lineTo(T.x,T.y);break;case"H":for(;!i();)et=new G((X===X.toLowerCase()?et.x:0)+parseFloat(n()),et.y),t.lineTo(et.x,et.y);break;case"V":for(;!i();)et=new G(et.x,(X===X.toLowerCase()?et.y:0)+parseFloat(n())),t.lineTo(et.x,et.y);break;case"C":for(;!i();){T=new G,s(T);var Pt=l(),De=a();jc(t,T.x,T.y,Pt.x,Pt.y,De.x,De.y)}break;case"S":for(;!i();)T=c(),Pt=l(),De=a(),jc(t,T.x,T.y,Pt.x,Pt.y,De.x,De.y);break;case"Q":for(;!i();)T=l(),Pt=a(),Fd(t,T.x,T.y,Pt.x,Pt.y);break;case"T":for(;!i();)J=T=c(),Pt=a(),Fd(t,T.x,T.y,Pt.x,Pt.y);break;case"B":for(;!i();){T=parseFloat(n()),Pt=parseFloat(n()),De=parseFloat(n());var ti=parseFloat(n()),Ve=parseFloat(n()),ye=Ve,Yt=!1;i()||(ye=parseFloat(n()),i()||(Yt=parseFloat(n())!==0)),X===X.toLowerCase()&&(De+=et.x,ti+=et.y),t.arcTo(T,Pt,De,ti,Ve,ye,Yt)}break;case"A":for(;!i();)T=Math.abs(parseFloat(n())),Pt=Math.abs(parseFloat(n())),De=parseFloat(n()),Ve=ti=!1,Yt=ye=0,ye=n(),ye.length===1?(ti=!!parseFloat(ye),Ve=!!parseFloat(n()),ye=parseFloat(n())):ye.length===2?(ti=!!parseFloat(ye[0]),Ve=!!parseFloat(ye[1]),ye=parseFloat(n())):(ti=!!parseFloat(ye[0]),Ve=!!parseFloat(ye[1]),ye=parseFloat(ye.slice(2))),Yt=parseFloat(n()),X===X.toLowerCase()&&(ye=et.x+ye,Yt=et.y+Yt),et.h(ye,Yt),gp(t,T,Pt,De,ti,Ve,ye,Yt);break;case"Z":dx(t),et.assign(p);break;case"F":for(T="",Pt=1;m[A+Pt];)if(m[A+Pt]==="0")C=!0,Pt++;else if(m[A+Pt].match(/[Uu]/)!==null)Pt++;else if(m[A+Pt].match(mt)===null)Pt++;else{T=m[A+Pt];break}T.match(/[Mm]/)?v=!0:0<t.mc.segments.length&&(t.mc.isFilled=!0);break;case"U":for(T="",Pt=1;m[A+Pt];)if(m[A+Pt].match(/[Ff]/)!==null)Pt++;else if(m[A+Pt].match(mt)===null)Pt++;else{T=m[A+Pt];break}T.match(/[Mm]/)?w=!0:t.mc.isShadowed=!1}if(p=t.os,i0=t,e)for(e=p.figures.iterator;e.next();)e.value.isFilled=!0;return p},ve.Ha=function(t,e){for(var i=t.length,n=G.alloc(),s=0;s<i;s++){var a=t[s];n.x=a[0],n.y=a[1],e.Ga(n),a[0]=n.x,a[1]=n.y,n.x=a[2],n.y=a[3],e.Ga(n),a[2]=n.x,a[3]=n.y,n.x=a[4],n.y=a[5],e.Ga(n),a[4]=n.x,a[5]=n.y,n.x=a[6],n.y=a[7],e.Ga(n),a[6]=n.x,a[7]=n.y}G.free(n)},ve.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===ve.o){if(this.aq!==this.figures.Ja)return!0;for(var t=this.figures.s,e=t.length,i=0;i<e;i++)if(t[i].Zu())return!0}return!1},ve.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===ve.o){this.aq=this.figures.Ja;for(var t=this.figures.s,e=t.length,i=0;i<e;i++){var n=t[i];n._isInvalidBounds=!1;var s=n.segments;n.sr=s.Ja,n=s.s,s=n.length;for(var a=0;a<s;a++){var l=n[a];l._isInvalidBounds=!1,l.ae=null}}}t=this.Ip,t.ka(),isNaN(this.Sk)||isNaN(this.Rk)?t.h(0,0,0,0):t.h(0,0,this.Sk,this.Rk),Sc(this,t,!1),or(t,0,0,0,0),t.freeze()},ve.prototype.ix=function(){var t=new Tt;return Sc(this,t,!0),t};function Sc(t,e,i){switch(t.type){case ve.j:case ve.u:case ve.F:i?e.h(t.od,t.pd,0,0):or(e,t.od,t.pd,0,0),or(e,t.Dc,t.Ec,0,0);break;case ve.o:var n=t.figures;t=n.s,n=n.length;for(var s=0;s<n;s++){var a=t[s];i&&s===0?e.h(a.startX,a.startY,0,0):or(e,a.startX,a.startY,0,0);for(var l=a.segments.s,c=l.length,p=a.startX,m=a.startY,v=0;v<c;v++){var w=l[v];switch(w.type){case po:case oa:p=w.endX,m=w.endY,or(e,p,m,0,0);break;case $a:xt.Dl(p,m,w.point1X,w.point1Y,w.point2X,w.point2Y,w.endX,w.endY,.5,e),p=w.endX,m=w.endY;break;case ps:xt.iv(p,m,w.point1X,w.point1Y,w.endX,w.endY,.5,e),p=w.endX,m=w.endY;break;case sr:case Vs:var C=w.type===sr?vl(w,a):Al(w,a,p,m),k=C.length;if(k===0){p=w.type===sr?w.centerX:w.endX,m=w.type===sr?w.centerY:w.endY,or(e,p,m,0,0);break}w=null;for(var T=0;T<k;T++)w=C[T],xt.Dl(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],.5,e);w!==null&&(p=w[6],m=w[7]);break;default:Mt("Unknown Segment type: "+w.type)}}}break;default:Mt("Unknown Geometry type: "+t.type)}}ve.prototype.normalize=function(){this._isFrozen&&ie(this);var t=this.ix();return this.offset(-t.x,-t.y),new G(-t.x,-t.y)},ve.prototype.offset=function(t,e){return this._isFrozen&&ie(this),this.transform(1,0,0,1,t,e),this},ve.prototype.scale=function(t,e){return this._isFrozen&&ie(this),this.transform(t,0,0,e,0,0),this},ve.prototype.rotate=function(t,e,i){this._isFrozen&&ie(this),e===void 0&&(e=0),i===void 0&&(i=0);var n=dn.alloc();return n.reset(),n.rotate(t,e,i),this.transform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),dn.free(n),this},L=ve.prototype,L.transform=function(t,e,i,n,s,a){switch(this.type){case ve.j:case ve.u:case ve.F:var l=this.od,c=this.pd;this.od=l*t+c*i+s,this.pd=l*e+c*n+a,l=this.Dc,c=this.Ec,this.Dc=l*t+c*i+s,this.Ec=l*e+c*n+a;break;case ve.o:for(var p=this.figures.s,m=p.length,v=0;v<m;v++){var w=p[v];l=w.startX,c=w.startY,w.startX=l*t+c*i+s,w.startY=l*e+c*n+a,w=w.segments.s;for(var C=w.length,k=0;k<C;k++){var T=w[k];switch(T.type){case po:case oa:l=T.endX,c=T.endY,T.endX=l*t+c*i+s,T.endY=l*e+c*n+a;break;case $a:l=T.point1X,c=T.point1Y,T.point1X=l*t+c*i+s,T.point1Y=l*e+c*n+a,l=T.point2X,c=T.point2Y,T.point2X=l*t+c*i+s,T.point2Y=l*e+c*n+a,l=T.endX,c=T.endY,T.endX=l*t+c*i+s,T.endY=l*e+c*n+a;break;case ps:l=T.point1X,c=T.point1Y,T.point1X=l*t+c*i+s,T.point1Y=l*e+c*n+a,l=T.endX,c=T.endY,T.endX=l*t+c*i+s,T.endY=l*e+c*n+a;break;case sr:l=T.centerX,c=T.centerY,T.centerX=l*t+c*i+s,T.centerY=l*e+c*n+a,e!==0&&(l=180*Math.atan2(e,t)/Math.PI,0>l&&(l+=360),T.startAngle+=l),0>t&&(T.startAngle=180-T.startAngle,T.sweepAngle=-T.sweepAngle),0>n&&(T.startAngle=-T.startAngle,T.sweepAngle=-T.sweepAngle),T.radiusX*=Math.sqrt(t*t+i*i),T.radiusY!==void 0&&(T.radiusY*=Math.sqrt(e*e+n*n));break;case Vs:if(l=T.endX,c=T.endY,T.endX=l*t+c*i+s,T.endY=l*e+c*n+a,T.radiusX===0||T.radiusY===0)break;e!==0&&(l=180*Math.atan2(e,t)/Math.PI,0>l&&(l+=360),T.xAxisRotation+=l),0>t&&(T.xAxisRotation=180-T.xAxisRotation,T.isClockwiseArc=!T.isClockwiseArc),0>n&&(T.xAxisRotation=-T.xAxisRotation,T.isClockwiseArc=!T.isClockwiseArc),T.radiusX*=Math.sqrt(t*t+i*i),T.radiusY*=Math.sqrt(e*e+n*n);break;default:Mt("Unknown Segment type: "+T.type)}}}}return this._isInvalidBounds=!0,this},L.ca=function(t,e){e===void 0&&(e=0);var i=this.od,n=this.pd,s=this.Dc,a=this.Ec;switch(this.type){case ve.j:return xt.Yb(i,n,s,a,e,t.x,t.y);case ve.u:var l=Tt.allocAt(Math.min(i,s)-e,Math.min(n,a)-e,Math.abs(s-i)+2*e,Math.abs(a-n)+2*e);return t=l.ca(t),Tt.free(l),t;case ve.F:l=Math.min(i,s)-e;var c=Math.min(n,a)-e;return i=(Math.abs(s-i)+2*e)/2,e=(Math.abs(a-n)+2*e)/2,0>=i||0>=e?!1:(l=t.x-(l+i),c=t.y-(c+e),1>=l*l/(i*i)+c*c/(e*e));case ve.o:return Ph(this,t,e,!0,!1);default:return!1}};function Ph(t,e,i,n,s){var a=e.x;e=e.y;for(var l=t.bounds.x-20,c=0,p,m,v,w,C=t.figures.s,k=C.length,T=0;T<k;T++){var A=C[T],X=!A.isEvenOdd;if(A.isFilled){if(n&&A.ca(a,e,i))return!0;var $=A.segments;p=A.startX,m=A.startY;for(var J=p,et=m,st=$.s,mt=0;mt<=$.length;mt++){var Pt=void 0;if(mt!==$.length){Pt=st[mt];var De=Pt.type;t=Pt.endX,w=Pt.endY}else De=po,t=J,w=et;switch(De){case oa:if(J=Nh(a,e,l,e,p,m,J,et),isNaN(J))return!0;c+=J,J=t,et=w;break;case po:if(p=Nh(a,e,l,e,p,m,t,w),isNaN(p))return!0;c+=p;break;case $a:v=xt.Fo(p,m,Pt.point1X,Pt.point1Y,Pt.point2X,Pt.point2Y,t,w,l,e,a,e,.5),c+=v;break;case ps:v=xt.Fo(p,m,(p+2*Pt.point1X)/3,(m+2*Pt.point1Y)/3,(2*Pt.point1X+t)/3,(2*Pt.point1Y+w)/3,t,w,l,e,a,e,.5),c+=v;break;case sr:case Vs:De=Pt.type===sr?vl(Pt,A):Al(Pt,A,p,m);var ti=De.length;if(ti===0){if(p=Nh(a,e,l,e,p,m,Pt.type===sr?Pt.centerX:Pt.endX,Pt.type===sr?Pt.centerY:Pt.endY),isNaN(p))return!0;c+=p;break}Pt=null;for(var Ve=0;Ve<ti;Ve++){if(Pt=De[Ve],Ve===0){if(v=Nh(a,e,l,e,p,m,Pt[0],Pt[1]),isNaN(v))return!0;c+=v}v=xt.Fo(Pt[0],Pt[1],Pt[2],Pt[3],Pt[4],Pt[5],Pt[6],Pt[7],l,e,a,e,.5),c+=v}Pt!==null&&(t=Pt[6],w=Pt[7]);break;default:Mt("Unknown Segment type: "+Pt.type)}p=t,m=w}if(X){if(c!==0)return!0}else if(c%2!==0)return!0;c=0}else if(A.ca(a,e,s?i:i+2))return!0}return!1}function Nh(t,e,i,n,s,a,l,c){if(xt.Yb(s,a,l,c,.05,t,e))return NaN;var p=(t-i)*(a-c);if(p===0)return 0;var m=((t*n-e*i)*(s-l)-(t-i)*(s*c-a*l))/p;if(e=(t*n-e*i)*(a-c)/p,m>=t)return 0;if((s>l?s-l:l-s)<(a>c?a-c:c-a)){if(a<c){if(e<a||e>c)return 0}else if(e<c||e>a)return 0}else if(s<l){if(m<s||m>l)return 0}else if(m<l||m>s)return 0;return 0<p?1:-1}function Su(t,e,i,n){t=t.figures.s;for(var s=t.length,a=0;a<s;a++)if(t[a].ca(e,i,n))return!0;return!1}L.Pu=function(t,e){if(0>t?t=0:1<t&&(t=1),e===void 0&&(e=new G),this.type===ve.j)return e.h(this.startX+t*(this.endX-this.startX),this.startY+t*(this.endY-this.startY)),e;for(var i=this.flattenedSegments,n=this.flattenedLengths,s=i.length,a=this.flattenedTotalLength*t,l=0,c=0;c<s;c++){var p=n[c],m=p.length;for(t=0;t<m;t++){var v=p[t];if(l+v>=a)return n=a-l,n=v===0?0:n/v,i=i[c],c=i[2*t],s=i[2*t+1],e.h(c+(i[2*t+2]-c)*n,s+(i[2*t+3]-s)*n),e;l+=v}}return e},L.wx=function(t){if(0>t?t=0:1<t&&(t=1),this.type===ve.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var e=this.flattenedSegments,i=this.flattenedLengths,n=e.length,s=this.flattenedTotalLength*t,a=0,l=0;l<n;l++){var c=i[l],p=c.length;for(t=0;t<p;t++){var m=c[t];if(a+m>=s)return s=e[l],e=s[2*t],i=s[2*t+1],n=s[2*t+2],t=s[2*t+3],1>Math.abs(n-e)&&1>Math.abs(t-i)?0:1>Math.abs(n-e)?0<=t-i?90:270:1>Math.abs(t-i)?0<=n-e?0:180:180*Math.atan2(t-i,n-e)/Math.PI;a+=m}}return NaN},L.Qu=function(t,e){if(0>t?t=0:1<t&&(t=1),e===void 0&&(e=[]),e.length=3,this.type===ve.j)return e[0]=this.startX+t*(this.endX-this.startX),e[1]=this.startY+t*(this.endY-this.startY),e[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,e;for(var i=this.flattenedSegments,n=this.flattenedLengths,s=i.length,a=this.flattenedTotalLength*t,l=0,c=0;c<s;c++){var p=n[c],m=p.length;for(t=0;t<m;t++){var v=p[t];if(l+v>=a)return n=a-l,n=v===0?0:n/v,v=i[c],i=v[2*t],c=v[2*t+1],s=v[2*t+2],t=v[2*t+3],e[0]=i+(s-i)*n,e[1]=c+(t-c)*n,e[2]=1>Math.abs(s-i)&&1>Math.abs(t-c)?0:1>Math.abs(s-i)?0<=t-c?90:270:1>Math.abs(t-c)?0<=s-i?0:180:180*Math.atan2(t-c,s-i)/Math.PI,e;l+=v}}return e},L.xx=function(t){if(this.type===ve.j){var e=this.startX,i=this.startY,n=this.endX,s=this.endY;if(e!==n||i!==s){var a=t.x;if(t=t.y,e===n){if(i<s){var l=i;n=s}else l=s,n=i;return t<=l?l===i?0:1:t>=n?n===i?0:1:Math.abs(t-i)/(n-l)}if(i===s)return e<n?l=e:(l=n,n=e),a<=l?l===e?0:1:a>=n?n===e?0:1:Math.abs(a-e)/(n-l);l=(n-e)*(n-e)+(s-i)*(s-i);var c=G.alloc();return xt.qh(e,i,n,s,a,t,c),t=c.x,a=c.y,G.free(c),Math.sqrt(((t-e)*(t-e)+(a-i)*(a-i))/l)}}else if(this.type===ve.u){l=this.startX,c=this.startY;var p=this.endX;if(s=this.endY,l!==p||c!==s){e=p-l,i=s-c,a=2*e+2*i,n=t.x,t=t.y,n=Math.min(Math.max(n,l),p),t=Math.min(Math.max(t,c),s),l=Math.abs(n-l),p=Math.abs(n-p),c=Math.abs(t-c),s=Math.abs(t-s);var m=Math.min(l,p,c,s);if(m===c)return n/a;if(m===p)return(e+t)/a;if(m===s)return(2*e+i-n)/a;if(m===l)return(2*e+2*i-t)/a}}else{e=this.flattenedSegments,i=this.flattenedLengths,a=this.flattenedTotalLength,n=G.alloc(),s=1/0,c=l=0,p=e.length;for(var v=m=0,w=0;w<p;w++)for(var C=e[w],k=i[w],T=C.length,A=0;A<T;A+=2){var X=C[A],$=C[A+1];if(A!==0){xt.qh(m,v,X,$,t.x,t.y,n);var J=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y);J<s&&(s=J,l=c,l+=Math.sqrt((n.x-m)*(n.x-m)+(n.y-v)*(n.y-v))),c+=k[(A-2)/2]}m=X,v=$}return G.free(n),t=l/a,0>t?0:1<t?1:t}return 0};function Mc(t){if(t.tk===null){var e=t.tk=[],i=t.ym=[],n=[],s=[];if(t.type===ve.j)n.push(t.startX),n.push(t.startY),n.push(t.endX),n.push(t.endY),e.push(n),s.push(Math.sqrt((t.startX-t.endX)*(t.startX-t.endX)+(t.startY-t.endY)*(t.startY-t.endY))),i.push(s);else if(t.type===ve.u)n.push(t.startX),n.push(t.startY),n.push(t.endX),n.push(t.startY),n.push(t.endX),n.push(t.endY),n.push(t.startX),n.push(t.endY),n.push(t.startX),n.push(t.startY),e.push(n),s.push(Math.abs(t.startX-t.endX)),s.push(Math.abs(t.startY-t.endY)),s.push(Math.abs(t.startX-t.endX)),s.push(Math.abs(t.startY-t.endY)),i.push(s);else if(t.type===ve.F){var a=new fa;a.startX=t.endX,a.startY=(t.startY+t.endY)/2;var l=new zn(sr);if(l.startAngle=0,l.sweepAngle=360,l.centerX=(t.startX+t.endX)/2,l.centerY=(t.startY+t.endY)/2,l.radiusX=Math.abs(t.startX-t.endX)/2,l.radiusY=Math.abs(t.startY-t.endY)/2,a.add(l),t=vl(l,a),s=t.length,s===0)n.push(l.centerX),n.push(l.centerY);else{l=a.startX,a=a.startY;for(var c=0;c<s;c++){var p=t[c];xt.Qe(l,a,p[2],p[3],p[4],p[5],p[6],p[7],.5,n),l=p[6],a=p[7]}}e.push(n),i.push(Cc(n))}else for(t=t.figures.iterator;t.next();){s=t.value,n=[],n.push(s.startX),n.push(s.startY),l=s.startX,a=s.startY,c=l,p=a;for(var m=s.segments.s,v=m.length,w=0;w<v;w++){var C=m[w];switch(C.type){case oa:4<=n.length&&(e.push(n),i.push(Cc(n))),n=[],n.push(C.endX),n.push(C.endY),l=C.endX,a=C.endY,c=l,p=a;break;case po:n.push(C.endX),n.push(C.endY),l=C.endX,a=C.endY;break;case $a:xt.Qe(l,a,C.point1X,C.point1Y,C.point2X,C.point2Y,C.endX,C.endY,.5,n),l=C.endX,a=C.endY;break;case ps:xt.ep(l,a,C.point1X,C.point1Y,C.endX,C.endY,.5,n),l=C.endX,a=C.endY;break;case sr:var k=vl(C,s),T=k.length;if(T===0){n.push(C.centerX),n.push(C.centerY),l=C.centerX,a=C.centerY;break}for(var A=0;A<T;A++){var X=k[A];xt.Qe(l,a,X[2],X[3],X[4],X[5],X[6],X[7],.5,n),l=X[6],a=X[7]}break;case Vs:if(k=Al(C,s,l,a),T=k.length,A=C.endX,X=C.endY,T===0){n.push(A),n.push(X),l=A,a=X;break}for(A=0;A<T;A++)X=k[A],xt.Qe(l,a,X[2],X[3],X[4],X[5],X[6],X[7],.5,n),l=X[6],a=X[7];break;default:Mt("Segment not of valid type: "+C.type)}C.isClosed&&(n.push(c),n.push(p))}4<=n.length&&(e.push(n),i.push(Cc(n)))}}}function Cc(t){for(var e=[],i=0,n=0,s=t.length,a=0;a<s;a+=2){var l=t[a],c=t[a+1];a!==0&&e.push(Math.sqrt(be(i,n,l,c))),i=l,n=c}return e}L.add=function(t){return this.ee.add(t),this},L.pm=function(t,e,i,n,s,a,l,c){return this._isFrozen&&ie(this),this.fg=new di(t,e,s,a).freeze(),this.gg=new di(i,n,l,c).freeze(),this},St.Object.defineProperties(ve.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(t){this.l=t?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(t){this.l=t?this.l|2:this.l&-3}},flattenedSegments:{get:function(){return Mc(this),this.tk}},flattenedLengths:{get:function(){return Mc(this),this.ym}},flattenedTotalLength:{get:function(){var t=this.zm;if(isNaN(t)){if(this.type===ve.j){t=Math.abs(this.endX-this.startX);var e=Math.abs(this.endY-this.startY);t=Math.sqrt(t*t+e*e)}else if(this.type===ve.u)t=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-this.startY);else{e=this.flattenedLengths;for(var i=e.length,n=t=0;n<i;n++)for(var s=e[n],a=s.length,l=0;l<a;l++)t+=s[l]}this.zm=t}return t}},type:{get:function(){return this.na},set:function(t){this.na!==t&&(this._isFrozen&&ie(this,t),this.na=t,t===ve.o?this.ee=new ue:(ve.V===null&&(ve.V=new ue().freeze()),this.ee=ve.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(t){this.od!==t&&(this._isFrozen&&ie(this,t),this.od=t,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(t){this.pd!==t&&(this._isFrozen&&ie(this,t),this.pd=t,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(t){this.Dc!==t&&(this._isFrozen&&ie(this,t),this.Dc=t,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(t){this.Ec!==t&&(this._isFrozen&&ie(this,t),this.Ec=t,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(t){this.ee!==t&&(this._isFrozen&&ie(this,t),this.ee=t,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(t){this._isFrozen&&ie(this,t),this.fg=t.J()}},spot2:{get:function(){return this.gg},set:function(t){this._isFrozen&&ie(this,t),this.gg=t.J()}},defaultStretch:{get:function(){return this.Uf},set:function(t){this._isFrozen&&ie(this,t),this.Uf=t}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),ve.prototype.setSpots=ve.prototype.pm,ve.prototype.add=ve.prototype.add,ve.prototype.getFractionForPoint=ve.prototype.xx,ve.prototype.getPointAndAngleAlongPath=ve.prototype.Qu,ve.prototype.getAngleAlongPath=ve.prototype.wx,ve.prototype.getPointAlongPath=ve.prototype.Pu,ve.prototype.containsPoint=ve.prototype.ca,ve.prototype.transform=ve.prototype.transform,ve.prototype.rotate=ve.prototype.rotate,ve.prototype.scale=ve.prototype.scale,ve.prototype.offset=ve.prototype.offset,ve.prototype.normalize=ve.prototype.normalize,ve.prototype.computeBoundsWithoutOrigin=ve.prototype.ix,ve.prototype.equalsApprox=ve.prototype.Xa,ve.className="Geometry",ve.j=new he(ve,"Line",0),ve.u=new he(ve,"Rectangle",1),ve.F=new he(ve,"Ellipse",2),ve.o=new he(ve,"Path",3),ve.V=null,ve.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",ve.className="Geometry",ve.stringify=ve.ia,ve.fillPath=ve.nb,ve.parse=ve.parse,ve.Line=ve.j,ve.Rectangle=ve.u,ve.Ellipse=ve.F,ve.Path=ve.o;function fa(t,e,i,n,s){Do(this),i===void 0&&(i=!0),n===void 0&&(n=!0),s===void 0&&(s=!1),this.l=2|(i?4:0)|(n?8:0)|(s?16:0),t!==void 0?this.od=t:this.od=0,e!==void 0?this.pd=e:this.pd=0,this.pl=new ue,this.sr=this.pl.Ja,this.fw=null}fa.prototype.copy=function(){var t=new fa;t.l=this.l&-2,t.od=this.od,t.pd=this.pd;for(var e=this.pl.s,i=e.length,n=t.pl,s=0;s<i;s++){var a=e[s].copy();n.add(a)}return t.sr=this.sr,t.fw=this.fw,t},L=fa.prototype,L.Xa=function(t){if(!(t instanceof fa&&xt.B(this.startX,t.startX)&&xt.B(this.startY,t.startY)))return!1;var e=this.segments.s;t=t.segments.s;var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(!e[n].Xa(t[n]))return!1;return!0},L.toString=function(t){t===void 0&&(t=-1);for(var e=0>t?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t),i=this.segments.s,n=i.length,s=0;s<n;s++)e+=" "+i[s].toString(t);return e},L.freeze=function(){this._isFrozen=!0;var t=this.segments;t.freeze();var e=t.s;t=t.length;for(var i=0;i<t;i++)e[i].freeze();return this},L.ka=function(){this._isFrozen=!1;var t=this.segments;t.ka(),t=t.s;for(var e=t.length,i=0;i<e;i++)t[i].ka();return this},L.Zu=function(){if(this._isInvalidBounds)return!0;var t=this.segments;if(this.sr!==t.Ja)return!0;t=t.s;for(var e=t.length,i=0;i<e;i++)if(t[i]._isInvalidBounds)return!0;return!1},L.add=function(t){return this.pl.add(t),this},L.ca=function(t,e,i){for(var n=this.startX,s=this.startY,a=n,l=s,c=this.segments.s,p=c.length,m=0;m<p;m++){var v=c[m];switch(v.type){case oa:a=v.endX,l=v.endY,n=v.endX,s=v.endY;break;case po:if(xt.Yb(n,s,v.endX,v.endY,i,t,e))return!0;n=v.endX,s=v.endY;break;case $a:if(xt.cs(n,s,v.point1X,v.point1Y,v.point2X,v.point2Y,v.endX,v.endY,.5,t,e,i))return!0;n=v.endX,s=v.endY;break;case ps:if(xt.jv(n,s,v.point1X,v.point1Y,v.endX,v.endY,.5,t,e,i))return!0;n=v.endX,s=v.endY;break;case sr:case Vs:var w=v.type===sr?vl(v,this):Al(v,this,n,s),C=w.length,k=v.type===sr?v.centerX:v.endX,T=v.type===sr?v.centerY:v.endY;if(C===0){if(xt.Yb(n,s,k,T,i,t,e))return!0;n=k,s=T;break}for(k=null,T=0;T<C;T++)if(k=w[T],T===0&&xt.Yb(n,s,k[0],k[1],i,t,e)||xt.cs(k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7],.5,t,e,i))return!0;k!==null&&(n=k[6],s=k[7]);break;default:Mt("Unknown Segment type: "+v.type)}if(v.isClosed&&(n!==a||s!==l)&&xt.Yb(n,s,a,l,i,t,e))return!0}return!1},St.Object.defineProperties(fa.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(t){this.l=t?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(t){this.l=t?this.l|2:this.l&-3}},isFilled:{get:function(){return(this.l&4)!==0},set:function(t){this._isFrozen&&ie(this,t),this.l=t?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(t){this._isFrozen&&ie(this,t),this.l=t?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(t){this._isFrozen&&ie(this,t),this.l=t?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(t){this._isFrozen&&ie(this,t),this.od=t,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(t){this._isFrozen&&ie(this,t),this.pd=t,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(t){this._isFrozen&&ie(this,t),this.pl=t,this._isInvalidBounds=!0}}}),fa.prototype.add=fa.prototype.add,fa.prototype.equalsApprox=fa.prototype.Xa,fa.className="PathFigure";function zn(t,e,i,n,s,a,l,c){Do(this),t===void 0&&(t=po),this.na=t,this.l=2,e!==void 0?this.Dc=e:this.Dc=0,i!==void 0?this.Ec=i:this.Ec=0,n===void 0&&(n=0),s===void 0&&(s=0),a===void 0&&(a=0),l===void 0&&(l=0),t===Vs?(t=a%360,0>t&&(t+=360),this.Ne=t,this.Vh=0,this.Wh=Math.max(n,0),this.Pg=Math.max(s,0),typeof l=="boolean"?l&&(this.isLargeArc=!0):typeof l=="number"&&l&&(this.isLargeArc=!0),c&&(this.isClockwiseArc=!0)):(this.Ne=n,this.Vh=s,t===sr&&(a=Math.max(a,0)),this.Wh=a,typeof l=="number"?(t===sr&&(l=Math.max(l,0)),this.Pg=l):this.Pg=0),this.ae=null}zn.prototype.copy=function(){var t=new zn;return t.na=this.na,t.l=this.l&-2,t.Dc=this.Dc,t.Ec=this.Ec,t.Ne=this.Ne,t.Vh=this.Vh,t.Wh=this.Wh,t.Pg=this.Pg,t},L=zn.prototype,L.Xa=function(t){if(!(t instanceof zn)||this.type!==t.type||this.isClosed!==t.isClosed)return!1;switch(this.type){case oa:case po:return xt.B(this.endX,t.endX)&&xt.B(this.endY,t.endY);case $a:return xt.B(this.endX,t.endX)&&xt.B(this.endY,t.endY)&&xt.B(this.point1X,t.point1X)&&xt.B(this.point1Y,t.point1Y)&&xt.B(this.point2X,t.point2X)&&xt.B(this.point2Y,t.point2Y);case ps:return xt.B(this.endX,t.endX)&&xt.B(this.endY,t.endY)&&xt.B(this.point1X,t.point1X)&&xt.B(this.point1Y,t.point1Y);case sr:return xt.B(this.startAngle,t.startAngle)&&xt.B(this.sweepAngle,t.sweepAngle)&&xt.B(this.centerX,t.centerX)&&xt.B(this.centerY,t.centerY)&&xt.B(this.radiusX,t.radiusX)&&xt.B(this.radiusY,t.radiusY);case Vs:return this.isClockwiseArc===t.isClockwiseArc&&this.isLargeArc===t.isLargeArc&&xt.B(this.xAxisRotation,t.xAxisRotation)&&xt.B(this.endX,t.endX)&&xt.B(this.endY,t.endY)&&xt.B(this.radiusX,t.radiusX)&&xt.B(this.radiusY,t.radiusY);default:return!1}},L.qb=function(t){t.classType===zn&&(this.type=t)},L.toString=function(t){switch(t===void 0&&(t=-1),this.type){case oa:t=0>t?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case po:t=0>t?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case $a:t=0>t?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(t)+" "+this.point1Y.toFixed(t)+" "+this.point2X.toFixed(t)+" "+this.point2Y.toFixed(t)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case ps:t=0>t?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(t)+" "+this.point1Y.toFixed(t)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case sr:t=0>t?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(t)+" "+this.sweepAngle.toFixed(t)+" "+this.centerX.toFixed(t)+" "+this.centerY.toFixed(t)+" "+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t);break;case Vs:t=0>t?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t)+" "+this.xAxisRotation.toFixed(t)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;default:t=this.type.toString()}return t+(this.isClosed?"z":"")},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.close=function(){return this.isClosed=!0,this};function vl(t,e){if(t.ae!==null&&e._isInvalidBounds===!1)return t.ae;var i=t.radiusX,n=t.radiusY;if(n===void 0&&(n=i),i===0||n===0)return t.ae=[],t.ae;e=t.Ne;var s=t.Vh,a=xt.jx(0,0,i<n?i:n,t.startAngle,t.startAngle+t.sweepAngle,!1);if(i!==n){var l=dn.alloc();l.reset(),i<n?l.scale(1,n/i):l.scale(i/n,1),ve.Ha(a,l),dn.free(l)}for(i=a.length,n=0;n<i;n++)l=a[n],l[0]+=e,l[1]+=s,l[2]+=e,l[3]+=s,l[4]+=e,l[5]+=s,l[6]+=e,l[7]+=s;return t.ae=a,t.ae}function Al(t,e,i,n){function s(A,X,$,J){return(A*J<X*$?-1:1)*Math.acos((A*$+X*J)/(Math.sqrt(A*A+X*X)*Math.sqrt($*$+J*J)))}if(t.ae!==null&&e._isInvalidBounds===!1)return t.ae;if(t.radiusX===0||t.radiusY===0)return t.ae=[],t.ae;e=t.Wh;var a=t.Pg;e===0&&(e=1e-4),a===0&&(a=1e-4);var l=Math.PI/180*t.Ne,c=t.isLargeArc,p=t.isClockwiseArc,m=t.Dc,v=t.Ec,w=Math.cos(l),C=Math.sin(l),k=w*(i-m)/2+C*(n-v)/2;l=-C*(i-m)/2+w*(n-v)/2;var T=k*k/(e*e)+l*l/(a*a);return 1<T&&(e*=Math.sqrt(T),a*=Math.sqrt(T)),T=(c===p?-1:1)*Math.sqrt((e*e*a*a-e*e*l*l-a*a*k*k)/(e*e*l*l+a*a*k*k)),isNaN(T)&&(T=0),c=T*e*l/a,T=T*-a*k/e,isNaN(c)&&(c=0),isNaN(T)&&(T=0),i=(i+m)/2+w*c-C*T,n=(n+v)/2+C*c+w*T,v=s(1,0,(k-c)/e,(l-T)/a),w=(k-c)/e,m=(l-T)/a,k=(-k-c)/e,c=(-l-T)/a,l=s(w,m,k,c),k=(w*k+m*c)/(Math.sqrt(w*w+m*m)*Math.sqrt(k*k+c*c)),-1>=k?l=Math.PI:1<=k&&(l=0),!p&&0<l&&(l-=2*Math.PI),p&&0>l&&(l+=2*Math.PI),p=e>a?1:e/a,k=e>a?a/e:1,e=xt.jx(0,0,e>a?e:a,v,v+l,!0),a=dn.alloc(),a.reset(),a.translate(i,n),a.rotate(t.Ne,0,0),a.scale(p,k),ve.Ha(e,a),dn.free(a),t.ae=e,t.ae}St.Object.defineProperties(zn.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(t){this.l=t?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(t){this.l=t?this.l|2:this.l&-3}},isClosed:{get:function(){return(this.l&8)!==0},set:function(t){this.isClosed!==t&&(this.l=t?this.l|8:this.l&-9,this._isInvalidBounds=!0)}},type:{get:function(){return this.na},set:function(t){this._isFrozen&&ie(this,t),this.na=t,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(t){this._isFrozen&&ie(this,t),this.Dc=t,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(t){this._isFrozen&&ie(this,t),this.Ec=t,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(t){this._isFrozen&&ie(this,t),this.Ne=t,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(t){this._isFrozen&&ie(this,t),this.Vh=t,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(t){this._isFrozen&&ie(this,t),this.Wh=t,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(t){this._isFrozen&&ie(this,t),this.Pg=t,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(t){this._isFrozen&&ie(this,t),this.Ne=t,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(t){this._isFrozen&&ie(this,t),this.Vh=t,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(t){0>t&&Re(t,">= zero",zn,"radiusX"),this._isFrozen&&ie(this,t),this.Wh=t,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(t){0>t&&Re(t,">= zero",zn,"radiusY"),this._isFrozen&&ie(this,t),this.Pg=t,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(t){this._isFrozen&&ie(this,t),t%=360,0>t&&(t+=360),this.Dc=t,this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(t){this._isFrozen&&ie(this,t),360<t&&(t=360),-360>t&&(t=-360),this.Ec=t,this._isInvalidBounds=!0}},isClockwiseArc:{get:function(){return(this.l&4)!==0},set:function(t){this._isFrozen&&ie(this,t),this.l=t?this.l|4:this.l&-5,this._isInvalidBounds=!0}},isLargeArc:{get:function(){return(this.l&16)!==0},set:function(t){this._isFrozen&&ie(this,t),this.l=t?this.l|16:this.l&-17,this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(t){this._isFrozen&&ie(this,t),t%=360,0>t&&(t+=360),this.Ne=t,this._isInvalidBounds=!0}}}),zn.prototype.equalsApprox=zn.prototype.Xa;var oa=new he(zn,"Move",0),po=new he(zn,"Line",1),$a=new he(zn,"Bezier",2),ps=new he(zn,"QuadraticBezier",3),sr=new he(zn,"Arc",4),Vs=new he(zn,"SvgArc",4);zn.className="PathSegment",zn.Move=oa,zn.Line=po,zn.Bezier=$a,zn.QuadraticBezier=ps,zn.Arc=sr,zn.SvgArc=Vs;function _s(){this.H=null,this.xu=new G(0,0).freeze(),this.mt=new G(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}_s.prototype.copy=function(){var t=new _s;return this.clone(t)},_s.prototype.clone=function(t){return t.H=this.H,t.xu.assign(this.viewPoint),t.mt.assign(this.documentPoint),t.Rq=this.Rq,t.Bp=this.Bp,t.Cp=this.Cp,t.xq=this.xq,t.Tp=this.Tp,t.Wr=this.Wr,t.Ep=this.Ep,t.Rp=this.Rp,t.tq=this.tq,t.nq=this.nq,t.xg=this.xg,t.Zp=this.Zp,t.Rr=this.Rr,t.Nr=this.Nr,t.xd=this.xd,t},_s.prototype.toString=function(){var t="^";return this.modifiers!==0&&(t+="M:"+this.modifiers),this.button!==0&&(t+="B:"+this.button),this.key!==""&&(t+="K:"+this.key),this.clickCount!==0&&(t+="C:"+this.clickCount),this.delta!==0&&(t+="D:"+this.delta),this.handled&&(t+="h"),this.bubbles&&(t+="b"),this.documentPoint!==null&&(t+="@"+this.documentPoint.toString()),t},_s.prototype.So=function(t,e){var i=this.diagram;return i===null||Ho(i,t,e),e},_s.prototype.Bz=function(t,e){var i=this.diagram;return i===null||(Ho(i,t,e),e.assign(i.Ps(e))),e},St.Object.defineProperties(_s.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},viewPoint:{get:function(){return this.xu},set:function(t){this.xu.assign(t)}},documentPoint:{get:function(){return this.mt},set:function(t){this.mt.assign(t)}},modifiers:{get:function(){return this.Rq},set:function(t){this.Rq=t}},button:{get:function(){return this.Bp},set:function(t){if(this.Bp=t,this.event===null)switch(t){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(t){this.Cp=t}},key:{get:function(){return this.xq},set:function(t){this.xq=t}},down:{get:function(){return this.Tp},set:function(t){this.Tp=t}},up:{get:function(){return this.Wr},set:function(t){this.Wr=t}},clickCount:{get:function(){return this.Ep},set:function(t){this.Ep=t}},delta:{get:function(){return this.Rp},set:function(t){this.Rp=t}},isMultiTouch:{get:function(){return this.tq},set:function(t){this.tq=t}},handled:{get:function(){return this.nq},set:function(t){this.nq=t}},bubbles:{get:function(){return this.xg},set:function(t){this.xg=t}},event:{get:function(){return this.Zp},set:function(t){this.Zp=t}},isTouchEvent:{get:function(){var t=this.event;return t===null?!1:t.pointerType==="touch"||t.pointerType==="pen"}},timestamp:{get:function(){return this.Rr},set:function(t){this.Rr=t}},targetDiagram:{get:function(){return this.Nr},set:function(t){this.Nr=t}},targetObject:{get:function(){return this.xd},set:function(t){this.xd=t}},control:{get:function(){return(this.modifiers&1)!==0},set:function(t){this.modifiers=t?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return(this.modifiers&4)!==0},set:function(t){this.modifiers=t?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return(this.modifiers&2)!==0},set:function(t){this.modifiers=t?this.modifiers|2:this.modifiers&-3}},meta:{get:function(){return(this.modifiers&8)!==0},set:function(t){this.modifiers=t?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var t=this.event;return t===null||t.type!=="mousedown"&&t.type!=="mouseup"&&t.type!=="pointerdown"&&t.type!=="pointerup"?(this.buttons&1)!==0:this.button===0},set:function(t){this.buttons=t?this.buttons|1:this.buttons&-2}},right:{get:function(){var t=this.event;return t===null||t.type!=="mousedown"&&t.type!=="mouseup"&&t.type!=="pointerdown"&&t.type!=="pointerup"?(this.buttons&2)!==0:this.button===2},set:function(t){this.buttons=t?this.buttons|2:this.buttons&-3}},middle:{get:function(){var t=this.event;return t===null||t.type!=="mousedown"&&t.type!=="mouseup"&&t.type!=="pointerdown"&&t.type!=="pointerup"?(this.buttons&4)!==0:this.button===1},set:function(t){this.buttons=t?this.buttons|4:this.buttons&-5}}}),_s.prototype.getMultiTouchDocumentPoint=_s.prototype.Bz,_s.prototype.getMultiTouchViewPoint=_s.prototype.So,_s.className="InputEvent";function sa(){this.H=null,this.xa="",this.ar=this.Lr=null}sa.prototype.copy=function(){var t=new sa;return t.H=this.H,t.xa=this.xa,t.Lr=this.Lr,t.ar=this.ar,t},sa.prototype.toString=function(){var t="*"+this.name;return this.subject!==null&&(t+=":"+this.subject.toString()),this.parameter!==null&&(t+="("+this.parameter.toString()+")"),t},St.Object.defineProperties(sa.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},subject:{get:function(){return this.Lr},set:function(t){this.Lr=t}},parameter:{get:function(){return this.ar},set:function(t){this.ar=t}}}),sa.className="DiagramEvent";function mo(){this.Fm=us,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}mo.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},mo.prototype.copy=function(){var t=new mo;t.Fm=this.Fm,t.Qq=this.Qq,t.rf=this.rf,t.cc=this.cc,t.H=this.H,t.Qn=this.Qn;var e=this.Sn;return t.Sn=Qt(e)&&typeof e.J=="function"?e.J():e,e=this.Rn,t.Rn=Qt(e)&&typeof e.J=="function"?e.J():e,e=this.Mn,t.Mn=Qt(e)&&typeof e.J=="function"?e.J():e,e=this.Ln,t.Ln=Qt(e)&&typeof e.J=="function"?e.J():e,t},mo.prototype.qb=function(t){t.classType===mo&&(this.change=t)},mo.prototype.toString=function(){var t="";return t=this.change===Hl?t+"* ":this.change===us?t+(this.model!==null?"!m":"!d"):t+((this.model!==null?"!m":"!d")+this.change),this.propertyName&&typeof this.propertyName=="string"&&(t+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(t+=" "+this.modelChange),t+=": ",this.change===Hl?this.oldValue!==null&&(t+=" "+this.oldValue):(this.object!==null&&(t+=zr(this.object)),this.oldValue!==null&&(t+=" old: "+zr(this.oldValue)),this.oldParam!==null&&(t+=" "+this.oldParam),this.newValue!==null&&(t+=" new: "+zr(this.newValue)),this.newParam!==null&&(t+=" "+this.newParam)),t},mo.prototype.I=function(t){return t?this.oldValue:this.newValue},mo.prototype.Dz=function(t){return t?this.oldParam:this.newParam},mo.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},mo.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},mo.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},mo.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},St.Object.defineProperties(mo.prototype,{model:{get:function(){return this.cc},set:function(t){this.cc=t}},diagram:{get:function(){return this.H},set:function(t){this.H=t}},change:{get:function(){return this.Fm},set:function(t){this.Fm=t}},modelChange:{get:function(){return this.Qq},set:function(t){this.Qq=t}},propertyName:{get:function(){return this.rf},set:function(t){this.rf=t}},isTransactionFinished:{get:function(){return this.Fm===Hl&&(this.rf==="CommittedTransaction"||this.rf==="FinishedUndo"||this.rf==="FinishedRedo")}},object:{get:function(){return this.Qn},set:function(t){this.Qn=t}},oldValue:{get:function(){return this.Sn},set:function(t){this.Sn=t}},oldParam:{get:function(){return this.Rn},set:function(t){this.Rn=t}},newValue:{get:function(){return this.Mn},set:function(t){this.Mn=t}},newParam:{get:function(){return this.Ln},set:function(t){this.Ln=t}}}),mo.prototype.redo=mo.prototype.redo,mo.prototype.canRedo=mo.prototype.canRedo,mo.prototype.undo=mo.prototype.undo,mo.prototype.canUndo=mo.prototype.canUndo,mo.prototype.getParam=mo.prototype.Dz,mo.prototype.getValue=mo.prototype.I,mo.prototype.clear=mo.prototype.clear;var Hl=new he(mo,"Transaction",-1),us=new he(mo,"Property",0),qs=new he(mo,"Insert",1),aa=new he(mo,"Remove",2);mo.className="ChangedEvent",mo.Transaction=Hl,mo.Property=us,mo.Insert=qs,mo.Remove=aa;function Ga(){this.o=new ue().freeze(),this.xa="",this.j=!1}Ga.prototype.toString=function(t){var e="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(t!==void 0&&0<t){t=this.changes.count;for(var i=0;i<t;i++){var n=this.changes.M(i);n!==null&&(e+=`
|
|
|
`+n.toString())}}return e},Ga.prototype.clear=function(){var t=this.changes;t.ka();for(var e=t.count-1;0<=e;e--){var i=t.M(e);i!==null&&i.clear()}t.clear(),t.freeze()},Ga.prototype.canUndo=function(){return this.isComplete},Ga.prototype.undo=function(){if(this.canUndo())for(var t=this.changes.count-1;0<=t;t--){var e=this.changes.M(t);e!==null&&e.undo()}},Ga.prototype.canRedo=function(){return this.isComplete},Ga.prototype.redo=function(){if(this.canRedo())for(var t=this.changes.count,e=0;e<t;e++){var i=this.changes.M(e);i!==null&&i.redo()}},Ga.prototype.ak=function(){if(this.isComplete){var t=this.changes;t.ka();for(var e=new ci,i=0;i<t.count;i++){var n=t.M(i);if(n!==null&&n.change===us&&n.object){var s=e.get(n.object);s||(s=new ci,e.set(n.object,s));var a=s.get(n.propertyName);a===null?s.set(n.propertyName,-1):(0<a&&t.cd(a,null),s.set(n.propertyName,i))}}for(i=e=0;i<t.count;i++)n=t.M(i),n!==null&&(i>e&&t.cd(e,n),e++);for(;t.length>e;)t.pop();t.freeze()}},St.Object.defineProperties(Ga.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},isComplete:{get:function(){return this.j},set:function(t){this.j=t}}}),Ga.prototype.optimize=Ga.prototype.ak,Ga.prototype.redo=Ga.prototype.redo,Ga.prototype.canRedo=Ga.prototype.canRedo,Ga.prototype.undo=Ga.prototype.undo,Ga.prototype.canUndo=Ga.prototype.canUndo,Ga.prototype.clear=Ga.prototype.clear,Ga.className="Transaction";function ms(){this.Pt=new te,this.Jd=!1,this.u=new ue().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new ue().freeze(),this.hl=new ue,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}ms.prototype.toString=function(t){var e="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;e+="[";for(var i=this.nestedTransactionNames.count,n=0;n<i;n++)0<n&&(e+=" "),e+=this.nestedTransactionNames.M(n);if(e+="]",t!==void 0&&0<t)for(i=this.history.count,n=0;n<i;n++)e+=`
|
|
|
`+this.history.M(n).toString(t-1);return e},ms.prototype.clear=function(){var t=this.history;t.ka();for(var e=t.count-1;0<=e;e--){var i=t.M(e);i!==null&&i.clear()}t.clear(),this.Ce=-1,t.freeze(),this.Fe=!1,this.Np=null,this.bi=0,this.Ie.ka(),this.Ie.clear(),this.Ie.freeze(),this.hl.clear(),this.Dt=this.rq=this.Gt=this.Ft=!1},ms.prototype.copyProperties=function(t){this.isEnabled=t.isEnabled,this.maxHistoryLength=t.maxHistoryLength,this.checksTransactionLevel=t.checksTransactionLevel},L=ms.prototype,L.Xw=function(t){this.Pt.add(t)},L.Rx=function(t){this.Pt.remove(t)},L.Ea=function(t){if(t===void 0&&(t=""),t===null&&(t=""),this.isUndoingRedoing)return!1;this.tt===!0&&(this.tt=!1,this.bi++,this.isInternalTransaction||this.Ob("StartingFirstTransaction",t,this.currentTransaction),0<this.bi&&this.bi--),this.isEnabled&&(this.Ie.ka(),this.Ie.add(t),this.Ie.freeze(),this.currentTransaction===null?this.hl.add(0):this.hl.add(this.currentTransaction.changes.count)),this.bi++;var e=this.transactionLevel===1;return e&&(this.isInternalTransaction||this.Ob("StartedTransaction",t,this.currentTransaction)),e},L.eb=function(t){return t===void 0&&(t=""),pf(this,!0,t)},L.Kf=function(){return pf(this,!1,"")};function pf(t,e,i){if(t.isUndoingRedoing)return!1;t.checksTransactionLevel&&1>t.transactionLevel&&_i("Ending transaction without having started a transaction: "+i);var n=t.transactionLevel===1,s=t.currentTransaction;n&&e&&(t.isInternalTransaction||t.Ob("CommittingTransaction",i,s));var a=0;if(0<t.transactionLevel&&(t.bi--,t.isEnabled)){var l=t.Ie.count;0<l&&(i===""&&(i=t.Ie.M(0)),t.Ie.ka(),t.Ie.mb(l-1),t.Ie.freeze()),l=t.hl.count,0<l&&(a=t.hl.M(l-1),t.hl.mb(l-1))}if(n){if(e)t.rq=!1,s===null&&i!==""&&(s=t.currentTransaction),t.isEnabled&&s!==null&&(s.isComplete||(s.isComplete=!0,s.name=i),t.lx(),e=t.history,e.ka(),n=t.maxHistoryLength,0<=n&&(n===0?e.clear():e.count>=n&&(a=e.M(0),a!==null&&a.clear(),e.mb(0),t.Ce--)),n===0||e.count!==0&&e.get(e.count-1)===s||(e.add(s),t.Ce++),e.freeze()),t.isInternalTransaction||t.Ob("CommittedTransaction",i,s);else{t.Fe=!0;try{t.isEnabled&&s!==null&&(s.isComplete=!0,s.undo())}finally{t.isInternalTransaction||t.Ob("RolledBackTransaction",i,s),t.Fe=!1}s!==null&&s.clear()}return t.Np=null,t.isPendingClear&&t.clear(),t.isPendingClear=!1,t.isPendingUnmodified=!1,!0}if(t.isEnabled&&!e&&s!==null){for(t=a,i=s.changes,s=i.count-1;s>=t;s--)e=i.M(s),e!==null&&e.undo(),i.ka(),i.mb(s);i.freeze()}return!1}L.lx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var t=this.history;t.ka();for(var e=t.count-1;e>this.historyIndex;e--){var i=t.M(e);i!==null&&i.clear(),t.mb(e),this.rq=!0}t.freeze()}},ms.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var t=this.transactionToUndo;return!!(t!==null&&t.canUndo())},ms.prototype.undo=function(){if(this.canUndo()){var t=this.transactionToUndo;try{this.Fe=!0,this.Ob("StartingUndo","Undo",t),this.Ce--,t.undo()}catch(e){_i("undo error: "+e.toString())}finally{this.Ob("FinishedUndo","Undo",t),this.Fe=!1}}},ms.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var t=this.transactionToRedo;return!!(t!==null&&t.canRedo())},ms.prototype.redo=function(){if(this.canRedo()){var t=this.transactionToRedo;try{this.Fe=!0,this.Ob("StartingRedo","Redo",t),this.Ce++,t.redo()}catch(e){_i("redo error: "+e.toString())}finally{this.Ob("FinishedRedo","Redo",t),this.Fe=!1}}},ms.prototype.Ob=function(t,e,i){i===void 0&&(i=null);var n=new mo;for(n.change=Hl,n.propertyName=t,n.object=i,n.oldValue=e,t=this.models;t.next();)e=t.value,n.model=e,e.ds(n)},ms.prototype.Tu=function(t){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(t)){var e=this.currentTransaction;e===null&&(this.Np=e=new Ga);var i=t.copy();e=e.changes,e.ka(),e.add(i),e.freeze(),this.checksTransactionLevel&&0>=this.transactionLevel&&!this.tt&&(t=t.diagram,t!==null&&t.pi===!1||_i("Change not within a transaction: "+i.toString()))}},ms.prototype.skipsEvent=function(t){if(t===null||0>t.change.value)return!0;if(t=t.object,t===null)return!1;if(t.layer!==void 0){if(t=t.layer,t!==null&&t.isTemporary)return!0}else if(t.isTemporary)return!0;return!1},St.Object.defineProperties(ms.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(t){this.Jd=t}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count-1?this.history.M(this.historyIndex+1):null}},isUndoingRedoing:{get:function(){return this.Fe}},history:{get:function(){return this.u}},maxHistoryLength:{get:function(){return this.o},set:function(t){this.o=t}},historyIndex:{get:function(){return this.Ce}},currentTransaction:{get:function(){return this.Np}},transactionLevel:{get:function(){return this.bi}},isInTransaction:{get:function(){return 0<this.bi}},checksTransactionLevel:{get:function(){return this.j},set:function(t){this.j=t}},nestedTransactionNames:{get:function(){return this.Ie}},isPendingClear:{get:function(){return this.Ft},set:function(t){this.Ft=t}},isPendingUnmodified:{get:function(){return this.Gt},set:function(t){this.Gt=t}},isInternalTransaction:{get:function(){return this.Dt},set:function(t){this.Dt=t}},isJustDiscarded:{get:function(){return this.rq}}}),ms.prototype.handleChanged=ms.prototype.Tu,ms.prototype.redo=ms.prototype.redo,ms.prototype.undo=ms.prototype.undo,ms.prototype.canUndo=ms.prototype.canUndo,ms.prototype.discardHistoryAfterIndex=ms.prototype.lx,ms.prototype.rollbackTransaction=ms.prototype.Kf,ms.prototype.commitTransaction=ms.prototype.eb,ms.prototype.startTransaction=ms.prototype.Ea,ms.prototype.removeModel=ms.prototype.Rx,ms.prototype.addModel=ms.prototype.Xw,ms.prototype.clear=ms.prototype.clear,ms.className="UndoManager";function Jn(){Do(this),this.H=Mn,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new _s,this.Zr=-1}Jn.prototype.toString=function(){return this.name!==""?this.name+" Tool":Xi(this.constructor)},Jn.prototype.updateAdornments=function(){},Jn.prototype.canStart=function(){return this.isEnabled},Jn.prototype.doStart=function(){},Jn.prototype.doActivate=function(){this.isActive=!0},Jn.prototype.doDeactivate=function(){this.isActive=!1},Jn.prototype.doStop=function(){},Jn.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},Jn.prototype.stopTool=function(){var t=this.diagram;t.currentTool===this&&(t.currentTool=null,t.currentCursor="")},Jn.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},Jn.prototype.doMouseMove=function(){},Jn.prototype.doMouseUp=function(){this.stopTool()},Jn.prototype.doMouseWheel=function(){},Jn.prototype.canStartMultiTouch=function(){return!0},Jn.prototype.standardPinchZoomStart=function(){var t=this.diagram,e=t.lastInput,i=e.So(0,G.allocAt(NaN,NaN)),n=e.So(1,G.allocAt(NaN,NaN));if(i.w()&&n.w()&&(this.doCancel(),t.Ql("hasGestureZoom"))){t.Bw=t.scale;var s=n.x-i.x,a=n.y-i.y;t.Jw=Math.sqrt(s*s+a*a),e.bubbles=!1}G.free(i),G.free(n)},Jn.prototype.standardPinchZoomMove=function(){var t=this.diagram,e=t.lastInput,i=e.So(0,G.allocAt(NaN,NaN)),n=e.So(1,G.allocAt(NaN,NaN));if(i.w()&&n.w()&&(this.doCancel(),t.Ql("hasGestureZoom"))){var s=n.x-i.x,a=n.y-i.y;a=Math.sqrt(s*s+a*a)/t.Jw,s=new G((Math.min(n.x,i.x)+Math.max(n.x,i.x))/2,(Math.min(n.y,i.y)+Math.max(n.y,i.y))/2),a*=t.Bw;var l=t.commandHandler;if(a!==t.scale&&l.canResetZoom(a)){var c=t.zoomPoint;t.zoomPoint=s,l.resetZoom(a),t.zoomPoint=c}e.bubbles=!1}G.free(i),G.free(n)},Jn.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},Jn.prototype.doKeyUp=function(){},Jn.prototype.Ea=function(t){return t===void 0&&(t=this.name),this.transactionResult=null,this.diagram.Ea(t)},Jn.prototype.stopTransaction=function(){var t=this.diagram;return this.transactionResult===null?t.Kf():t.eb(this.transactionResult)},Jn.prototype.standardMouseSelect=function(){var t=this.diagram;if(t.allowSelect){var e=t.lastInput,i=t.Ol(e.documentPoint,!1);if(i!==null){if(qr?e.meta:e.control){for(t.R("ChangingSelection",t.selection),e=i;e!==null&&!e.canSelect();)e=e.containingGroup;e!==null&&(e.isSelected=!e.isSelected),t.R("ChangedSelection",t.selection)}else if(e.shift){if(!i.isSelected){for(t.R("ChangingSelection",t.selection),e=i;e!==null&&!e.canSelect();)e=e.containingGroup;e!==null&&(e.isSelected=!0),t.R("ChangedSelection",t.selection)}}else if(!i.isSelected){for(e=i;e!==null&&!e.canSelect();)e=e.containingGroup;e!==null&&t.select(e)}}else!e.left||(qr?e.meta:e.control)||e.shift||t.clearSelection()}},Jn.prototype.standardMouseClick=function(t,e){t===void 0&&(t=null),e===void 0&&(e=function(s){return!s.layer.isTemporary});var i=this.diagram,n=i.lastInput;return t=i.ic(n.documentPoint,t,e),n.targetObject=t,Ad(t,n,i),n.handled};function Ad(t,e,i){if(e.handled=!1,t===null||t.If()){var n=0;e.left?n=e.clickCount===1?1:e.clickCount===2?2:1:e.right&&e.clickCount===1&&(n=3);var s="ObjectSingleClicked";if(t!==null){switch(n){case 1:s="ObjectSingleClicked";break;case 2:s="ObjectDoubleClicked";break;case 3:s="ObjectContextClicked"}n!==0&&i.R(s,t)}else{switch(n){case 1:s="BackgroundSingleClicked";break;case 2:s="BackgroundDoubleClicked";break;case 3:s="BackgroundContextClicked"}n!==0&&i.R(s)}if(t!==null)for(;t!==null;){switch(i=null,n){case 1:i=t.click;break;case 2:i=t.doubleClick?t.doubleClick:t.click;break;case 3:i=t.contextClick}if(i!==null&&(i(e,t),e.handled))break;t=t.panel}else{switch(t=null,n){case 1:t=i.click;break;case 2:t=i.doubleClick?i.doubleClick:i.click;break;case 3:t=i.contextClick}t!==null&&t(e)}}}Jn.prototype.standardMouseOver=function(){var t=this.diagram,e=t.lastInput;if(t.animationManager.zb!==!0){var i=t.skipsUndoManager;t.skipsUndoManager=!0;var n=t.viewportBounds.ca(e.documentPoint)?t.ic(e.documentPoint,null,null):null;!e.event||e.event.type!=="pointercancel"&&e.event.type!=="pointerout"||(n=null),e.targetObject=n;var s=!1;if(n!==t.Ck){var a=t.Ck,l=a;for(t.Ck=n,this.doCurrentObjectChanged(a,n),e.handled=!1;a!==null;){var c=a.mouseLeave;if(c!==null&&(n===a||n!==null&&n.rg(a)||(c(e,a,n),s=!0,e.handled)))break;a=a.panel}for(a=l,e.handled=!1;n!==null&&(l=n.mouseEnter,!(l!==null&&(a===n||a!==null&&a.rg(n)||(l(e,n,a),s=!0,e.handled))));)n=n.panel;n=t.Ck}if(n!==null){for(a=n,l="";a!==null&&(l=a.cursor,l==="");)a=a.panel;for(t.currentCursor=l,e.handled=!1,a=n;a!==null&&(n=a.mouseOver,!(n!==null&&(n(e,a),s=!0,e.handled)));)a=a.panel}else this.doUpdateCursor(null),n=t.mouseOver,n!==null&&(n(e),s=!0);s&&t.$b(),t.skipsUndoManager=i}},Jn.prototype.doUpdateCursor=function(){var t=this.diagram;t&&(t.currentCursor="")},Jn.prototype.doCurrentObjectChanged=function(){},Jn.prototype.standardMouseWheel=function(){var t=this.diagram,e=t.lastInput,i=e.delta;if(i!==0&&t.documentBounds.w()){var n=t.commandHandler,s=t.toolManager.mouseWheelBehavior;if(n!==null&&(s===Pf&&!e.shift||s===Ah&&e.control))(0<i?n.canIncreaseZoom():n.canDecreaseZoom())&&(s=t.zoomPoint,t.zoomPoint=e.viewPoint,0<i?n.increaseZoom():n.decreaseZoom(),t.zoomPoint=s),e.bubbles=!1;else if(s===Pf&&e.shift||s===Ah&&!e.control){n=t.position.copy();var a=e.event;s=a.deltaMode;var l=a.deltaX;a=a.deltaY;var c="pixel";if(l===0&&a===0||e.shift)!e.shift&&t.allowVerticalScroll?(i=3*i*t.scrollVerticalLineChange,t.scroll(c,0<i?"up":"down",Math.abs(i))):e.shift&&t.allowHorizontalScroll&&(i=3*i*t.scrollHorizontalLineChange,t.scroll(c,0<i?"left":"right",Math.abs(i)));else{switch(s){case 0:c="pixel";break;case 1:c="line";break;case 2:c="page"}l!==0&&t.allowHorizontalScroll&&(l*=t.scrollHorizontalLineChange/16,t.scroll(c,0<l?"right":"left",Math.abs(l))),a!==0&&t.allowVerticalScroll&&(a*=t.scrollVerticalLineChange/16,t.scroll(c,0<a?"down":"up",Math.abs(a)))}this.doWheelChange(t,n,e)}}},Jn.prototype.doWheelChange=function(t,e,i){t.position.D(e)&&i.event.wheelDeltaX===0||(i.bubbles=!1)},Jn.prototype.standardWaitAfter=function(t,e){e===void 0&&(e=this.diagram.lastInput),this.cancelWaitAfter();var i=this,n=e.clone(this.yy);this.Zr=Ce(function(){i.doWaitAfter(n)},t)},Jn.prototype.cancelWaitAfter=function(){this.Zr!==-1&&Kt.clearTimeout(this.Zr),this.Zr=-1},Jn.prototype.doWaitAfter=function(){},Jn.prototype.findToolHandleAt=function(t,e){return t=this.diagram.ic(t,function(i){for(;i!==null&&!(i.panel instanceof pr);)i=i.panel;return i}),t===null?null:t.part.category===e?t:null},Jn.prototype.isBeyondDragSize=function(t,e){var i=this.diagram;t===void 0&&(t=i.firstInput.viewPoint),e===void 0&&(e=i.lastInput.viewPoint);var n=i.toolManager.dragSize,s=n.width;return n=n.height,i.firstInput.isTouchEvent&&(s+=6,n+=6),Math.abs(e.x-t.x)>s||Math.abs(e.y-t.y)>n},St.Object.defineProperties(Jn.prototype,{diagram:{get:function(){return this.H},set:function(t){t instanceof Ct&&(this.H=t)}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},isEnabled:{get:function(){return this.Jd},set:function(t){this.Jd=t}},isActive:{get:function(){return this.nb},set:function(t){this.nb=t}},transactionResult:{get:function(){return this.wm},set:function(t){this.wm=t}}}),Jn.prototype.startTransaction=Jn.prototype.Ea,Jn.className="Tool";function Rr(){Jn.call(this),this.name="ToolManager",this.hb=new ue,this.ob=new ue,this.Hb=new ue,this.F=this.V=850,this.o=new fe(2,2).ja(),this.Ha=5e3,this.ia=Ah,this.u=mf,this.Mp=this.j=null,this.zj=-1}li(Rr,Jn),Rr.prototype.initializeStandardTools=function(){},Rr.prototype.updateAdornments=function(t){var e=this.currentToolTip;if(e instanceof pr&&this.Mp===t){var i=e.adornedObject;(t!==null?i.part===t:i===null)?this.showToolTip(e,i):this.hideToolTip()}},Rr.prototype.doMouseDown=function(){var t=this.diagram,e=t.lastInput;if(e.isTouchEvent&&this.gestureBehavior===Hh&&(e.bubbles=!1),e.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Rc){e.bubbles=!0;return}if(this.gestureBehavior===Hh)return;if(t.currentTool.canStartMultiTouch()){t.currentTool.standardPinchZoomStart();return}}for(var i=this.mouseDownTools.length,n=0;n<i;n++){var s=this.mouseDownTools.M(n);if(s.diagram=this.diagram,s.canStart()){t.doFocus(),t.currentTool=s,t.currentTool===s&&(s.isActive||s.doActivate(),s.doMouseDown());return}}t.lastInput.button===1&&(this.mouseWheelBehavior===Ah?this.mouseWheelBehavior=Pf:this.mouseWheelBehavior===Pf&&(this.mouseWheelBehavior=Ah)),this.doActivate(),this.standardWaitAfter(this.holdDelay,e)},Rr.prototype.doMouseMove=function(){var t=this.diagram,e=t.lastInput;if(e.isMultiTouch){if(this.gestureBehavior===Rc){e.bubbles=!0;return}if(this.gestureBehavior===Hh)return;if(t.currentTool.canStartMultiTouch()){t.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var i=this.mouseMoveTools.length,n=0;n<i;n++){var s=this.mouseMoveTools.M(n);if(s.diagram=this.diagram,s.canStart()){t.doFocus(),t.currentTool=s,t.currentTool===s&&(s.isActive||s.doActivate(),s.doMouseMove());return}}kc(this,t),t=e.event,t===null||t.type!=="pointermove"&&t.cancelable||(e.bubbles=!0)};function kc(t,e){t.standardMouseOver(),t.isBeyondDragSize()&&t.standardWaitAfter(t.isActive?t.holdDelay:t.hoverDelay,e.lastInput)}Rr.prototype.doCurrentObjectChanged=function(t,e){t=this.currentToolTip,t===null||e!==null&&t instanceof pr&&(e===t||e.rg(t))||this.hideToolTip()},Rr.prototype.doWaitAfter=function(t){var e=this.diagram;e.ta!==null&&(this.doMouseHover(),this.isActive||this.doToolTip(),t.isTouchEvent&&!e.lastInput.handled&&(t=t.copy(),t.button=2,t.buttons=2,e.lastInput=t,e.qu=!0,e.doMouseUp()))},Rr.prototype.doMouseHover=function(){var t=this.diagram,e=t.lastInput;e.targetObject===null&&(e.targetObject=t.ic(e.documentPoint,null,null));var i=e.targetObject;if(i!==null)for(e.handled=!1;i!==null&&(t=this.isActive?i.mouseHold:i.mouseHover,!(t!==null&&(t(e,i),e.handled)));)i=i.panel;else i=this.isActive?t.mouseHold:t.mouseHover,i!==null&&i(e)},Rr.prototype.doToolTip=function(){var t=this.diagram,e=t.lastInput;if(e.targetObject===null&&(e.targetObject=t.ic(e.documentPoint,null,null)),e=e.targetObject,e!==null){if(t=this.currentToolTip,!(t instanceof pr)||e!==t&&!e.rg(t)){for(;e!==null;){if(t=e.toolTip,t!==null){this.showToolTip(t,e);return}e=e.panel}this.hideToolTip()}}else e=t.toolTip,e!==null?this.showToolTip(e,null):this.hideToolTip()},Rr.prototype.showToolTip=function(t,e){var i=this.diagram;if(t!==this.currentToolTip&&this.hideToolTip(),t instanceof pr){t.layerName="Tool",t.selectable=!1,t.scale=1/i.scale,t.category="ToolTip",t.placeholder!==null&&(t.placeholder.scale=i.scale);var n=t.diagram;n!==null&&n!==i&&n.remove(t),i.add(t),e!==null?t.adornedObject=e:t.data=i.model,t.Va(),this.positionToolTip(t,e)}else t instanceof la&&t!==this.currentToolTip&&t.show(e,i,this);if(this.currentToolTip=t,this.zj!==-1&&(Kt.clearTimeout(this.zj),this.zj=-1),t=this.toolTipDuration,0<t&&t!==1/0){var s=this;this.zj=Ce(function(){s.hideToolTip()},t)}},Rr.prototype.positionToolTip=function(t){if(t.placeholder===null){var e=this.diagram,i=e.lastInput.documentPoint.copy(),n=t.measuredBounds,s=e.viewportBounds;e.lastInput.isTouchEvent&&(i.x-=n.width),i.x+n.width>s.right&&(i.x-=n.width+5/e.scale),i.x<s.x&&(i.x=s.x),i.y=i.y+20/e.scale+n.height>s.bottom?i.y-(n.height+5/e.scale):i.y+20/e.scale,i.y<s.y&&(i.y=s.y),t.position=i}},Rr.prototype.hideToolTip=function(){this.zj!==-1&&(Kt.clearTimeout(this.zj),this.zj=-1);var t=this.diagram,e=this.currentToolTip;e!==null&&(e instanceof pr?(t.remove(e),this.Mp!==null&&this.Mp.Jf(e.category),e.data=null,e.adornedObject=null):e instanceof la&&e.hide!==null&&e.hide(t,this),this.currentToolTip=null)},Rr.prototype.doMouseUp=function(){this.cancelWaitAfter();var t=this.diagram;if(this.isActive)for(var e=this.mouseUpTools.length,i=0;i<e;i++){var n=this.mouseUpTools.M(i);if(n.diagram=this.diagram,n.canStart()){t.doFocus(),t.currentTool=n,t.currentTool===n&&(n.isActive||n.doActivate(),n.doMouseUp());return}}t.doFocus(),this.doDeactivate()},Rr.prototype.doMouseWheel=function(){this.standardMouseWheel()},Rr.prototype.doKeyDown=function(){var t=this.diagram;t.commandHandler!==null&&t.commandHandler.doKeyDown()},Rr.prototype.doKeyUp=function(){var t=this.diagram;t.commandHandler!==null&&t.commandHandler.doKeyUp()},Rr.prototype.findTool=function(t){for(var e=this.mouseDownTools.length,i=0;i<e;i++){var n=this.mouseDownTools.M(i);if(n.name===t)return n}for(e=this.mouseMoveTools.length,i=0;i<e;i++)if(n=this.mouseMoveTools.M(i),n.name===t)return n;for(e=this.mouseUpTools.length,i=0;i<e;i++)if(n=this.mouseUpTools.M(i),n.name===t)return n;return null},Rr.prototype.replaceTool=function(t,e){e!==null&&(e.diagram=this.diagram);for(var i=this.mouseDownTools.length,n=0;n<i;n++){var s=this.mouseDownTools.M(n);if(s.name===t)return e!==null?this.mouseDownTools.cd(n,e):this.mouseDownTools.mb(n),s}for(i=this.mouseMoveTools.length,n=0;n<i;n++)if(s=this.mouseMoveTools.M(n),s.name===t)return e!==null?this.mouseMoveTools.cd(n,e):this.mouseMoveTools.mb(n),s;for(i=this.mouseUpTools.length,n=0;n<i;n++)if(s=this.mouseUpTools.M(n),s.name===t)return e!==null?this.mouseUpTools.cd(n,e):this.mouseUpTools.mb(n),s;return null},Rr.prototype.gb=function(t,e,i){e!==null&&(e.name=t,e.diagram=this.diagram),this.findTool(t)?this.replaceTool(t,e):e!==null&&i.add(e)},St.Object.defineProperties(Rr.prototype,{mouseWheelBehavior:{get:function(){return this.ia},set:function(t){this.ia=t}},gestureBehavior:{get:function(){return this.u},set:function(t){this.u=t}},currentToolTip:{get:function(){return this.j},set:function(t){this.j=t,this.Mp=t!==null&&t instanceof pr?t.adornedPart:null}},mouseDownTools:{get:function(){return this.hb}},mouseMoveTools:{get:function(){return this.ob}},mouseUpTools:{get:function(){return this.Hb}},hoverDelay:{get:function(){return this.V},set:function(t){this.V=t}},holdDelay:{get:function(){return this.F},set:function(t){this.F=t}},dragSize:{get:function(){return this.o},set:function(t){this.o=t.J()}},toolTipDuration:{get:function(){return this.Ha},set:function(t){this.Ha=t}}}),Rr.prototype.replaceStandardTool=Rr.prototype.gb;var Ah=new he(Rr,"WheelScroll",0),Pf=new he(Rr,"WheelZoom",1),Yf=new he(Rr,"WheelNone",2),mf=new he(Rr,"GestureZoom",3),Hh=new he(Rr,"GestureCancel",4),Rc=new he(Rr,"GestureNone",5);Rr.className="ToolManager",Rr.WheelScroll=Ah,Rr.WheelZoom=Pf,Rr.WheelNone=Yf,Rr.GestureZoom=mf,Rr.GestureCancel=Hh,Rr.GestureNone=Rc;function as(){Jn.call(this),this.name="Dragging",this.u=this.Sw=this.ob=!0,this.o=this.Ha=this.V=this.Oe=null,this.Ym=this.Hb=!1,this.tl=new G(NaN,NaN),this.Fr=new G,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new te().freeze(),this.ia=new d,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var oc;li(as,Jn),as.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly&&!t.allowDragOut||!t.allowMove&&!t.allowCopy&&!t.allowDragOut||!t.allowSelect)return!1;var e=t.lastInput;return!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.isTouchEvent&&e.timestamp-t.firstInput.timestamp<this.Ik)?!1:this.findDraggablePart()!==null},as.prototype.findDraggablePart=function(){var t=this.diagram;if(t=t.Ol(t.firstInput.documentPoint,!1),t===null)return null;for(;t!==null&&!t.canSelect();)t=t.containingGroup;return t!==null&&(t.canMove()||t.canCopy())?t:null},as.prototype.standardMouseSelect=function(){var t=this.diagram;if(t.allowSelect){var e=t.Ol(t.firstInput.documentPoint,!1);if(e!==null){for(;e!==null&&!e.canSelect();)e=e.containingGroup;this.currentPart=e,this.currentPart===null||this.currentPart.isSelected||(t.R("ChangingSelection",t.selection),e=t.lastInput,(qr?e.meta:e.control)||e.shift||t.clearSelection(!0),this.currentPart.isSelected=!0,t.R("ChangedSelection",t.selection))}}},as.prototype.doActivate=function(){var t=this.diagram;this.Bn=null,this.currentPart===null&&this.standardMouseSelect();var e=this.currentPart;e!==null&&(e.canMove()||e.canCopy())&&(t.Fu(!0),Dn=null,this.isActive=!0,this.tl.set(t.position),Jf(this,t.selection),this.Cg.length=0,t.animationManager.Cc(),this.draggedParts=this.computeEffectiveCollection(t.selection,this.dragOptions),this.Sw=this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,t.Ns=!0,t.Gf("temporaryPixelRatio")===!0&&30<t.$w&&tn(t),Yr(t,this.draggedParts),this.Ea("Drag"),this.startPoint=t.firstInput.documentPoint,t.isMouseCaptured=!0,t.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,Dn=this,$n=this.diagram,this.doSimulatedDragOut()))};function Jf(t,e){if(t.dragsLink){var i=t.diagram;i.allowRelink&&(i.model.Wj()&&e.count===1&&e.first()instanceof ge?(t.draggedLink=e.first(),t.draggedLink.canRelinkFrom()&&t.draggedLink.canRelinkTo()&&t.draggedLink.Ej(),t.Oe=i.toolManager.findTool("Relinking"),t.Oe===null&&(t.Oe=new go,t.Oe.diagram=i),t.Oe.originalLink=t.draggedLink):(t.draggedLink=null,t.Oe=null))}}as.prototype.computeEffectiveCollection=function(t,e){return this.diagram.commandHandler.computeEffectiveCollection(t,e)},as.prototype.Pd=function(t){return t===void 0?new Eu(Wa):this.isGridSnapEnabled?new Eu(new G(Math.round(1e3*t.x)/1e3,Math.round(1e3*t.y)/1e3)):new Eu(t.copy())},as.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,t.Fu(!1),t.ug(),oh(this),Fi(t,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<oc.count){for(var e=oc,i=e.length,n=0;n<i;n++){var s=e.M(n);Ec(s),Mu(s),oh(s),s.diagram.ug()}e.clear()}Ec(this),this.tl.h(NaN,NaN),$n!==null&&($n.currentCursor=""),Dn=$n=null,Mu(this),t.isMouseCaptured=!1,t.currentCursor="",t.Ns=!1,this.stopTransaction(),so(t,!0)},as.prototype.stopTransaction=function(){var t=this.diagram,e=Jn.prototype.stopTransaction.call(this);return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.ak(),e};function oh(t){var e=t.diagram,i=e.skipsUndoManager;e.skipsUndoManager=!0,Ft(t,e.lastInput,null),e.skipsUndoManager=i,t.Cg.length=0}function dd(){var t=Dn;Mu(t),ht(t);var e=t.diagram;t.tl.w()&&(e.position=t.tl),e.ug()}as.prototype.doCancel=function(){Mu(this),ht(this);var t=this.diagram;this.tl.w()&&(t.position=this.tl),this.stopTool()},as.prototype.doKeyDown=function(){var t=this.diagram,e=t.lastInput;this.isActive&&(e.key==="Esc"?this.doCancel():e.key!==t.previousInput.key&&this.doMouseMove())},as.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function sc(t,e){if(t.copiedParts===null){var i=t.diagram;if((!e||!i.isReadOnly&&!i.isModelReadOnly)&&t.draggedParts!==null){var n=i.undoManager;for(n.isEnabled&&n.isInTransaction?n.currentTransaction!==null&&0<n.currentTransaction.changes.count&&(i.undoManager.Kf(),i.Ea("Drag")):ht(t),i.skipsUndoManager=!e,i.partManager.addsToTemporaryLayer=!e,t.startPoint=i.firstInput.documentPoint,e=t.copiesEffectiveCollection?t.draggedParts.Lf():i.selection,e=i.Kj(e,i,!0),i=new ci,n=t.draggedParts.iterator;n.next();){var s=n.key;if(s.Zc()&&s.canCopy()){var a=e.I(s);a!==null&&(a.location=s.location,a.Va(),i.add(a,t.Pd(a.location)))}}for(e=e.iterator;e.next();)n=e.value,n instanceof ge&&n.canCopy()&&i.add(n,t.Pd());t.copiedParts=i,Jf(t,i.Lf()),t.draggedLink!==null&&(i=t.draggedLink,e=i.routeBounds,xd(i,t.startPoint.x-(e.x+e.width/2),t.startPoint.y-(e.y+e.height/2))),t.doUpdateCursor(null)}}}function Mu(t){var e=t.diagram;if(t.copiedParts!==null){if(e.Is(t.copiedParts.Lf(),!1),t.copiedParts=null,t.draggedParts!==null)for(var i=t.draggedParts.iterator;i.next();)i.key instanceof ge&&(i.value.point=new G(0,0));t.doUpdateCursor(null)}e.skipsUndoManager=!1,e.partManager.addsToTemporaryLayer=!1,t.startPoint=e.firstInput.documentPoint}function Ec(t){if(t.draggedLink!==null){if(t.dragsLink&&t.Oe!==null){var e=t.Oe;e.diagram.remove(e.temporaryFromNode),e.diagram.remove(e.temporaryToNode),t.Oe.originalLink=null}t.draggedLink=null,t.Oe=null}}function Z(t,e,i){var n=t.diagram,s=t.startPoint,a=G.alloc();a.assign(n.lastInput.documentPoint),t.moveParts(e,a.re(s),i),G.free(a),n.Gf("temporaryPixelRatio")===!0&&n.Yh===null&&30<n.$w&&(tn(n),n.hk())}as.prototype.moveParts=function(t,e,i){i===void 0&&(i=!1);var n=this.diagram;n!==null&&Pr(n,t,e,this.dragOptions,i)};function ht(t){if(t.draggedParts!==null){for(var e=t.diagram,i=t.draggedParts.iterator;i.next();){var n=i.key;n.Zc()&&(n.location=i.value.point)}for(i=t.draggedParts.iterator;i.next();)if(n=i.key,n instanceof ge&&n.suspendsRouting){var s=i.value.point;t.draggedParts.add(n,t.Pd()),xd(n,-s.x,-s.y)}e.bd()}}function wt(t,e){var i=t.diagram;t.dragsLink&&(t.draggedLink!==null&&(t.draggedLink.fromNode=null,t.draggedLink.toNode=null),ke(t,!1));var n=t.findDragOverObject(e),s=i.lastInput;s.targetObject=n,t.doUpdateCursor(n);var a=i.skipsUndoManager,l=!1;try{if(i.skipsUndoManager=!0,l=Ft(t,s,n),!t.isActive&&Dn===null)return;var c=n!==null?n.part:null;if(c===null||i.handlesDragDropForTopLevelParts&&c.isTopLevel&&!(c instanceof Yi)){var p=i.mouseDragOver;p!==null&&(p(s),l=!0)}if(!t.isActive&&Dn===null||(t.doDragOver(e,n),!t.isActive&&Dn===null))return}finally{i.skipsUndoManager=a,l&&i.bd()}t.Bn=n,i.isReadOnly||!i.allowMove&&!i.allowCopy||!i.allowHorizontalScroll&&!i.allowVerticalScroll||i.gs(s.viewPoint)}as.prototype.findDragOverObject=function(t){var e=this;return Rn(this.diagram,t,null,function(i){return i===null?i=!0:(i=i.part,i=!!(i===null||i instanceof pr||i.layer.isTemporary||e.draggedParts&&e.draggedParts.contains(i)||e.copiedParts&&e.copiedParts.contains(i))),!i})},as.prototype.doUpdateCursor=function(t){var e=this.diagram;(t===null||this.Bn!==t)&&(!this.diagram.currentTool.isActive||this.mayCopy()?e.currentCursor=this.copyCursor:this.mayMove()?e.currentCursor=this.moveCursor:this.mayDragOut()&&(e.currentCursor=this.nodropCursor))};function Ft(t,e,i){var n=!1,s=t.Cg.length,a=0<s?t.Cg[0]:null;if(i===a)return!1;e.handled=!1;for(var l=0;l<s;l++){var c=t.Cg[l],p=c.mouseDragLeave;if(p!==null&&(p(e,c,i),n=!0,e.handled))break}if(t.Cg.length=0,!t.isActive&&Dn===null||i===null)return n;for(e.handled=!1,s=i;s!==null;)t.Cg.push(s),s=Ut(s);for(s=t.Cg.length,i=0;i<s&&(l=t.Cg[i],c=l.mouseDragEnter,c===null||(c(e,l,a),n=!0,!e.handled));i++);return n}function Ut(t){var e=t.panel;return e!==null?e:t instanceof bi&&!(t instanceof Yi)&&(t=t.containingGroup,t!==null&&t.handlesDragDropForMembers)?t:null}function Ie(t,e,i){var n=t.Oe;if(n===null)return null;var s=t.diagram.og(e,n.portGravity,function(m){return n.findValidLinkablePort(m,i)});t=G.alloc();var a=1/0,l=null;for(s=s.iterator;s.next();){var c=s.value;if(c.part!==null){var p=c.ga(_n,t);p=e.Bf(p),p<a&&(l=c,a=p)}}return G.free(t),l}function ke(t,e){var i=t.draggedLink;if(i!==null&&!(2>i.pointsCount)){var n=t.diagram;if(!n.isReadOnly){var s=t.Oe;if(s!==null){var a=null,l=null;i.fromNode===null&&(a=Ie(t,i.i(0),!1),a!==null&&(l=a.part));var c=null,p=null;i.toNode===null&&(c=Ie(t,i.i(i.pointsCount-1),!0),c!==null&&(p=c.part)),s.isValidLink(l,a,p,c)?e?(i.defaultFromPoint=i.i(0),i.defaultToPoint=i.i(i.pointsCount-1),i.suspendsRouting=!1,i.fromNode=l,a!==null&&(i.fromPortId=a.portId),i.toNode=p,c!==null&&(i.toPortId=c.portId),i.fromPort!==n.Mx&&n.R("LinkRelinked",i,n.Mx),i.toPort!==n.Nx&&n.R("LinkRelinked",i,n.Nx)):Ko(s,l,a,p,c):Ko(s,null,null,null,null)}}}}as.prototype.doDragOver=function(){};function Ri(t,e){var i=t.diagram;t.dragsLink&&ke(t,!0),oh(t);var n=t.findDragOverObject(e),s=i.lastInput;if(s.targetObject=n,n!==null){s.handled=!1;for(var a=n;a!==null;){var l=a.mouseDrop;if(l!==null&&(l(s,a),s.handled))break;qi(t,s,a),a=Ut(a)}}else a=i.mouseDrop,a!==null&&a(s);if(t.isActive||Dn!==null){for(s=(t.copiedParts||t.draggedParts).iterator;s.next();)a=s.key,a instanceof Ee&&a.linksConnected.each(function(c){c.suspendsRouting=!1});if(t.doDropOnto(e,n),t.isActive||Dn!==null){for(t=Tt.alloc(),e=i.selection.iterator;e.next();)n=e.value,n instanceof Ee&&fn(i,n,t);Tt.free(t)}}}function qi(t,e,i){t=t.diagram,i=i.part,!t.handlesDragDropForTopLevelParts||!i.isTopLevel||i instanceof Yi||(i=t.mouseDrop,i!==null&&i(e))}function fn(t,e,i){var n=!1;if(i=e.getAvoidableRect(i),t.viewportBounds.Re(i)&&(n=!0),t=t.Nu(i,function(s){return s.part},function(s){return s instanceof ge},!0,function(s){return s instanceof ge},n),t.count!==0)for(t=t.iterator;t.next();)i=t.value,!i.Td(e)&&i.isAvoiding&&i.bb()}as.prototype.doDropOnto=function(){},as.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram,e=t.lastInput;this.simulatedMouseMove(e.event,e.documentPoint,e.targetDiagram)||this.currentPart===null||this.draggedParts===null||(this.mayCopy()?(sc(this,!1),Yr(t,this.copiedParts),Z(this,this.copiedParts,!1),Fi(t,this.copiedParts)):this.mayMove()?(Mu(this),Z(this,this.draggedParts,!0)):this.mayDragOut()?(sc(this,!1),Z(this,this.copiedParts,!1)):Mu(this),wt(this,t.lastInput.documentPoint))}},as.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram,e=t.lastInput;if(!this.simulatedMouseUp(e.event,e.documentPoint,e.targetDiagram)){e=!1;var i=this.mayCopy();if(i&&this.copiedParts!==null?(Mu(this),sc(this,!0),Yr(t,this.copiedParts),Z(this,this.copiedParts,!1),Fi(t,this.copiedParts),this.copiedParts!==null&&(t.R("ChangingSelection",t.selection),t.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(s){s.isSelected=!0}))):(e=!0,Mu(this),this.mayMove()&&(Z(this,this.draggedParts,!0),wt(this,t.lastInput.documentPoint))),this.Ym=!0,Ri(this,t.lastInput.documentPoint),this.isActive){var n=i?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,e&&Ar(this),t.Ya(),Fi(t,this.draggedParts),this.transactionResult=i?"Copy":"Move",t.R(i?"SelectionCopied":"SelectionMoved",n)}this.stopTool(),i&&t.R("ChangedSelection",t.selection)}}},as.prototype.simulatedMouseMove=function(t,e,i){if(Dn===null)return!1;var n=Dn.diagram;i instanceof Ct||(i=null);var s=$n;return i!==s&&(s!==null&&s!==n&&(s.ug(),Dn.isDragOutStarted=!1,s=s.toolManager.findTool("Dragging"),s!==null&&s.doSimulatedDragLeave()),$n=i,i!==null&&i!==n&&(dd(),s=i.toolManager.findTool("Dragging"),s!==null&&(oc.contains(s)||oc.add(s),s.doSimulatedDragEnter())),this.doUpdateCursor(null)),i===null||i===n||!i.allowDrop||i.isReadOnly||!i.allowInsert?!1:(n=i.toolManager.findTool("Dragging"),n!==null&&(t!==null&&(t.targetTouches!==void 0&&(0<t.targetTouches.length?t=t.targetTouches[0]:0<t.changedTouches.length&&(t=t.changedTouches[0])),e=i.getMouse(t)),i.lastInput.documentPoint=e,i.lastInput.viewPoint=i.op(e),i.lastInput.down=!1,i.lastInput.up=!1,n.doSimulatedDragOver()),!0)},as.prototype.simulatedMouseUp=function(t,e,i){if(Dn===null)return!1;var n=$n,s=Dn.diagram;if(i===null)return Dn.doCancel(),!0;if(i!==n){var a=n.toolManager.findTool("Dragging");if(n!==null&&n!==s&&a!==null)return n.ug(),Dn.isDragOutStarted=!1,a.doSimulatedDragLeave(),!1;$n=i,n=i.toolManager.findTool("Dragging"),n!==null&&(dd(),oc.contains(n)||oc.add(n),n.doSimulatedDragEnter())}return i!==this.diagram?(t!==null?(t.targetTouches!==void 0&&(0<t.targetTouches.length?t=t.targetTouches[0]:0<t.changedTouches.length&&(t=t.changedTouches[0])),e=i.getMouse(t)):e===null&&(e=new G),i.lastInput.documentPoint=e,i.lastInput.viewPoint=i.op(e),i.lastInput.down=!1,i.lastInput.up=!0,t=i.toolManager.findTool("Dragging"),t!==null&&t.doSimulatedDrop(),t=Dn,t!==null&&(i=t.mayCopy(),t.transactionResult=i?"Copy":"Move",t.stopTool()),!0):!1};function Ar(t){if(t.draggedParts!==null)for(var e=t.draggedParts.iterator;e.next();){var i=e.key;i instanceof Ee&&(i=i.containingGroup,i===null||i.placeholder===null||t.draggedParts.contains(i)||i.placeholder.v())}}as.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowCopy||(qr?!t.lastInput.alt:!t.lastInput.control))return!1;for(t=t.selection.iterator;t.next();)if(t.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},as.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var t=this.diagram;if(!t.allowDragOut||!t.allowCopy||t.allowMove)return!1;for(t=t.selection.iterator;t.next();)if(t.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},as.prototype.mayMove=function(){var t=this.diagram;if(t.isReadOnly||!t.allowMove)return!1;for(t=t.selection.iterator;t.next();)if(t.value.canMove())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canMove())},as.prototype.computeBorder=function(t,e,i){return this.Ym||this.draggedParts===null||this.draggedParts.contains(t)?null:i.assign(e)},as.prototype.Az=function(){return Dn},as.prototype.mayDragIn=function(){var t=this.diagram;if(!t.allowDrop||t.isReadOnly||t.isModelReadOnly||!t.allowInsert)return!1;var e=Dn;return!(e===null||e.diagram.model.dataFormat!==t.model.dataFormat)},as.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var t=this.diagram;t.animationManager.Cc(),Rs(t),t.animationManager.Cc(),t=Dn,t!==null&&(t.diagram.Ns=!1),this.doUpdateCursor(null)}},as.prototype.doSimulatedDragLeave=function(){var t=Dn;t!==null&&t.doSimulatedDragOut(),this.doCancel()},as.prototype.doSimulatedDragOver=function(){var t=this.diagram;t.animationManager.Dm=!0;var e=Dn;if(e!==null&&e.draggedParts!==null){if(!this.mayDragIn())return;qn(this,e.draggedParts.Lf(),!1,t.firstInput),Z(this,this.copiedParts,!1),wt(this,t.lastInput.documentPoint)}t.animationManager.Dm=!1},as.prototype.doSimulatedDrop=function(){var t=this.diagram,e=Dn;if(e!==null){var i=e.diagram;if(e.Ym=!0,Mu(this),!this.mayDragIn())return;t.animationManager.Dm=!0,t.R("ChangingSelection",t.selection),this.Ea("Drop"),qn(this,e.draggedParts.Lf(),!0,t.lastInput),Z(this,this.copiedParts,!1);var n=new te;this.copiedParts!==null&&(t.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(s){s.isSelected=!0,n.add(s)})),Ri(this,t.lastInput.documentPoint),t.Ya(),this.copiedParts!==null&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,t.doFocus(),t.R("ExternalObjectsDropped",n,i),this.stopTransaction(),t.R("ChangedSelection",t.selection)}t.animationManager.Dm=!1};function qn(t,e,i,n){if(t.copiedParts===null){var s=t.diagram;if(!s.isReadOnly&&!s.isModelReadOnly){s.skipsUndoManager=!i,s.partManager.addsToTemporaryLayer=!i,t.startPoint=n.documentPoint,i=s.Kj(e,s,!0);var a=Tt.alloc();s=n=1/0;for(var l=-1/0,c=-1/0,p=e.iterator;p.next();){var m=p.value;if(m.isVisible()){var v=m.location;m=v.x,v=v.y,isNaN(m)||isNaN(v)||(m<n&&(n=m),v<s&&(s=v),m>l&&(l=m),v>c&&(c=v))}}for(n===1/0?a.h(0,0,0,0):a.h(n,s,l-n,c-s),n=a.x+a.width/2,s=a.y+a.height/2,Tt.free(a),a=t.Fr,l=new ci,c=G.alloc(),p=e.iterator;p.next();)m=p.value,m instanceof ge&&m.canCopy()&&(v=i.I(m),v!==null&&(v.points=m.points,xd(v,a.x-n,a.y-s),v.suspendsRouting=!0,l.add(v,t.Pd())));for(e=e.iterator;e.next();)m=e.value,m.Zc()&&m.canCopy()&&(p=i.I(m),p!==null&&(m=m.location,c.h(a.x-(n-m.x),a.y-(s-m.y)),p.location=c,p.Va(),l.add(p,t.Pd(c))));G.free(c),t.copiedParts=l,Jf(t,l.Lf()),t.draggedLink!==null&&(i=t.draggedLink,e=i.routeBounds,xd(i,t.startPoint.x-(e.x+e.width/2),t.startPoint.y-(e.y+e.height/2))),t.doUpdateCursor(null)}}}as.prototype.doSimulatedDragOut=function(){var t=this.diagram;t.Ns=!1,this.mayCopy()||this.mayMove()?t.currentCursor="":t.currentCursor=this.nodropCursor,this.Bn=null},as.prototype.computeMove=function(t,e,i,n){return i=this.diagram,i!==null?i.computeMove(t,e,this.dragOptions,n):new G},St.Object.defineProperties(as.prototype,{isCopyEnabled:{get:function(){return this.ob},set:function(t){this.ob=t}},copiesEffectiveCollection:{get:function(){return this.u},set:function(t){this.u=t}},dragOptions:{get:function(){return this.ia},set:function(t){this.ia=t}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(t){this.dragOptions.isGridSnapEnabled=t}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(t){this.hb=t}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(t){this.dragOptions.isGridSnapRealtime=t}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(t){this.dragOptions.gridSnapCellSize.D(t)||(t=t.J(),this.dragOptions.gridSnapCellSize=t)}},gridSnapCellSpot:{get:function(){return this.dragOptions.gridSnapCellSpot},set:function(t){this.dragOptions.gridSnapCellSpot.D(t)||(t=t.J(),this.dragOptions.gridSnapCellSpot=t)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(t){this.dragOptions.gridSnapOrigin.D(t)||(t=t.J(),this.dragOptions.gridSnapOrigin=t)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(t){this.dragOptions.dragsLink=t}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(t){this.dragOptions.dragsTree=t}},copyCursor:{get:function(){return this.F},set:function(t){this.F=t}},moveCursor:{get:function(){return this.Oc},set:function(t){this.Oc=t}},nodropCursor:{get:function(){return this.Pc},set:function(t){this.Pc=t}},currentPart:{get:function(){return this.V},set:function(t){this.V=t}},copiedParts:{get:function(){return this.o},set:function(t){this.o=t}},draggedParts:{get:function(){return this.Ha},set:function(t){this.Ha=t}},draggingParts:{get:function(){return this.copiedParts!==null?this.copiedParts.Lf():this.draggedParts!==null?this.draggedParts.Lf():this.te}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(t){this.diagram.draggedLink=t}},isDragOutStarted:{get:function(){return this.Hb},set:function(t){this.Hb=t}},startPoint:{get:function(){return this.Fr},set:function(t){this.Fr.D(t)||this.Fr.assign(t)}},delay:{get:function(){return this.Ik},set:function(t){this.Ik=t}}}),as.prototype.getDraggingSource=as.prototype.Az;var Dn=null,$n=null;as.className="DraggingTool",oc=new ue,Tn("draggingTool",function(){return this.findTool("Dragging")},function(t){this.gb("Dragging",t,this.mouseMoveTools)}),Rr.prototype.doCancel=function(){Dn!==null&&Dn.doCancel(),Jn.prototype.doCancel.call(this)};function Di(){Jn.call(this),this.te=100,this.Ha=!1,this.u="pointer";var t=new ge,e=new pn;e.isPanelMain=!0,e.stroke="blue",t.add(e),e=new pn,e.toArrow="Standard",e.fill="blue",e.stroke="blue",t.add(e),t.layerName="Tool",this.Ci=t,t=new Ee,e=new pn,e.portId="",e.figure="Rectangle",e.fill=null,e.stroke="magenta",e.strokeWidth=2,e.desiredSize=An,t.add(e),t.selectable=!1,t.layerName="Tool",this.Bi=t,this.j=e,t=new Ee,e=new pn,e.portId="",e.figure="Rectangle",e.fill=null,e.stroke="magenta",e.strokeWidth=2,e.desiredSize=An,t.add(e),t.selectable=!1,t.layerName="Tool",this.Di=t,this.o=e,this.Pc=this.Oc=this.ob=this.hb=this.Hb=null,this.ia=!0,this.hy=new ci,this.Of=this.gj=this.Pf=null}li(Di,Jn),Di.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},Di.prototype.copyPortProperties=function(t,e,i,n,s){if(t!==null&&e!==null&&i!==null&&n!==null){var a=e.Df(),l=fe.alloc();l.width=e.naturalBounds.width*a,l.height=e.naturalBounds.height*a,n.desiredSize=l,fe.free(l),s?(n.toSpot=e.toSpot,n.toEndSegmentLength=e.toEndSegmentLength):(n.fromSpot=e.fromSpot,n.fromEndSegmentLength=e.fromEndSegmentLength),i.locationSpot=_n,a=G.alloc(),i.location=e.ga(_n,a),G.free(a),n.angle=e.li(),this.portTargeted!==null&&this.portTargeted(t,e,i,n,s)}},Di.prototype.setNoTargetPortProperties=function(t,e,i){e!==null&&(e.desiredSize=An,e.fromSpot=jr,e.toSpot=jr),t!==null&&(t.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,t,e,i)},Di.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},Di.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof Ee){var e=this.targetPort.part;this.isForwards?this.copyPortProperties(e,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(e,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(t.allowHorizontalScroll||t.allowVerticalScroll)&&t.gs(t.lastInput.viewPoint)}},Di.prototype.findValidLinkablePort=function(t,e){if(t===null)return null;var i=t.part;if(!(i instanceof Ee))return null;for(;t!==null;){var n=e?t.toLinkable:t.fromLinkable;if(n===!0&&(t.portId!==null||t instanceof Ee)&&(e?this.isValidTo(i,t):this.isValidFrom(i,t)))return t;if(n===!1)break;t=t.panel}return null},Di.prototype.findTargetPort=function(t){var e=this.diagram,i=e.lastInput.documentPoint,n=this.portGravity;0>=n&&(n=.1);var s=this,a=e.og(i,n,function(w){return s.findValidLinkablePort(w,t)},null,!0);for(n=1/0,e=null,a=a.iterator;a.next();){var l=a.value,c=l.part;if(c instanceof Ee){var p=l.ga(_n,G.alloc()),m=i.x-p.x,v=i.y-p.y;G.free(p),p=m*m+v*v,p<n&&(m=this.validPortsCache.I(l),m!==null?m&&(e=l,n=p):t&&this.isValidLink(this.originalFromNode,this.originalFromPort,c,l)||!t&&this.isValidLink(c,l,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(l,!0),e=l,n=p):this.validPortsCache.add(l,!1))}}return e!==null&&(i=e.part,i instanceof Ee&&(i.layer===null||i.layer.allowLink))?e:null},Di.prototype.isValidFrom=function(t,e){if(t===null||e===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(t.layer!==null&&!t.layer.allowLink||e.fromLinkable!==!0))return!1;var i=e.fromMaxLinks;if(1/0>i){if(this.originalLink!==null&&t===this.originalFromNode&&e===this.originalFromPort)return!0;if(e=e.portId,e===null&&(e=""),t.Mo(e).count>=i)return!1}return!0},Di.prototype.isValidTo=function(t,e){if(t===null||e===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(t.layer!==null&&!t.layer.allowLink||e.toLinkable!==!0))return!1;var i=e.toMaxLinks;if(1/0>i){if(this.originalLink!==null&&t===this.originalToNode&&e===this.originalToPort)return!0;if(e=e.portId,e===null&&(e=""),t.Sd(e).count>=i)return!1}return!0},Di.prototype.isInSameNode=function(t,e){return t===null||e===null?!1:t===e?!0:(t=t.part,e=e.part,t!==null&&t===e)},Di.prototype.isLinked=function(t,e){if(t===null||e===null)return!1;var i=t.part;if(!(i instanceof Ee))return!1;t=t.portId,t===null&&(t="");var n=e.part;if(!(n instanceof Ee))return!1;for(e=e.portId,e===null&&(e=""),e=n.Sd(e);e.next();)if(n=e.value,n.fromNode===i&&n.fromPortId===t)return!0;return!1},Di.prototype.isValidLink=function(t,e,i,n){if(!this.isValidFrom(t,e)||!this.isValidTo(i,n)||!(e===null||n===null||(e.fromLinkableSelfNode&&n.toLinkableSelfNode||!this.isInSameNode(e,n))&&(e.fromLinkableDuplicates&&n.toLinkableDuplicates||!this.isLinked(e,n)))||this.originalLink!==null&&(t!==null&&this.isLabelDependentOnLink(t,this.originalLink)||i!==null&&this.isLabelDependentOnLink(i,this.originalLink))||t!==null&&i!==null&&(t.data===null&&i.data!==null||t.data!==null&&i.data===null)||!this.isValidCycle(t,i,this.originalLink))return!1;if(t!==null){var s=t.linkValidation;if(s!==null&&!s(t,e,i,n,this.originalLink))return!1}return i!==null&&(s=i.linkValidation,s!==null&&!s(t,e,i,n,this.originalLink))?!1:(s=this.linkValidation,s!==null?s(t,e,i,n,this.originalLink):!0)},Di.prototype.isLabelDependentOnLink=function(t,e){if(t===null)return!1;var i=t.labeledLink;if(i===null)return!1;if(i===e)return!0;var n=new te;return n.add(t),Wn(this,i,e,n)};function Wn(t,e,i,n){if(e===i)return!0;var s=e.fromNode;return s!==null&&s.isLinkLabel&&(n.add(s),Wn(t,s.labeledLink,i,n))?!0:(e=e.toNode,!!(e!==null&&e.isLinkLabel&&(n.add(e),Wn(t,e.labeledLink,i,n))))}Di.prototype.isValidCycle=function(t,e,i){if(i===void 0&&(i=null),t===null||e===null)return this.isUnconnectedLinkValid;var n=this.diagram.validCycle;if(n!==Uo){if(n===Cl){if(n=i||this.temporaryLink,n!==null&&!n.isTreeLink)return!0;for(n=e.linksConnected;n.next();){var s=n.value;if(s!==i&&s.isTreeLink&&s.toNode===e)return!1}return!Ln(this,t,e,i,!0)}if(n===Ou){if(n=i||this.temporaryLink,n!==null&&!n.isTreeLink)return!0;for(n=t.linksConnected;n.next();)if(s=n.value,s!==i&&s.isTreeLink&&s.fromNode===t)return!1;return!Ln(this,t,e,i,!0)}if(n===ns)return t===e?t=!0:(n=new te,n.add(e),t=cr(this,n,t,e,i)),!t;if(n===Zl)return!Ln(this,t,e,i,!1);if(n===Gl)return t===e?t=!0:(n=new te,n.add(e),t=wr(this,n,t,e,i)),!t}return!0};function Ln(t,e,i,n,s){if(e===i)return!0;if(e===null||i===null)return!1;for(var a=e.linksConnected;a.next();){var l=a.value;if(l!==n&&(!s||l.isTreeLink)&&l.toNode===e&&(l=l.fromNode,l!==e&&Ln(t,l,i,n,s)))return!0}return!1}function cr(t,e,i,n,s){if(i===n)return!0;if(i===null||n===null||e.contains(i))return!1;e.add(i);for(var a=i.linksConnected;a.next();){var l=a.value;if(l!==s&&l.toNode===i&&(l=l.fromNode,l!==i&&cr(t,e,l,n,s)))return!0}return!1}function wr(t,e,i,n,s){if(i===n)return!0;if(i===null||n===null||e.contains(i))return!1;e.add(i);for(var a=i.linksConnected;a.next();){var l=a.value;if(l!==s){var c=l.fromNode;if(l=l.toNode,c=c===i?l:c,c!==i&&wr(t,e,c,n,s))return!0}}return!1}St.Object.defineProperties(Di.prototype,{portGravity:{get:function(){return this.te},set:function(t){0<=t&&(this.te=t)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(t){this.Ha=t}},linkingCursor:{get:function(){return this.u},set:function(t){this.u=t}},temporaryLink:{get:function(){return this.Ci},set:function(t){this.Ci=t}},temporaryFromNode:{get:function(){return this.Bi},set:function(t){(this.Bi=t)&&(this.j=t.port)}},temporaryFromPort:{get:function(){return this.j},set:function(t){if(this.j!==null){var e=this.j.panel;if(e!==null){var i=e.O.indexOf(this.j);e.mb(i),e.Gb(i,t)}}this.j=t}},temporaryToNode:{get:function(){return this.Di},set:function(t){(this.Di=t)&&(this.o=t.port)}},temporaryToPort:{get:function(){return this.o},set:function(t){if(this.o!==null){var e=this.o.panel;if(e!==null){var i=e.O.indexOf(this.o);e.mb(i),e.Gb(i,t)}}this.o=t}},originalLink:{get:function(){return this.Hb},set:function(t){this.Hb=t}},originalFromNode:{get:function(){return this.hb},set:function(t){this.hb=t}},originalFromPort:{get:function(){return this.ob},set:function(t){this.ob=t}},originalToNode:{get:function(){return this.Oc},set:function(t){this.Oc=t}},originalToPort:{get:function(){return this.Pc},set:function(t){this.Pc=t}},isForwards:{get:function(){return this.ia},set:function(t){this.ia=t}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(t){this.Pf=t}},linkValidation:{get:function(){return this.gj},set:function(t){this.gj=t}},portTargeted:{get:function(){return this.Of},set:function(t){this.Of=t}}}),Di.className="LinkingBaseTool";function xn(){Di.call(this),this.name="Linking",this.V={},this.F=null,this.K=Qi,this.Xd=null}li(xn,Di),xn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return t.isReadOnly||t.isModelReadOnly||!t.allowLink||!t.model.xs()||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize()?!1:this.findLinkablePort()!==null},xn.prototype.findLinkablePort=function(){var t=this.diagram,e=this.startObject;if(e===null&&(e=t.ic(t.firstInput.documentPoint,null,null)),e===null||(t=e.part,!(t instanceof Ee)))return null;var i=this.direction;if(i===Qi||i===So){var n=this.findValidLinkablePort(e,!1);if(n!==null||this.startObject===t&&(n=t.port,this.findValidLinkablePort(n,!1)))return this.isForwards=!0,n}return(i===Qi||i===jo)&&(e=this.findValidLinkablePort(e,!0),e!==null||this.startObject===t&&(e=t.port,this.findValidLinkablePort(e,!0)))?(this.isForwards=!1,e):null},xn.prototype.doActivate=function(){var t=this.diagram,e=this.findLinkablePort();e===null?this.stopTool():(this.Ea(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.isForwards?(this.temporaryToNode!==null&&(this.temporaryToNode.location=t.lastInput.documentPoint),this.originalFromPort=e,e=this.originalFromPort.part,e instanceof Ee&&(this.originalFromNode=e),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(this.temporaryFromNode!==null&&(this.temporaryFromNode.location=t.lastInput.documentPoint),this.originalToPort=e,e=this.originalToPort.part,e instanceof Ee&&(this.originalToNode=e),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),t.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),t.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),t.add(this.temporaryLink)),this.isActive=!0)},xn.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()},xn.prototype.doStop=function(){Di.prototype.doStop.call(this),this.startObject=null},xn.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram,e=this.transactionResult=null,i=null,n=null,s=null,a=null;try{var l=this.targetPort=this.findTargetPort(this.isForwards);if(l!==null){var c=l.part;c instanceof Ee&&(this.isForwards?(this.originalFromNode!==null&&(e=this.originalFromNode,i=this.originalFromPort),n=c,s=l):(e=c,i=l,this.originalToNode!==null&&(n=this.originalToNode,s=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(e=this.originalFromNode,i=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(n=this.originalToNode,s=this.originalToPort);e!==null||n!==null?(a=this.insertLink(e,i,n,s),a!==null?(l===null&&(this.isForwards?a.defaultToPoint=t.lastInput.documentPoint:a.defaultFromPoint=t.lastInput.documentPoint),t.allowSelect&&(t.R("ChangingSelection",t.selection),t.clearSelection(!0),a.isSelected=!0),this.transactionResult=this.name,t.R("LinkDrawn",a)):this.doNoLink(e,i,n,s)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),a&&t.allowSelect&&t.R("ChangedSelection",t.selection)}}},xn.prototype.isNewTreeLink=function(){var t=this.archetypeLinkData;if(t===null)return!0;if(t instanceof ge)return t.isTreeLink;var e=this.diagram;return e===null?!0:(t=e.partManager.getLinkCategoryForData(t),e=e.partManager.findLinkTemplateForCategory(t),e!==null?e.isTreeLink:!0)},xn.prototype.insertLink=function(t,e,i,n){return this.diagram.partManager.insertLink(t,e,i,n)},xn.prototype.doNoLink=function(){},St.Object.defineProperties(xn.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(t){this.V=t}},archetypeLabelNodeData:{get:function(){return this.F},set:function(t){this.F=t}},direction:{get:function(){return this.K},set:function(t){this.K=t}},startObject:{get:function(){return this.Xd},set:function(t){this.Xd=t}}});var Qi=new he(xn,"Either",0),So=new he(xn,"ForwardsOnly",0),jo=new he(xn,"BackwardsOnly",0);xn.className="LinkingTool",xn.Either=Qi,xn.ForwardsOnly=So,xn.BackwardsOnly=jo;function go(){Di.call(this),this.name="Relinking";var t=new pn;t.figure="Diamond",t.desiredSize=Ur,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=0,this.V=t,t=new pn,t.figure="Diamond",t.desiredSize=Ur,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=-1,this.Xd=t,this.F=null,this.Ew=new Tt}li(go,Di),go.prototype.updateAdornments=function(t){if(t!==null&&t instanceof ge){var e="RelinkFrom",i=null;if(t.isSelected&&!this.diagram.isReadOnly){var n=t.selectionObject;n!==null&&t.canRelinkFrom()&&t.actualBounds.w()&&t.isVisible()&&n.actualBounds.w()&&n.Ed()&&(i=t.Pj(e),i===null&&(i=this.makeAdornment(n,!1),t.bh(e,i)))}i===null&&t.Jf(e),e="RelinkTo",i=null,t.isSelected&&!this.diagram.isReadOnly&&(n=t.selectionObject,n!==null&&t.canRelinkTo()&&t.actualBounds.w()&&t.isVisible()&&n.actualBounds.w()&&n.Ed()&&(i=t.Pj(e),i===null?(i=this.makeAdornment(n,!0),t.bh(e,i)):i.v())),i===null&&t.Jf(e)}},go.prototype.makeAdornment=function(t,e){var i=new pr;return i.type=ce.Link,e=e?this.toHandleArchetype:this.fromHandleArchetype,e!==null&&i.add(e.copy()),i.adornedObject=t,i},go.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowRelink||!t.model.xs()||!t.lastInput.left)return!1;var e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom");return e===null&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo")),e!==null},go.prototype.doActivate=function(){var t=this.diagram;if(this.originalLink===null){var e=this.handle;if(e===null&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom"),e===null&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo"))),e===null)return;var i=e.part;if(!(i instanceof pr&&i.adornedPart instanceof ge))return;this.handle=e,this.isForwards=i===null||i.category==="RelinkTo",this.originalLink=i.adornedPart}this.Ea(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this.Ew.set(this.originalLink.actualBounds),this.originalLink!==null&&0<this.originalLink.pointsCount&&(this.originalLink.fromNode===null&&(this.temporaryFromPort!==null&&(this.temporaryFromPort.desiredSize=un),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=un),this.temporaryToNode!==null&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),t.add(this.temporaryFromNode),t.add(this.temporaryToNode),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.bb(),t.add(this.temporaryLink)),this.isActive=!0},go.prototype.copyLinkProperties=function(t,e){if(t!==null&&e!==null){e.adjusting=t.adjusting,e.corner=t.corner;var i=t.curve;(i===el||i===Fh)&&(i=eh),e.curve=i,e.curviness=t.curviness,e.isTreeLink=t.isTreeLink,e.points=t.points,e.routing=t.routing,e.smoothness=t.smoothness,e.fromSpot=t.fromSpot,e.fromEndSegmentLength=t.fromEndSegmentLength,e.fromShortLength=t.fromShortLength,e.toSpot=t.toSpot,e.toEndSegmentLength=t.toEndSegmentLength,e.toShortLength=t.toShortLength}},go.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()},go.prototype.doStop=function(){Di.prototype.doStop.call(this),this.handle=null},go.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram;this.transactionResult=null;var e=this.originalFromNode,i=this.originalFromPort,n=this.originalToNode,s=this.originalToPort,a=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){var l=this.targetPort.part;l instanceof Ee&&(this.isForwards?(n=l,s=this.targetPort):(e=l,i=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?s=n=null:i=e=null:a=null;a!==null?(this.reconnectLink(a,this.isForwards?n:e,this.isForwards?s:i,this.isForwards),this.targetPort===null&&(this.isForwards?a.defaultToPoint=t.lastInput.documentPoint:a.defaultFromPoint=t.lastInput.documentPoint,a.bb()),this.transactionResult=this.name,t.R("LinkRelinked",a,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards),this.originalLink.Xo(this.Ew)}finally{this.stopTool()}}},go.prototype.reconnectLink=function(t,e,i,n){return i=i!==null&&i.portId!==null?i.portId:"",n?(t.toNode=e,t.toPortId=i):(t.fromNode=e,t.fromPortId=i),!0},go.prototype.doNoRelink=function(){};function Ko(t,e,i,n,s){e!==null?(t.copyPortProperties(e,i,t.temporaryFromNode,t.temporaryFromPort,!1),t.diagram.add(t.temporaryFromNode)):t.diagram.remove(t.temporaryFromNode),n!==null?(t.copyPortProperties(n,s,t.temporaryToNode,t.temporaryToPort,!0),t.diagram.add(t.temporaryToNode)):t.diagram.remove(t.temporaryToNode)}St.Object.defineProperties(go.prototype,{fromHandleArchetype:{get:function(){return this.V},set:function(t){this.V=t}},toHandleArchetype:{get:function(){return this.Xd},set:function(t){this.Xd=t}},handle:{get:function(){return this.F},set:function(t){if(t!==null&&!(t.part instanceof pr))throw Error("new handle is not in an Adornment: "+t);this.F=t}}}),go.className="RelinkingTool",Tn("linkingTool",function(){return this.findTool("Linking")},function(t){this.gb("Linking",t,this.mouseMoveTools)}),Tn("relinkingTool",function(){return this.findTool("Relinking")},function(t){this.gb("Relinking",t,this.mouseDownTools)});function Zr(){Jn.call(this),this.name="LinkReshaping";var t=new pn;t.figure="Rectangle",t.desiredSize=xr,t.fill="lightblue",t.stroke="dodgerblue",this.o=t,t=new pn,t.figure="Diamond",t.desiredSize=Ur,t.fill="lightblue",t.stroke="dodgerblue",t.cursor="move",this.u=t,this.F=3,this.Ts=this.j=null,this.Fw=new G,this.Yq=new ue}li(Zr,Jn),Zr.prototype.Ru=function(t){return t&&t.reshapingBehavior.value!==0?t.reshapingBehavior:da},Zr.prototype.om=function(t,e){t.reshapingBehavior=e},Zr.prototype.updateAdornments=function(t){if(t!==null&&t instanceof ge){var e=null;if(t.isSelected&&!this.diagram.isReadOnly){var i=t.path;i!==null&&t.canReshape()&&t.actualBounds.w()&&t.isVisible()&&i.actualBounds.w()&&i.Ed()&&(e=t.Pj(this.name),e===null||e.Aw!==t.pointsCount||e.Uw!==t.resegmentable)&&(e=this.makeAdornment(i),e!==null&&(e.Aw=t.pointsCount,e.Uw=t.resegmentable,t.bh(this.name,e)))}e===null&&t.Jf(this.name)}},Zr.prototype.makeAdornment=function(t){var e=t.part,i=e.pointsCount,n=e.isOrthogonal,s=null;if(e.points!==null&&1<i){s=new pr,s.type=ce.Link,i=e.firstPickIndex;var a=e.lastPickIndex,l=n?1:0;if(e.resegmentable&&e.computeCurve()!==Yh)for(var c=i+l;c<a-l;c++){var p=this.makeResegmentHandle(t,c);p!==null&&(p.segmentIndex=c,p.segmentFraction=.5,p.fromMaxLinks=999,s.add(p))}for(l=i+1;l<a;l++)if(c=this.makeHandle(t,l),c!==null){if(c.segmentIndex=l,l!==i)if(l===i+1&&n){p=e.i(i);var m=e.i(i+1);xt.B(p.x,m.x)&&xt.B(p.y,m.y)&&(m=e.i(i-1)),xt.B(p.x,m.x)?(this.om(c,ys),c.cursor="n-resize"):xt.B(p.y,m.y)&&(this.om(c,Cs),c.cursor="w-resize")}else l===a-1&&n?(p=e.i(a-1),m=e.i(a),xt.B(p.x,m.x)&&xt.B(p.y,m.y)&&(p=e.i(a+1)),xt.B(p.x,m.x)?(this.om(c,ys),c.cursor="n-resize"):xt.B(p.y,m.y)&&(this.om(c,Cs),c.cursor="w-resize")):l!==a&&(this.om(c,pa),c.cursor="move");s.add(c)}s.adornedObject=t}return s},Zr.prototype.makeHandle=function(){var t=this.handleArchetype;return t===null?null:t.copy()},Zr.prototype.makeResegmentHandle=function(){var t=this.midHandleArchetype;return t===null?null:t.copy()},Zr.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!t.isReadOnly&&t.allowReshape&&t.lastInput.left?this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null:!1},Zr.prototype.doActivate=function(){var t=this.diagram;if(this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle!==null){var e=this.handle.part.adornedPart;if(e instanceof ge){if(this.Ts=e,t.isMouseCaptured=!0,this.Ea(this.name),e.resegmentable&&this.handle.fromMaxLinks===999){var i=e.points.copy(),n=this.getResegmentingPoint();if(i.Gb(this.handle.segmentIndex+1,n),e.isOrthogonal&&i.Gb(this.handle.segmentIndex+1,n),e.points=i,e.Wb(),e.updateAdornments(),this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name),this.handle===null){this.doDeactivate();return}}this.Fw=e.i(this.handle.segmentIndex),this.Yq=e.points.copy(),this.isActive=!0}}},Zr.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},Zr.prototype.stopTransaction=function(){var t=this.diagram,e=Jn.prototype.stopTransaction.call(this);return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.ak(),e},Zr.prototype.doCancel=function(){var t=this.adornedLink;t!==null&&(t.points=this.Yq),this.stopTool()},Zr.prototype.getResegmentingPoint=function(){return this.handle.ga(_n)},Zr.prototype.doMouseMove=function(){var t=this.diagram;this.isActive&&(t=this.computeReshape(t.lastInput.documentPoint),this.reshape(t))},Zr.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var e=this.computeReshape(t.lastInput.documentPoint);if(this.reshape(e),e=this.adornedLink,e!==null&&e.resegmentable){var i=this.handle.segmentIndex,n=e.i(i-1),s=e.i(i),a=e.i(i+1);if(e.isOrthogonal){if(i>e.firstPickIndex+1&&i<e.lastPickIndex-1){var l=e.i(i-2);if(Math.abs(n.x-s.x)<this.resegmentingDistance&&Math.abs(n.y-s.y)<this.resegmentingDistance&&(zo(this,l,n,s,a,!0)||zo(this,l,n,s,a,!1))){var c=e.points.copy();zo(this,l,n,s,a,!0)?(c.cd(i-2,new G(l.x,(a.y+l.y)/2)),c.cd(i+1,new G(a.x,(a.y+l.y)/2))):(c.cd(i-2,new G((a.x+l.x)/2,l.y)),c.cd(i+1,new G((a.x+l.x)/2,a.y))),c.mb(i),c.mb(i-1),e.points=c,e.Wb()}else l=e.i(i+2),Math.abs(s.x-a.x)<this.resegmentingDistance&&Math.abs(s.y-a.y)<this.resegmentingDistance&&(zo(this,n,s,a,l,!0)||zo(this,n,s,a,l,!1))&&(c=e.points.copy(),zo(this,n,s,a,l,!0)?(c.cd(i-1,new G(n.x,(n.y+l.y)/2)),c.cd(i+2,new G(l.x,(n.y+l.y)/2))):(c.cd(i-1,new G((n.x+l.x)/2,n.y)),c.cd(i+2,new G((n.x+l.x)/2,l.y))),c.mb(i+1),c.mb(i),e.points=c,e.Wb())}}else l=G.alloc(),xt.qh(n.x,n.y,a.x,a.y,s.x,s.y,l)&&l.Bf(s)<this.resegmentingDistance*this.resegmentingDistance&&(n=e.points.copy(),n.mb(i),e.points=n,e.Wb()),G.free(l)}t.Ya(),this.transactionResult=this.name,t.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function zo(t,e,i,n,s,a){return a?Math.abs(e.y-i.y)<t.resegmentingDistance&&Math.abs(i.y-n.y)<t.resegmentingDistance&&Math.abs(n.y-s.y)<t.resegmentingDistance:Math.abs(e.x-i.x)<t.resegmentingDistance&&Math.abs(i.x-n.x)<t.resegmentingDistance&&Math.abs(n.x-s.x)<t.resegmentingDistance}Zr.prototype.reshape=function(t){var e=this.adornedLink;e.uh();var i=this.handle.segmentIndex,n=this.Ru(this.handle);if(e.isOrthogonal)if(i===e.firstPickIndex+1)i=e.firstPickIndex+1,n===ys?(e.L(i,e.i(i-1).x,t.y),e.L(i+1,e.i(i+2).x,t.y)):n===Cs&&(e.L(i,t.x,e.i(i-1).y),e.L(i+1,t.x,e.i(i+2).y));else if(i===e.lastPickIndex-1)i=e.lastPickIndex-1,n===ys?(e.L(i-1,e.i(i-2).x,t.y),e.L(i,e.i(i+1).x,t.y)):n===Cs&&(e.L(i-1,t.x,e.i(i-2).y),e.L(i,t.x,e.i(i+1).y));else{n=i;var s=e.i(n),a=e.i(n-1),l=e.i(n+1);xt.B(a.x,s.x)&&xt.B(s.y,l.y)?(xt.B(a.x,e.i(n-2).x)&&!xt.B(a.y,e.i(n-2).y)?(e.m(n,t.x,a.y),i++,n++):e.L(n-1,t.x,a.y),xt.B(l.y,e.i(n+2).y)&&!xt.B(l.x,e.i(n+2).x)?e.m(n+1,l.x,t.y):e.L(n+1,l.x,t.y)):xt.B(a.y,s.y)&&xt.B(s.x,l.x)?(xt.B(a.y,e.i(n-2).y)&&!xt.B(a.x,e.i(n-2).x)?(e.m(n,a.x,t.y),i++,n++):e.L(n-1,a.x,t.y),xt.B(l.x,e.i(n+2).x)&&!xt.B(l.y,e.i(n+2).y)?e.m(n+1,t.x,l.y):e.L(n+1,t.x,l.y)):xt.B(a.x,s.x)&&xt.B(s.x,l.x)?(xt.B(a.x,e.i(n-2).x)&&!xt.B(a.y,e.i(n-2).y)?(e.m(n,t.x,a.y),i++,n++):e.L(n-1,t.x,a.y),xt.B(l.x,e.i(n+2).x)&&!xt.B(l.y,e.i(n+2).y)?e.m(n+1,t.x,l.y):e.L(n+1,t.x,l.y)):xt.B(a.y,s.y)&&xt.B(s.y,l.y)&&(xt.B(a.y,e.i(n-2).y)&&!xt.B(a.x,e.i(n-2).x)?(e.m(n,a.x,t.y),i++,n++):e.L(n-1,a.x,t.y),xt.B(l.y,e.i(n+2).y)&&!xt.B(l.x,e.i(n+2).x)?e.m(n+1,l.x,t.y):e.L(n+1,l.x,t.y)),e.L(i,t.x,t.y)}else e.L(i,t.x,t.y),n=e.fromNode,s=e.fromPort,n!==null&&(a=n.findVisibleNode(),a!==null&&a!==n&&(n=a,s=n.port)),i===1&&e.computeSpot(!0,s).Mc()&&(a=s.ga(_n,G.alloc()),n=e.getLinkPointFromPoint(n,s,a,t,!0,G.alloc()),e.L(0,n.x,n.y),G.free(a),G.free(n)),n=e.toNode,s=e.toPort,n!==null&&(a=n.findVisibleNode(),a!==null&&a!==n&&(n=a,s=n.port)),i===e.pointsCount-2&&e.computeSpot(!1,s).Mc()&&(i=s.ga(_n,G.alloc()),t=e.getLinkPointFromPoint(n,s,i,t,!1,G.alloc()),e.L(e.pointsCount-1,t.x,t.y),G.free(i),G.free(t));e.zf()},Zr.prototype.computeReshape=function(t){var e=this.adornedLink,i=this.handle.segmentIndex;switch(this.Ru(this.handle)){case pa:return t;case ys:return new G(e.i(i).x,t.y);case Cs:return new G(t.x,e.i(i).y);default:case da:return e.i(i)}},St.Object.defineProperties(Zr.prototype,{handleArchetype:{get:function(){return this.o},set:function(t){this.o=t}},midHandleArchetype:{get:function(){return this.u},set:function(t){this.u=t}},handle:{get:function(){return this.j},set:function(t){if(t!==null&&!(t.part instanceof pr))throw Error("new handle is not in an Adornment: "+t);this.j=t}},adornedLink:{get:function(){return this.Ts}},resegmentingDistance:{get:function(){return this.F},set:function(t){this.F=t}},originalPoint:{get:function(){return this.Fw}},originalPoints:{get:function(){return this.Yq}}}),Zr.prototype.setReshapingBehavior=Zr.prototype.om,Zr.prototype.getReshapingBehavior=Zr.prototype.Ru;var da=new he(Zr,"None",0),Cs=new he(Zr,"Horizontal",1),ys=new he(Zr,"Vertical",2),pa=new he(Zr,"All",3);Zr.className="LinkReshapingTool",Zr.None=da,Zr.Horizontal=Cs,Zr.Vertical=ys,Zr.All=pa,Tn("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(t){this.gb("LinkReshaping",t,this.mouseDownTools)});function Cr(){Jn.call(this),this.name="Resizing",this.o=new fe(1,1).freeze(),this.j=new fe(9999,9999).freeze(),this.yg=new fe(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var t=new pn;t.alignmentFocus=_n,t.figure="Rectangle",t.desiredSize=xr,t.fill="lightblue",t.stroke="dodgerblue",t.strokeWidth=1,t.cursor="pointer",this.F=t,this.u=null,this.Xq=new G,this.Dw=new fe,this.Tn=new G,this.rt=new fe(0,0),this.qt=new fe(1/0,1/0),this.pt=new fe(1,1)}li(Cr,Jn),Cr.prototype.updateAdornments=function(t){if(!(t===null||t instanceof ge)){if(t.isSelected&&!this.diagram.isReadOnly){var e=t.resizeObject,i=t.Pj(this.name);if(e!==null&&t.canResize()&&t.actualBounds.w()&&t.isVisible()&&e.actualBounds.w()&&e.Ed()&&((i===null||i.adornedObject!==e)&&(i=this.makeAdornment(e)),i!==null)){e=e.li(),zd(t)&&this.updateResizeHandles(i,e),t.bh(this.name,i);return}}t.Jf(this.name)}},Cr.prototype.makeAdornment=function(t){var e=t.part.resizeAdornmentTemplate;if(e===null){e=new pr,e.type=ce.Spot,e.locationSpot=_n;var i=new Wu;i.isPanelMain=!0,e.add(i),e.add(this.makeHandle(t,Fo)),e.add(this.makeHandle(t,Ll)),e.add(this.makeHandle(t,uu)),e.add(this.makeHandle(t,nu)),e.add(this.makeHandle(t,al)),e.add(this.makeHandle(t,qa)),e.add(this.makeHandle(t,ka)),e.add(this.makeHandle(t,gl))}else if(Sh(e),e=e.copy(),e===null)return null;return e.adornedObject=t,e},Cr.prototype.makeHandle=function(t,e){return t=this.handleArchetype,t===null?null:(t=t.copy(),t.alignment=e,t)},Cr.prototype.updateResizeHandles=function(t,e){if(t!==null){if(!t.alignment.Xb()&&(t.cursor==="pointer"||0<t.cursor.indexOf("resize")))t:{var i=t.alignment;if(i.Mc()&&(i=_n),0>=i.x)e=0>=i.y?e+225:1<=i.y?e+135:e+180;else if(1<=i.x)0>=i.y?e+=315:1<=i.y&&(e+=45);else if(0>=i.y)e+=270;else if(1<=i.y)e+=90;else break t;0>e?e+=360:360<=e&&(e-=360),t.cursor=22.5>e?"e-resize":67.5>e?"se-resize":112.5>e?"s-resize":157.5>e?"sw-resize":202.5>e?"w-resize":247.5>e?"nw-resize":292.5>e?"n-resize":337.5>e?"ne-resize":"e-resize"}else if(t instanceof ce)for(t=t.elements;t.next();)this.updateResizeHandles(t.value,e)}},Cr.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!t.isReadOnly&&t.allowResize&&t.lastInput.left?this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null:!1},Cr.prototype.doActivate=function(){var t=this.diagram;this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle!==null&&(this.adornedObject=this.handle.part.adornedObject,this.adornedObject!==null&&(t.isMouseCaptured=!0,t.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt=this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))},Cr.prototype.doDeactivate=function(){var t=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=t.isMouseCaptured=!1},Cr.prototype.stopTransaction=function(){var t=this.diagram,e=Jn.prototype.stopTransaction.call(this);return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.ak(),e},Cr.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Cr.prototype.doMouseMove=function(){var t=this.diagram;if(this.isActive){var e=this.rt,i=this.qt,n=this.pt,s=this.adornedObject.qs(t.lastInput.documentPoint,G.alloc()),a=this.computeReshape();e=this.computeResize(s,this.handle.alignment,e,i,n,a),this.resize(e),t.bd(),G.free(s)}},Cr.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var e=this.rt,i=this.qt,n=this.pt,s=this.adornedObject.qs(t.lastInput.documentPoint,G.alloc()),a=this.computeReshape();e=this.computeResize(s,this.handle.alignment,e,i,n,a),this.resize(e),G.free(s),t.Ya(),this.transactionResult=this.name,t.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Cr.prototype.resize=function(t){var e=this.diagram,i=this.adornedObject;if(i!==null){if(i.desiredSize=t.size,t=i.part,t.Va(),i=i.ga(this.handle.alignment.gv()),t instanceof Yi){var n=new ue;if(n.add(t),!this.dragsMembers&&t.placeholder===null){var s=new d;s.dragsMembers=!1}e.moveParts(n,this.oppositePoint.copy().re(i),!0,s)}else t.location=t.location.copy().re(i).add(this.oppositePoint);e.bd()}},Cr.prototype.computeResize=function(t,e,i,n,s,a){e.Mc()&&(e=_n);var l=this.adornedObject.naturalBounds,c=l.x,p=l.y,m=l.x+l.width,v=l.y+l.height,w=1;if(!a){w=l.width;var C=l.height;0>=w&&(w=1),0>=C&&(C=1),w=C/w}return C=G.alloc(),xt.No(t.x,t.y,c,p,s.width,s.height,C),t=l.copy(),0>=e.x?0>=e.y?(t.x=Math.max(C.x,m-n.width),t.x=Math.min(t.x,m-i.width),t.width=Math.max(m-t.x,i.width),t.y=Math.max(C.y,v-n.height),t.y=Math.min(t.y,v-i.height),t.height=Math.max(v-t.y,i.height),a||(1<=t.height/t.width?(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w):(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width),t.x=m-t.width,t.y=v-t.height)):1<=e.y?(t.x=Math.max(C.x,m-n.width),t.x=Math.min(t.x,m-i.width),t.width=Math.max(m-t.x,i.width),t.height=Math.max(Math.min(C.y-p,n.height),i.height),a||(1<=t.height/t.width?(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w):(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width),t.x=m-t.width)):(t.x=Math.max(C.x,m-n.width),t.x=Math.min(t.x,m-i.width),t.width=m-t.x,a||(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w,t.y=p+.5*(v-p-t.height))):1<=e.x?0>=e.y?(t.width=Math.max(Math.min(C.x-c,n.width),i.width),t.y=Math.max(C.y,v-n.height),t.y=Math.min(t.y,v-i.height),t.height=Math.max(v-t.y,i.height),a||(1<=t.height/t.width?(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w):(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width),t.y=v-t.height)):1<=e.y?(t.width=Math.max(Math.min(C.x-c,n.width),i.width),t.height=Math.max(Math.min(C.y-p,n.height),i.height),a||(1<=t.height/t.width?(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w):(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width))):(t.width=Math.max(Math.min(C.x-c,n.width),i.width),a||(t.height=Math.max(Math.min(w*t.width,n.height),i.height),t.width=t.height/w,t.y=p+.5*(v-p-t.height))):0>=e.y?(t.y=Math.max(C.y,v-n.height),t.y=Math.min(t.y,v-i.height),t.height=v-t.y,a||(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width,t.x=c+.5*(m-c-t.width))):1<=e.y&&(t.height=Math.max(Math.min(C.y-p,n.height),i.height),a||(t.width=Math.max(Math.min(t.height/w,n.width),i.width),t.height=w*t.width,t.x=c+.5*(m-c-t.width))),G.free(C),t},Cr.prototype.computeReshape=function(){var t=Jt;return this.adornedObject instanceof pn&&(t=F0(this.adornedObject)),!(t===oi||this.diagram.lastInput.shift)},Cr.prototype.computeMinSize=function(){var t=this.adornedObject.minSize.copy(),e=this.minSize;return!isNaN(e.width)&&e.width>t.width&&(t.width=e.width),!isNaN(e.height)&&e.height>t.height&&(t.height=e.height),t},Cr.prototype.computeMaxSize=function(){var t=this.adornedObject.maxSize.copy(),e=this.maxSize;return!isNaN(e.width)&&e.width<t.width&&(t.width=e.width),!isNaN(e.height)&&e.height<t.height&&(t.height=e.height),t},Cr.prototype.computeCellSize=function(){var t=new fe(NaN,NaN),e=this.adornedObject.part;return e!==null&&(e=e.resizeCellSize,!isNaN(e.width)&&0<e.width&&(t.width=e.width),!isNaN(e.height)&&0<e.height&&(t.height=e.height)),e=this.cellSize,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height),e=this.diagram,(isNaN(t.width)||isNaN(t.height))&&e&&(e=e.grid,e!==null&&e.visible&&this.isGridSnapEnabled&&(e=e.gridCellSize,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height))),(isNaN(t.width)||t.width===0||t.width===1/0)&&(t.width=1),(isNaN(t.height)||t.height===0||t.height===1/0)&&(t.height=1),t},St.Object.defineProperties(Cr.prototype,{handleArchetype:{get:function(){return this.F},set:function(t){this.F=t}},handle:{get:function(){return this.u},set:function(t){if(t!==null&&!(t.part instanceof pr))throw Error("new handle is not in an Adornment: "+t);this.u=t}},adornedObject:{get:function(){return this.ue},set:function(t){if(t!==null&&t.part instanceof pr)throw Error("new handle must not be in an Adornment: "+t);this.ue=t}},minSize:{get:function(){return this.o},set:function(t){if(!this.o.D(t)){var e=t.width;isNaN(e)&&(e=0),t=t.height,isNaN(t)&&(t=0),this.o.h(e,t)}}},maxSize:{get:function(){return this.j},set:function(t){if(!this.j.D(t)){var e=t.width;isNaN(e)&&(e=1/0),t=t.height,isNaN(t)&&(t=1/0),this.j.h(e,t)}}},cellSize:{get:function(){return this.yg},set:function(t){this.yg.D(t)||this.yg.assign(t)}},isGridSnapEnabled:{get:function(){return this.V},set:function(t){this.V=t}},dragsMembers:{get:function(){return this.ia},set:function(t){this.ia=t}},oppositePoint:{get:function(){return this.Xq},set:function(t){this.Xq.D(t)||this.Xq.assign(t)}},originalDesiredSize:{get:function(){return this.Dw}},originalLocation:{get:function(){return this.Tn}}}),Cr.className="ResizingTool",Tn("resizingTool",function(){return this.findTool("Resizing")},function(t){this.gb("Resizing",t,this.mouseDownTools)});function Qr(){Jn.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new G,this.ue=null;var t=new pn;t.figure="Ellipse",t.desiredSize=Ur,t.fill="lightblue",t.stroke="dodgerblue",t.strokeWidth=1,t.cursor="pointer",this.o=t,this.j=null,this.Cw=0,this.kr=new G(NaN,NaN),this.u=0,this.F=50}li(Qr,Jn),Qr.prototype.updateAdornments=function(t){if(t!==null){if(t.ph()){var e=t.rotateObject;if(e===t||e===t.path||e.isPanelMain)return}if(t.isSelected&&!this.diagram.isReadOnly&&(e=t.rotateObject,e!==null&&t.canRotate()&&t.actualBounds.w()&&t.isVisible()&&e.actualBounds.w()&&e.Ed())){var i=t.Pj(this.name);if((i===null||i.adornedObject!==e)&&(i=this.makeAdornment(e)),i!==null){i.angle=e.li(),i.placeholder===null&&(i.location=this.computeAdornmentLocation(e)),t.bh(this.name,i);return}}t.Jf(this.name)}},Qr.prototype.makeAdornment=function(t){var e=t.part.rotateAdornmentTemplate;if(e===null){e=new pr,e.type=ce.Position,e.locationSpot=_n;var i=this.handleArchetype;i!==null&&e.add(i.copy())}else if(Sh(e),e=e.copy(),e===null)return null;return e.adornedObject=t,e},Qr.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!t.isReadOnly&&t.allowRotate&&t.lastInput.left?this.findToolHandleAt(t.firstInput.documentPoint,this.name)!==null:!1},Qr.prototype.doActivate=function(){var t=this.diagram;if(this.adornedObject===null){if(this.handle===null&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),this.handle===null)return;this.adornedObject=this.handle.part.adornedObject}this.adornedObject!==null&&(t.isMouseCaptured=!0,t.delaysLayout=!0,this.Ea(this.name),this.Cw=this.adornedObject.angle,this.kr=this.computeRotationPoint(this.adornedObject),this.Tn=this.adornedObject.part.location.copy(),this.isActive=!0)},Qr.prototype.computeRotationPoint=function(t){var e=t.part,i=e.locationObject;return e.rotationSpot.sb()?t.ga(e.rotationSpot):t===e||t===i?i.ga(e.locationSpot):t.ga(_n)},Qr.prototype.computeAdornmentLocation=function(t){var e=this.rotationPoint;e.w()||(e=this.computeRotationPoint(t)),e=t.qs(e);var i=this.handleAngle;0>i?i+=360:360<=i&&(i-=360),i=Math.round(45*Math.round(i/45));var n=this.handleDistance;return i===0?e.x=t.naturalBounds.width+n:i===45?(e.x=t.naturalBounds.width+n,e.y=t.naturalBounds.height+n):i===90?e.y=t.naturalBounds.height+n:i===135?(e.x=-n,e.y=t.naturalBounds.height+n):i===180?e.x=-n:i===225?(e.x=-n,e.y=-n):i===270?e.y=-n:i===315&&(e.x=t.naturalBounds.width+n,e.y=-n),t.ga(e)},Qr.prototype.doDeactivate=function(){var t=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new G(NaN,NaN),this.isActive=t.isMouseCaptured=!1},Qr.prototype.stopTransaction=function(){var t=this.diagram,e=Jn.prototype.stopTransaction.call(this);return e&&t.undoManager.transactionToUndo!==null&&t.undoManager.transactionToUndo.ak(),e},Qr.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Qr.prototype.doMouseMove=function(){var t=this.diagram;this.isActive&&(t=this.computeRotate(t.lastInput.documentPoint),this.rotate(t))},Qr.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){t.delaysLayout=!1;var e=this.computeRotate(t.lastInput.documentPoint);this.rotate(e),t.Ya(),this.transactionResult=this.name,t.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},Qr.prototype.rotate=function(t){var e=this.adornedObject;if(e!==null){e.angle=t,e=e.part,e.Va();var i=e.locationObject,n=e.rotateObject;(i===n||i.rg(n))&&(i=this.Tn.copy(),e.location=i.re(this.rotationPoint).rotate(t-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},Qr.prototype.computeRotate=function(t){t=this.rotationPoint.ab(t)-this.handleAngle;var e=this.adornedObject.panel;e!==null&&(t-=e.li()),360<=t?t-=360:0>t&&(t+=360),e=Math.min(Math.abs(this.snapAngleMultiple),180);var i=Math.min(Math.abs(this.snapAngleEpsilon),e/2);return!this.diagram.lastInput.shift&&0<e&&0<i&&(t%e<i?t=Math.floor(t/e)*e:t%e>e-i&&(t=(Math.floor(t/e)+1)*e)),360<=t?t-=360:0>t&&(t+=360),t},St.Object.defineProperties(Qr.prototype,{handleArchetype:{get:function(){return this.o},set:function(t){this.o=t}},handle:{get:function(){return this.j},set:function(t){if(t!==null&&!(t.part instanceof pr))throw Error("new handle is not in an Adornment: "+t);this.j=t}},adornedObject:{get:function(){return this.ue},set:function(t){if(t!==null&&t.part instanceof pr)throw Error("new handle must not be in an Adornment: "+t);this.ue=t}},snapAngleMultiple:{get:function(){return this.ia},set:function(t){this.ia=t}},snapAngleEpsilon:{get:function(){return this.V},set:function(t){this.V=t}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(t){this.kr=t.copy()}},handleAngle:{get:function(){return this.u},set:function(t){this.u=t}},handleDistance:{get:function(){return this.F},set:function(t){this.F=t}}}),Qr.className="RotatingTool",Tn("rotatingTool",function(){return this.findTool("Rotating")},function(t){this.gb("Rotating",t,this.mouseDownTools)});function io(){Jn.call(this),this.name="ClickSelecting"}li(io,Jn),io.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},io.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},io.className="ClickSelectingTool";function Ps(){Jn.call(this),this.name="Action",this.pk=null}li(Ps,Jn),Ps.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram,e=t.lastInput,i=t.ic(e.documentPoint,function(n){for(;n.panel!==null&&!n.isActionable;)n=n.panel;return n});return i!==null&&i.isActionable?(this.pk=i,t.Ck=t.ic(e.documentPoint,null,null),!0):!1},Ps.prototype.doMouseDown=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;e!==null&&(t.targetObject=e,e.actionDown!==null&&e.actionDown(t,e))}else this.canStart()&&this.doActivate()},Ps.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;e!==null&&(t.targetObject=e,e.actionMove!==null&&e.actionMove(t,e))}},Ps.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.pk;if(e===null)return;t.targetObject=e,e.actionUp!==null&&e.actionUp(t,e),this.standardMouseClick(function(i){for(;i.panel!==null&&(!i.isActionable||i!==e);)i=i.panel;return i},function(i){return i===e})}this.stopTool()},Ps.prototype.doCancel=function(){var t=this.diagram.lastInput,e=this.pk;e!==null&&(t.targetObject=e,e.actionCancel!==null&&e.actionCancel(t,e),this.stopTool())},Ps.prototype.doStop=function(){this.pk=null},Ps.className="ActionTool";function xs(){Jn.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new G(0,0)}li(xs,Jn),xs.prototype.canStart=function(){if(!this.isEnabled||this.archetypeNodeData===null)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(t.lastInput.clickCount===1&&(this.mw=t.lastInput.viewPoint.copy()),t.lastInput.clickCount!==2||this.isBeyondDragSize(this.mw))return!1}else if(t.lastInput.clickCount!==1)return!1;return!(t.currentTool!==this&&t.Ol(t.lastInput.documentPoint,!0)!==null)},xs.prototype.doMouseUp=function(){var t=this.diagram;this.isActive&&this.insertPart(t.lastInput.documentPoint),this.stopTool()},xs.prototype.insertPart=function(t){var e=this.diagram,i=this.archetypeNodeData;if(i===null)return null;var n=null;try{if(e.R("ChangingSelection",e.selection),this.Ea(this.name),i instanceof bi)i.Zc()&&(Sh(i),n=i.copy(),n!==null&&e.add(n));else if(i!==null){var s=e.model.copyNodeData(i);Qt(s)&&(e.model.xf(s),n=e.Lc(s))}if(n!==null){var a=G.allocAt(t.x,t.y);this.isGridSnapEnabled&&Nn(this.diagram,n,t,a),n.location=a,e.allowSelect&&(e.clearSelection(!0),n.isSelected=!0),G.free(a)}e.Ya(),this.transactionResult=this.name,e.R("PartCreated",n)}finally{this.stopTransaction(),e.R("ChangedSelection",e.selection)}return n},St.Object.defineProperties(xs.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(t){this.Ri=t}},isDoubleClick:{get:function(){return this.o},set:function(t){this.o=t}},isGridSnapEnabled:{get:function(){return this.j},set:function(t){this.j=t}}}),xs.className="ClickCreatingTool";function Ns(){Jn.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var t=new bi;t.layerName="Tool",t.selectable=!1;var e=new pn;e.name="SHAPE",e.figure="Rectangle",e.fill=null,e.stroke="magenta",t.add(e),this.j=t}li(Ns,Jn),Ns.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(!t.allowSelect)return!1;var e=t.lastInput;return!(!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.timestamp-t.firstInput.timestamp<this.delay||t.Ol(e.documentPoint,!0)!==null))},Ns.prototype.doActivate=function(){var t=this.diagram;this.isActive=!0,t.isMouseCaptured=!0,t.skipsUndoManager=!0,t.add(this.box),this.doMouseMove()},Ns.prototype.doDeactivate=function(){var t=this.diagram;t.ug(),t.remove(this.box),t.skipsUndoManager=!1,this.isActive=t.isMouseCaptured=!1},Ns.prototype.doMouseMove=function(){var t=this.diagram;if(this.isActive&&this.box!==null){var e=this.computeBoxBounds(),i=this.box.fb("SHAPE");i===null&&(i=this.box.Pb());var n=fe.alloc().h(e.width,e.height);i.desiredSize=n,this.box.mm(e.x,e.y,!1),fe.free(n),(t.allowHorizontalScroll||t.allowVerticalScroll)&&t.gs(t.lastInput.viewPoint)}},Ns.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram;t.remove(this.box);try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),this.selectInRect(this.computeBoxBounds()),t.R("ChangedSelection",t.selection)}finally{t.currentCursor=""}}this.stopTool()},Ns.prototype.computeBoxBounds=function(){var t=this.diagram;return new Tt(t.firstInput.documentPoint,t.lastInput.documentPoint)},Ns.prototype.selectInRect=function(t){var e=this.diagram,i=e.lastInput;if(t=e.ux(t,this.isPartialInclusion),qr?i.meta:i.control)if(i.shift)for(t=t.iterator;t.next();)e=t.value,e.isSelected&&(e.isSelected=!1);else for(t=t.iterator;t.next();)e=t.value,e.isSelected=!e.isSelected;else if(i.shift)for(t=t.iterator;t.next();)e=t.value,e.isSelected||(e.isSelected=!0);else{for(i=new ue,e=e.selection.iterator;e.next();){var n=e.value;t.contains(n)||i.add(n)}for(e=i.iterator;e.next();)e.value.isSelected=!1;for(t=t.iterator;t.next();)e=t.value,e.isSelected||(e.isSelected=!0)}},St.Object.defineProperties(Ns.prototype,{delay:{get:function(){return this.Ik},set:function(t){this.Ik=t}},isPartialInclusion:{get:function(){return this.o},set:function(t){this.o=t}},box:{get:function(){return this.j},set:function(t){this.j=t}}}),Ns.className="DragSelectingTool";function gs(){Jn.call(this),this.name="Panning",this.Xt=new G,this.xy=new G,this.xg=!1;var t=this;this.Kw=function(){var e=t.diagram;e!==null&&e.removeEventListener(Kt.document,"scroll",t.Kw,!1),t.stopTool()}}li(gs,Jn),gs.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(!t.allowHorizontalScroll&&!t.allowVerticalScroll||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())},gs.prototype.doActivate=function(){var t=this.diagram;this.xg?(t.lastInput.bubbles=!0,t.addEventListener(Kt.document,"scroll",this.Kw,!1)):(t.currentCursor="move",t.isMouseCaptured=!0,this.Xt.assign(t.position)),this.isActive=!0},gs.prototype.doDeactivate=function(){var t=this.diagram;t.currentCursor="",this.isActive=t.isMouseCaptured=!1},gs.prototype.doCancel=function(){var t=this.diagram;t.position=this.Xt,t.isMouseCaptured=!1,this.stopTool()},gs.prototype.doMouseMove=function(){this.move()},gs.prototype.doMouseUp=function(){this.move(),this.stopTool()},gs.prototype.move=function(){var t=this.diagram;if(this.isActive&&t)if(this.xg)t.lastInput.bubbles=!0;else{var e=t.position,i=t.firstInput.documentPoint,n=t.lastInput.documentPoint,s=e.x+i.x-n.x;i=e.y+i.y-n.y,t.allowHorizontalScroll||(s=e.x),t.allowVerticalScroll||(i=e.y),t.position=this.xy.h(s,i)}},St.Object.defineProperties(gs.prototype,{bubbles:{get:function(){return this.xg},set:function(t){this.xg=t}},originalPosition:{get:function(){return this.Xt}}}),gs.className="PanningTool",Tn("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(t){this.gb("ClickCreating",t,this.mouseUpTools)}),Tn("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(t){this.gb("ClickSelecting",t,this.mouseUpTools)}),Tn("panningTool",function(){return this.findTool("Panning")},function(t){this.gb("Panning",t,this.mouseMoveTools)}),Tn("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(t){this.gb("DragSelecting",t,this.mouseMoveTools)}),Tn("actionTool",function(){return this.findTool("Action")},function(t){this.gb("Action",t,this.mouseDownTools)});function la(){this.F=this.u=this.j=this.o=null}St.Object.defineProperties(la.prototype,{mainElement:{get:function(){return this.u},set:function(t){this.u=t}},show:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t)}},hide:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t)}},valueFunction:{get:function(){return this.F},set:function(t){this.F=t}}}),la.className="HTMLInfo";function Da(t,e,i){this.text=t,this.hx=e,this.visible=i}Da.className="ContextMenuButtonInfo";function Ks(){Jn.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new G,this.jt=null,this.Et=!1;var t=this;this.tu=function(){t.stopTool()}}li(Ks,Jn);function va(t){var e=new la;e.show=function(s,a,l){l.showDefaultContextMenu()},e.hide=function(s,a){a.hideDefaultContextMenu()},ll=e,t.tu=function(){t.stopTool()},e=we("div");var i=we("div");e.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px",i.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";var n=we("style");Kt.document.getElementsByTagName("head")[0].appendChild(n),n.sheet.insertRule(".goCXul { list-style: none; }",0),n.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),n.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),n=t.diagram,n!==null&&(n.addEventListener(e,"contextmenu",oo,!1),n.addEventListener(e,"selectstart",oo,!1),n.addEventListener(i,"contextmenu",oo,!1)),e.className="goCXforeground",i.className="goCXbackground",Kt.document.body&&(Kt.document.body.appendChild(e),Kt.document.body.appendChild(i)),Qa=e,Oa=i,ja=!0}function oo(t){return t.preventDefault(),!1}Ks.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return this.isBeyondDragSize()||!t.lastInput.right||1<t.lastInput.clickCount?!1:!!(t.lastInput.isTouchEvent&&this.defaultTouchContextMenu!==null||this.findObjectWithContextMenu()!==null)},Ks.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},Ks.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},Ks.prototype.findObjectWithContextMenu=function(t){t===void 0&&(t=null);var e=this.diagram,i=e.lastInput,n=null;if(t instanceof Ct||(t instanceof pt?n=t:n=e.ic(i.documentPoint,null,function(s){return!s.layer.isTemporary})),n!==null){for(t=n;t!==null;){if(t.contextMenu!==null)return t;t=t.panel}if(e.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return n.part}else if(e.contextMenu!==null)return e;return null},Ks.prototype.doActivate=function(){},Ks.prototype.doMouseDown=function(){if(Jn.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof pr){var t=this.diagram.toolManager.findTool("Action");t!==null&&t.canStart()&&(t.doActivate(),t.doMouseDown(),t.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&vs(this)},Ks.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof pr){var t=this.diagram.toolManager.findTool("Action");t!==null&&t.canStart()&&(t.doActivate(),t.doCancel(),t.doDeactivate())}vs(this)};function vs(t){var e=t.diagram;if(t.isActive){var i=t.currentContextMenu;if(i!==null){var n=null;i instanceof la||(n=e.ic(e.lastInput.documentPoint,null,null),n!==null&&n.rg(i)&&t.standardMouseClick(null,null)),t.maybeStopTool(n)}}else t.canStart()&&(ks(t,!0),t.isActive||t.stopTool())}Ks.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function ks(t,e,i){if(i===void 0&&(i=null),!t.Et&&(t.Et=!0,e&&t.standardMouseSelect(),e=t.standardMouseClick(),t.Et=!1,!e)){if(t.isActive=!0,e=ll,i===null&&(i=t.findObjectWithContextMenu()),i!==null){var n=i.contextMenu;n!==null?(t.currentObject=i instanceof pt?i:null,t.showContextMenu(n,t.currentObject)):e!==null&&t.showContextMenu(e,t.currentObject)}else e!==null&&t.showContextMenu(e,null);t.currentContextMenu instanceof pr&&!t.currentContextMenu.visible&&t.stopTool()}}Ks.prototype.doMouseMove=function(){var t=this.diagram.toolManager.findTool("Action");t!==null&&t.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},Ks.prototype.showContextMenu=function(t,e){var i=this.diagram;if(t!==this.currentContextMenu&&this.hideContextMenu(),t instanceof pr){t.layerName="Tool",t.selectable=!1,t.scale=1/i.scale,t.category=this.name,t.placeholder!==null&&(t.placeholder.scale=i.scale);var n=t.diagram;n!==null&&n!==i&&n.remove(t),i.add(t),e!==null?t.adornedObject=e:t.data=i.model,t.Va(),this.positionContextMenu(t,e)}else t instanceof la&&t.show(e,i,this);this.currentContextMenu=t},Ks.prototype.positionContextMenu=function(t){if(t.placeholder===null){var e=this.diagram,i=e.lastInput.documentPoint.copy(),n=t.measuredBounds,s=e.viewportBounds;e.lastInput.isTouchEvent&&(i.x-=n.width),i.x+n.width>s.right&&(i.x-=n.width+5/e.scale),i.x<s.x&&(i.x=s.x),i.y+n.height>s.bottom&&(i.y-=n.height+5/e.scale),i.y<s.y&&(i.y=s.y),t.position=i}},Ks.prototype.hideContextMenu=function(){var t=this.diagram,e=this.currentContextMenu;e!==null&&(e instanceof pr?(t.remove(e),this.ht!==null&&this.ht.Jf(e.category),e.data=null,e.adornedObject=null):e instanceof la&&(e.hide!==null?e.hide(t,this):e.mainElement!==null&&(e.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Ia(t){var e=new ue;return e.add(new Da("Copy",function(i){i.commandHandler.copySelection()},function(i){return i.commandHandler.canCopySelection()})),e.add(new Da("Cut",function(i){i.commandHandler.cutSelection()},function(i){return i.commandHandler.canCutSelection()})),e.add(new Da("Delete",function(i){i.commandHandler.deleteSelection()},function(i){return i.commandHandler.canDeleteSelection()})),e.add(new Da("Paste",function(i){i.commandHandler.pasteSelection(t.mouseDownPoint)},function(i){return i.commandHandler.canPasteSelection(t.mouseDownPoint)})),e.add(new Da("Select All",function(i){i.commandHandler.selectAll()},function(i){return i.commandHandler.canSelectAll()})),e.add(new Da("Undo",function(i){i.commandHandler.undo()},function(i){return i.commandHandler.canUndo()})),e.add(new Da("Redo",function(i){i.commandHandler.redo()},function(i){return i.commandHandler.canRedo()})),e.add(new Da("Scroll To Part",function(i){i.commandHandler.scrollToPart()},function(i){return i.commandHandler.canScrollToPart()})),e.add(new Da("Zoom To Fit",function(i){i.commandHandler.zoomToFit()},function(i){return i.commandHandler.canZoomToFit()})),e.add(new Da("Reset Zoom",function(i){i.commandHandler.resetZoom()},function(i){return i.commandHandler.canResetZoom()})),e.add(new Da("Group Selection",function(i){i.commandHandler.groupSelection()},function(i){return i.commandHandler.canGroupSelection()})),e.add(new Da("Ungroup Selection",function(i){i.commandHandler.ungroupSelection()},function(i){return i.commandHandler.canUngroupSelection()})),e.add(new Da("Edit Text",function(i){i.commandHandler.editTextBlock()},function(i){return i.commandHandler.canEditTextBlock()})),e}Ks.prototype.showDefaultContextMenu=function(){var t=this.diagram;this.jt===null&&(this.jt=Ia(this)),Qa.innerHTML="",Oa.addEventListener("pointerdown",this.tu,!1);var e=this,i=we("ul");i.className="goCXul",Qa.appendChild(i),i.innerHTML="";for(var n=this.jt.iterator;n.next();){var s=n.value,a=s.visible;if(typeof s.hx=="function"&&(typeof a!="function"||a(t))){a=we("li"),a.className="goCXli";var l=we("a");l.className="goCXa",l.href="#",l.ky=s.hx,l.addEventListener("pointerdown",function(c){return this.ky(t),e.stopTool(),c.preventDefault(),!1},!1),l.textContent=s.text,a.appendChild(l),i.appendChild(a)}}Qa.style.display="block",Oa.style.display="block"},Ks.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===ll){Qa.style.display="none",Oa.style.display="none";var t=this.diagram;t!==null&&t.removeEventListener(Oa,"pointerdown",this.tu,!1),this.currentContextMenu=null}},St.Object.defineProperties(Ks.prototype,{currentContextMenu:{get:function(){return this.j},set:function(t){this.j=t,this.ht=t instanceof pr?t.adornedPart:null}},defaultTouchContextMenu:{get:function(){return ja===!1&&ll===null&&ur&&va(this),ll},set:function(t){t===null&&(ja=!0),ll=t}},currentObject:{get:function(){return this.o},set:function(t){this.o=t}},mouseDownPoint:{get:function(){return this.yw}}});var ll=null,ja=!1,Oa=null,Qa=null;Ks.className="ContextMenuTool",Tn("contextMenuTool",function(){return this.findTool("ContextMenu")},function(t){this.gb("ContextMenu",t,this.mouseUpTools)});function mr(){Jn.call(this),this.name="TextEditing",this.Zh=new ao,this.ia=null,this.V=pu,this.vj=null,this.qa=Xu,this.u=1,this.F=!0,this.o=null,this.j=new la,this.kt=null,Dl(this,this.j)}li(mr,Jn);function Dl(t,e){if(ur){var i=we("textarea");t.kt=i,i.addEventListener("input",function(){if(t.textBlock!==null){var n=t.Lx(this.value);this.style.width=20+n.measuredBounds.width*this.wA+"px",this.rows=n.lineCount}},!1),i.addEventListener("keydown",function(n){if(!n.isComposing&&t.textBlock!==null){var s=n.key;s==="Enter"?(t.textBlock.isMultiline===!1&&n.preventDefault(),t.acceptText(Ml)):s==="Tab"?(t.acceptText(Au),n.preventDefault()):s==="Escape"&&(t.doCancel(),t.diagram!==null&&t.diagram.doFocus())}},!1),i.addEventListener("focus",function(){if(t.currentTextEditor!==null&&t.state!==Xu){var n=t.kt;t.qa===ru&&(t.qa=ya),typeof n.select=="function"&&t.selectsTextOnActivate&&(n.select(),n.setSelectionRange(0,9999))}},!1),i.addEventListener("blur",function(){if(t.currentTextEditor!==null&&t.state!==Xu){var n=t.kt;typeof n.focus=="function"&&n.focus(),typeof n.select=="function"&&t.selectsTextOnActivate&&(n.select(),n.setSelectionRange(0,9999))}},!1),e.valueFunction=function(){return i.value},e.mainElement=i,e.show=function(n,s,a){if(n instanceof ao&&a instanceof mr)if(a.state===hl)i.style.border="3px solid red",i.focus();else{var l=n.ga(_n),c=s.position,p=s.scale,m=n.Df()*p;m<a.minimumEditorScale&&(m=a.minimumEditorScale);var v=n.naturalBounds.width*m+6,w=n.naturalBounds.height*m+2,C=(l.x-c.x)*p;l=(l.y-c.y)*p,c=n.verticalAlignment,p=(n.lineHeight+n.spacingAbove+n.spacingBelow)*n.lineCount*m,w=c.y*w-c.y*p+c.offsetY-(.5*w-.5*p)-p/2,i.value=n.text,s.div.style.font=n.font,i.style.position="absolute",i.style.zIndex="100",i.style.font="inherit",i.style.fontSize=100*m+"%",i.style.lineHeight="normal",i.style.width=v+"px",i.style.left=(C-v/2|0)-1+"px",i.style.top=(l+w|0)-1+"px",i.style.textAlign=n.textAlign,i.style.margin="0",i.style.padding="1px",i.style.border="0",i.style.outline="none",i.style.whiteSpace="pre-wrap",i.style.overflow="hidden",i.rows=n.lineCount,i.wA=m,i.className="goTXarea",s.div.appendChild(i),i.focus(),a.selectsTextOnActivate&&(i.select(),i.setSelectionRange(0,9999))}},e.hide=function(n){n.div.removeChild(i)}}}mr.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t===null||t.isReadOnly||Il&&Il!==this&&(Il.acceptText(To),Il&&Il!==this)||!t.lastInput.left||this.isBeyondDragSize())return!1;var e=t.ic(t.lastInput.documentPoint);return e!==null&&e instanceof ao&&e.editable&&e.part.canEdit()?(e=e.part,!(e===null||this.starting===pu&&!e.isSelected||this.starting===yl&&2>t.lastInput.clickCount)):!1},mr.prototype.doStart=function(){Il=this,this.textBlock!==null&&this.doActivate()},mr.prototype.doActivate=function(){if(!this.isActive){var t=this.diagram;if(t!==null){var e=this.textBlock;if(e===null&&(e=t.ic(t.lastInput.documentPoint)),e!==null&&e instanceof ao&&(this.textBlock=e,e.part!==null)){t.animationManager.Cc(),this.isActive=!0,this.qa=ru;var i=this.defaultTextEditor;e.textEditor!==null&&(i=e.textEditor),this.Zh=this.textBlock.copy();var n=new Tt(this.textBlock.ga(Fo),this.textBlock.ga(uu));t.tv(n),i.show(e,t,this),this.currentTextEditor=i}}}},mr.prototype.doCancel=function(){this.stopTool()},mr.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},mr.prototype.doMouseDown=function(){this.isActive&&this.acceptText(To)},mr.prototype.acceptText=function(t){switch(t){case To:this.qa===Qs?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===ru||this.qa===hl||this.qa===ya)&&(this.qa=ju,ul(this));break;case Cu:case Ml:case Au:(Ml!==t||this.textBlock.isMultiline!==!0)&&(this.qa===ru||this.qa===hl||this.qa===ya)&&(this.qa=ju,ul(this))}};function ul(t){var e=t.textBlock,i=t.diagram,n=t.currentTextEditor;if(e!==null&&n!==null){var s=e.text,a="";n.valueFunction!==null&&(a=n.valueFunction()),t.isValidText(e,s,a)?(t.Ea(t.name),t.qa=Qs,t.transactionResult=t.name,e.text=a,t.doSuccess(s,a),i!==null&&i.R("TextEdited",e,s),t.stopTransaction(),t.stopTool(),i!==null&&i.doFocus()):(t.qa=hl,t.doError(s,a))}}mr.prototype.doError=function(t,e){var i=this.textBlock;i.errorFunction!==null&&i.errorFunction(this,t,e),(t=this.currentTextEditor)&&t.show(i,this.diagram,this)},mr.prototype.doSuccess=function(t,e){var i=this.textBlock;i.textEdited!==null&&i.textEdited(i,t,e)},mr.prototype.doDeactivate=function(){var t=this.diagram;t!==null&&(this.qa=Xu,this.currentTextEditor!==null&&this.currentTextEditor.hide(t,this),this.textBlock=null,this.isActive=!1)},mr.prototype.doStop=function(){Il=null},mr.prototype.isValidText=function(t,e,i){var n=this.textValidation;return n!==null&&!n(t,e,i)?!1:(n=t.textValidation,!!(n===null||n(t,e,i)))},mr.prototype.Lx=function(t){var e=this.Zh;return e.text=t,e.measure(this.textBlock.Ih,1/0),e},St.Object.defineProperties(mr.prototype,{textBlock:{get:function(){return this.ia},set:function(t){this.ia=t}},currentTextEditor:{get:function(){return this.o},set:function(t){this.o=t}},defaultTextEditor:{get:function(){return this.j},set:function(t){this.j=t}},starting:{get:function(){return this.V},set:function(t){this.V=t}},textValidation:{get:function(){return this.vj},set:function(t){this.vj=t}},minimumEditorScale:{get:function(){return this.u},set:function(t){this.u=t}},selectsTextOnActivate:{get:function(){return this.F},set:function(t){this.F=t}},state:{get:function(){return this.qa},set:function(t){this.qa!==t&&(this.qa=t)}}}),mr.prototype.measureTemporaryTextBlock=mr.prototype.Lx;var Cu=new he(mr,"LostFocus",0),To=new he(mr,"MouseDown",1),Au=new he(mr,"Tab",2),Ml=new he(mr,"Enter",3),du=new he(mr,"SingleClick",0),pu=new he(mr,"SingleClickSelected",1),yl=new he(mr,"DoubleClick",2),Xu=new he(mr,"StateNone",0),ru=new he(mr,"StateActive",1),ya=new he(mr,"StateEditing",2),ju=new he(mr,"StateValidating",3),hl=new he(mr,"StateInvalid",4),Qs=new he(mr,"StateValidated",5),Il=null;mr.className="TextEditingTool",mr.LostFocus=Cu,mr.MouseDown=To,mr.Tab=Au,mr.Enter=Ml,mr.SingleClick=du,mr.SingleClickSelected=pu,mr.DoubleClick=yl,mr.StateNone=Xu,mr.StateActive=ru,mr.StateEditing=ya,mr.StateValidating=ju,mr.StateInvalid=hl,mr.StateValidated=Qs,Tn("textEditingTool",function(){return this.findTool("TextEditing")},function(t){this.gb("TextEditing",t,this.mouseUpTools)});function Es(t){wi||(xi(),wi=!0),this.H=Mn,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=ri,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new te,this.ce=new Li,this.ce.Yd=this,this.Ei=new te,this.pu=new te,this.Sr=new te,this.pr=new te,t&&Object.assign(this,t)}Es.prototype.Xe=function(t){this.H=t},Es.prototype.canStart=function(){return!0};function R(t,e){t.Jd&&t.canStart(e)&&(t.Zd.add(e),t.defaultAnimation.isAnimating&&t.Cc(),Vo(t.H),t.zb=!0)}function V(t){if(t.Jd&&t.zb){var e=t.ce,i=t.H,n=t.Zd.contains("Model");n&&(t.Ok=!0,t.Pk===ri?(e.isViewportUnconstrained=!0,e.vc.clear(),e.add(i,"position",i.position.copy().offset(0,-200),i.position),e.add(i,"opacity",0,1)):t.Pk===Bi&&e.vc.clear(),t.Qw=!!(t.Pk===Mi&&i.du.D(i.pa)),i.R("InitialAnimationStarting",t)),n&&!t.Gh||e.vc.count===0?(t.Zd.clear(),t.zb=!1,e.vc.clear(),Ni(e,i),t.Ok=!1,i.N()):(t.Zd.clear(),i.kg=!1,n=e.vc.get(i),i.autoScale!==xa&&n!==null&&(delete n.start.scale,delete n.end.scale),Kt.requestAnimationFrame(function(){t.zb===!1||e.bc||(i.Gf("temporaryPixelRatio")&&tn(i),Po(i),t.zb=!1,e.start(),e.bc&&(Xt(t),i.Ya(),ir(e,0),Rs(i,!0),Ne(t),i.R("AnimationStarting",t)))}))}}function at(t){return t.Zd.contains("Trigger")&&t.Zd.count===1}function dt(t,e,i,n){t.isTicking||at(t)||e instanceof ge&&(e.fromNode!==null||e.toNode!==null)||t.ce.add(e,"position",i,n,!1)}L=Es.prototype,L.fv=function(t){return this.ce.fv(t)},L.Xu=function(t){return this.ce.Xu(t)};function Dt(t,e){function i(){if(0<s.Sr.count&&(n.addAll(s.Sr),s.Sr.clear(),s.bc=!0),s.bc!==!1&&n.count!==0){s.pu.addAll(n);for(var a=s.pu.iterator;a.next();){var l=a.value;if(l.bc!==!1){t:if(0<l.yl.count)var c=!0;else{for(c=l.vc.iterator;c.next();){var p=c.key;if(p instanceof pt&&p.diagram!==null||p instanceof Ct){c=!0;break t}}c=!1}c?cn(l,!1):l.Xk=!0}}s.pu.clear(),s.bc!==!1&&(Xt(s),Rs(s.H),Ne(s)),Kt.requestAnimationFrame(i)}}var n=t.Ei,s=t;t.bc?t.Sr.add(e):(t.bc=!0,n.add(e),Kt.requestAnimationFrame(function(){i()}))}function _t(t){for(t=t.Ei.iterator;t.next();)t.value.Xk=!1}function Xt(t){if(!t.vq){var e=t.H;t.Ow=e.skipsUndoManager,t.cw=e.skipsModelSourceBindings,e.skipsUndoManager=!0,e.skipsModelSourceBindings=!0,t.vq=!0}}function Ne(t){var e=t.H;e.skipsUndoManager=t.Ow,e.skipsModelSourceBindings=t.cw,t.vq=!1}L.Cc=function(t){var e=this.ce;if(this.zb===!0&&(this.Ok=this.zb=!1,this.Zd.clear(),0<e.vc.count&&this.H.$b()),this.bc){if(e.Ml(!0),e.vc.clear(),Ni(e,null),t===!0)for(t=this.Ei.Fa(),e=0;e<t.length;e++)t[e].Ml(!0)}else e.vc.clear(),Ni(e,this.H)},L.Ml=function(t){t===this.defaultAnimation&&this.defaultAnimation.vc.clear(),this.Ei.remove(t),this.Ei.count===0&&(this.bc=!1,this.H.$b()),t===this.defaultAnimation&&(this.defaultAnimation.vc.clear(),this.H.R("AnimationFinished",this))},L.Cj=function(t,e){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(t,e),Qe(this,t))},L.Aj=function(t,e){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(t,e),Hi(this.ce,e,"position",e.position,e.position),Qe(this,t))};function Xe(t,e,i){!t.zb||e.D(i)||at(t)||(t.H.pi||(e=i.copy()),Hi(t.ce,t.H,"position",e,i))}function ze(t,e,i){e.fd&&(e.Tg=i,t.pr.add(e))}function Qe(t,e){for(e=e.findLinksConnected();e.next();){var i=e.value;i.fd&&(i.Tg=i.points.copy(),t.pr.add(i))}}function Be(t,e,i,n,s){t===null&&(t=[0,0,0,0]),e===null&&(e=[0,0,0,0]);var a=t[0],l=t[1],c=t[2];t=t[3];var p=e[0],m=e[1],v=e[2];return e=e[3],c===0||c===100?(a=p,l=m):(v===0||v===100)&&(p=a,m=l),180<Math.abs(p-a)&&(p>a?a+=360:p+=360),a=s(i,a,p-a,n)%360,l=s(i,l,m-l,n),c=s(i,c,v-c,n),i=s(i,t,e-t,n),"hsla("+a+", "+l+"%, "+c+"%, "+i+")"}function xi(){function t(i,n,s,a,l,c){i.position=new G(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c))}var e=new ci;e.add("position:diagram",t),e.add("position",t),e.add("position:part",function(i,n,s,a,l,c){l<c?i.mm(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c),!1):i.position=new G(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c))}),e.add("location",function(i,n,s,a,l,c){l<c?i.mm(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c),!0):i.location=new G(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c))}),e.add("position:placeholder",function(i,n,s,a,l,c){l<c?i.mm(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c),!1):i.position=new G(a(l,n.x,s.x-n.x,c),a(l,n.y,s.y-n.y,c))}),e.add("position:nodeCollapse",function(i,n,s,a,l,c){var p=i.actualBounds,m=s.actualBounds;s=m.x+m.width/2-p.width/2,p=m.y+m.height/2-p.height/2,l<c?i.mm(a(l,n.x,s-n.x,c),a(l,n.y,p-n.y,c),!1):i.position=new G(a(l,n.x,s-n.x,c),a(l,n.y,p-n.y,c))}),e.add("desiredSize",function(i,n,s,a,l,c){i.desiredSize=new Tt(a(l,n.width,s.width-n.width,c),a(l,n.height,s.height-n.height,c))}),e.add("width",function(i,n,s,a,l,c){i.width=a(l,n,s-n,c)}),e.add("height",function(i,n,s,a,l,c){i.height=a(l,n,s-n,c)}),e.add("fill",function(i,n,s,a,l,c){i.fill=Be(n,s,l,c,a)}),e.add("stroke",function(i,n,s,a,l,c){i.stroke=Be(n,s,l,c,a)}),e.add("strokeWidth",function(i,n,s,a,l,c){i.strokeWidth=a(l,n,s-n,c)}),e.add("strokeDashOffset",function(i,n,s,a,l,c){i.strokeDashOffset=a(l,n,s-n,c)}),e.add("background",function(i,n,s,a,l,c){i.background=Be(n,s,l,c,a)}),e.add("areaBackground",function(i,n,s,a,l,c){i.areaBackground=Be(n,s,l,c,a)}),e.add("opacity",function(i,n,s,a,l,c){i.opacity=a(l,n,s-n,c)}),e.add("scale",function(i,n,s,a,l,c){i.scale=a(l,n,s-n,c)}),e.add("angle",function(i,n,s,a,l,c){i.angle=a(l,n,s-n,c)}),Oe=e}St.Object.defineProperties(Es.prototype,{animationReasons:{get:function(){return this.Zd}},isEnabled:{get:function(){return this.Jd},set:function(t){(this.Jd=t)&&this.Ei.each(function(e){e.isAnimating||e.runCount!==1/0||e.start()})}},duration:{get:function(){return this.Dg},set:function(t){1>t&&Re(t,">= 1",Es,"duration"),this.Dg=t}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(t){this.Gh=t}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(t){this.Pk=t}}}),Es.prototype.stopAnimation=Es.prototype.Cc;var Oe=null,wi=!1,ri=new he(Es,"Default",1),Mi=new he(Es,"AnimateLocations",2),Bi=new he(Es,"None",3);Es.className="AnimationManager",Es.defineAnimationEffect=function(t,e){wi||(xi(),wi=!0),Oe.add(t,e)},Es.Default=ri,Es.AnimateLocations=Mi,Es.None=Bi;function Li(t){this.vu=this.Nw=this.Yd=this.H=null,this.Xk=this.bc=this.j=!1,this.cn=this.Qd=0,this.Lp=this.ot=Qn,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=Wa,this.vc=new ci,this.Tt=new ci,this.yl=new te,this.Ut=new te,this.dw=Xl,t&&Object.assign(this,t)}Li.prototype.suspend=function(){this.Xk=!0},Li.prototype.advanceTo=function(t,e){e&&(this.Xk=!1),this.ho&&t>=this.Gd&&(this.Wk=!0,t-=this.Gd),this.gw=t,cn(this,!0),Xt(this.Yd),Rs(this.H),Ne(this.Yd),this.H.redraw()};function Ni(t,e){if(t.Tt.clear(),t.Wk=!1,t.au=0,t.Gd=NaN,0<t.yl.count&&t.yl.clear(),0<t.Ut.count&&t.Ut.clear(),e!==null)for(t=e.links;t.next();)t.value.Tg=null}L=Li.prototype,L.start=function(){if(this.vc.count===0||this.bc)return this;for(var t=this.H,e=this.vc.iterator;e.next();){var i=e.key;t===null&&(i instanceof Ct?t=i:i instanceof pt&&(t=i.diagram))}if(t!==null)this.H=t,this.Yd=t.animationManager;else return this;return e=this.Yd,e.isEnabled===!1?this:(this.Gd=isNaN(this.Dg)?e.duration:this.Dg,this.Lp=this.ot,e.Ok&&e.Pk===ri&&this===e.defaultAnimation&&(this.Lp=Xr,this.Gd=isNaN(this.Dg)?e.duration===600?900:e.duration:this.Dg),this.dw=t.scrollMode,this.isViewportUnconstrained&&(t.sj=Uh),Xt(e),this.yl.each(function(n){n.data=null,t.add(n)}),Ne(e),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,Dt(e,this),this)},L.Iy=function(t,e){return t.Zc()?(this.yl.add(t),this.H=e,this):this},L.add=function(t,e,i,n,s){if(e==="position"&&i.Xa(n))return this;if(this.H===null&&(t instanceof Ct?this.H=t:t instanceof pt&&t.diagram!==null&&(this.H=t.diagram)),t instanceof bi){if(!t.isAnimated)return this;e==="position"&&(e="position:part")}return Hi(this,t,e,i,n,s),this};function Hi(t,e,i,n,s,a){var l=t.vc;if(e instanceof Ct&&i==="position"&&(i="position:diagram"),(i==="fill"||i==="stroke"||i==="background"||i==="areaBackground")&&(Qf(n),$v(),n=[Xh.j,Xh.u,Xh.o,Xh.F],Qf(s),$v(),s=[Xh.j,Xh.u,Xh.o,Xh.F]),l.contains(e)){var c=l.I(e),p=c.start,m=c.end;p[i]===void 0&&(p[i]=Gn(n)),m[i]=Gn(s)}else p={},m={},p[i]=Gn(n),m[i]=Gn(s),c=p.position,e instanceof pt&&c instanceof G&&!c.w()&&e.diagram.animationManager.Zd.contains("Expand SubGraph")&&c.assign(m.position),c=new In(p,m,a),l.add(e,c);l=p[i],l instanceof G&&!l.w()&&l.assign(t.o),a&&i.indexOf("position:")===0&&e instanceof bi?c.Ku.location=Gn(e.location):a&&(c.Ku[i]=Gn(n))}function Gn(t){return t instanceof G||t instanceof fe?t.copy():t}L.fv=function(t){return this.bc?(t=this.vc.I(t),t!==null&&t.nv):!1},L.Xu=function(t){return this.bc?(t=this.vc.I(t),t!==null&&(t.start.position||t.start.location)):!1};function cn(t,e){if(!t.Xk||e){var i=t.Yd;if(t.bc!==!1){var n=+new Date,s=n>t.cn?t.Gd:n-t.Qd;e&&(s=t.gw,s<t.Gd?(t.Qd=+new Date-s,t.cn=t.Qd+t.Gd):s=t.Gd),Xt(i),ir(t,s),Rs(t.H,!0),Ne(i),n>t.cn&&(t.ho&&!t.Wk?(t.Qd=+new Date,t.cn=t.Qd+t.Gd,t.Wk=!0):t.Ml(!1))}}}function ir(t,e){for(var i=t.Gd,n=t.vc.iterator,s=t.Wk;n.next();){var a=n.key;if(!(a instanceof pt&&a.diagram===null)){var l=n.value,c=s?l.end:l.start;l=s?l.start:l.end;var p=Oe,m;for(m in l)m==="position"&&(l["position:placeholder"]||l["position:nodeCollapse"])||p.get(m)===null||p.get(m)(a,c[m],l[m],t.Lp,e,i,t)}}}L.stop=function(){return this.bc?(this.Ml(!0),this):this},L.Ml=function(t){if(this.vu!==null&&this.vu.jo.remove(this.Nw),this.bc){var e=this.H,i=this.Yd;this.Xk=this.bc=i.Ok=!1,Xt(i);for(var n=this.vc,s=this.yl.iterator;s.next();)e.remove(s.value);for(s=this.Ut.iterator;s.next();)s.value.v();s=this.ho,n=n.iterator;for(var a=Oe;n.next();){var l=n.key,c=n.value,p=s?c.end:c.start,m=s?c.start:c.end,v=c.Ku,w;for(w in m)if(a.get(w)!==null){var C=w;!c.Hu||C!=="position:nodeCollapse"&&C!=="position:placeholder"||(C="position"),a.get(C)(l,p[w],v[w]!==void 0?v[w]:c.Hu?p[w]:m[w],this.Lp,this.Gd,this.Gd,this)}c.Hu&&v.location!==void 0&&l instanceof bi&&(l.location=v.location),c.nv&&l instanceof bi&&l.Zb(!1)}if(e.As.clear(),so(e,!1),e.Ya(),e.N(),Rs(e,!0),i.defaultAnimation===this){for(w=i.pr.iterator;w.next();)s=w.value,s.Tg!==null&&(s.points=s.Tg,s.Tg=null);i.pr.clear()}Rs(e,!0),this.isViewportUnconstrained&&(e.scrollMode=this.dw),Ne(i),this.au++,!t&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Ni(this,null),i.Ml(this),e.$b())}},L.Cj=function(t,e){var i=e.actualBounds,n=null;if(e instanceof Yi&&(n=e.placeholder),n!==null?(i=n.ga(Fo),n=n.padding,i.x+=n.left,i.y+=n.top,this.add(t,"position",i,t.position,!1)):this.add(t,"position",new G(i.x+i.width/2,i.y+i.height/2),t.position,!1),this.add(t,"scale",.01,t.scale,!1),t instanceof Yi)for(t=t.memberParts;t.next();)n=t.value,n instanceof Ee&&this.Cj(n,e)},L.Aj=function(t,e){if(t.isVisible()){var i=null;if(e instanceof Yi&&(i=e.placeholder),i!==null){var n=i.ga(Fo);i=i.padding,n.x+=i.left,n.y+=i.top,this.add(t,"position:placeholder",t.position,n,!0)}else this.add(t,"position:nodeCollapse",t.position,e,!0);if(this.add(t,"scale",t.scale,.01,!0),n=this.vc,n.contains(t)&&(n.I(t).nv=!0),t instanceof Yi)for(t=t.memberParts;t.next();)n=t.value,n instanceof Ee&&this.Aj(n,e)}},L.Ez=function(t){var e=this.Tt.get(t);return e===null&&(e={},this.Tt.add(t,e)),e},St.Object.defineProperties(Li.prototype,{duration:{get:function(){return this.Dg},set:function(t){1>t&&Re(t,">= 1",Li,"duration"),this.Dg=t}},reversible:{get:function(){return this.ho},set:function(t){this.ho=t}},runCount:{get:function(){return this.cu},set:function(t){0<t?this.cu=t:Mt("Animation.runCount value must be a positive integer.")}},finished:{get:function(){return this.dn},set:function(t){this.dn!==t&&(this.dn=t)}},easing:{get:function(){return this.ot},set:function(t){this.ot=t}},isViewportUnconstrained:{get:function(){return this.j},set:function(t){this.j=t}},isAnimating:{get:function(){return this.bc}}}),Li.prototype.getTemporaryState=Li.prototype.Ez,Li.prototype.stop=Li.prototype.stop,Li.prototype.add=Li.prototype.add,Li.prototype.addTemporaryPart=Li.prototype.Iy;function Qn(t,e,i,n){return t/=n/2,1>t?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e}function Xr(t,e,i,n){return t===n?e+i:i*(-Math.pow(2,-10*t/n)+1)+e}Li.className="Animation",Li.EaseLinear=function(t,e,i,n){return i*t/n+e},Li.EaseInOutQuad=Qn,Li.EaseInQuad=function(t,e,i,n){return i*(t/=n)*t+e},Li.EaseOutQuad=function(t,e,i,n){return-i*(t/=n)*(t-2)+e},Li.EaseInExpo=function(t,e,i,n){return t===0?e:i*Math.pow(2,10*(t/n-1))+e},Li.EaseOutExpo=Xr;function In(t,e,i){this.start=t,this.end=e,this.Ku={},this.Hu=i,this.nv=!1}In.className="AnimationState";function nn(t,e,i){this.xd=null,this.rf=t,this.so=i||Kr,this.uk=null,e!==void 0&&(this.uk=e,i===void 0&&(this.so=gr))}nn.prototype.copy=function(){var t=new nn(this.rf);t.so=this.so;var e=this.uk;if(e!==null){var i={};e.duration!==void 0&&(i.duration=e.duration),e.finished!==void 0&&(i.finished=e.finished),e.easing!==void 0&&(i.easing=e.easing),t.uk=i}return t};function vo(t,e){t=t.uk,t!==null&&(t.duration&&(e.duration=t.duration),t.finished&&(e.finished=t.finished),t.easing&&(e.easing=t.easing))}St.Object.defineProperties(nn.prototype,{propertyName:{get:function(){return this.rf},set:function(t){this.rf=t}},animationSettings:{get:function(){return this.uk},set:function(t){this.uk=t}},startCondition:{get:function(){return this.so},set:function(t){this.so=t}}});var Kr=new he(nn,"Default",1),gr=new he(nn,"Immediate",2),kn=new he(nn,"Bundled",3);nn.className="AnimationTrigger",nn.Default=Kr,nn.Immediate=gr,nn.Bundled=kn;function ji(t){Do(this),this.H=null,this.Pa=new ue,this.xa="",this.pb=1,this.o=!1,this.j=this.Uh=this.u=this.Oi=this.Ni=this.Mi=this.Li=this.Ji=this.Ki=this.Ii=this.Qi=this.Hi=this.Pi=this.Gi=this.Fi=!0,this.Zq=[],t&&Object.assign(this,t)}L=ji.prototype,L.clear=function(){for(var t=this.Pa,e=0;e<t.length;e++){var i=t.s[e];i.Ig=null,su(i)}t.clear(),this.Zq.length=0},L.Xe=function(t){this.H=t},L.toString=function(t){t===void 0&&(t=0);var e='Layer "'+this.name+'"';if(0>=t)return e;for(var i=0,n=0,s=0,a=0,l=0,c=this.Pa.iterator;c.next();){var p=c.value;p instanceof Yi?s++:p instanceof Ee?n++:p instanceof ge?a++:p instanceof pr?l++:i++}if(c="",0<i&&(c+=i+" Parts "),0<n&&(c+=n+" Nodes "),0<s&&(c+=s+" Groups "),0<a&&(c+=a+" Links "),0<l&&(c+=l+" Adornments "),1<t)for(t=this.Pa.iterator;t.next();)i=t.value,c+=`
|
|
|
`+i.toString(),n=i.data,n!==null&&Io(n)&&(c+=" #"+Io(n)),i instanceof Ee?c+=" "+zr(n):i instanceof ge&&(c+=" "+zr(i.fromNode)+" "+zr(i.toNode));return e+" "+this.Pa.count+": "+c},L.ic=function(t,e,i){if(e===void 0&&(e=null),i===void 0&&(i=null),this.Uh===!1)return null;var n=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(t)&&(n=!0);for(var s=G.alloc(),a=this.Pa.s,l=a.length;l--;){var c=a[l];if((n!==!0||zd(c)!==!1)&&c.isVisible()&&(s.assign(t),ut(s,c.oe),c=c.ic(s,e,i),c!==null&&(e!==null&&(c=e(c)),c!==null&&(i===null||i(c)))))return G.free(s),c}return G.free(s),null},L.ji=function(t,e,i,n){if(e===void 0&&(e=null),i===void 0&&(i=null),n instanceof ue||n instanceof te||(n=new te),this.Uh===!1)return n;var s=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(t)&&(s=!0);for(var a=G.alloc(),l=this.Pa.s,c=l.length;c--;){var p=l[c];if((s!==!0||zd(p)!==!1)&&p.isVisible()){a.assign(t),ut(a,p.oe);var m=p;p.ji(a,e,i,n)&&(e!==null&&(m=e(m)),m===null||i!==null&&!i(m)||n.add(m))}}return G.free(a),n},L.Cf=function(t,e,i,n,s){if(e===void 0&&(e=null),i===void 0&&(i=null),n===void 0&&(n=!1),s instanceof ue||s instanceof te||(s=new te),this.Uh===!1)return s;var a=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(t)&&(a=!0);for(var l=this.Pa.s,c=l.length;c--;){var p=l[c];if((a!==!0||zd(p)!==!1)&&p.isVisible()){var m=p;p.Cf(t,e,i,n,s)&&(e!==null&&(m=e(m)),m===null||i!==null&&!i(m)||s.add(m))}}return s},L.Nu=function(t,e,i,n,s,a,l){if(this.Uh===!1)return s;for(var c=this.Pa.s,p=c.length;p--;){var m=c[p];if((l!==!0||zd(m)!==!1)&&a(m)&&m.isVisible()){var v=m;m.Cf(t,e,i,n,s)&&(e!==null&&(v=e(v)),v===null||i!==null&&!i(v)||s.add(v))}}return s},L.og=function(t,e,i,n,s,a){if(i===void 0&&(i=null),n===void 0&&(n=null),s===void 0&&(s=!0),s!==!1&&s!==!0&&((s instanceof ue||s instanceof te)&&(a=s),s=!0),a instanceof ue||a instanceof te||(a=new te),this.Uh===!1)return a;var l=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(t)&&(l=!0);for(var c=G.alloc(),p=G.alloc(),m=this.Pa.s,v=m.length;v--;){var w=m[v];if((l!==!0||zd(w)!==!1)&&w.isVisible()){c.assign(t),ut(c,w.oe),p.h(t.x+e,t.y),ut(p,w.oe);var C=w;w.og(c,p,i,n,s,a)&&(i!==null&&(C=i(C)),C===null||n!==null&&!n(C)||a.add(C))}}return G.free(c),G.free(p),a},L.Fd=function(t,e){if(this.visible){var i=this.Pa.s,n=i.length;if(n!==0){t=gi();for(var s=gi(),a=0;a<n;a++){var l=i[a];if(l.vw=a,l instanceof ge){if(l.fd===!1)continue}else if(l instanceof pr&&l.adornedPart!==null)continue;var c=l.actualBounds;l.isVisible()&&$s(c,e)?(l.Fd(!0),t.push(l)):(l.Fd(!1),l.adornments!==null&&0<l.adornments.count&&s.push(l))}for(e=0;e<t.length;e++)for(i=t[e],Fm(i),i=i.adornments;i.next();)n=i.value,n.measure(1/0,1/0),n.arrange(),n.Fd(!0);for(e=0;e<s.length;e++)Fm(s[e]);Ji(t),Ji(s)}}};function rn(t,e){var i=1;return t.pb!==1&&(i=e.globalAlpha,e.globalAlpha=i*t.pb),i}L.gc=function(t,e,i){if(this.visible&&this.pb!==0&&(i===void 0&&(i=!0),i||!this.isTemporary)){i=this.Pa.s;var n=i.length;if(n!==0){if(t.isTemporary)for(var s=0;s<n;s++)i[s].Gj();s=rn(this,t);var a=this.Zq;a.length=0;for(var l=e.scale,c=Tt.alloc(),p=0;p<n;p++)this.Oj(t,i[p],e,a,l,c,!0);if(Tt.free(c),t.isTemporary)for(e=0;e<n;e++)i[e].Gj();t.globalAlpha=s}}};function On(t,e,i,n,s){if(t.visible&&t.pb!==0&&(s||!t.isTemporary)){s=t.Pa.s;var a=s.length;if(a!==0){var l=rn(t,e),c=t.Zq;c.length=0;for(var p=i.scale,m=Tt.alloc(),v=0;v<a;v++){var w=s[v];n.contains(w)&&t.Oj(e,w,i,c,p,m,!1)}Tt.free(m),e.globalAlpha=l}}}L.Oj=function(t,e,i,n,s,a,l){if(l&&!zd(e))t.Hs(e);else{if(n!==null&&e instanceof ge&&(e.isOrthogonal&&n.push(e),e.fd===!1)){t.Hs(e);return}for(l=!1,n=e.containingGroup;n!==null;)l?n.tb!==null&&a.Ex(n.tb):n.tb!==null&&(l=!0,a.assign(n.tb)),n=n.containingGroup;var c=e.actualBounds;if(n=!1,l&&e.isVisible()){if(!a.Yc(c)){t.Hs(e);return}n=!a.Re(c)}n&&(t.save(),t instanceof Fu?t.bk=a.copy():(t.beginPath(),t.rect(a.x,a.y,a.width,a.height),t.clip())),c.width*s>i.Oq||c.height*s>i.Oq?e.gc(t,i):(s=e.actualBounds,a=e.naturalBounds,s.width===0||s.height===0||isNaN(s.x)||isNaN(s.y)||!e.isVisible()||(i=e.transform,e.areaBackground!==null&&(Gs(e,t,e.areaBackground,!0,!0,a,s),t.fillRect(s.x,s.y,s.width,s.height)),e.areaBackground===null&&e.background===null&&(Gs(e,t,"rgba(0,0,0,0.3)",!0,!1,a,s),t.fillRect(s.x,s.y,s.width,s.height)),e.background!==null&&(t.transform(i.m11,i.m12,i.m21,i.m22,i.dx,i.dy),Gs(e,t,e.background,!0,!1,a,s),t.fillRect(0,0,a.width/2,a.height/2),i.ws()||(e=1/(i.m11*i.m22-i.m12*i.m21),t.transform(i.m22*e,-i.m12*e,-i.m21*e,i.m11*e,e*(i.m21*i.dy-i.m22*i.dx),e*(i.m12*i.dx-i.m11*i.dy)))))),n&&(t.restore(),t.Vc(!0))}},L.g=function(t,e,i,n,s){var a=this.diagram;a!==null&&a.cb(us,t,this,e,i,n,s)},L.oi=function(t,e,i){var n=this.Pa;if(e.Ig=this,this===null&&su(e),t>=n.count)t=n.count;else if(n.M(t)===e)return-1;return n.Gb(t,e),e.Vo(i),n=this.diagram,n!==null&&(i?n.N():n.oi(e)),tr(this,t,e),t},L.pc=function(t,e,i){if(!i&&e.layer!==this&&e.layer!==null)return e.layer.pc(t,e,i);var n=this.Pa;if(0>t||t>=n.length){if(t=n.indexOf(e),0>t)return-1}else if(n.M(t)!==e&&(t=n.indexOf(e),0>t))return-1;return e.Wo(i),n.mb(t),n=this.diagram,n!==null&&(i?n.N():n.pc(e)),e.Ig=null,su(e),t};function tr(t,e,i){if(e=Ws(t,e,i),i instanceof Yi&&i!==null&&isNaN(i.zOrder)){if(i.memberParts.count!==0){for(var n=-1,s=t.Pa.s,a=s.length,l=0;l<a;l++){var c=s[l];if(c===i&&(e=l,0<=n)||0>n&&c.containingGroup===i&&(n=l,0<=e))break}!(0>n)&&n<e&&(s=t.Pa,s.mb(e),s.Gb(n,i))}e=i.containingGroup,e!==null&&tr(t,-1,e)}i.svg!==null&&i.svg.remove()}function Ws(t,e,i){var n=i.zOrder;if(isNaN(n))return e;t=t.Pa;var s=t.count;if(1>=s)return e;if(0>e&&(e=t.indexOf(i)),0>e)return-1;for(var a=e-1,l=NaN;0<=a&&(l=t.M(a).zOrder,!!isNaN(l));)a--;for(var c=e+1,p=NaN;c<s&&(p=t.M(c).zOrder,!!isNaN(p));)c++;if(!isNaN(l)&&l>n)for(;;){if(a===-1||l<=n){if(a++,a===e)break;return t.mb(e),t.Gb(a,i),a}for(l=NaN;0<=--a&&(l=t.M(a).zOrder,isNaN(l)););}else if(!isNaN(p)&&p<n)for(;;){if(c===s||p>=n){if(c--,c===e)break;return t.mb(e),t.Gb(c,i),c}for(p=NaN;++c<s&&(p=t.M(c).zOrder,isNaN(p)););}return e}St.Object.defineProperties(ji.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(t){var e=this.xa;if(e!==t){var i=this.diagram;if(i!==null)for(e===""&&Mt("Cannot rename default Layer to: "+t),i=i.layers;i.next();)i.value.name===t&&Mt("Layer.name is already present in this diagram: "+t);for(this.xa=t,this.g("name",e,t),t=this.Pa.iterator;t.next();)t.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(t){var e=this.pb;e!==t&&((0>t||1<t)&&Re(t,"0 <= value <= 1",ji,"opacity"),this.pb=t,this.g("opacity",e,t),t=this.diagram,t!==null&&t.N())}},isTemporary:{get:function(){return this.o},set:function(t){var e=this.o;e!==t&&((this.o=t)&&(this.isInDocumentBounds=!1),this.g("isTemporary",e,t))}},visible:{get:function(){return this.u},set:function(t){var e=this.u;if(e!==t){for(this.u=t,this.g("visible",e,t),e=this.Pa.iterator;e.next();)e.value.Zb(t);t=this.diagram,t!==null&&t.N()}}},pickable:{get:function(){return this.Uh},set:function(t){var e=this.Uh;e!==t&&(this.Uh=t,this.g("pickable",e,t))}},isInDocumentBounds:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.diagram!==null&&this.diagram.Ya())}},allowCopy:{get:function(){return this.Fi},set:function(t){var e=this.Fi;e!==t&&(this.Fi=t,this.g("allowCopy",e,t))}},allowDelete:{get:function(){return this.Gi},set:function(t){var e=this.Gi;e!==t&&(this.Gi=t,this.g("allowDelete",e,t))}},allowTextEdit:{get:function(){return this.Pi},set:function(t){var e=this.Pi;e!==t&&(this.Pi=t,this.g("allowTextEdit",e,t))}},allowGroup:{get:function(){return this.Hi},set:function(t){var e=this.Hi;e!==t&&(this.Hi=t,this.g("allowGroup",e,t))}},allowUngroup:{get:function(){return this.Qi},set:function(t){var e=this.Qi;e!==t&&(this.Qi=t,this.g("allowUngroup",e,t))}},allowLink:{get:function(){return this.Ii},set:function(t){var e=this.Ii;e!==t&&(this.Ii=t,this.g("allowLink",e,t))}},allowRelink:{get:function(){return this.Ki},set:function(t){var e=this.Ki;e!==t&&(this.Ki=t,this.g("allowRelink",e,t))}},allowMove:{get:function(){return this.Ji},set:function(t){var e=this.Ji;e!==t&&(this.Ji=t,this.g("allowMove",e,t))}},allowReshape:{get:function(){return this.Li},set:function(t){var e=this.Li;e!==t&&(this.Li=t,this.g("allowReshape",e,t))}},allowResize:{get:function(){return this.Mi},set:function(t){var e=this.Mi;e!==t&&(this.Mi=t,this.g("allowResize",e,t))}},allowRotate:{get:function(){return this.Ni},set:function(t){var e=this.Ni;e!==t&&(this.Ni=t,this.g("allowRotate",e,t))}},allowSelect:{get:function(){return this.Oi},set:function(t){var e=this.Oi;e!==t&&(this.Oi=t,this.g("allowSelect",e,t))}}}),ji.prototype.findObjectsNear=ji.prototype.og,ji.prototype.findObjectsIn=ji.prototype.Cf,ji.prototype.findObjectsAt=ji.prototype.ji,ji.prototype.findObjectAt=ji.prototype.ic,ji.className="Layer";function Ct(t,e){if(Qc||(Ka(),Qc=!0),Do(this),Mn=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,ur){var i=this,n=function(){i.removeEventListener(Kt.document,"DOMContentLoaded",n,!1),i.setRTL()};Kt.document.body!==null?this.setRTL():i.addEventListener(Kt.document,"DOMContentLoaded",n,!1)}this.ol=null,Tc.add("Model",Dr);var s=this;return this.Hb=function(a){var l=s.partManager;if(a.model===l.diagram.model&&l.diagram.aa){l.diagram.aa=!1;try{var c=a.change;a.modelChange===""&&c===us&&l.updateDataBindings(a.object,a.propertyName)}finally{l.diagram.aa=!0}}},this.Oc=function(a){s.partManager.doModelChanged(a)},this.hu=this.ku=null,jn(this),this.model=eg(),this.Wg=!0,No(this),this.layout=new hs,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new Zh,t!==void 0&&(typeof t=="string"||Kt.Element&&t instanceof Element?Pn(this,t):e=t),this.vb=!1,e&&this.nm(e),this}var _o,Mn;function jn(t){t.Yd=new Es,t.Yd.Xe(t),t.Db=17,t.Gw=!1,t.tn=!1,t.bu="default",t.Wa=new ue,t.pj=new ci,t.nl="default",t.Tx(),t.Sx(),t.pb=1,t.pa=new G(NaN,NaN).freeze(),t.du=new G(NaN,NaN),t.Ca=1,t.Pp=1,t.zt=new G(NaN,NaN).freeze(),t.At=NaN,t.Ot=1e-4,t.Mt=100,t.Ab=new dn,t.zu=new G(NaN,NaN).freeze(),t.ut=new Tt(NaN,NaN,NaN,NaN).freeze(),t.rj=new Ai(0,0,0,0).freeze(),t.sj=Xl,t.nu=!1,t.Zt=null,t.fu=null,t.yh=xa,t.zk=ds,t.Fg=xa,t.pq=ds,t.yt=Fo,t.Bt=Fo,t.Fc=!0,t.pn=!1,t.De=new te,t.Eh=new ci,t.Xm=!0,t.vp=250,t.vk=-1,t.xp=new Ai(16,16,16,16).freeze(),t.kg=!1,t.Jk=!1,t.fn=!0,t.bq=new _s,t.bq.diagram=t,t.Qg=new _s,t.Qg.diagram=t,t.cj=new _s,t.cj.diagram=t,t.zg=null,t.pf=null,t.qu=!1,Nf(t),t.ai=new te,t.Ht=!0,t.uu=Ru,t.pw=!1,t.wu=Uo,t.it="auto",t.Op="auto",t.zh=null,t.Fh=null,t.Bh=null,t.Qh=null,t.Oh=null,t.Nh=null,t.Qt=null,t.Lh=null,t.xt=!1,t.Mh=null,t.Ph=null,t.$h=null,t.Ch=null,t.Rt=!1,t.Yt={},t.oj=[null,null],t.Wg=!1,t.Iw=!1,t.ou=!1,t.lt=!1,t.rw=!0,t.ld=!1,t.$i=!1,t.Tw=!0,t.Ce=-2,t.Og=new ci,t.Xn=new ue,t.Gg=!1,t.Jd=!0,t.Us=!0,t.Fi=!0,t.Gi=!0,t.Vs=!1,t.Ws=!0,t.Pi=!0,t.Hi=!0,t.Qi=!0,t.Ys=!0,t.Ii=!0,t.Ki=!0,t.Ji=!0,t.Li=!0,t.Mi=!0,t.Ni=!0,t.Oi=!0,t.Zs=!0,t.at=!0,t.qw=!1,t.Vk=!1,t.mn=!0,t.nn=!0,t.Xs=!0,t.$s=!0,t.iu=16,t.mu=16,t.qr=!1,t.gu=!1,t.lu=0,t.ju=0,t.yb=new Ai(5).freeze(),t.Hw=new te().freeze(),t.Nt=999999999,t.nw=new te().freeze(),t.Zi=!0,t.Ee=!0,t.vd=!0,t.Be=!1,t.gf=!1,t.xh=!0,t.hf=!1,t.sy=new te,t.ow=new te,t.Xh=null,t.aw=new fe(8,8),t.bw=999,t.Bw=1,t.Jw=0,t.fc={scale:1,position:new G,bounds:new Tt,Py:new fe,bA:new fe,Oz:!1},t.fc.canvasSize=t.fc.Py,t.fc.newCanvasSize=t.fc.bA,t.fc.isScroll=!1,t.Rw=new Tt(NaN,NaN,NaN,NaN).freeze(),t.wo=new fe(NaN,NaN).freeze(),t.Sp=new Tt(NaN,NaN,NaN,NaN).freeze(),t.It=!1,t.Lg=new ci;var e=new Ee,i=new ao;i.bind(new lo("text","",zr)),e.add(i),t.ny=e,t.Lg.add("",e),e=new Ee,i=new ao,i.stroke="brown",i.bind(new lo("text","",zr)),e.add(i),t.Lg.add("Comment",e),e=new Ee,e.selectable=!1,e.avoidable=!1,i=new pn,i.figure="Ellipse",i.fill="black",i.stroke=null,i.desiredSize=new fe(3,3).ja(),e.add(i),t.Lg.add("LinkLabel",e),t.Yi=new ci,e=new Yi,e.selectionObjectName="GROUPPANEL",e.type=ce.Vertical,i=new ao,i.font="bold 12pt sans-serif",i.bind(new lo("text","",zr)),e.add(i),i=new ce(ce.Auto),i.name="GROUPPANEL";var n=new pn;n.figure="Rectangle",n.fill="rgba(128,128,128,0.2)",n.stroke="black",i.add(n),n=new Wu,n.padding=new Ai(5,5,5,5).ja(),i.add(n),e.add(i),t.ly=e,t.Yi.add("",e),t.Kh=new ci,e=new ge,i=new pn,i.isPanelMain=!0,e.add(i),i=new pn,i.toArrow="Standard",i.fill="black",i.stroke=null,i.strokeWidth=0,e.add(i),t.my=e,t.Kh.add("",e),e=new ge,i=new pn,i.isPanelMain=!0,i.stroke="brown",e.add(i),t.Kh.add("Comment",e),e=new pr,e.type=ce.Auto,i=new pn,i.fill=null,i.stroke="dodgerblue",i.strokeWidth=3,e.add(i),i=new Wu,i.margin=new Ai(1.5,1.5,1.5,1.5).ja(),e.add(i),t.St=e,t.wt=e,e=new pr,e.type=ce.Link,i=new pn,i.isPanelMain=!0,i.fill=null,i.stroke="dodgerblue",i.strokeWidth=3,e.add(i),t.Kt=e,t.fe=null,t.mq=!1,t.Ck=null,t.partManager=new Dr,t.toolManager=new Rr,t.toolManager.initializeStandardTools(),t.defaultTool=t.toolManager,t.currentTool=t.defaultTool,t.nt=null,t.Wm=new d,t.Vt=null,t.Wt=null,t.Mr=!1,t.commandHandler=Ea(),t.eq=null,t.fq=iu,t.Pw=!1,t.Mb=1,t.Yh=null,t.Oq=1,t.Sq=0,t.zw=[0,0,0,0,0],t.Tq=0,t.yq=1,t.tw=0,t.uw=new G,t.zy=500,t.wp=new G,t.wq=!1}Ct.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Ih=null,vh="",ws(this,!1),this.Xn.clear(),W0(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function ws(t,e){t.animationManager.Cc(!0),t.Hw=new te().freeze(),t.nw=new te().freeze();var i=t.skipsUndoManager,n=t.cc!==null&&t.cc!==void 0;n&&(t.skipsUndoManager=!0);var s=null;t.fe!==null&&(s=t.fe.part,s!==null&&t.remove(s));var a=[],l=t.Wa.length;if(e){for(e=0;e<l;e++)for(var c=t.Wa.s[e].parts;c.next();){var p=c.value;p!==s&&p.data===null&&a.push(p)}for(e=0;e<a.length;e++)t.remove(a[e])}for(e=0;e<l;e++)t.Wa.s[e].clear();return t.partManager.clear(),t.De.clear(),t.Eh.clear(),t.ai.clear(),t.Ck=null,t.Xn.clear(),W0(),t.Og.clear(),bo=[],s!==null&&(t.add(s),t.partManager.parts.remove(s)),n&&(t.skipsUndoManager=i),a}function Ea(){return null}Ct.prototype.reset=function(){this.clear(),this.vb=!0,jn(this),Ds(this),this.Wg=!0,No(this),this.layout=new hs,this.Wg=!1,this.model=eg(),this.model.undoManager=new ms,this.vb=this.rn=!1,this.N()},Ct.prototype.setRTL=function(t){t=t===void 0?this.div:t,t===null&&(t=Kt.document.body);var e=we("div");e.dir="rtl",e.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",e.textContent="A",t.appendChild(e);var i="reverse";0<e.scrollLeft?i="default":(e.scrollLeft=1,e.scrollLeft===0&&(i="negative")),t.removeChild(e),this.bu=i},Ct.prototype.setScrollWidth=function(t){t=t===void 0?this.div:t,t===null&&(t=Kt.document.body);var e=0;if(ur){var i=qc;e=_o,i===null&&(i=qc=we("p"),i.style.width="100%",i.style.height="200px",i.style.boxSizing="content-box",e=_o=we("div"),e.style.position="absolute",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.boxSizing="content-box",e.appendChild(i)),e.style.overflow="hidden",t.appendChild(e);var n=i.offsetWidth;e.style.overflow="scroll",i=i.offsetWidth,n===i&&(i=e.clientWidth),t.removeChild(e),e=n-i,e!==0||qr||(e=11)}this.Db=e,this.Gw=!0},Ct.prototype.qb=function(t){t.classType===Ct&&(this.autoScale=t)},Ct.prototype.toString=function(t){t===void 0&&(t=0);var e="";if(this.div&&this.div.id&&(e=this.div.id),e='Diagram "'+e+'"',0>=t)return e;for(var i=this.Wa.iterator;i.next();)e+=`
|
|
|
`+i.value.toString(t-1);return e};function Pn(t,e){if(ur){if(e!=null||Mt("Diagram setup requires an argument DIV."),t.Ka!==null&&Mt("Diagram has already completed setup."),typeof e=="string"?t.Ka=Kt.document.getElementById(e):e instanceof HTMLDivElement?t.Ka=e:Mt("No DIV or DIV id supplied: "+e),t.Ka===null&&Mt("Invalid DIV id; could not get element with id: "+e),t.Ka.H!==void 0&&Mt("Invalid div id; div already has a Diagram associated with it."),!t.ol&&Kt.ResizeObserver){var i=me(function(){t.$b()},250);t.ol=new Kt.ResizeObserver(function(){i()}),t.ol.observe(t.Ka)}Kt.getComputedStyle(t.Ka,null).position==="static"&&(t.Ka.style.position="relative"),e=5;var n="rgba(2"+e+"5, 255, 255, 0)";e--,t.Ka.style["-webkit-tap-highlight-color"]=n,t.Ka.innerHTML="",t.Ka.H=t,t.Ka.goDiagram=t,t.Ka.go=Kt.go;var s=new Pc(t);if(s.style!==void 0&&(s.style.position="absolute",s.style.top="0px",s.style.left="0px",Kt.getComputedStyle(t.Ka,null).getPropertyValue("direction")==="rtl"&&(t.tn=!0),s.style.zIndex="2",s.style.userSelect="none",s.style.MozUserSelect="none",s.style.touchAction="none",s.style.letterSpacing="normal !important",s.style.wordSpacing="normal !important"),t.ta=s,t.ib=s.context,n=t.ib,t.Mb=t.computePixelRatio(),t.viewSize.w()||(t.Aa=t.Ka.clientWidth||1,t.ya=t.Ka.clientHeight||1),Yu(t,t.Aa,t.ya),t.Ka.insertBefore(s.Oa,t.Ka.firstChild),s=new Pc(null),s.width=1,s.height=1,t.jw=s,t.oy=s.context,ur){s=we("div");var a=we("div");s.style.position="absolute",s.style.overflow="auto",s.style.width=t.Aa+"px",s.style.height=t.ya+"px",s.style.zIndex="1",a.style.position="absolute",a.style.width="1px",a.style.height="1px",t.Ka.appendChild(s),s.appendChild(a),s.onscroll=Mo,s.addEventListener("pointerdown",qo),s.H=t,s.uy=!0,s.vy=!0,t.ku=s,t.hu=a}t.hk=me(function(){t.Yh=null,t.N()},300),t.Ov=me(function(){Po(t)},250),t.preventDefault=function(l){return l.preventDefault(),!1},t.$j=function(l){if(t.isEnabled){var c=Gr(t,l,!0);c.bubbles=!0;var p=0,m=0;c.delta=0,l.deltaX!==void 0?(l.deltaX!==0&&(p=0<l.deltaX?1:-1),l.deltaY!==0&&(m=0<l.deltaY?1:-1),c.delta=Math.abs(l.deltaX)>Math.abs(l.deltaY)?-p:-m):l.wheelDeltaX!==void 0?(l.wheelDeltaX!==0&&(p=0<l.wheelDeltaX?-1:1),l.wheelDeltaY!==0&&(m=0<l.wheelDeltaY?-1:1),c.delta=Math.abs(l.wheelDeltaX)>Math.abs(l.wheelDeltaY)?-p:-m):l.wheelDelta!==void 0&&l.wheelDelta!==0&&(c.delta=0<l.wheelDelta?1:-1),t.doMouseWheel(),bs(c,l)}},t.aA=function(l){t.isEnabled&&(t.Vk=!1,Gr(t,l,!0),l=t.currentTool,l.cancelWaitAfter(),l.standardMouseOver())},t.ui=function(l){if(t.isEnabled){t.Vk=!0;var c=t.Yt;c[l.pointerId]===void 0&&(c[l.pointerId]=l),c=t.oj;var p=!1;if(c[0]===null||c[0].pointerId!==l.pointerId&&c[0].pointerType===l.pointerType)if(c[1]!==null&&c[1].pointerId===l.pointerId)c[1]=l,p=!0;else if(c[0]===null)c[0]=l;else if(c[1]===null)c[1]=l,p=!0;else{l.preventDefault();return}else c[0]=l;(c=l.pointerType==="touch"||l.pointerType==="pen")&&(t.qu=!1,t.wq=!0);var m=p;p=Qo(t,l,!0,!1,!0,m),ua(t,l,p),p.targetDiagram=ma(l,l.target),p.targetObject=null,m||p.clone(t.bq),m=t.uw,c=c?25:10,l.timeStamp-t.tw<t.zy&&!(Math.abs(m.x-l.screenX)>c||Math.abs(m.y-l.screenY)>c)?t.yq++:t.yq=1,p.clickCount=t.yq,t.tw=l.timeStamp,t.uw.sg(l.screenX,l.screenY),t.doMouseDown(),l.button===1?l.preventDefault():bs(p,l)}},t.dk=function(l){if(t.isEnabled){t.Vk=!0;var c=t.oj;if(c[0]===null||c[0].pointerId!==l.pointerId&&c[0].pointerType===l.pointerType){if(c[1]!==null&&c[1].pointerId===l.pointerId){c[1]=l;return}if(c[0]===null)c[0]=l;else return}else c[0]=l;if(c[0].pointerId===l.pointerId){c=Qo(t,l,!1,!1,!1,c[1]!==null);var p=Kt.document.elementFromPoint(l.clientX,l.clientY)||null;p!==null&&p.shadowRoot!==void 0&&p.shadowRoot!==null&&(p=p.shadowRoot.elementFromPoint(l.clientX,l.clientY));var m=t,v=l;p&&p.H&&(v=l,m=p.H),c.targetDiagram=m,ua(t,v,c),c.targetObject=null,t.doMouseMove(),bs(c,l)}}},t.fk=function(l){if(t.isEnabled){t.Vk=!0;var c=l.pointerType==="touch"||l.pointerType==="pen",p=t.Yt;if(c&&t.qu)delete p[l.pointerId],l.preventDefault();else if(p=t.oj,p[0]===null||p[0].pointerId!==l.pointerId&&p[0].pointerType===l.pointerType)p[1]!==null&&p[1].pointerId===l.pointerId&&(p[1]=null);else{p[0]=null,p=Qo(t,l,!1,!0,!0,!1);var m=Kt.document.elementFromPoint(l.clientX,l.clientY)||null;m!==null&&m.shadowRoot!==void 0&&m.shadowRoot!==null&&(m=m.shadowRoot.elementFromPoint(l.clientX,l.clientY)),m!==null&&m.H instanceof Ct&&m.H!==t&&ua(m.H,l,p),m===null&&(m=l.target),ua(t,l,p),p.clickCount=t.yq,p.targetDiagram=ma(l,m),p.targetObject=null,t.doMouseUp(),bs(p,l),c&&(t.wq=!1)}}},t.ek=function(l){if(t.isEnabled){t.Vk=!1;var c=t.Yt;c[l.pointerId]&&delete c[l.pointerId],c=t.oj,c[0]!==null&&c[0].pointerId===l.pointerId&&(c[0]=null),c[1]!==null&&c[1].pointerId===l.pointerId&&(c[1]=null),l.pointerType!=="touch"&&l.pointerType!=="pen"&&(l=t.currentTool,l.cancelWaitAfter(),l.standardMouseOver())}},t.ck=function(l){var c=t.oj;c[0]!==null&&c[0].pointerId===l.pointerId?(c[0]=null,t.wq=!1):c[1]!==null&&c[1].pointerId===l.pointerId&&(c[1]=null)},t.Vp=n.Z["d"+qu[1]+qu[2]+"wI"+Of.slice(1,5)]["b"+xx.slice(1,e)](n.Z,yh,e,e),n.Vc(!0),vn(t),t.nl==="svg"&&(e=t.pj.get("svg"),t.Ka.appendChild(e.Oa),t.ib=e.context)}}Ct.prototype.addEventListener=function(t,e,i,n){t.addEventListener(e,i,{capture:n,passive:!1})},Ct.prototype.removeEventListener=function(t,e,i,n){t.removeEventListener(e,i,{capture:n})};function vn(t){var e=t.ta.Oa;e instanceof HTMLCanvasElement||(e=t.div),t.addEventListener(e,"pointerdown",t.ui,!1),t.addEventListener(e,"pointermove",t.dk,!1),t.addEventListener(e,"pointerup",t.fk,!1),t.addEventListener(e,"pointerout",t.ek,!1),t.addEventListener(e,"pointercancel",t.ck,!1),t.addEventListener(e,"pointerenter",t.bz,!1),t.addEventListener(e,"pointerleave",t.cz,!1),t.addEventListener(e,"wheel",t.$j,!1),t.addEventListener(e,"keydown",t.Qz,!1),t.addEventListener(e,"keyup",t.Rz,!1),t.addEventListener(e,"blur",t.Ny,!1),t.addEventListener(e,"focus",t.Oy,!1),t.addEventListener(e,"selectstart",function(i){return i.preventDefault(),!1},!1),t.addEventListener(e,"contextmenu",function(i){return i.preventDefault(),!1},!1),t.addEventListener(Kt,"resize",t.Ov,!1)}function tn(t){30<t.Sq&&(t.Yh=1)}function so(t,e){t.Yh!==null&&(t.Yh=null,e&&t.hk(),Ma&&Ma.nx||(t.Sq=0,t.zw=[0,0,0,0,0],t.Tq=0))}Ct.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:Kt.devicePixelRatio||1},Ct.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},Ct.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},Ct.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},Ct.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},Ct.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},Ct.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},Ct.prototype.doFocus=function(){this.focus()},Ct.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var t=Kt.scrollX||Kt.pageXOffset,e=Kt.scrollY||Kt.pageYOffset;this.ta.focus(),Kt.scrollTo(t,e)}},Ct.prototype.Oy=function(){this.H.R("GainedFocus")},Ct.prototype.Ny=function(){this.H.R("LostFocus")};function Po(t){if(t.ta!==null){var e=t.Ka;if(e!==null&&e.clientWidth!==0&&e.clientHeight!==0){t.Gw||t.setScrollWidth();var i=t.gf?t.Db:0,n=t.Be?t.Db:0,s=t.Mb;t.Mb=t.computePixelRatio(),t.Mb!==s&&(t.pn=!0,t.$b()),(e.clientWidth!==t.Aa+i||e.clientHeight!==t.ya+n)&&(t.Ee=!0,t.Fc=!0,e=t.layout,e!==null&&e.isViewportSized&&t.autoScale===xa&&(t.Jk=!0,e.C()),t.ld||t.$b())}}}function No(t){var e=new ji;e.name="Background",t.Al(e),e=new ji,e.name="",t.Al(e),e=new ji,e.name="Foreground",t.Al(e),e=new ji,e.name="Adornment",e.isTemporary=!0,e.isInDocumentBounds=!1,t.Al(e),e=new ji,e.name="Tool",e.isTemporary=!0,e.isInDocumentBounds=!0,t.Al(e),e=new ji,e.name="Grid",e.allowSelect=!1,e.pickable=!1,e.isTemporary=!0,e.isInDocumentBounds=!1,t.Ww(e,t.Qj("Background"))}function ar(t){var e=new ce(ce.Grid);e.name="GRID";var i=new pn;return i.figure="LineH",i.stroke="lightgray",i.strokeWidth=.5,i.interval=1,e.add(i),i=new pn,i.figure="LineH",i.stroke="gray",i.strokeWidth=.5,i.interval=5,e.add(i),i=new pn,i.figure="LineH",i.stroke="gray",i.strokeWidth=1,i.interval=10,e.add(i),i=new pn,i.figure="LineV",i.stroke="lightgray",i.strokeWidth=.5,i.interval=1,e.add(i),i=new pn,i.figure="LineV",i.stroke="gray",i.strokeWidth=.5,i.interval=5,e.add(i),i=new pn,i.figure="LineV",i.stroke="gray",i.strokeWidth=1,i.interval=10,e.add(i),i=new bi,i.add(e),i.layerName="Grid",i.zOrder=0,i.isInDocumentBounds=!1,i.isAnimated=!1,i.pickable=!1,i.locationObjectName="GRID",t.add(i),t.partManager.parts.remove(i),e.visible=!1,e}function Mo(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):Ts(this.H)}function qo(t){this.H.isEnabled?(this.H.lu=t.target.scrollTop,this.H.ju=t.target.scrollLeft):Ts(this.H)}Ct.prototype.kx=function(t){if(this.ta!==null){var e=this.ku,i=this.hu;this.qr=!0;var n=this.documentBounds,s=this.viewportBounds,a=this.rj,l=n.x-a.left,c=n.y-a.top,p=n.width+a.left+a.right,m=n.height+a.top+a.bottom,v=n.right+a.right;a=n.bottom+a.bottom;var w=s.x;n=s.y;var C=s.width,k=s.height,T=s.right,A=s.bottom;s=this.scale;var X=t.scrollLeft;if(this.tn)switch(this.bu){case"negative":X=X+t.scrollWidth-t.clientWidth;break;case"reverse":X=t.scrollWidth-X-t.clientWidth}var $=X;C<p||k<m?(X=G.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==$&&(X.x=$/s+l,this.ju=$),this.allowVerticalScroll&&this.lu!==t.scrollTop&&(X.y=t.scrollTop/s+c,this.lu=t.scrollTop),this.position=X,G.free(X),this.Ee=this.qr=!1):(X=G.alloc(),t.uy&&this.allowHorizontalScroll&&(l<w&&(this.position=X.h($+l,this.position.y)),v>T&&(this.position=X.h(-(e.scrollWidth-this.Aa)+$-this.Aa/s+v,this.position.y))),t.vy&&this.allowVerticalScroll&&(c<n&&(this.position=X.h(this.position.x,t.scrollTop+c)),a>A&&(this.position=X.h(this.position.x,-(e.scrollHeight-this.ya)+t.scrollTop-this.ya/s+a))),G.free(X),this.vd=!0,this.Ee=this.qr=!1,n=this.documentBounds,s=this.viewportBounds,v=n.right,T=s.right,a=n.bottom,A=s.bottom,l=n.x,w=s.x,c=n.y,n=s.y,C>=p&&l>=w&&v<=T&&(i.style.width="1px"),k>=m&&c>=n&&a<=A&&(i.style.height="1px"))}},Ct.prototype.computeBounds=function(t){return t===void 0&&(t=new Tt),Vo(this),Je(this,t)};function Je(t,e){if(t.fixedBounds.w())return e.assign(t.fixedBounds),e.Co(t.yb),e;for(var i=!0,n=t.Wa.s,s=n.length,a=0;a<s;a++){var l=n[a];if(l.visible&&l.isInDocumentBounds){l=l.Pa.s;for(var c=l.length,p=0;p<c;p++){var m=l[p];m.isInDocumentBounds&&m.isVisible()&&(m=m.actualBounds,m.w()&&(i?(i=!1,e.assign(m)):e.ed(m)))}}}return i&&e.h(0,0,0,0),e.Co(t.yb),e}Ct.prototype.computePartsBounds=function(t,e){e===void 0&&(e=!1);var i=null;if(ui(t))for(var n=0;n<t.length;n++){var s=t[n];!e&&s instanceof ge||(s.Va(),i===null?i=s.actualBounds.copy():i.ed(s.actualBounds))}else for(t=t.iterator;t.next();)n=t.value,!e&&n instanceof ge||(n.Va(),i===null?i=n.actualBounds.copy():i.ed(n.actualBounds));return i===null?new Tt(NaN,NaN,0,0):i};function br(t,e){if((e||t.hf)&&!t.vb&&t.ta!==null&&t.documentBounds.w()){if(t.vb=!0,e){var i=t.initialPosition;if(i.w()){t.vb=!1,t.position=i;return}i=G.alloc(),i.xi(t.documentBounds,t.initialDocumentSpot);var n=t.viewportBounds;n=Tt.allocAt(0,0,n.width,n.height);var s=G.alloc();s.xi(n,t.initialViewportSpot),s.h(i.x-s.x,i.y-s.y),t.position=s,Tt.free(n),G.free(s),G.free(i)}i=t.yh,e&&t.Fg!==xa&&(i=t.Fg);var a=i!==xa?wn(t,i):t.scale;i=t.pa.x,n=t.pa.y,s=t.Aa/a;var l=t.ya/a,c=t.zk,p=t.pq;e&&!c.sb()&&(p.sb()||p.Xb())&&(c=p.Xb()?_n:p),lr(t,t.documentBounds,s,l,c,e),e=t.scale,t.scale=a,t.vb=!1,a=t.viewportBounds,xt.B(a.x,i)&&xt.B(a.y,n)&&xt.B(a.width,s)&&xt.B(a.height,l)||t.onViewportBoundsChanged(new Tt(i,n,s,l),a,e,!1)}}function wn(t,e){var i=t.Pp;if(t.ta===null)return i;t.Va();var n=t.documentBounds;if(!n.w())return i;var s=n.width;n=n.height;var a=t.Aa+(t.gf?t.Db:0),l=t.ya+(t.Be?t.Db:0),c=a/s,p=l/n;return e===Ul?(e=Math.min(p,c),e>i&&(e=i),e<t.minScale&&(e=t.minScale),e>t.maxScale&&(e=t.maxScale),e):e===Iu?(e=p>c?(l-t.Db)/n:(a-t.Db)/s,e>i&&(e=i),e<t.minScale&&(e=t.minScale),e>t.maxScale&&(e=t.maxScale),e):t.scale}Ct.prototype.zoomToFit=function(){var t=this.sj;this.sj=Xl,this.scale=wn(this,Ul),t!==Xl&&(br(this,!1),lr(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=t},L=Ct.prototype,L.BA=function(t,e){e===void 0&&(e=Ul);var i=t.width,n=t.height;if(!(i===0||n===0||isNaN(i)&&isNaN(n))){var s=1;if(e===Ul||e===Iu)if(isNaN(i))s=this.viewportBounds.height*this.scale/n;else if(isNaN(n))s=this.viewportBounds.width*this.scale/i;else{s=this.Aa;var a=this.ya;s=e===Iu?a/n>s/i?(a-(this.Be?this.Db:0))/n:(s-(this.gf?this.Db:0))/i:Math.min(a/n,s/i)}this.scale=s,this.position=new G(t.x,t.y)}},L.Jy=function(t,e){this.Va();var i=this.documentBounds,n=this.viewportBounds;this.position=new G(i.x+(t.x*i.width+t.offsetX)-(e.x*n.width-e.offsetX),i.y+(t.y*i.height+t.offsetY)-(e.y*n.height-e.offsetY))},L.zz=function(t){if(t instanceof pt){this.eq=t;var e=G.alloc();this.fq=this.op(t.ga(Fo,e)),G.free(e)}else this.eq=null,this.fq=iu};function lr(t,e,i,n,s,a){var l=G.allocAt(t.pa.x,t.pa.y),c=l.x,p=l.y;if(t.eq!==null){var m=G.alloc();m=t.eq.ga(Fo,m),c=m.x-t.fq.x/t.scale,p=m.y-t.fq.y/t.scale,s=jr,G.free(m)}(a||t.scrollMode===Xl)&&(s.sb()&&(i>e.width&&(c=e.x+(s.x*e.width+s.offsetX)-(s.x*i-s.offsetX)),n>e.height&&(p=e.y+(s.y*e.height+s.offsetY)-(s.y*n-s.offsetY))),s=t.rj,a=i-e.width,i<e.width+s.left+s.right?(c=Math.min(c+i/2,e.right+Math.max(a,s.right)-i/2),c=Math.max(c,e.left-Math.max(a,s.left)+i/2),c-=i/2):c>e.left?c=e.left:c<e.right-i&&(c=e.right-i),i=n-e.height,n<e.height+s.top+s.bottom?(p=Math.min(p+n/2,e.bottom+Math.max(i,s.bottom)-n/2),p=Math.max(p,e.top-Math.max(i,s.top)+n/2),p-=n/2):p>e.top?p=e.top:p<e.bottom-n&&(p=e.bottom-n)),l.x=isFinite(c)?c:-t.yb.left,l.y=isFinite(p)?p:-t.yb.top,t.positionComputation!==null&&(e=t.positionComputation(t,l),l.x=e.x,l.y=e.y),Xe(t.Yd,t.pa,l),t.pa.h(l.x,l.y),Ds(t),G.free(l)}L.Ol=function(t,e){if(e===void 0&&(e=!0),e){if(t=Rn(this,t,function(i){return i.part},function(i){return i.canSelect()}),t instanceof bi)return t}else if(t=Rn(this,t,function(i){return i.part}),t instanceof bi)return t;return null},L.ic=function(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null),Vo(this);for(var n=this.Wa.iteratorBackwards;n.next();){var s=n.value;if(s.visible&&(s=s.ic(t,e,i),s!==null))return s}return null};function Rn(t,e,i,n){for(i===void 0&&(i=null),n===void 0&&(n=null),Vo(t),t=t.Wa.iteratorBackwards;t.next();){var s=t.value;if(s.visible&&!s.isTemporary&&(s=s.ic(e,i,n),s!==null))return s}return null}L.lz=function(t,e,i){return e===void 0&&(e=!0),kr(this,t,function(n){return n.part},e?function(n){return n instanceof bi&&n.canSelect()}:null,i)};function kr(t,e,i,n,s){for(i===void 0&&(i=null),n===void 0&&(n=null),s instanceof ue||s instanceof te||(s=new te),Vo(t),t=t.Wa.iteratorBackwards;t.next();){var a=t.value;a.visible&&!a.isTemporary&&a.ji(e,i,n,s)}return s}L.ji=function(t,e,i,n){e===void 0&&(e=null),i===void 0&&(i=null),n instanceof ue||n instanceof te||(n=new te),Vo(this);for(var s=this.Wa.iteratorBackwards;s.next();){var a=s.value;a.visible&&a.ji(t,e,i,n)}return n},L.ux=function(t,e,i,n){return e===void 0&&(e=!1),i===void 0&&(i=!0),Ls(this,t,function(s){return s instanceof bi&&(!i||s.canSelect())},e,n)},L.Cf=function(t,e,i,n,s){e===void 0&&(e=null),i===void 0&&(i=null),n===void 0&&(n=!1),s instanceof ue||s instanceof te||(s=new te),Vo(this);for(var a=this.Wa.iteratorBackwards;a.next();){var l=a.value;l.visible&&l.Cf(t,e,i,n,s)}return s},L.Nu=function(t,e,i,n,s,a){var l=new te;Vo(this);for(var c=this.Wa.iteratorBackwards;c.next();){var p=c.value;p.visible&&p.Nu(t,e,i,n,l,s,a)}return l};function Ls(t,e,i,n,s){var a=null;for(a===void 0&&(a=null),i===void 0&&(i=null),n===void 0&&(n=!1),s instanceof ue||s instanceof te||(s=new te),Vo(t),t=t.Wa.iteratorBackwards;t.next();){var l=t.value;l.visible&&!l.isTemporary&&l.Cf(e,a,i,n,s)}return s}L.mz=function(t,e,i,n,s){return i===void 0&&(i=!0),n===void 0&&(n=!0),As(this,t,e,function(a){return a instanceof bi&&(!n||a.canSelect())},i,s)},L.og=function(t,e,i,n,s,a){i===void 0&&(i=null),n===void 0&&(n=null),s===void 0&&(s=!0),s!==!1&&s!==!0&&((s instanceof ue||s instanceof te)&&(a=s),s=!0),a instanceof ue||a instanceof te||(a=new te),Vo(this);for(var l=this.Wa.iteratorBackwards;l.next();){var c=l.value;c.visible&&c.og(t,e,i,n,s,a)}return a};function As(t,e,i,n,s,a){var l=null;for(l===void 0&&(l=null),n===void 0&&(n=null),s===void 0&&(s=!0),s!==!1&&s!==!0&&((s instanceof ue||s instanceof te)&&(a=s),s=!0),a instanceof ue||a instanceof te||(a=new te),Vo(t),t=t.Wa.iteratorBackwards;t.next();){var c=t.value;c.visible&&!c.isTemporary&&c.og(e,i,l,n,s,a)}return a}Ct.prototype.acceptEvent=function(t){return Gr(this,t,t instanceof MouseEvent)};function Gr(t,e,i){var n=t.Qg;return t.Qg=t.cj,t.cj=n,n.diagram=t,n.event=e,i?ua(t,e,n):(n.viewPoint=t.Qg.viewPoint,n.documentPoint=t.Qg.documentPoint),t=0,e.ctrlKey&&(t+=1),e.altKey&&(t+=2),e.shiftKey&&(t+=4),e.metaKey&&(t+=8),n.modifiers=t,n.button=e.button,e.buttons!==void 0&&(n.buttons=e.buttons),qr&&e.button===0&&e.ctrlKey&&(n.button=2),n.down=!1,n.up=!1,n.clickCount=1,n.delta=0,n.handled=!1,n.bubbles=!1,n.timestamp=e.timeStamp,n.isMultiTouch=!1,n.targetDiagram=ma(e,e.target),n.targetObject=null,n}function ma(t,e){return e===null?null:(e=e.H)?e:((e=t.path)||typeof t.composedPath!="function"||(e=t.composedPath()),e&&e[0]&&e[0].H?e[0].H:null)}function Qo(t,e,i,n,s,a){var l=t.Qg;return t.Qg=t.cj,t.cj=l,l.diagram=t,l.clickCount=1,t=l.delta=0,e.ctrlKey&&(t+=1),e.altKey&&(t+=2),e.shiftKey&&(t+=4),e.metaKey&&(t+=8),l.modifiers=t,l.event=e,l.timestamp=e.timeStamp,l.button=e.button,l.buttons=e.buttons,qr&&e.button===0&&e.ctrlKey&&(l.button=2),l.down=i,l.up=n,l.handled=!1,l.bubbles=s,l.isMultiTouch=a,l}function bs(t,e){return t.bubbles?!0:(e.stopPropagation!==void 0&&e.stopPropagation(),e.cancelable!==!1&&e.preventDefault(),e.cancelBubble=!0,!1)}Ct.prototype.Qz=function(t){var e=this.H;if(!this.H.isEnabled)return!1;var i=Gr(e,t,!1);switch(i.key=String.fromCharCode(t.which),i.down=!0,t.which){case 8:i.key="Backspace";break;case 33:i.key="PageUp";break;case 34:i.key="PageDown";break;case 35:i.key="End";break;case 36:i.key="Home";break;case 37:i.key="Left";break;case 38:i.key="Up";break;case 39:i.key="Right";break;case 40:i.key="Down";break;case 45:i.key="Insert";break;case 46:i.key="Del";break;case 48:i.key="0";break;case 187:case 61:case 107:i.key="Add";break;case 189:case 173:case 109:i.key="Subtract";break;case 27:i.key="Esc"}return e.doKeyDown(),bs(i,t)},Ct.prototype.Rz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=Gr(e,t,!1);switch(i.key=String.fromCharCode(t.which),i.up=!0,t.which){case 8:i.key="Backspace";break;case 33:i.key="PageUp";break;case 34:i.key="PageDown";break;case 35:i.key="End";break;case 36:i.key="Home";break;case 37:i.key="Left";break;case 38:i.key="Up";break;case 39:i.key="Right";break;case 40:i.key="Down";break;case 45:i.key="Insert";break;case 46:i.key="Del"}return e.doKeyUp(),bs(i,t)},Ct.prototype.bz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=Gr(e,t,!0);return e.mouseEnter!==null&&e.mouseEnter(i),e.currentTool.standardMouseOver(),bs(i,t)},Ct.prototype.cz=function(t){var e=this.H;if(!e.isEnabled)return!1;var i=Gr(e,t,!0);return e.mouseLeave!==null&&e.mouseLeave(i),bs(i,t)},Ct.prototype.getMouse=function(t){var e=this.ta;if(e===null)return new G(0,0);var i=e.getBoundingClientRect();return e=t.clientX-this.Aa/i.width*i.left,t=t.clientY-this.ya/i.height*i.top,this.Ab!==null?ut(new G(e,t),this.Ab):new G(e,t)};function ua(t,e,i){var n=t.ta,s=t.Aa,a=t.ya,l=0,c=0;n!==null&&(n=n.getBoundingClientRect(),l=e.clientX-s/n.width*n.left,c=e.clientY-a/n.height*n.top),i.viewPoint.h(l,c),t.Ab!==null?(e=G.allocAt(l,c),t.Ab.Cd(e),i.documentPoint.assign(e),G.free(e)):i.documentPoint.h(l,c)}function Ho(t,e,i){if(t.oj[0]!==null){e=t.oj[e];var n=t.ta;n!==null&&(n=n.getBoundingClientRect(),i.h(e.clientX-t.Aa/n.width*n.left,e.clientY-t.ya/n.height*n.top))}}Ct.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function La(t){t.ld||Vo(t),t.Va()}Ct.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},L=Ct.prototype,L.Pz=function(){return this.kg},L.Xy=function(t){t===void 0&&(t=null);var e=this.animationManager,i=e.isEnabled;e.Cc(),e.isEnabled=!1,Rs(this),this.hf=!1,this.du=new G(NaN,NaN),e.isEnabled=i,this.ld=!0;var n=this;t!==null&&Ce(function(){n.ld=!1,R(e,"Model"),t(n)},1)},L.$b=function(t){if(t===void 0&&(t=!1),this.kg!==!0&&!(this.vb||t===!1&&this.ld)){this.kg=!0;var e=this;Kt.requestAnimationFrame(function(){e.kg&&e.bd()})}},L.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),Rs(this))};function Eo(t,e,i){!t.Ee||t.vb||t.animationManager.defaultAnimation.isAnimating||Ts(t)||(e&&Vo(t),i&&br(t,!1))}function Rs(t,e){if(!t.ld&&(t.kg=!1,t.Ka!==null||t.wo.w())){t.ld=!0;var i=t.animationManager,n=t.Xn;if(!i.isAnimating&&n.length!==0){for(var s=n.s,a=s.length,l=0;l<a;l++){var c=s[l];ba(c,!1),c.v()}n.clear()}n=t.ow,0<n.count&&(n.each(function(p){p.Nv()}),n.clear()),s=n=!1,i.defaultAnimation.isAnimating&&(s=!0,n=t.skipsUndoManager,t.skipsUndoManager=!0),i.zb||Po(t),Eo(t,!1,!0),t.fe!==null&&(t.fe.visible&&!t.mq&&(Bs(t),t.mq=!0),!t.fe.visible&&t.mq&&(t.mq=!1)),Vo(t),a=!1,(!t.hf||t.xh)&&(t.hf?Vh(t,!t.Jk):(t.Ea("Initial Layout"),i.isEnabled===!1&&i.Cc(),Vh(t,!1)),a=!0),t.Jk=!1,Vo(t),t.ou||La(t),Eo(t,!0,!1),l=!1,a?(i=Tt.alloc(),i.assign(t.viewportBounds),t.hf||(l=t.hf=!0,t.skipsUndoManager||(t.undoManager.isPendingClear=!0),t.undoManager.isPendingUnmodified=!0,Us(t)),t.R("LayoutCompleted"),Eo(t,!0,!1),Tt.free(i)):i.Ok&&i.Qw&&(t.Fg!==xa?t.scale=wn(t,t.Fg):t.yh!==xa?t.scale=wn(t,t.yh):(i=t.initialScale,isFinite(i)&&0<i&&(t.scale=i)),br(t,!0)),a&&l&&t.eb("Initial Layout"),Vo(t),e||t.gc(t.ib),s&&(t.skipsUndoManager=n),t.ld=!1}}function Us(t){if(t.Fg!==xa)t.scale=wn(t,t.Fg);else if(t.yh!==xa)t.scale=wn(t,t.yh);else{var e=t.initialScale;isFinite(e)&&0<e&&(t.scale=e)}br(t,!0),e=t.Wa.s,t.Fd(e,e.length,t,t.viewportBounds),t.R("InitialLayoutCompleted"),t.du.assign(t.pa),Bs(t)}function Vo(t){if(t.De.count!==0&&(t.ld||!t.animationManager.isTicking)){for(var e=0;23>e;e++){var i=t.De.iterator;if(i===null||t.De.count===0)break;t.De=new te,t.Nv(i,t.De)}t.nodes.each(function(n){n instanceof Yi&&n.U&65536&&(n.U=n.U^65536)})}}L.Nv=function(t,e){for(t.reset();t.next();){var i=t.value;!i.Zc()||i instanceof Yi||(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i))}for(t.reset();t.next();)i=t.value,i instanceof Yi&&i.isVisible()&&ha(this,i);for(t.reset();t.next();)i=t.value,i instanceof ge&&i.isVisible()&&(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i));for(t.reset();t.next();)i=t.value,i instanceof pr&&i.isVisible()&&(i.si()?(i.measure(1/0,1/0),i.arrange()):e.add(i))};function ha(t,e){for(var i=gi(),n=gi(),s=e.memberParts;s.next();){var a=s.value;a.isVisible()&&(a instanceof Yi?(lh(a)||Vu(a)||vd(a))&&ha(t,a):a instanceof ge?a.fromNode===e||a.toNode===e?n.push(a):i.push(a):(a.measure(1/0,1/0),a.arrange()))}for(t=i.length,s=0;s<t;s++)a=i[s],a.measure(1/0,1/0),a.arrange();for(Ji(i),e.measure(1/0,1/0),e.arrange(),t=n.length,e=0;e<t;e++)i=n[e],i.measure(1/0,1/0),i.arrange();Ji(n)}L.Fd=function(t,e,i,n){if(this.vd||this.animationManager.isAnimating)for(var s=0;s<e;s++)t[s].Fd(i,n)},L.gc=function(t){if(this.Ka!==null){if(this.ta===null&&Mt("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var e=this.animationManager;if(!e.zb&&(!e.isAnimating||e.isTicking)){Xa(this);var i=this.Aa,n=this.ya;if(t.Gv.resize(i,n,i,n),i=this.Wa.s,n=i.length,this.Fd(i,n,this,this.viewportBounds),this.Fc||e.isAnimating){e=this.pa;var s=this.Ca,a=Math.round(e.x*s)/s,l=Math.round(e.y*s)/s,c=this.Ab;for(c.reset(),s!==1&&c.scale(s),e.x===0&&e.y===0||c.translate(-a,-l),t.ti=null,bh(t,c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),this.pb!==1&&(t.globalAlpha=this.pb),Vl(this,t),e=this.Mb,this.ta.context.setTransform(e,0,0,e,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya),e=0;e<n;e++)i[e].gc(t,this);t=!1,this.Yf?Ju(this.Yf,this)&&(t=this.Vp()):t=!0,t&&(dn.prototype.Cd=dn.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(a=this.animationManager,!a.zb&&(!a.isAnimating||a.isTicking)&&(i=new Date,Xa(this),this.Ka.style.opacity!=="0")){if(n=t!==this.ib,e=this.Wa.s,s=e.length,this.Fd(e,s,this,this.viewportBounds),n)t.Vc(!0),this.vd=!0;else if(!this.Fc&&!a.isAnimating)break t;a=this.Ab,a.reset(),l=this.Mb,c=this.pa;var p=this.Ca,m=Math.round(c.x*p)/p,v=Math.round(c.y*p)/p;for(p!==1&&a.scale(p),c.x===0&&c.y===0||a.translate(-m,-v),t.setTransform(l,0,0,l,0,0),t.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(t.globalAlpha=this.pb),Vl(this,t),c=0;c<s;c++)t.setTransform(l,0,0,l,0,0),t.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),t.yc(),e[c].gc(t,this);if(e=!1,this.Yf?Ju(this.Yf,this)&&(e=this.Vp()):e=!0,e&&(dn.prototype.Cd=dn.prototype.Eu),n?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,e=+new Date-+i,n=Ma&&Ma.nx,i=this.zw,n||this.Yh===null){for(i[this.Tq]=e,this.Tq=(this.Tq+1)%i.length,s=e=0;s<i.length;s++)e+=i[s];this.Sq=e/i.length}if(this.pb!==1&&(t.globalAlpha=1),n)for(t.setTransform(1,0,0,1,0,0),n=0;n<i.length;n++)t.fillText(i[n].toString(),20,150+ +(20*n))}}};function Zs(t,e,i,n,s,a,l,c,p,m){if(t.Ka!==null){t.ta===null&&Mt("No canvas specified"),l===void 0&&(l=null),c===void 0&&(c=null),p===void 0&&(p=!1),m===void 0&&(m=!1),Xa(t),t.ib.Vc(!0),t.vd=!0,t.$i=!0;var v=t.Ca;t.Ca=s;var w=t.Wa.s,C=w.length;try{var k=new Tt(a.x,a.y,n.width/s,n.height/s),T=k.copy();T.Co(i),Bs(t,T),Vo(t),t.Fd(w,C,t,k),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,n.width,n.height),c!==null&&c!==""&&(e.fillStyle=c,e.ox(0,0,n.width,n.height));var A=t.Mb;e.scale(A,A);var X=dn.alloc();X.reset(),X.translate(i.left,i.top),X.scale(s),a.x===0&&a.y===0||X.translate(-a.x,-a.y),e.setTransform(X.m11,X.m12,X.m21,X.m22,X.dx,X.dy),e.yc(),e instanceof Fu&&bh(e,X.m11,X.m12,X.m21,X.m22,X.dx,X.dy),dn.free(X),Vl(t,e),e.globalAlpha=t.pb;var $=t.Qj("Grid");if(l){var J=new te,et=l.iterator;for(et.reset();et.next();){var st=et.value;st instanceof bi&&(m||st.layer!==$)&&(st.Gj(),J.add(st))}for(m=0;m<C;m++)On(w[m],e,t,J,p);J.each(function(Pt){return Pt.Gj()})}else for(J=0;J<C;J++){var mt=w[J];mt===$?m&&mt.gc(e,t,!0):mt.gc(e,t,p)}t.$i=!1,t.Yf&&Ju(t.Yf,t)&&t.Vp()}finally{t.Ca=v,t.ib.Vc(!0),t.vd=!0,t.Fd(w,C,t,t.viewportBounds),Bs(t),t.ib instanceof Fu&&(t.ib.Nj.PA(),t.redraw())}}}L.Gf=function(t){return this.Rg[t]},L.Xx=function(t,e){t==="minDrawingLength"&&(this.Oq=e),this.Rg[t]=e,this.redraw()},L.Tx=function(){this.Rg=new Bo,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(qr||os),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function Vl(t,e){t=t.Rg,t!==null&&(t.imageSmoothingEnabled!==void 0&&e.Wx(!!t.imageSmoothingEnabled),t=t.defaultFont,t!=null&&(e.font=t))}L.Ql=function(t){return this.on[t]},L.sA=function(t,e){this.on[t]=e},L.Sx=function(){this.on=new Bo,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},L.set=function(t){return Object.assign(this,t),this},L.Du=function(t){return this.nm(t)},L.nm=function(t){return Ta(this,t),this};function Ta(t,e){var i=t instanceof ce,n=t instanceof Ct,s;for(s in e){s===""&&Mt("Setting properties requires non-empty property names");var a=t,l=s;if(i||n){var c=s.indexOf(".");if(0<c){var p=s.substring(0,c);i?a=t.fb(p):(a=t[p],a==null&&(a=t.toolManager[p])),Qt(a)?l=s.substr(c+1):Mt("Unable to find object named: "+p+" in "+t.toString()+" when trying to set property: "+s)}}if(l[0]!=="_"&&!ho(a,l))if(n&&l==="ModelChanged"){t.Yw(e[l]);continue}else if(n&&l==="Changed"){t.Pe(e[l]);continue}else if(n&&ho(t.toolManager,l))a=t.toolManager;else if(n&&gu(t,l)){t.Bj(l,e[l]);continue}else if(t instanceof ii&&l==="Changed"){t.Pe(e[l]);continue}else Mt('Trying to set undefined property "'+l+'" on object: '+a.toString());a[l]=e[s],l[0]==="_"&&a instanceof pt&&a.Vw(l)}}L.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var t=this.Eh;for(this.Eh=new ci,t=t.iterator;t.next();){var e=t.key;e.Xo(t.value),e.qc()}}this.N()}},L.N=function(t){if(t===void 0)this.Fc=!0,this.$b();else{var e=this.viewportBounds;t.w()&&e.Yc(t)&&(this.Fc=!0,this.$b())}this.R("InvalidateDraw")},Ct.prototype.invalidateViewport=function(t,e){if(this.Fc!==!0)if(this.Fc=!0,this.nl==="svg")this.bd();else{var i=this.Gf("temporaryPixelRatio")===!0;if(this.Gf("viewportOptimizations")===!0&&this.scrollMode!==Uh&&this.rj.hi(0,0,0,0)&&e.width===t.width&&e.height===t.height){var n=this.scale,s=Math.max(t.y,e.y),a=Math.min(t.y+t.height,e.y+e.height);if(0<Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x))*n&&0<Math.max(0,a-s)*n){if(!(this.ld||(this.kg=!1,this.Ka===null||(this.ld=!0,this.documentBounds.w()||(n=Tt.alloc(),ku(this,this.computeBounds(n)),Tt.free(n)),n=this.ta,n===null||n instanceof tf)))){var l=this.Mb;s=this.Aa*l;var c=this.ya*l,p=this.scale*l;a=Math.round(Math.round(e.x*p)-Math.round(t.x*p)),e=Math.round(Math.round(e.y*p)-Math.round(t.y*p)),p=this.jw,t=this.oy,p.width!==s&&(p.width=s),p.height!==c&&(p.height=c),t.clearRect(0,0,s,c),p=190*l;var m=70*l,v=Math.max(a,0),w=Math.max(e,0),C=Math.floor(s-v),k=Math.floor(c-w);t.drawImage(n.Oa,v,w,C,k,0,0,C,k),Ju(this.Yf,this)&&t.clearRect(0,0,p,m),n=gi(),t=gi(),k=Math.abs(a),C=Math.abs(e);var T=v===0?0:s-k;v=G.allocAt(T,0),k=G.allocAt(k+T,c),t.push(new Tt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y)));var A=this.Ab;if(A.reset(),A.scale(l,l),this.Ca!==1&&A.scale(this.Ca),l=this.pa,(l.x!==0||l.y!==0)&&isFinite(l.x)&&isFinite(l.y)&&A.translate(-l.x,-l.y),ut(v,A),ut(k,A),n.push(new Tt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y))),T=w===0?0:c-C,v.h(0,T),k.h(s,C+T),t.push(new Tt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y))),ut(v,A),ut(k,A),n.push(new Tt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y))),Ju(this.Yf,this)&&(s=0<a?0:-a,c=0<e?0:-e,v.h(s,c),k.h(p+s,m+c),t.push(new Tt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y))),ut(v,A),ut(k,A),n.push(new Tt(Math.min(v.x,k.x),Math.min(v.y,k.y),Math.abs(v.x-k.x),Math.abs(v.y-k.y)))),G.free(v),G.free(k),Eo(this,!1,!0),this.Ka===null&&Mt("No div specified"),this.ta===null&&Mt("No canvas specified"),!this.animationManager.zb&&(s=this.ib,this.Fc)){for(Xa(this),c=this.Mb,s.setTransform(1,0,0,1,0,0),s.clearRect(0,0,this.Aa*c,this.ya*c),s.drawImage(this.jw.Oa,0<a?0:Math.round(-a),0<e?0:Math.round(-e)),a=this.pa,l=this.Ca,p=Math.round(a.x*l)/l,m=Math.round(a.y*l)/l,e=this.Ab,e.reset(),l!==1&&e.scale(l),a.x===0&&a.y===0||e.translate(-p,-m),s.save(),s.beginPath(),a=t.length,l=0;l<a;l++)p=t[l],p.width!==0&&p.height!==0&&s.rect(Math.floor(p.x),Math.floor(p.y),Math.ceil(p.width),Math.ceil(p.height));for(s.clip(),s.setTransform(c,0,0,c,0,0),s.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),s.yc(),e=this.Wa.s,a=e.length,this.Fd(e,a,this,this.viewportBounds),Vl(this,s),s.globalAlpha=this.pb,c=0;c<a;c++)if(l=e[c],p=n,l.visible&&l.pb!==0){m=rn(l,s),w=l.Zq,w.length=0,v=this.scale,C=Tt.alloc(),k=l.Pa.s,A=k.length,T=p.length;for(var X=0;X<A;X++){var $=k[X],J=of($,$.actualBounds);t:{for(var et=2/v,st=4/v,mt=0;mt<T;mt++){var Pt=p[mt];if(Pt.width!==0&&Pt.height!==0&&J.Vu(Pt.x-et,Pt.y-et,Pt.width+st,Pt.height+st)){J=!0;break t}}J=!1}J&&l.Oj(s,$,this,w,v,C,!0)}Tt.free(C),s.globalAlpha=m}s.restore(),s.Vc(!0),this.Yf&&Ju(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}Ji(n),Ji(t),this.ld=!1}}else this.bd();i&&(tn(this),this.bd(),so(this,!0))}else i?(tn(this),this.bd(),so(this,!0)):this.bd()}};function Xa(t){t.pn!==!1&&(t.pn=!1,Yu(t,t.Aa,t.ya))}function Yu(t,e,i){Ds(t);var n=t.Mb;t.ta.resize(e*n,i*n,e,i)&&(t.Fc=!0,t.ib.Vc(!0))}function Ts(t){var e=t.ta;if(e===null||t.wo.w())return!0;var i=t.Aa,n=t.ya,s=t.Ka,a=!1,l=t.gf?t.Db:0,c=t.Be?t.Db:0,p=s.clientWidth||i+l,m=s.clientHeight||n+c,v=t.viewportBounds;s=v.x;var w=v.y,C=v.width,k=v.height;if((p!==i+l||m!==n+c)&&(t.gf=!1,t.Be=!1,c=l=0,t.Aa=p,t.ya=m,a=t.pn=!0,Ds(t)),!t.hf||!t.viewportBounds.w())return!0;var T=t.ku,A=t.hu;if(t.Ee=!1,!(a||t.gf||t.Be||t.mn||t.nn))return!0;var X=t.documentBounds,$=0,J=0,et=0,st=0,mt=v.width,Pt=v.height,De=t.rj;t.contentAlignment.sb()?(X.width>mt&&($=De.left,J=De.right),X.height>Pt&&(et=De.top,st=De.bottom)):($=De.left,J=De.right,et=De.top,st=De.bottom);var ti=X.width+$+J,Ve=X.height+et+st;De=t.scale;var ye=ti>p/De,Yt=Ve>m/De;if(!(a||t.gf||t.Be||ye||Yt))return!0;$=X.x-$,p=v.x,J=X.right+J,m=v.right+l,et=X.y-et;var sn=v.y;X=X.bottom+st,v=v.bottom+c;var Ui="1px";if(st="1px",t.scrollMode===Xl&&(ye||Yt)&&(ye&&t.hasHorizontalScrollbar&&t.allowHorizontalScroll&&(ye=1,$+1<p&&(ye=Math.max((p-$)*De+t.Aa,ye)),J>m+1&&(ye=Math.max((J-m)*De+t.Aa,ye)),mt+l+1<ti&&(ye=Math.max((ti-mt)*De+t.Aa,ye)),Ui=ye.toString()+"px"),Yt&&t.hasVerticalScrollbar&&t.allowVerticalScroll&&(ye=1,et+1<sn&&(ye=Math.max((sn-et)*De+t.ya,ye)),X>v+1&&(ye=Math.max((X-v)*De+t.ya,ye)),Pt+c+1<Ve&&(ye=Math.max((Ve-Pt)*De+t.ya,ye)),st=ye.toString()+"px")),ye=Ui!=="1px",Yt=st!=="1px",ye&&Yt||!ye&&!Yt||(Yt&&(m-=t.Db),ye&&(v-=t.Db),ti<mt+l||!t.hasHorizontalScrollbar||!t.allowHorizontalScroll||(l=1,$+1<p&&(l=Math.max((p-$)*De+t.Aa,l)),J>m+1&&(l=Math.max((J-m)*De+t.Aa,l)),mt+1<ti&&(l=Math.max((ti-mt)*De+t.Aa,l)),Ui=l.toString()+"px"),ye=Ui!=="1px",l=t.ya,ye!==t.Be&&(l=ye?t.ya-t.Db:t.ya+t.Db),Ve<Pt+c||!t.hasVerticalScrollbar||!t.allowVerticalScroll||(c=1,et+1<sn&&(c=Math.max((sn-et)*De+l,c)),X>v+1&&(c=Math.max((X-v)*De+l,c)),Pt+1<Ve&&(c=Math.max((Ve-Pt)*De+l,c)),st=c.toString()+"px"),Yt=st!=="1px"),t.qr&&ye===t.Be&&Yt===t.gf)return i===t.Aa&&n===t.ya||t.bd(),!1;if(ye!==t.Be&&(Ui==="1px"?t.ya=t.ya+t.Db:t.ya=Math.max(t.ya-t.Db,1),a=!0),t.Be=ye,A.style.width=Ui,Yt!==t.gf&&(st==="1px"?t.Aa=t.Aa+t.Db:t.Aa=Math.max(t.Aa-t.Db,1),a=!0,t.tn&&(c=G.alloc(),Yt?(e.style.left=t.Db+"px",t.position=c.h(t.pa.x+t.Db/t.scale,t.pa.y)):(e.style.left="0px",t.position=c.h(t.pa.x-t.Db/t.scale,t.pa.y)),G.free(c))),a&&Ds(t),t.gf=Yt,A.style.height=st,t.gu=!0,a&&(t.pn=!0),e=T.scrollLeft,t.hasHorizontalScrollbar&&t.allowHorizontalScroll&&(mt+1<ti?e=(t.position.x-$)*De:$+1<p?e=T.scrollWidth-T.clientWidth:J>m+1&&(e=t.position.x*De)),t.tn)switch(t.bu){case"negative":e=-(T.scrollWidth-e-T.clientWidth);break;case"reverse":e=T.scrollWidth-e-T.clientWidth}return T.scrollLeft=e,t.hasVerticalScrollbar&&t.allowVerticalScroll&&(Pt+1<Ve?T.scrollTop=(t.position.y-et)*De:et+1<sn?T.scrollTop=T.scrollHeight-T.clientHeight:X>v+1&&(T.scrollTop=t.position.y*De)),p=t.Aa,m=t.ya,T.style.width=p+(t.gf?t.Db:0)+"px",T.style.height=m+(t.Be?t.Db:0)+"px",i!==p||n!==m||t.animationManager.zb?(i=Tt.allocAt(s,w,C,k),t.onViewportBoundsChanged(i,t.viewportBounds,De,a),Tt.free(i),!1):!0}L=Ct.prototype,L.add=function(t){var e=t.diagram;if(e!==this&&(e!==null&&Mt("Cannot add part "+t.toString()+" to "+this.toString()+". It is already a part of "+e.toString()),e=this.Qj(t.layerName),e===null&&(e=this.Qj("")),e===null&&Mt('Cannot add a Part when unable find a Layer named "'+t.layerName+'" and there is no default Layer'),t.layer!==e)){var i=e.oi(99999999,t,t.diagram===this);0<=i&&this.cb(qs,"parts",e,null,t,null,i),e.isTemporary||this.Ya(),t.C(1),i=t.layerChanged,i!==null&&i(t,null,e)}},L.oi=function(t){this.partManager.oi(t);var e=this;id(t,function(i){Wl(e,i)}),(t instanceof pr||t instanceof Yi&&t.placeholder!==null)&&t.v(),t.data!==null&&id(t,function(i){Pa(e.partManager,i)}),Vu(t)!==!0&&vd(t)!==!0||this.De.add(t),zm(t,!0,this),jm(t)?(t.actualBounds.w()&&this.N(of(t,t.actualBounds)),this.Ya()):t.isVisible()&&t.actualBounds.w()&&this.N(of(t,t.actualBounds)),this.$b()},L.pc=function(t){t.Ej(),this.partManager.pc(t);var e=this;t.data!==null&&id(t,function(i){Vd(e.partManager,i,e)}),this.De.remove(t),jm(t)?(t.actualBounds.w()&&this.N(of(t,t.actualBounds)),this.Ya()):t.isVisible()&&t.actualBounds.w()&&this.N(of(t,t.actualBounds)),this.$b()},L.remove=function(t){Cn(this,t,!0)};function Cn(t,e,i){var n=e.layer;n!==null&&n.diagram===t&&(e.isSelected=!1,e.isHighlighted=!1,e.C(2),i&&e.Lj(),i=n.pc(-1,e,!1),0<=i&&t.cb(aa,"parts",n,e,null,i,null),t=e.layerChanged,t!==null&&t(e,n,null))}L.Is=function(t,e){if(e===void 0&&(e=!1),ui(t))for(var i=t.length,n=0;n<i;n++){var s=t[n];e&&!s.canDelete()||this.remove(s)}else for(i=new te,i.addAll(t),t=i.iterator;t.next();)i=t.value,e&&!i.canDelete()||this.remove(i)},L.Kj=function(t,e,i){return i===void 0&&(i=!1),this.partManager.Kj(t,e,i)},Ct.prototype.moveParts=function(t,e,i,n){if(i===void 0&&(i=!1),n===void 0&&(n=Ss(this)),this.toolManager!==null){var s=new ci;if(t!==null)if(ui(t))for(var a=0;a<t.length;a++)Kn(this,s,t[a],i,n);else for(t=t.iterator;t.next();)Kn(this,s,t.value,i,n);else{for(t=this.parts;t.next();)Kn(this,s,t.value,i,n);for(t=this.nodes;t.next();)Kn(this,s,t.value,i,n);for(t=this.links;t.next();)Kn(this,s,t.value,i,n)}Pr(this,s,e,n,i)}};function Kn(t,e,i,n,s,a){if(!e.contains(i)&&(a===void 0&&(a=!1),!n||a||i.canMove()||i.canCopy()))if(s===void 0&&(s=Ss(t)),i instanceof Ee){if(e.add(i,t.Pd(s,i,i.location)),i instanceof Yi&&(i.placeholder!==null||s.dragsMembers))for(a=i.memberParts;a.next();)Kn(t,e,a.value,n,s,s.groupsAlwaysMove);for(a=i.linksConnected;a.next();){var l=a.value;if(!e.contains(l)){var c=l.fromNode,p=l.toNode;c!==null&&e.contains(c)&&p!==null&&e.contains(p)&&Kn(t,e,l,n,s)}}if(s.dragsTree)for(i=i.Ou();i.next();)Kn(t,e,i.value,n,s)}else if(i instanceof ge)for(e.add(i,t.Pd(s,i)),i=i.labelNodes;i.next();)Kn(t,e,i.value,n,s);else i instanceof pr||e.add(i,t.Pd(s,i,i.location))}function Pr(t,e,i,n,s){if(e!==null&&e.count!==0){var a=G.alloc(),l=G.alloc();l.assign(i),isNaN(l.x)&&(l.x=0),isNaN(l.y)&&(l.y=0),(i=t.Mr)||Yr(t,e);for(var c=gi(),p=gi(),m=e.iterator,v=G.alloc();m.next();){var w=m.key,C=m.value;if(w.Zc()){var k=Un(t,w,e);k!==null?c.push(new h(w,C,k)):(!s||w.canMove())&&(k=C.point,a.assign(k),t.computeMove(w,a.add(l),n,v),w.location=v,C.shifted===void 0&&(C.shifted=new G),C.shifted.assign(v.re(k)))}else m.key instanceof ge&&p.push(m.sa)}for(G.free(v),s=c.length,m=0;m<s;m++)w=c[m],a.assign(w.info.point),w.Su.shifted===void 0&&(w.Su.shifted=new G),w.node.location=a.add(w.Su.shifted);for(s=G.alloc(),m=G.alloc(),w=p.length,C=0;C<w;C++){var T=p[C];if(k=T.key,k instanceof ge)if(k.suspendsRouting){k.Tg=null,v=k.fromNode;var A=k.toNode;if(t.draggedLink!==null&&n.dragsLink)if(A=T.value.point,k.dragComputation===null)e.add(k,t.Pd(n,k,l)),xd(k,l.x-A.x,l.y-A.y);else{T=G.allocAt(0,0),(v=k.i(0))&&v.w()&&T.assign(v);var X=v=G.alloc().assign(T).add(l);n.isGridSnapEnabled&&(n.isGridSnapRealtime||t.lastInput.up)&&(X=G.alloc(),Nn(t,k,v,X,n)),v.assign(k.dragComputation(k,v,X)).re(T),e.add(k,t.Pd(n,k,v)),xd(k,v.x-A.x,v.y-A.y),G.free(T),G.free(v),X!==v&&G.free(X)}else v!==null&&(s.assign(v.location),X=e.I(v),X!==null&&s.re(X.point)),A!==null&&(m.assign(A.location),X=e.I(A),X!==null&&m.re(X.point)),v!==null&&A!==null?s.Xa(m)?(v=T.value.point,A=a,A.assign(s),A.re(v),e.add(k,t.Pd(n,k,s)),xd(k,A.x,A.y)):(k.suspendsRouting=!1,k.bb()):(T=T.value.point,v=v!==null?s:A!==null?m:l,e.add(k,t.Pd(n,k,v)),xd(k,v.x-T.x,v.y-T.y))}else(k.fromNode===null||k.toNode===null)&&(v=T.value.point,e.add(k,t.Pd(n,k,l)),xd(k,l.x-v.x,l.y-v.y))}G.free(a),G.free(l),G.free(s),G.free(m),Ji(c),Ji(p),i||(Vo(t),Fi(t,e))}}Ct.prototype.computeMove=function(t,e,i,n){if(n===void 0&&(n=new G),n.assign(e),t===null)return n;var s=e,a=i.isGridSnapEnabled;a&&(i.isGridSnapRealtime||this.lastInput.up)&&(s=G.alloc(),Nn(this,t,e,s,i)),i=t.dragComputation!==null?t.dragComputation(t,e,s):s;var l=t.minLocation,c=l.x;isNaN(c)&&(c=a?Math.round(1e3*t.location.x)/1e3:t.location.x),l=l.y,isNaN(l)&&(l=a?Math.round(1e3*t.location.y)/1e3:t.location.y);var p=t.maxLocation,m=p.x;return isNaN(m)&&(m=a?Math.round(1e3*t.location.x)/1e3:t.location.x),p=p.y,isNaN(p)&&(p=a?Math.round(1e3*t.location.y)/1e3:t.location.y),n.h(Math.max(c,Math.min(i.x,m)),Math.max(l,Math.min(i.y,p))),s!==e&&G.free(s),n};function Ss(t){var e=t.toolManager.findTool("Dragging");return e!==null?e.dragOptions:t.Wm}function Nn(t,e,i,n,s){if(s===void 0&&(s=Ss(t)),n.assign(i),e!==null){var a=t.grid;e=s.gridSnapCellSize,t=e.width,e=e.height;var l=s.gridSnapOrigin,c=l.x;if(l=l.y,s=s.gridSnapCellSpot,a!==null){var p=a.gridCellSize;isNaN(t)&&(t=p.width),isNaN(e)&&(e=p.height),a=a.gridOrigin,isNaN(c)&&(c=a.x),isNaN(l)&&(l=a.y)}a=G.allocAt(0,0),a.yi(0,0,t,e,s),xt.No(i.x,i.y,c+a.x,l+a.y,t,e,n),G.free(a)}}function Yr(t,e){if(e!==null)for(t.Mr=!0,t=e.iterator;t.next();)e=t.key,e instanceof ge&&(e.suspendsRouting=!0)}function Fi(t,e){if(e!==null){for(e=e.iterator;e.next();){var i=e.key;i instanceof ge&&(i.suspendsRouting=!1,dy(i)&&i.bb())}t.Mr=!1}}function Un(t,e,i){return e=e.containingGroup,e!==null&&(t=Un(t,e,i),t!==null||(t=i.I(e),t!==null))?t:null}L=Ct.prototype,L.Pd=function(t,e,i){if(i===void 0)return new Eu(Wa);var n=t.isGridSnapEnabled;return t.groupsSnapMembers||e.containingGroup===null||(n=!1),n?new Eu(new G(Math.round(1e3*i.x)/1e3,Math.round(1e3*i.y)/1e3)):new Eu(i.copy())};function ae(t,e,i){if(e.diagram!==null&&e.diagram!==t&&Mt("Cannot share a Layer with another Diagram: "+e+" of "+e.diagram),i===null?e.diagram!==null&&Mt("Cannot add an existing Layer to this Diagram again: "+e):(i.diagram!==t&&Mt("Existing Layer must be in this Diagram: "+i+" not in "+i.diagram),e===i&&Mt("Cannot move a Layer before or after itself: "+e)),e.diagram!==t){e=e.name,t=t.Wa,i=t.count;for(var n=0;n<i;n++)t.M(n).name===e&&Mt("Cannot add Layer with the name '"+e+"'; a Layer with the same name is already present in this Diagram.")}}L.Al=function(t){ae(this,t,null),t.Xe(this);var e=this.Wa,i=e.count-1;if(!t.isTemporary)for(;0<=i&&e.M(i).isTemporary;)i--;return e.Gb(i+1,t),this.cc!==null&&this.cb(qs,"layers",this,null,t,null,i+1),this.N(),this.Ya(),this},L.Ww=function(t,e){ae(this,t,e),t.Xe(this);var i=this.Wa,n=i.indexOf(t);0<=n&&(i.remove(t),this.cc!==null&&this.cb(aa,"layers",this,t,null,n,null));var s=i.count,a;for(a=0;a<s;a++)if(i.M(a)===e){i.Gb(a,t);break}return this.cc!==null&&this.cb(qs,"layers",this,null,t,null,a),this.N(),0>n&&this.Ya(),this},L.Cy=function(t,e){ae(this,t,e),t.Xe(this);var i=this.Wa,n=i.indexOf(t);0<=n&&(i.remove(t),this.cc!==null&&this.cb(aa,"layers",this,t,null,n,null));var s=i.count,a;for(a=0;a<s;a++)if(i.M(a)===e){i.Gb(a+1,t);break}return this.cc!==null&&this.cb(qs,"layers",this,null,t,null,a+1),this.N(),0>n&&this.Ya(),this},L.kA=function(t){if(t.diagram!==this&&Mt("Cannot remove a Layer from another Diagram: "+t+" of "+t.diagram),t.name!==""){var e=this.Wa,i=e.indexOf(t);if(e.remove(t)){for(e=t.Pa.copy().iterator;e.next();){var n=e.value,s=n.layerName;s!==t.name?n.layerName=s:n.layerName=""}this.cc!==null&&this.cb(aa,"layers",this,t,null,i,null),this.N(),this.Ya()}}},L.Qj=function(t){for(var e=this.layers;e.next();){var i=e.value;if(i.name===t)return i}return null},L.Yw=function(t){return this.pf===null&&(this.pf=new ue),this.pf.add(t),this.model.Pe(t),this},L.mA=function(t){this.pf!==null&&(this.pf.remove(t),this.pf.count===0&&(this.pf=null)),this.model.ik(t)},L.Pe=function(t){return this.zg===null&&(this.zg=new ue),this.zg.add(t),this},L.ik=function(t){this.zg!==null&&(this.zg.remove(t),this.zg.count===0&&(this.zg=null))},L.ds=function(t){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(t),t.change!==Hl&&(this.isModified=!0),this.zg!==null)for(var e=this.zg,i=e.length,n=0;n<i;n++)e.M(n)(t)},L.cb=function(t,e,i,n,s,a,l){a===void 0&&(a=null),l===void 0&&(l=null);var c=new mo;c.diagram=this,c.change=t,c.propertyName=e,c.object=i,c.oldValue=n,c.oldParam=a,c.newValue=s,c.newParam=l,this.ds(c)},L.g=function(t,e,i,n,s){this.cb(us,t,this,e,i,n,s)},Ct.prototype.changeState=function(t,e){if(t!==null&&t.diagram===this){var i=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var n=t.change;if(n===us){var s=t.object;if(cs(s,t.propertyName,t.I(e)),s instanceof pt){var a=s.part;a!==null&&a.Wb()}this.isModified=!0}else if(n===qs){var l=t.object,c=t.newParam,p=t.newValue;if(l instanceof ce)if(typeof c=="number"&&p instanceof pt){e?l.pc(c):l.Gb(c,p);var m=l.part;m!==null&&m.Wb()}else typeof c=="number"&&p instanceof tl&&(p.isRow?e1(l,c,e?void 0:p):i1(l,c,e?void 0:p));else if(l instanceof ji){var v=t.oldParam===!0;typeof c=="number"&&p instanceof bi&&(e?(p.isSelected=!1,p.isHighlighted=!1,p.Wb(),l.pc(v?c:-1,p,v)):l.oi(c,p,v))}else l instanceof Ct?typeof c=="number"&&p instanceof ji&&(e?this.Wa.mb(c):(p.Xe(this),this.Wa.Gb(c,p))):Mt("unknown ChangedEvent.Insert object: "+t.toString());this.isModified=!0}else if(n===aa){var w=t.object,C=t.oldParam,k=t.oldValue;if(w instanceof ce)typeof C=="number"&&k instanceof pt?e?w.Gb(C,k):w.pc(C):typeof C=="number"&&k instanceof tl&&(k.isRow?e1(w,C,e?k:void 0):i1(w,C,e?k:void 0));else if(w instanceof ji){var T=t.newParam===!0;typeof C=="number"&&k instanceof bi&&(e?0>w.Pa.indexOf(k)&&w.oi(C,k,T):(k.isSelected=!1,k.isHighlighted=!1,k.Wb(),w.pc(T?C:-1,k,T)))}else w instanceof Ct?typeof C=="number"&&k instanceof ji&&(e?(k.Xe(this),this.Wa.Gb(C,k)):this.Wa.mb(C)):Mt("unknown ChangedEvent.Remove object: "+t.toString());this.isModified=!0}else n!==Hl&&Mt("unknown ChangedEvent: "+t.toString())}finally{this.skipsModelSourceBindings=i}}},Ct.prototype.Ea=function(t){return this.undoManager.Ea(t)},Ct.prototype.eb=function(t){return this.undoManager.eb(t)},Ct.prototype.Kf=function(){return this.undoManager.Kf()},Ct.prototype.commit=function(t,e){e===void 0&&(e="");var i=this.skipsUndoManager;e===null&&(this.skipsUndoManager=!0,e=""),this.undoManager.Ea(e);var n=!1;try{t(this),n=!0}finally{n?this.undoManager.eb(e):this.undoManager.Kf(),this.skipsUndoManager=i}},Ct.prototype.updateAllTargetBindings=function(t){this.partManager.updateAllTargetBindings(t)},Ct.prototype.rp=function(){this.partManager.rp()};function to(t,e,i){var n=t.animationManager;if(t.vb||t.ld)t.Ca=i,Ds(t),t.N(),t.Ee=!0,n.zb&&(at(n)||n.ce.add(n.H,"scale",e,t.Ca));else if(t.ta===null)t.Ca=i,Ds(t);else{t.vb=!0;var s=t.viewportBounds.copy(),a=t.Aa,l=t.ya,c=t.zoomPoint.x,p=t.zoomPoint.y,m=t.contentAlignment;isNaN(c)&&(m.$c()?m.Hf(hu)?c=0:m.Hf(ml)&&(c=a-1):c=m.sb()?m.x*(a-1):a/2),isNaN(p)&&(m.$c()?m.Hf(_h)?p=0:m.Hf(sl)&&(p=l-1):p=m.sb()?m.y*(l-1):l/2),t.scaleComputation===null||t.animationManager.defaultAnimation.isAnimating||(i=t.scaleComputation(t,i)),i<t.minScale&&(i=t.minScale),i>t.maxScale&&(i=t.maxScale),a=G.allocAt(t.pa.x+c/e-c/i,t.pa.y+p/e-p/i),t.position=a,G.free(a),t.Ca=i,Ds(t),t.vb=!1,t.onViewportBoundsChanged(s,t.viewportBounds,e,!1),br(t,!1),n.zb&&(at(n)||n.ce.add(n.H,"scale",e,t.Ca))}}Ct.prototype.onViewportBoundsChanged=function(t,e,i,n){if(!t.D(e)){n===void 0&&(n=!1),n||(this.Ee=!0),this.vd=!0;var s=this.layout;s===null||!s.isViewportSized||this.autoScale!==xa||t.width===e.width&&t.height===e.height||s.C(),s=this.currentTool,this.Vk===!0&&s instanceof Rr&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),kc(s,this)),this.vb||this.invalidateViewport(t,e),Bs(this),this.fc.scale=i,this.fc.position.x=t.x,this.fc.position.y=t.y,this.fc.bounds.assign(t),this.fc.canvasSize.width=Math.round(t.width*i),this.fc.canvasSize.height=Math.round(t.height*i),this.fc.newCanvasSize.width=this.Aa,this.fc.newCanvasSize.height=this.ya,this.fc.isScroll=n,this.R("ViewportBoundsChanged",this.fc,t),this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Yc(e)&&a.bb()})}};function Bs(t,e){var i=t.fe;if(i!==null&&i.visible){for(var n=fe.alloc(),s=1,a=1,l=i.O.s,c=l.length,p=0;p<c;p++){var m=l[p],v=Math.abs(m.interval);2>v||(Zv(m.figure)?a=a*v/xt.vx(a,v):s=s*v/xt.vx(s,v))}if(l=i.gridCellSize,n.h(a*l.width,s*l.height),e!==void 0)s=e.width,a=e.height,t=e.x,l=e.y;else{if(e=Tt.alloc(),t=t.viewportBounds,e.h(t.x,t.y,t.width,t.height),!e.w()){Tt.free(e);return}s=e.width,a=e.height,t=e.x,l=e.y,Tt.free(e)}i.width=s+2*n.width,i.height=a+2*n.height,e=G.alloc(),xt.No(t,l,0,0,n.width,n.height,e),e.offset(-n.width,-n.height),fe.free(n),i.part.location=e,G.free(e)}}Ct.prototype.clearSelection=function(t){t===void 0&&(t=!1);var e=this.selection;if(e.count!==0){t||this.R("ChangingSelection",e);for(var i=e.Fa(),n=i.length,s=0;s<n;s++)i[s].isSelected=!1;e.ka(),e.clear(),e.freeze(),t||this.R("ChangedSelection",e)}},Ct.prototype.select=function(t){t!==null&&t.diagram===this&&(!t.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),this.clearSelection(!0),t.isSelected=!0,this.R("ChangedSelection",this.selection))},Ct.prototype.rA=function(t){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),ui(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];n instanceof bi||Mt("Diagram.selectCollection given something that is not a Part: "+n),n.isSelected=!0}else for(t=t.iterator;t.next();)e=t.value,e instanceof bi||Mt("Diagram.selectCollection given something that is not a Part: "+e),e.isSelected=!0;this.R("ChangedSelection",this.selection)},Ct.prototype.clearHighlighteds=function(){var t=this.highlighteds;if(0<t.count){for(var e=t.Fa(),i=e.length,n=0;n<i;n++)e[n].isHighlighted=!1;t.ka(),t.clear(),t.freeze()}},L=Ct.prototype,L.Iz=function(t){t!==null&&t.diagram===this&&(!t.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),t.isHighlighted=!0)},L.Jz=function(t){t=new te().addAll(t);for(var e=this.highlighteds.copy().hp(t).iterator;e.next();)e.value.isHighlighted=!1;for(t=t.iterator;t.next();)e=t.value,e instanceof bi||Mt("Diagram.highlightCollection given something that is not a Part: "+e),e.isHighlighted=!0},L.scroll=function(t,e,i){i===void 0&&(i=1);var n=e==="up"||e==="down",s=0,a=G.alloc();if(t==="pixel")s=i;else if(t==="line")s=i*(n?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(t==="page")t=n?this.viewportBounds.height:this.viewportBounds.width,t*=this.scale,t!==0&&(s=i*Math.max(t-(n?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if(t==="document"){s=this.documentBounds,i=this.viewportBounds,e==="up"?this.position=a.h(i.x,s.y):e==="left"?this.position=a.h(s.x,i.y):e==="down"?this.position=a.h(i.x,s.bottom-i.height):e==="right"&&(this.position=a.h(s.right-i.width,i.y)),G.free(a);return}Mt("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+t)}s/=this.scale,i=this.position,e==="up"?this.position=a.h(i.x,i.y-s):e==="down"?this.position=a.h(i.x,i.y+s):e==="left"?this.position=a.h(i.x-s,i.y):e==="right"?this.position=a.h(i.x+s,i.y):Mt("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+e),G.free(a)},L.tv=function(t){var e=this.viewportBounds;e.Re(t)||(t=t.center,t.x-=e.width/2,t.y-=e.height/2,this.position=t)},L.es=function(t){var e=this.viewportBounds;t=t.center,t.x-=e.width/2,t.y-=e.height/2,this.position=t},L.op=function(t){var e=this.Ab;e.reset(),this.Ca!==1&&e.scale(this.Ca);var i=this.pa;return(i.x!==0||i.y!==0)&&isFinite(i.x)&&isFinite(i.y)&&e.translate(-i.x,-i.y),t.copy().transform(this.Ab)},L.zA=function(t){var e=this.Ab,i=t.x,n=t.y,s=i+t.width,a=n+t.height,l=e.m11,c=e.m12,p=e.m21,m=e.m22,v=e.dx,w=e.dy,C=i*l+n*p+v;e=i*c+n*m+w;var k=s*l+n*p+v;return t=s*c+n*m+w,n=i*l+a*p+v,i=i*c+a*m+w,l=s*l+a*p+v,s=s*c+a*m+w,a=Math.min(C,k),C=Math.max(C,k),k=Math.min(e,t),e=Math.max(e,t),a=Math.min(a,n),C=Math.max(C,n),k=Math.min(k,i),e=Math.max(e,i),a=Math.min(a,l),C=Math.max(C,l),k=Math.min(k,s),e=Math.max(e,s),new Tt(a,k,C-a,e-k)},L.Ps=function(t){var e=this.Ab;e.reset(),this.Ca!==1&&e.scale(this.Ca);var i=this.pa;return(i.x!==0||i.y!==0)&&isFinite(i.x)&&isFinite(i.y)&&e.translate(-i.x,-i.y),ut(t.copy(),this.Ab)};function _a(t){var e=t.isModified;t.Tw!==e&&(t.Tw=e,t.R("Modified"))}function sh(t){return t=Tc.get(t),t!==null?new t:new Dr}Ct.prototype.doModelChanged=function(t){var e=this;if(t.model===this.model){var i=t.change,n=t.propertyName;if(i===Hl&&n[0]==="S")if(n==="StartingFirstTransaction"){var s=this;t=this.toolManager,t.mouseDownTools.each(function(p){return p.diagram=s}),t.mouseMoveTools.each(function(p){return p.diagram=s}),t.mouseUpTools.each(function(p){return p.diagram=s}),this.ld||this.hf||(this.Jk=!0,this.fn&&(this.kg=!0))}else n==="StartingUndo"||n==="StartingRedo"?(t=this.animationManager,t.defaultAnimation.isAnimating&&!this.skipsUndoManager&&t.Cc(),this.R("ChangingSelection",this.selection)):n==="StartedTransaction"&&(t=this.animationManager,t.defaultAnimation.isAnimating&&!this.skipsUndoManager&&t.Cc());else if(this.aa){this.aa=!1;try{if(t.modelChange===""&&i===Hl){(n==="FinishedUndo"||n==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),Vo(this));var a=this.animationManager;n==="RolledBackTransaction"&&a.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||V(a),n==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1)),n!=="CommittedTransaction"&&n!=="RolledBackTransaction"||!this.undoManager.isPendingUnmodified||setTimeout(function(){e.isModified=!1},1);var l=t.isTransactionFinished;if(l&&(_a(this),this.As.clear(),_t(this.animationManager)),!this.Rt&&l&&this.lastInput.targetDiagram){this.Rt=!0;var c=this;Ce(function(){c.currentTool.standardMouseOver(),c.Rt=!1},10)}}}finally{this.aa=!0}}}};function Wl(t,e){e=e.O.s;for(var i=e.length,n=0;n<i;n++)Du(t,e[n])}function Du(t,e){if(e instanceof hh){var i=e.element;if(i!==null&&i instanceof HTMLImageElement){i.Bg instanceof te&&i.Bg.add(t);var n=e.Eg;if(n!==null&&n.sq===!0&&e.diagram!==null&&e.diagram.Xn.add(e),i.hn)if(i=i.getAttribute("src")||"",n=t.Og.I(i),n===null)n=[],n.push(e),t.Og.add(i,n);else{for(t=0;t<n.length;t++)if(n[t]===e)return;n.push(e)}}}}function cl(t,e){if(e instanceof hh){var i=e.element;if(i!==null&&i instanceof HTMLImageElement&&i.hn){var n=i.getAttribute("src")||"",s=t.Og.I(n);if(s!==null){for(var a=0;a<s.length;a++)if(s[a]===e){s.splice(a,1),s.length===0&&(t.Og.remove(n),i.Fq&&i.removeEventListener("load",i.Fq),i.Yp&&i.removeEventListener("error",i.Yp),delete i.Fq,delete i.Yp,i.Bg instanceof te&&i.Bg.remove(t),W0(n));break}}}}}Ct.prototype.Wd=function(){this.partManager.Wd()},Ct.prototype.Aj=function(t,e){this.Yd.Aj(t,e)},Ct.prototype.Cj=function(t,e){this.Yd.Cj(t,e)},Ct.prototype.findPartForKey=function(t){return this.partManager.findPartForKey(t)},Ct.prototype.Vb=function(t){return this.partManager.Vb(t)},Ct.prototype.findLinkForKey=function(t){return this.partManager.findLinkForKey(t)},L=Ct.prototype,L.Lc=function(t){return this.partManager.Lc(t)},L.ii=function(t){return this.partManager.ii(t)},L.Kc=function(t){return this.partManager.Kc(t)},L.ms=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];return this.partManager.ms.apply(this.partManager,e instanceof Array?e:Si(qe(e)))},L.ls=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];return this.partManager.ls.apply(this.partManager,e instanceof Array?e:Si(qe(e)))};function Ds(t){var e=t.pa,i=t.Ca;t.Rw.h(e.x,e.y,Math.max(t.Aa,0)/i,Math.max(t.ya,0)/i),t.vd=!0}function ku(t,e){t.Zi=!1;var i=t.Sp;i.D(e)||(i=i.copy(),t.Sp.assign(e),br(t,!1),t.R("DocumentBoundsChanged",void 0,i),t.Ee=!0,t.N())}L.Va=function(){if(this.Zi){var t=Tt.alloc();ku(this,this.computeBounds(t)),Tt.free(t)}},L.rz=function(){for(var t=new te,e=this.nodes;e.next();){var i=e.value;i.isTopLevel&&t.add(i)}for(e=this.links;e.next();)i=e.value,i.isTopLevel&&t.add(i);return t.iterator},L.qz=function(){return this.ai.iterator},L.Uz=function(t){Vo(this),t&&ah(this,!0),this.ld?Vh(this,!1):(this.Jk=!0,Rs(this))};function ah(t,e){for(var i=t.ai.iterator;i.next();)Lc(t,i.value,e);t.layout&&(e?t.layout.isValidLayout=!1:t.layout.C())}function Lc(t,e,i){if(e!==null){for(var n=e.gl.iterator;n.next();)Lc(t,n.value,i);e.layout!==null&&(i?e.layout.isValidLayout=!1:e.layout.C())}}function Vh(t,e){if(t.xh&&!t.lt){var i=t.aa;t.aa=!0;var n=t.undoManager.transactionLevel,s=t.layout,a=t.animationManager;try{n===0&&(t.undoManager.isInternalTransaction=!0,t.Ea("Layout")),1>=n&&!a.defaultAnimation.isAnimating&&!a.zb&&(e||R(a,"Layout")),t.xh=!1;for(var l=t.ai.iterator;l.next();)mu(t,l.value,e,n);s.isValidLayout||(!e||s.isRealtime||s.isRealtime===null||n===0?(s.doLayout(t),Vo(t),s.isValidLayout=!0):t.xh=!0)}finally{e=t.undoManager.isInternalTransaction,n===0&&(t.eb("Layout"),t.undoManager.isInternalTransaction=!1),!e||n!==0&&n!==1||V(a),t.aa=i}}}function mu(t,e,i,n){if(e!==null){for(var s=e.gl.iterator;s.next();)mu(t,s.value,i,n);s=e.layout,s===null||s.isValidLayout||(!i||s.isRealtime||n===0?(e.rh=!e.location.w(),s.doLayout(e),e.C(32),ha(t,e),s.isValidLayout=!0):t.xh=!0)}}L.yz=function(){for(var t=new ue,e=this.nodes;e.next();){var i=e.value;i.isTopLevel&&i.kh()===null&&t.add(i)}return t.iterator};function Nf(t){function e(s){var a=s.toLowerCase(),l=new ue;i.add(s,l),i.add(a,l),n.add(s,s),n.add(a,s)}var i=new ci,n=new ci;e("InitialAnimationStarting"),e("AnimationStarting"),e("AnimationFinished"),e("BackgroundSingleClicked"),e("BackgroundDoubleClicked"),e("BackgroundContextClicked"),e("ClipboardChanged"),e("ClipboardPasted"),e("DocumentBoundsChanged"),e("ExternalObjectsDropped"),e("GainedFocus"),e("InitialLayoutCompleted"),e("LayoutCompleted"),e("LinkDrawn"),e("LinkRelinked"),e("LinkReshaped"),e("LostFocus"),e("Modified"),e("ObjectSingleClicked"),e("ObjectDoubleClicked"),e("ObjectContextClicked"),e("PartCreated"),e("PartResized"),e("PartRotated"),e("SelectionMoved"),e("SelectionCopied"),e("SelectionDeleting"),e("SelectionDeleted"),e("SelectionGrouped"),e("SelectionUngrouped"),e("ChangingSelection"),e("ChangedSelection"),e("SubGraphCollapsed"),e("SubGraphExpanded"),e("TextEdited"),e("TreeCollapsed"),e("TreeExpanded"),e("ViewportBoundsChanged"),e("InvalidateDraw"),t.iw=i,t.hw=n}function gu(t,e){var i=t.hw.I(e);return i!==null?i:t.hw.I(e.toLowerCase())}function Dh(t,e){var i=t.iw.I(e);if(i!==null||(i=t.iw.I(e.toLowerCase()),i!==null))return i;Mt("Unknown DiagramEvent name: "+e)}L.Bj=function(t,e){return t=Dh(this,t),t!==null&&t.add(e),this},L.am=function(t,e){t=Dh(this,t),t!==null&&t.remove(e)},L.R=function(t,e,i){var n=Dh(this,t),s=new sa;if(s.diagram=this,t=gu(this,t),t!==null&&(s.name=t),e!==void 0&&(s.subject=e),i!==void 0&&(s.parameter=i),e=n.length,e===1)n.M(0)(s);else if(e!==0)for(n=n.Fa(),i=0;i<e;i++)(0,n[i])(s)};function ou(t){if(t.animationManager.isTicking)return!1;var e=t.currentTool;return e===t.toolManager.findTool("Dragging")?!t.Mr||e.isComplexRoutingRealtime:!0}L.Yj=function(t,e){return Wh(this,!1,null,e||null).Yj(t.x,t.y,t.width,t.height)},Ct.prototype.computeOccupiedArea=function(t){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Je(this,t):t.assign(this.documentBounds)};function Wh(t,e,i,n){var s=t.Xh;if(s===null&&(t.Xh=s=new a0(t.avoidanceCellSize)),s.vs||s.group!==i||s.Yx!==n){if(s.Hx=Math.max(s.Os+1,Math.floor(t.avoidanceLimit/t.avoidanceCellSize.width)),s.Ix=Math.max(s.Os+1,Math.floor(t.avoidanceLimit/t.avoidanceCellSize.height)),i!==null&&(i=Af(t,i)),i===null){e=Tt.alloc(),t.computeOccupiedArea(e),e.Bc(100,100),s.initialize(e);for(var a=t.nodes;a.next();){var l=a.value,c=l.layer;c!==null&&c.visible&&!c.isTemporary&&Yc(t,l,n,e)}Tt.free(e)}else{for(0<i.memberParts.count&&(e=t.computePartsBounds(i.memberParts,!1),e.Bc(20,20),s.initialize(e)),e=Tt.alloc(),a=i.memberParts;a.next();)l=a.value,l instanceof Ee&&Yc(t,l,n,e);Tt.free(e)}s.group=i,s.Yx=n,s.vs=!1}else e&&b1(s);return s}function Af(t,e){return e.avoidable&&!e.isLinkLabel?e:e.containingGroup!==null?Af(t,e.containingGroup):null}function Yc(t,e,i,n){if(e!==i&&e.isVisible()){if(e.avoidable&&!e.isLinkLabel){e=e.getAvoidableRect(n),t=t.Xh;var s=e.x,a=e.y;if(tm(t,s,a))for(i=(a-t.Od)/t.sc|0,n=Math.min((s+e.width-t.Nd)/t.rc|0,t.di),e=Math.min((a+e.height-t.Od)/t.sc|0,t.ei),s=(s-t.Nd)/t.rc|0;s<=n;s++)if(a=t.ac[s],a.fill)a.fill(jf,i,e+1);else for(var l=i;l<=e;l++)a[l]=jf}else if(e instanceof Yi)for(e=e.memberParts;e.next();)s=e.value,s instanceof Ee&&Yc(t,s,i,n)}}function Ku(t,e){t.Xh===null||t.Xh.vs||e!==void 0&&(!e.avoidable||e.isLinkLabel)||(t.Xh.vs=!0)}Ct.prototype.gs=function(t){this.wp.assign(t),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():Df(this)};function Df(t){t.vk===-1&&(t.vk=Ce(function(){if(t.vk!==-1&&(t.ug(),t.lastInput.event!==null)){var e=t.computeAutoScrollPosition(t.wp);e.Xa(t.position)||(t.position=e,t.lastInput.documentPoint=t.Ps(t.wp),t.doMouseMove(),t.Zi=!0,e=Tt.alloc(),t.computeBounds(e),e.ed(t.documentBounds),ku(t,e),Tt.free(e),t.Fc=!0,t.bd(),Df(t))}},t.vp))}Ct.prototype.ug=function(){this.vk!==-1&&(Kt.clearTimeout(this.vk),this.vk=-1)},Ct.prototype.computeAutoScrollPosition=function(t){var e=this.position,i=this.xp;if(0>=i.top&&0>=i.left&&0>=i.right&&0>=i.bottom)return e;var n=this.viewportBounds,s=this.scale;n=Tt.allocAt(0,0,n.width*s,n.height*s);var a=G.allocAt(0,0);if(t.x>=n.x&&t.x<n.x+i.left&&this.allowHorizontalScroll){var l=Math.max(this.scrollHorizontalLineChange,1);l|=0,a.x-=l,t.x<n.x+i.left/2&&(a.x-=l),t.x<n.x+i.left/4&&(a.x-=4*l)}else t.x<=n.x+n.width&&t.x>n.x+n.width-i.right&&this.allowHorizontalScroll&&(l=Math.max(this.scrollHorizontalLineChange,1),l|=0,a.x+=l,t.x>n.x+n.width-i.right/2&&(a.x+=l),t.x>n.x+n.width-i.right/4&&(a.x+=4*l));return t.y>=n.y&&t.y<n.y+i.top&&this.allowVerticalScroll?(l=Math.max(this.scrollVerticalLineChange,1),l|=0,a.y-=l,t.y<n.y+i.top/2&&(a.y-=l),t.y<n.y+i.top/4&&(a.y-=4*l)):t.y<=n.y+n.height&&t.y>n.y+n.height-i.bottom&&this.allowVerticalScroll&&(l=Math.max(this.scrollVerticalLineChange,1),l|=0,a.y+=l,t.y>n.y+n.height-i.bottom/2&&(a.y+=l),t.y>n.y+n.height-i.bottom/4&&(a.y+=4*l)),a.Xa(Wa)||(e=new G(e.x+a.x/s,e.y+a.y/s)),Tt.free(n),G.free(a),e},L=Ct.prototype,L.Cs=function(){return null},L.av=function(){return null},L.bs=function(t,e){this.pj.add(t,e)},L.Fu=function(t){(this.Pw=t)||this.nodes.each(function(e){e instanceof Yi&&(e.$p=null)})};function Jc(t,e,i){function n(){var v=+new Date;for(a=!0,l.reset();l.next();)if(!l.value[0].al){a=!1;break}a||v-m>p?e(i,s,c):Kt.requestAnimationFrame(n)}for(var s=i.callback,a=!0,l=t.Og.iterator;l.next();)if(!l.value[0].al){a=!1;break}if(typeof s!="function"||a)return e(i,s,t);var c=t,p=i.callbackTimeout||300,m=+new Date;return Kt.requestAnimationFrame(function(){n()}),null}L.Wz=function(t){return ur?(t===void 0&&(t={}),t.returnType="Image",this.Jx(t)):null},L.Jx=function(t){return t===void 0&&(t={}),Jc(this,this.Xz,t)},L.Xz=function(t,e,i){var n=Bc(i,t,"canvas",null);if(n===null)return null;i=n.Z.canvas;var s=null;if(i!==null)switch(s=t.returnType,s===void 0?s="string":s=s.toLowerCase(),s){case Of+"data":s=n.getImageData(0,0,i.width,i.height);break;case Of:n=(t.document||document).createElement("img"),n.src=i.toDataURL(t.type,t.details),s=n;break;case"blob":return typeof e!="function"&&Mt('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),typeof i.toBlob=="function"?(i.toBlob(e,t.type,t.details),"toBlob"):(e(null),null);default:s=i.toDataURL(t.type,t.details)}return typeof e=="function"?(e(s),null):s};function Bc(t,e,i,n){if(t.animationManager.Cc(),t.bd(),t.ta===null)return null;typeof e!="object"&&Mt("properties argument must be an Object.");var s=e.size||null,a=e.scale||null;e.scale!==void 0&&isNaN(e.scale)&&(a="NaN");var l=e.maxSize;e.maxSize===void 0&&(l=i==="SVG"?new fe(1/0,1/0):new fe(2e3,2e3));var c=e.position||null,p=e.parts||null,m=e.padding===void 0?1:e.padding,v=e.background||null,w=e.omitTemporary;w===void 0&&(w=!0);var C=e.document||document,k=e.elementFinished||null,T=e.showTemporary;T===void 0&&(T=!w),e=e.showGrid,e===void 0&&(e=T),s!==null&&isNaN(s.width)&&isNaN(s.height)&&(s=null),typeof m=="number"?m=new Ai(m):m instanceof Ai||Mt("MakeImage padding must be a Margin or a number."),m.left=Math.max(m.left,0),m.right=Math.max(m.right,0),m.top=Math.max(m.top,0),m.bottom=Math.max(m.bottom,0),t.ib.Vc(!0),w=new Pc(null,C,void 0,!0);var A=w.context;if(!(s||a||p||c))return w.width=t.Aa+Math.ceil(m.left+m.right),w.height=t.ya+Math.ceil(m.top+m.bottom),i==="SVG"?n===null?null:(n.resize(w.width,w.height,w.width,w.height),n.ownerDocument=C,n.hs=k,Zs(t,n.context,m,new fe(w.width,w.height),t.Ca,t.pa,p,v,T,e),n.context):(t.Xm=!1,Zs(t,A,m,new fe(w.width,w.height),t.Ca,t.pa,p,v,T,e),t.Xm=!0,w.context);var X=t.Pp,$=t.documentBounds.copy();if($.Fv(t.yb),T)for(var J=t.Wa.s,et=J.length,st=0;st<et;st++){var mt=J[st];if(mt.visible&&mt.isTemporary){mt=mt.Pa.s;for(var Pt=mt.length,De=0;De<Pt;De++){var ti=mt[De];ti.isInDocumentBounds&&ti.isVisible()&&(ti=ti.actualBounds,ti.w()&&$.ed(ti))}}}if(J=new G($.x,$.y),p!==null){for(et=new Tt(0,0,0,0),st=!0,mt=p.iterator,mt.reset();mt.next();)Pt=mt.value,Pt instanceof bi&&(De=Pt.layer,De!==null&&!De.visible||De!==null&&!T&&De.isTemporary||!Pt.isVisible()||(Pt=Pt.actualBounds,Pt.w()&&(st?(st=!1,et.assign(Pt)):et.ed(Pt))));$.width=et.width,$.height=et.height,J.x=et.x,J.y=et.y}return c!==null&&c.w()&&(J=c,a||(a=X)),et=c=0,m!==null&&(c=m.left+m.right,et=m.top+m.bottom),st=mt=0,s!==null&&(mt=s.width,st=s.height,isFinite(mt)&&(mt=Math.max(0,mt-c)),isFinite(st)&&(st=Math.max(0,st-et))),s!==null&&a!==null?(a==="NaN"&&(a=X),s.w()?(s=mt,$=st):isNaN(st)?(s=mt,$=$.height*a):(s=$.width*a,$=st)):s!==null?s.w()?(a=Math.min(mt/$.width,st/$.height),s=mt,$=st):isNaN(st)?(a=mt/$.width,s=mt,$=$.height*a):(a=st/$.height,s=$.width*a,$=st):a!==null?a==="NaN"&&l.w()?(a=Math.min((l.width-c)/$.width,(l.height-et)/$.height),a>X?(a=X,s=$.width,$=$.height):(s=l.width,$=l.height)):(s=$.width*a,$=$.height*a):(a=X,s=$.width,$=$.height),m!==null?(s+=c,$+=et):m=new Ai(0),l!==null&&(X=l.width,l=l.height,isNaN(X)&&(X=2e3),isNaN(l)&&(l=2e3),isFinite(X)&&(s=Math.min(s,X)),isFinite(l)&&($=Math.min($,l))),w.width=Math.ceil(s),w.height=Math.ceil($),i==="SVG"?n===null?null:(n.resize(w.width,w.height,w.width,w.height),n.ownerDocument=C,n.hs=k,Zs(t,n.context,m,new fe(Math.ceil(s),Math.ceil($)),a,J,p,v,T,e),n.context):(t.Xm=!1,Zs(t,A,m,new fe(Math.ceil(s),Math.ceil($)),a,J,p,v,T,e),t.Xm=!0,w.context)}St.Object.defineProperties(Ct.prototype,{renderer:{get:function(){return this.nl},set:function(t){this instanceof S||(t===""&&(t="default"),t=t.toLowerCase(),t!==this.nl&&(this.nl=t,t==="default"||t==="canvas"?(t=this.pj.get("svg"),t!==null&&t.Oa.remove(),this.ta&&(this.ib=this.ta.context)):t==="svg"?(this.pj.contains("svg")?t=this.pj.get("svg"):(t=new tf(this,Kt.document),this.bs("svg",t)),this.div!==null&&this.div.appendChild(t.Oa),this.ib=t.context,this.ta&&(this.ta.context.setTransform(this.Mb,0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):t!=="debug"||this.pj.contains("SVG")||(t=new tf(this,Kt.document),this.bs("SVG",t),t.Oa.style.backgroundColor="whitesmoke",this.div!==null&&this.div.after(t.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(t){if(this.Ka!==t){var e=this.Ka;e!==null?(e.H=void 0,e.goDiagram=void 0,e.go=void 0,e.innerHTML="",this.ta!==null&&(e=this.ta.Oa,this.removeEventListener(e,"pointermove",this.dk,!1),this.removeEventListener(e,"pointerdown",this.ui,!1),this.removeEventListener(e,"pointerup",this.fk,!1),this.removeEventListener(e,"pointerout",this.ek,!1),this.removeEventListener(e,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),e=this.toolManager,e!==null&&(e.mouseDownTools.each(function(i){i.cancelWaitAfter()}),e.mouseMoveTools.each(function(i){i.cancelWaitAfter()}),e.mouseUpTools.each(function(i){i.cancelWaitAfter()})),e.cancelWaitAfter(),this.currentTool.doCancel(),this.ta=null,this.removeEventListener(Kt,"resize",this.Ov,!1),this.removeEventListener(Kt,"wheel",this.$j,!0),Mn===this&&(Mn=null)):this.ui===null&&(this.hf=!1),this.Ka=null,t!==null&&((e=t.H)&&(e.div=null),Pn(this,t),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(t){this.nt!==t&&(this.nt=t,t!==null&&(this.Vt=t.fromPort,this.Wt=t.toPort))}},Mx:{get:function(){return this.Vt},set:function(t){this.Vt=t}},Nx:{get:function(){return this.Wt},set:function(t){this.Wt=t}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(t){this.Wg=t,this.cc.skipsUndoManager=t}},delaysLayout:{get:function(){return this.lt},set:function(t){this.lt=t}},opacity:{get:function(){return this.pb},set:function(t){var e=this.pb;e!==t&&((0>t||1<t)&&Re(t,"0 <= value <= 1",Ct,"opacity"),this.pb=t,this.g("opacity",e,t),this.N())}},validCycle:{get:function(){return this.wu},set:function(t){var e=this.wu;e!==t&&(this.wu=t,this.g("validCycle",e,t))}},layers:{get:function(){return this.Wa.iterator}},isModelReadOnly:{get:function(){var t=this.cc;return t===null?!1:t.isReadOnly},set:function(t){var e=this.cc;e!==null&&(e.isReadOnly=t)}},isReadOnly:{get:function(){return this.Gg},set:function(t){var e=this.Gg;e!==t&&(this.Gg=t,this.g("isReadOnly",e,t))}},isEnabled:{get:function(){return this.Jd},set:function(t){var e=this.Jd;e!==t&&(this.Jd=t,this.g("isEnabled",e,t))}},allowClipboard:{get:function(){return this.Us},set:function(t){var e=this.Us;e!==t&&(this.Us=t,this.g("allowClipboard",e,t))}},allowCopy:{get:function(){return this.Fi},set:function(t){var e=this.Fi;e!==t&&(this.Fi=t,this.g("allowCopy",e,t))}},allowDelete:{get:function(){return this.Gi},set:function(t){var e=this.Gi;e!==t&&(this.Gi=t,this.g("allowDelete",e,t))}},allowDragOut:{get:function(){return this.Vs},set:function(t){var e=this.Vs;e!==t&&(this.Vs=t,this.g("allowDragOut",e,t))}},allowDrop:{get:function(){return this.Ws},set:function(t){var e=this.Ws;e!==t&&(this.Ws=t,this.g("allowDrop",e,t))}},allowTextEdit:{get:function(){return this.Pi},set:function(t){var e=this.Pi;e!==t&&(this.Pi=t,this.g("allowTextEdit",e,t))}},allowGroup:{get:function(){return this.Hi},set:function(t){var e=this.Hi;e!==t&&(this.Hi=t,this.g("allowGroup",e,t))}},allowUngroup:{get:function(){return this.Qi},set:function(t){var e=this.Qi;e!==t&&(this.Qi=t,this.g("allowUngroup",e,t))}},allowInsert:{get:function(){return this.Ys},set:function(t){var e=this.Ys;e!==t&&(this.Ys=t,this.g("allowInsert",e,t))}},allowLink:{get:function(){return this.Ii},set:function(t){var e=this.Ii;e!==t&&(this.Ii=t,this.g("allowLink",e,t))}},allowRelink:{get:function(){return this.Ki},set:function(t){var e=this.Ki;e!==t&&(this.Ki=t,this.g("allowRelink",e,t))}},allowMove:{get:function(){return this.Ji},set:function(t){var e=this.Ji;e!==t&&(this.Ji=t,this.g("allowMove",e,t))}},allowReshape:{get:function(){return this.Li},set:function(t){var e=this.Li;e!==t&&(this.Li=t,this.g("allowReshape",e,t))}},allowResize:{get:function(){return this.Mi},set:function(t){var e=this.Mi;e!==t&&(this.Mi=t,this.g("allowResize",e,t))}},allowRotate:{get:function(){return this.Ni},set:function(t){var e=this.Ni;e!==t&&(this.Ni=t,this.g("allowRotate",e,t))}},allowSelect:{get:function(){return this.Oi},set:function(t){var e=this.Oi;e!==t&&(this.Oi=t,this.g("allowSelect",e,t))}},allowUndo:{get:function(){return this.Zs},set:function(t){var e=this.Zs;e!==t&&(this.Zs=t,this.g("allowUndo",e,t))}},allowZoom:{get:function(){return this.at},set:function(t){var e=this.at;e!==t&&(this.at=t,this.g("allowZoom",e,t))}},hasVerticalScrollbar:{get:function(){return this.nn},set:function(t){var e=this.nn;e!==t&&(this.nn=t,this.Ee=!0,this.N(),this.g("hasVerticalScrollbar",e,t),br(this,!1))}},hasHorizontalScrollbar:{get:function(){return this.mn},set:function(t){var e=this.mn;e!==t&&(this.mn=t,this.Ee=!0,this.N(),this.g("hasHorizontalScrollbar",e,t),br(this,!1))}},allowHorizontalScroll:{get:function(){return this.Xs},set:function(t){var e=this.Xs;e!==t&&(this.Xs=t,this.g("allowHorizontalScroll",e,t),br(this,!1))}},allowVerticalScroll:{get:function(){return this.$s},set:function(t){var e=this.$s;e!==t&&(this.$s=t,this.g("allowVerticalScroll",e,t),br(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(t){var e=this.iu;e!==t&&(0>t&&Re(t,">= 0",Ct,"scrollHorizontalLineChange"),this.iu=t,this.g("scrollHorizontalLineChange",e,t))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(t){var e=this.mu;e!==t&&(0>t&&Re(t,">= 0",Ct,"scrollVerticalLineChange"),this.mu=t,this.g("scrollVerticalLineChange",e,t))}},lastInput:{get:function(){return this.cj},set:function(t){this.cj=t}},previousInput:{get:function(){return this.Qg},set:function(t){this.Qg=t}},firstInput:{get:function(){return this.bq},set:function(t){this.bq=t}},currentCursor:{get:function(){return this.it},set:function(t){if(t===""&&(t=this.Op),this.it!==t){var e=this.ta,i=this.Ka;if(e!==null&&i!==null){this.it=t;var n=e.style.cursor;e.style.cursor=t,i.style.cursor=t,e.style.cursor===n&&(e.style.cursor="-webkit-"+t,i.style.cursor="-webkit-"+t,e.style.cursor===n&&(e.style.cursor="-moz-"+t,i.style.cursor="-moz-"+t,e.style.cursor===n&&(e.style.cursor=t,i.style.cursor=t)))}}}},defaultCursor:{get:function(){return this.Op},set:function(t){t===""&&(t="auto");var e=this.Op;e!==t&&(this.Op=t,this.g("defaultCursor",e,t))}},click:{get:function(){return this.zh},set:function(t){var e=this.zh;e!==t&&(this.zh=t,this.g("click",e,t))}},doubleClick:{get:function(){return this.Fh},set:function(t){var e=this.Fh;e!==t&&(this.Fh=t,this.g("doubleClick",e,t))}},contextClick:{get:function(){return this.Bh},set:function(t){var e=this.Bh;e!==t&&(this.Bh=t,this.g("contextClick",e,t))}},mouseOver:{get:function(){return this.Qh},set:function(t){var e=this.Qh;e!==t&&(this.Qh=t,this.g("mouseOver",e,t))}},mouseHover:{get:function(){return this.Oh},set:function(t){var e=this.Oh;e!==t&&(this.Oh=t,this.g("mouseHover",e,t))}},mouseHold:{get:function(){return this.Nh},set:function(t){var e=this.Nh;e!==t&&(this.Nh=t,this.g("mouseHold",e,t))}},mouseDragOver:{get:function(){return this.Qt},set:function(t){var e=this.Qt;e!==t&&(this.Qt=t,this.g("mouseDragOver",e,t))}},mouseDrop:{get:function(){return this.Lh},set:function(t){var e=this.Lh;e!==t&&(this.Lh=t,this.g("mouseDrop",e,t))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(t){var e=this.xt;e!==t&&(this.xt=t,this.g("handlesDragDropForTopLevelParts",e,t))}},mouseEnter:{get:function(){return this.Mh},set:function(t){var e=this.Mh;e!==t&&(this.Mh=t,this.g("mouseEnter",e,t))}},mouseLeave:{get:function(){return this.Ph},set:function(t){var e=this.Ph;e!==t&&(this.Ph=t,this.g("mouseLeave",e,t))}},toolTip:{get:function(){return this.$h},set:function(t){var e=this.$h;e!==t&&(this.$h=t,this.g("toolTip",e,t))}},contextMenu:{get:function(){return this.Ch},set:function(t){var e=this.Ch;e!==t&&(this.Ch=t,this.g("contextMenu",e,t))}},commandHandler:{get:function(){return this.nb},set:function(t){this.nb!==t&&(this.nb=t,t.Xe(this))}},toolManager:{get:function(){return this.te},set:function(t){this.te!==t&&(this.te=t,t.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(t){var e=this.ob;e!==t&&(this.ob=t,t.diagram=this,this.currentTool===e&&(this.currentTool=t))}},currentTool:{get:function(){return this.hb},set:function(t){var e=this.hb;e&&(e.isActive&&e.doDeactivate(),e.cancelWaitAfter(),e.doStop()),t===null&&(t=this.defaultTool),t!==null&&(this.hb=t,t.diagram=this,t.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(t){var e=this.Nt;if(e!==t)if(0<=t&&!isNaN(t)){if(this.Nt=t,this.g("maxSelectionCount",e,t),!this.undoManager.isUndoingRedoing&&(t=this.selection.count-t,0<t)){this.R("ChangingSelection",this.selection),e=this.selection.Fa();for(var i=0;i<t;i++)e[i].isSelected=!1;this.R("ChangedSelection",this.selection)}}else Re(t,">= 0",Ct,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(t){var e=this.St;e!==t&&(this.St=t,this.g("nodeSelectionAdornmentTemplate",e,t))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(t){var e=this.wt;e!==t&&(this.wt=t,this.g("groupSelectionAdornmentTemplate",e,t))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(t){var e=this.Kt;e!==t&&(this.Kt=t,this.g("linkSelectionAdornmentTemplate",e,t))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var t=this.undoManager;return t.isEnabled?t.currentTransaction!==null?!0:this.rn&&this.Ce!==t.historyIndex:this.rn},set:function(t){if(this.rn!==t){this.rn=t;var e=this.undoManager;!t&&e.isEnabled&&(this.Ce=e.historyIndex),t||_a(this)}}},model:{get:function(){return this.cc},set:function(t){var e=this.cc;if(e!==t){this.currentTool.doCancel(),e&&e.undoManager!==t.undoManager&&e.undoManager.isInTransaction&&Mt("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var i=ws(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var n=this.vb;this.vb=!0,R(this.animationManager,"Model"),e&&(this.pf!==null&&this.pf.each(function(a){return e.ik(a)}),e.ik(this.Oc)),this.cc=t,this.partManager=sh(this.cc.type);for(var s=0;s<i.length;s++)this.add(i[s]);t.Pe(this.Hb),this.partManager.addAllModeledParts(),t.ik(this.Hb),t.Pe(this.Oc),this.pf!==null&&this.pf.each(function(a){return t.Pe(a)}),this.vb=n,this.Ya(),this.vb||this.N(),e&&t.undoManager.copyProperties(e.undoManager)}}},aa:{get:function(){return this.rw},set:function(t){this.rw=t}},As:{get:function(){return this.sy}},skipsModelSourceBindings:{get:function(){return this.Iw},set:function(t){this.Iw=t}},Ns:{get:function(){return this.ou},set:function(t){this.ou=t}},nodeTemplate:{get:function(){return this.Lg.I("")},set:function(t){var e=this.Lg.I("");e!==t&&(this.Lg.add("",t),this.g("nodeTemplate",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},nodeTemplateMap:{get:function(){return this.Lg},set:function(t){var e=this.Lg;e!==t&&(this.Lg=t,this.g("nodeTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplate:{get:function(){return this.Yi.I("")},set:function(t){var e=this.Yi.I("");e!==t&&(this.Yi.add("",t),this.g("groupTemplate",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplateMap:{get:function(){return this.Yi},set:function(t){var e=this.Yi;e!==t&&(this.Yi=t,this.g("groupTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplate:{get:function(){return this.Kh.I("")},set:function(t){var e=this.Kh.I("");e!==t&&(this.Kh.add("",t),this.g("linkTemplate",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplateMap:{get:function(){return this.Kh},set:function(t){var e=this.Kh;e!==t&&(this.Kh=t,this.g("linkTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Wd())}},isMouseCaptured:{get:function(){return this.qw},set:function(t){var e=this.ta;e!==null&&(e=e.Oa,e instanceof SVGElement||(t?(this.lastInput.bubbles=!1,this.removeEventListener(e,"pointermove",this.dk,!1),this.removeEventListener(e,"pointerdown",this.ui,!1),this.removeEventListener(e,"pointerup",this.fk,!1),this.removeEventListener(e,"pointerout",this.ek,!1),this.removeEventListener(e,"pointercancel",this.ck,!1),this.addEventListener(Kt,"pointermove",this.dk,!0),this.addEventListener(Kt,"pointerdown",this.ui,!0),this.addEventListener(Kt,"pointerup",this.fk,!0),this.addEventListener(Kt,"pointerout",this.ek,!0),this.addEventListener(Kt,"pointercancel",this.ck,!0),this.removeEventListener(e,"wheel",this.$j,!1),this.addEventListener(Kt,"wheel",this.$j,!0),this.addEventListener(Kt,"selectstart",this.preventDefault,!1)):(this.removeEventListener(Kt,"pointermove",this.dk,!0),this.removeEventListener(Kt,"pointerdown",this.ui,!0),this.removeEventListener(Kt,"pointerup",this.fk,!0),this.removeEventListener(Kt,"pointerout",this.ek,!0),this.removeEventListener(Kt,"pointercancel",this.ck,!0),this.addEventListener(e,"pointermove",this.dk,!1),this.addEventListener(e,"pointerdown",this.ui,!1),this.addEventListener(e,"pointerup",this.fk,!1),this.addEventListener(e,"pointerout",this.ek,!1),this.addEventListener(e,"pointercancel",this.ck,!1),this.removeEventListener(Kt,"wheel",this.$j,!0),this.removeEventListener(Kt,"selectstart",this.preventDefault,!1),this.addEventListener(e,"wheel",this.$j,!1)),this.qw=t))}},position:{get:function(){return this.pa},set:function(t){var e=G.alloc().assign(this.pa);if(!e.D(t)){var i=this.viewportBounds.copy();this.pa.assign(t),Xe(this.animationManager,e,this.pa),this.vb||this.ta===null&&!this.wo.w()?Ds(this):(this.vb=!0,t=this.scale,lr(this,this.Sp,this.Aa/t,this.ya/t,this.zk,!1),this.vb=!1),this.vb||this.onViewportBoundsChanged(i,this.viewportBounds,this.Ca,!1)}G.free(e)}},initialPosition:{get:function(){return this.zt},set:function(t){this.zt.D(t)||(this.zt=t.J())}},initialScale:{get:function(){return this.At},set:function(t){this.At!==t&&(this.At=t)}},grid:{get:function(){return this.fe===null&&(this.fe=ar(this)),this.fe},set:function(t){var e=this.fe;if(e!==t){e===null&&(e=this.fe=ar(this)),t.type!==ce.Grid&&Mt("Diagram.grid must be a Panel of type Panel.Grid");var i=e.panel;i!==null&&i.remove(e),this.fe=t,t.name="GRID",i!==null&&i.add(t),Bs(this),this.N(),this.g("grid",e,t)}}},viewportBounds:{get:function(){return this.Rw}},viewSize:{get:function(){return this.wo},set:function(t){var e=this.viewSize;e.D(t)||(this.wo=t=t.J(),this.ya=this.Aa=0,t.w()?(this.Aa=t.width,this.ya=t.height):this.Ka!==null&&(this.Aa=this.Ka.clientWidth||1,this.ya=this.Ka.clientHeight||1),Ds(this),this.Ya(),this.g("viewSize",e,t),this.redraw())}},fixedBounds:{get:function(){return this.ut},set:function(t){var e=this.ut;e.D(t)||(t.width!==-1/0&&t.height!==1/0&&t.height!==-1/0||Mt("fixedBounds width/height must not be Infinity"),this.ut=t=t.J(),this.Ya(),this.g("fixedBounds",e,t))}},scrollMargin:{get:function(){return this.rj},set:function(t){typeof t=="number"&&(t=new Ai(t));var e=this.rj;e.D(t)||(this.rj=t=t.J(),this.g("scrollMargin",e,t),this.hk())}},scrollMode:{get:function(){return this.sj},set:function(t){var e=this.sj;e!==t&&(this.sj=t,t===Xl&&br(this,!1),this.g("scrollMode",e,t),this.Ee=!0,this.N())}},scrollsPageOnFocus:{get:function(){return this.nu},set:function(t){var e=this.nu;e!==t&&(this.nu=t,this.g("scrollsPageOnFocus",e,t))}},positionComputation:{get:function(){return this.Zt},set:function(t){var e=this.Zt;e!==t&&(this.Zt=t,br(this,!1),this.g("positionComputation",e,t))}},scaleComputation:{get:function(){return this.fu},set:function(t){var e=this.fu;e!==t&&(this.fu=t,to(this,this.scale,this.scale),this.g("scaleComputation",e,t))}},documentBounds:{get:function(){return this.Sp}},isVirtualized:{get:function(){return this.It},set:function(t){var e=this.It;e!==t&&(this.It=t,this.g("isVirtualized",e,t))}},scale:{get:function(){return this.Ca},set:function(t){var e=this.Ca;e!==t&&to(this,e,t)}},defaultScale:{get:function(){return this.Pp},set:function(t){this.Pp=t}},autoScale:{get:function(){return this.yh},set:function(t){var e=this.yh;e!==t&&(this.yh=t,this.g("autoScale",e,t),t!==xa&&br(this,!1))}},initialAutoScale:{get:function(){return this.Fg},set:function(t){var e=this.Fg;e!==t&&(this.Fg=t,this.g("initialAutoScale",e,t))}},initialViewportSpot:{get:function(){return this.Bt},set:function(t){var e=this.Bt;e!==t&&(t.sb()||Mt("initialViewportSpot must be a specific Spot: "+t),this.Bt=t,this.g("initialViewportSpot",e,t))}},initialDocumentSpot:{get:function(){return this.yt},set:function(t){var e=this.yt;e!==t&&(t.sb()||Mt("initialViewportSpot must be a specific Spot: "+t),this.yt=t,this.g("initialDocumentSpot",e,t))}},minScale:{get:function(){return this.Ot},set:function(t){var e=this.Ot;e!==t&&(0<t?(this.Ot=t,this.g("minScale",e,t),t>this.scale&&(this.scale=t)):Re(t,"> 0",Ct,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(t){var e=this.Mt;e!==t&&(0<t?(this.Mt=t,this.g("maxScale",e,t),t<this.scale&&(this.scale=t)):Re(t,"> 0",Ct,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(t){this.zu.D(t)||(this.zu=t=t.J())}},contentAlignment:{get:function(){return this.zk},set:function(t){var e=this.zk;e.D(t)||(this.zk=t=t.J(),this.g("contentAlignment",e,t),br(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(t){var e=this.pq;e.D(t)||(this.pq=t=t.J(),this.g("initialContentAlignment",e,t))}},padding:{get:function(){return this.yb},set:function(t){typeof t=="number"&&(t=new Ai(t));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.Ya(),this.g("padding",e,t))}},partManager:{get:function(){return this.Pc},set:function(t){var e=this.Pc;e!==t&&(t.diagram!==null&&Mt("Cannot share PartManagers between Diagrams: "+t.toString()),e&&e.Xe(null),this.Pc=t,t.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(t){var e=this.Sc;e!==t&&(this.Sc=t,t.diagram=this,t.group=null,this.xh=!0,this.g("layout",e,t),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(t){var e=this.Ht;if(e!==t&&(this.Ht=t,this.g("isTreePathToChildren",e,t),!this.undoManager.isUndoingRedoing))for(t=this.nodes;t.next();)Vm(t.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(t){var e=this.uu;e!==t&&(t!==Ru&&t!==Fs&&t!==Oh&&Mt("Unknown Diagram.treeCollapsePolicy: "+t),this.uu=t,this.g("treeCollapsePolicy",e,t))}},Ue:{get:function(){return this.pw},set:function(t){this.pw=t}},avoidanceCellSize:{get:function(){return this.aw},set:function(t){this.Xh=null,this.aw=new fe(Math.max(1,t.width),Math.max(1,t.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(t){this.bw=Math.max(1,t)}},autoScrollInterval:{get:function(){return this.vp},set:function(t){var e=this.vp;e!==t&&(this.vp=t,this.g("autoScrollInterval",e,t))}},autoScrollRegion:{get:function(){return this.xp},set:function(t){typeof t=="number"&&(t=new Ai(t));var e=this.xp;e.D(t)||(this.xp=t=t.J(),this.Ya(),this.g("autoScrollRegion",e,t))}}}),St.Object.defineProperties(Ct,{licenseKey:{get:function(){return gf.jc()},set:function(t){gf.add(t.replace(/\s/g,""))}},version:{get:function(){return If}}}),Ct.prototype.makeImageData=Ct.prototype.Jx,Ct.prototype.makeImage=Ct.prototype.Wz,Ct.prototype.cacheGroupExternalLinks=Ct.prototype.Fu,Ct.prototype.addRenderer=Ct.prototype.bs,Ct.prototype.makeSVG=Ct.prototype.av,Ct.prototype.makeSvg=Ct.prototype.Cs,Ct.prototype.stopAutoScroll=Ct.prototype.ug,Ct.prototype.doAutoScroll=Ct.prototype.gs,Ct.prototype.isUnoccupied=Ct.prototype.Yj,Ct.prototype.raiseDiagramEvent=Ct.prototype.R,Ct.prototype.removeDiagramListener=Ct.prototype.am,Ct.prototype.addDiagramListener=Ct.prototype.Bj,Ct.prototype.findTreeRoots=Ct.prototype.yz,Ct.prototype.layoutDiagram=Ct.prototype.Uz,Ct.prototype.findTopLevelGroups=Ct.prototype.qz,Ct.prototype.findTopLevelNodesAndLinks=Ct.prototype.rz,Ct.prototype.ensureBounds=Ct.prototype.Va,Ct.prototype.findLinksByExample=Ct.prototype.ls,Ct.prototype.findNodesByExample=Ct.prototype.ms,Ct.prototype.findLinkForData=Ct.prototype.Kc,Ct.prototype.findNodeForData=Ct.prototype.ii,Ct.prototype.findPartForData=Ct.prototype.Lc,Ct.prototype.findLinkForKey=Ct.prototype.findLinkForKey,Ct.prototype.findNodeForKey=Ct.prototype.Vb,Ct.prototype.findPartForKey=Ct.prototype.findPartForKey,Ct.prototype.rebuildParts=Ct.prototype.Wd,Ct.prototype.transformViewToDoc=Ct.prototype.Ps,Ct.prototype.transformRectDocToView=Ct.prototype.zA,Ct.prototype.transformDocToView=Ct.prototype.op,Ct.prototype.centerRect=Ct.prototype.es,Ct.prototype.scrollToRect=Ct.prototype.tv,Ct.prototype.scroll=Ct.prototype.scroll,Ct.prototype.highlightCollection=Ct.prototype.Jz,Ct.prototype.highlight=Ct.prototype.Iz,Ct.prototype.selectCollection=Ct.prototype.rA,Ct.prototype.select=Ct.prototype.select,Ct.prototype.updateAllRelationshipsFromData=Ct.prototype.rp,Ct.prototype.updateAllTargetBindings=Ct.prototype.updateAllTargetBindings,Ct.prototype.commit=Ct.prototype.commit,Ct.prototype.rollbackTransaction=Ct.prototype.Kf,Ct.prototype.commitTransaction=Ct.prototype.eb,Ct.prototype.startTransaction=Ct.prototype.Ea,Ct.prototype.raiseChanged=Ct.prototype.g,Ct.prototype.raiseChangedEvent=Ct.prototype.cb,Ct.prototype.removeChangedListener=Ct.prototype.ik,Ct.prototype.addChangedListener=Ct.prototype.Pe,Ct.prototype.removeModelChangedListener=Ct.prototype.mA,Ct.prototype.addModelChangedListener=Ct.prototype.Yw,Ct.prototype.findLayer=Ct.prototype.Qj,Ct.prototype.removeLayer=Ct.prototype.kA,Ct.prototype.addLayerAfter=Ct.prototype.Cy,Ct.prototype.addLayerBefore=Ct.prototype.Ww,Ct.prototype.addLayer=Ct.prototype.Al,Ct.prototype.moveParts=Ct.prototype.moveParts,Ct.prototype.copyParts=Ct.prototype.Kj,Ct.prototype.removeParts=Ct.prototype.Is,Ct.prototype.remove=Ct.prototype.remove,Ct.prototype.add=Ct.prototype.add,Ct.prototype.clearDelayedGeometries=Ct.prototype.bx,Ct.prototype.setProperties=Ct.prototype.nm,Ct.prototype.attach=Ct.prototype.Du,Ct.prototype.set=Ct.prototype.set,Ct.prototype.resetInputOptions=Ct.prototype.Sx,Ct.prototype.setInputOption=Ct.prototype.sA,Ct.prototype.getInputOption=Ct.prototype.Ql,Ct.prototype.resetRenderingHints=Ct.prototype.Tx,Ct.prototype.setRenderingHint=Ct.prototype.Xx,Ct.prototype.getRenderingHint=Ct.prototype.Gf,Ct.prototype.maybeUpdate=Ct.prototype.bd,Ct.prototype.requestUpdate=Ct.prototype.$b,Ct.prototype.delayInitialization=Ct.prototype.Xy,Ct.prototype.isUpdateRequested=Ct.prototype.Pz,Ct.prototype.invalidateDocumentBounds=Ct.prototype.Ya,Ct.prototype.findObjectsNear=Ct.prototype.og,Ct.prototype.findPartsNear=Ct.prototype.mz,Ct.prototype.findObjectsIn=Ct.prototype.Cf,Ct.prototype.findPartsIn=Ct.prototype.ux,Ct.prototype.findObjectsAt=Ct.prototype.ji,Ct.prototype.findPartsAt=Ct.prototype.lz,Ct.prototype.findObjectAt=Ct.prototype.ic,Ct.prototype.findPartAt=Ct.prototype.Ol,Ct.prototype.focusObject=Ct.prototype.zz,Ct.prototype.alignDocument=Ct.prototype.Jy,Ct.prototype.zoomToRect=Ct.prototype.BA,Ct.prototype.zoomToFit=Ct.prototype.zoomToFit,Ct.prototype.diagramScroll=Ct.prototype.kx,Ct.prototype.focus=Ct.prototype.focus;var Tc=new ci,qc=null,ur=Kt.document!==void 0,Ih=null,vh="",xa=new he(Ct,"None",0),Ul=new he(Ct,"Uniform",1),Iu=new he(Ct,"UniformToFill",2),Uo=new he(Ct,"CycleAll",10),ns=new he(Ct,"CycleNotDirected",11),Zl=new he(Ct,"CycleNotDirectedFast",12),Gl=new he(Ct,"CycleNotUndirected",13),Cl=new he(Ct,"CycleDestinationTree",14),Ou=new he(Ct,"CycleSourceTree",15),Xl=new he(Ct,"DocumentScroll",1),Uh=new he(Ct,"InfiniteScroll",2),Ru=new he(Ct,"TreeParentCollapsed",21),Fs=new he(Ct,"AllParentsCollapsed",22),Oh=new he(Ct,"AnyParentsCollapsed",23),gf=new ue,If="2.3.10",Of="image",yh=null,Qc=!1;function Ka(){if(ur){var t=Kt.document.createElement("canvas"),e=t.getContext("2d"),i=Pi("7ca11abfd022028846");e[i]=Pi("398c3597c01238");for(var n=["5da73c80a36455d7038e4972187c3cae51fd22",yt.Dx+"4ae6247590da4bb21c324ba3a84e385776",dn.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",xt.za],s=1;5>s;s++)e[Pi("7ca11abfd7330390")](Pi(n[s-1]),10,15*s);for(e[i]=Pi("39f046ebb36e4b"),i=1;5>i;i++)e[Pi("7ca11abfd7330390")](Pi(n[i-1]),10,15*i);(n.length!==4||n[0][0]!=="5"||n[3][0]!=="7")&&(dn.prototype.Cd=dn.prototype.Eu),yh=t}}Ct.className="Diagram",Ct.fromDiv=function(t){var e=t;return typeof t=="string"&&(e=Kt.document.getElementById(t)),e instanceof HTMLDivElement&&e.H instanceof Ct?e.H:null},Ct.inherit=function(t,e){function i(){}if(Object.getPrototypeOf(t).prototype)throw Error(`Used go.Diagram.inherit defining already defined class
|
|
|
`+t);i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t},Ct.useDOM=function(t){ur=t?Kt.document!==void 0:!1},Ct.isUsingDOM=function(){return ur},Ct.None=xa,Ct.Uniform=Ul,Ct.UniformToFill=Iu,Ct.CycleAll=Uo,Ct.CycleNotDirected=ns,Ct.CycleNotDirectedFast=Zl,Ct.CycleNotUndirected=Gl,Ct.CycleDestinationTree=Cl,Ct.CycleSourceTree=Ou,Ct.DocumentScroll=Xl,Ct.InfiniteScroll=Uh,Ct.TreeParentCollapsed=Ru,Ct.AllParentsCollapsed=Fs,Ct.AnyParentsCollapsed=Oh;function Zh(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Ju(t,e){if(e.ib.setTransform(e.Mb,0,0,e.Mb,0,0),e.ib.yc(),t.Rc===null)t:{e="f";var i=Kt[Pi("76a715b2f73f148a")][Pi("72ba13b5")]||"";if(t.Rc=!0,ur){var n=Ct[Pi("76a115b6ed251eaf4692")];if(n)for(var s=gf.iterator;s.next()&&(n=s.value,n=Pi(n).split(Pi("39e9")),!(6>n.length));){var a=Pi(n[1]).split(".");if(n[4]!=="7da71ca0")break;var l=Pi(yt[Pi("6cae19")]).split(".");if(a[0]>l[0]||a[0]===l[0]&&a[1]>=l[1]){var c=Kt[Pi("74a900bae4370f8b51")][Pi("6fbb13a1c2311e8a57")].toLowerCase();if(l=c[Pi("73a612b6fb191d")](Pi("3aad1ab6e022098b4dc4")),a=Pi(n[2]),-1<l&&(c=c[Pi("73a612b6fb191d")](a.toLowerCase()+"/"),t.Rc=!(-1<c&&c<l),!t.Rc))break;for(l=i[Pi("76ad18b4f73e")],c=i[Pi("73a612b6fb191d")](Pi("35e7"))+2;c<l;c++)e+=i[c];if(l=e[Pi("73a612b6fb191d")](a),0>l&&a!==Pi("7da71ca0ad381e90")&&(l=e[Pi("73a612b6fb191d")](Pi("76a715b2ef3e149757"))),0>l&&(l=e[Pi("73a612b6fb191d")](Pi("76a715b2ef3e149757"))),0>l&&(l=e[Pi("73a612b6fb191d")](Pi("2bfa41fdb3784bca12"))),0>l&&(l=i[Pi("73a612b6fb191d")](Pi("7baa19a6f76c1988428554"))),t.Rc=!(0<=l&&l<e[Pi("73a612b6fb191d")](Pi("35"))||e[Pi("73a612b6fb191d")](Pi("35"))===-1),!t.Rc||i[Pi("73a612b6fb191d")](Pi("7fb002b6ed25128b4da25b2e"))&&(t.Rc=!(-1<i[Pi("73a612b6fb191d")](a)),!t.Rc)||(l=Kt[Pi("76a715b2f73f148a")][Pi("69ad17a1e03e")],c=l[Pi("73a612b6fb191d")](Pi("7fb002b6ed25128b4da25b2e")),-1<c&&(t.Rc=!(l[Pi("73a612b6fb191d")](a)>c),!t.Rc)))break;if(a[0]==="#"){l=Kt.document.createElement("div");for(var p=n[0].replace(/[A-Za-z]/g,"");4>p.length;)p+="9";if(c=p,p=p.substr(p.length-4),n="",n+=["gsh","gsf"][parseInt(p.substr(0,1),10)%2],n+=["Header","Background","Display","Feedback"][parseInt(p.substr(0,1),10)%4],l[Pi("79a417a0f0181a8946")]=n,Kt.document[Pi("78a712aa")]){Kt.document[Pi("78a712aa")][Pi("7bb806b6ed32388c4a875b")](l),p=Kt.getComputedStyle(l).getPropertyValue(Pi("78a704b7e62456904c9b12701b6532a8"));var m=Kt.getComputedStyle(l).getPropertyValue(Pi("75b817b0ea2202"));if(Kt.document[Pi("78a712aa")][Pi("68ad1bbcf533388c4a875b")](l),p){if(l=Kt[Pi("77a902b0eb1b1e804a8a")],m==="0."+parseInt(c,10)%100||p.indexOf(parseInt(a[1]+a[2],16))!==-1&&p.indexOf(parseInt(a[3]+a[4],16))!==-1){t.Rc=!1;break}else if(l&&l(Pi("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(n="."+n,a=0;a<document.styleSheets.length;a++){l=document.styleSheets[a].rules||document.styleSheets[a].cssRules;for(var v in l)if(n===l[v].selectorText){t.Rc=!1;break t}}}}else t.Rc=null,t.Rc=!1}}}else{for(v=i[Pi("76ad18b4f73e")],s=i[Pi("73a612b6fb191d")](Pi("35e7"))+2;s<v;s++)e+=i[s];i=e[Pi("73a612b6fb191d")](Pi("7da71ca0ad381e90")),t.Rc=!(0<=i&&i<e[Pi("73a612b6fb191d")](Pi("35")))}}}return 0<t.Rc&&t!==t.wy}Zh.className="DiagramHelper";function Eu(t){this.j=t===void 0?new G:t,this.o=new G}St.Object.defineProperties(Eu.prototype,{point:{get:function(){return this.j},set:function(t){this.j=t}},shifted:{get:function(){return this.o},set:function(t){this.o=t}}});var qu="DraggingInfo";Eu.className="DraggingInfo";function h(t,e,i){this.node=t,this.info=e,this.Su=i}h.className="DraggingNodeInfoPair";function d(){this.reset()}d.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new fe(NaN,NaN).freeze(),this.gridSnapCellSpot=Fo,this.gridSnapOrigin=new G(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},d.className="DraggingOptions";function x(t,e){if(typeof t=="string"||Kt.Element&&t instanceof Element)var i=Ct.call(this,t)||this;else i=Ct.call(this)||this,e=t;return y(i),e&&i.nm(e),i}li(x,Ct);function y(t){t.allowDragOut=!0,t.allowMove=!1,t.isReadOnly=!0,t.contentAlignment=Ca,t.layout=new Fl}x.prototype.reset=function(){Ct.prototype.reset.call(this),y(this)},x.className="Palette";function S(t,e){if(typeof t=="string"||Kt.Element&&t instanceof Element)var i=Ct.call(this,t)||this;else i=Ct.call(this)||this,e=t;var n=i;i.animationManager.isEnabled=!1,i.vb=!0,i.V=null,i.mn=!1,i.nn=!1,i.F=!0,i.u=!0,i.ia=0,i.o=!1,i.ql=null,i.Xx("drawShadows",!1),t=new bi;var s=new pn;return s.stroke="magenta",s.strokeWidth=2,s.fill="transparent",s.name="BOXSHAPE",t.selectable=!0,t.selectionAdorned=!1,t.selectionObjectName="BOXSHAPE",t.locationObjectName="BOXSHAPE",t.resizeObjectName="BOXSHAPE",t.cursor="move",t.add(s),i.j=t,i.allowCopy=!1,i.allowDelete=!1,i.allowSelect=!0,i.autoScrollRegion=new Ai(0,0,0,0),i.pa.h(0,0),i.toolManager.gb("Dragging",new W,i.toolManager.mouseMoveTools),i.click=function(){var a=n.observed;if(a!==null){var l=a.viewportBounds,c=n.lastInput.documentPoint;a.position=new G(c.x-l.width/2,c.y-l.height/2)}},i.Pf=function(){n.Ya(),O(n)},i.Xd=function(){n.observed!==null&&(n.Ya(),n.N())},i.Ha=function(){1>n.updateDelay?n.N():n.o||(n.o=!0,setTimeout(function(){return n.redraw()},n.updateDelay))},i.Of=function(){n.observed!==null&&O(n)},i.autoScale=Ul,i.vb=!1,e&&Object.assign(i,e),i}li(S,Ct),S.prototype.computePixelRatio=function(){return 1},S.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var t=this.ta,e=this.ib;if(t!==null&&e!==null){if(Xa(this),this.ql===null){var i=new Pc(null);i.width=t.width,i.height=t.height,this.ql=i}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),E(this)}finally{this.ta=t,this.ib=e}}}Ct.prototype.redraw.call(this)},S.prototype.gc=function(){if(this.Ka===null&&Mt("No div specified"),this.ta===null&&Mt("No canvas specified"),!(this.ta instanceof tf)&&(Fm(this.box),this.Fc)){var t=this.observed;if(t!==null&&!t.animationManager.defaultAnimation.isAnimating&&t.pi){Xa(this);var e=this.ta;t=this.ib,t.Vc(!0),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),1>this.updateDelay?E(this):this.ql!==null&&(t.drawImage(this.ql.Oa,0,0),e=this.Ab,e.reset(),this.scale!==1&&e.scale(this.scale),this.position.x===0&&this.position.y===0||e.translate(-this.position.x,-this.position.y),t.scale(this.Mb,this.Mb),t.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),t.yc()),e=this.Wa.s;for(var i=e.length,n=0;n<i;n++)e[n].gc(t,this);this.Fc=this.vd=!1}}};function E(t){var e=t.observed;if(e!==null){var i=t.drawsTemporaryLayers,n=t.drawsGrid&&i,s=e.grid;n&&s!==null&&s.visible&&!isNaN(s.width)&&!isNaN(s.height)&&(s=Tt.alloc().assign(t.viewportBounds).ed(e.viewportBounds),Bs(e,s),Tt.free(s),Vo(e));var a=t.Ab;a.reset(),t.scale!==1&&a.scale(t.scale),t.position.x===0&&t.position.y===0||a.translate(-t.position.x,-t.position.y),s=t.ib,s.scale(t.Mb,t.Mb),s.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),s.yc(),e=e.Wa.s,a=e.length;for(var l=0;l<a;l++){var c=e[l],p=t;if(c.visible&&c.opacity!==0){var m=c.diagram.grid.part;if(!i&&c.isTemporary)n&&m.layer===c&&(c=rn(c,s),m.gc(s,p),s.globalAlpha=c);else{for(var v=rn(c,s),w=p.scale,C=Tt.alloc(),k=c.Pa.s,T=k.length,A=0;A<T;A++){var X=k[A];(n||X!==m)&&c.Oj(s,X,p,null,w,C,!1)}Tt.free(C),s.globalAlpha=v}}}}}function O(t){var e=t.box;if(e!==null){var i=t.observed;if(i!==null){t.Fc=!0,i=i.viewportBounds;var n=e.selectionObject,s=fe.alloc();s.h(i.width,i.height),n.desiredSize=s,fe.free(s),t=2/t.scale,n instanceof pn&&(n.strokeWidth=t),e.location=new G(i.x-t/2,i.y-t/2),e.isSelected=!0}}}S.prototype.computeBounds=function(){var t=this.observed;if(t===null)return hn;var e=t.documentBounds.copy();return e.ed(t.viewportBounds),e},S.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},S.prototype.onViewportBoundsChanged=function(t,e,i,n){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),O(this),this.fc.scale=i,this.fc.position.x=t.x,this.fc.position.y=t.y,this.fc.bounds.assign(t),this.fc.Oz=n,this.R("ViewportBoundsChanged",this.fc,t))},St.Object.defineProperties(S.prototype,{observed:{get:function(){return this.V},set:function(t){var e=this.V;if(t instanceof S&&Mt("Overview.observed Diagram may not be an Overview itself: "+t),e!==t){if(e!==null&&(this.remove(this.box),e.am("ViewportBoundsChanged",this.Pf),e.am("DocumentBoundsChanged",this.Xd),e.am("InvalidateDraw",this.Ha),e.am("AnimationFinished",this.Of)),this.V=t,t!==null&&(t.Bj("ViewportBoundsChanged",this.Pf),t.Bj("DocumentBoundsChanged",this.Xd),t.Bj("InvalidateDraw",this.Ha),t.Bj("AnimationFinished",this.Of),this.add(this.box)),this.Ya(),t===null){this.ql=null;var i=this.ta,n=this.ib;i&&n&&(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,i.width,i.height))}else this.Ha(null),O(this),this.N();this.g("observed",e,t)}}},box:{get:function(){return this.j},set:function(t){var e=this.j;e!==t&&(this.j=t,this.remove(e),this.add(this.j),O(this),this.g("box",e,t))}},drawsTemporaryLayers:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t,this.redraw())}},drawsGrid:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t,this.redraw())}},updateDelay:{get:function(){return this.ia},set:function(t){0>t&&(t=0),this.ia!==t&&(this.ia=t)}}}),S.className="Overview";function W(){as.call(this),this.j=null}li(W,as),W.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t===null||!t.allowMove||!t.allowSelect)return!1;var e=t.observed;if(e===null)return!1;var i=t.lastInput;return!i.left||t.currentTool!==this&&(!this.isBeyondDragSize()||i.isTouchEvent&&i.timestamp-t.firstInput.timestamp<this.delay)?!1:(this.findDraggablePart()===null&&(i=e.viewportBounds,this.j=new G(i.width/2,i.height/2),t=t.firstInput.documentPoint,e.position=new G(t.x-this.j.x,t.y-this.j.y)),!0)},W.prototype.doActivate=function(){this.j=null,as.prototype.doActivate.call(this)},W.prototype.doUpdateCursor=function(){var t=this.diagram,e=t.box;e!==null&&e.cursor&&(t.currentCursor=e.cursor)},W.prototype.moveParts=function(){var t=this.diagram,e=t.observed;if(e!==null){var i=t.box;if(i!==null){if(this.j===null){var n=t.firstInput.documentPoint;i=i.location,this.j=new G(n.x-i.x,n.y-i.y)}t=t.lastInput.documentPoint,e.position=new G(t.x-this.j.x,t.y-this.j.y)}}},W.className="OverviewDraggingTool";function H(){Do(this),this.H=Mn,this.Ha=this.u=this.o=!0,this.F=this.V=this.nb=this.ia=!1,this.ij=this.j=null,this.Hb=1.05,this.Jt=NaN,this.sw=null,this.Au=NaN,this.yu=hn,this.hb=!0,this.cg=null,this.ob=200}H.prototype.toString=function(){return"CommandHandler"},H.prototype.Xe=function(t){this.H=t},H.prototype.doKeyDown=function(){var t=this.diagram,e=t.lastInput,i=qr?e.meta:e.control,n=e.shift,s=e.alt,a=e.key;!i||a!=="C"&&a!=="Insert"?i&&a==="X"||n&&a==="Del"?this.canCutSelection()&&this.cutSelection():i&&a==="V"||n&&a==="Insert"?this.canPasteSelection()&&this.pasteSelection():i&&a==="Y"||s&&n&&a==="Backspace"?this.canRedo()&&this.redo():i&&a==="Z"||s&&a==="Backspace"?this.canUndo()&&this.undo():a==="Del"||a==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():i&&a==="A"?this.canSelectAll()&&this.selectAll():a==="Esc"?this.canStopCommand()&&this.stopCommand():a==="Up"?t.allowVerticalScroll&&(i?t.scroll("pixel","up"):t.scroll("line","up")):a==="Down"?t.allowVerticalScroll&&(i?t.scroll("pixel","down"):t.scroll("line","down")):a==="Left"?t.allowHorizontalScroll&&(i?t.scroll("pixel","left"):t.scroll("line","left")):a==="Right"?t.allowHorizontalScroll&&(i?t.scroll("pixel","right"):t.scroll("line","right")):a==="PageUp"?n&&t.allowHorizontalScroll?t.scroll("page","left"):t.allowVerticalScroll&&t.scroll("page","up"):a==="PageDown"?n&&t.allowHorizontalScroll?t.scroll("page","right"):t.allowVerticalScroll&&t.scroll("page","down"):a==="Home"?i&&t.allowVerticalScroll?t.scroll("document","up"):!i&&t.allowHorizontalScroll&&t.scroll("document","left"):a==="End"?i&&t.allowVerticalScroll?t.scroll("document","down"):!i&&t.allowHorizontalScroll&&t.scroll("document","right"):a===" "?this.canScrollToPart()&&this.scrollToPart():a==="Subtract"?this.canDecreaseZoom()&&this.decreaseZoom():a==="Add"?this.canIncreaseZoom()&&this.increaseZoom():i&&a==="0"?this.canResetZoom()&&this.resetZoom():n&&a==="Z"?this.canZoomToFit()&&this.zoomToFit():i&&!n&&a==="G"?this.canGroupSelection()&&this.groupSelection():i&&n&&a==="G"?this.canUngroupSelection()&&this.ungroupSelection():a==="F2"||e.event&&e.event.key==="F2"?this.canEditTextBlock()&&this.editTextBlock():a==="ContextMenu"||e.event&&e.event.key==="ContextMenu"?this.canShowContextMenu()&&this.showContextMenu():e.bubbles=!0:this.canCopySelection()&&this.copySelection()},H.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},H.prototype.stopCommand=function(){var t=this.diagram,e=t.currentTool;e instanceof Rr&&t.allowSelect&&t.clearSelection(),e!==null&&e.doCancel()},H.prototype.canStopCommand=function(){return!0},H.prototype.selectAll=function(){var t=this.diagram;t.N();try{t.currentCursor="wait",t.R("ChangingSelection",t.selection);for(var e=t.parts;e.next();)e.value.isSelected=!0;for(var i=t.nodes;i.next();)i.value.isSelected=!0;for(var n=t.links;n.next();)n.value.isSelected=!0}finally{t.R("ChangedSelection",t.selection),t.currentCursor=""}},H.prototype.canSelectAll=function(){return this.diagram.allowSelect},H.prototype.deleteSelection=function(){var t=this.diagram;try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),t.Ea("Delete"),t.R("SelectionDeleting",t.selection);for(var e=new te,i=t.selection.iterator;i.next();)yd(e,i.value,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,function(n){return n.canDelete()});t.Is(e,!0),t.R("SelectionDeleted",e)}finally{t.eb("Delete"),t.R("ChangedSelection",t.selection),t.currentCursor=""}},H.prototype.canDeleteSelection=function(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowDelete||t.selection.count===0)},H.prototype.copySelection=function(){var t=this.diagram,e=new te;for(t=t.selection.iterator;t.next();)yd(e,t.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(i){return i.canCopy()});this.copyToClipboard(e)},H.prototype.canCopySelection=function(){var t=this.diagram;return!!(t.allowCopy&&t.allowClipboard&&t.selection.count!==0)},H.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},H.prototype.canCutSelection=function(){var t=this.diagram;return!!(!t.isReadOnly&&!t.isModelReadOnly&&t.allowCopy&&t.allowDelete&&t.allowClipboard&&t.selection.count!==0)},H.prototype.copyToClipboard=function(t){var e=this.diagram,i=null;if(t===null)Ih=null,vh="";else{i=e.model;var n=!1,s=!1,a=null;try{i.Tl()&&(n=i.Jj,i.Jj=this.copiesParentKey),i.Wj()&&(s=i.Ij,i.Ij=this.copiesGroupKey),a=e.Kj(t,null,!0)}finally{i.Tl()&&(i.Jj=n),i.Wj()&&(i.Ij=s),i=new ue,i.addAll(a),Ih=i,vh=e.model.dataFormat}}e.R("ClipboardChanged",i)},H.prototype.pasteFromClipboard=function(){var t=new te,e=Ih;if(e===null)return t;var i=this.diagram;if(vh!==i.model.dataFormat)return t;var n=i.model,s=!1,a=!1,l=null;try{n.Tl()&&(s=n.Jj,n.Jj=this.copiesParentKey),n.Wj()&&(a=n.Ij,n.Ij=this.copiesGroupKey),l=i.Kj(e,i,!1)}finally{for(n.Tl()&&(n.Jj=s),n.Wj()&&(n.Ij=a),e=l.iterator;e.next();)i=e.value,n=e.key,i.location.w()||(n.location.w()?i.location=n.location:!i.position.w()&&n.position.w()&&(i.position=n.position)),t.add(i)}return t},H.prototype.pasteSelection=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.currentCursor="wait",e.R("ChangingSelection",e.selection),e.Ea("Paste");var i=this.pasteFromClipboard();0<i.count&&e.clearSelection(!0);for(var n=i.iterator;n.next();)n.value.isSelected=!0;if(t!==null){var s=e.computePartsBounds(e.selection);if(s.w()){var a=this.computeEffectiveCollection(e.selection,e.Wm);Pr(e,a,new G(t.x-s.centerX,t.y-s.centerY),e.Wm,!1)}}e.R("ClipboardPasted",i)}finally{e.eb("Paste"),e.R("ChangedSelection",e.selection),e.currentCursor=""}},H.prototype.canPasteSelection=function(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowClipboard||Ih===null||Ih.count===0||vh!==t.model.dataFormat)},H.prototype.undo=function(){this.diagram.undoManager.undo()},H.prototype.canUndo=function(){var t=this.diagram;return t.isReadOnly||t.isModelReadOnly?!1:t.allowUndo&&t.undoManager.canUndo()},H.prototype.redo=function(){this.diagram.undoManager.redo()},H.prototype.canRedo=function(){var t=this.diagram;return t.isReadOnly||t.isModelReadOnly?!1:t.allowUndo&&t.undoManager.canRedo()},H.prototype.decreaseZoom=function(t){t===void 0&&(t=1/this.zoomFactor);var e=this.diagram;e.autoScale===xa&&(t=e.scale*t,t<e.minScale||t>e.maxScale||(e.scale=t))},H.prototype.canDecreaseZoom=function(t){t===void 0&&(t=1/this.zoomFactor);var e=this.diagram;return e.autoScale!==xa?!1:(t=e.scale*t,t<e.minScale||t>e.maxScale?!1:e.allowZoom)},H.prototype.increaseZoom=function(t){t===void 0&&(t=this.zoomFactor);var e=this.diagram;e.autoScale===xa&&(t=e.scale*t,t<e.minScale||t>e.maxScale||(e.scale=t))},H.prototype.canIncreaseZoom=function(t){t===void 0&&(t=this.zoomFactor);var e=this.diagram;return e.autoScale!==xa?!1:(t=e.scale*t,t<e.minScale||t>e.maxScale?!1:e.allowZoom)},H.prototype.resetZoom=function(t){t===void 0&&(t=this.defaultScale);var e=this.diagram;t<e.minScale||t>e.maxScale||(e.scale=t)},H.prototype.canResetZoom=function(t){t===void 0&&(t=this.defaultScale);var e=this.diagram;return t<e.minScale||t>e.maxScale?!1:e.allowZoom},H.prototype.zoomToFit=function(){var t=this.diagram,e=t.animationManager;e.Cc(),t.redraw();var i=t.position,n=t.scale;R(e,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&n===this.Au&&!isNaN(this.Jt)&&t.documentBounds.D(this.yu)?(t.scale=this.Jt,t.position=this.sw,this.Au=NaN,this.yu=hn):(this.Jt=n,this.sw=i.copy(),t.zoomToFit(),this.Au=t.scale,this.yu=t.documentBounds.copy()),V(e)},H.prototype.canZoomToFit=function(){return this.diagram.allowZoom},H.prototype.scrollToPart=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.Va(),t===null){try{this.cg!==null&&(this.cg.next()?t=this.cg.value:this.cg=null)}catch(p){this.cg=null}t===null&&(0<e.highlighteds.count?this.cg=e.highlighteds.iterator:0<e.selection.count&&(this.cg=e.selection.iterator),this.cg!==null&&this.cg.next()&&(t=this.cg.value))}if(t!==null){var i=e.animationManager;R(i,"Scroll To Part");var n=this.scrollToPartPause;if(0<n){var s=nt(this,t,[t]);if(s.length===1)e.Ea(),e.es(t.actualBounds),e.eb("Scroll To Part");else{var a=function(){e.Ea();for(var p=s.pop();0<s.length&&p instanceof Ee&&p.isTreeExpanded&&(!(p instanceof Yi)||p.isSubGraphExpanded);)p=s.pop();0<s.length?(p instanceof bi&&e.tv(p.actualBounds),p instanceof Ee&&!p.isTreeExpanded&&(p.isTreeExpanded=!0),p instanceof Yi&&!p.isSubGraphExpanded&&(p.isSubGraphExpanded=!0)):(p instanceof bi&&e.es(p.actualBounds),e.am("LayoutCompleted",l)),e.eb("Scroll To Part")},l=function(){Ce(a,(i.isEnabled?i.duration:0)+n)};e.Bj("LayoutCompleted",l),a()}}else{var c=e.position.copy();e.es(t.actualBounds),c.Xa(e.position)&&i.Cc()}}};function nt(t,e,i){if(e.isVisible())return i;if(e instanceof pr)nt(t,e.adornedPart,i);else if(e instanceof ge){var n=e.fromNode;n!==null&&nt(t,n,i),e=e.toNode,e!==null&&nt(t,e,i)}else e instanceof Ee&&(n=e.labeledLink,n!==null&&nt(t,n,i),n=e.pg(),n!==null&&(n.isTreeExpanded||n.wasTreeExpanded||i.push(n),nt(t,n,i))),e=e.containingGroup,e!==null&&(e.isSubGraphExpanded||e.wasSubGraphExpanded||i.push(e),nt(t,e,i));return i}H.prototype.canScrollToPart=function(t){return t===void 0&&(t=null),t!==null&&!(t instanceof bi)?!1:(t=this.diagram,t.selection.count===0&&t.highlighteds.count===0?!1:t.allowHorizontalScroll&&t.allowVerticalScroll)},H.prototype.collapseTree=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.Ea("Collapse Tree"),R(e.animationManager,"Collapse Tree");var i=new ue;if(t!==null&&t.isTreeExpanded)t.collapseTree(),i.add(t);else if(t===null)for(var n=e.selection.iterator;n.next();){var s=n.value;s instanceof Ee&&s.isTreeExpanded&&(s.collapseTree(),i.add(s))}e.R("TreeCollapsed",i)}finally{e.eb("Collapse Tree")}},H.prototype.canCollapseTree=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(t!==null){if(!(t instanceof Ee&&t.isTreeExpanded))return!1;if(0<t.Qo().count)return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Ee&&e.isTreeExpanded&&0<e.Qo().count)return!0;return!1},H.prototype.expandTree=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.Ea("Expand Tree"),R(e.animationManager,"Expand Tree");var i=new ue;if(t!==null&&!t.isTreeExpanded)t.expandTree(),i.add(t);else if(t===null)for(var n=e.selection.iterator;n.next();){var s=n.value;s instanceof Ee&&!s.isTreeExpanded&&(s.expandTree(),i.add(s))}e.R("TreeExpanded",i)}finally{e.eb("Expand Tree")}},H.prototype.canExpandTree=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(t!==null){if(!(t instanceof Ee)||t.isTreeExpanded)return!1;if(0<t.Qo().count)return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Ee&&!e.isTreeExpanded&&0<e.Qo().count)return!0;return!1},H.prototype.groupSelection=function(){var t=this.diagram,e=t.model;if(e.Xj()){var i=this.archetypeGroupData;if(i!==null){var n=null;try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),t.Ea("Group");for(var s=new ue,a=t.selection.iterator;a.next();){var l=a.value;l.Zc()&&l.canGroup()&&s.add(l)}for(var c=new ue,p=s.iterator;p.next();){var m=p.value;a=!1;for(var v=s.iterator;v.next();)if(m.Td(v.value)){a=!0;break}a||c.add(m)}if(0<c.count){var w=c.first().containingGroup;if(w!==null)for(;w!==null;){s=!1;for(var C=c.iterator;C.next();)if(!C.value.Td(w)){s=!0;break}if(s)w=w.containingGroup;else break}if(i instanceof Yi)Sh(i),n=i.copy(),n!==null&&t.add(n);else if(e.Yu(i)){var k=e.copyNodeData(i);Qt(k)&&(e.xf(k),n=t.ii(k))}if(n!==null){w!==null&&this.isValidMember(w,n)&&(n.containingGroup=w);for(var T=c.iterator;T.next();){var A=T.value;this.isValidMember(n,A)&&(A.containingGroup=n)}t.clearSelection(!0),n.isSelected=!0}}t.R("SelectionGrouped",n)}finally{t.eb("Group"),t.R("ChangedSelection",t.selection),t.currentCursor=""}}}},H.prototype.canGroupSelection=function(){var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowGroup||!t.model.Xj()||this.archetypeGroupData===null)return!1;for(t=t.selection.iterator;t.next();){var e=t.value;if(e.Zc()&&e.canGroup())return!0}return!1};function Rt(t){var e=gi();for(t=t.iterator;t.next();){var i=t.value;i instanceof ge||e.push(i)}t=new te,i=e.length;for(var n=0;n<i;n++){for(var s=e[n],a=!0,l=0;l<i;l++)if(s.Td(e[l])){a=!1;break}a&&t.add(s)}return Ji(e),t}H.prototype.isValidMember=function(t,e){if(e===null||t===e||e instanceof ge)return!1;if(t!==null){if(t===e||t.Td(e))return!1;var i=t.memberValidation;if(i!==null&&!i(t,e)||t.data===null&&e.data!==null||t.data!==null&&e.data===null)return!1}return i=this.memberValidation,i!==null?i(t,e):!0},H.prototype.ungroupSelection=function(t){t===void 0&&(t=null);var e=this.diagram,i=e.model;if(i.Xj())try{e.currentCursor="wait",e.R("ChangingSelection",e.selection),e.Ea("Ungroup");var n=new ue;if(t!==null)n.add(t);else for(var s=e.selection.iterator;s.next();){var a=s.value;a instanceof Yi&&a.canUngroup()&&n.add(a)}var l=new ue;if(0<n.count){e.clearSelection(!0);for(var c=n.iterator;c.next();){var p=c.value;p.expandSubGraph();var m=p.containingGroup,v=m!==null&&m.data!==null?i.wa(m.data):void 0;l.addAll(p.memberParts);for(var w=l.iterator;w.next();){var C=w.value;if(C.isSelected=!0,!(C instanceof ge)){var k=C.data;k!==null?i.mp(k,v):C.containingGroup=m}}e.remove(p)}}e.R("SelectionUngrouped",n,l)}finally{e.eb("Ungroup"),e.R("ChangedSelection",e.selection),e.currentCursor=""}},H.prototype.canUngroupSelection=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly||e.isModelReadOnly||!e.allowDelete||!e.allowUngroup||!e.model.Xj())return!1;if(t!==null){if(!(t instanceof Yi))return!1;if(t.canUngroup())return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Yi&&e.canUngroup())return!0;return!1},H.prototype.addTopLevelParts=function(t,e){var i=!0;for(t=Rt(t).iterator;t.next();){var n=t.value;n.containingGroup!==null&&(!e||this.isValidMember(null,n)?n.containingGroup=null:i=!1)}return i},H.prototype.collapseSubGraph=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.Ea("Collapse SubGraph"),R(e.animationManager,"Collapse SubGraph");var i=new ue;if(t!==null&&t.isSubGraphExpanded)t.collapseSubGraph(),i.add(t);else if(t===null)for(var n=e.selection.iterator;n.next();){var s=n.value;s instanceof Yi&&s.isSubGraphExpanded&&(s.collapseSubGraph(),i.add(s))}e.R("SubGraphCollapsed",i)}finally{e.eb("Collapse SubGraph")}},H.prototype.canCollapseSubGraph=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(t!==null)return!!(t instanceof Yi&&t.isSubGraphExpanded);for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Yi&&e.isSubGraphExpanded)return!0;return!1},H.prototype.expandSubGraph=function(t){t===void 0&&(t=null);var e=this.diagram;try{e.Ea("Expand SubGraph"),R(e.animationManager,"Expand SubGraph");var i=new ue;if(t!==null&&!t.isSubGraphExpanded)t.expandSubGraph(),i.add(t);else if(t===null)for(var n=e.selection.iterator;n.next();){var s=n.value;s instanceof Yi&&!s.isSubGraphExpanded&&(s.expandSubGraph(),i.add(s))}e.R("SubGraphExpanded",i)}finally{e.eb("Expand SubGraph")}},H.prototype.canExpandSubGraph=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(t!==null)return t instanceof Yi&&!t.isSubGraphExpanded;for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof Yi&&!e.isSubGraphExpanded)return!0;return!1},H.prototype.editTextBlock=function(t){t===void 0&&(t=null);var e=this.diagram,i=e.toolManager.findTool("TextEditing");if(i!==null){if(t===null){t=null;for(var n=e.selection.iterator;n.next();){var s=n.value;if(s.canEdit()){t=s;break}}if(t===null)return;t=t.Nl(function(a){return a instanceof ao&&a.editable})}t!==null&&(e.currentTool=null,i.textBlock=t,e.currentTool=i)}},H.prototype.canEditTextBlock=function(t){t===void 0&&(t=null);var e=this.diagram;if(e.isReadOnly||e.isModelReadOnly||!e.allowTextEdit||e.toolManager.findTool("TextEditing")===null)return!1;if(t!==null){if(!(t instanceof ao))return!1;if(t=t.part,t!==null&&t.canEdit())return!0}else for(e=e.selection.iterator;e.next();)if(t=e.value,t.canEdit()&&(t=t.Nl(function(i){return i instanceof ao&&i.editable}),t!==null))return!0;return!1},H.prototype.showContextMenu=function(t){var e=this.diagram,i=e.toolManager.findTool("ContextMenu");if(i!==null&&(t===void 0&&(t=0<e.selection.count?e.selection.first():e),t=i.findObjectWithContextMenu(t),t!==null)){var n=e.lastInput,s=null;t instanceof pt?s=t.ga(_n):e.viewportBounds.ca(n.documentPoint)||(s=e.viewportBounds,s=new G(s.x+s.width/2,s.y+s.height/2)),s!==null&&(n.viewPoint=e.op(s),n.documentPoint=s,n.left=!1,n.right=!0,n.up=!0),e.currentTool=i,ks(i,!1,t)}},H.prototype.canShowContextMenu=function(t){var e=this.diagram,i=e.toolManager.findTool("ContextMenu");return i===null?!1:(t===void 0&&(t=0<e.selection.count?e.selection.first():e),i.findObjectWithContextMenu(t)!==null)},H.prototype.computeEffectiveCollection=function(t,e){var i=this.diagram,n=i.toolManager.findTool("Dragging"),s=i.currentTool===n;if(e===void 0&&(e=s?n.dragOptions:i.Wm),n=new ci,t===null)return n;for(var a=t.iterator;a.next();)Kn(i,n,a.value,s,e);if(i.draggedLink!==null&&e.dragsLink)return n;for(a=t.iterator;a.next();)t=a.value,t instanceof ge&&(e=t.fromNode,e===null||n.contains(e)?(e=t.toNode,e===null||n.contains(e)||n.remove(t)):n.remove(t));return n},St.Object.defineProperties(H.prototype,{diagram:{get:function(){return this.H}},copiesClipboardData:{get:function(){return this.o},set:function(t){this.o=t}},copiesConnectedLinks:{get:function(){return this.u},set:function(t){this.u=t}},deletesConnectedLinks:{get:function(){return this.Ha},set:function(t){this.Ha=t}},copiesTree:{get:function(){return this.ia},set:function(t){this.ia=t}},deletesTree:{get:function(){return this.nb},set:function(t){this.nb=t}},copiesParentKey:{get:function(){return this.V},set:function(t){this.V=t}},copiesGroupKey:{get:function(){return this.F},set:function(t){this.F=t}},archetypeGroupData:{get:function(){return this.j},set:function(t){this.j=t}},memberValidation:{get:function(){return this.ij},set:function(t){this.ij=t}},defaultScale:{get:function(){return this.diagram.defaultScale},set:function(t){this.diagram.defaultScale=t}},zoomFactor:{get:function(){return this.Hb},set:function(t){1<t||Mt("zoomFactor must be larger than 1.0, not: "+t),this.Hb=t}},isZoomToFitRestoreEnabled:{get:function(){return this.hb},set:function(t){this.hb=t}},scrollToPartPause:{get:function(){return this.ob},set:function(t){this.ob=t}}}),H.className="CommandHandler",Ea=function(){return new H};function pt(){Do(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new G(NaN,NaN).freeze(),this.jd=Yo,this.Ab=new dn,this.wh=new dn,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=Ua,this.uc=new Tt(NaN,NaN,NaN,NaN).freeze(),this.Ib=new Tt(NaN,NaN,NaN,NaN).freeze(),this.dc=new Tt(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=ds,this.Ag=this.io=0,this.V=this.tb=this.Dh=this.A=this.Ua=null,this.Uc=!1,this.jo=this.Ng=null}var oe,Jt,oi,mi,Ii,on,Bn,gn,Vn,Hr;pt.prototype.cloneProtected=function(t){t.l=this.l|6144,t.pb=this.pb,t.bn=this.bn,t.Ma=this.Ma,t.pa.assign(this.pa),t.jd=this.jd.J(),this.Lb!==null?t.Lb=this.Lb.copy():t.Lb=null,t.Ca=this.Ca,t.Kb=this.Kb,t.Kg=this.Kg.J(),t.uc.assign(this.uc),t.Ib.assign(this.Ib),t.dc.assign(this.dc),t.Yn=this.Yn,this.ba!==null&&(t.ba=this.ba.copy()),t.Jb=this.Jb.J(),t.sk=this.sk.J(),t.io=this.io,t.Ag=this.Ag,this.Ua!==null&&(t.Ua=this.Ua.copy()),this.A!==null&&(t.A=this.A.nc?this.A:this.A.copy()),this.Dh!==null&&(t.Dh=vr(this.Dh)),this.tb!==null&&(t.tb=this.tb.copy())},pt.prototype.Vw=function(t){var e=this.Dh;if(ui(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return}else this.Dh=e=[];e.push(t)},pt.prototype.Af=function(t){t.Zn=null,t.Ng=null,t.v()},pt.prototype.clone=function(){var t=new this.constructor;if(this.cloneProtected(t),this.Dh!==null)for(var e=0;e<this.Dh.length;e++){var i=this.Dh[e];t[i]=this[i]}return t},pt.prototype.copy=function(){return this.clone()},L=pt.prototype,L.qb=function(t){t.classType===ge?t.name.indexOf("Orient")===0?this.segmentOrientation=t:Mt("Unknown Link enum value for GraphObject.segmentOrientation property: "+t):t.classType===pt&&(this.stretch=t)},L.toString=function(){return Xi(this.constructor)+"#"+Io(this)},L.th=function(){this.A!==null&&(this.A.nc=!0)};function bn(t){t.A===null?t.A=new rp:t.A.nc&&(t.A=t.A.copy())}L.Xc=function(){if(this.ba===null){var t=new op;t.Xi=jr,t.yj=jr,t.Vi=10,t.wj=10,t.Wi=0,t.xj=0,this.ba=t}},L.cb=function(t,e,i,n,s,a,l){var c=this.part;if(c!==null&&(c.gk(t,e,i,n,s,a,l),i===this&&t===us&&Jl(this)&&rs(this,c,e),a=this.diagram,this.animationTriggers===null||a===null||!a.pi||a.undoManager.isUndoingRedoing||a.animationManager.Dm||(t=this.animationTriggers.get(e),t!==null&&a.animationManager.isEnabled&&!a.animationManager.isTicking&&(this.jo===null&&(this.jo=new ci),l=a.undoManager.transactionLevel===0,t.startCondition===gr?l=!0:t.startCondition===kn&&(l=!1),l?(a=new Li,vo(t,a),l=this.jo.get(t),l!==null&&l.stop(),this.jo.add(t,a),a.vu=this,a.Nw=t,a.add(this,e,n,s),a.start()):(R(a.animationManager,"Trigger"),a.animationManager.defaultAnimation.add(this,e,n,s)))),this instanceof ce&&i===c&&(c.l&16777216)!==0&&c.data!==null))for(i=this.O.s,n=i.length,s=0;s<n;s++)c=i[s],c instanceof ce&&id(c,function(p){p.data!==null&&p.l&16777216&&p.La(e)})};function rs(t,e,i){var n=t.ih();if(n!==null)for(var s=t.localBindings.iterator;s.next();){var a=s.value,l=null;if(a.sourceName!==null){if(l=_y(a,n,t),l===null)continue;a.sp(t,l,i,null)}else if(a.isToModel){var c=e.diagram;c===null||c.skipsModelSourceBindings||a.sp(t,c.model.modelData,i,n)}else{if(c=n.data,c===null)continue;var p=e.diagram;p===null||p.skipsModelSourceBindings||a.sp(t,c,i,n)}l===t&&(c=n.ks(a.Ai),c!==null&&a.Mv(c,l,i))}}L.ks=function(t){return this.bindingId===t?this:null},L.g=function(t,e,i){this.cb(us,t,this,e,i)},L.Ge=function(t,e,i,n){var s=this.uc;if(s.h(t,e,i,n),this.Ca!==1||this.Kb!==0){this.Lb===null&&(this.Lb=new dn);var a=this.Lb;a.reset(),this.no(a,t,e,i,n),a.pp(s)}};function xl(t,e,i,n){return t.pickable===!1?!1:(n.multiply(t.transform),i?t.Yc(e,n):t.fh(e,n))}L.tx=function(t,e,i){if(this.pickable===!1)return!1;var n=this.naturalBounds;return e=t.Bf(e),i?re(t.x,t.y,0,0,0,n.height)<=e||re(t.x,t.y,0,n.height,n.width,n.height)<=e||re(t.x,t.y,n.width,n.height,n.width,0)<=e||re(t.x,t.y,n.width,0,0,0)<=e:t.zd(0,0)<=e&&t.zd(0,n.height)<=e&&t.zd(n.width,0)<=e&&t.zd(n.width,n.height)<=e},L.se=function(){return!0},L.ca=function(t){var e=G.alloc();e.assign(t),this.transform.Ga(e);var i=this.actualBounds;if(!i.w())return G.free(e),!1;var n=this.diagram;if(n!==null&&n.wq){var s=n.Ql("extraTouchThreshold"),a=n.Ql("extraTouchArea"),l=a/2,c=this.naturalBounds;n=this.Df()*n.scale;var p=1/n;if(c.width*n<s&&c.height*n<s)return t=eo(i.x-l*p,i.y-l*p,i.width+a*p,i.height+a*p,e.x,e.y),G.free(e),t}return s=!1,(this instanceof pr||this instanceof pn?eo(i.x-5,i.y-5,i.width+10,i.height+10,e.x,e.y):i.ca(e))&&(this.tb&&!this.tb.ca(e)?s=!1:this.areaBackground!==null&&i.ca(e)||this.Ma!==null&&this.dc.ca(t)?s=!0:s=this.gh(t)),G.free(e),s},L.gh=function(t){var e=this.naturalBounds;return eo(0,0,e.width,e.height,t.x,t.y)},L.Re=function(t){if(this.angle===0)return this.actualBounds.Re(t);var e=this.naturalBounds;e=Tt.allocAt(0,0,e.width,e.height);var i=this.transform,n=!1,s=G.allocAt(t.x,t.y);return e.ca(i.Cd(s))&&(s.h(t.x,t.bottom),e.ca(i.Cd(s))&&(s.h(t.right,t.bottom),e.ca(i.Cd(s))&&(s.h(t.right,t.y),e.ca(i.Cd(s))&&(n=!0)))),G.free(s),Tt.free(e),n},L.fh=function(t,e){if(e===void 0)return t.Re(this.actualBounds);var i=this.naturalBounds,n=!1,s=G.allocAt(0,0);return t.ca(e.Ga(s))&&(s.h(0,i.height),t.ca(e.Ga(s))&&(s.h(i.width,i.height),t.ca(e.Ga(s))&&(s.h(i.width,0),t.ca(e.Ga(s))&&(n=!0)))),G.free(s),n},L.Yc=function(t,e){if(e===void 0&&(e=this.transform,this.angle===0))return t.Yc(this.actualBounds);var i=this.naturalBounds,n=G.allocAt(0,0),s=G.allocAt(0,i.height),a=G.allocAt(i.width,i.height),l=G.allocAt(i.width,0),c=!1;if(t.ca(e.Ga(n))||t.ca(e.Ga(s))||t.ca(e.Ga(a))||t.ca(e.Ga(l)))c=!0;else{i=Tt.allocAt(0,0,i.width,i.height);var p=G.allocAt(t.x,t.y);i.ca(e.Cd(p))?c=!0:(p.h(t.x,t.bottom),i.ca(e.Cd(p))?c=!0:(p.h(t.right,t.bottom),i.ca(e.Cd(p))?c=!0:(p.h(t.right,t.y),i.ca(e.Cd(p))&&(c=!0)))),G.free(p),Tt.free(i),!c&&(xt.us(t,n,s)||xt.us(t,s,a)||xt.us(t,a,l)||xt.us(t,l,n))&&(c=!0)}return G.free(n),G.free(s),G.free(a),G.free(l),c},L.ga=function(t,e){if(e===void 0&&(e=new G),t instanceof di){var i=this.naturalBounds;e.h(t.x*i.width+t.offsetX,t.y*i.height+t.offsetY)}else e.set(t);return this.oe.Ga(e),e},L.mi=function(t){t===void 0&&(t=new Tt);var e=this.naturalBounds,i=this.oe,n=G.allocAt(0,0).transform(i);return t.h(n.x,n.y,0,0),n.h(e.width,0).transform(i),or(t,n.x,n.y,0,0),n.h(e.width,e.height).transform(i),or(t,n.x,n.y,0,0),n.h(0,e.height).transform(i),or(t,n.x,n.y,0,0),G.free(n),t},L.li=function(){var t=this.oe;return t.m11===1&&t.m12===0?t=0:(t=180*Math.atan2(t.m12,t.m11)/Math.PI,0>t&&(t+=360)),t},L.Df=function(){if(!(this.l&4096))return this.Kk;var t=this.Ca;return this.panel!==null?t*this.panel.Df():t},L.qs=function(t,e){return e===void 0&&(e=new G),e.assign(t),this.oe.Cd(e),e},L.rs=function(t,e,i){return this.Sj(t.x,t.y,e.x,e.y,i)},L.Sj=function(t,e,i,n,s){var a=this.transform,l=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*l,p=-a.m12*l,m=-a.m21*l,v=a.m11*l,w=l*(a.m21*a.dy-a.m22*a.dx),C=l*(a.m12*a.dx-a.m11*a.dy);return this.areaBackground!==null?(a=this.actualBounds,xt.Ff(a.left,a.top,a.right,a.bottom,t,e,i,n,s)):(l=t*c+e*m+w,t=t*p+e*v+C,e=i*c+n*m+w,i=i*p+n*v+C,s.h(0,0),n=this.naturalBounds,i=xt.Ff(0,0,n.width,n.height,l,t,e,i,s),s.transform(a),i)},pt.prototype.measure=function(t,e,i,n){if(lh(this)!==!1){var s=this.Kg,a=s.right+s.left;s=s.top+s.bottom,t=Math.max(t-a,0),e=Math.max(e-s,0),i=Math.max((i||0)-a,0),n=Math.max((n||0)-s,0),a=this.angle,s=this.desiredSize;var l=this.kq();a===90||a===270?(t=isFinite(s.height)?s.height+l:t,e=isFinite(s.width)?s.width+l:e):(t=isFinite(s.width)?s.width+l:t,e=isFinite(s.height)?s.height+l:e),s=i||0,l=n||0;var c=this instanceof ce;switch(Qu(this,!0)){case Jt:l=s=0,c&&(e=t=1/0);break;case oe:isFinite(t)&&t>i&&(s=t),isFinite(e)&&e>n&&(l=e);break;case mi:isFinite(t)&&t>i&&(s=t),l=0,c&&(e=1/0);break;case Ii:isFinite(e)&&e>n&&(l=e),s=0,c&&(t=1/0)}c=this.maxSize;var p=this.minSize;s>c.width&&p.width<c.width&&(s=c.width),l>c.height&&p.height<c.height&&(l=c.height),i=Math.max(s,p.width),n=Math.max(l,p.height),c.width<i&&(i=Math.min(p.width,i)),c.height<n&&(n=Math.min(p.height,n)),t=Math.min(c.width,t),e=Math.min(c.height,e),t=Math.max(i,t),e=Math.max(n,e),(a===90||a===270)&&(a=t,t=e,e=a,a=i,i=n,n=a),this.uc.ka(),this.Wl(t,e,i,n),this.uc.freeze(),this.uc.w()||Mt("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),ba(this,!1)}},pt.prototype.Wl=function(){},pt.prototype.Dd=function(){return!1},pt.prototype.arrange=function(t,e,i,n,s){this.Uk();var a=Tt.alloc();a.assign(this.Ib),this.Ib.ka(),Vu(this)===!1?this.Ib.h(t,e,i,n):this.eh(t,e,i,n),this.Ib.freeze(),s===void 0?this.tb=null:this.tb=s,i=!1,s!==void 0?i=!0:(s=this.panel,s!==null&&md(s)&&(s=s.panel),s!==null&&(s=s.dc,n=this.measuredBounds,this.areaBackground!==null&&(n=this.Ib),i=e+n.height,n=t+n.width,i=!(0<=t+.05&&n<=s.width+.05&&0<=e+.05&&i<=s.height+.05),this instanceof ao&&(t=this.naturalBounds,this.Lq>t.height||this.Cb>t.width))&&(i=!0)),this.l=i?this.l|256:this.l&-257,this.Ib.w()||Mt("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(a,this.Ib),au(this,!1),Tt.free(a)},L=pt.prototype,L.eh=function(){};function Hu(t,e,i,n,s){if(t.Ib.h(e,i,n,s),!t.desiredSize.w()){var a=t.uc;i=t.Kg,e=i.right+i.left;var l=i.top+i.bottom;switch(i=a.width+e,a=a.height+l,n+=e,s+=l,e=Qu(t,!0),i===n&&a===s&&(e=Jt),e){case Jt:(i>n||a>s)&&(ba(t,!0),t.measure(i>n?n:i,a>s?s:a,0,0));break;case oe:ba(t,!0),t.measure(n,s,0,0);break;case mi:ba(t,!0),t.measure(n,a,0,0);break;case Ii:ba(t,!0),t.measure(i,s,0,0)}}}L.Xl=function(t,e){var i=this.part;i!==null&&i.diagram!==null&&(i.selectionObject!==this&&i.resizeObject!==this&&i.rotateObject!==this||Gg(i,!0),this.N(),ls(t,e)||(i.oh(),this.Pn(i)))},L.Pn=function(t){this.portId!==null&&(Gg(t,!0),t instanceof Ee&&Km(t,this))},L.gc=function(t,e){if(!ac(this,t,e)&&this.visible){var i=this.opacity;if(i!==0){var n=1;i!==1&&(n=t.globalAlpha,t.globalAlpha=n*i);var s="";this.filter!==""&&(s=t.filter,t.filter=this.filter);var a=this instanceof ce&&md(this),l=this.Ib;if(a){var c=this.Ib,p=this.dc,m=this.areaBackground,v=this.Ma;m===null&&v===null||t.yc(),m!==null&&(Gs(this,t,m,!0,!0,p,c),m instanceof Br&&m.type===lc?(t.beginPath(),t.rect(c.x,c.y,c.width,c.height),t.ng(m)):t.fillRect(c.x,c.y,c.width,c.height)),v!==null&&(Gs(this,t,v,!0,!1,p,c),v instanceof Br&&v.type===lc?(t.beginPath(),t.rect(c.x,c.y,c.width,c.height),t.ng(v)):t.fillRect(c.x,c.y,c.width,c.height)),this.hh(t,e)}if(!a&&(a||l.width!==0&&l.height!==0&&!isNaN(l.x)&&!isNaN(l.y))){a=this.transform,c=this.panel,this.l&4096&&Yl(this),m=this.part,p=!1;var w=0;m&&e.Gf("drawShadows")&&(p=m.isShadowed)&&(v=m.shadowOffset,w=Math.max(v.y,v.x)*e.scale*e.Mb),v=this.Dd();var C;if(!(C=e.$i||!v)){var k=this.naturalBounds;C=this.wh;var T=C.m11,A=C.m21,X=C.dx,$=C.m12,J=C.m22,et=C.dy,st,mt=st=0;C=st*T+mt*A+X;var Pt=st*$+mt*J+et;st=k.width+w,mt=0;var De=st*T+mt*A+X;st=st*$+mt*J+et,mt=Math.min(C,De);var ti=Math.min(Pt,st),Ve=Math.max(C+0,De)-mt,ye=Math.max(Pt+0,st)-ti;C=mt,Pt=ti,st=k.width+w,mt=k.height+w,De=st*T+mt*A+X,st=st*$+mt*J+et,mt=Math.min(C,De),ti=Math.min(Pt,st),Ve=Math.max(C+Ve,De)-mt,ye=Math.max(Pt+ye,st)-ti,C=mt,Pt=ti,st=0,mt=k.height+w,De=st*T+mt*A+X,st=st*$+mt*J+et,mt=Math.min(C,De),ti=Math.min(Pt,st),Ve=Math.max(C+Ve,De)-mt,ye=Math.max(Pt+ye,st)-ti,C=mt,Pt=ti,w=e.viewportBounds,k=w.x,T=w.y,C=!(C>w.width+k||k>Ve+C||Pt>w.height+T||T>ye+Pt)}if(C){if(C=(this.l&256)!==0,t.clipInsteadOfFill&&(C=!1),this instanceof ao&&(t.font=this.font),C){if(Pt=c.se()?c.naturalBounds:c.actualBounds,Ve=Math.max(l.x,Pt.x),ye=Math.max(l.y,Pt.y),w=Math.min(l.right,Pt.right)-Ve,k=Math.min(l.bottom,Pt.bottom)-ye,T=this.tb,T!==null&&(Ve=T.x,ye=T.y,w=T.width,k=T.height),Ve>l.width+l.x||l.x>Pt.width+Pt.x){i!==1&&(t.globalAlpha=n),this.filter!==""&&(t.filter=s);return}t.save(),t.beginPath(),t.rect(Ve,ye,w,k),t.clip()}if(v){if(!m.isVisible()){i!==1&&(t.globalAlpha=n),this.filter!==""&&(t.filter=s);return}p&&(Pt=m.shadowOffset,t.Ev(Pt.x*e.scale*this.scale*e.Mb,Pt.y*e.scale*this.scale*e.Mb,m.shadowBlur),qf(t),t.shadowColor=m.shadowColor)}p&&this.shadowVisible===!0?qf(t):p&&this.shadowVisible===!1&&Fc(t),m=this.naturalBounds,this.areaBackground!==null&&(t.yc(),Rh(this,t,m,l)),t.transform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),p&&Ol(this,c)&&this.shadowVisible===null&&Fc(t),this.Ma!==null&&(t.yc(),xh(this,t,m,l)),p&&(this.Ma!==null||this.areaBackground!==null||Ol(this,c))?(wa(this,!0),this.shadowVisible===null&&Fc(t)):wa(this,!1),this.hh(t,e),p&&this.l&512&&qf(t),v&&p&&Fc(t),C&&(t.restore(),t.Vc(this instanceof ce)),a.ws()||(e=1/(a.m11*a.m22-a.m12*a.m21),t.transform(a.m22*e,-a.m12*e,-a.m21*e,a.m11*e,e*(a.m21*a.dy-a.m22*a.dx),e*(a.m12*a.dx-a.m11*a.dy)))}}i!==1&&(t.globalAlpha=n),this.filter!==""&&(t.filter=s)}}};function Ol(t,e){return e===null?!1:(md(e)&&(e=e.panel),(e.l&512)!==0||(e.type===ce.Auto||e.type===ce.Spot)&&e.Pb()!==t)}L.Dv=function(){};function Rh(t,e,i,n){Gs(t,e,t.areaBackground,!0,!0,i,n),t.areaBackground instanceof Br&&t.areaBackground.type===lc?(e.beginPath(),e.rect(n.x,n.y,n.width,n.height),e.ng(t.areaBackground)):e.fillRect(n.x,n.y,n.width,n.height)}function xh(t,e,i,n){var s=t.kq(),a=i.x,l=i.y,c=i.width+s,p=i.height+s;Gs(t,e,t.Ma,!0,!1,i,n),t.Ma instanceof Br&&t.Ma.type===lc?(e.beginPath(),e.rect(a-s/2,l-s/2,c,p),e.ng(t.Ma)):e.fillRect(a-s/2,l-s/2,c,p)}function Bu(t,e,i){for(var n=e.O.s,s=n.length,a=-1,l=0;l<s;l++)if(n[l]===t){a=l;break}if(t=a,t!==-1)if(t===0)e.svg.gd?e.svg.gd.after(i):e.svg.Ma?e.svg.Ma.after(i):e.type===ce.Table?(e=e.svg.getElementsByClassName("gojs-ts"),e=e.length!==0?e[0]:null,e!==null&&e.after(i)):e.svg.prepend(i);else{for(;t!==0&&!e.M(t-1).Ed();)t--;t===0?e.svg.prepend(i):(t=e.M(t-1).svg,t!==null?t.after(i):e.svg.appendChild(i))}}function ac(t,e,i){if(!(e instanceof Fu))return!1;if(!t.visible||t.opacity===0||t.Dd()&&!t.isVisible())return t.svg!==null&&t.svg.parentNode!==null&&t.svg.remove(),!0;var n=t.panel,s=t.nk(e);if(t.kk(e,i,s))return t.svg.parentElement!==null?(t.Dd()&&(e.ti=t.svg),!0):(t.Dd()?(e.ti!==null?e.ti.after(t.svg):e.Nj.prepend(t.svg),e.ti=t.svg):n&&Bu(t,n,t.svg),!0);if(t.Dd()&&t.isShadowed){var a=t.shadowOffset;e.Ev(a.x*i.scale*t.scale*i.Mb,a.y*i.scale*t.scale*i.Mb,t.shadowBlur),qf(e),e.shadowColor=t.shadowColor}t instanceof ao&&(e.font=t.font),e.yd=null;var l=t.transform;a=t instanceof ce;var c=t instanceof ce?md(t):!1;t.l&4096&&Yl(t);var p=t.Ib;if(e.rb.ha=[1,0,0,1,0,0],e.o=!1,s&&(e.o=!0,a&&c?(P0(e,1,0,0,1,0,0),t.svg=e.ad):a?(P0(e,l.m11,l.m12,l.m21,l.m22,l.dx,l.dy),t.svg=e.ad):P0(e,1,0,0,1,0,0)),s=t.naturalBounds,t.areaBackground!==null){var m=l.copy().Vj();e.rb.ha=[m.m11,m.m12,m.m21,m.m22,m.dx,m.dy],Rh(t,e,s,p),e.rb.ha=[1,0,0,1,0,0],e.yd.gd=e.ad,e.yd.prepend(e.ad)}return a||(e.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy]),t.background!==null&&(a?(c&&(e.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy]),xh(t,e,s,p),c&&(e.rb.ha=[1,0,0,1,0,0])):(e.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy],xh(t,e,s,p)),e.yd.Ma=e.ad,e.yd.prepend(e.ad)),l=e.yd,s=t.part,c=!1,s&&i.Gf("drawShadows")&&(c=s.isShadowed),e.clipInsteadOfFill&&(c=!1),t.Dd()&&c&&qf(e),c&&t.shadowVisible===!0?qf(e):c&&t.shadowVisible===!1&&Fc(e),s=t.panel,c&&Ol(t,s)&&t.shadowVisible===null&&Fc(e),e.Il&&(m=i.computePixelRatio(),m="drop-shadow("+e.shadowOffsetX/m+"px "+e.shadowOffsetY/m+"px "+e.shadowBlur/m/2+"px "+e.shadowColor+")",t.background!==null&&l.Ma.setAttributeNS(null,"filter",m),t.areaBackground!==null&&l.gd.setAttributeNS(null,"filter",m)),c&&(t.Ma!==null||t.areaBackground!==null||Ol(t,s))?(wa(t,!0),t.shadowVisible===null&&Fc(e)):wa(t,!1),s=c,t.hh(e,i),a&&e.nh.pop(),e.o&&e.nh.pop(),l=e.Gv.hs,c=a?t.svg:e.yd,m=t.svg,!a&&m!==null&&c!==m&&m.parentNode===t.panel.svg?(t.svg.replaceWith(c),t.svg=c,c!==null&&t.$o(e,n,p,c),ts(e,m),!0):(t.svg=c,l!==null&&c===null&&(Mg(e),e.nh.pop()),c===null||(t.$o(e,n,p,c),e.Il&&(i=i.computePixelRatio(),t.Dv(c,"drop-shadow("+e.shadowOffsetX/i+"px "+e.shadowOffsetY/i+"px "+e.shadowBlur/i/2+"px "+e.shadowColor+")")),s&&t.l&512&&qf(e),t.Dd()&&Fc(e),i=t.Dd()?t.opacity*e.globalAlpha:t.opacity,i!==1&&c.setAttributeNS(null,"opacity",i.toString()),t.filter!==""&&c.setAttributeNS(null,"filter",t.filter),t.Dd()?(e.ti?e.ti.after(c):e.Nj.prepend(c),e.ti=c):n!==null&&Bu(t,n,c),l!==null&&l(t,c)),!0)}L.$o=function(t,e,i,n){var s=(this.l&256)!==0;if(t.clipInsteadOfFill&&(s=!1),s){var a=e.se()?e.naturalBounds:e.actualBounds;e=Math.max(i.x,a.x),s=Math.max(i.y,a.y);var l=Math.min(i.right,a.right)-e;i=Math.min(i.bottom,a.bottom)-s,a=this.tb,a!==null&&(e=a.x,s=a.y,l=a.width,i=a.height),a=n.getAttribute("clip-path");var c=null;a!==null&&(c=t.svg.getElementById(a.split("#")[1].slice(0,-1))),c===null?(a="CLIP"+ea++,c=t.Ud("clipPath",{id:a}),e=t.Ud("rect",{x:e,y:s,width:l,height:i}),this instanceof ce&&(s=this.transform.copy().Vj(),e.setAttribute("transform","matrix("+s.m11+", "+s.m12+", "+s.m21+", "+s.m22+", "+s.dx+", "+s.dy+")")),c.appendChild(e),t.svg.appendChild(c),n.setAttributeNS(null,"clip-path","url(#"+a+")")):(t=c.firstElementChild,t.setAttribute("x",e.toString()),t.setAttribute("y",s.toString()),t.setAttribute("width",l.toString()),t.setAttribute("height",i.toString()))}else n.removeAttributeNS(null,"clip-path"),ts(t,n)};function ts(t,e){e=e.getAttribute("clip-path"),e!==null&&(t=t.svg.getElementById(e.split("#")[1].slice(0,-1)),t!==null&&t.remove())}function su(t){if(t.svg!==null){var e=t.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),i=t.svg.ownerDocument;if(e!==null){e=qe(e);for(var n=e.next();!n.done;n=e.next())n=i.getElementById(n.value.split("#")[1].slice(0,-1)),n!==null&&n.remove()}t.svg.remove()}}L.hh=function(){},L.lv=function(){this.Uc=!0},L.kk=function(t,e,i){if(this.Uc)return this.lv(),this.Uc=!1;if(e=this.svg,e===null)return!1;if(!this.visible)return e.remove(),!1;if(e.nodeName!=="g"&&i||e.nodeName==="g"&&!i)return!1;var n=this.transform,s=this instanceof ce?md(this):!1;if(!(this instanceof ce&&s))if(this instanceof hh){var a=this.bt;t.rb.ha=[n.m11,n.m12,n.m21,n.m22,n.dx,n.dy],a!==null&&T0(t,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]),i?e.lastElementChild.setAttributeNS(null,"transform",Sg(t)):e.setAttributeNS(null,"transform",Sg(t))}else if(!i||this instanceof ce)e.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");else if(this instanceof pn){a=e.getElementsByTagName("path");for(var l=0;l<a.length;l++)a[l].setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")")}else e.lastElementChild.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");return a=this.Dd()?this.opacity*t.globalAlpha:this.opacity,a===1?e.removeAttribute("opacity"):e.setAttributeNS(null,"opacity",a.toString()),t.rb.ha=[1,0,0,1,0,0],(this.areaBackground!==null||e.gd!==void 0)&&(a=e.gd,this.areaBackground===null?(e.gd.remove(),e.gd=void 0):(l=n.copy().Vj(),t.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy],Rh(this,t,this.naturalBounds,this.actualBounds),t.rb.ha=[1,0,0,1,0,0],e.gd?(l=e.gd.getAttribute("filter"),l!==null&&t.ad.setAttribute("filter",l),e.gd.replaceWith(t.ad)):e.prepend(t.ad),e.gd=t.ad),a&&Cg(t,a)),(this.background!==null||e.Ma!==void 0)&&(a=e.Ma,this.background===null?(Cg(t,e.Ma),e.Ma.remove(),e.Ma=void 0):((s||i&&!(this instanceof ce))&&(t.rb.ha=[n.m11,n.m12,n.m21,n.m22,n.dx,n.dy]),xh(this,t,this.naturalBounds,this.actualBounds),e.Ma?(Cg(t,e.Ma),i=e.Ma.getAttribute("filter"),i!==null&&t.ad.setAttribute("filter",i),e.Ma.replaceWith(t.ad)):e.prepend(t.ad),e.Ma=t.ad),a&&Cg(t,a)),this.$o(t,this.panel,this.actualBounds,e),!0},L.nk=function(t){if(this.background!==null||this.areaBackground!==null)return!0;var e=(this.l&256)!==0;return t.clipInsteadOfFill&&(e=!1),!!e};function Gs(t,e,i,n,s,a,l){if(i!==null){var c=1,p=1;if(typeof i=="string")n?e.fillStyle=i:e.strokeStyle=i;else if(i.type===td)n?e.fillStyle=i.color:e.strokeStyle=i.color;else{var m=t.kq();if(c=a.width,p=a.height,s?(c=l.width,p=l.height):n||(c+=m,p+=m),(a=e instanceof Bf)&&i.xe&&(i.type===A0||i.yk===c&&i.ft===p))var v=i.xe;else{var w=0,C=0,k=0,T=0,A=0,X=0;if(X=A=0,s?(A=l.x,X=l.y):n||(A-=m/2,X-=m/2),w=i.start.x*c+i.start.offsetX,C=i.start.y*p+i.start.offsetY,k=i.end.x*c+i.end.offsetX,T=i.end.y*p+i.end.offsetY,w+=A,k+=A,C+=X,T+=X,i.type===ed)v=e.createLinearGradient(w,C,k,T);else if(i.type===lc)X=isNaN(i.endRadius)?Math.max(c,p)/2:i.endRadius,isNaN(i.startRadius)?(A=0,X=Math.max(c,p)/2):A=i.startRadius,v=e.createRadialGradient(w,C,A,k,T,X);else if(i.type===A0)try{v=e.createPattern(i.pattern,"repeat")}catch(J){v=null}if(i.type!==A0&&(s=i.colorStops,s!==null))for(s=s.iterator;s.next();)v.addColorStop(s.key,s.value);if(a&&(i.xe=v,v!==null&&(i.yk=c,i.ft=p),v===null&&i.type===A0&&i.yk!==-1)){i.yk=-1;var $=t.diagram;$!==null&&i.yk===-1&&Ce(function(){$.redraw()},600)}}n?e.fillStyle=v:e.strokeStyle=v}}}L.rg=function(t){if(t instanceof ce)t:{if(this!==t&&t!==null)for(var e=this.panel;e!==null;){if(e===t){t=!0;break t}e=e.panel}t=!1}else t=!1;return t},L.Ed=function(){if(!this.visible)return!1;var t=this.panel;return t!==null?t.Ed():!0},L.If=function(){for(var t=this instanceof ce?this:this.panel;t!==null&&t.isEnabled;)t=t.panel;return t===null};function Yl(t){if(t.l&2048){var e=t.Ab;if(e.reset(),!t.Ib.w()||!t.uc.w()){_c(t,!1);return}if(e.translate(t.Ib.x-t.uc.x,t.Ib.y-t.uc.y),t.scale!==1||t.angle!==0){var i=t.naturalBounds;t.no(e,i.x,i.y,i.width,i.height)}_c(t,!1),Gh(t,!0)}t.l&4096&&(e=t.panel,e===null?(t.wh.set(t.Ab),t.Kk=t.scale,Gh(t,!1)):e.oe!==null&&(i=t.wh,i.reset(),e.se()?i.multiply(e.wh):e.panel!==null&&i.multiply(e.panel.wh),i.multiply(t.Ab),t.Kk=t.scale*e.Kk,Gh(t,!1)))}L.no=function(t,e,i,n,s){if(this.Ca!==1&&t.scale(this.Ca),this.Kb!==0){var a=G.alloc();a.yi(e,i,n,s,_n),t.rotate(this.Kb,a.x,a.y),G.free(a)}},L.v=function(t){if(!lh(this)){t===void 0&&(t=!1),ba(this,!0),au(this,!0);var e=this.panel;e===null||t||e.v()}},L.Uj=function(){lh(this)||(ba(this,!0),au(this,!0))};function Rl(t){if(!Vu(t)){var e=t.panel;e!==null?e.v():t.Dd()&&(e=t.diagram,e!==null&&(e.De.add(t),t instanceof Ee&&t.Bd(),e.$b())),au(t,!0)}}L.Uk=function(){!(this.l&2048)&&(_c(this,!0),Gh(this,!0))},L.Wu=function(){Gh(this,!0)},L.N=function(){var t=this.part;t!==null&&t.N()};function Qu(t,e){var i=t.stretch,n=t.panel;return n!==null&&n.type===ce.Table?wh(t,n.Fb(t.row),n.Eb(t.column),e):n!==null&&n.type===ce.Auto&&n.Pb()===t?_l(t,oe,e):i===on?n!==null?n.type===ce.Spot&&n.Pb()===t?_l(t,oe,e):(i=n.defaultStretch,i===on?_l(t,Jt,e):_l(t,i,e)):_l(t,Jt,e):_l(t,i,e)}function wh(t,e,i,n){var s=t.stretch;if(s!==on)return _l(t,s,n);var a=s=null;switch(e.stretch){case Ii:a=!0;break;case oe:a=!0}switch(i.stretch){case mi:s=!0;break;case oe:s=!0}return e=t.panel.defaultStretch,s===null&&(s=e===mi||e===oe),a===null&&(a=e===Ii||e===oe),s===!0&&a===!0?_l(t,oe,n):s===!0?_l(t,mi,n):a===!0?_l(t,Ii,n):_l(t,Jt,n)}function _l(t,e,i){if(i)return e;if(e===Jt||(i=t.desiredSize,i.w()))return Jt;if(t=t.angle,!isNaN(i.width))if(t!==90&&t!==270){if(e===mi)return Jt;if(e===oe)return Ii}else{if(e===Ii)return Jt;if(e===oe)return mi}if(!isNaN(i.height))if(t!==90&&t!==270){if(e===Ii)return Jt;if(e===oe)return mi}else{if(e===mi)return Jt;if(e===oe)return Ii}return e}function wa(t,e){t.l=e?t.l|512:t.l&-513}function Jl(t){return(t.l&1024)!==0}function np(t,e){t.l=e?t.l|1024:t.l&-1025}function _c(t,e){t.l=e?t.l|2048:t.l&-2049}function Gh(t,e){t.l=e?t.l|4096:t.l&-4097}function lh(t){return(t.l&8192)!==0}function ba(t,e){t.l=e?t.l|8192:t.l&-8193}function Vu(t){return(t.l&16384)!==0}function au(t,e){t.l=e?t.l|16384:t.l&-16385}L.Gj=function(){this.svg=null},L.wi=function(t){this.Me=t,this.svg!==null&&this.svg.remove()},L.Av=function(){},L.zv=function(t){return this.pa=t,Rl(this),!0},L.mm=function(t,e){(this.pa.x!==t||this.pa.y!==e)&&(this.pa.h(t,e),this.Uk())},L.kq=function(){return 0};function Dd(t){var e=t.part;if(e instanceof Ee&&(t.portId!==null||t===e.port)){var i=e.diagram;i===null||i.undoManager.isUndoingRedoing||Km(e,t)}}function Fv(t){var e=t.diagram;e===null||e.undoManager.isUndoingRedoing||(t instanceof ce?t instanceof Ee?t.Bd():t.qm(t,function(i){Dd(i)}):Dd(t))}L.bind=function(t,e,i,n){var s=null;return typeof t=="string"?s=new lo(t,e,i,n):s=t,s.xd=this,t=this.ih(),t!==null&&n1(t)&&Mt("Cannot add a Binding to a template that has already been copied: "+s),this.localBindings===null&&(this.localBindings=new ue),this.localBindings.add(s),this},L.set=function(t){return Object.assign(this,t),this},L.Du=function(t){return Bl(this,t),this},L.apply=function(t){return t(this),this},L.nm=function(t){return Ta(this,t),this},L.pz=function(){return this.ih()},L.ih=function(){for(var t=this instanceof ce?this:this.panel;t!==null;){if(t.allBindings!==null)return t;t=t.panel}return null},L.Jv=function(t){return t.xd=this,this.animationTriggers===null&&(this.animationTriggers=new ci),this.animationTriggers.add(t.propertyName,t),this};function Ei(t,e){for(var i=1;i<arguments.length;++i);i=arguments;var n=null,s=null;if(typeof t=="function")s=t;else if(typeof t=="string"){var a=Hp.I(t);typeof a=="function"?(i=vr(arguments),n=a(i),Qt(n)||Mt('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):s=Kt.go[t]}if(n===null&&(s!=null&&s.constructor||Mt("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+t),n=new s),s=1,n instanceof Ct&&1<i.length){a=n;var l=i[1];(typeof l=="string"||l instanceof HTMLDivElement)&&(Pn(a,l),s++)}for(;s<i.length;s++)a=i[s],a===void 0?Mt("Undefined value at argument "+s+" for object being constructed by GraphObject.make: "+n):Bl(n,a);return n}function Bl(t,e){if(typeof e=="string")if(t instanceof ao)t.text=e;else if(t instanceof pn)t.figure=e;else if(t instanceof hh)t.source=e;else if(t instanceof ce)e=Mh.I(e),e!==null&&(t.type=e);else if(t instanceof Br){var i=ss(Br,e);i!==null?t.type=i:Mt("Unknown Brush type as an argument to GraphObject.make: "+e)}else t instanceof ve?(e=ss(ve,e),e!==null&&(t.type=e)):t instanceof zn&&(e=ss(zn,e),e!==null&&(t.type=e));else if(e instanceof pt)t instanceof ce||Mt("A GraphObject can only be added to a Panel, not to: "+t),t.add(e);else if(e instanceof tl){var n;e.isRow&&typeof t.getRowDefinition=="function"?n=t.getRowDefinition(e.index):e.isRow||typeof t.getColumnDefinition!="function"||(n=t.getColumnDefinition(e.index)),n instanceof tl?Jp(n,e):Mt("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+t)}else if(e instanceof he)typeof t.qb=="function"&&t.qb(e);else if(e instanceof fl)t.type=e;else if(e instanceof lo)t instanceof pt||t instanceof tl?t.bind(e):Mt("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+t);else if(e instanceof nn)t instanceof pt?t.Jv(e):Mt("An AnimationTrigger can only be applied to a GraphObject, not to: "+t);else if(e instanceof fa)t instanceof ve&&t.type===ve.o?t.figures.add(e):Mt("A PathFigure can only be added to a Path Geometry, not to: "+t);else if(e instanceof zn)t instanceof fa?t.segments.add(e):Mt("A PathSegment can only be added to a PathFigure, not to: "+t);else if(e instanceof hs)t instanceof Ct||t instanceof Yi?t.layout=e:Mt("A Layout can only be assigned to a Diagram or a Group, not to: "+t);else if(Array.isArray(e))for(i=0;i<e.length;i++)Bl(t,e[i]);else if(typeof e=="object"&&e!==null)if(t instanceof Br){i=new Bo;for(var s in e)n=parseFloat(s),isNaN(n)?i[s]=e[s]:t.addColorStop(n,e[s]);Ta(t,i)}else if(t instanceof tl){e.row!==void 0?(s=e.row,(s==null||s===1/0||isNaN(s)||0>s)&&Mt("Must specify non-negative integer row for RowColumnDefinition "+e+", not: "+s),t.isRow=!0,t.index=s):e.column!==void 0&&(s=e.column,(s==null||s===1/0||isNaN(s)||0>s)&&Mt("Must specify non-negative integer column for RowColumnDefinition "+e+", not: "+s),t.isRow=!1,t.index=s),s=new Bo;for(i in e)i!=="row"&&i!=="column"&&(s[i]=e[i]);Ta(t,s)}else Ta(t,e);else Mt('Unknown initializer "'+e+'" for object being constructed by GraphObject.make: '+t)}function Id(t,e){Hp.add(t,e)}function zv(t,e,i){i===void 0&&(i=null);var n=t[1];if(typeof i=="function"?i(n):typeof n=="string")return t.splice(1,1),n;if(e===void 0)throw Error("no "+(typeof i=="function"?"satisfactory":"string")+" argument for GraphObject builder "+t[0]);return e}St.Object.defineProperties(pt.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(t){this.bindingId!==t&&(this.A===null&&(this.A=new rp),this.A.zp=t)}},localBindings:{get:function(){return this.A!==null?this.A.te:null},set:function(t){this.localBindings!==t&&(this.A===null&&(this.A=new rp),this.A.te=t)}},srcBindings:{get:function(){return this.A!==null?this.A.wm:null},set:function(t){this.srcBindings!==t&&(this.A===null&&(this.A=new rp),this.A.wm=t)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(t){var e=this.shadowVisible;e!==t&&(bn(this),this.A.Ci=t,this.Uc=!0,this.N(),this.g("shadowVisible",e,t))}},enabledChanged:{get:function(){return this.A!==null?this.A.Hb:null},set:function(t){var e=this.enabledChanged;e!==t&&(bn(this),this.A.Hb=t,this.g("enabledChanged",e,t))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:eh},set:function(t){var e=this.segmentOrientation;e!==t&&(this.Ua===null&&(this.Ua=new vf),this.Ua.rr=t,this.v(),this.g("segmentOrientation",e,t),t===eh&&(this.angle=0))}},segmentIndex:{get:function(){return this.Ua!==null?this.Ua.u:-1/0},set:function(t){t=Math.round(t);var e=this.segmentIndex;e!==t&&(this.Ua===null&&(this.Ua=new vf),this.Ua.u=t,this.v(),this.g("segmentIndex",e,t))}},segmentFraction:{get:function(){return this.Ua!==null?this.Ua.o:0},set:function(t){isNaN(t)||0>t?t=0:1<t&&(t=1);var e=this.segmentFraction;e!==t&&(this.Ua===null&&(this.Ua=new vf),this.Ua.o=t,this.v(),this.g("segmentFraction",e,t))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:Wa},set:function(t){var e=this.segmentOffset;e.D(t)||(t=t.J(),this.Ua===null&&(this.Ua=new vf),this.Ua.F=t,this.v(),this.g("segmentOffset",e,t))}},stretch:{get:function(){return this.A!==null?this.A.hg:on},set:function(t){var e=this.stretch;e!==t&&(bn(this),this.A.hg=t,this.v(),this.g("stretch",e,t))}},name:{get:function(){return this.A!==null?this.A.xa:""},set:function(t){var e=this.name;e!==t&&(bn(this),this.A.xa=t,this.part!==null&&(this.part.Rh=null),this.g("name",e,t))}},opacity:{get:function(){return this.pb},set:function(t){var e=this.pb;e!==t&&((0>t||1<t)&&Re(t,"0 <= value <= 1",pt,"opacity"),this.pb=t,this.g("opacity",e,t),t=this.diagram,e=this.part,t!==null&&e!==null&&t.N(of(e,e.actualBounds)))}},filter:{get:function(){return this.bn},set:function(t){var e=this.bn;e!==t&&(this.bn=t,this.Uc=!0,this.g("filter",e,t),t=this.diagram,e=this.part,t!==null&&e!==null&&t.N(of(e,e.actualBounds)))}},visible:{get:function(){return(this.l&1)!==0},set:function(t){var e=(this.l&1)!==0;e!==t&&(this.l^=1,this.g("visible",e,t),e=this.panel,e!==null?e.v():this.Dd()&&this.Zb(t),this.N(),Fv(this))}},pickable:{get:function(){return(this.l&2)!==0},set:function(t){var e=(this.l&2)!==0;e!==t&&(this.l^=2,this.g("pickable",e,t))}},fromLinkableDuplicates:{get:function(){return(this.l&4)!==0},set:function(t){var e=(this.l&4)!==0;e!==t&&(this.l^=4,this.g("fromLinkableDuplicates",e,t))}},fromLinkableSelfNode:{get:function(){return(this.l&8)!==0},set:function(t){var e=(this.l&8)!==0;e!==t&&(this.l^=8,this.g("fromLinkableSelfNode",e,t))}},toLinkableDuplicates:{get:function(){return(this.l&16)!==0},set:function(t){var e=(this.l&16)!==0;e!==t&&(this.l^=16,this.g("toLinkableDuplicates",e,t))}},toLinkableSelfNode:{get:function(){return(this.l&32)!==0},set:function(t){var e=(this.l&32)!==0;e!==t&&(this.l^=32,this.g("toLinkableSelfNode",e,t))}},isPanelMain:{get:function(){return(this.l&64)!==0},set:function(t){var e=(this.l&64)!==0;e!==t&&(this.l^=64,this.v(),this.g("isPanelMain",e,t))}},isActionable:{get:function(){return(this.l&128)!==0},set:function(t){var e=(this.l&128)!==0;e!==t&&(this.l^=128,this.g("isActionable",e,t))}},areaBackground:{get:function(){return this.A!==null?this.A.gd:null},set:function(t){var e=this.areaBackground;e!==t&&(t!==null&&Gp(t,"GraphObject.areaBackground"),t instanceof Br&&t.freeze(),bn(this),this.A.gd=t,this.N(),this.g("areaBackground",e,t))}},background:{get:function(){return this.Ma},set:function(t){var e=this.Ma;e!==t&&(t!==null&&Gp(t,"GraphObject.background"),t instanceof Br&&t.freeze(),this.Ma=t,this.N(),this.g("background",e,t))}},part:{get:function(){if(this.Dd())return this;if(this.Ng!==null)return this.Ng;var t;for(t=this.panel;t;){if(t instanceof bi)return this.Ng=t;t=t.panel}return null}},svg:{get:function(){return this.V},set:function(t){this.V=t}},panel:{get:function(){return this.Me}},layer:{get:function(){var t=this.part;return t!==null?t.layer:null}},diagram:{get:function(){var t=this.part;return t!==null?t.diagram:null}},position:{get:function(){return this.pa},set:function(t){var e=t.x,i=t.y,n=this.pa,s=n.x;n=n.y,(s===e||isNaN(s)&&isNaN(e))&&(n===i||isNaN(n)&&isNaN(i))?this.Av():(t=t.copy(),this.zv(t,s,n)&&this.g("position",new G(s,n),t))}},actualBounds:{get:function(){return this.Ib}},scale:{get:function(){return this.Ca},set:function(t){var e=this.Ca;e!==t&&(0>=t&&Mt("GraphObject.scale for "+this+" must be greater than zero, not: "+t),this.Ca=t,this.v(),this.g("scale",e,t))}},angle:{get:function(){return this.Kb},set:function(t){var e=this.Kb;e!==t&&(t%=360,0>t&&(t+=360),e!==t&&(this.Kb=t,Fv(this),this.v(),this.g("angle",e,t)))}},desiredSize:{get:function(){return this.jd},set:function(t){var e=t.width,i=t.height,n=this.jd,s=n.width,a=n.height;(s===e||isNaN(s)&&isNaN(e))&&(a===i||isNaN(a)&&isNaN(i))||(this.jd=t=t.J(),this.v(),this instanceof pn&&this.qc(),this.g("desiredSize",n,t),Jl(this)&&(t=this.part,t!==null&&(rs(this,t,"width"),rs(this,t,"height"))))}},width:{get:function(){return this.jd.width},set:function(t){var e=this.jd.width;e===t||isNaN(e)&&isNaN(t)||(e=this.jd,this.jd=t=new fe(t,this.jd.height).freeze(),this.v(),this instanceof pn&&this.qc(),this.g("desiredSize",e,t),Jl(this)&&(t=this.part,t!==null&&rs(this,t,"width")))}},height:{get:function(){return this.jd.height},set:function(t){var e=this.jd.height;e===t||isNaN(e)&&isNaN(t)||(e=this.jd,this.jd=t=new fe(this.jd.width,t).freeze(),this.v(),this instanceof pn&&this.qc(),this.g("desiredSize",e,t),Jl(this)&&(t=this.part,t!==null&&rs(this,t,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:un},set:function(t){var e=this.minSize;e.D(t)||(t=t.copy(),isNaN(t.width)&&(t.width=0),isNaN(t.height)&&(t.height=0),t.freeze(),bn(this),this.A.u=t,this.v(),this.g("minSize",e,t))}},maxSize:{get:function(){return this.A!==null?this.A.o:ko},set:function(t){var e=this.maxSize;e.D(t)||(t=t.copy(),isNaN(t.width)&&(t.width=1/0),isNaN(t.height)&&(t.height=1/0),t.freeze(),bn(this),this.A.o=t,this.v(),this.g("maxSize",e,t))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(t){typeof t=="number"&&(t=new Ai(t));var e=this.Kg;e.D(t)||(this.Kg=t=t.J(),this.v(),this.g("margin",e,t))}},transform:{get:function(){return this.l&2048&&Yl(this),this.Ab}},oe:{get:function(){return this.l&4096&&Yl(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(t){this.animationTriggers!==t&&(bn(this),this.A.hb=t)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:Jt},set:function(t){this.reshapingBehavior!==t&&(bn(this),this.A.Pf=t)}},alignment:{get:function(){return this.Jb},set:function(t){var e=this.Jb;e.D(t)||(t.Mc()&&!t.Xb()&&Mt("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+t),this.Jb=t=t.J(),Rl(this),this.g("alignment",e,t))}},column:{get:function(){return this.Ag},set:function(t){t=Math.round(t);var e=this.Ag;e!==t&&(0>t&&Re(t,">= 0",pt,"column"),this.Ag=t,this.v(),this.g("column",e,t),this.svg!==null&&this.svg.remove())}},columnSpan:{get:function(){return this.A!==null?this.A.ob:1},set:function(t){t=Math.round(t);var e=this.columnSpan;e!==t&&(1>t&&Re(t,">= 1",pt,"columnSpan"),bn(this),this.A.ob=t,this.v(),this.g("columnSpan",e,t))}},row:{get:function(){return this.io},set:function(t){t=Math.round(t);var e=this.io;e!==t&&(0>t&&Re(t,">= 0",pt,"row"),this.io=t,this.v(),this.g("row",e,t),this.svg!==null&&this.svg.remove())}},rowSpan:{get:function(){return this.A!==null?this.A.Bi:1},set:function(t){t=Math.round(t);var e=this.rowSpan;e!==t&&(1>t&&Re(t,">= 1",pt,"rowSpan"),bn(this),this.A.Bi=t,this.v(),this.g("rowSpan",e,t))}},spanAllocation:{get:function(){return this.A!==null?this.A.Di:null},set:function(t){var e=this.spanAllocation;e!==t&&(bn(this),this.A.Di=t,this.v(),this.g("spanAllocation",e,t))}},alignmentFocus:{get:function(){return this.sk},set:function(t){var e=this.sk;e.D(t)||(this.sk=t=t.J(),this.v(),this.g("alignmentFocus",e,t))}},portId:{get:function(){return this.Yn},set:function(t){var e=this.Yn;if(e!==t){var i=this.part;i===null||i instanceof Ee||Mt("Cannot set portID on a Link: "+t),e!==null&&i!==null&&uy(i,this),this.Yn=t,t!==null&&i!==null&&(i.Te=!0,ly(i,this)),this.g("portId",e,t)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:jr},set:function(t){var e=this.toSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.yj=t,this.g("toSpot",e,t),Dd(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(t){var e=this.toEndSegmentLength;e!==t&&(0>t&&Re(t,">= 0",pt,"toEndSegmentLength"),this.Xc(),this.ba.wj=t,this.g("toEndSegmentLength",e,t),Dd(this))}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:0},set:function(t){var e=this.toShortLength;e!==t&&(this.Xc(),this.ba.xj=t,this.g("toShortLength",e,t),Dd(this))}},toLinkable:{get:function(){return this.ba!==null?this.ba.Tr:null},set:function(t){var e=this.toLinkable;e!==t&&(this.Xc(),this.ba.Tr=t,this.g("toLinkable",e,t))}},toMaxLinks:{get:function(){return this.ba!==null?this.ba.Ur:1/0},set:function(t){var e=this.toMaxLinks;e!==t&&(0>t&&Re(t,">= 0",pt,"toMaxLinks"),this.Xc(),this.ba.Ur=t,this.g("toMaxLinks",e,t))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:jr},set:function(t){var e=this.fromSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.Xi=t,this.g("fromSpot",e,t),Dd(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(t){var e=this.fromEndSegmentLength;e!==t&&(0>t&&Re(t,">= 0",pt,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=t,this.g("fromEndSegmentLength",e,t),Dd(this))}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:0},set:function(t){var e=this.fromShortLength;e!==t&&(this.Xc(),this.ba.Wi=t,this.g("fromShortLength",e,t),Dd(this))}},fromLinkable:{get:function(){return this.ba!==null?this.ba.hq:null},set:function(t){var e=this.fromLinkable;e!==t&&(this.Xc(),this.ba.hq=t,this.g("fromLinkable",e,t))}},fromMaxLinks:{get:function(){return this.ba!==null?this.ba.iq:1/0},set:function(t){var e=this.fromMaxLinks;e!==t&&(0>t&&Re(t,">= 0",pt,"fromMaxLinks"),this.Xc(),this.ba.iq=t,this.g("fromMaxLinks",e,t))}},cursor:{get:function(){return this.A!==null?this.A.j:""},set:function(t){var e=this.cursor;e!==t&&(bn(this),this.A.j=t,this.g("cursor",e,t))}},click:{get:function(){return this.A!==null?this.A.zh:null},set:function(t){var e=this.click;e!==t&&(bn(this),this.A.zh=t,this.g("click",e,t))}},doubleClick:{get:function(){return this.A!==null?this.A.Fh:null},set:function(t){var e=this.doubleClick;e!==t&&(bn(this),this.A.Fh=t,this.g("doubleClick",e,t))}},contextClick:{get:function(){return this.A!==null?this.A.Bh:null},set:function(t){var e=this.contextClick;e!==t&&(bn(this),this.A.Bh=t,this.g("contextClick",e,t))}},mouseEnter:{get:function(){return this.A!==null?this.A.Mh:null},set:function(t){var e=this.mouseEnter;e!==t&&(bn(this),this.A.Mh=t,this.g("mouseEnter",e,t))}},mouseLeave:{get:function(){return this.A!==null?this.A.Ph:null},set:function(t){var e=this.mouseLeave;e!==t&&(bn(this),this.A.Ph=t,this.g("mouseLeave",e,t))}},mouseOver:{get:function(){return this.A!==null?this.A.Qh:null},set:function(t){var e=this.mouseOver;e!==t&&(bn(this),this.A.Qh=t,this.g("mouseOver",e,t))}},mouseHover:{get:function(){return this.A!==null?this.A.Oh:null},set:function(t){var e=this.mouseHover;e!==t&&(bn(this),this.A.Oh=t,this.g("mouseHover",e,t))}},mouseHold:{get:function(){return this.A!==null?this.A.Nh:null},set:function(t){var e=this.mouseHold;e!==t&&(bn(this),this.A.Nh=t,this.g("mouseHold",e,t))}},mouseDragEnter:{get:function(){return this.A!==null?this.A.Of:null},set:function(t){var e=this.mouseDragEnter;e!==t&&(bn(this),this.A.Of=t,this.g("mouseDragEnter",e,t))}},mouseDragLeave:{get:function(){return this.A!==null?this.A.Xd:null},set:function(t){var e=this.mouseDragLeave;e!==t&&(bn(this),this.A.Xd=t,this.g("mouseDragLeave",e,t))}},mouseDrop:{get:function(){return this.A!==null?this.A.Lh:null},set:function(t){var e=this.mouseDrop;e!==t&&(bn(this),this.A.Lh=t,this.g("mouseDrop",e,t))}},actionDown:{get:function(){return this.A!==null?this.A.V:null},set:function(t){var e=this.actionDown;e!==t&&(bn(this),this.A.V=t,this.g("actionDown",e,t))}},actionMove:{get:function(){return this.A!==null?this.A.ia:null},set:function(t){var e=this.actionMove;e!==t&&(bn(this),this.A.ia=t,this.g("actionMove",e,t))}},actionUp:{get:function(){return this.A!==null?this.A.Ha:null},set:function(t){var e=this.actionUp;e!==t&&(bn(this),this.A.Ha=t,this.g("actionUp",e,t))}},actionCancel:{get:function(){return this.A!==null?this.A.F:null},set:function(t){var e=this.actionCancel;e!==t&&(bn(this),this.A.F=t,this.g("actionCancel",e,t))}},toolTip:{get:function(){return this.A!==null?this.A.$h:null},set:function(t){var e=this.toolTip;e!==t&&(bn(this),this.A.$h=t,this.g("toolTip",e,t))}},contextMenu:{get:function(){return this.A!==null?this.A.Ch:null},set:function(t){var e=this.contextMenu;e!==t&&(bn(this),this.A.Ch=t,this.g("contextMenu",e,t))}}}),pt.prototype.trigger=pt.prototype.Jv,pt.prototype.findBindingPanel=pt.prototype.ih,pt.prototype.findTemplateBinder=pt.prototype.pz,pt.prototype.setProperties=pt.prototype.nm,pt.prototype.apply=pt.prototype.apply,pt.prototype.attach=pt.prototype.Du,pt.prototype.set=pt.prototype.set,pt.prototype.isEnabledObject=pt.prototype.If,pt.prototype.isVisibleObject=pt.prototype.Ed,pt.prototype.isContainedBy=pt.prototype.rg,pt.prototype.getNearestIntersectionPoint=pt.prototype.rs,pt.prototype.getLocalPoint=pt.prototype.qs,pt.prototype.getDocumentScale=pt.prototype.Df,pt.prototype.getDocumentAngle=pt.prototype.li,pt.prototype.getDocumentBounds=pt.prototype.mi,pt.prototype.getDocumentPoint=pt.prototype.ga,pt.prototype.intersectsRect=pt.prototype.Yc,pt.prototype.containedInRect=pt.prototype.fh,pt.prototype.containsRect=pt.prototype.Re,pt.prototype.containsPoint=pt.prototype.ca,pt.prototype.raiseChanged=pt.prototype.g,pt.prototype.raiseChangedEvent=pt.prototype.cb,pt.prototype.addCopyProperty=pt.prototype.Vw;var Hp=null;pt.className="GraphObject",Hp=new ci,Id("Button",function(){function t(i,n){return i.diagram.ic(i.documentPoint,function(s){for(;s.panel!==null&&!s.isActionable;)s=s.panel;return s},function(s){return s===n})!==null}var e=Ei(ce,ce.Auto,{isActionable:!0,enabledChanged:function(i,n){if(i instanceof ce){var s=i.fb("ButtonBorder");s!==null&&(s.fill=n?i._buttonFillNormal:i._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Ei(pn,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new di(0,0,2.76142374915397,2.761423749153969),spot2:new di(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));return e.mouseEnter=function(i,n){if(n.If()&&n instanceof ce&&(i=n.fb("ButtonBorder"),i instanceof pn)){var s=n._buttonFillOver;n._buttonFillNormal=i.fill,i.fill=s,s=n._buttonStrokeOver,n._buttonStrokeNormal=i.stroke,i.stroke=s}},e.mouseLeave=function(i,n){n.If()&&n instanceof ce&&(i=n.fb("ButtonBorder"),i instanceof pn&&(i.fill=n._buttonFillNormal,i.stroke=n._buttonStrokeNormal))},e.actionDown=function(i,n){if(n.If()&&n instanceof ce&&n._buttonFillPressed!==null&&i.button===0){var s=n.fb("ButtonBorder");if(s instanceof pn){i=i.diagram;var a=i.skipsUndoManager;i.skipsUndoManager=!0;var l=n._buttonFillPressed;n._buttonFillOver=s.fill,s.fill=l,l=n._buttonStrokePressed,n._buttonStrokeOver=s.stroke,s.stroke=l,i.skipsUndoManager=a}}},e.actionUp=function(i,n){if(n.If()&&n instanceof ce&&n._buttonFillPressed!==null&&i.button===0){var s=n.fb("ButtonBorder");if(s instanceof pn){var a=i.diagram,l=a.skipsUndoManager;a.skipsUndoManager=!0,t(i,n)?(s.fill=n._buttonFillOver,s.stroke=n._buttonStrokeOver):(s.fill=n._buttonFillNormal,s.stroke=n._buttonStrokeNormal),a.skipsUndoManager=l}}},e.actionCancel=function(i,n){if(n.If()&&n instanceof ce&&n._buttonFillPressed!==null){var s=n.fb("ButtonBorder");if(s instanceof pn){var a=i.diagram,l=a.skipsUndoManager;a.skipsUndoManager=!0,t(i,n)?(s.fill=n._buttonFillOver,s.stroke=n._buttonStrokeOver):(s.fill=n._buttonFillNormal,s.stroke=n._buttonStrokeNormal),a.skipsUndoManager=l}}},e.actionMove=function(i,n){if(n.If()&&n instanceof ce&&n._buttonFillPressed!==null){var s=i.diagram;if(s.firstInput.button===0&&(s.currentTool.standardMouseOver(),t(i,n)&&(i=n.fb("ButtonBorder"),i instanceof pn))){var a=s.skipsUndoManager;s.skipsUndoManager=!0;var l=n._buttonFillPressed;i.fill!==l&&(i.fill=l),l=n._buttonStrokePressed,i.stroke!==l&&(i.stroke=l),s.skipsUndoManager=a}}},e}),Id("TreeExpanderButton",function(){var t=Ei("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Ei(pn,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ur},new lo("figure","isTreeExpanded",function(e,i){return i=i.panel,e?i._treeExpandedFigure:i._treeCollapsedFigure}).cp()),{visible:!1},new lo("visible","isTreeLeaf",function(e){return!e}).cp());return t.click=function(e,i){if(i=i.part,i instanceof pr&&(i=i.adornedPart),i instanceof Ee){var n=i.diagram;if(n!==null){if(n=n.commandHandler,i.isTreeExpanded){if(!n.canCollapseTree(i))return}else if(!n.canExpandTree(i))return;e.handled=!0,i.isTreeExpanded?n.collapseTree(i):n.expandTree(i)}}},t}),Id("SubGraphExpanderButton",function(){var t=Ei("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Ei(pn,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ur},new lo("figure","isSubGraphExpanded",function(e,i){return i=i.panel,e?i._subGraphExpandedFigure:i._subGraphCollapsedFigure}).cp()));return t.click=function(e,i){if(i=i.part,i instanceof pr&&(i=i.adornedPart),i instanceof Yi){var n=i.diagram;if(n!==null){if(n=n.commandHandler,i.isSubGraphExpanded){if(!n.canCollapseSubGraph(i))return}else if(!n.canExpandSubGraph(i))return;e.handled=!0,i.isSubGraphExpanded?n.collapseSubGraph(i):n.expandSubGraph(i)}}},t}),Id("ToolTip",function(){return Ei(pr,ce.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new G(0,3),shadowBlur:5},Ei(pn,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new di(0,0,4,6),spot2:new di(1,1,-4,-4)}))}),Id("ContextMenu",function(){return Ei(pr,ce.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new G(0,3),shadowBlur:5},new lo("background","",function(t){return t.adornedPart!==null&&t.placeholder!==null?null:"#F5F5F5"}))}),Id("ContextMenuButton",function(){var t=Ei("Button");t.stretch=mi;var e=t.fb("ButtonBorder");return e instanceof pn&&(e.figure="Rectangle",e.strokeWidth=0,e.spot1=new di(0,0,2,3),e.spot2=new di(1,1,-2,-2)),t}),Id("PanelExpanderButton",function(t){var e=zv(t,"COLLAPSIBLE"),i=Ei("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},Ei(pn,{name:"ButtonIcon",strokeWidth:2},new lo("geometryString","visible",function(n){return n?i._buttonExpandedFigure:i._buttonCollapsedFigure}).cp(e)));return t=i.fb("ButtonBorder"),t instanceof pn&&(t.stroke=null,t.fill="rgba(0, 0, 0, 0)"),i.click=function(n,s){var a=s.diagram;if(a!==null&&!a.isReadOnly){var l=s.ih();l===null&&(l=s.part),l!==null&&(s=l.fb(e),s!==null&&(n.handled=!0,a.Ea("Collapse/Expand Panel"),s.visible=!s.visible,a.eb("Collapse/Expand Panel")))}},i}),Id("CheckBoxButton",function(t){var e=zv(t);return t=Ei("Button",{desiredSize:new fe(14,14)},Ei(pn,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:oe,geometryStretch:oi,visible:!1},e!==""?new lo("visible",e).Kx():[])),t.click=function(i,n){if(n instanceof ce){var s=i.diagram;if(!(s===null||s.isReadOnly||e!==""&&s.model.isReadOnly)){i.handled=!0;var a=n.fb("ButtonIcon");s.Ea("checkbox"),a.visible=!a.visible,typeof n._doClick=="function"&&n._doClick(i,n),s.eb("checkbox")}}},t}),Id("CheckBox",function(t){t=zv(t),t=Ei("CheckBoxButton",t,{name:"Button",isActionable:!1,margin:new Ai(0,1,0,0)});var e=Ei(ce,"Horizontal",t,{isActionable:!0,cursor:t.cursor,margin:new Ai(1),_buttonFillNormal:t._buttonFillNormal,_buttonStrokeNormal:t._buttonStrokeNormal,_buttonFillOver:t._buttonFillOver,_buttonStrokeOver:t._buttonStrokeOver,_buttonFillPressed:t._buttonFillPressed,_buttonStrokePressed:t._buttonStrokePressed,_buttonFillDisabled:t._buttonFillDisabled,mouseEnter:t.mouseEnter,mouseLeave:t.mouseLeave,actionDown:t.actionDown,actionUp:t.actionUp,actionCancel:t.actionCancel,actionMove:t.actionMove,click:t.click,_buttonClick:t.click});return t.mouseEnter=null,t.mouseLeave=null,t.actionDown=null,t.actionUp=null,t.actionCancel=null,t.actionMove=null,t.click=null,e}),pt.None=Jt=new he(pt,"None",0),pt.Default=on=new he(pt,"Default",0),pt.Vertical=Ii=new he(pt,"Vertical",4),pt.Horizontal=mi=new he(pt,"Horizontal",5),pt.Fill=oe=new he(pt,"Fill",3),pt.Uniform=oi=new he(pt,"Uniform",1),pt.UniformToFill=Bn=new he(pt,"UniformToFill",2),pt.FlipVertical=gn=new he(pt,"FlipVertical",1),pt.FlipHorizontal=Vn=new he(pt,"FlipHorizontal",2),pt.FlipBoth=Hr=new he(pt,"FlipBoth",3),pt.make=Ei,pt.getBuilders=function(){var t=new ci,e;for(e in Hp)if(e!==e.toLowerCase()){var i=Hp.I(e);typeof i=="function"&&t.add(e,i)}return t.freeze(),t},pt.defineBuilder=Id,pt.build=function(t,e,i){for(var n=[],s=2;s<arguments.length;++s)n[s-2]=arguments[s];if(s=Hp.I(t),typeof s=="function"&&(n=s([t].concat(n)),n instanceof pt))return e&&n.set(e),n;Mt('GraphObject.build invoked object builder "'+t+'", but it did not return an Object')},pt.takeBuilderArgument=zv;function rp(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=un,this.o=ko,this.hg=on,this.ob=this.Bi=1,this.Pf=Jt,this.Pc=this.Ci=this.gd=null,this.Oc="category"}rp.prototype.copy=function(){var t=new rp;return t.xa=this.xa,t.zp=this.zp,t.te=this.te,t.nb=this.nb,t.j=this.j,t.zh=this.zh,t.Fh=this.Fh,t.Bh=this.Bh,t.Mh=this.Mh,t.Ph=this.Ph,t.Qh=this.Qh,t.Oh=this.Oh,t.Nh=this.Nh,t.Of=this.Of,t.Xd=this.Xd,t.Lh=this.Lh,t.V=this.V,t.ia=this.ia,t.Ha=this.Ha,t.F=this.F,t.$h=this.$h,t.Ch=this.Ch,t.Hb=this.Hb,t.Di=this.Di,t.hb=this.hb,t.u=this.u.J(),t.o=this.o.J(),t.hg=this.hg,t.Bi=this.Bi,t.ob=this.ob,t.Pf=this.Pf,t.gd=this.gd,t.Ci=this.Ci,t.Pc=this.Pc,t.Oc=this.Oc,t};function vf(){this.u=-1/0,this.o=0,this.F=Wa,this.rr=eh,this.j=this.V="None"}vf.prototype.copy=function(){var t=new vf;return t.u=this.u,t.o=this.o,t.F=this.F.J(),t.rr=this.rr,t.V=this.V,t.j=this.j,t},vf.className="LinkElementSettings";function op(){this.yj=this.Xi=ds,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}op.prototype.copy=function(){var t=new op;return t.Xi=this.Xi.J(),t.yj=this.yj.J(),t.Vi=this.Vi,t.wj=this.wj,t.Wi=this.Wi,t.xj=this.xj,t.hq=this.hq,t.Tr=this.Tr,t.iq=this.iq,t.Ur=this.Ur,t},op.className="LinkSettings";function sp(){this.ha=[1,0,0,1,0,0]}sp.prototype.copy=function(){var t=new sp;return t.ha[0]=this.ha[0],t.ha[1]=this.ha[1],t.ha[2]=this.ha[2],t.ha[3]=this.ha[3],t.ha[4]=this.ha[4],t.ha[5]=this.ha[5],t},sp.prototype.translate=function(t,e){this.ha[4]+=this.ha[0]*t+this.ha[2]*e,this.ha[5]+=this.ha[1]*t+this.ha[3]*e},sp.prototype.scale=function(t,e){this.ha[0]*=t,this.ha[1]*=t,this.ha[2]*=e,this.ha[3]*=e},sp.prototype.rotate=function(t,e,i){if(360<=t?t-=360:0>t&&(t+=360),t!==0){if(this.translate(e,i),t===90){t=0;var n=1}else t===180?(t=-1,n=0):t===270?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));var s=this.ha[1]*t+this.ha[3]*n,a=this.ha[0]*-n+this.ha[2]*t,l=this.ha[1]*-n+this.ha[3]*t;this.ha[0]=this.ha[0]*t+this.ha[2]*n,this.ha[1]=s,this.ha[2]=a,this.ha[3]=l,this.translate(-e,-i)}},sp.className="STransform";function Vp(t){this.type=t,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Vp.prototype.addColorStop=function(t,e){this.gx.push({offset:t,color:e})},Vp.className="SGradient";function tf(t,e,i){this.ownerDocument=t=e===void 0?Kt.document:e,this.cA="http://www.w3.org/2000/svg",t!==void 0&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new Fu(this,i)}tf.prototype.resize=function(t,e,i,n){return this.width!==t||this.height!==e?(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=n+"px",this.Oa.setAttributeNS(null,"width",i+"px"),this.Oa.setAttributeNS(null,"height",n+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+i+" "+n),this.context.ww.firstElementChild.setAttributeNS(null,"width",i+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",n+"px"),!0):!1},tf.prototype.Ud=function(t,e,i){if(t=this.ownerDocument.createElementNS(this.cA,t),Qt(e))for(var n in e)t.setAttributeNS(n==="href"?"http://www.w3.org/1999/xlink":"",n,e[n]);return i!==void 0&&(t.textContent=i),t},tf.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},tf.prototype.focus=function(){this.Oa.focus()},tf.prototype.mx=function(){this.ownerDocument=null},St.Object.defineProperties(tf.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(t){this.Oa.setAttribute("width",t+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(t){this.Oa.setAttribute("height",t+"px")}},style:{get:function(){return this.Oa.style}}}),tf.className="SVGSurface";function Fu(t,e){this.Gv=t,this.svg=t.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetY=this.shadowOffsetX=0,this.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new sp,this.j=Mg(this),this.Nj=Mg(this,"gojs-diagram"),this.Hl=this.ti=null;var i=ea++,n=this.Ud("clipPath",{id:"mainClip"+i});n.appendChild(this.Ud("rect",{x:0,y:0,width:t.width,height:t.height})),this.ww=n,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(n),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+i+")"),this.eA={},this.isTemporary=!!e,this.filter="",this.bk=null}function bh(t,e,i,n,s,a,l){t.Nj===void 0?P0(t,e,i,n,s,a,l):t.Nj.setAttribute("transform","matrix("+e+", "+i+", "+n+", "+s+", "+a+", "+l+")")}L=Fu.prototype,L.arc=function(t,e,i,n,s,a,l,c){var p=2*Math.PI,m=p-1e-6,v=i*Math.cos(n),w=i*Math.sin(n),C=t+v,k=e+w,T=a?0:1;n=a?n-s:s-n,(1e-6<Math.abs(l-C)||1e-6<Math.abs(c-k))&&this.path.push(["L",C,+k]),0>n&&(n=n%p+p),n>m?(this.path.push(["A",i,i,0,1,T,t-v,e-w]),this.path.push(["A",i,i,0,1,T,C,k])):1e-6<n&&this.path.push(["A",i,i,0,+(n>=Math.PI),T,t+i*Math.cos(s),e+i*Math.sin(s)])},L.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},L.Se=function(t){this.addPath(this.path,this.rb,t||0)},L.bezierCurveTo=function(t,e,i,n,s,a){this.path.push(["C",t,e,i,n,s,a])},L.clearRect=function(){},L.clip=function(){this.Yl.clipPath=!0},L.closePath=function(){this.path.push(["z"])},L.createLinearGradient=function(t,e,i,n){var s=new Vp("linear");return s.x1=t,s.y1=e,s.x2=i,s.y2=n,s},L.createPattern=function(t){var e="";t instanceof HTMLCanvasElement&&(e=t.toDataURL()),t instanceof HTMLImageElement&&(e=t.getAttribute("src"));var i=this.eA;if(i[e])return"url(#"+i[e]+")";var n="PATTERN"+ea++,s={x:0,y:0,width:t.width,height:t.height,href:e};return t=this.Ud("pattern",{width:t.width,height:t.height,id:n,patternUnits:"userSpaceOnUse"}),t.appendChild(this.Ud(Of,s)),this.svg.appendChild(t),i[e]=n,"url(#"+n+")"},L.createRadialGradient=function(t,e,i,n,s,a){var l=new Vp("radial");return l.x1=t,l.y1=e,l.r1=i,l.x2=n,l.y2=s,l.r2=a,l};function T0(t,e,i,n,s,a,l,c,p){n=c/n,s=p/s,a===0&&l===0||t.rb.translate(a,l),n===1&&s===1||t.rb.scale(n,s),e===0&&i===0||t.rb.translate(-e,-i)}L.drawImage=function(t,e,i,n,s,a,l,c,p){var m="";t instanceof HTMLCanvasElement&&(m=t.toDataURL()),t instanceof HTMLImageElement&&(m=t.getAttribute("src"));var v=t instanceof HTMLImageElement?t.naturalWidth:t.width;t=t instanceof HTMLImageElement?t.naturalHeight:t.height,n===void 0&&(a=e,l=i,c=n=v,p=s=t),n=n||0,s=s||0,c=c||0,p=p||0,T0(this,e,i,n,s,a||0,l||0,c,p),a={x:0,y:0,width:v||n,height:t||s,href:m},xt.$(n,c)&&xt.$(s,p)?m.toLowerCase().indexOf(".svg")===-1&&m.toLowerCase().indexOf("data:image/svg")===-1&&(a.preserveAspectRatio="xMidYMid slice"):a.preserveAspectRatio="none",(e!==0||i!==0||n!==v||s!==t)&&(n+=e,s+=i,a["clip-path"]="path('M "+e+","+i+" L "+n+" "+i+" L "+n+" "+s+" L "+e+" "+s+" z')"),Rf(this,Of,a,this.rb),this.addElement(Of,a)},L.fill=function(t){t&&(this.Yl["fill-rule"]="evenodd"),ef(this,this.Yl)},L.ng=function(t,e){this.clipInsteadOfFill?this.clip():this.fill(e)},L.fillRect=function(t,e,i,n){t=[t,e,i,n],t={x:t[0],y:t[1],width:t[2],height:t[3]},Rf(this,"fill",t,this.rb),this.addElement("rect",t)},L.ox=function(t,e,i,n){t={x:t,y:e,width:i,height:n},Rf(this,"fill",t,this.rb),ef(this,t),this.svg.prepend(this.Ud("rect",t))},L.fillText=function(t,e,i){t=[t,e,i],e=this.textAlign,e==="left"?e="start":e==="right"?e="end":e==="center"&&(e="middle"),e={x:t[1],y:t[2],style:"font: "+this.font,"text-anchor":e},Rf(this,"fill",e,this.rb),this.addElement("text",e,t[0])},L.lineTo=function(t,e){this.path.push(["L",t,e])},L.moveTo=function(t,e){this.path.push(["M",t,e])},L.quadraticCurveTo=function(t,e,i,n){this.path.push(["Q",t,e,i,n])},L.rect=function(t,e,i,n){this.path.push(["M",t,e],["L",t+i,e],["L",t+i,e+n],["L",t,e+n],["z"])},L.restore=function(){this.rb=this.stack.pop(),this.path=this.stack.pop();var t=this.stack.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lineDashOffset=t.lineDashOffset,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign,this.bk=t.bk},L.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var t=[],e=0;e<this.path.length;e++)t.push(this.path[e]);this.stack.push(t),this.stack.push(this.rb.copy())},L.setTransform=function(t,e,i,n,s,a){t===1&&e===0&&i===0&&n===1&&s===0&&a===0||P0(this,t,e,i,n,s,a)};function Sg(t){return t=t.rb.ha,"matrix("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}L.scale=function(t,e){this.rb.scale(t,e)},L.translate=function(t,e){this.rb.translate(t,e)},L.transform=function(){},L.yc=function(){},L.stroke=function(){_0(this,this.Yl)},L.jk=function(){this.clipInsteadOfFill||this.stroke()},L.Ud=function(t,e,i){return this.Gv.Ud(t,e,i)},L.addElement=function(t,e,i){return t=this.Ud(t,e,i),this.yd!==null?this.yd.appendChild(t):this.yd=t,this.ad=t};function Rf(t,e,i,n){e==="fill"?ef(t,i):e==="stroke"&&_0(t,i),n!==null&&(t=n.ha,i.transform="matrix("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")")}function ef(t,e){t.fillStyle instanceof Vp?e.fill=Wp(t,t.fillStyle,!0):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),e.fill="rgb("+t[1]+","+t[2]+","+t[3]+")",e["fill-opacity"]=t[4]):e.fill=t.fillStyle}function Xy(t,e,i){i=i?"fill":"stroke",t.fillStyle instanceof Vp?e.setAttributeNS(null,"fill",Wp(t,t.fillStyle,!0)):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),e.setAttributeNS(null,i,"rgb("+t[1]+","+t[2]+","+t[3]+")"),e.setAttributeNS(null,i+"-opacity",t[4])):e.setAttributeNS(null,i,t.fillStyle)}function _0(t,e){if(t.strokeStyle instanceof Vp)e.stroke=Wp(t,t.strokeStyle,!1);else if(/^rgba\(/.test(t.strokeStyle)){var i=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.strokeStyle);e.stroke="rgb("+i[1]+","+i[2]+","+i[3]+")",e["stroke-opacity"]=i[4]}else e.stroke=t.strokeStyle;e["stroke-width"]=t.lineWidth,e["stroke-linecap"]=t.lineCap,e["stroke-linejoin"]=t.lineJoin,e["stroke-miterlimit"]=t.miterLimit,t.Ct&&(e["stroke-dasharray"]=t.Yg.toString(),e["stroke-dashoffset"]=t.uj)}function Wp(t,e,i){var n="";if(n=t.Hl!==null?t.Hl.getAttribute(i?"fill":"stroke"):null,n!==null&&n.indexOf("GRAD")!==-1?(n=n.split("#")[1].slice(0,-1),i=t.svg.getElementById(n),i!==null&&i.remove()):n="GRAD"+ea++,e.type==="linear")i=t.Ud("linearGradient",{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,id:n,gradientUnits:"userSpaceOnUse"});else if(e.type==="radial")i=t.Ud("radialGradient",{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,r1:e.r1,r2:e.r2,id:n});else throw Error("invalid gradient");var s=e.gx;e=s.length;for(var a=[],l=0;l<e;l++){var c=s[l],p=c.color;c={offset:c.offset,"stop-color":p},/^rgba\(/.test(p)&&(p=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(p),c["stop-color"]="rgb("+p[1]+","+p[2]+","+p[3]+")",c["stop-opacity"]=p[4]),a.push(c)}for(a.sort(function(m,v){return m.offset>v.offset?1:-1}),s=0;s<e;s++)i.appendChild(t.Ud("stop",a[s]));return t.svg.appendChild(i),"url(#"+n+")"}L.addPath=function(t,e,i){for(var n=[],s=0;s<t.length;s++){var a=vr(t[s]),l=[a.shift()];if(l[0]==="A")l.push(a.shift()+","+a.shift(),a.shift(),a.shift()+","+a.shift(),a.shift()+","+a.shift());else for(;a.length;)l.push(a.shift()+","+a.shift());n.push(l.join(" "))}if(n=n.join(" "),t=this.Yl,t.clipPath)0<this.nh.length&&this.nh[this.nh.length-1].setAttributeNS(null,"clip-path",'path("'+n+'")');else if(t.d=n,Rf(this,"",t,e),this.Hl!==null)if(e=this.Hl,e.nodeName!=="g")for(var c in t)c!=="transform"&&e.setAttributeNS(null,c,t[c]);else{c=e.getElementsByTagName("path");for(var p in t)p!=="transform"&&c[i].setAttributeNS(null,p,t[p])}else this.addElement("path",t)};function P0(t,e,i,n,s,a,l){var c=new sp;c.ha=[e,i,n,s,a,l],e={},Rf(t,"g",e,c),c=t.addElement("g",e),t.nh.push(c)}function Mg(t,e){var i={};return e&&(i.class=e),e=t.addElement("g",i),t.nh.push(e),e}L.Ev=function(t,e,i){this.Ar=t,this.Br=e,this.Vg=i};function Fc(t){t.Il=!1,t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0}function qf(t){t.Il=!0,t.shadowOffsetX=t.Ar,t.shadowOffsetY=t.Br,t.shadowBlur=t.Vg}L.js=function(t,e){this.Ct=!0,this.Yg=t,this.uj=e},L.fs=function(){this.Ct=!1},L.Vc=function(){},L.Wx=function(){},Fu.prototype.rotate=function(t){this.rb.rotate(57.2958*t,0,0)},Fu.prototype.getImageData=function(){return null},Fu.prototype.measureText=function(){return null};function Cg(t,e){e=e.getAttribute("fill"),e!==null&&(e=e.split("#"),e.length!==1&&(e=t.svg.getElementById(e[1].slice(0,-1)),e!==null&&t.svg.innerHTML.match(new RegExp(e.id,"g")).length===1&&e.remove()))}Fu.prototype.Hs=function(t){t.svg!==null&&t.svg.parentNode===this.Nj&&t.svg.remove()},Fu.className="SVGContext",Ct.prototype.Cs=function(t){this.pj.contains("SVG")||this.bs("SVG",new tf(this,Kt.document));var e=new tf(this,Kt.document,!0);t===void 0&&(t=new Bo);var i=this;return Jc(this,function(n,s){return n=Bc(i,n,"SVG",e),n=n!==null?n.svg:null,typeof s=="function"?(s(n),null):n},t)},Ct.prototype.makeSvg=Ct.prototype.Cs,Ct.prototype.av=function(t){return this.Cs(t)},Ct.prototype.makeSVG=Ct.prototype.av;function Pc(t,e,i,n){this.ownerDocument=e=e===void 0?Kt.document:e,this.hs=null,e=e.createElement("canvas"),e.tabIndex=0,this.Oa=e,this.context=new Bf(e,i,n),e.H=t}Pc.prototype.resize=function(t,e,i,n){return this.width!==t||this.height!==e?(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=n+"px",!0):!1},Pc.prototype.toDataURL=function(t,e){return this.Oa.toDataURL(t,e)},Pc.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Pc.prototype.focus=function(){this.Oa.focus()},Pc.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},St.Object.defineProperties(Pc.prototype,{width:{get:function(){return this.Oa.width},set:function(t){this.Oa.width=t}},height:{get:function(){return this.Oa.height},set:function(t){this.Oa.height=t}},style:{get:function(){return this.Oa.style}}}),Pc.className="CanvasSurface";function Bf(t,e,i){this.Z=t.getContext?t.getContext("2d",e):null,this.Z===null&&Mt("Browser does not support HTML Canvas Element"),this.ct=this.et=this.dt="",this.Hm=!1,this.Vg=this.Br=this.Ar=0,this.Il=!1,this.El=new dn,this.isTemporary=!!i}L=Bf.prototype,L.Wx=function(t){this.Z.imageSmoothingEnabled=t},L.arc=function(t,e,i,n,s,a){this.Z.arc(t,e,i,n,s,a)},L.beginPath=function(){this.Z.beginPath()},L.Se=function(){},L.bezierCurveTo=function(t,e,i,n,s,a){this.Z.bezierCurveTo(t,e,i,n,s,a)},L.clearRect=function(t,e,i,n){this.yc(),this.Z.clearRect(t,e,i,n)},L.clip=function(){this.Z.clip()},L.closePath=function(){this.Z.closePath()},L.createLinearGradient=function(t,e,i,n){return this.Z.createLinearGradient(t,e,i,n)},L.createPattern=function(t,e){return this.Z.createPattern(t,e)},L.createRadialGradient=function(t,e,i,n,s,a){return this.Z.createRadialGradient(t,e,i,n,s,a)},L.drawImage=function(t,e,i,n,s,a,l,c,p){n===void 0?this.Z.drawImage(t,e,i):this.Z.drawImage(t,e,i,n,s,a,l,c,p)},L.fill=function(t){this.Z.fill(t?"evenodd":"nonzero")},L.fillRect=function(t,e,i,n){this.Z.fillRect(t,e,i,n)},L.ox=function(t,e,i,n){this.Z.fillRect(t,e,i,n)},L.fillText=function(t,e,i){this.Z.fillText(t,e,i)},L.getImageData=function(t,e,i,n){return this.Z.getImageData(t,e,i,n)},L.lineTo=function(t,e){this.Z.lineTo(t,e)},L.measureText=function(t){return this.Z.measureText(t)},L.moveTo=function(t,e){this.Z.moveTo(t,e)},L.quadraticCurveTo=function(t,e,i,n){this.Z.quadraticCurveTo(t,e,i,n)},L.rect=function(t,e,i,n){this.Z.rect(t,e,i,n)},L.restore=function(){this.Z.restore()},L.save=function(){this.yc(),this.Z.save()},Bf.prototype.rotate=function(t){this.El.rotate(57.2958*t,0,0)},L=Bf.prototype,L.setTransform=function(t,e,i,n,s,a){this.El.setTransform(t,e,i,n,s,a)},L.scale=function(t,e){this.El.scale(t,e)},L.translate=function(t,e){this.El.translate(t,e)},L.stroke=function(){this.Z.stroke()},L.transform=function(t,e,i,n,s,a){if(t!==1||e!==0||i!==0||n!==1||s!==0||a!==0){var l=this.El,c=l.m11*t+l.m21*e;t=l.m12*t+l.m22*e,e=l.m11*i+l.m21*n,i=l.m12*i+l.m22*n,l.dx=l.m11*s+l.m21*a+l.dx,l.dy=l.m12*s+l.m22*a+l.dy,l.m11=c,l.m12=t,l.m21=e,l.m22=i}},L.yc=function(){var t=this.El;this.Z.setTransform(t.m11,t.m12,t.m21,t.m22,t.dx,t.dy)},L.ng=function(t,e){if(t instanceof Br&&t.type===lc){var i=t.yk;t=t.ft,t>i?(this.scale(i/t,1),this.translate((t-i)/2,0)):i>t&&(this.scale(1,t/i),this.translate(0,(i-t)/2)),this.Hm?this.clip():this.fill(e),t>i?(this.translate(-(t-i)/2,0),this.scale(1/(i/t),1)):i>t&&(this.translate(0,-(i-t)/2),this.scale(1,1/(t/i)))}else this.Hm?this.clip():this.fill(e)},L.jk=function(){this.Hm||this.stroke()},L.Ev=function(t,e,i){this.Ar=t,this.Br=e,this.Vg=i},L.js=function(t,e){var i=this.Z;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=e)},L.fs=function(){var t=this.Z;t.setLineDash!==void 0&&(t.setLineDash(bm),t.lineDashOffset=0)},L.Vc=function(t){t&&(this.dt=""),this.ct=this.et=""},L.Hs=function(){},St.Object.defineProperties(Bf.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(t){this.ct!==t&&(this.ct=this.Z.fillStyle=t)}},font:{get:function(){return this.Z.font},set:function(t){this.dt!==t&&(this.dt=this.Z.font=t)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(t){this.Z.globalAlpha=t}},lineCap:{get:function(){return this.Z.lineCap},set:function(t){this.Z.lineCap=t}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(t){this.Z.lineDashOffset=t}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(t){this.Z.lineJoin=t}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(t){this.Z.lineWidth=t}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(t){this.Z.miterLimit=t}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(t){this.Z.shadowBlur=t}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(t){this.Z.shadowColor=t}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(t){this.Z.shadowOffsetX=t}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(t){this.Z.shadowOffsetY=t}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(t){this.et!==t&&(this.et=this.Z.strokeStyle=t)}},textAlign:{get:function(){return this.Z.textAlign},set:function(t){this.Z.textAlign=t}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(t){this.Z.imageSmoothingEnabled=t}},filter:{get:function(){return this.Z.filter},set:function(t){this.Z.filter=t===""?"none":t}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(t){this.Hm=t}}});var bm=Object.freeze([]);Bf.className="CanvasSurfaceContext";function Up(){this.F=this.o=this.u=this.j=0}Up.className="ColorNumbers";function Br(t,e){Xp||(Wv(),Xp=!0),Do(this),this._isFrozen=!1,t===void 0?(this.na=td,this.xk="black"):typeof t=="string"?(this.na=td,this.xk=t):(this.na=t,this.xk="black"),t=this.na,t===ed?(this.Qd=Ca,this.Lk=Tl):this.Lk=t===lc?this.Qd=_n:this.Qd=jr,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,e&&Object.assign(this,e)}Br.prototype.copy=function(){var t=new Br;return t.na=this.na,t.xk=this.xk,t.Qd=this.Qd.J(),t.Lk=this.Lk.J(),t.Gr=this.Gr,t.Xp=this.Xp,this.we!==null&&(t.we=this.we.copy()),t.cr=this.cr,t},L=Br.prototype,L.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},L.ka=function(){return Object.isFrozen(this)&&Mt("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},L.qb=function(t){t.classType===Br&&(this.type=t)},L.toString=function(){var t="Brush(";if(this.type===td)t+=this.color;else if(t=this.type===ed?t+"Linear ":this.type===lc?t+"Radial ":this.type===A0?t+"Pattern ":t+"(unknown) ",t+=this.start+" "+this.end,this.colorStops!==null)for(var e=this.colorStops.iterator;e.next();)t+=" "+e.key+":"+e.value;return t+")"},L.addColorStop=function(t,e){return this._isFrozen&&ie(this),(typeof t!="number"||!isFinite(t)||1<t||0>t)&&Re(t,"0 <= loc <= 1",Br,"addColorStop:loc"),this.we===null&&(this.we=new ci),this.we.add(t,e),this.na===td&&(this.type=ed),this.xe=null,this},L.Vz=function(t,e){if(this._isFrozen&&ie(this),t=t===void 0||typeof t!="number"?.2:t,e=e===void 0?D0:e,this.type===td)Qf(this.color),this.color=Zp(t,e);else if((this.type===ed||this.type===lc)&&this.colorStops!==null)for(var i=this.colorStops.iterator;i.next();)Qf(i.value),this.addColorStop(i.key,Zp(t,e));return this};function Od(t,e,i){return e=e===void 0||typeof e!="number"?.2:e,i=i===void 0?D0:i,Qf(t),Zp(e,i)}L.Wy=function(t,e){if(this._isFrozen&&ie(this),t=t===void 0||typeof t!="number"?.2:t,e=e===void 0?D0:e,this.type===td)Qf(this.color),this.color=Zp(-t,e);else if((this.type===ed||this.type===lc)&&this.colorStops!==null)for(var i=this.colorStops.iterator;i.next();)Qf(i.value),this.addColorStop(i.key,Zp(-t,e));return this};function Yy(t,e,i){return e=e===void 0||typeof e!="number"?.2:e,i=i===void 0?D0:i,Qf(t),Zp(-e,i)}function kg(t,e,i){Qf(t),t=es.j;var n=es.u,s=es.o,a=es.F;return Qf(e),i===void 0&&(i=.5),"rgba("+Math.round((es.j-t)*i+t)+", "+Math.round((es.u-n)*i+n)+", "+Math.round((es.o-s)*i+s)+", "+Math.round((es.F-a)*i+a)+")"}L.Gx=function(){if(this.type===td)return ap(this.color);if((this.type===ed||this.type===lc)&&this.colorStops!==null){var t=this.colorStops;if(this.type===lc)return ap(t.first().value);if(t.get(.5)!==null)return ap(t.get(.5));if(t.count===2)return t=t.Fa(),ap(kg(t[0].value,t[1].value));for(var e=t.iterator,i=-1,n=-1,s=1,a=1;e.next();){var l=e.key,c=Math.abs(.5-e.key);s>a&&c<s?(i=l,s=c):a>=s&&c<a&&(n=l,a=c)}return i>n&&(a=i,i=n,n=a,a=s),s=n-i,ap(kg(t.get(i),t.get(n),1-a/s))}return!1};function ap(t){return t?t instanceof Br?t.Gx():(Qf(t),128>(299*es.j+587*es.u+114*es.o)/1e3):!1}function Zp(t,e){switch(e){case D0:e=100*jv(es.j);var i=100*jv(es.u),n=100*jv(es.o);return th.j=.4124564*e+.3575761*i+.1804375*n,th.u=.2126729*e+.7151522*i+.072175*n,th.o=.0193339*e+.119192*i+.9503041*n,th.F=es.F,e=Hv(th.j/N0[0]),i=Hv(th.u/N0[1]),n=Hv(th.o/N0[2]),nf.j=116*i-16,nf.u=500*(e-i),nf.o=200*(i-n),nf.F=th.F,nf.j=Math.min(100,Math.max(0,nf.j+100*t)),t=(nf.j+16)/116,e=t-nf.o/200,th.j=N0[0]*Vv(nf.u/500+t),th.u=N0[1]*(nf.j>Eg*Uv?Math.pow(t,3):nf.j/Eg),th.o=N0[2]*Vv(e),th.F=nf.F,t=-.969266*th.j+1.8760108*th.u+.041556*th.o,e=.0556434*th.j+-.2040259*th.u+1.0572252*th.o,es.j=255*Kv((3.2404542*th.j+-1.5371385*th.u+-.4985314*th.o)/100),es.u=255*Kv(t/100),es.o=255*Kv(e/100),es.F=th.F,es.j=Math.round(es.j),255<es.j?es.j=255:0>es.j&&(es.j=0),es.u=Math.round(es.u),255<es.u?es.u=255:0>es.u&&(es.u=0),es.o=Math.round(es.o),255<es.o?es.o=255:0>es.o&&(es.o=0),"rgba("+es.j+", "+es.u+", "+es.o+", "+es.F+")";case Jy:return $v(),Xh.o=Math.min(100,Math.max(0,Xh.o+100*t)),"hsla("+Xh.j+", "+Xh.u+"%, "+Xh.o+"%, "+Xh.F+")";default:Mt("Unknown color space: "+e)}}function Qf(t){Xp||(Wv(),Xp=!0);var e=Lg;if(e!==null){e.clearRect(0,0,1,1),e.fillStyle="#000000";var i=e.fillStyle;e.fillStyle=t,e.fillStyle!==i?(e.fillRect(0,0,1,1),t=e.getImageData(0,0,1,1).data,es.j=t[0],es.u=t[1],es.o=t[2],es.F=t[3]/255):(e.fillStyle="#FFFFFF",e.fillStyle=t,es.j=0,es.u=0,es.o=0,es.F=1)}}function $v(){var t=es.j/255,e=es.u/255,i=es.o/255,n=Math.max(t,e,i),s=Math.min(t,e,i),a=n-s;if(s=(n+s)/2,a===0)var l=t=0;else{switch(n){case t:l=(e-i)/a%6;break;case e:l=(i-t)/a+2;break;case i:l=(t-e)/a+4}l*=60,0>l&&(l+=360),t=a/(1-Math.abs(2*s-1))}Xh.j=Math.round(l),Xh.u=Math.round(100*t),Xh.o=Math.round(100*s),Xh.F=es.F}function jv(t){return t/=255,.04045>=t?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Kv(t){return .0031308>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function Hv(t){return t>Uv?Math.pow(t,1/3):(Eg*t+16)/116}function Vv(t){var e=t*t*t;return e>Uv?e:(116*t-16)/Eg}function Gp(t,e){typeof t!="string"&&(t instanceof Br||Mt("Value for "+e+" must be a color string or a Brush, not "+t))}function Wv(){Lg=ur?new Pc(null,void 0,{willReadFrequently:!0}).context:null}St.Object.defineProperties(Br.prototype,{type:{get:function(){return this.na},set:function(t){this._isFrozen&&ie(this,t),this.na=t,this.start.Mc()&&(t===ed?this.start=Ca:t===lc&&(this.start=_n)),this.end.Mc()&&(t===ed?this.end=Tl:t===lc&&(this.end=_n)),this.xe=null}},color:{get:function(){return this.xk},set:function(t){this._isFrozen&&ie(this,t),this.xk=t,this.xe=null}},start:{get:function(){return this.Qd},set:function(t){this._isFrozen&&ie(this,t),this.Qd=t.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(t){this._isFrozen&&ie(this,t),this.Lk=t.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(t){this._isFrozen&&ie(this,t),0>t&&Re(t,">= zero",Br,"startRadius"),this.Gr=t,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(t){this._isFrozen&&ie(this,t),0>t&&Re(t,">= zero",Br,"endRadius"),this.Xp=t,this.xe=null}},colorStops:{get:function(){return this.we},set:function(t){this._isFrozen&&ie(this,t),this.we=t,this.xe=null}},pattern:{get:function(){return this.cr},set:function(t){this._isFrozen&&ie(this,t),this.cr=t,this.xe=null}}}),Br.prototype.isDark=Br.prototype.Gx,Br.prototype.darkenBy=Br.prototype.Wy,Br.prototype.lightenBy=Br.prototype.Vz,Br.prototype.addColorStop=Br.prototype.addColorStop;var Uv=216/24389,Eg=24389/27,N0=[95.047,100,108.883],Lg=null,es=new Up,Xh=new Up,th=new Up,nf=new Up,Xp=!1;Br.className="Brush";var td;Br.Solid=td=new he(Br,"Solid",0);var ed;Br.Linear=ed=new he(Br,"Linear",1);var lc;Br.Radial=lc=new he(Br,"Radial",2);var A0;Br.Pattern=A0=new he(Br,"Pattern",4);var D0;Br.Lab=D0=new he(Br,"Lab",5);var Jy;Br.HSL=Jy=new he(Br,"HSL",6),Br.randomColor=function(t,e){t===void 0&&(t=128),e===void 0&&(e=Math.max(t,255));var i=Math.abs(e-t);e=Math.floor(t+Math.random()*i).toString(16);var n=Math.floor(t+Math.random()*i).toString(16);return t=Math.floor(t+Math.random()*i).toString(16),2>e.length&&(e="0"+e),2>n.length&&(n="0"+n),2>t.length&&(t="0"+t),"#"+e+n+t},Br.isValidColor=function(t){if(t==="black")return!0;if(t==="")return!1;Xp||(Wv(),Xp=!0);var e=Lg;if(e===null)return!0;e.fillStyle="#000000";var i=e.fillStyle;return e.fillStyle=t,e.fillStyle!==i?!0:(e.fillStyle="#FFFFFF",i=e.fillStyle,e.fillStyle=t,e.fillStyle!==i)},Br.lighten=function(t){return Od(t)},Br.lightenBy=Od,Br.darken=function(t){return Yy(t)},Br.darkenBy=Yy,Br.mix=kg,Br.isDark=ap;function fl(){this.xa="Base"}fl.prototype.measure=function(){},fl.prototype.Yz=function(t,e,i,n,s){t.measure(e,i,n,s)},fl.prototype.arrange=function(){},fl.prototype.Ly=function(t,e,i,n,s,a){t.arrange(e,i,n,s,a)},fl.prototype.iA=function(t){t.Uj()},fl.prototype.gc=function(){},St.Object.defineProperties(fl.prototype,{name:{get:function(){return this.xa},set:function(t){this.xa=t}},classType:{get:function(){return ce}}}),fl.prototype.remeasureObject=fl.prototype.iA,fl.prototype.arrangeElement=fl.prototype.Ly,fl.prototype.measureElement=fl.prototype.Yz,fl.className="PanelLayout";function Tg(){this.xa="Base"}li(Tg,fl),Tg.prototype.measure=function(t,e,i,n,s,a,l){var c=n.length;t=rf(t);for(var p=0;p<c;p++){var m=n[p];if(m.visible||m===t){var v=m.margin,w=v.right+v.left;v=v.top+v.bottom,m.measure(e,i,a,l);var C=m.measuredBounds;w=Math.max(C.width+w,0),v=Math.max(C.height+v,0),C=m.position.x;var k=m.position.y;isFinite(C)||(C=0),isFinite(k)||(k=0),m instanceof pn&&m.isGeometryPositioned&&(m=m.strokeWidth/2,C-=m,k-=m),or(s,C,k,w,v)}}},Tg.prototype.arrange=function(t,e,i){var n=e.length,s=t.padding;for(t=i.x-s.left,i=i.y-s.top,s=0;s<n;s++){var a=e[s],l=a.measuredBounds,c=a.margin,p=a.position.x,m=a.position.y;if(p=isNaN(p)?-t:p-t,m=isNaN(m)?-i:m-i,a instanceof pn&&a.isGeometryPositioned){var v=a.strokeWidth/2;p-=v,m-=v}a.visible&&a.arrange(p+c.left,m+c.top,l.width,l.height)}};function _g(){this.xa="Base"}li(_g,fl),_g.prototype.measure=function(t,e,i,n,s,a,l){var c=n.length;e=gi(),a=rf(t);for(var p=0;p<c;p++){var m=n[p];if(m.visible||m===a){var v=Qu(m,!1);if(v!==Jt&&v!==mi)e.push(m);else{m.measure(1/0,i,0,l),v=m.margin,m=m.measuredBounds;var w=Math.max(m.height+v.top+v.bottom,0);s.width+=Math.max(m.width+v.right+v.left,0),s.height=Math.max(s.height,w)}}}for(n=e.length,t.desiredSize.height?i=Math.min(t.desiredSize.height,t.maxSize.height):s.height!==0&&(i=Math.min(s.height,t.maxSize.height)),t=0;t<n;t++)p=e[t],(p.visible||p===a)&&(v=p.margin,c=v.right+v.left,v=v.top+v.bottom,p.measure(1/0,i,0,l),p=p.measuredBounds,v=Math.max(p.height+v,0),s.width+=Math.max(p.width+c,0),s.height=Math.max(s.height,v));Ji(e)},_g.prototype.arrange=function(t,e,i){for(var n=e.length,s=t.padding,a=s.top,l=t.isOpposite,c=l?i.width:s.left,p=0;p<n;p++){var m=a,v=e[p];if(v.visible){var w=v.measuredBounds,C=v.margin,k=C.top+C.bottom,T=a+s.bottom,A=w.height,X=Qu(v,!1);(isNaN(v.desiredSize.height)&&X===oe||X===Ii)&&(A=Math.max(i.height-k-T,0)),k=A+k+T,T=v.alignment,T.Xb()&&(T=t.defaultAlignment),T.sb()||(T=_n),l&&(c-=w.width+C.left+C.right),v.arrange(c+T.offsetX+C.left,m+T.offsetY+C.top+(i.height*T.y-k*T.y),w.width,A),l||(c+=w.width+C.left+C.right)}}};function Pg(){this.xa="Base"}li(Pg,fl),Pg.prototype.measure=function(t,e,i,n,s,a){var l=n.length;i=gi();for(var c=rf(t),p=0;p<l;p++){var m=n[p];if(m.visible||m===c){var v=Qu(m,!1);if(v!==Jt&&v!==Ii)i.push(m);else{var w=m.margin;v=w.right+w.left,w=w.top+w.bottom,m.measure(e,1/0,a,0),m=m.measuredBounds,yn(s,Math.max(s.width,Math.max(m.width+v,0)),s.height+Math.max(m.height+w,0))}}}if(n=i.length,n!==0){for(t.desiredSize.width?e=Math.min(t.desiredSize.width,t.maxSize.width):s.width!==0&&(e=Math.min(s.width,t.maxSize.width)),t=0;t<n;t++)p=i[t],(p.visible||p===c)&&(m=p.margin,l=m.right+m.left,m=m.top+m.bottom,p.measure(e,1/0,a,0),p=p.measuredBounds,m=Math.max(p.height+m,0),s.width=Math.max(s.width,Math.max(p.width+l,0)),s.height+=m);Ji(i)}},Pg.prototype.arrange=function(t,e,i){for(var n=e.length,s=t.padding,a=s.left,l=t.isOpposite,c=l?i.height:s.top,p=0;p<n;p++){var m=a,v=e[p];if(v.visible){var w=v.measuredBounds,C=v.margin,k=C.left+C.right,T=a+s.right,A=w.width,X=Qu(v,!1);(isNaN(v.desiredSize.width)&&X===oe||X===mi)&&(A=Math.max(i.width-k-T,0)),k=A+k+T,T=v.alignment,T.Xb()&&(T=t.defaultAlignment),T.sb()||(T=_n),l&&(c-=w.height+C.bottom+C.top),v.arrange(m+T.offsetX+C.left+(i.width*T.x-k*T.x),c+T.offsetY+C.top,A,w.height),l||(c+=w.height+C.bottom+C.top)}}};function Sm(){this.xa="Base"}li(Sm,fl),Sm.prototype.measure=function(t,e,i,n,s,a,l){var c=n.length,p=t.Pb(),m=p.margin,v=m.right+m.left,w=m.top+m.bottom;p.measure(e,i,a,l);var C=p.measuredBounds;a=C.width,l=C.height;var k=Math.max(a+v,0),T=Math.max(l+w,0),A=t.isClipping,X=Tt.allocAt(-m.left,-m.top,k,T),$=Tt.allocAt(0,0,a,l);lp(p,$,!0),a=$.width,l=$.height;for(var J=!0,et=rf(t),st=0;st<c;st++){var mt=n[st];C=e;var Pt=i;if(mt!==p&&(mt.visible||mt===et)){m=mt.margin;var De=m.left,ti=m.top;switch(k=m.right+m.left,T=m.top+m.bottom,m=Qu(mt,!1),m){case oe:C=a,Pt=l,ti=De=T=k=0;break;case mi:C=a,De=k=0;break;case Ii:Pt=l,ti=T=0}mt.measure(C,Pt,0,0),C=mt.measuredBounds,k=Math.max(C.width+k,0),T=Math.max(C.height+T,0),m=mt.alignment,m.Xb()&&(m=t.defaultAlignment),m.sb()||(m=_n);var Ve=mt.alignmentFocus;if(Ve.Xb()&&(Ve=_n),Pt=null,mt instanceof ce&&mt.$e!==""&&(Pt=mt.fb(mt.$e),Pt===mt&&(Pt=null)),De=$.x-De,ti=$.y-ti,Pt!==null){for(mt.arrange(0,0,C.width,C.height),C=Pt.actualBounds,C=G.allocAt(C.x+(Ve.x*C.width-Ve.offsetX),C.y+(Ve.y*C.height-Ve.offsetY)),Pt=Pt.panel;Pt!==mt;)Pt.transform.Ga(C),Pt=Pt.panel;De+=m.x*a+m.offsetX-C.x,ti+=m.y*l+m.offsetY-C.y,G.free(C)}else De+=m.x*a+m.offsetX-(Ve.x*C.width+Ve.offsetX),ti+=m.y*l+m.offsetY-(Ve.y*C.height+Ve.offsetY);J?(J=!1,s.h(De,ti,k,T)):or(s,De,ti,k,T)}}switch(J?s.assign(X):A?s.Uu($.x,$.y,$.width,$.height):or(s,X.x,X.y,X.width,X.height),Tt.free(X),Tt.free($),m=p.stretch,m===on&&(m=Qu(p,!1)),m){case Jt:return;case oe:if(!isFinite(e)&&!isFinite(i))return;break;case mi:if(!isFinite(e))return;break;case Ii:if(!isFinite(i))return}for(C=p.measuredBounds,a=C.width,l=C.height,k=Math.max(a+v,0),T=Math.max(l+w,0),m=p.margin,$=Tt.allocAt(-m.left,-m.top,k,T),lp(p,$,!0),a=$.width,l=$.height,e=0;e<c;e++)i=n[e],i===p||!i.visible&&i!==et||(m=i.margin,k=m.right+m.left,T=m.top+m.bottom,C=i.measuredBounds,k=Math.max(C.width+k,0),T=Math.max(C.height+T,0),v=i.alignment,v.Xb()&&(v=t.defaultAlignment),v.sb()||(v=_n),i=i.alignmentFocus,i.Xb()&&(i=_n),J?(J=!1,s.h(v.x*a+v.offsetX-(i.x*C.width+i.offsetX)-m.left,v.y*l+v.offsetY-(i.y*C.height+i.offsetY)-m.top,k,T)):or(s,v.x*a+v.offsetX-(i.x*C.width+i.offsetX)-m.left,v.y*l+v.offsetY-(i.y*C.height+i.offsetY)-m.top,k,T));J?s.assign(X):A?s.Uu($.x,$.y,$.width,$.height):or(s,X.x,X.y,X.width,X.height),Tt.free($)},Sm.prototype.arrange=function(t,e,i){var n=e.length,s=t.Pb(),a=s.measuredBounds,l=a.width,c=a.height,p=t.padding;a=p.left,p=p.top;var m=a-i.x,v=p-i.y;for(s.arrange(m,v,l,c),l=Tt.allocAt(0,0,l,c),lp(s,l,!1),c=0;c<n;c++){var w=e[c];if(w!==s){m=w.measuredBounds;var C=m.width,k=m.height;v=w.alignment,v.Xb()&&(v=t.defaultAlignment),v.sb()||(v=_n);var T=w.alignmentFocus;if(T.Xb()&&(T=_n),m=null,w instanceof ce&&w.$e!==""&&(m=w.fb(w.$e),m===w&&(m=null)),m!==null){var A=m.actualBounds;for(T=G.allocAt(A.x+(T.x*A.width-T.offsetX),A.y+(T.y*A.height-T.offsetY)),m=m.panel;m!==w;)m.transform.Ga(T),m=m.panel;m=v.x*l.width+v.offsetX-T.x,v=v.y*l.height+v.offsetY-T.y,G.free(T)}else m=v.x*l.width+v.offsetX-(T.x*C+T.offsetX),v=v.y*l.height+v.offsetY-(T.y*k+T.offsetY);m+=l.x-i.x,v+=l.y-i.y,w.visible&&w.arrange(a+m,p+v,C,k)}}Tt.free(l)};function lp(t,e,i){var n=null;if(t instanceof ce&&t.$e!==""&&(n=t.fb(t.$e),n===t&&(n=null)),n!==null)for(i&&t.arrange(0,0,e.width,e.height),e.assign(n.actualBounds),n=n.panel;n!==t;)n.transform.pp(e),n=n.panel}function Ng(){this.xa="Base"}li(Ng,fl),Ng.prototype.measure=function(t,e,i,n,s,a,l){var c=n.length,p=t.Pb(),m=p.margin,v=e,w=i,C=m.right+m.left,k=m.top+m.bottom;p.measure(e,i,a,l),m=p.measuredBounds;var T=0,A=null;p instanceof pn&&(A=p,T=A.strokeWidth*A.scale);var X=Math.max(m.width+C,0);m=Math.max(m.height+k,0);var $=Xv(p),J=$.x*X+$.offsetX;$=$.y*m+$.offsetY;var et=Yv(p),st=et.x*X+et.offsetX;for(et=et.y*m+et.offsetY,isFinite(e)&&(v=Math.max(Math.abs(J-st)-T,0)),isFinite(i)&&(w=Math.max(Math.abs($-et)-T,0)),T=fe.alloc(),T.h(0,0),t=rf(t),et=0;et<c;et++)$=n[et],$===p||!$.visible&&$!==t||(m=$.margin,X=m.right+m.left,J=m.top+m.bottom,$.measure(v,w,0,0),m=$.measuredBounds,X=Math.max(m.width+X,0),m=Math.max(m.height+J,0),T.h(Math.max(X,T.width),Math.max(m,T.height)));if(c===1)s.width=X,s.height=m,fe.free(T);else{switch($=Xv(p),et=Yv(p),c=n=0,et.x!==$.x&&et.y!==$.y&&(n=T.width/Math.abs(et.x-$.x),c=T.height/Math.abs(et.y-$.y)),fe.free(T),T=0,A!==null&&(T=A.strokeWidth*A.scale,F0(A)===oi&&(n=c=Math.max(n,c))),n+=Math.abs($.offsetX)+Math.abs(et.offsetX)+T,c+=Math.abs($.offsetY)+Math.abs(et.offsetY)+T,A=p.stretch,A===on&&(A=Qu(p,!1)),A){case Jt:l=a=0;break;case oe:isFinite(e)&&(n=e),isFinite(i)&&(c=i);break;case mi:isFinite(e)&&(n=e),l=0;break;case Ii:a=0,isFinite(i)&&(c=i)}p.Uj(),p.measure(n,c,a,l),s.width=p.measuredBounds.width+C,s.height=p.measuredBounds.height+k}},Ng.prototype.arrange=function(t,e){var i=e.length,n=t.Pb(),s=n.measuredBounds,a=Tt.alloc();a.h(0,0,1,1);var l=n.margin,c=l.left;l=l.top;var p=t.padding,m=p.left;p=p.top,n.arrange(m+c,p+l,s.width,s.height);var v=Xv(n),w=Yv(n),C=v.y*s.height+v.offsetY,k=w.x*s.width+w.offsetX;for(w=w.y*s.height+w.offsetY,a.x=v.x*s.width+v.offsetX,a.y=C,or(a,k,w,0,0),a.x+=c+m,a.y+=l+p,s=0;s<i;s++)c=e[s],c!==n&&(m=c.measuredBounds,l=c.margin,p=Math.max(m.width+l.right+l.left,0),v=Math.max(m.height+l.top+l.bottom,0),C=c.alignment,C.Xb()&&(C=t.defaultAlignment),C.sb()||(C=_n),p=a.width*C.x+C.offsetX-p*C.x+l.left+a.x,l=a.height*C.y+C.offsetY-v*C.y+l.top+a.y,c.visible&&(eo(a.x,a.y,a.width,a.height,p,l,m.width,m.height)?c.arrange(p,l,m.width,m.height):c.arrange(p,l,m.width,m.height,new Tt(a.x,a.y,a.width,a.height))));Tt.free(a)};function up(){this.xa="Base",this.name="Table"}li(up,fl),up.prototype.measure=function(t,e,i,n,s){for(var a=n.length,l=gi(),c=gi(),p=0;p<a;p++){var m=n[p],v=m instanceof ce?m:null;if(v!==null&&md(v)&&m.visible){c.push(v);for(var w=v.O.s,C=w.length,k=0;k<C;k++){var T=w[k];v.type===ce.TableRow?T.row=m.row:v.type===ce.TableColumn&&(T.column=m.column),l.push(T)}}else l.push(m)}a=l.length,a===0&&(t.Fb(0),t.Eb(0));for(var A=[],X=0;X<a;X++){var $=l[X];$.visible&&(ba($,!0),au($,!0),A[$.row]||(A[$.row]=[]),A[$.row][$.column]||(A[$.row][$.column]=[]),A[$.row][$.column].push($))}Ji(l);var J=gi(),et=gi(),st=gi(),mt={count:0},Pt={count:0},De=e,ti=i,Ve=t.rowDefs,ye=t.colDefs,Yt=null;a=Ve.length;for(var sn=0;sn<a;sn++)Yt=Ve[sn],Yt!==void 0&&(Yt.actual=0);a=ye.length;for(var Ui=0;Ui<a;Ui++)Yt=ye[Ui],Yt!==void 0&&(Yt.actual=0);for(var Vr=A.length,is=0,zl=0;zl<Vr;zl++)A[zl]&&(is=Math.max(is,A[zl].length));var eu=Math.min(t.topIndex,Vr-1),dh=Math.min(t.leftIndex,is-1),$l=0;Vr=A.length;for(var Dp=rf(t),il=0;il<Vr;il++)if(A[il]){is=A[il].length;var Wf=t.Fb(il);Wf.actual=0;for(var ph=Wf.oc=0;ph<is;ph++)if(A[il][ph]){var Ip=t.Eb(ph);J[ph]===void 0&&(Ip.actual=0,Ip.oc=0,J[ph]=!0);for(var Ic=A[il][ph],hf=Ic.length,pc=0;pc<hf;pc++){var tc=Ic[pc];if(tc.visible||tc===Dp){var y0=1<tc.rowSpan||1<tc.columnSpan;y0&&(il<eu||ph<dh||et.push(tc));var Uf=tc.margin,Lv=Uf.right+Uf.left,mc=Uf.top+Uf.bottom,mh=wh(tc,Wf,Ip,!1),$y=tc.desiredSize,dg=!isNaN($y.height),ud=!isNaN($y.width)&&dg;if(y0||mh===Jt||ud||il<eu||ph<dh||(mt[ph]!==void 0||mh!==oe&&mh!==mi||(mt[ph]=-1,mt.count++),Pt[il]!==void 0||mh!==oe&&mh!==Ii||(Pt[il]=-1,Pt.count++),st.push(tc)),tc.measure(1/0,1/0,0,0),!(il<eu||ph<dh)){var ec=tc.measuredBounds,dm=Math.max(ec.width+Lv,0),gc=Math.max(ec.height+mc,0);if(tc.rowSpan===1&&(mh===Jt||mh===mi)){Yt=t.Fb(il);var x0=Yt.Wc();$l=Math.max(gc-Yt.actual,0),$l+x0>ti&&($l=Math.max(ti-x0,0));var Q1=Yt.oa===0;Yt.oc=Yt.oc+$l,Yt.actual=Yt.oa+$l,ti=Math.max(ti-($l+(Q1?x0:0)),0)}if(tc.columnSpan===1&&(mh===Jt||mh===Ii)){Yt=t.Eb(ph);var jy=Yt.Wc();$l=Math.max(dm-Yt.actual,0),$l+jy>De&&($l=Math.max(De-jy,0));var jx=Yt.oa===0;Yt.oc=Yt.oc+$l,Yt.actual=Yt.oa+$l,De=Math.max(De-($l+(jx?jy:0)),0)}y0&&tc.Uj()}}}}}Ji(J);var Td=0,Jd=0;a=t.columnCount;for(var pg=0;pg<a;pg++){var w0=ye[pg];w0!==void 0&&(Td+=isNaN(w0.Hc)?w0.oc:w0.Hc,w0.oc!==0&&(Td+=w0.Wc()))}a=t.rowCount;for(var Tv=0;Tv<a;Tv++){var b0=Ve[Tv];b0!==void 0&&(Jd+=isNaN(b0.Hc)?b0.oc:b0.Hc,b0.oc!==0&&(Jd+=b0.Wc()))}De=Math.max(e-Td,0);var _d=ti=Math.max(i-Jd,0),Op=De;a=st.length;for(var ic=0;ic<a;ic++){var hd=st[ic],tx=t.Fb(hd.row),qd=t.Eb(hd.column),_v=hd.measuredBounds,Zf=hd.margin,pm=Zf.right+Zf.left,cd=Zf.top+Zf.bottom;mt[hd.column]=qd.oc===0&&mt[hd.column]!==void 0?Math.max(_v.width+pm,mt[hd.column]):null,Pt[hd.row]=tx.oc===0&&Pt[hd.row]!==void 0?Math.max(_v.height+cd,Pt[hd.row]):null}var mg=0,Pv=0,Tf;for(Tf in Pt)Tf!=="count"&&(mg+=Pt[Tf]);for(Tf in mt)Tf!=="count"&&(Pv+=mt[Tf]);for(var yu=fe.alloc(),Ky=0;Ky<a;Ky++){var Eh=st[Ky];if(Eh.visible||Eh===Dp){var nl=t.Fb(Eh.row),Lh=t.Eb(Eh.column),Qd=0;isFinite(Lh.width)?Qd=Lh.width:(isFinite(De)&&mt[Eh.column]!==null?Pv===0?Qd=Lh.actual+De:Qd=mt[Eh.column]/Pv*Op:mt[Eh.column]!==null?Qd=De:Qd=Lh.actual||De,Qd=Math.max(0,Qd-Lh.Wc()));var Rp=0;switch(isFinite(nl.height)?Rp=nl.height:(isFinite(ti)&&Pt[Eh.row]!==null?mg===0?Rp=nl.actual+ti:Rp=Pt[Eh.row]/mg*_d:Pt[Eh.row]!==null?Rp=ti:Rp=nl.actual||ti,Rp=Math.max(0,Rp-nl.Wc())),yu.h(Math.max(Lh.minimum,Math.min(Qd,Lh.maximum)),Math.max(nl.minimum,Math.min(Rp,nl.maximum))),mh=wh(Eh,nl,Lh,!1),mh){case mi:yu.height=Math.max(yu.height,nl.actual+ti);break;case Ii:yu.width=Math.max(yu.width,Lh.actual+De)}var mm=Eh.margin,Kx=mm.right+mm.left,ex=mm.top+mm.bottom;Eh.Uj(),Eh.measure(yu.width,yu.height,Lh.minimum,nl.minimum);var Nv=Eh.measuredBounds,gm=Math.max(Nv.width+Kx,0),gg=Math.max(Nv.height+ex,0);isFinite(De)&&(gm=Math.min(gm,yu.width)),isFinite(ti)&&(gg=Math.min(gg,yu.height));var nc=0;nc=nl.actual,nl.actual=Math.max(nl.actual,gg),nl.oc=Math.max(nl.oc,gg),$l=nl.actual-nc,ti=Math.max(ti-$l,0),Pt[Eh.row]===null&&(_d=Math.max(_d-$l,0)),nc=Lh.actual,Lh.actual=Math.max(Lh.actual,gm),Lh.oc=Math.max(Lh.oc,gm),$l=Lh.actual-nc,De=Math.max(De-$l,0),mt[Eh.column]===null&&(Op=Math.max(Op-$l,0))}}Ji(st);var tp=fe.alloc(),Gf=gi(),Gc=gi();if(a=et.length,a!==0){for(var S0=0;S0<Vr;S0++)if(A[S0]){is=A[S0].length;var Av=t.Fb(S0);Gf[S0]=Av.actual;for(var M0=0;M0<is;M0++)if(A[S0][M0]){var ix=t.Eb(M0);Gc[M0]=ix.actual}}}for(var Dv=0;Dv<a;Dv++){var Ba=et[Dv];if(Ba.visible||Ba===Dp){var _f=t.Fb(Ba.row),cf=t.Eb(Ba.column);switch(yu.h(Math.max(cf.minimum,Math.min(e,cf.maximum)),Math.max(_f.minimum,Math.min(i,_f.maximum))),mh=wh(Ba,_f,cf,!1),mh){case oe:Gc[cf.index]!==0&&(yu.width=Math.min(yu.width,Gc[cf.index])),Gf[_f.index]!==0&&(yu.height=Math.min(yu.height,Gf[_f.index]));break;case mi:Gc[cf.index]!==0&&(yu.width=Math.min(yu.width,Gc[cf.index]));break;case Ii:Gf[_f.index]!==0&&(yu.height=Math.min(yu.height,Gf[_f.index]))}isFinite(cf.width)&&(yu.width=cf.width),isFinite(_f.height)&&(yu.height=_f.height),tp.h(0,0);for(var nx=cf.minimum,vc=_f.minimum,Bp=1;Bp<Ba.rowSpan&&!(Ba.row+Bp>=t.rowCount);Bp++)Yt=t.Fb(Ba.row+Bp),$l=0,$l=mh===oe||mh===Ii?Math.max(Yt.minimum,Gf[Ba.row+Bp]===0?Yt.maximum:Math.min(Gf[Ba.row+Bp],Yt.maximum)):Math.max(Yt.minimum,isNaN(Yt.Hc)?Yt.maximum:Math.min(Yt.Hc,Yt.maximum)),tp.height+=$l,vc+=Yt.minimum;for(var ff=1;ff<Ba.columnSpan&&!(Ba.column+ff>=t.columnCount);ff++)Yt=t.Eb(Ba.column+ff),$l=0,$l=mh===oe||mh===mi?Math.max(Yt.minimum,Gc[Ba.column+ff]===0?Yt.maximum:Math.min(Gc[Ba.column+ff],Yt.maximum)):Math.max(Yt.minimum,isNaN(Yt.Hc)?Yt.maximum:Math.min(Yt.Hc,Yt.maximum)),tp.width+=$l,nx+=Yt.minimum;yu.width+=tp.width,yu.height+=tp.height;var Iv=Ba.margin,C0=Iv.right+Iv.left,Hy=Iv.top+Iv.bottom;Ba.measure(yu.width,yu.height,nx,vc);for(var Ov=Ba.measuredBounds,fd=Math.max(Ov.width+C0,0),vm=Math.max(Ov.height+Hy,0),k0=0,Rv=0;Rv<Ba.rowSpan&&!(Ba.row+Rv>=t.rowCount);Rv++)Yt=t.Fb(Ba.row+Rv),k0+=Yt.total||0;if(k0<vm){var Fp=vm-k0,Pd=vm-k0;if(Ba.spanAllocation!==null)for(var zp=Ba.spanAllocation,ep=0;ep<Ba.rowSpan&&!(0>=Fp)&&!(Ba.row+ep>=t.rowCount);ep++){Yt=t.Fb(Ba.row+ep);var $p=Yt.oa||0,ym=zp(Ba,Yt,Pd);Yt.actual=Math.min(Yt.maximum,$p+ym),Yt.oa!==$p&&(Fp-=Yt.oa-$p)}for(;0<Fp;){var Xf=Yt.oa||0;if(isNaN(Yt.height)&&Yt.maximum>Xf&&(Yt.actual=Math.min(Yt.maximum,Xf+Fp),Yt.oa!==Xf&&(Fp-=Yt.oa-Xf)),Yt.index===0)break;Yt=t.Fb(Yt.index-1)}}for(var vg=0,jp=0;jp<Ba.columnSpan&&!(Ba.column+jp>=t.columnCount);jp++)Yt=t.Eb(Ba.column+jp),vg+=Yt.total||0;if(vg<fd){var yg=fd-vg,Hx=fd-vg;if(Ba.spanAllocation!==null)for(var ip=Ba.spanAllocation,xm=0;xm<Ba.columnSpan&&!(0>=yg)&&!(Ba.column+xm>=t.columnCount);xm++){Yt=t.Eb(Ba.column+xm);var Vy=Yt.oa||0,Vx=ip(Ba,Yt,Hx);Yt.actual=Math.min(Yt.maximum,Vy+Vx),Yt.oa!==Vy&&(yg-=Yt.oa-Vy)}for(;0<yg;){var rx=Yt.oa||0;if(isNaN(Yt.width)&&Yt.maximum>rx&&(Yt.actual=Math.min(Yt.maximum,rx+yg),Yt.oa!==rx&&(yg-=Yt.oa-rx)),Yt.index===0)break;Yt=t.Eb(Yt.index-1)}}}}Ji(et),fe.free(tp),fe.free(yu),Gf!==void 0&&Ji(Gf),Gc!==void 0&&Ji(Gc);var xg=0,wg=0,ox=t.desiredSize,o2=t.maxSize;mh=Qu(t,!0);var Wy=Jd=Td=0,Uy=0;a=t.columnCount;for(var sx=0;sx<a;sx++)ye[sx]!==void 0&&(Yt=t.Eb(sx),isFinite(Yt.width)?(Wy+=Yt.width,Wy+=Yt.Wc()):Pm(Yt)===qp?(Wy+=Yt.oa,Wy+=Yt.Wc()):Yt.oa!==0&&(Td+=Yt.oa,Td+=Yt.Wc()));isFinite(ox.width)?xg=Math.min(ox.width,o2.width):xg=mh!==Jt&&isFinite(e)?e:Td,xg=Math.max(xg,t.minSize.width),xg=Math.max(xg-Wy,0);for(var V2=Td===0?1:Math.max(xg/Td,1),ax=0;ax<a;ax++)ye[ax]!==void 0&&(Yt=t.Eb(ax),isFinite(Yt.width)||Pm(Yt)===qp||(Yt.actual=Yt.oa*V2),Yt.position=s.width,Yt.oa!==0&&(s.width+=Yt.oa,s.width+=Yt.Wc()));a=t.rowCount;for(var lx=0;lx<a;lx++)Ve[lx]!==void 0&&(Yt=t.Fb(lx),isFinite(Yt.height)?(Uy+=Yt.height,Uy+=Yt.Wc()):Pm(Yt)===qp?(Uy+=Yt.oa,Uy+=Yt.Wc()):Yt.oa!==0&&(Jd+=Yt.oa,Jd+=Yt.Wc()));isFinite(ox.height)?wg=Math.min(ox.height,o2.height):wg=mh!==Jt&&isFinite(i)?i:Jd,wg=Math.max(wg,t.minSize.height),wg=Math.max(wg-Uy,0);for(var W2=Jd===0?1:Math.max(wg/Jd,1),ux=0;ux<a;ux++)Ve[ux]!==void 0&&(Yt=t.Fb(ux),isFinite(Yt.height)||Pm(Yt)===qp||(Yt.actual=Yt.oa*W2),Yt.position=s.height,Yt.oa!==0&&(s.height+=Yt.oa,s.height+=Yt.Wc()));a=c.length;for(var Wx=0;Wx<a;Wx++){var Zy=c[Wx],Ux=0,Zx=0;Zy.type===ce.TableRow?(Ux=s.width,Yt=t.Fb(Zy.row),Zx=Yt.actual):(Yt=t.Eb(Zy.column),Ux=Yt.actual,Zx=s.height),Zy.measuredBounds.h(0,0,Ux,Zx),ba(Zy,!1)}Ji(c),t.inRowsCols=A},up.prototype.arrange=function(t,e,i){var n=e.length,s=t.padding,a=s.left;s=s.top;var l=t.inRowsCols;if(l!==null){for(var c,p,m=l.length,v=0,w=0;w<m;w++)l[w]&&(v=Math.max(v,l[w].length));p=t.rowDefs,c=t.colDefs;var C=w=0,k=Math.min(t.topIndex,m-1);if(0<p.length){for(;k!==m&&(p[k]===void 0||p[k].oa===0);)k++;k=Math.max(Math.min(k,m-1),0),w=-p[k].position}var T=Math.min(t.leftIndex,v-1);if(0<c.length){for(;T!==v&&(c[T]===void 0||c[T].oa===0);)T++;T=Math.max(Math.min(T,v-1),0),C=-c[T].position}for(var A=0,X=0;A!==m&&p[A]===void 0;)A++;for(;X!==m&&c[X]===void 0;)X++;v=t.part,t.Fb(A),t.Eb(X);for(var $=0;$<e.length;$++){var J=e[$];if(J instanceof ce&&J.visible&&md(J)){if(J.type===ce.TableRow){c=t.Fb(J.row);var et=t.Eb(X)}else c=t.Fb(A),et=t.Eb(J.column);p=c.position+w+s,c.oa!==0&&(p+=c.Io(Math.max(A,k))),c=et.position+C+a,et.oa!==0&&(c+=et.Io(Math.max(X,T))),et=J.measuredBounds,J.Uk(),J.actualBounds.ka();var st=J.actualBounds,mt=Tt.allocAt(st.x,st.y,st.width,st.height);st.x=J.type===ce.TableRow?a:c,st.y=J.type===ce.TableColumn?s:p,st.width=et.width,st.height=et.height,J.actualBounds.freeze(),au(J,!1),ls(mt,st)||v===null||(v.oh(),J.Pn(v)),Tt.free(mt)}}for($=fe.alloc(),J=0;J<m;J++)if(l[J]){for(v=l[J].length,et=t.Fb(J),p=et.position+w+s,et.oa!==0&&(p+=et.Io(Math.max(A,k))),st=0;st<v;st++)if(l[J][st]){mt=t.Eb(st),c=mt.position+C+a,mt.oa!==0&&(c+=mt.Io(Math.max(X,T)));for(var Pt=l[J][st],De=Pt.length,ti=0;ti<De;ti++){var Ve=Pt[ti],ye=Ve.measuredBounds;$.h(0,0);for(var Yt=1;Yt<Ve.rowSpan&&!(J+Yt>=t.rowCount);Yt++){var sn=t.Fb(J+Yt);sn.oa!==0&&($.height+=sn.total)}for(Yt=1;Yt<Ve.columnSpan&&!(st+Yt>=t.columnCount);Yt++)sn=t.Eb(st+Yt),sn.oa!==0&&($.width+=sn.total);var Ui=mt.oa+$.width,Vr=et.oa+$.height;Yt=c,sn=p;var is=Ui,zl=Vr,eu=c,dh=p,$l=Ui,Dp=Vr;c+Ui>i.width&&($l=Math.max(i.width-c,0)),p+Vr>i.height&&(Dp=Math.max(i.height-p,0));var il=Ve.alignment;if(il.Xb()){il=t.defaultAlignment,il.sb()||(il=_n);var Wf=il.x,ph=il.y,Ip=il.offsetX;il=il.offsetY;var Ic=mt.alignment,hf=et.alignment;Ic.sb()&&(Wf=Ic.x,Ip=Ic.offsetX),hf.sb()&&(ph=hf.y,il=hf.offsetY)}else Wf=il.x,ph=il.y,Ip=il.offsetX,il=il.offsetY;(isNaN(Wf)||isNaN(ph))&&(ph=Wf=.5,il=Ip=0),Ic=ye.width,hf=ye.height;var pc=Ve.margin,tc=pc.left+pc.right,y0=pc.top+pc.bottom,Uf=wh(Ve,et,mt,!1);!isNaN(Ve.desiredSize.width)||Uf!==oe&&Uf!==mi||(Ic=Math.max(Ui-tc,0)),!isNaN(Ve.desiredSize.height)||Uf!==oe&&Uf!==Ii||(hf=Math.max(Vr-y0,0)),Ui=Ve.maxSize,Vr=Ve.minSize,Ic=Math.min(Ui.width,Ic),hf=Math.min(Ui.height,hf),Ic=Math.max(Vr.width,Ic),hf=Math.max(Vr.height,hf),Ui=hf+y0,Yt+=is*Wf-(Ic+tc)*Wf+Ip+pc.left,sn+=zl*ph-Ui*ph+il+pc.top,Ve.visible&&(eo(eu,dh,$l,Dp,Yt,sn,ye.width,ye.height)?Ve.arrange(Yt,sn,Ic,hf):Ve.arrange(Yt,sn,Ic,hf,new Tt(eu,dh,$l,Dp)))}}}for(fe.free($),t=0;t<n;t++)i=e[t],a=i instanceof ce?i:null,a!==null&&md(a)&&(a=i.actualBounds,i.naturalBounds.ka(),i.naturalBounds.h(0,0,a.width,a.height),i.naturalBounds.freeze())}};function hp(){this.xa="Base"}li(hp,fl),hp.prototype.measure=function(){},hp.prototype.arrange=function(){};function I0(){this.xa="Base"}li(I0,fl),I0.prototype.measure=function(){},I0.prototype.arrange=function(){};function Nc(){this.xa="Base"}li(Nc,fl),Nc.prototype.measure=function(t,e,i,n,s,a,l){1<n.length&&Mt("Viewbox Panel cannot contain more than one GraphObject."),n=n[0],n.Ca=1,n.Uj(),n.measure(1/0,1/0,a,l);var c=n.measuredBounds,p=n.margin,m=p.right+p.left;if(p=p.top+p.bottom,isFinite(e)||isFinite(i)){var v=n.scale,w=c.width;c=c.height;var C=Math.max(e-m,0),k=Math.max(i-p,0),T=1;t.viewboxStretch===oi?w!==0&&c!==0&&(T=Math.min(C/w,k/c)):w!==0&&c!==0&&(T=Math.max(C/w,k/c)),T===0&&(T=1e-4),n.Ca*=T,v!==n.scale&&(ba(n,!0),n.measure(1/0,1/0,a,l))}c=n.measuredBounds,s.width=isFinite(e)?e:Math.max(c.width+m,0),s.height=isFinite(i)?i:Math.max(c.height+p,0)},Nc.prototype.arrange=function(t,e,i){e=e[0];var n=e.measuredBounds,s=e.margin,a=Math.max(n.width+(s.right+s.left),0);s=Math.max(n.height+(s.top+s.bottom),0);var l=e.alignment;l.Xb()&&(l=t.defaultAlignment),l.sb()||(l=_n),e.arrange(i.width*l.x-a*l.x+l.offsetX,i.height*l.y-s*l.y+l.offsetY,n.width,n.height)};function Mm(){this.xa="Base"}li(Mm,fl),Mm.prototype.measure=function(){},Mm.prototype.arrange=function(){},Mm.prototype.gc=function(t,e,i){i=t.Df()*i.scale,0>=i&&(i=1);var n=t.gridCellSize,s=n.width;n=n.height;var a=t.naturalBounds,l=t.actualBounds,c=a.width,p=a.height,m=Math.ceil(c/s),v=Math.ceil(p/n),w=t.gridOrigin,C=w.x;w=w.y,e.save(),e.beginPath(),e.rect(0,0,c,p),e.clip(),e.Se();for(var k=[],T=t.O.s,A=T.length,X=0;X<A;X++){var $=T[X],J=[];if(k.push(J),$.visible){var et=$.interval;if(!(0>et)){$=Zv($.figure);for(var st=0;st<A;st++)if(st!==X){var mt=T[st];mt.visible&&Zv(mt.figure)===$&&(mt=mt.interval,mt>et&&J.push(mt))}}}}for(T=t.O.s,A=T.length,X=0;X<A;X++){var Pt=T[X];if(Pt.visible&&(J=Pt.interval||1,$=Math.abs(J),!(2>s*$*i))){if(et=Pt.segmentIndex,(!isFinite(et)||isNaN(et))&&(et=0),0>et&&(et=$-Math.min(-et,$)),et=Math.round(et%$),$=Pt.opacity,st=1,$!==1){if($===0)continue;st=e.globalAlpha,e.globalAlpha=st*$}mt=k[X];var De=!1,ti=Pt.strokeDashArray;if(ti!==null&&(De=!0,e.js(ti,Pt.strokeDashOffset)),Pt.figure==="LineV"&&Pt.stroke!==null&&0<Pt.strokeWidth){for(e.lineWidth=Pt.strokeWidth,Gs(t,e,Pt.stroke,!1,!1,a,l),e.beginPath(),ti=Pt=Math.floor((C-s)/s);ti<=Pt+m;ti++){var Ve=ti*s+C;0<=Ve&&Ve<=c&&Ag(ti,J,et,mt)&&(e.moveTo(Ve,0),e.lineTo(Ve,p))}e.stroke(),e.Se()}else if(Pt.figure==="LineH"&&Pt.stroke!==null&&0<Pt.strokeWidth){for(e.lineWidth=Pt.strokeWidth,Gs(t,e,Pt.stroke,!1,!1,a,l),e.beginPath(),ti=Pt=Math.floor((w-n)/n);ti<=Pt+v;ti++)Ve=ti*n+w,0<=Ve&&Ve<=p&&Ag(ti,J,et,mt)&&(e.moveTo(0,Ve),e.lineTo(c,Ve));e.stroke(),e.Se()}else if(Pt.figure==="BarV"&&Pt.fill!==null)for(Gs(t,e,Pt.fill,!0,!1,a,l),Pt=Pt.width,isNaN(Pt)&&(Pt=s),Ve=ti=Math.floor((C-s)/s);Ve<=ti+m;Ve++){var ye=Ve*s+C;0<=ye+Pt&&ye<=c&&Ag(Ve,J,et,mt)&&e.fillRect(ye,0,Pt,p)}else if(Pt.figure==="BarH"&&Pt.fill!==null)for(Gs(t,e,Pt.fill,!0,!1,a,l),Pt=Pt.height,isNaN(Pt)&&(Pt=n),Ve=ti=Math.floor((w-n)/n);Ve<=ti+v;Ve++)ye=Ve*n+w,0<=ye+Pt&&ye<=p&&Ag(Ve,J,et,mt)&&e.fillRect(0,ye,c,Pt);De&&e.fs(),$!==1&&(e.globalAlpha=st)}}e.restore(),e.Vc(!1)};function Ag(t,e,i,n){if(0>e)return t%e===i;if(t%e!==i)return!1;e=n.length;for(var s=0;s<e;s++)if(t%n[s]===i)return!1;return!0}function Dg(){this.xa="Base"}li(Dg,fl),Dg.prototype.measure=function(t,e,i,n,s){var a=n.length;if(t instanceof pr||t instanceof ge){var l=null,c=null;if(t instanceof ge&&(l=t),t instanceof pr&&(c=t,l=c.adornedPart,t.j===null&&(t.j=[])),l instanceof ge){var p=l;if(a===0)yn(t.naturalBounds,0,0),t.measuredBounds.h(0,0,0,0);else{var m=t instanceof pr?null:l.path;e=l.routeBounds,i=t.jg,i.h(0,0,e.width,e.height);var v=p.points,w=l.pointsCount;c!==null?c.Ul(!1):l!==null&&l.Ul(!1),c=e.width;var C=e.height,k=t.j;if(k.length=0,m!==null){qy(t,c,C,m);var T=m.measuredBounds;i.ed(T),k.push(T)}T=dn.alloc();for(var A=G.alloc(),X=G.alloc(),$=0;$<a;$++){var J=n[$];if(J!==m)if(J.isPanelMain&&J instanceof pn){qy(t,c,C,J);var et=J.measuredBounds;i.ed(et),k.push(et)}else if(2>w)J.measure(1/0,1/0,0,0),et=J.measuredBounds,i.ed(et),k.push(et);else{var st=J.segmentIndex,mt=J.segmentFraction,Pt=J.alignmentFocus;Pt.Mc()&&(Pt=_n);var De=J.segmentOrientation,ti=J.segmentOffset;if(isNaN(st)){var Ve=p.ua;et=gi(),Ve.Qu(mt,et);var ye=G.allocAt(et[0],et[1]);if(ye.add(p.i(0)),Ve.type===ve.j?ye.offset(-Ve.startX,-Ve.startY):(Ve=Ve.figures.first(),Ve!==null&&ye.offset(-Ve.startX,-Ve.startY)),Ve=et[2],De!==eh){var Yt=p.computeAngle(J,De,Ve);J.Kb=Yt}Yt=ye.x-e.x;var sn=ye.y-e.y;G.free(ye),Ji(et)}else if(st<-w||st>=w)et=G.alloc(),p.vg(),p.computeMidPoint(et),Ve=p.midAngle,De!==eh&&(Yt=p.computeAngle(J,De,Ve),J.Kb=Yt),Yt=et.x-e.x,sn=et.y-e.y,G.free(et);else{if(Yt=0,0<=st?(sn=v.M(st),et=st<w-1?v.M(st+1):sn):(Yt=w+st,sn=v.M(Yt),et=0<Yt?v.M(Yt-1):sn),sn.Xa(et)){0<=st?(Ve=0<st?v.M(st-1):sn,Yt=st<w-2?v.M(st+2):et):(Ve=Yt<w-1?v.M(Yt+1):sn,Yt=1<Yt?v.M(Yt-2):et),ye=Ve.Bf(sn);var Ui=et.Bf(Yt);Ve=ye>Ui+10?0<=st?Ve.ab(sn):sn.ab(Ve):Ui>ye+10?0<=st?et.ab(Yt):Yt.ab(et):0<=st?Ve.ab(Yt):Yt.ab(Ve)}else Ve=0<=st?sn.ab(et):et.ab(sn);De!==eh&&(Yt=p.computeAngle(J,De,Ve),J.Kb=Yt),Yt=sn.x+(et.x-sn.x)*mt-e.x,sn=sn.y+(et.y-sn.y)*mt-e.y}J.measure(1/0,1/0,0,0),et=J.measuredBounds,ye=J.naturalBounds;var Vr=0;J instanceof pn&&(Vr=J.strokeWidth),Ui=ye.width+Vr;var is=ye.height+Vr;T.reset(),T.translate(-et.x,-et.y),T.scale(J.scale,J.scale),T.rotate(De===eh?J.angle:Ve,Ui/2,is/2),De!==Mp&&De!==q0||T.rotate(90,Ui/2,is/2),De!==Xm&&De!==Ym||T.rotate(-90,Ui/2,is/2),De===rv&&(45<Ve&&135>Ve||225<Ve&&315>Ve)&&T.rotate(-Ve,Ui/2,is/2),ye=new Tt(0,0,Ui,is),A.xi(ye,Pt),T.Ga(A),Pt=-A.x+Vr/2*J.scale,J=-A.y+Vr/2*J.scale,X.assign(ti),Vr=isNaN(ti.x);var zl=isNaN(ti.y);if(Vr||zl){Ui=Ui/2+3,is=is/2+3;var eu=45<=Ve&&135>=Ve,dh=225<=Ve&&315>=Ve;De===eh&&(eu||dh)?(X.x=zl?Ui:ti.y,X.y=Vr?is:ti.x,eu?0<=st||isNaN(st)&&.5>mt||!Vr||(X.y=-is):dh&&((0<=st||isNaN(st)&&.5>mt)&&Vr&&(X.y=-is),zl&&(X.x=-Ui))):(Vr&&(X.x=0<=st||isNaN(st)&&.5>mt?Ui:-Ui),zl&&(X.y=-is),X.rotate(Ve))}else X.rotate(Ve);Yt+=X.x,sn+=X.y,ye.set(et),ye.h(Yt+Pt,sn+J,et.width,et.height),k.push(ye),i.ed(ye)}}if(l!==null)for(n=l.labelNodes;n.next();)n.value.measure(1/0,1/0);t.jg=i,t.position.h(e.x+i.x,e.y+i.y),yn(s,i.width||0,i.height||0),dn.free(T),G.free(A),G.free(X)}}}},Dg.prototype.arrange=function(t,e){var i=e.length;if(t instanceof pr||t instanceof ge){var n=t,s=null;t instanceof pr&&(s=t,n=s.adornedPart);var a=t instanceof pr?null:n.path,l=t.j;if(l.length!==0){var c=0;if(a!==null&&c<l.length){var p=l[c];c++,a.arrange(p.x-t.jg.x,p.y-t.jg.y,p.width,p.height)}for(p=0;p<i;p++){var m=e[p];if(m!==a&&c<l.length){var v=l[c];c++,m.arrange(v.x-t.jg.x,v.y-t.jg.y,v.width,v.height)}}}if(e=n.points,i=e.count,2<=i&&t instanceof ge)for(a=t.labelNodes;a.next();){var w=t;l=a.value,c=l.segmentIndex,p=l.segmentFraction;var C=l.alignmentFocus;if(m=l.segmentOrientation,v=l.segmentOffset,isNaN(c)){var k=w.ua,T=gi();k.Qu(p,T);var A=G.allocAt(T[0],T[1]);A.add(w.i(0)),k.type===ve.j||(k=k.figures.first()),A.offset(-k.startX,-k.startY),k=T[2],m!==eh&&(w=w.computeAngle(l,m,k),l.angle=w),w=A.x;var X=A.y;G.free(A),Ji(T)}else if(c<-i||c>=i)T=G.alloc(),k=w,X=T,k.vg(),k.computeMidPoint(X),k=w.midAngle,m!==eh&&(w=w.computeAngle(l,m,k),l.angle=w),w=T.x,X=T.y,G.free(T);else{if(A=0,0<=c?(T=e.s[c],X=c<i-1?e.s[c+1]:T):(A=i+c,T=e.s[A],X=0<A?e.s[A-1]:T),T.Xa(X)){0<=c?(k=0<c?e.s[c-1]:T,A=c<i-2?e.s[c+2]:X):(k=A<i-1?e.s[A+1]:T,A=1<A?e.s[A-2]:X);var $=k.Bf(T),J=X.Bf(A);k=$>J+10?0<=c?k.ab(T):T.ab(k):J>$+10?0<=c?X.ab(A):A.ab(X):0<=c?k.ab(A):A.ab(k)}else k=0<=c?T.ab(X):X.ab(T);m!==eh&&(w=w.computeAngle(l,m,k),l.angle=w),w=T.x+(X.x-T.x)*p,X=T.y+(X.y-T.y)*p}if(C.ys())l.location=new G(w,X);else{C.Mc()&&(C=_n),T=dn.alloc(),T.reset(),T.scale(l.scale,l.scale),T.rotate(l.angle,0,0);var et=l.naturalBounds;A=Tt.allocAt(0,0,et.width,et.height),$=G.alloc(),$.xi(A,C),T.Ga($),C=-$.x,J=-$.y;var st=et.width,mt=et.height;et=G.alloc(),et.assign(v);var Pt=isNaN(v.x),De=isNaN(v.y);if(Pt||De){st=st/2+3,mt=mt/2+3;var ti=45<=k&&135>=k,Ve=225<=k&&315>=k;m===eh&&(ti||Ve)?(et.x=De?st:v.y,et.y=Pt?mt:v.x,ti?0<=c||isNaN(c)&&.5>p||!Pt||(et.y=-mt):Ve&&((0<=c||isNaN(c)&&.5>p)&&Pt&&(et.y=-mt),De&&(et.x=-st))):(Pt&&(et.x=0<=c||isNaN(c)&&.5>p?st:-st),De&&(et.y=-mt),et.rotate(k))}else et.rotate(k);w+=et.x,X+=et.y,T.pp(A),C+=A.x,J+=A.y,c=G.allocAt(w+C,X+J),l.move(c),G.free(c),G.free(et),G.free($),Tt.free(A),dn.free(T)}}s!==null?s.Ul(!1):n.Ul(!1),n=xf(t),t.location.h(t.position.x+n.x,t.position.y+n.y),G.free(n)}};function qy(t,e,i,n){if(lh(n)!==!1){var s=n.strokeWidth;s===0&&t instanceof pr&&t.type===ce.Link&&t.adornedObject instanceof pn&&(s=t.adornedObject.strokeWidth),s*=n.Ca,t instanceof ge&&t.ua!==null?(t=t.geometry.bounds,n.Ge(t.x-s/2,t.y-s/2,t.width+s,t.height+s)):t instanceof pr&&t.adornedPart.ua!==null?(t=t.adornedPart.ua.bounds,n.Ge(t.x-s/2,t.y-s/2,t.width+s,t.height+s)):n.Ge(-(s/2),-(s/2),e+s,i+s),s=n.desiredSize,s.w()||n.ua===null?n.dc.h(0,0,s.width,s.height):n.dc.assign(n.ua.bounds),ba(n,!1)}}function Rd(){this.xa="Base"}li(Rd,fl),Rd.prototype.measure=function(t,e,i,n,s,a,l){var c=t.Pb();t.graduatedBounds=[];var p=c.margin,m=p.right+p.left,v=p.top+p.bottom;c.measure(e,i,a,l);var w=c.measuredBounds,C=new Tt(-p.left,-p.top,Math.max(w.width+m,0),Math.max(w.height+v,0));t.graduatedBounds.push(C),s.assign(C);for(var k=c.geometry,T=c.strokeWidth,A=k.flattenedSegments,X=k.flattenedLengths,$=k.flattenedTotalLength,J=A.length,et=0,st=0,mt=gi(),Pt=0;Pt<J;Pt++){var De=A[Pt],ti=[];st=et=0;for(var Ve=De.length,ye=0;ye<Ve;ye+=2){var Yt=De[ye],sn=De[ye+1];if(ye!==0){var Ui=180*Math.atan2(sn-st,Yt-et)/Math.PI;0>Ui&&(Ui+=360),ti.push(Ui)}et=Yt,st=sn}mt.push(ti)}if(t.graduatedIntervals===null){for(var Vr=[],is=t.O.s,zl=is.length,eu=0;eu<zl;eu++){var dh=is[eu],$l=[];if(Vr.push($l),dh.visible){var Dp=dh.interval;if(!(0>Dp)){for(var il=0;il<zl;il++)if(il!==eu){var Wf=is[il];if(Wf.visible&&dh.constructor===Wf.constructor){var ph=Wf.interval;ph>Dp&&$l.push(ph)}}}}}t.graduatedIntervals=Vr}var Ip=t.graduatedIntervals,Ic=t.O.s,hf=Ic.length,pc=0,tc=0,y0=$;t.graduatedMarks=[];for(var Uf,Lv=0;Lv<hf;Lv++){var mc=Ic[Lv];if(Uf=[],mc.visible&&mc!==c){var mh=Math.abs(mc.interval),$y=t.graduatedTickUnit;if(!(2>$y*mh*$/t.graduatedRange&&mc.graduatedSkip===null)){var dg=X[0][0],ud=0,ec=0;tc=$*mc.graduatedStart-1e-4,y0=$*mc.graduatedEnd+1e-4;var dm=$y*mh,gc=t.graduatedTickBase;if(gc<t.graduatedMin){var x0=(t.graduatedMin-gc)/dm;x0=x0%1===0?x0:Math.floor(x0+1),gc+=x0*dm}else gc>t.graduatedMin+dm&&(gc-=Math.floor((gc-t.graduatedMin)/dm)*dm);for(var Q1=Ip[Lv],jy=gc,jx=1e-6*t.graduatedMax,Td=1;gc<=t.graduatedMax+jx;Td++){t:{for(var Jd=Q1.length,pg=0;pg<Jd;pg++){var w0=(gc-t.graduatedTickBase)%(Q1[pg]*t.graduatedTickUnit),Tv=1e-6*t.graduatedTickUnit;if(w0<Tv&&w0>-Tv){var b0=!1;break t}}b0=!0}if(b0&&(gc>t.graduatedMax&&(gc=t.graduatedMax),mc.graduatedSkip===null||mc instanceof ao&&!mc.graduatedSkip(gc,mc)||mc instanceof pn&&!mc.graduatedSkip(gc,mc))&&(pc=(gc-t.graduatedMin)*$/t.graduatedRange,pc>$&&(pc=$),tc<=pc&&pc<=y0)){for(var _d=mt[ud][ec],Op=X[ud][ec];ud<X.length;){for(;pc>dg&&ec<X[ud].length-1;)ec++,_d=mt[ud][ec],Op=X[ud][ec],dg+=Op;if(pc<=dg)break;ud++,ec=0,_d=mt[ud][ec],Op=X[ud][ec],dg+=Op}var ic=A[ud],hd=ic[2*ec],tx=ic[2*ec+1],qd=(pc-(dg-Op))/Op,_v=new G(hd+(ic[2*ec+2]-hd)*qd+T/2-k.bounds.x,tx+(ic[2*ec+3]-tx)*qd+T/2-k.bounds.y);_v.scale(c.scale,c.scale);t:{var Zf=_d,pm=mt[ud];if(!(.5005>qd&&.4995<qd)){var cd=Zf;if(.5>qd?0<ec?cd=pm[ec-1]:xt.$(ic[0],ic[ic.length-2])&&xt.$(ic[1],ic[ic.length-1])&&(cd=pm[pm.length-1]):.5<qd&&(ec+1<pm.length?cd=pm[ec+1]:xt.$(ic[0],ic[ic.length-2])&&xt.$(ic[1],ic[ic.length-1])&&(cd=pm[0])),Zf!==cd){var mg=Math.abs(Zf-cd);if(180<mg&&(Zf<cd?Zf+=360:cd+=360,mg=Math.abs(Zf-cd)),5e-4>qd||.9995<qd){_d=(Zf+cd)/2%360;break t}if(10>mg){var Pv=1-Math.abs(.5-qd);_d=(Zf*Pv+cd*(1-Pv))%360;break t}}}_d=Zf}if(mc instanceof ao){var Tf="";mc.graduatedFunction!==null?(Tf=mc.graduatedFunction(gc,mc),Tf=Tf!=null?Tf.toString():""):Tf=(+gc.toFixed(2)).toString(),Tf!==""&&Uf.push({$l:_v,angle:_d,text:Tf})}else Uf.push({$l:_v,angle:_d})}gc=jy+Td*dm}}}t.graduatedMarks.push(Uf)}Ji(mt);var yu=t.graduatedMarks;if(yu!==null)for(var Ky=n.length,Eh=0;Eh<Ky;Eh++){var nl=n[Eh],Lh=yu[Eh];if(nl.visible&&nl!==c&&Lh.length!==0){if(nl instanceof pn){var Qd=t,Rp=s,mm=nl.alignmentFocus;mm.Mc()&&(mm=Ca);var Kx=nl.angle;nl.Kb=0,nl.measure(1/0,1/0,0,0),nl.Kb=Kx;var ex=nl.measuredBounds,Nv=ex.width,gm=ex.height,gg=Tt.allocAt(0,0,Nv,gm),nc=G.alloc();nc.xi(gg,mm),Tt.free(gg);for(var tp=-nc.x,Gf=-nc.y,Gc=new Tt,S0=Lh.length,Av=0;Av<S0;Av++)for(var M0=Lh[Av],ix=M0.$l.x,Dv=M0.$l.y,Ba=M0.angle,_f=0;4>_f;_f++){switch(_f){case 0:nc.h(tp,Gf);break;case 1:nc.h(tp+Nv,Gf);break;case 2:nc.h(tp,Gf+gm);break;case 3:nc.h(tp+Nv,Gf+gm)}nc.rotate(Ba+nl.angle),nc.offset(ix,Dv),Av===0&&_f===0?Gc.h(nc.x,nc.y,0,0):Gc.Ye(nc),nc.offset(-ix,-Dv),nc.rotate(-Ba-nl.angle)}G.free(nc),Qd.graduatedBounds!==null&&Qd.graduatedBounds.push(Gc),or(Rp,Gc.x,Gc.y,Gc.width,Gc.height)}else if(nl instanceof ao){var cf=t,nx=s;cf.temporaryTextBlock===null&&(cf.temporaryTextBlock=new ao);var vc=cf.temporaryTextBlock;$g(vc,nl);var Bp=nl.alignmentFocus;Bp.Mc()&&(Bp=Ca);for(var ff=nl.segmentOrientation,Iv=nl.segmentOffset,C0=new Tt,Hy=0,Ov=0,fd=0,vm=0,k0=0,Rv=Lh.length,Fp=0;Fp<Rv;Fp++){var Pd=Lh[Fp];Hy=Pd.$l.x,Ov=Pd.$l.y,fd=Pd.angle,k0=vm=nl.angle,ff!==eh&&(k0=ff===J0||ff===nv?fd+nl.angle:fd,vm=ge.computeAngle(ff,k0)),vc.Kb=vm,vc.text=Pd.text||"",vc.measure(1/0,1/0,0,0);var zp=vc.measuredBounds,ep=vc.naturalBounds,$p=ep.width,ym=ep.height,Xf=dn.alloc();Xf.reset(),Xf.translate(-zp.x,-zp.y),Xf.scale(vc.scale,vc.scale),Xf.rotate(k0,$p/2,ym/2),ff!==Mp&&ff!==q0||Xf.rotate(90,$p/2,ym/2),ff!==Xm&&ff!==Ym||Xf.rotate(-90,$p/2,ym/2),ff===rv&&(45<fd&&135>fd||225<fd&&315>fd)&&Xf.rotate(-fd,$p/2,ym/2);var vg=Tt.allocAt(0,0,$p,ym),jp=G.alloc();jp.xi(vg,Bp),Xf.Ga(jp);var yg=-jp.x,Hx=-jp.y,ip=G.alloc();ip.assign(Iv),isNaN(ip.x)&&(ip.x=$p/2+3),isNaN(ip.y)&&(ip.y=-(ym/2+3)),ip.rotate(fd),Hy+=ip.x+yg,Ov+=ip.y+Hx;var xm=new Tt(Hy,Ov,zp.width,zp.height),Vy=new Tt(zp.x,zp.y,zp.width,zp.height),Vx=new Tt(ep.x,ep.y,ep.width,ep.height);Pd.Sz=vm,Pd.lineCount=vc.lineCount,Pd.lines=[vc.Cb,vc.Ih,vc.df,vc.Le,vc.Qc,vc.Qb,vc.ze],Pd.actualBounds=xm,Pd.measuredBounds=Vy,Pd.naturalBounds=Vx,Fp===0?C0.assign(xm):C0.ed(xm),G.free(ip),G.free(jp),Tt.free(vg),dn.free(Xf)}cf.graduatedBounds!==null&&cf.graduatedBounds.push(C0),or(nx,C0.x,C0.y,C0.width,C0.height)}ba(nl,!1)}}},Rd.prototype.arrange=function(t,e,i){if(t.graduatedBounds!==null){var n=t.Pb(),s=t.graduatedMarks;if(s!==null){var a=t.graduatedBounds,l=0,c=a[l];l++,n!==null&&n.arrange(c.x-i.x,c.y-i.y,c.width,c.height);for(var p=e.length,m=0;m<p;m++){var v=e[m];c=s[m],v.visible&&v!==n&&c.length!==0&&(c=a[l],l++,v.arrange(c.x-i.x,c.y-i.y,c.width,c.height))}t.graduatedBounds=null}}},Rd.prototype.gc=function(t,e,i){var n=i.$i;i.$i=!0;var s=t.naturalBounds,a=s.width,l=s.height;s=e instanceof Fu,e.save(),e.beginPath(),e.rect(-1,-1,a+1,l+1),e.clip(),e.Se(),a=t.Pb(),a.gc(e,i),l=t.Df()*i.scale,0>=l&&(l=1);for(var c=a.actualBounds,p=t.O.s,m=t.graduatedMarks,v=p.length,w=0;w<v;w++){var C=p[w],k=m[w],T=k.length;if(C.visible&&C!==a&&k.length!==0){if(C instanceof pn){if(!(2>t.graduatedTickUnit*C.interval*a.geometry.flattenedTotalLength/t.graduatedRange*l&&C.graduatedSkip===null)){var A=C.measuredBounds,X=C.strokeWidth*C.scale,$=C.alignmentFocus;$.Mc()&&($=Ca);for(var J=0;J<T;J++){var et=k[J].$l,st=k[J].angle,mt=$,Pt=C.Ab;Pt.reset(),Pt.translate(et.x+c.x,et.y+c.y),Pt.rotate(st+C.angle,0,0),Pt.translate(-A.width*mt.x+mt.offsetX+X/2,-A.height*mt.y+mt.offsetY+X/2),Pt.scale(C.scale,C.scale),_c(C,!1),C.wh.set(C.Ab),C.Kk=C.scale,Gh(C,!1),C.gc(e,i),s&&(t.svg.appendChild(C.svg),C.svg=null),C.Ab.reset()}}}else if(C instanceof ao)for(t.temporaryTextBlock===null&&(t.temporaryTextBlock=new ao),A=t.temporaryTextBlock,$g(A,C),X=0;X<T;X++)$=k[X],$.actualBounds&&$.measuredBounds&&$.naturalBounds&&(A.ec=$.text||"",A.Kb=$.Sz||0,A.Gc=$.lineCount||0,J=$.lines,J!==void 0&&(A.Cb=J[0],A.Ih=J[1],A.df=J[2],A.Le=J[3],A.Qc=J[4],A.Qb=J[5],A.ze=J[6]),$.naturalBounds&&(A.dc=$.naturalBounds),$.actualBounds&&(J=$.actualBounds,A.arrange(J.x,J.y,J.width,J.height)),J=$.actualBounds,A.arrange(J.x,J.y,J.width,J.height),et=$.measuredBounds,$=$.naturalBounds,st=A.Ab,st.reset(),st.translate(J.x+c.x,J.y+c.y),st.translate(-et.x,-et.y),A.no(st,$.x,$.y,$.width,$.height),_c(A,!1),A.wh.set(A.Ab),A.Kk=A.scale,Gh(A,!1),A.Ng=C.part,A.Me=C.panel,A.gc(e,i),A.Me=null,A.Ng=null,s&&(t.svg.appendChild(A.svg),A.svg=null))}}i.$i=n,e.restore(),e.Vc(!0)};function ce(t,e){if(pt.call(this),this.na=null,t===void 0)this.na=ce.Position;else if(typeof t=="string"){var i=Mh.I(t);i!==null&&(this.na=i)}else t instanceof fl?this.na=t:t&&(this.na=ce.Position,e=t);this.na===null&&Mt("Panel type not specified or PanelLayout not loaded: "+t),this.l=this.l|4194304|(this.na===ce.Grid?1048576:0),this.O=new ue,this.yb=Ua,this.Tm=ds,this.Uf=on,this.$g=null,this.$e="",this.jg=new Tt(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=oi,this.jn=Zn,this.kn=Wa,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,e&&Object.assign(this,e)}li(ce,pt),ce.prototype.cloneProtected=function(t){pt.prototype.cloneProtected.call(this,t),t.na=this.na,t.yb=this.yb.J(),t.Tm=this.Tm.J(),t.Uf=this.Uf,t.$e=this.$e,t.jg.assign(this.jg),this.T!==null&&(t.T=this.T.copy(t)),t.xo=this.xo,t.jn=this.jn.J(),t.kn=this.kn.J(),this.ra!==null&&(t.ra=this.ra.copy()),t.ub=this.ub,t.zn=this.zn,t.Hh=this.Hh},ce.prototype.Af=function(t){pt.prototype.Af.call(this,t),t.O=this.O;for(var e=t.O.s,i=e.length,n=0;n<i;n++)e[n].Me=t;t.$g=null},ce.prototype.copy=function(){var t=pt.prototype.copy.call(this);if(t!==null){for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n].copy();s.wi(t),s.Ng=null;var a=t.O,l=a.count;if(a.Gb(l,s),a=t.part,a!==null){a.Rh=null,s.portId!==null&&a instanceof Ee&&(a.Te=!0);var c=t.diagram;c!==null&&c.undoManager.isUndoingRedoing||a.cb(qs,"elements",t,null,s,null,l)}}return t}return null},L=ce.prototype,L.toString=function(){return"Panel("+this.type.name+")#"+Io(this)},L.Pn=function(t){pt.prototype.Pn.call(this,t);for(var e=this.O.s,i=e.length,n=0;n<i;n++)e[n].Pn(t)},L.hh=function(t,e){if(this.na===ce.Grid)t.yc(),this.na.gc(this,t,e);else if(this.na===ce.Graduated)t.yc(),this.na.gc(this,t,e);else{if(this.na===ce.Table)if(t.yc(),t instanceof Fu){var i=t.yd;t.yd=Mg(t,"gojs-ts"),Cm(this,t),t.nh.pop(),t.yd=i}else Cm(this,t);(i=this.isClipping&&this.na===ce.Spot)&&t.save();for(var n=this.Pb(),s=this.O.s,a=s.length,l=0;l<a;l++){var c=s[l];i&&c===n&&(t.clipInsteadOfFill=!0),c.gc(t,e),i&&c===n&&(t.clipInsteadOfFill=!1)}i&&(t.restore(),t.Vc(!0))}};function Cm(t,e){e.lineCap="butt";var i=0<t.rowCount?t.rowDefs:null,n=0<t.columnCount?t.colDefs:null;i!==null&&pd(t,e,!0,i,!0),n!==null&&pd(t,e,!1,n,!0),i!==null&&km(t,e,!0,i),n!==null&&km(t,e,!1,n),i!==null&&pd(t,e,!0,i,!1),n!==null&&pd(t,e,!1,n,!1)}function km(t,e,i,n){for(var s=n.length,a=t.actualBounds,l=t.naturalBounds,c=!0,p=0;p<s;p++){var m=n[p];if(m!==void 0&&m.actual!==0)if(c)c=!1;else{if(i){if(m.position>l.height)continue}else if(m.position>l.width)continue;var v=m.separatorStrokeWidth;isNaN(v)&&(v=i?t.defaultRowSeparatorStrokeWidth:t.defaultColumnSeparatorStrokeWidth);var w=m.separatorStroke;if(w===null&&(w=i?t.defaultRowSeparatorStroke:t.defaultColumnSeparatorStroke),v!==0&&w!==null){Gs(t,e,w,!1,!1,l,a),w=!1;var C=m.separatorDashArray;C===null&&(C=i?t.defaultRowSeparatorDashArray:t.defaultColumnSeparatorDashArray),C!==null&&(w=!0,e.js(C,0)),e.beginPath(),C=m.position+v,i?C>l.height&&(v-=C-l.height):C>l.width&&(v-=C-l.width),m=m.position+v/2,e.lineWidth=v,v=t.yb,i?(m+=v.top,C=l.width-v.right,e.moveTo(v.left,m),e.lineTo(C,m)):(m+=v.left,C=l.height-v.bottom,e.moveTo(m,v.top),e.lineTo(m,C)),e.stroke(),e.Se(),w&&e.fs()}}}}function pd(t,e,i,n,s){for(var a=n.length,l=t.actualBounds,c=t.naturalBounds,p=Qy(t,!0),m=Qy(t,!1),v=0;v<a;v++){var w=n[v];if(w!==void 0&&w.background!==null&&w.coversSeparators!==s&&w.actual!==0){var C=i?l.height:l.width;if(!(w.position>C)){var k=w.Wc(),T=w.separatorStrokeWidth;isNaN(T)&&(T=i?t.defaultRowSeparatorStrokeWidth:t.defaultColumnSeparatorStrokeWidth);var A=w.separatorStroke;A===null&&(A=i?t.defaultRowSeparatorStroke:t.defaultColumnSeparatorStroke),(A===null||w.index===(i?p:m))&&(T=0),k-=T,T=w.position+T,k+=w.actual,T+k>C&&(k=C-T),0>=k||(C=t.yb,Gs(t,e,w.background,!0,!1,c,l),i?e.fillRect(C.left,T+C.top,l.width-(C.left+C.right),k):e.fillRect(T+C.left,C.top,k,l.height-(C.top+C.bottom)))}}}}function Qy(t,e){for(var i=e?t.rowCount:t.columnCount,n=0;n<i;n++){var s=e?t.rowDefs[n]:t.colDefs[n];if(s!==void 0)return s.index}return 0}function Zv(t){return t==="LineV"||t==="BarV"}L.lv=function(){for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].lv();this.Uc=!0},L.kk=function(t,e,i){if(!pt.prototype.kk.call(this,t,e,i))return!1;if(this.type===ce.Table)i=this.svg.getElementsByClassName("gojs-ts"),i=i.length!==0?i[0]:null,i!==null&&(i.innerHTML=""),t.yd=i,Cm(this,t),t.yd=null;else if(this.na===ce.Grid||this.na===ce.Graduated)return this.svg.innerHTML="",this.svg.remove(),!1;i=this.O.s;for(var n=i.length,s=0;s<n;s++)i[s].gc(t,e);return!0},L.nk=function(){return!0},L.$o=function(t,e,i,n){if(!this.isClipping)if(this.Dd()&&t.bk!==null){t=t.bk,e=this.O.s;for(var s=0,a=0,l=0;l<e.length;l++)if(e[l].Ed()){var c=e[l].actualBounds;s=l===0?c.x:Math.min(c.x,s),a=l===0?c.y:Math.min(c.y,a)}n.setAttributeNS(null,"clip-path","path('M "+(t.x-i.x-s)+","+(t.y-i.y-a)+" l "+t.width+" 0 l 0 "+t.height+" l -"+t.width+" 0 z')")}else pt.prototype.$o.call(this,t,e,i,n)},L.Sj=function(t,e,i,n,s){var a=this.se(),l=this.transform,c=1/(l.m11*l.m22-l.m12*l.m21),p=l.m22*c,m=-l.m12*c,v=-l.m21*c,w=l.m11*c,C=c*(l.m21*l.dy-l.m22*l.dx),k=c*(l.m12*l.dx-l.m11*l.dy);if(this.areaBackground!==null)return l=this.actualBounds,xt.Ff(l.left,l.top,l.right,l.bottom,t,e,i,n,s);if(this.background!==null)return a=t*p+e*v+C,c=t*m+e*w+k,t=i*p+n*v+C,p=i*m+n*w+k,s.h(0,0),i=this.naturalBounds,a=xt.Ff(0,0,i.width,i.height,a,c,t,p,s),s.transform(l),a;a||(p=1,v=m=0,w=1,k=C=0),c=t*p+e*v+C,t=t*m+e*w+k,p=i*p+n*v+C,i=i*m+n*w+k,s.h(p,i),n=(p-c)*(p-c)+(i-t)*(i-t),m=!1,w=this.O.s,k=w.length,v=G.alloc(),C=null,e=1/0;var T=null,A=this.isClipping&&this.na===ce.Spot;A&&(T=G.alloc(),C=this.Pb(),(m=C.Sj(c,t,p,i,T))&&(e=(c-T.x)*(c-T.x)+(t-T.y)*(t-T.y)));for(var X=0;X<k;X++){var $=w[X];$.visible&&$!==C&&$.Sj(c,t,p,i,v)&&(m=!0,$=(c-v.x)*(c-v.x)+(t-v.y)*(t-v.y),$<n&&(n=$,s.set(v)))}return A&&(e>n&&s.set(T),G.free(T)),G.free(v),a&&s.transform(l),m},L.Gj=function(){for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].Gj();pt.prototype.Gj.call(this)},L.v=function(t){if(!lh(this)){pt.prototype.v.call(this,t),t=null,(this.na===ce.Auto||this.na===ce.Link)&&(t=this.Pb());for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n];if((s===t||s.isPanelMain)&&s.v(!0),!s.desiredSize.w()){var a=Qu(s,!1);(s instanceof Wu||s instanceof ce||s instanceof ao||a!==Jt)&&s.v(!0)}}}},L.Uj=function(){if(!lh(this)){ba(this,!0),au(this,!0);for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].Uj()}},L.Uk=function(){if(!(this.l&2048)){_c(this,!0),Gh(this,!0);for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].Wu()}},L.Wu=function(){Gh(this,!0);for(var t=this.O.s,e=t.length,i=0;i<e;i++)t[i].Wu()},L.Wl=function(t,e,i,n){var s=this.jg;s.h(0,0,0,0);var a=this.desiredSize,l=this.minSize;i===void 0&&(i=l.width,n=l.height),i=Math.max(i,l.width),n=Math.max(n,l.height);var c=this.maxSize;isNaN(a.width)||(t=Math.min(a.width,c.width)),isNaN(a.height)||(e=Math.min(a.height,c.height)),t=Math.max(i,t),e=Math.max(n,e);var p=this.yb;t=Math.max(t-p.left-p.right,0),e=Math.max(e-p.top-p.bottom,0);var m=this.O.s;m.length!==0&&this.na.measure(this,t,e,m,s,i,n),t=s.width+p.left+p.right,p=s.height+p.top+p.bottom,isFinite(a.width)&&(t=a.width),isFinite(a.height)&&(p=a.height),t=Math.min(c.width,t),p=Math.min(c.height,p),t=Math.max(l.width,t),p=Math.max(l.height,p),t=Math.max(i,t),p=Math.max(n,p),yn(s,t,p),yn(this.naturalBounds,t,p),this.Ge(0,0,t,p)},L.Pb=function(){if(this.$g===null){var t=this.O.s,e=t.length;if(e===0)return null;for(var i=0;i<e;i++){var n=t[i];if(n.isPanelMain===!0)return this.$g=n}this.$g=t[0]}return this.$g};function rf(t){return t.part!==null?t.part.locationObject:null}L.eh=function(t,e,i,n){var s=this.O.s;if(this.actualBounds.h(t,e,i,n),s.length!==0){if(!this.desiredSize.w()){t=Qu(this,!0);var a=this.measuredBounds;e=a.width,a=a.height;var l=this.Kg,c=l.left+l.right;switch(l=l.top+l.bottom,e===i&&a===n&&(t=Jt),t){case Jt:(e>i||a>n)&&(this.v(),this.measure(e>i?i:e,a>n?n:a,0,0));break;case oe:this.v(!0),this.measure(i+c,n+l,0,0);break;case mi:this.v(!0),this.measure(i+c,a+l,0,0);break;case Ii:this.v(!0),this.measure(e+c,n+l,0,0)}}this.na.arrange(this,s,this.jg)}},L.gh=function(t){var e=this.naturalBounds,i=rf(this);if(eo(0,0,e.width,e.height,t.x,t.y)){e=this.O.s;for(var n=e.length,s=G.allocAt(0,0);n--;){var a=e[n];if((a.visible||a===i)&&(ut(s.set(t),a.transform),a.ca(s)))return G.free(s),!0}return G.free(s),!(this.Ma===null&&this.areaBackground===null)}return!1},L.ks=function(t){if(this.bindingId===t)return this;for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n].ks(t);if(s!==null)return s}return null},L.qm=function(t,e){if(e(this,t),t instanceof ce){t=t.O.s;for(var i=t.length,n=0;n<i;n++)this.qm(t[n],e)}};function id(t,e){nd(t,t,e)}function nd(t,e,i){i(e),e=e.O.s;for(var n=e.length,s=0;s<n;s++){var a=e[s];a instanceof ce&&nd(t,a,i)}}function cx(t,e){Yp(t,t,e)}function Yp(t,e,i){if(i(e),e instanceof ce){e=e.O.s;for(var n=e.length,s=0;s<n;s++)Yp(t,e[s],i)}}L.Nl=function(t){return Gv(this,this,t)};function Gv(t,e,i){if(i(e))return e;if(e instanceof ce){e=e.O.s;for(var n=e.length,s=0;s<n;s++){var a=Gv(t,e[s],i);if(a!==null)return a}}return null}L.fb=function(t){if(this.name===t)return this;var e=this.O.s,i=e.length;this.Hh===null&&this.itemTemplateMap===null||(i=cp(this));for(var n=0;n<i;n++){var s=e[n];if(s instanceof ce){var a=s.fb(t);if(a!==null)return a}if(s.name===t)return s}return null};function t1(t){t=t.O.s;for(var e=t.length,i=0,n=0;n<e;n++){var s=t[n];s instanceof ce?i=Math.max(i,t1(s)):s instanceof pn&&(i=Math.max(i,s.ig/2*s.strokeMiterLimit*s.Df()))}return i}L.se=function(){return!(this.type===ce.TableRow||this.type===ce.TableColumn)};function md(t){return t.type===ce.TableRow||t.type===ce.TableColumn}L.ic=function(t,e,i){if(this.pickable===!1||(e===void 0&&(e=null),i===void 0&&(i=null),Vu(this)))return null;var n=this.naturalBounds,s=1/this.Df(),a=this.se(),l=a?t:ut(G.allocAt(t.x,t.y),this.transform),c=this.diagram,p=10,m=5;if(c!==null&&(p=c.Ql("extraTouchArea"),m=p/2),eo(-(m*s),-(m*s),n.width+p*s,n.height+p*s,l.x,l.y)){if(!this.isAtomic){s=this.O.s;var v=s.length;if(c=G.alloc(),m=(p=this.isClipping&&this.na===ce.Spot)?this.Pb():null,p&&(m.se()?ut(c.set(t),m.transform):c.set(t),!m.ca(c)))return G.free(c),a||G.free(l),null;for(var w=rf(this);v--;){var C=s[v];if((C.visible||C===w)&&(C.se()?ut(c.set(t),C.transform):c.set(t),!p||C!==m)){var k=null;if(C instanceof ce?k=C.ic(c,e,i):C.pickable===!0&&C.ca(c)&&(k=C),k!==null&&(e!==null&&(k=e(k)),k!==null&&(i===null||i(k))))return G.free(c),a||G.free(l),k}}G.free(c)}return this.background===null&&this.areaBackground===null?(a||G.free(l),null):(t=eo(0,0,n.width,n.height,l.x,l.y)?this:null,a||G.free(l),t)}return a||G.free(l),null},L.ji=function(t,e,i,n){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);var s=this.naturalBounds,a=this.se(),l=a?t:ut(G.allocAt(t.x,t.y),this.transform);if(s=eo(0,0,s.width,s.height,l.x,l.y),md(this)||s){if(!this.isAtomic){for(var c=this.O.s,p=c.length,m=G.alloc(),v=rf(this);p--;){var w=c[p];if(w.visible||w===v){w.se()?ut(m.set(t),w.transform):m.set(t);var C=w;w=w instanceof ce?w:null,(w!==null?w.ji(m,e,i,n):C.ca(m))&&C.pickable!==!1&&(e!==null&&(C=e(C)),C===null||i!==null&&!i(C)||n.add(C))}}G.free(m)}return a||G.free(l),s&&(this.background!==null||this.areaBackground!==null)}return a||G.free(l),!1},L.Cf=function(t,e,i,n,s,a){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);var l=a;if(a===void 0&&(l=dn.alloc(),l.reset()),l.multiply(this.transform),this.fh(t,l))return Ig(this,e,i,s),a===void 0&&dn.free(l),!0;if(this.Yc(t,l)){if(!this.isAtomic)for(var c=rf(this),p=this.O.s,m=p.length;m--;){var v=p[m];if(v.visible||v===c){var w=v.actualBounds,C=this.naturalBounds;w.x>C.width||w.y>C.height||0>w.x+w.width||0>w.y+w.height||(w=v,v=v instanceof ce?v:null,C=dn.alloc(),C.set(l),(v!==null?v.Cf(t,e,i,n,s,C):xl(w,t,n,C))&&(e!==null&&(w=e(w)),w===null||i!==null&&!i(w)||s.add(w)),dn.free(C))}}return a===void 0&&dn.free(l),n}return a===void 0&&dn.free(l),!1};function Ig(t,e,i,n){for(var s=t.O.s,a=s.length;a--;){var l=s[a];if(l.visible){var c=l.actualBounds,p=t.naturalBounds;c.x>p.width||c.y>p.height||0>c.x+c.width||0>c.y+c.height||(l instanceof ce&&Ig(l,e,i,n),e!==null&&(l=e(l)),l===null||i!==null&&!i(l)||n.add(l))}}}L.og=function(t,e,i,n,s,a){if(this.pickable===!1)return!1;i===void 0&&(i=null),n===void 0&&(n=null);var l=this.naturalBounds,c=this.se(),p=c?t:ut(G.allocAt(t.x,t.y),this.transform),m=c?e:ut(G.allocAt(e.x,e.y),this.transform),v=p.Bf(m),w=0<p.x&&p.x<l.width&&0<p.y&&p.y<l.height||re(p.x,p.y,0,0,0,l.height)<=v||re(p.x,p.y,0,l.height,l.width,l.height)<=v||re(p.x,p.y,l.width,l.height,l.width,0)<=v||re(p.x,p.y,l.width,0,0,0)<=v;if(l=p.zd(0,0)<=v&&p.zd(0,l.height)<=v&&p.zd(l.width,0)<=v&&p.zd(l.width,l.height)<=v,c||(G.free(p),G.free(m)),w){if(!this.isAtomic){p=G.alloc(),m=G.alloc(),v=rf(this);for(var C=this.O.s,k=C.length;k--;){var T=C[k];if(T.visible||T===v){var A=T.actualBounds,X=this.naturalBounds;(!c||!(A.x>X.width||A.y>X.height||0>A.x+A.width||0>A.y+A.height))&&(T.se()?(A=T.transform,ut(p.set(t),A),ut(m.set(e),A)):(p.set(t),m.set(e)),A=T,T=T instanceof ce?T:null,(T!==null?T.og(p,m,i,n,s,a):A.tx(p,m,s))&&(i!==null&&(A=i(A)),A===null||n!==null&&!n(A)||a.add(A)))}}G.free(p),G.free(m)}return s?w:l}return!1};function Xv(t){var e=null;return t instanceof pn&&(e=t.spot1,e===ds&&(e=null),t=t.geometry,t!==null&&e===null&&(e=t.spot1)),e===null&&(e=Fo),e}function Yv(t){var e=null;return t instanceof pn&&(e=t.spot2,e===ds&&(e=null),t=t.geometry,t!==null&&e===null&&(e=t.spot2)),e===null&&(e=uu),e}L.add=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];for(i=0;i<e.length;i++)this.Gb(this.O.count,e[i]);return this},L.M=function(t){return this.O.M(t)},L.Gb=function(t,e){e instanceof bi&&Mt("Cannot add a Part to a Panel: "+e+"; use a Panel instead"),(this===e||this.rg(e))&&(this===e&&Mt("Cannot make a Panel contain itself: "+this.toString()),Mt("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+e.toString()));var i=e.panel;if(i!==null&&i!==this&&Mt("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+e.toString()+", already contained by "+i.toString()+", cannot be shared by this Panel: "+this.toString()),this.na!==ce.Grid||e instanceof pn||Mt("Can only add Shapes to a Grid Panel, not: "+e),this.na!==ce.Graduated||e instanceof pn||e instanceof ao||Mt("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+e),e.wi(this),e.Ng=null,this.itemArray!==null){var n=e.data;n!==null&&typeof n=="object"&&(this.ge===null&&(this.ge=new ci),this.ge.add(n,e))}var s=this.O;if(n=-1,i===this){for(var a=-1,l=this.O.s,c=l.length,p=0;p<c;p++)if(l[p]===e){a=p;break}if(a!==-1){if(a===t||a+1>=s.count&&t>=s.count)return;s.mb(a),n=a}else Mt("element "+e.toString()+" has panel "+i.toString()+" but is not contained by it.")}(0>t||t>s.count)&&(t=s.count),s.Gb(t,e),(t===0||e.isPanelMain)&&(this.$g=null),lh(this)||this.v(),e.v(!1),e.portId!==null?this.Te=!0:e instanceof ce&&e.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Og(this,e,!1),i=this.part,i!==null&&(i.Rh=null,i.ag=NaN,this.Te&&i instanceof Ee&&(i.Te=!0),i.Te&&i instanceof Ee&&(i.wc=null),s=this.diagram,s!==null&&s.undoManager.isUndoingRedoing||(n!==-1&&i.cb(aa,"elements",this,e,null,n,null),i.cb(qs,"elements",this,null,e,null,t)))};function Em(t,e){t.l=e?t.l|16777216:t.l&-16777217}L.remove=function(t){for(var e=this.O.s,i=e.length,n=-1,s=0;s<i;s++)if(e[s]===t){n=s;break}n!==-1&&this.pc(n,!0)},L.mb=function(t){0<=t&&this.pc(t,!0)},L.pc=function(t,e){var i=this.O,n=i.M(t);if(n.Ng=null,n.wi(null),this.ge!==null){var s=n.data;typeof s=="object"&&this.ge.remove(s)}i.mb(t),ba(this,!1),this.v(),this.$g===n&&(this.$g=null),this.graduatedIntervals=null;var a=this.part;a!==null&&(a.Rh=null,a.ag=NaN,a.Wb(),a instanceof Ee&&(n instanceof ce?n.qm(n,function(l,c){uy(a,c,e)}):uy(a,n,e)),i=this.diagram,i!==null&&i.undoManager.isUndoingRedoing||a.cb(aa,"elements",this,n,null,t,null))},L.Fb=function(t){0>t&&Re(t,">= 0",ce,"getRowDefinition:idx"),t=Math.round(t);var e=this.rowDefs;if(e[t]===void 0){var i=new tl;i.wi(this),i.isRow=!0,i.index=t,e[t]=i,this.cb(qs,"rowdefs",this,null,i,null,t)}return e[t]},L.oA=function(t){if(0>t&&Re(t,">= 0",ce,"removeRowDefinition:idx"),this.rowCount!==0){t=Math.round(t);var e=this.rowDefs,i=e[t];if(i){e[t]=void 0;for(var n=e.length-1;0<=n&&e[n--]===void 0;)e.length--;this.cb(aa,"rowdefs",this,i,null,t,null),this.v()}}};function e1(t,e,i){var n=t.rowDefs;if(!(0>e)){if(n[e]=i instanceof tl?i:void 0,!i)for(e=n.length-1;0<=e&&n[e--]===void 0;)n.length--;t.v()}}L.Eb=function(t){0>t&&Re(t,">= 0",ce,"getColumnDefinition:idx"),t=Math.round(t);var e=this.colDefs;if(e[t]===void 0){var i=new tl;i.wi(this),i.isRow=!1,i.index=t,e[t]=i,this.cb(qs,"coldefs",this,null,i,null,t)}return e[t]},L.jA=function(t){if(0>t&&Re(t,">= 0",ce,"removeColumnDefinition:idx"),this.columnCount!==0){t=Math.round(t);var e=this.colDefs,i=e[t];if(i){e[t]=void 0;for(var n=e.length-1;0<=n&&e[n--]===void 0;)e.length--;this.cb(aa,"coldefs",this,i,null,t,null),this.v()}}};function i1(t,e,i){var n=t.colDefs;if(!(0>e)){if(n[e]=i instanceof tl?i:void 0,!i)for(e=n.length-1;0<=e&&n[e--]===void 0;)n.length--;t.v()}}L.Gy=function(t){var e=null;return t.isRow?e=this.Fb(t.index):t.isRow||(e=this.Eb(t.index)),e&&Jp(e,t),this},L.Hy=function(t,e){return(t=this.Fb(t))&&Jp(t,new tl(e)),this},L.By=function(t,e){return(t=this.Eb(t))&&Jp(t,new tl(e)),this},L.nz=function(t){if(0>t||this.type!==ce.Table||this.rowCount===0)return-1;for(var e=0,i=this.rowDefs,n=i.length,s=this.topIndex;s<n;s++){var a=i[s];if(a!==void 0&&(e+=a.total,t<e))break}return s},L.fz=function(t){if(0>t||this.type!==ce.Table||this.columnCount===0)return-1;for(var e=0,i=this.colDefs,n=i.length,s=this.leftIndex;s<n;s++){var a=i[s];if(a!==void 0&&(e+=a.total,t<e))break}return s},L.Fz=function(t,e){if(e===void 0&&(e=new G(NaN,NaN)),this.type!==ce.Graduated)return e.h(NaN,NaN),e;t=Math.min(Math.max(t,this.graduatedMin),this.graduatedMax);var i=this.Pb();return i.geometry.Pu((t-this.graduatedMin)/this.graduatedRange,e),i.transform.Ga(e)},L.Gz=function(t){if(this.type!==ce.Graduated)return NaN;var e=this.Pb();return e.transform.Cd(t),e.geometry.xx(t)*this.graduatedRange+this.graduatedMin};function n1(t){return t=t.allBindings,t!==null&&t._isFrozen}function Sh(t){var e=t.allBindings;if(e===null)t.data!==null&&Mt("Template cannot have .data be non-null: "+t),t.allBindings=e=new ue;else if(e._isFrozen)return;var i=new ue;Em(t,!1),t.qm(t,function(m,v){v.th();var w=v.localBindings;if(w!==null)for(np(v,!1),w=w.iterator;w.next();){var C=w.value;C.mode===ig&&np(v,!0);var k=C.sourceName;k!==null&&(k==="/"&&Em(m,!0),k=_y(C,m,v),k!==null&&(i.add(k),k.srcBindings===null&&(k.srcBindings=new ue),k.srcBindings.add(C))),e.add(C)}if(v instanceof ce&&v.type===ce.Table){if(0<v.rowCount){for(m=v.rowDefs,w=m.length,C=0;C<w;C++)if(k=m[C],k!==void 0&&k.be!==null)for(var T=k.be.iterator;T.next();){var A=T.value;A.xd=k,A.to=2,A.wl=k.index,e.add(A)}}if(0<v.columnCount){for(v=v.colDefs,m=v.length,w=0;w<m;w++)if(C=v[w],C!==void 0&&C.be!==null)for(k=C.be.iterator;k.next();)T=k.value,T.xd=C,T.to=1,T.wl=C.index,e.add(T)}}});for(var n=i.iterator;n.next();){var s=n.value;if(s.srcBindings!==null){np(s,!0);for(var a=s.srcBindings.iterator;a.next();){var l=a.value;s.localBindings===null&&(s.localBindings=new ue),s.localBindings.add(l)}}s.srcBindings=null}for(n=e.iterator;n.next();)if(s=n.value,a=s.xd,a!==null){s.xd=null;var c=s.targetProperty,p=c.indexOf(".");0<p&&a instanceof ce&&(l=c.substring(0,p),c=c.substr(p+1),p=a.fb(l),p!==null?(a=p,s.targetProperty=c):_i('Warning: unable to find GraphObject named "'+l+'" for Binding: '+s.toString())),a instanceof tl?(l=Io(a.panel),s.Ai=l===void 0?-1:l,a.panel.bindingId=s.Ai):a instanceof pt?(l=Io(a),s.Ai=l===void 0?-1:l,a.bindingId=s.Ai):Mt("Unknown type of binding target: "+a)}e.freeze(),t instanceof bi&&t.Zc()&&t.Va()}L.Uy=function(t){t===void 0&&(t=!1);var e=this.copy();return cx(e,function(i){i instanceof ce&&(i.allBindings=null,i.ub=null);var n=i.localBindings;n!==null&&(i.localBindings=null,n.each(function(s){i.bind(s.copy())})),n=i.animationTriggers,n!==null&&(i.animationTriggers=null,n.each(function(s){i.Jv(s.value.copy())}))}),t&&Sh(e),e},L.La=function(t){var e=this.allBindings;if(e!==null)for(t===void 0&&(t=""),e=e.iterator;e.next();){var i=e.value,n=i.sourceProperty;if((t===""||n===""||n===t)&&(n=i.targetProperty,i.converter!==null||n!=="")){n=this.data;var s=i.sourceName;if(s!==null){if(s==="")n=this;else if(s==="/")n=this;else if(s===".")n=this;else if(s==="..")n=this;else if(n=this.fb(s),n===null)continue}else if(i.isToModel)if(n=this.diagram,n!==null)n=n.model.modelData;else continue;var a=this,l=i.Ai;if(l!==-1){if(a=this.ks(l),a===null)continue}else i.xd!==null&&(a=i.xd);if(s==="/"?n=a.part:s==="."?n=a:s===".."&&(n=a.panel),s=i.to,s!==0){if(!(a instanceof ce))continue;s===1?a=a.Eb(i.wl):s===2&&(a=a.Fb(i.wl))}a!==void 0&&i.Mv(a,n)}}},L.sx=function(t){return t==null||this.ge===null?null:this.ge.I(t)};function r1(t,e){t=t.O.s;for(var i=t.length,n=e.length,s=0,a=null;s<i&&(a=t[s],!(a instanceof ce&&a.data!==null));)s++,a=t[s];if(i-s!==n)return!0;if(a===null)return 0<n;for(var l=0;s<i&&l<n;){if(a=t[s],!(a instanceof ce)||a.data!==e[l])return!0;s++,l++}return!1}function cp(t){if(t.type===ce.Spot||t.type===ce.Auto)return Math.min(t.O.length,1);if(t.type===ce.Link){t=t.O;for(var e=t.length,i=0;i<e;i++){var n=t.M(i);if(!(n instanceof pn&&n.isPanelMain))break}return i}return t.type===ce.Table&&0<t.O.length&&(t=t.O.M(0),t.isPanelMain&&t instanceof ce&&md(t))?1:0}L.mv=function(){for(var t=cp(this);this.O.length>t;)this.pc(this.O.length-1,!1);O0(this,this.itemArray)};function O0(t,e){var i=cp(t);if(e===null||e.length===0)for(;t.O.length>i;)t.pc(t.O.length-1,!1);else if(t.O.length<=i){i=e.length;for(var n=0;n<i;n++)Lm(t,e[n],n,!0)}else{n=i;for(var s=0;s<e.length;s++,n++){var a=e[s],l=n<t.O.length?t.O.M(n):null;if(l instanceof ce){if(l.data!==a){var c=R0(t,l.data),p=R0(t,a),m=p!==c;m||(c=Tm(t,c),m=Tm(t,p)!==c),m?(t.pc(n,!1),Lm(t,a,s,!1)):l.data=a}}else Lm(t,a,s,!1)}for(;n<t.O.length;)t.pc(n,!1);t.$g=null,fp(t,i,0),lh(t)||t.v(),t.graduatedIntervals=null,t.If()||Og(t,t,!1),e=t.part,e!==null&&(e.Rh=null,e.ag=NaN,t.Te&&e instanceof Ee&&(e.Te=!0),e.Te&&e instanceof Ee&&(e.wc=null))}}function Lm(t,e,i,n){if(!(e==null||0>i)){var s=R0(t,e);if(s=Tm(t,s),s!==null){if(Sh(s),s=s.copy(),s.l&16777216){var a=t.ih();a!==null&&Em(a,!0)}typeof e=="object"&&(t.ge===null&&(t.ge=new ci),t.ge.add(e,s)),a=i+cp(t),t.Gb(a,s),n&&(s.ub=e,fp(t,a,i),s.ub=null),s.data=e}}}function fp(t,e,i){for(t=t.O;e<t.length;){var n=t.M(e);if(n instanceof ce){var s=e,a=i;n.type===ce.TableRow?n.row=s:n.type===ce.TableColumn&&(n.column=s),n.itemIndex=a}e++,i++}}function R0(t,e){if(e===null)return"";if(t=t.itemCategoryProperty,typeof t=="function")t=t(e);else if(typeof t=="string"&&typeof e=="object"){if(t==="")return"";t=Ra(e,t)}else return"";if(t===void 0)return"";if(typeof t=="string")return t;Mt("Panel.getCategoryForItemData found a non-string category for "+e+": "+t)}function Tm(t,e){var i=t.itemTemplateMap,n=null;return i!==null&&(n=i.I(e)),n===null&&(i!==null&&(n=i.I("")),n===null&&(Rg||(Rg=!0,_i('No item template Panel found for category "'+e+'" on '+t),_i(" Using default item template."),t=new ce,e=new ao,e.bind(new lo("text","",zr)),t.add(e),_m=t),n=_m)),n}function Og(t,e,i){var n=e.enabledChanged;if(n!==null&&n(e,i),e instanceof ce){e=e.O.s,n=e.length;for(var s=0;s<n;s++){var a=e[s];i&&a instanceof ce&&!a.isEnabled||Og(t,a,i)}}}function yf(t,e){e.name=t,Mh.add(t,e)}St.Object.defineProperties(ce.prototype,{type:{get:function(){return this.na},set:function(t){var e=this.na;e!==t&&(this.na=t,this.isAtomic=this.na===ce.Grid,this.v(),this.g("type",e,t))}},elements:{get:function(){return this.O.iterator}},naturalBounds:{get:function(){return this.dc}},padding:{get:function(){return this.yb},set:function(t){typeof t=="number"?(0>t&&Re(t,">= 0",ce,"padding"),t=new Ai(t)):(0>t.left&&Re(t.left,">= 0",ce,"padding:value.left"),0>t.right&&Re(t.right,">= 0",ce,"padding:value.right"),0>t.top&&Re(t.top,">= 0",ce,"padding:value.top"),0>t.bottom&&Re(t.bottom,">= 0",ce,"padding:value.bottom"));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.v(),this.g("padding",e,t))}},defaultAlignment:{get:function(){return this.Tm},set:function(t){var e=this.Tm;e.D(t)||(this.Tm=t=t.J(),this.v(),this.g("defaultAlignment",e,t))}},defaultStretch:{get:function(){return this.Uf},set:function(t){var e=this.Uf;e!==t&&(this.Uf=t,this.v(),this.g("defaultStretch",e,t))}},defaultSeparatorPadding:{get:function(){return this.T!==null?this.T.Qp:Ua},set:function(t){typeof t=="number"&&(t=new Ai(t));var e=this.defaultSeparatorPadding;e.D(t)||(t=t.J(),this.T===null&&(this.T=new uc),this.T.Qp=t,this.v(),this.g("defaultSeparatorPadding",e,t))}},defaultRowSeparatorStroke:{get:function(){return this.T!==null?this.T.ia:null},set:function(t){var e=this.defaultRowSeparatorStroke;e!==t&&(t===null||typeof t=="string"||t instanceof Br)&&(t instanceof Br&&t.freeze(),this.T===null&&(this.T=new uc),this.T.ia=t,this.N(),this.g("defaultRowSeparatorStroke",e,t))}},defaultRowSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.Ha:1},set:function(t){var e=this.defaultRowSeparatorStrokeWidth;e!==t&&isFinite(t)&&0<=t&&(this.T===null&&(this.T=new uc),this.T.Ha=t,this.v(),this.g("defaultRowSeparatorStrokeWidth",e,t))}},defaultRowSeparatorDashArray:{get:function(){return this.T!==null?this.T.V:null},set:function(t){var e=this.defaultRowSeparatorDashArray;if(e!==t){if(t!==null){for(var i=t.length,n=0,s=0;s<i;s++){var a=t[s];typeof a=="number"&&0<=a&&isFinite(a)||Mt("defaultRowSeparatorDashArray value "+a+" at index "+s+" must be a positive number or zero."),n+=a}if(n===0){if(e===null)return;t=null}}this.T===null&&(this.T=new uc),this.T.V=t,this.N(),this.g("defaultRowSeparatorDashArray",e,t)}}},defaultColumnSeparatorStroke:{get:function(){return this.T!==null?this.T.u:null},set:function(t){var e=this.defaultColumnSeparatorStroke;e!==t&&(t===null||typeof t=="string"||t instanceof Br)&&(t instanceof Br&&t.freeze(),this.T===null&&(this.T=new uc),this.T.u=t,this.N(),this.g("defaultColumnSeparatorStroke",e,t))}},defaultColumnSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.F:1},set:function(t){var e=this.defaultColumnSeparatorStrokeWidth;e!==t&&isFinite(t)&&0<=t&&(this.T===null&&(this.T=new uc),this.T.F=t,this.v(),this.g("defaultColumnSeparatorStrokeWidth",e,t))}},defaultColumnSeparatorDashArray:{get:function(){return this.T!==null?this.T.o:null},set:function(t){var e=this.defaultColumnSeparatorDashArray;if(e!==t){if(t!==null){for(var i=t.length,n=0,s=0;s<i;s++){var a=t[s];typeof a=="number"&&0<=a&&isFinite(a)||Mt("defaultColumnSeparatorDashArray value "+a+" at index "+s+" must be a positive number or zero."),n+=a}if(n===0){if(e===null)return;t=null}}this.T===null&&(this.T=new uc),this.T.o=t,this.N(),this.g("defaultColumnSeparatorDashArray",e,t)}}},inRowsCols:{get:function(){return this.T!==null?this.T.nb:null},set:function(t){this.T===null&&(this.T=new uc),this.T.nb=t}},viewboxStretch:{get:function(){return this.xo},set:function(t){var e=this.xo;e!==t&&(this.xo=t,this.v(),this.g("viewboxStretch",e,t))}},gridCellSize:{get:function(){return this.jn},set:function(t){var e=this.jn;if(!e.D(t)){t.w()&&t.width!==0&&t.height!==0||Mt("Invalid Panel.gridCellSize: "+t),this.jn=t.J();var i=this.diagram;i!==null&&this===i.grid&&Bs(i),this.N(),this.g("gridCellSize",e,t)}}},gridOrigin:{get:function(){return this.kn},set:function(t){var e=this.kn;if(!e.D(t)){t.w()||Mt("Invalid Panel.gridOrigin: "+t),this.kn=t.J();var i=this.diagram;i!==null&&this===i.grid&&Bs(i),this.N(),this.g("gridOrigin",e,t)}}},graduatedMin:{get:function(){return this.ra!==null?this.ra.lq:0},set:function(t){var e=this.graduatedMin;e!==t&&(this.ra===null&&(this.ra=new rd),this.ra.lq=t,this.v(),this.g("graduatedMin",e,t),Jl(this)&&(t=this.part,t!==null&&rs(this,t,"graduatedRange")))}},graduatedMax:{get:function(){return this.ra!==null?this.ra.F:100},set:function(t){var e=this.graduatedMax;e!==t&&(this.ra===null&&(this.ra=new rd),this.ra.F=t,this.v(),this.g("graduatedMax",e,t),Jl(this)&&(t=this.part,t!==null&&rs(this,t,"graduatedRange")))}},graduatedRange:{get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{get:function(){return this.ra!==null?this.ra.ia:10},set:function(t){var e=this.graduatedTickUnit;e!==t&&0<t&&(this.ra===null&&(this.ra=new rd),this.ra.ia=t,this.v(),this.g("graduatedTickUnit",e,t))}},graduatedTickBase:{get:function(){return this.ra!==null?this.ra.V:0},set:function(t){var e=this.graduatedTickBase;e!==t&&(this.ra===null&&(this.ra=new rd),this.ra.V=t,this.v(),this.g("graduatedTickBase",e,t))}},graduatedMarks:{get:function(){return this.ra!==null?this.ra.u:null},set:function(t){this.ra!==null?this.ra.u=t:t!==null&&(this.ra=new rd,this.ra.u=t)}},graduatedBounds:{get:function(){return this.ra!==null?this.ra.j:null},set:function(t){this.ra!==null?this.ra.j=t:t!==null&&(this.ra=new rd,this.ra.j=t)}},graduatedIntervals:{get:function(){return this.ra!==null?this.ra.o:null},set:function(t){this.ra!==null?this.ra.o=t:t!==null&&(this.ra=new rd,this.ra.o=t)}},temporaryTextBlock:{get:function(){return this.ra!==null?this.ra.Zh:null},set:function(t){this.ra!==null?this.ra.Zh=t:t!==null&&(this.ra=new rd,this.ra.Zh=t)}},panelLayoutState:{get:function(){return this.F},set:function(t){this.F=t}},Te:{get:function(){return(this.l&8388608)!==0},set:function(t){(this.l&8388608)!==0!==t&&(this.l^=8388608)}},rowDefs:{get:function(){return this.T===null&&(this.T=new uc),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new uc),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Nm},set:function(t){var e=this.rowSizing;e!==t&&(this.T===null&&(this.T=new uc),this.T.ob=t,this.v(),this.g("rowSizing",e,t))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Nm},set:function(t){var e=this.columnSizing;e!==t&&(this.T===null&&(this.T=new uc),this.T.j=t,this.v(),this.g("columnSizing",e,t))}},topIndex:{get:function(){return this.T!==null?this.T.Hb:0},set:function(t){var e=this.topIndex;e!==t&&((!isFinite(t)||0>t)&&Mt("Panel.topIndex must be greater than zero and a real number, not: "+t),this.T===null&&(this.T=new uc),this.T.Hb=t,this.v(),this.g("topIndex",e,t))}},leftIndex:{get:function(){return this.T!==null?this.T.hb:0},set:function(t){var e=this.leftIndex;e!==t&&((!isFinite(t)||0>t)&&Mt("Panel.leftIndex must be greater than zero and a real number, not: "+t),this.T===null&&(this.T=new uc),this.T.hb=t,this.v(),this.g("leftIndex",e,t))}},data:{get:function(){return this.ub},set:function(t){var e=this.ub;if(e!==t){var i=this instanceof bi&&!(this instanceof pr);Sh(this),this.ub=t;var n=this.diagram;n!==null&&(i?(i=n.partManager,this instanceof ge?(e!==null&&i.bf.remove(e),t!==null&&i.bf.add(t,this)):this instanceof bi&&(e!==null&&i.cf.remove(e),t!==null&&i.cf.add(t,this))):(i=this.panel,i!==null&&i.ge!==null&&(e!==null&&i.ge.remove(e),t!==null&&i.ge.add(t,this)))),this.g("data",e,t),n!==null&&n.undoManager.isUndoingRedoing||t!==null&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(t){var e=this.zn;e!==t&&(this.zn=t,this.g("itemIndex",e,t))}},allBindings:{get:function(){return this.A!==null?this.A.nb:null},set:function(t){this.localBindings!==t&&(this.A===null&&(this.A=new rp),this.A.nb=t)}},itemArray:{get:function(){return this.Hh},set:function(t){var e=this.Hh;if(e!==t||t!==null&&r1(this,t)){var i=this.diagram;e!==t&&(i!==null&&e!==null&&Vd(i.partManager,this,i),this.Hh=t,i!==null&&t!==null&&Pa(i.partManager,this)),this.g("itemArray",e,t),i!==null&&i.undoManager.isUndoingRedoing||O0(this,t)}}},itemTemplate:{get:function(){return this.itemTemplateMap===null?null:this.itemTemplateMap.I("")},set:function(t){if(this.itemTemplateMap===null){if(t===null)return;this.itemTemplateMap=new ci}var e=this.itemTemplateMap.I("");e!==t&&((t instanceof bi||t.isPanelMain)&&Mt("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+t),this.itemTemplateMap.add("",t),this.g("itemTemplate",e,t),t=this.diagram,t!==null&&t.undoManager.isUndoingRedoing||this.mv())}},itemTemplateMap:{get:function(){return this.A!==null?this.A.Pc:null},set:function(t){var e=this.itemTemplateMap;if(e!==t){for(var i=t.iterator;i.next(););bn(this),this.A.Pc=t,this.g("itemTemplateMap",e,t),t=this.diagram,t!==null&&t.undoManager.isUndoingRedoing||this.mv()}}},itemCategoryProperty:{get:function(){return this.A!==null?this.A.Oc:"category"},set:function(t){var e=this.itemCategoryProperty;e!==t&&(bn(this),this.A.Oc=t,this.g("itemCategoryProperty",e,t))}},isAtomic:{get:function(){return(this.l&1048576)!==0},set:function(t){var e=(this.l&1048576)!==0;e!==t&&(this.l^=1048576,this.g("isAtomic",e,t))}},isClipping:{get:function(){return(this.l&2097152)!==0},set:function(t){var e=(this.l&2097152)!==0;e!==t&&(this.l^=2097152,this instanceof Yi&&(this.tb=null),this.v(),this.g("isClipping",e,t))}},isOpposite:{get:function(){return(this.l&33554432)!==0},set:function(t){var e=(this.l&33554432)!==0;e!==t&&(this.l^=33554432,this.v(),this.g("isOpposite",e,t))}},isEnabled:{get:function(){return(this.l&4194304)!==0},set:function(t){var e=(this.l&4194304)!==0;if(e!==t){var i=this.panel===null||this.panel.If();this.l^=4194304,this.g("isEnabled",e,t),e=this.diagram,e!==null&&e.undoManager.isUndoingRedoing||i&&Og(this,this,t)}}},alignmentFocusName:{get:function(){return this.$e},set:function(t){var e=this.$e;e!==t&&(this.$e=t,this.v(),this.g("alignmentFocusName",e,t))}}}),St.Object.defineProperties(ce,{Position:{get:function(){return Mh.I("Position")}},Horizontal:{get:function(){return Mh.I("Horizontal")}},Vertical:{get:function(){return Mh.I("Vertical")}},Spot:{get:function(){return Mh.I("Spot")}},Auto:{get:function(){return Mh.I("Auto")}},Table:{get:function(){return Mh.I("Table")}},Viewbox:{get:function(){return Mh.I("Viewbox")}},TableRow:{get:function(){return Mh.I("TableRow")}},TableColumn:{get:function(){return Mh.I("TableColumn")}},Link:{get:function(){return Mh.I("Link")}},Grid:{get:function(){return Mh.I("Grid")}},Graduated:{get:function(){return Mh.I("Graduated")}}}),ce.prototype.rebuildItemElements=ce.prototype.mv,ce.prototype.findItemPanelForData=ce.prototype.sx,ce.prototype.updateTargetBindings=ce.prototype.La,ce.prototype.copyTemplate=ce.prototype.Uy,ce.prototype.graduatedValueForPoint=ce.prototype.Gz,ce.prototype.graduatedPointForValue=ce.prototype.Fz,ce.prototype.findColumnForLocalX=ce.prototype.fz,ce.prototype.findRowForLocalY=ce.prototype.nz,ce.prototype.addColumnDefinition=ce.prototype.By,ce.prototype.addRowDefinition=ce.prototype.Hy,ce.prototype.addRowColumnDefinition=ce.prototype.Gy,ce.prototype.removeColumnDefinition=ce.prototype.jA,ce.prototype.getColumnDefinition=ce.prototype.Eb,ce.prototype.removeRowDefinition=ce.prototype.oA,ce.prototype.getRowDefinition=ce.prototype.Fb,ce.prototype.removeAt=ce.prototype.mb,ce.prototype.remove=ce.prototype.remove,ce.prototype.insertAt=ce.prototype.Gb,ce.prototype.elt=ce.prototype.M,ce.prototype.add=ce.prototype.add,ce.prototype.findObject=ce.prototype.fb,ce.prototype.findInVisualTree=ce.prototype.Nl,ce.prototype.walkVisualTreeFrom=ce.prototype.qm,ce.prototype.findMainElement=ce.prototype.Pb;var Rg=!1,_m=null,Mh=new ci;ce.className="Panel",ce.definePanelLayout=yf,yf("Position",new Tg),yf("Vertical",new Pg),yf("Auto",new Ng),yf("Link",new Dg);function rd(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}rd.prototype.copy=function(){var t=new rd;return t.lq=this.lq,t.F=this.F,t.ia=this.ia,t.V=this.V,t.u=this.u,t.j=this.j,t.o=this.o,t.Zh=this.Zh,t},rd.className="GradPanelSettings";function uc(){this.Pc=[],this.Oc=[],this.j=this.ob=Nm,this.hb=this.Hb=0,this.Qp=Ua,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}uc.prototype.copy=function(t){for(var e=new uc,i=this.Pc,n=i.length,s=e.Pc,a=0;a<n;a++)if(i[a]!==void 0){var l=i[a].copy();l.wi(t),s[a]=l}for(i=this.Oc,n=i.length,s=e.Oc,a=0;a<n;a++)i[a]!==void 0&&(l=i[a].copy(),l.wi(t),s[a]=l);return e.ob=this.ob,e.j=this.j,e.Hb=this.Hb,e.hb=this.hb,e.Qp=this.Qp.J(),e.Ha=this.Ha,e.ia=this.ia,e.V=this.V,e.F=this.F,e.u=this.u,e.o=this.o,e.nb=this.nb,e},uc.className="TablePanelSettings";function tl(t){Do(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=ds,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Bg,this.hg=on,this.lo=this.dg=null,this.mo=NaN,this.Ma=this.tj=null,this.Pm=!1,t&&(Object.assign(this,t),t.column!==void 0?(this.isRow=!1,this.index=t.column):t.row!==void 0&&(this.isRow=!0,this.index=t.row))}tl.prototype.copy=function(){var t=new tl;return t.uq=this.uq,t.Za=this.Za,t.Hc=this.Hc,t.jj=this.jj,t.hj=this.hj,t.Jb=this.Jb,t.oa=this.oa,t.oc=this.oc,t.pa=this.pa,t.hg=this.hg,t.oo=this.oo,this.dg===null?t.dg=null:t.dg=this.dg.J(),t.lo=this.lo,t.mo=this.mo,t.tj=null,this.tj!==null&&(t.separatorDashArray=vr(this.separatorDashArray)),t.Ma=this.Ma,t.Pm=this.Pm,t.be=this.be,t};function Jp(t,e){e.isRow?t.height=e.height:t.width=e.width,t.minimum=e.minimum,t.maximum=e.maximum,t.alignment=e.alignment,t.stretch=e.stretch,t.sizing=e.sizing,t.dg=e.separatorPadding===null?null:e.separatorPadding.J(),t.separatorStroke=e.separatorStroke,t.separatorStrokeWidth=e.separatorStrokeWidth,t.tj=null,e.separatorDashArray&&(t.tj=vr(e.separatorDashArray)),t.background=e.background,t.coversSeparators=e.coversSeparators,t.be=e.be}L=tl.prototype,L.qb=function(t){t.classType===tl&&(this.sizing=t)},L.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+Io(this)},L.wi=function(t){this.Me=t},L.Io=function(t){var e=0,i=this.Me;if(this.index!==t&&(t=this.separatorStroke,t===null&&i!==null&&(t=this.isRow?i.defaultRowSeparatorStroke:i.defaultColumnSeparatorStroke),t!==null&&(e=this.separatorStrokeWidth,isNaN(e)&&(i!==null?e=this.isRow?i.defaultRowSeparatorStrokeWidth:i.defaultColumnSeparatorStrokeWidth:e=0))),t=this.dg,t===null)if(i!==null)t=i.defaultSeparatorPadding;else return e;return e+(this.isRow?t.top:t.left)},L.Wc=function(){var t=0,e=this.Me,i=0,n=this.isRow;if(e!==null&&e.type===ce.Table)for(var s=n?e.rowDefs.length:e.colDefs.length,a=0;a<s;a++){var l=n?e.rowDefs[a]:e.colDefs[a];if(l!==void 0&&l.oa!==0){i=l.index;break}}if(this.index!==i&&(i=this.separatorStroke,i===null&&e!==null&&(i=n?e.defaultRowSeparatorStroke:e.defaultColumnSeparatorStroke),i!==null&&(t=this.separatorStrokeWidth,isNaN(t)&&(e!==null?t=n?e.defaultRowSeparatorStrokeWidth:e.defaultColumnSeparatorStrokeWidth:t=0))),n=this.dg,n===null)if(e!==null)n=e.defaultSeparatorPadding;else return t;return t+(this.isRow?n.top+n.bottom:n.left+n.right)},L.Ob=function(t,e,i){var n=this.Me;if(n!==null&&(n.cb(us,t,this,e,i,void 0,void 0),this.be!==null&&(e=n.diagram,e!==null&&!e.skipsModelSourceBindings&&(n=n.ih(),n!==null&&(e=n.data,e!==null)))))for(i=this.be.iterator;i.next();)i.value.sp(this,e,t,n)};function Pm(t){if(t.sizing===Bg){var e=t.Me;return t.isRow?e.rowSizing:e.columnSizing}return t.sizing}L.bind=function(t,e,i,n){var s=null;return typeof t=="string"?s=new lo(t,e,i,n):s=t,s.xd=this,t=this.panel,t!==null&&(e=t.ih(),e!==null&&n1(e)&&Mt("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+s+" on "+t)),this.be===null&&(this.be=new ue),this.be.add(s),this},St.Object.defineProperties(tl.prototype,{panel:{get:function(){return this.Me}},isRow:{get:function(){return this.uq},set:function(t){this.uq=t}},index:{get:function(){return this.Za},set:function(t){this.Za=t}},height:{get:function(){return this.Hc},set:function(t){var e=this.Hc;e!==t&&(0>t&&Re(t,">= 0",tl,"height"),this.Hc=t,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("height",e,t))}},width:{get:function(){return this.Hc},set:function(t){var e=this.Hc;e!==t&&(0>t&&Re(t,">= 0",tl,"width"),this.Hc=t,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("width",e,t))}},minimum:{get:function(){return this.jj},set:function(t){var e=this.jj;e!==t&&((0>t||!isFinite(t))&&Re(t,">= 0",tl,"minimum"),this.jj=t,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("minimum",e,t))}},maximum:{get:function(){return this.hj},set:function(t){var e=this.hj;e!==t&&(0>t&&Re(t,">= 0",tl,"maximum"),this.hj=t,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("maximum",e,t))}},alignment:{get:function(){return this.Jb},set:function(t){var e=this.Jb;e.D(t)||(this.Jb=t.J(),this.panel!==null&&this.panel.v(),this.Ob("alignment",e,t))}},stretch:{get:function(){return this.hg},set:function(t){var e=this.hg;e!==t&&(this.hg=t,this.panel!==null&&this.panel.v(),this.Ob("stretch",e,t))}},separatorPadding:{get:function(){return this.dg},set:function(t){typeof t=="number"&&(t=new Ai(t));var e=this.dg;t!==null&&e!==null&&e.D(t)||(t!==null&&(t=t.J()),this.dg=t,this.panel!==null&&this.panel.v(),this.Ob("separatorPadding",e,t))}},separatorStroke:{get:function(){return this.lo},set:function(t){var e=this.lo;e!==t&&(t!==null&&Gp(t,"RowColumnDefinition.separatorStroke"),t instanceof Br&&t.freeze(),this.lo=t,this.panel!==null&&this.panel.v(),this.Ob("separatorStroke",e,t))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(t){var e=this.mo;e!==t&&(this.mo=t,this.panel!==null&&this.panel.v(),this.Ob("separatorStrokeWidth",e,t))}},separatorDashArray:{get:function(){return this.tj},set:function(t){var e=this.tj;if(e!==t){if(t!==null){for(var i=t.length,n=0,s=0;s<i;s++){var a=t[s];typeof a=="number"&&0<=a&&isFinite(a)||Mt("separatorDashArray value "+a+" at index "+s+" must be a positive number or zero."),n+=a}if(n===0){if(e===null)return;t=null}}this.tj=t,this.panel!==null&&this.panel.N(),this.Ob("separatorDashArray",e,t)}}},background:{get:function(){return this.Ma},set:function(t){var e=this.Ma;e!==t&&(t!==null&&Gp(t,"RowColumnDefinition.background"),t instanceof Br&&t.freeze(),this.Ma=t,this.panel!==null&&this.panel.N(),this.Ob("background",e,t))}},coversSeparators:{get:function(){return this.Pm},set:function(t){var e=this.Pm;e!==t&&(this.Pm=t,this.panel!==null&&this.panel.N(),this.Ob("coversSeparators",e,t))}},sizing:{get:function(){return this.oo},set:function(t){var e=this.oo;e!==t&&(this.oo=t,this.panel!==null&&this.panel.v(),this.Ob("sizing",e,t))}},actual:{get:function(){return this.oa},set:function(t){this.oa=isNaN(this.Hc)?Math.max(Math.min(this.hj,t),this.jj):Math.max(Math.min(this.hj,this.Hc),this.jj)}},measured:{get:function(){return this.oc},set:function(t){this.oc=t}},total:{get:function(){return this.oa+this.Wc()}},position:{get:function(){return this.pa},set:function(t){this.pa=t}}}),tl.prototype.computeEffectiveSpacing=tl.prototype.Wc,tl.prototype.computeEffectiveSpacingTop=tl.prototype.Io;var Bg=new he(tl,"Default",0),qp=new he(tl,"None",1),Nm=new he(tl,"ProportionalExtra",2);tl.className="RowColumnDefinition",tl.Default=Bg,tl.None=qp,tl.ProportionalExtra=Nm;function pn(t,e){pt.call(this),this.Rd=this.ua=null,this.an="None",this.xc=this.Ui="black",this.ig=1,this.Na=this.Yg=null,this.Vn=this.Un=NaN,this.fa=null,typeof t=="string"?this.figure=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}li(pn,pt),pn.prototype.cloneProtected=function(t){pt.prototype.cloneProtected.call(this,t),t.ua=this.ua,t.Rd=this.Rd,t.an=this.an,t.Ui=this.Ui,t.xc=this.xc,t.ig=this.ig,this.Yg!==null&&(t.Yg=vr(this.Yg)),this.Na!==null&&(t.Na=this.Na.nc?this.Na:this.Na.copy()),t.Un=this.Un,t.Vn=this.Vn,this.fa!==null&&(t.fa=this.fa.copy())};function Ch(t){t.Na===null?t.Na=new zg:t.Na.nc&&(t.Na=t.Na.copy())}L=pn.prototype,L.th=function(){pt.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},L.qb=function(t){t===Jt||t===oi||t===Bn||t===on?this.geometryStretch=t:pt.prototype.qb.call(this,t)},L.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+Io(this)};function B0(t,e,i,n){var s=i.length;if(!(4>s)){var a=n.measuredBounds,l=Math.max(1,a.width);a=a.height;for(var c=i[0],p=i[1],m,v,w,C,k,T,A=0,X=gi(),$=2;$<s;$+=2)m=i[$],v=i[$+1],w=m-c,c=v-p,w===0&&(w=.001),C=c/w,k=Math.atan2(c,w),T=Math.sqrt(w*w+c*c),X.push([w,k,C,T]),A+=T,c=m,p=v;c=i[0],p=i[1],w=n.measuredBounds.width,n instanceof pn&&(w-=n.strokeWidth),1>w&&(w=1),s=i=w,m=l/2,v=m!==0,$=0,T=X[$],w=T[0],k=T[1],C=T[2],T=T[3];for(var J=0;.1<=A;){if(J===0&&(v?(s=i,s-=m,A-=m,v=!1):s=i,s===0&&(s=1)),s>A){Ji(X);return}s>T?(J=s-T,s=T):J=0;var et=Math.sqrt(s*s/(1+C*C));if(0>w&&(et=-et),c+=et,p+=C*et,t.translate(c,p),t.rotate(k),t.translate(-(l/2),-(a/2)),J===0&&n.hh(t,e),t.translate(l/2,a/2),t.rotate(-k),t.translate(-c,-p),A-=s,T-=s,J!==0){if($++,$===X.length){Ji(X);return}T=X[$],w=T[0],k=T[1],C=T[2],T=T[3],s=J}}Ji(X)}}L.hh=function(t,e){var i=this.xc,n=this.Ui;if(i!==null||n!==null){var s=this.ua;if(s!==null){t.yc();var a=this.actualBounds,l=this.naturalBounds;n!==null&&Gs(this,t,n,!0,!1,l,a);var c=this.part,p=this.ig;if(i===null||p!==0||c===null||!this.isPanelMain&&c.Pb()!==this||(p=c.type===ce.Link&&c instanceof pr&&c.category==="Selection"&&c.adornedObject instanceof pn&&c.adornedPart.Pb()===c.adornedObject?c.adornedObject.strokeWidth:0),p===0&&(i=null),i!==null&&p!==0&&(Gs(this,t,i,!1,!1,l,a),t.lineWidth=p,t.lineJoin=this.strokeJoin,t.lineCap=this.strokeCap,t.miterLimit=this.strokeMiterLimit),a=!1,c&&e.Gf("drawShadows")&&(a=c.isShadowed),t.Il===!1&&(a=!1),c=!0,i===null||n!==null&&n!=="transparent"||(c=!1),l=!1,p=this.strokeDashArray,p!==null&&(l=!0,t.js(p,this.strokeDashOffset)),s.type===ve.j)t.beginPath(),t.moveTo(s.startX,s.startY),t.lineTo(s.endX,s.endY),i!==null&&t.jk(),t.Se();else if(s.type===ve.u){var m=s.startX;p=s.startY;var v=s.endX,w=s.endY;s=Math.min(m,v);var C=Math.min(p,w);m=Math.abs(v-m),p=Math.abs(w-p),t.beginPath(),t.rect(s,C,m,p),n!==null&&t.ng(n),i!==null&&(c&&a&&Fc(t),t.jk(),c&&a&&qf(t)),t.Se()}else if(s.type===ve.F)m=s.startX,p=s.startY,v=s.endX,w=s.endY,s=Math.abs(v-m)/2,C=Math.abs(w-p)/2,m=Math.min(m,v)+s,p=Math.min(p,w)+C,t.beginPath(),t.moveTo(m,p-C),t.bezierCurveTo(m+xt.wg*s,p-C,m+s,p-xt.wg*C,m+s,p),t.bezierCurveTo(m+s,p+xt.wg*C,m+xt.wg*s,p+C,m,p+C),t.bezierCurveTo(m-xt.wg*s,p+C,m-s,p+xt.wg*C,m-s,p),t.bezierCurveTo(m-s,p-xt.wg*C,m-xt.wg*s,p-C,m,p-C),t.closePath(),n!==null&&t.ng(n),i!==null&&(c&&a&&Fc(t),t.jk(),c&&a&&qf(t)),t.Se();else if(s.type===ve.o)for(s=s.figures,p=s.length,C=0;C<p;C++){m=s.s[C],t.beginPath(),t.moveTo(m.startX,m.startY),v=m.segments.s,w=v.length;for(var k=null,T=0;T<w;T++){var A=v[T];switch(A.type){case oa:t.moveTo(A.endX,A.endY);break;case po:t.lineTo(A.endX,A.endY);break;case $a:t.bezierCurveTo(A.point1X,A.point1Y,A.point2X,A.point2Y,A.endX,A.endY);break;case ps:t.quadraticCurveTo(A.point1X,A.point1Y,A.endX,A.endY);break;case sr:if(A.radiusX===A.radiusY){var X=Math.PI/180;t.arc(A.point1X,A.point1Y,A.radiusX,A.startAngle*X,(A.startAngle+A.sweepAngle)*X,0>A.sweepAngle,k!==null?k.endX:m.startX,k!==null?k.endY:m.startY)}else if(k=vl(A,m),X=k.length,X===0)t.lineTo(A.centerX,A.centerY);else for(var $=0;$<X;$++){var J=k[$];$===0&&t.lineTo(J[0],J[1]),t.bezierCurveTo(J[2],J[3],J[4],J[5],J[6],J[7])}break;case Vs:if($=X=0,k!==null&&k.type===sr){if(k=vl(k,m),J=k.length,J===0){t.lineTo(A.endX,A.endY);break}k=k[J-1]||null,k!==null&&(X=k[6],$=k[7])}else X=k!==null?k.endX:m.startX,$=k!==null?k.endY:m.startY;if(k=Al(A,m,X,$),X=k.length,X===0){t.lineTo(A.endX,A.endY);break}for($=0;$<X;$++)J=k[$],t.bezierCurveTo(J[2],J[3],J[4],J[5],J[6],J[7]);break;default:Mt("Segment not of valid type: "+A.type)}A.isClosed&&t.closePath(),k=A}v=m.isFilled,a?m.isShadowed?(v===!0&&n!=="transparent"&&n!==null&&t.ng(n,m.isEvenOdd),i!==null&&(v&&c&&Fc(t),t.jk(),v&&c&&qf(t))):(Fc(t),v&&n!=="transparent"&&n!==null&&t.ng(n,m.isEvenOdd),i!==null&&t.jk(),qf(t)):(v&&n!==null&&t.ng(n,m.isEvenOdd),i!==null&&t.jk()),t.Se(C)}if(l&&t.fs(),this.pathPattern!==null){if(i=this.pathPattern,i.measure(1/0,1/0),n=i.measuredBounds,i.arrange(0,0,n.width,n.height),a=this.geometry,t.save(),t.beginPath(),n=gi(),a.type===ve.j)n.push(a.startX),n.push(a.startY),n.push(a.endX),n.push(a.endY),B0(t,e,n,i);else if(a.type===ve.o)for(a=a.figures.iterator;a.next();){for(c=a.value,n.length=0,n.push(c.startX),n.push(c.startY),l=c.startX,s=c.startY,p=l,C=s,m=c.segments.s,v=m.length,w=0;w<v;w++){switch(T=m[w],T.type){case oa:B0(t,e,n,i),n.length=0,n.push(T.endX),n.push(T.endY),l=T.endX,s=T.endY,p=l,C=s;break;case po:n.push(T.endX),n.push(T.endY),l=T.endX,s=T.endY;break;case $a:xt.Qe(l,s,T.point1X,T.point1Y,T.point2X,T.point2Y,T.endX,T.endY,.5,n),l=T.endX,s=T.endY;break;case ps:xt.ep(l,s,T.point1X,T.point1Y,T.endX,T.endY,.5,n),l=T.endX,s=T.endY;break;case sr:if(A=vl(T,c),k=A.length,k===0){n.push(T.centerX),n.push(T.centerY),l=T.centerX,s=T.centerY;break}for(X=0;X<k;X++)$=A[X],xt.Qe(l,s,$[2],$[3],$[4],$[5],$[6],$[7],.5,n),l=$[6],s=$[7];break;case Vs:if(A=Al(T,c,l,s),k=A.length,k===0){n.push(T.endX),n.push(T.endY),l=T.endX,s=T.endY;break}for(X=0;X<k;X++)$=A[X],xt.Qe(l,s,$[2],$[3],$[4],$[5],$[6],$[7],.5,n),l=$[6],s=$[7];break;default:Mt("Segment not of valid type: "+T.type)}T.isClosed&&(n.push(p),n.push(C),B0(t,e,n,i))}B0(t,e,n,i)}else if(a.type===ve.u)n.push(a.startX),n.push(a.startY),n.push(a.endX),n.push(a.startY),n.push(a.endX),n.push(a.endY),n.push(a.startX),n.push(a.endY),n.push(a.startX),n.push(a.startY),B0(t,e,n,i);else if(a.type===ve.F){if(s=new fa,s.startX=a.endX,s.startY=(a.startY+a.endY)/2,l=new zn(sr),l.startAngle=0,l.sweepAngle=360,l.centerX=(a.startX+a.endX)/2,l.centerY=(a.startY+a.endY)/2,l.radiusX=Math.abs(a.startX-a.endX)/2,l.radiusY=Math.abs(a.startY-a.endY)/2,s.add(l),a=vl(l,s),c=a.length,c===0)n.push(l.centerX),n.push(l.centerY);else for(l=s.startX,s=s.startY,p=0;p<c;p++)C=a[p],xt.Qe(l,s,C[2],C[3],C[4],C[5],C[6],C[7],.5,n),l=C[6],s=C[7];B0(t,e,n,i)}Ji(n),t.restore(),t.Vc(!1)}}}},L.kk=function(t,e,i){return!pt.prototype.kk.call(this,t,e,i)||this.xc===null&&this.Ui===null||this.ua===null||this.pathPattern!==null||this.geometry.figures.length!==this.svg.getElementsByTagName("path").length?!1:(t.Hl=this.svg,this.hh(t,e),t.Hl=null,!0)},L.nk=function(t){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:pt.prototype.nk.call(this,t)},L.Dv=function(t,e){if(t.nodeName!=="g")t.setAttributeNS(null,"filter",e);else{t=t.getElementsByTagName("path");for(var i=0;i<t.length;i++)t[i].setAttributeNS(null,"filter",e)}},L.ga=function(t,e){if(e===void 0&&(e=new G),t instanceof di){t.Mc()&&Mt("getDocumentPoint Spot must be a real, specific Spot, not: "+t.toString());var i=this.naturalBounds,n=this.strokeWidth;e.h(t.x*(i.width+n)-n/2+i.x+t.offsetX,t.y*(i.height+n)-n/2+i.y+t.offsetY)}else e.set(t);return this.oe.Ga(e),e},L.mi=function(t){t===void 0&&(t=new Tt);var e=this.naturalBounds,i=this.oe;e=Tt.allocAt(e.x,e.y,e.width,e.height);var n=this.strokeWidth;return e.Bc(n/2,n/2),n=G.allocAt(e.x,e.y).transform(i),t.h(n.x,n.y,0,0),n.h(e.right,e.y).transform(i),or(t,n.x,n.y,0,0),n.h(e.right,e.bottom).transform(i),or(t,n.x,n.y,0,0),n.h(e.x,e.bottom).transform(i),or(t,n.x,n.y,0,0),Tt.free(e),G.free(n),t},L.gh=function(t,e){var i=this.geometry;if(i===null||this.fill===null&&this.stroke===null)return!1;var n=i.bounds,s=this.strokeWidth/2;i.type!==ve.j||e||(s+=2);var a=Tt.alloc();if(a.assign(n),a.Bc(s+2,s+2),!a.ca(t))return Tt.free(a),!1;if(n=s+1e-4,i.type===ve.j)return this.stroke===null||(n=(i.endX-i.startX)*(t.x-i.startX)+(i.endY-i.startY)*(t.y-i.startY),0>(i.startX-i.endX)*(t.x-i.endX)+(i.startY-i.endY)*(t.y-i.endY)||0>n)?!1:(Tt.free(a),xt.Yb(i.startX,i.startY,i.endX,i.endY,s,t.x,t.y));if(i.type===ve.u){e=i.startX;var l=i.startY,c=i.endX;if(i=i.endY,a.x=Math.min(e,c),a.y=Math.min(l,i),a.width=Math.abs(c-e),a.height=Math.abs(i-l),this.fill===null){if(a.Bc(-n,-n),a.ca(t))return Tt.free(a),!1;a.Bc(n,n)}return this.stroke!==null&&a.Bc(s,s),t=a.ca(t),Tt.free(a),t}if(i.type===ve.F){l=i.startX,s=i.startY,c=i.endX;var p=i.endY;if(i=Math.min(l,c),e=Math.min(s,p),l=Math.abs(c-l)/2,s=Math.abs(p-s)/2,i=t.x-(i+l),e=t.y-(e+s),this.fill===null){if(l-=n,s-=n,0>=l||0>=s||1>=i*i/(l*l)+e*e/(s*s))return Tt.free(a),!1;l+=n,s+=n}return this.stroke!==null&&(l+=n,s+=n),Tt.free(a),0>=l||0>=s?!1:1>=i*i/(l*l)+e*e/(s*s)}if(i.type===ve.o)return Tt.free(a),this.fill===null?Su(i,t.x,t.y,s):Ph(i,t,s,1<this.strokeWidth,e);Mt("Unknown Geometry type: "+i.type)},L.Wl=function(t,e,i,n){var s=this.desiredSize,a=this.ig;if(t=Math.max(t,0),e=Math.max(e,0),this.Rd!==null)var l=this.geometry.bounds;else{var c=this.figure,p=qv[c];if(p===void 0){var m=xt.Ze[c];typeof m=="string"&&(m=xt.Ze[m]),typeof m=="function"?(p=m(null,100,100),qv[c]=p):Mt("Unsupported Figure: "+c)}l=p.bounds}c=l.width,p=l.height,m=l.width;var v=l.height;switch(Qu(this,!0)){case Jt:n=i=0;break;case oe:m=Math.max(t-a,0),v=Math.max(e-a,0);break;case mi:m=Math.max(t-a,0),n=0;break;case Ii:i=0,v=Math.max(e-a,0)}isFinite(s.width)&&(m=s.width),isFinite(s.height)&&(v=s.height);var w=this.maxSize,C=this.minSize;switch(i=Math.max(i-a,C.width),n=Math.max(n-a,C.height),m=Math.min(w.width,m),v=Math.min(w.height,v),m=isFinite(m)?Math.max(i,m):Math.max(c,i),v=isFinite(v)?Math.max(n,v):Math.max(p,n),i=F0(this),i){case Jt:break;case oe:c=m,p=v;break;case oi:i=Math.min(m/c,v/p),isFinite(i)||(i=1),c*=i,p*=i;break;default:Mt(i+" is not a valid geometryStretch.")}this.Rd!==null?(c===0&&(c=.001),p===0&&(p=.001),i=this.Rd!==null?this.Rd:this.ua,l=i.bounds,n=c/l.width,l=p/l.height,isFinite(n)||(n=1),isFinite(l)||(l=1),this.ua=n===1&&l===1?i:i.copy().scale(n,l)):this.ua!==null&&xt.$(this.ua.Sk,t-a)&&xt.$(this.ua.Rk,e-a)||(this.ua=pn.makeGeometry(this,c,p)),l=this.ua.bounds,t===1/0||e===1/0?this.Ge(l.x-a/2,l.y-a/2,t===0&&c===0?0:l.width+a,e===0&&p===0?0:l.height+a):this.Ge(-(a/2),-(a/2),m+a,v+a),s.w()?(m=s.width,v=s.height,m=Math.min(w.width,m),v=Math.min(w.height,v),m=Math.max(C.width,m),v=Math.max(C.height,v),this.dc.h(0,0,m,v)):this.dc.assign(l)};function F0(t){var e=t.geometryStretch;return t.Rd!==null?e===on?oe:e:e===on?qv[t.figure].defaultStretch:e}L.eh=function(t,e,i,n){Hu(this,t,e,i,n)},L.rs=function(t,e,i){return this.Sj(t.x,t.y,e.x,e.y,i)},L.Sj=function(t,e,i,n,s){var a=this.transform,l=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*l,p=-a.m12*l,m=-a.m21*l,v=a.m11*l,w=l*(a.m21*a.dy-a.m22*a.dx),C=l*(a.m12*a.dx-a.m11*a.dy);a=t*c+e*m+w,l=t*p+e*v+C,c=i*c+n*m+w,p=i*p+n*v+C,w=this.ig/2,m=this.ua,m===null&&(this.measure(1/0,1/0),m=this.ua);var k=m.bounds;if(v=!1,m.type===ve.j)if(1.5>=this.strokeWidth)v=xt.Ve(m.startX,m.startY,m.endX,m.endY,a,l,c,p,s);else{if(m.startX===m.endX?(n=w,v=0):(e=(m.endY-m.startY)/(m.endX-m.startX),v=w/Math.sqrt(1+e*e),n=v*e),e=gi(),t=new G,xt.Ve(m.startX+n,m.startY+v,m.endX+n,m.endY+v,a,l,c,p,t)&&e.push(t),t=new G,xt.Ve(m.startX-n,m.startY-v,m.endX-n,m.endY-v,a,l,c,p,t)&&e.push(t),t=new G,xt.Ve(m.startX+n,m.startY+v,m.startX-n,m.startY-v,a,l,c,p,t)&&e.push(t),t=new G,xt.Ve(m.endX+n,m.endY+v,m.endX-n,m.endY-v,a,l,c,p,t)&&e.push(t),c=e.length,c===0)return Ji(e),!1;for(v=!0,p=1/0,n=0;n<c;n++)t=e[n],i=(t.x-a)*(t.x-a)+(t.y-l)*(t.y-l),i<p&&(p=i,s.x=t.x,s.y=t.y);Ji(e)}else if(m.type===ve.u)v=xt.Ff(k.x-w,k.y-w,k.x+k.width+w,k.y+k.height+w,a,l,c,p,s);else if(m.type===ve.F){e=Tt.allocAt(k.x,k.y,k.width,k.height).Bc(w,w);t:if(e.width===0)v=xt.Ve(e.x,e.y,e.x,e.y+e.height,a,l,c,p,s);else if(e.height===0)v=xt.Ve(e.x,e.y,e.x+e.width,e.y,a,l,c,p,s);else{if(t=e.width/2,m=e.height/2,n=e.x+t,v=e.y+m,i=9999,a!==c&&(i=(l-p)/(a-c)),9999>Math.abs(i)){if(p=l-v-i*(a-n),0>t*t*i*i+m*m-p*p){s.x=NaN,s.y=NaN,v=!1;break t}w=Math.sqrt(t*t*i*i+m*m-p*p),c=(-(t*t*i*p)+t*m*w)/(m*m+t*t*i*i)+n,t=(-(t*t*i*p)-t*m*w)/(m*m+t*t*i*i)+n,m=i*(c-n)+p+v,p=i*(t-n)+p+v,Math.abs((a-c)*(a-c))+Math.abs((l-m)*(l-m))<Math.abs((a-t)*(a-t))+Math.abs((l-p)*(l-p))?(s.x=c,s.y=m):(s.x=t,s.y=p)}else{if(c=m*m,p=a-n,c-=c/(t*t)*p*p,0>c){s.x=NaN,s.y=NaN,v=!1;break t}p=Math.sqrt(c),c=v+p,p=v-p,Math.abs(c-l)<Math.abs(p-l)?(s.x=a,s.y=c):(s.x=a,s.y=p)}v=!0}Tt.free(e)}else if(m.type===ve.o){C=G.alloc();var T=c-a,A=p-l,X=T*T+A*A,$=a,J=l;if(0<X&&k.contains($,J)&&(C.x=$,C.y=J,this.ca(C)))for(T!==0&&.5>Math.abs(T)?(A*=.5/T,T=.5):A!==0&&.5>Math.abs(A)&&(T*=.5/A,A=.5),$-=T,J-=A;k.contains($,J);)$-=T,J-=A;for(s.x=c,s.y=p,A=0;A<m.figures.count;A++){var et=m.figures.s[A],st=et.isFilled?$:a,mt=et.isFilled?J:l,Pt=et.segments;k=et.startX,T=et.startY;for(var De=k,ti=T,Ve=0;Ve<Pt.count;Ve++){var ye=Pt.s[Ve],Yt=ye.type,sn=ye.endX,Ui=ye.endY,Vr=!1;switch(Yt){case oa:De=sn,ti=Ui;break;case po:Vr=ql(k,T,sn,Ui,st,mt,c,p,C);break;case $a:Vr=xt.Eo(k,T,ye.point1X,ye.point1Y,ye.point2X,ye.point2Y,sn,Ui,st,mt,c,p,.6,C);break;case ps:Vr=xt.Eo(k,T,k+2/3*(ye.point1X-k),T+2/3*(ye.point1Y-T),sn+2/3*(ye.point1X-sn),Ui+2/3*(ye.point1Y-Ui),sn,Ui,st,mt,c,p,.6,C);break;case sr:case Vs:Yt=ye.type===sr?vl(ye,et):Al(ye,et,k,T);var is=Yt.length;if(is===0){Vr=ql(k,T,ye.type===sr?ye.centerX:ye.endX,ye.type===sr?ye.centerY:ye.endY,st,mt,c,p,C);break}for(Ui=null,sn=0;sn<is;sn++){if(Ui=Yt[sn],sn===0&&ql(k,T,Ui[0],Ui[1],st,mt,c,p,C)){var zl=Fg(st,mt,C,X,s);zl<X&&(X=zl,v=!0)}xt.Eo(Ui[0],Ui[1],Ui[2],Ui[3],Ui[4],Ui[5],Ui[6],Ui[7],st,mt,c,p,.6,C)&&(zl=Fg(st,mt,C,X,s),zl<X&&(X=zl,v=!0))}sn=Ui[6],Ui=Ui[7];break;default:Mt("Unknown Segment type: "+Yt)}k=sn,T=Ui,Vr&&(Vr=Fg(st,mt,C,X,s),Vr<X&&(X=Vr,v=!0)),ye.isClosed&&(sn=De,Ui=ti,ql(k,T,sn,Ui,st,mt,c,p,C)&&(ye=Fg(st,mt,C,X,s),ye<X&&(X=ye,v=!0)))}}a=i-t,l=n-e,c=Math.sqrt(a*a+l*l),c!==0&&(a/=c,l/=c),s.x-=a*w,s.y-=l*w,G.free(C)}else Mt("Unknown Geometry type: "+m.type);return v?(this.transform.Ga(s),!0):!1};function Fg(t,e,i,n,s){return t=i.x-t,e=i.y-e,e=t*t+e*e,e<n?(s.x=i.x,s.y=i.y,e):n}function ql(t,e,i,n,s,a,l,c,p){if(xt.$(t,i)&&xt.$(e,n)||xt.$(s,l)&&xt.$(a,c))return!1;var m=!1,v=(s-l)*(e-n)-(a-c)*(t-i);return v===0?!1:(p.x=((s*c-a*l)*(t-i)-(s-l)*(t*n-e*i))/v,p.y=((s*c-a*l)*(e-n)-(a-c)*(t*n-e*i))/v,(t>i?t-i:i-t)<(e>n?e-n:n-e)?(t=e<n?e:n,e=e<n?n:e,(p.y>t||xt.$(p.y,t))&&(p.y<e||xt.$(p.y,e))&&(m=!0)):(e=t<i?t:i,t=t<i?i:t,(p.x>e||xt.$(p.x,e))&&(p.x<t||xt.$(p.x,t))&&(m=!0)),m)}L.fh=function(t,e){if(e===void 0)return t.Re(this.actualBounds);var i=this.ua;i===null&&(this.measure(1/0,1/0),i=this.ua),i=i.bounds;var n=this.strokeWidth/2,s=!1,a=G.alloc();return a.h(i.x-n,i.y-n),t.ca(e.Ga(a))&&(a.h(i.x-n,i.bottom+n),t.ca(e.Ga(a))&&(a.h(i.right+n,i.bottom+n),t.ca(e.Ga(a))&&(a.h(i.right+n,i.y-n),t.ca(e.Ga(a))&&(s=!0)))),G.free(a),s},L.Yc=function(t,e){if(this.fh(t,e)||e===void 0&&(e=this.transform,t.Re(this.actualBounds)))return!0;var i=dn.alloc();i.set(e),i.Vj();var n=t.left,s=t.right,a=t.top;t=t.bottom;var l=G.alloc();if(l.h(n,a),i.Ga(l),this.gh(l,!0)||(l.h(s,a),i.Ga(l),this.gh(l,!0))||(l.h(n,t),i.Ga(l),this.gh(l,!0))||(l.h(s,t),i.Ga(l),this.gh(l,!0)))return G.free(l),!0;var c=G.alloc(),p=G.alloc();return i.set(e),i.bv(this.transform),i.Vj(),c.x=s,c.y=a,c.transform(i),l.x=n,l.y=a,l.transform(i),e=!1,dp(this,l,c,p)?e=!0:(l.x=s,l.y=t,l.transform(i),dp(this,l,c,p)?e=!0:(c.x=n,c.y=t,c.transform(i),dp(this,l,c,p)?e=!0:(l.x=n,l.y=a,l.transform(i),dp(this,l,c,p)&&(e=!0)))),G.free(l),dn.free(i),G.free(c),G.free(p),e};function dp(t,e,i,n){if(!t.rs(e,i,n))return!1;t=e.x,e=e.y;var s=i.x,a=i.y;return i=n.x,n=n.y,t===s?(e<a?(t=e,e=a):t=a,n>=t&&n<=e):(t<s?(n=t,t=s):n=s,i>=n&&i<=t)}L.tx=function(t,e,i){function n(X,$){for(var J=X.length,et=0;et<J;et+=2)if($.zd(X[et],X[et+1])>s)return!0;return!1}if(i&&this.fill!==null&&this.gh(t,!0))return!0;var s=t.Bf(e),a=s;if(1.5<this.strokeWidth&&(s=this.strokeWidth/2+Math.sqrt(s),s*=s),e=this.ua,e===null&&(this.measure(1/0,1/0),e=this.ua,e===null))return!1;if(!i){var l=e.bounds,c=l.x,p=l.y,m=l.x+l.width;if(l=l.y+l.height,be(t.x,t.y,c,p)<=s&&be(t.x,t.y,m,p)<=s&&be(t.x,t.y,c,l)<=s&&be(t.x,t.y,m,l)<=s)return!0}if(c=e.startX,p=e.startY,m=e.endX,l=e.endY,e.type===ve.j){if(i=(c-m)*(t.x-m)+(p-l)*(t.y-l),re(t.x,t.y,c,p,m,l)<=(0<=(m-c)*(t.x-c)+(l-p)*(t.y-p)&&0<=i?s:a))return!0}else{if(e.type===ve.u)return e=!1,i&&(e=re(t.x,t.y,c,p,c,l)<=s||re(t.x,t.y,c,p,m,p)<=s||re(t.x,t.y,m,p,m,l)<=s||re(t.x,t.y,c,l,m,l)<=s),e;if(e.type===ve.F){e=t.x-(c+m)/2,a=t.y-(p+l)/2;var v=Math.abs(m-c)/2,w=Math.abs(l-p)/2;if(v===0||w===0)return re(t.x,t.y,c,p,m,l)<=s;if(i){if(t=xt.$y(v,w,e,a),t*t<=s)return!0}else return!(be(e,a,-v,0)>=s||be(e,a,0,-w)>=s||be(e,a,0,w)>=s||be(e,a,v,0)>=s)}else if(e.type===ve.o){if(m=e.bounds,a=m.x,c=m.y,p=m.x+m.width,m=m.y+m.height,t.x>p&&t.x<a&&t.y>m&&t.y<c&&re(t.x,t.y,a,c,a,m)>s&&re(t.x,t.y,a,c,p,c)>s&&re(t.x,t.y,p,m,a,m)>s&&re(t.x,t.y,p,m,p,c)>s)return!1;if(a=Math.sqrt(s),i){if(this.fill===null?Su(e,t.x,t.y,a):Ph(e,t,a,!0,!1))return!0}else{for(i=e.figures,e=0;e<i.count;e++){if(a=i.s[e],l=a.startX,v=a.startY,t.zd(l,v)>s)return!1;for(c=a.segments.s,p=c.length,m=0;m<p;m++)switch(w=c[m],w.type){case oa:case po:if(l=w.endX,v=w.endY,t.zd(l,v)>s)return!1;break;case $a:var C=gi();if(xt.Qe(l,v,w.point1X,w.point1Y,w.point2X,w.point2Y,w.endX,w.endY,.8,C),l=n(C,t),Ji(C),l||(l=w.endX,v=w.endY,t.zd(l,v)>s))return!1;break;case ps:if(C=gi(),xt.ep(l,v,w.point1X,w.point1Y,w.endX,w.endY,.8,C),l=n(C,t),Ji(C),l||(l=w.endX,v=w.endY,t.zd(l,v)>s))return!1;break;case sr:case Vs:C=w.type===sr?vl(w,a):Al(w,a,l,v);var k=C.length;if(k===0){if(l=w.type===sr?w.centerX:w.endX,v=w.type===sr?w.centerY:w.endY,t.zd(l,v)>s)return!1;break}w=null;for(var T=gi(),A=0;A<k;A++)if(w=C[A],T.length=0,xt.Qe(w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],.8,T),n(T,t))return Ji(T),!1;Ji(T),w!==null&&(l=w[6],v=w[7]);break;default:Mt("Unknown Segment type: "+w.type)}}return!0}}}return!1},L.qc=function(){this.ua=null},L.kq=function(){return this.ig};function Jv(t){var e=t.diagram;e!==null&&e.undoManager.isUndoingRedoing||(t.segmentOrientation=J0,t.toArrow!=="None"?(t.segmentIndex=-1,t.alignmentFocus=qa):t.fromArrow!=="None"&&(t.segmentIndex=0,t.alignmentFocus=new di(1-qa.x,qa.y)))}pn.makeGeometry=function(t,e,i){if(t.toArrow!=="None")var n=zc[t.toArrow];else t.fromArrow!=="None"?n=zc[t.fromArrow]:(n=xt.Ze[t.figure],typeof n=="string"&&(n=xt.Ze[n]),n===void 0&&Mt("Unknown Shape.figure: "+t.figure),n=n(t,e,i),n.Sk=e,n.Rk=i);if(n===null){var s=xt.Ze.Rectangle;typeof s=="function"&&(n=s(t,e,i))}return n};function pp(t){var e=zc[t];if(e===void 0){var i=t.toLowerCase();if(i==="none")return"None";if(e=zc[i],e===void 0){var n=null,s;for(s in xt.um)if(s.toLowerCase()===i){n=s;break}if(n!==null)return t=ve.parse(xt.um[n],!1),zc[n]=t,i!==n&&(zc[i]=n),n}}return typeof e=="string"?e:e instanceof ve?t:null}St.Object.defineProperties(pn.prototype,{geometry:{get:function(){return this.ua!==null?this.ua:this.Rd},set:function(t){var e=this.ua,i=this.Rd;if(e!==t){t!==null?this.Rd=this.ua=t.freeze():this.Rd=this.ua=null;var n=this.part;n!==null&&(n.ag=NaN),this.v(),this.g("geometry",e||i,t),Jl(this)&&(t=this.part,t!==null&&rs(this,t,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(t){t=ve.parse(t);var e=t.normalize();this.geometry=t,this.position=t=G.allocAt(-e.x,-e.y),G.free(t)}},isGeometryPositioned:{get:function(){return(this.l&1048576)!==0},set:function(t){var e=(this.l&1048576)!==0;e!==t&&(this.l^=1048576,this.v(),this.g("isGeometryPositioned",e,t))}},fill:{get:function(){return this.Ui},set:function(t){var e=this.Ui;e!==t&&(t!==null&&Gp(t,"Shape.fill"),t instanceof Br&&t.freeze(),this.Ui=t,this.N(),this.g("fill",e,t))}},stroke:{get:function(){return this.xc},set:function(t){var e=this.xc;e!==t&&(t!==null&&Gp(t,"Shape.stroke"),t instanceof Br&&t.freeze(),this.xc=t,this.N(),this.g("stroke",e,t))}},strokeWidth:{get:function(){return this.ig},set:function(t){var e=this.ig;if(e!==t)if(0<=t){this.ig=t,this.v();var i=this.part;i!==null&&(i.ag=NaN),this.g("strokeWidth",e,t)}else Re(t,"value >= 0",pn,"strokeWidth:value")}},strokeCap:{get:function(){return this.Na!==null?this.Na.Hr:"butt"},set:function(t){var e=this.strokeCap;e!==t&&(typeof t!="string"||t!=="butt"&&t!=="round"&&t!=="square"?Re(t,'"butt", "round", or "square"',pn,"strokeCap"):(Ch(this),this.Na.Hr=t,this.N(),this.g("strokeCap",e,t)))}},strokeJoin:{get:function(){return this.Na!==null?this.Na.Ir:"miter"},set:function(t){var e=this.strokeJoin;e!==t&&(typeof t!="string"||t!=="miter"&&t!=="bevel"&&t!=="round"?Re(t,'"miter", "bevel", or "round"',pn,"strokeJoin"):(Ch(this),this.Na.Ir=t,this.N(),this.g("strokeJoin",e,t)))}},strokeMiterLimit:{get:function(){return this.Na!==null?this.Na.Jr:10},set:function(t){var e=this.strokeMiterLimit;if(e!==t&&1<=t){Ch(this),this.Na.Jr=t,this.N();var i=this.part;i!==null&&(i.ag=NaN),this.g("strokeMiterLimit",e,t)}}},strokeDashArray:{get:function(){return this.Yg},set:function(t){var e=this.Yg;if(e!==t){if(t!==null){for(var i=t.length,n=0,s=0;s<i;s++){var a=t[s];0<=a&&isFinite(a)||Mt("strokeDashArray:value "+a+" at index "+s+" must be a positive number or zero."),n+=a}if(n===0){if(e===null)return;t=null}}this.Yg=t,this.N(),this.g("strokeDashArray",e,t)}}},strokeDashOffset:{get:function(){return this.Na!==null?this.Na.uj:0},set:function(t){var e=this.strokeDashOffset;e!==t&&0<=t&&(Ch(this),this.Na.uj=t,this.N(),this.g("strokeDashOffset",e,t))}},figure:{get:function(){return this.an},set:function(t){var e=this.an;if(e!==t){var i=xt.Ze[t];typeof i=="function"?i=t:(i=xt.Ze[t.toLowerCase()])||Mt("Unknown Shape.figure: "+t),e!==i&&(t=this.part,t!==null&&(t.ag=NaN),this.an=i,this.Rd=null,this.qc(),this.v(),this.g("figure",e,i))}}},toArrow:{get:function(){return this.Ua!==null?this.Ua.V:"None"},set:function(t){var e=this.toArrow;if(t===!0?t="Standard":t===!1&&(t=""),e!==t){var i=pp(t);i===null?Mt("Unknown Shape.toArrow: "+t):e!==i&&(this.Ua===null&&(this.Ua=new vf),this.Ua.V=i,this.Rd=null,this.qc(),this.v(),Jv(this),this.g("toArrow",e,i))}}},fromArrow:{get:function(){return this.Ua!==null?this.Ua.j:"None"},set:function(t){var e=this.fromArrow;if(t===!0?t="Standard":t===!1&&(t=""),e!==t){var i=pp(t);i===null?Mt("Unknown Shape.fromArrow: "+t):e!==i&&(this.Ua===null&&(this.Ua=new vf),this.Ua.j=i,this.Rd=null,this.qc(),this.v(),Jv(this),this.g("fromArrow",e,i))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:ds},set:function(t){var e=this.spot1;e.D(t)||(t=t.J(),Ch(this),this.Na.fg=t,this.v(),this.g("spot1",e,t))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:ds},set:function(t){var e=this.spot2;e.D(t)||(t=t.J(),Ch(this),this.Na.gg=t,this.v(),this.g("spot2",e,t))}},parameter1:{get:function(){return this.Un},set:function(t){var e=this.Un;e!==t&&(this.Un=t,this.qc(),this.v(),this.g("parameter1",e,t))}},parameter2:{get:function(){return this.Vn},set:function(t){var e=this.Vn;e!==t&&(this.Vn=t,this.qc(),this.v(),this.g("parameter2",e,t))}},naturalBounds:{get:function(){return this.dc}},pathPattern:{get:function(){return this.Na!==null?this.Na.br:null},set:function(t){var e=this.pathPattern;e!==t&&(Ch(this),this.Na.br=t,this.N(),this.g("pathPattern",e,t))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:on},set:function(t){var e=this.geometryStretch;e!==t&&(Ch(this),this.Na.jq=t,this.v(),this.g("geometryStretch",e,t))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(t){var e=this.interval;if(t=Math.round(t),e!==t&&t!==0&&isFinite(t)){this.fa===null&&(this.fa=new Ff),this.fa.Tk=t;var i=this.diagram;i!==null&&this.panel===i.grid&&Bs(i),this.v(),i=this.panel,i!==null&&(i.graduatedIntervals=null),this.g("interval",e,t)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(t){var e=this.graduatedStart;e!==t&&(0>t?t=0:1<t&&(t=1),this.fa===null&&(this.fa=new Ff),this.fa.u=t,this.v(),this.g("graduatedStart",e,t))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(t){var e=this.graduatedEnd;e!==t&&(0>t?t=0:1<t&&(t=1),this.fa===null&&(this.fa=new Ff),this.fa.j=t,this.v(),this.g("graduatedEnd",e,t))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(t){var e=this.graduatedSkip;e!==t&&(this.fa===null&&(this.fa=new Ff),this.fa.o=t,this.v(),this.g("graduatedSkip",e,t))}}}),pn.prototype.intersectsRect=pn.prototype.Yc,pn.prototype.containedInRect=pn.prototype.fh,pn.prototype.getNearestIntersectionPoint=pn.prototype.rs,pn.prototype.getDocumentBounds=pn.prototype.mi,pn.prototype.getDocumentPoint=pn.prototype.ga;var zc=new Bo,qv=new Bo;pn.className="Shape",pn.getFigureGenerators=function(){var t=new ci,e;for(e in xt.Ze)e!==e.toLowerCase()&&t.add(e,xt.Ze[e]);return t.freeze(),t},pn.defineFigureGenerator=function(t,e){var i=t.toLowerCase(),n=xt.Ze;n[t]=e,n[i]=t},pn.getArrowheadGeometries=function(){var t=new ci;for(n in xt.um)if(zc[n]===void 0){var e=ve.parse(xt.um[n],!1);zc[n]=e,e=n.toLowerCase(),e!==n&&(zc[e]=n)}for(var i in zc)if(i!==i.toLowerCase()){var n=zc[i];n instanceof ve&&t.add(i,n)}return t.freeze(),t},pn.defineArrowheadGeometry=function(t,e){var i=null;typeof e=="string"?i=ve.parse(e,!1):i=e,e=t.toLowerCase(),e!=="none"&&t!==e||Mt("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t);var n=zc;n[t]=i,n[e]=t};function zg(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=on,this.gg=this.fg=ds}zg.prototype.copy=function(){var t=new zg;return t.Hr=this.Hr,t.Ir=this.Ir,t.Jr=this.Jr,t.uj=this.uj,t.br=this.br,t.jq=this.jq,t.fg=this.fg.J(),t.gg=this.gg.J(),t};function ao(t,e){return pt.call(this),Ug||(uh=ur?new Pc(null).context:null,Ug=!0),this.l|=2097152,this.ec="",this.xc="black",this.Ae="13px sans-serif",this.Lq=this.Cb=this.Gc=0,this.da=this.fa=this.Gm=null,this.Ih=0,this.df=null,this.Le=0,this.ze=this.Qb=this.Qc=null,typeof t=="string"?this.text=t:t&&Object.assign(this,t),e&&Object.assign(this,e),this}li(ao,pt),ao.prototype.cloneProtected=function(t){pt.prototype.cloneProtected.call(this,t),t.ec=this.ec,t.xc=this.xc,t.Ae=this.Ae,t.Gc=this.Gc,t.Cb=this.Cb,t.Lq=this.Lq,t.Gm=this.Gm,this.fa!==null&&(t.fa=this.fa.copy()),this.da!==null&&(t.da=this.da.nc?this.da:this.da.copy()),t.Ih=this.Ih,t.df=this.df,t.Le=this.Le,t.Qc=this.Qc,t.Qb=this.Qb,t.ze=this.ze};function vu(t){t.da===null?t.da=new ey:t.da.nc&&(t.da=t.da.copy())}L=ao.prototype,L.th=function(){pt.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function $g(t,e){t.l=e.l|6144,t.pb=e.opacity,t.Ma=e.background,t.areaBackground=e.areaBackground,t.jd=e.desiredSize.J(),t.minSize=e.minSize.J(),t.maxSize=e.maxSize.J(),e.Lb!==null?t.Lb=e.Lb.copy():t.Lb=null,t.Ca=e.scale,t.Kb=e.angle,t.stretch=e.stretch,t.Kg=e.margin.J(),t.Jb=e.alignment.J(),t.sk=e.alignmentFocus.J(),t.segmentFraction=e.segmentFraction,t.segmentOffset=e.segmentOffset.J(),t.segmentOrientation=e.segmentOrientation,e.tb!==null&&(t.tb=e.tb.copy()),t.shadowVisible=e.shadowVisible,t.ec=e.ec,t.xc=e.xc,t.Ae=e.Ae,t.fa!==null&&(t.fa=e.fa.copy()),e.da!==null&&(t.da=e.da.nc?e.da:e.da.copy()),t.Ih=e.Ih}L.qb=function(t){t.classType===ao?this.wrap=t:pt.prototype.qb.call(this,t)},L.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},L.v=function(){pt.prototype.v.call(this)},L.hh=function(t,e){if(this.xc!==null&&this.ec.length!==0&&this.Ae!==null){var i=this.naturalBounds,n=this.actualBounds,s=i.width,a=i.height,l=Am(this),c=t.textAlign=this.textAlign,p=e.tn;c==="start"?c=p?"right":"left":c==="end"&&(c=p?"left":"right"),p=this.isUnderline;var m=this.isStrikethrough;Gs(this,t,this.xc,!0,!1,i,n),(p||m)&&Gs(this,t,this.xc,!1,!1,i,n),n=0,i=!1;var v=this.oe,w=v.dx-(l*v.m21+v.dx);v=v.dy-(l*v.m22+v.dy);var C=e.scale;switch(8>(w*w+v*v)*C*C&&(i=!0),e.ib!==t&&(i=!1),e.ib instanceof Fu&&(i=!1),e.Gf("textGreeking")===!1&&(i=!1),e=this.spacingAbove,w=this.spacingBelow,this.flip){case Vn:t.translate(s,0),t.scale(-1,1);break;case gn:t.translate(0,a),t.scale(1,-1);break;case Hr:t.translate(s,a),t.scale(-1,-1)}if(t.yc(),v=this.Gc,C=(e+l+w)*v,a>C&&(n=this.verticalAlignment,n=n.y*a-n.y*C+n.offsetY),v===1&&this.ze!==null)w=this.Cb,w>s&&(w=s),this.Oj(this.ze,t,0,n+e,s,l,w,i,c,p,m);else if(this.Qc!==null&&this.Qb!==null)for(C=0;C<v;C++){var k=this.Qc[C];k>s&&(k=s),n+=e,this.Oj(this.Qb[C],t,0,n,s,l,k,i,c,p,m),n+=l+w}switch(this.flip){case Vn:t.scale(-1,1),t.translate(-s,0);break;case gn:t.scale(1,-1),t.translate(0,-a);break;case Hr:t.scale(-1,-1),t.translate(-s,-a)}}},L.Oj=function(t,e,i,n,s,a,l,c,p,m,v){var w=0;if(c)p==="left"?w=0:p==="right"?w=s-l:p==="center"&&(w=(s-l)/2),e.fillRect(i+w,n+.25*a,l,1);else{if(p==="left"?w=0:p==="right"?w=s:p==="center"&&(w=s/2),s=Kg!==null?Kg(this,a):.75*a,e.fillText(t,i+w,n+s),t=a/20|0,t===0&&(t=1),p==="right"?w-=l:p==="center"&&(w-=l/2),m){c=Im!==null?Im(this,a):.8*a,p=i+w,m=n+c,s=i+w+l,c=n+c;var C=t;e.beginPath(),e.lineWidth=C,e.moveTo(p,m),e.lineTo(s,c),e.stroke(),e.Se(),e instanceof Fu&&e.ad.classList.add("gojs-td")}v&&(v=n+a-a/2.2|0,t%2!==0&&(v+=.5),n=i+w,a=v,i=i+w+l,l=v,w=t,e.beginPath(),e.lineWidth=w,e.moveTo(n,a),e.lineTo(i,l),e.stroke(),e.Se(),e instanceof Fu&&e.ad.classList.add("gojs-td"))}},L.kk=function(t,e,i){if(!pt.prototype.kk.call(this,t,e,i))return!1;if(Gs(this,t,this.xc,!0,!1,this.naturalBounds,this.actualBounds),i){if(this.svg.getElementsByTagName("text").length===0)return!0;for(e=this.svg.getElementsByClassName("gojs-td"),i=0;i<e.length;i++)Xy(t,e[i],!1)}else e=this.svg,e.innerHTML=this.text,Xy(t,e,!0);return!0},L.nk=function(t){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:pt.prototype.nk.call(this,t)},L.Dv=function(t,e){if(t.nodeName!=="g")t.setAttributeNS(null,"filter",e);else{t=t.getElementsByTagName("text");for(var i=0;i<t.length;i++)t[i].setAttributeNS(null,"filter",e)}},L.Wl=function(t,e,i,n){var s=this.Gc;this.Ih=t,this.l&=-16777217;var a=this.Ae;uh!==null&&s1!==a&&(s1=uh.font=a),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var l;if(isNaN(this.desiredSize.width)){if(a=this.ec.replace(/\r\n/g,`
|
|
|
`).replace(/\r/g,`
|
|
|
`),a.length===0)a=8;else if(this.isMultiline){for(var c=l=0,p=!1;!p;){var m=a.indexOf(`
|
|
|
`,c);m===-1&&(m=a.length,p=!0),c=a.substr(c,m-c),this.formatting===Rm&&(c=c.trim()),l=Math.max(l,$c(c)),c=m+1}a=l}else l=a.indexOf(`
|
|
|
`,0),0<=l&&(a=a.substr(0,l)),a=$c(a);a=Math.min(a,t/this.scale)}else a=this.desiredSize.width;if(this.panel!==null&&(a=Math.min(a,this.panel.maxSize.width)),l=jg(this,a),isNaN(this.desiredSize.height)?l=Math.min(l,e/this.scale):l=this.desiredSize.height,p=l,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Om&&(e=this.Ae,e=this.overflow===Om?Dm(e):0,m=this.spacingAbove+this.spacingBelow,m=Math.max(0,Am(this)+m),p=Math.min(this.maxLines-1,Math.max(Math.floor(p/m+.01)-1,0)),!(p+1>=this.Qb.length))){for(this.l|=16777216,m=this.Qb[p],e=Math.max(1,t-e);$c(m)>e&&1<m.length;)m=m.substr(0,m.length-1);m+=Bm,e=$c(m),this.Qb[p]=m,this.Qb=this.Qb.slice(0,p+1),this.Qc[p]=e,this.Qc=this.Qc.slice(0,p+1),this.Le=this.Qb.length,this.Cb=Math.max(this.Cb,e),this.Gc=this.Le,this.Gc===1&&(this.ze=this.Qb[0])}(this.wrap===j0||isNaN(this.desiredSize.width))&&(a=isNaN(t)?this.Cb:Math.min(t,this.Cb)),a=Math.max(i,a),l=Math.max(n,l),yn(this.dc,a,l),this.Ge(0,0,a,l),this.svg!==null&&s!==this.Gc&&(this.Uc=!0)},L.eh=function(t,e,i,n){Hu(this,t,e,i,n)};function gd(t,e,i){t.ze===null?(t.ze=e,t.Cb=i):((t.Qb===null||t.Qc===null)&&(t.Qb=[],t.Qc=[],t.Qb.push(t.ze),t.Qc.push(t.Cb)),t.Qb.push(e),t.Qc.push(i),t.Qb.length>t.maxLines&&(t.l|=16777216))}function Qv(t,e,i,n){var s=t.formatting===Rm;s&&(e=e.trim());var a=0,l=t.Ae,c=t.spacingAbove+t.spacingBelow;c=Math.max(0,Am(t)+c);var p=t.overflow===Om?Dm(l):0;if(t.Gc>=t.maxLines)n!==null&&n.h(0,c);else if(l=e,t.wrap===$0){t.Le=1;var m=$c(e);if(p===0||m<=i)t.Cb=Math.max(t.Cb,m),gd(t,e,t.Cb),n!==null&&n.h(m,c);else{for(a=z0(t,l),l=l.substr(a.length),e=z0(t,l),m=$c(a+e);0<e.length&&m<=i;)a+=e,l=l.substr(e.length),e=z0(t,l),m=a+e,s&&(m=m.trim()),m=$c(m);for(s&&(e=e.trim()),a+=e,i=Math.max(1,i-p);$c(a)>i&&1<a.length;)a=a.substr(0,a.length-1);t.l|=16777216,a+=Bm;var v=$c(a);t.Cb=v,gd(t,a,v),n!==null&&n.h(v,c)}}else{for(p=0,l.length===0&&(p=1,gd(t,l,0));0<l.length;){for(e=z0(t,l),l=l.substr(e.length);$c(e)>i;){var w=1;for(m=$c(e.substr(0,w)),v=0;m<=i;)w++,v=m,m=$c(e.substr(0,w));if(w===1){var C=m;a=Math.max(a,m)}else C=v,a=Math.max(a,v);if(w--,1>w&&(w=1),gd(t,e.substr(0,w),C),p++,e=e.substr(w),t.Gc+p>t.maxLines)break}for(v=z0(t,l),m=$c(e+v);0<v.length&&m<=i;)e+=v,l=l.substr(v.length),v=z0(t,l),m=e+v,s&&(m=m.trim()),m=$c(m);if(s&&(e=e.trim()),e!==""&&(e[e.length-1]==="\xAD"&&(e=e.substring(0,e.length-1)+"\u2010"),v.length===0?(w=m,a=Math.max(a,m)):(w=v=$c(e),a=Math.max(a,v)),gd(t,e,w),p++,t.Gc+p>t.maxLines))break}t.Le=Math.min(t.maxLines,p),t.Cb=Math.max(t.Cb,a),n!==null&&n.h(t.Cb,c*t.Le)}}function z0(t,e){if(t.wrap===K0)return e.substr(0,1);for(var i=e.length,n=0,s=fx;n<i&&!s.test(e.charAt(n));)n++;for(t.formatting===o1&&(i=Math.min(i,n+1));n<i&&s.test(e.charAt(n));)n++;return n>=e.length?e:e.substr(0,n)}function $c(t){return uh===null?8*t.length:uh.measureText(t).width}function Am(t){if(t.df!==null)return t.df;var e=t.Ae;if(uh===null){var i=16;return t.df=i}return Qp[e]!==void 0&&5e3>H0?i=Qp[e]:(i=1.3*uh.measureText("M").width,Qp[e]=i,H0++),t.df=i}function Dm(t){if(uh===null)return 6;if(Vg[t]!==void 0&&5e3>Wg)var e=Vg[t];else e=uh.measureText(Bm).width,Vg[t]=e,Wg++;return e}function jg(t,e){var i=t.ec.replace(/\r\n/g,`
|
|
|
`).replace(/\r/g,`
|
|
|
`),n=t.spacingAbove+t.spacingBelow;if(n=Math.max(0,Am(t)+n),i.length===0)return t.Cb=0,t.Gc=1,n;if(!t.isMultiline){var s=i.indexOf(`
|
|
|
`,0);0<=s&&(i=i.substr(0,s))}s=0;for(var a=t.Gc=0,l,c=!1;!c;){if(l=i.indexOf(`
|
|
|
`,a),l===-1&&(l=i.length,c=!0),a<=l){if(a=i.substr(a,l-a),t.wrap!==$0){t.Le=0;var p=fe.alloc();Qv(t,a,e,p),s+=p.height,fe.free(p),t.Gc+=t.Le}else Qv(t,a,e,null),s+=n,t.Gc++;t.Gc===t.maxLines&&(c=!0)}a=l+1}return t.Lq=s}St.Object.defineProperties(ao.prototype,{font:{get:function(){return this.Ae},set:function(t){var e=this.Ae;e!==t&&(this.Ae=t,this.df=null,this.v(),this.g("font",e,t))}},text:{get:function(){return this.ec},set:function(t){var e=this.ec;t!=null?t=t.toString():t="",e!==t&&(this.ec=t,this.v(),this.g("text",e,t),this.Uc=!0)}},textAlign:{get:function(){return this.da!==null?this.da.Or:"start"},set:function(t){var e=this.textAlign;e===t||t!=="start"&&t!=="end"&&t!=="left"&&t!=="right"&&t!=="center"||(vu(this),this.da.Or=t,this.N(),this.g("textAlign",e,t))}},flip:{get:function(){return this.da!==null?this.da.Xf:Jt},set:function(t){var e=this.flip;e!==t&&(vu(this),this.da.Xf=t,this.N(),this.g("flip",e,t))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:wu},set:function(t){var e=this.verticalAlignment;e.D(t)||(t=t.J(),vu(this),this.da.Yr=t,Rl(this),this.g("verticalAlignment",e,t))}},naturalBounds:{get:function(){if(!this.dc.w()){var t=fe.alloc();Qv(this,this.ec,999999,t);var e=t.width;fe.free(t),t=jg(this,e);var i=this.desiredSize;isNaN(i.width)||(e=i.width),isNaN(i.height)||(t=i.height),yn(this.dc,e,t)}return this.dc}},isMultiline:{get:function(){return(this.l&2097152)!==0},set:function(t){var e=(this.l&2097152)!==0;e!==t&&(this.l^=2097152,this.v(),this.g("isMultiline",e,t))}},isUnderline:{get:function(){return(this.l&4194304)!==0},set:function(t){var e=(this.l&4194304)!==0;e!==t&&(this.l^=4194304,this.Uc=!0,this.N(),this.g("isUnderline",e,t))}},isStrikethrough:{get:function(){return(this.l&8388608)!==0},set:function(t){var e=(this.l&8388608)!==0;e!==t&&(this.l^=8388608,this.Uc=!0,this.N(),this.g("isStrikethrough",e,t))}},wrap:{get:function(){return this.da!==null?this.da.$r:Hg},set:function(t){var e=this.wrap;e!==t&&(vu(this),this.da.$r=t,this.v(),this.g("wrap",e,t))}},overflow:{get:function(){return this.da!==null?this.da.$q:ty},set:function(t){var e=this.overflow;e!==t&&(vu(this),this.da.$q=t,this.v(),this.g("overflow",e,t))}},isOverflowed:{get:function(){return(this.l&16777216)!==0}},stroke:{get:function(){return this.xc},set:function(t){var e=this.xc;e!==t&&(t!==null&&Gp(t,"TextBlock.stroke"),t instanceof Br&&t.freeze(),this.xc=t,this.N(),this.g("stroke",e,t))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return Am(this)}},editable:{get:function(){return(this.l&1048576)!==0},set:function(t){var e=(this.l&1048576)!==0;e!==t&&(this.l^=1048576,this.g("editable",e,t))}},textEditor:{get:function(){return this.da!==null?this.da.Qr:null},set:function(t){var e=this.textEditor;e!==t&&(vu(this),this.da.Qr=t,this.g("textEditor",e,t))}},errorFunction:{get:function(){return this.da!==null?this.da.Hd:null},set:function(t){var e=this.errorFunction;e!==t&&(vu(this),this.da.Hd=t,this.g("errorFunction",e,t))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(t){var e=this.interval;if(t=Math.round(t),e!==t&&t!==0&&isFinite(t)){this.fa===null&&(this.fa=new Ff),this.fa.Tk=t,this.v();var i=this.panel;i!==null&&(i.graduatedIntervals=null),this.g("interval",e,t)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(t){var e=this.graduatedStart;e!==t&&(0>t?t=0:1<t&&(t=1),this.fa===null&&(this.fa=new Ff),this.fa.u=t,this.v(),this.g("graduatedStart",e,t))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(t){var e=this.graduatedEnd;e!==t&&(0>t?t=0:1<t&&(t=1),this.fa===null&&(this.fa=new Ff),this.fa.j=t,this.v(),this.g("graduatedEnd",e,t))}},graduatedFunction:{get:function(){return this.fa!==null?this.fa.F:null},set:function(t){var e=this.graduatedFunction;e!==t&&(this.fa===null&&(this.fa=new Ff),this.fa.F=t,this.v(),this.g("graduatedFunction",e,t))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(t){var e=this.graduatedSkip;e!==t&&(this.fa===null&&(this.fa=new Ff),this.fa.o=t,this.v(),this.g("graduatedSkip",e,t))}},textValidation:{get:function(){return this.da!==null?this.da.vj:null},set:function(t){var e=this.textValidation;e!==t&&(vu(this),this.da.vj=t,this.g("textValidation",e,t))}},textEdited:{get:function(){return this.da!==null?this.da.Pr:null},set:function(t){var e=this.textEdited;e!==t&&(vu(this),this.da.Pr=t,this.g("textEdited",e,t))}},spacingAbove:{get:function(){return this.da!==null?this.da.Dr:0},set:function(t){var e=this.spacingAbove;e!==t&&(vu(this),this.da.Dr=t,this.v(),this.g("spacingAbove",e,t))}},spacingBelow:{get:function(){return this.da!==null?this.da.Er:0},set:function(t){var e=this.spacingBelow;e!==t&&(vu(this),this.da.Er=t,this.v(),this.g("spacingBelow",e,t))}},formatting:{get:function(){return this.da!==null?this.da.gq:Rm},set:function(t){var e=this.formatting;e!==t&&(vu(this),this.da.gq=t,this.v(),this.g("formatting",e,t))}},maxLines:{get:function(){return this.da!==null?this.da.Jq:1/0},set:function(t){var e=this.maxLines;e!==t&&(t=Math.floor(t),0>=t&&Re(t,"> 0",ao,"maxLines"),vu(this),this.da.Jq=t,this.v(),this.g("maxLines",e,t))}},metrics:{get:function(){return{arrSize:this.Qc!==null?this.Qc:[this.Cb],arrText:this.Qb!==null?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(t){var e=this.Gm;e!==t&&(this.Gm=t,this.g("choices",e,t))}}});var Kg=null,Im=null,$0=new he(ao,"None",0),j0=new he(ao,"WrapFit",1),Hg=new he(ao,"WrapDesiredSize",2),K0=new he(ao,"WrapBreakAll",3),ty=new he(ao,"OverflowClip",0),Om=new he(ao,"OverflowEllipsis",1),Rm=new he(ao,"FormatTrim",0),o1=new he(ao,"FormatNone",0),fx=/[ \u200b\u00ad]/,Qp=new Bo,H0=0,Vg=new Bo,Wg=0,Bm="...",s1="",uh=null,Ug=!1;ao.className="TextBlock";function ey(){this.nc=!1,this.Hd=null,this.Xf=Jt,this.gq=Rm,this.Jq=1/0,this.$q=ty,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=wu,this.$r=Hg}ey.prototype.copy=function(){var t=new ey;return t.Hd=this.Hd,t.Xf=this.Xf,t.gq=this.gq,t.Jq=this.Jq,t.$q=this.$q,t.Dr=this.Dr,t.Er=this.Er,t.Or=this.Or,t.Pr=this.Pr,t.Qr=this.Qr,t.vj=this.vj,t.Yr=this.Yr,t.$r=this.$r,t},ao.getEllipsis=function(){return Bm},ao.setEllipsis=function(t){Bm=t,Vg=new Bo,Wg=0},ao.getBaseline=function(){return Kg},ao.setBaseline=function(t){Kg=t},ao.getUnderline=function(){return Im},ao.setUnderline=function(t){Im=t},ao.isValidFont=function(t){if(Ug||(uh=ur?new Pc(null).context:null,Ug=!0),uh===null)return!0;var e=uh.font;if(t===e||t==="10px sans-serif")return!0;uh.font="10px sans-serif",uh.font=t;var i=uh.font;if(i!=="10px sans-serif")return uh.font=e,!0;uh.font="19px serif";var n=uh.font;return uh.font=t,i=uh.font,uh.font=e,i!==n},ao.FormatNone=o1,ao.FormatTrim=Rm,ao.None=$0,ao.OverflowClip=ty,ao.OverflowEllipsis=Om,ao.WrapBreakAll=K0,ao.WrapDesiredSize=Hg,ao.WrapFit=j0;function Ff(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Ff.prototype.copy=function(){var t=new Ff;return t.Tk=this.Tk,t.u=this.u,t.j=this.j,t.F=this.F,t.o=this.o,t},Ff.className="GradElementSettings";function hh(t,e){pt.call(this),this.Eg=null,this.qo="",this.Xg=_r,this.Nk=oe,this.Zg=this.Hd=null,this.Mk=_n,this.Xf=Jt,this.vl=null,this.qn=!1,this.en=!0,this.al=!1,this.bt=this.rl=null,typeof t=="string"?this.source=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}var V0;li(hh,pt),hh.prototype.cloneProtected=function(t){pt.prototype.cloneProtected.call(this,t),t.qo=this.qo,t.element=this.Eg,t.Xg=this.Xg.J(),t.Nk=this.Nk,t.Xf=this.Xf,t.Hd=this.Hd,t.Zg=this.Zg,t.Mk=this.Mk.J(),t.en=this.en,t.rl=this.rl},hh.prototype.qb=function(t){t===Jt||t===oi||t===Bn?this.imageStretch=t:pt.prototype.qb.call(this,t)},hh.prototype.toString=function(){return"Picture("+this.source+")#"+Io(this)};function W0(t){t===void 0&&(t=""),t!==""?V0[t]&&(delete V0[t],t0--):(V0=new Bo,t0=0)}function a1(t,e){e.qy||(e.Fq=function(i){e.sq=!0,e.ln=!1;var n=e.Bg.copy();if(n!=null){for(n=n.iterator;n.next();){var s=n.value;s.N();var a=e.getAttribute("src")||"",l=s.Og.I(a);if(l!==null)for(var c=l.length,p=0;p<c;p++)a=l[p],s.Xn.add(a),a.Uc=!0,s.$b(),e.hn&&(e.eu===void 0&&(e.eu=i),a.Zg!==null&&a.Zg(a,i))}e.Bg.clear()}t.desiredSize.w()||(ba(t,!1),t.v())},e.Yp=function(i){e.ln=i;var n=e.Bg.copy();if(n!=null){for(n=n.iterator;n.next();){var s=n.value,a=e.getAttribute("src")||"",l=s.Og.I(a);if(l!==null){s=l.length,a=gi();for(var c=0;c<s;c++)a.push(l[c]);if(e.hn)for(c=0;c<s;c++)l=a[c],l.Hd!==null&&l.Hd(l,i);Ji(a)}}e.Bg.clear()}},e.addEventListener("load",e.Fq),e.addEventListener("error",e.Yp),e.qy=!0)}hh.prototype.hA=function(){if(this.source!==""){W0(this.source);var t=this.source;this.source="",this.source=t}},hh.prototype.redraw=function(){this.N(),this.Uc=!0},hh.prototype.hh=function(t,e){var i=this.Eg;if(i!==null){var n=i.getAttribute("src");if(!(i instanceof HTMLImageElement&&(n===null||n==="")||i.ln instanceof Event&&t instanceof Bf)){var s=t instanceof Fu;n=this.naturalBounds;var a=0,l=0,c=this.qn,p=c?+i.width:i.naturalWidth;if(c=c?+i.height:i.naturalHeight,p===void 0&&i.videoWidth&&(p=i.videoWidth),c===void 0&&i.videoHeight&&(c=i.videoHeight),p=p||n.width,c=c||n.height,p!==0&&c!==0){var m=p,v=c;this.sourceRect.w()&&(a=this.Xg.x,l=this.Xg.y,p=this.Xg.width,c=this.Xg.height);var w=p,C=c,k=this.Nk,T=this.Mk;switch(k){case Jt:if(this.sourceRect.w())break;w>=n.width&&(a=a+T.offsetX+(w*T.x-n.width*T.x)),C>=n.height&&(l=l+T.offsetY+(C*T.y-n.height*T.y)),p=Math.min(n.width,w),c=Math.min(n.height,C);break;case oe:w=n.width,C=n.height;break;case oi:case Bn:k===oi?(k=Math.min(n.height/C,n.width/w),w*=k,C*=k):k===Bn&&(k=Math.max(n.height/C,n.width/w),w*=k,C*=k,w>=n.width&&(a=(a+T.offsetX+(w*T.x-n.width*T.x)/w)*p),C>=n.height&&(l=(l+T.offsetY+(C*T.y-n.height*T.y)/C)*c),p*=1/(w/n.width),c*=1/(C/n.height),w=n.width,C=n.height)}k=this.Df()*e.scale;var A=w*k*C*k,X=p*c/A,$=i.__goCache;k=null;var J=e0;if(!s){if(i.sq&&$!==void 0&&4<A&&X>J*J)for($.gi===null&&(U0($,4,m,v,i),U0($,16,m,v,i)),s=$.gi,m=s.length,v=0;v<m&&s[v].ratio*s[v].ratio<X;v++)k=s[v];if(!e.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{s=new Pc(null).context;try{s.drawImage(this.Eg,0,0)}catch(et){this.en=!1}try{s.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(et){this.vl=!0}}if(this.vl)return}}switch(s=w<n.width?T.offsetX+(n.width*T.x-w*T.x):0,T=C<n.height?T.offsetY+(n.height*T.y-C*T.y):0,this.flip){case Vn:t.translate(Math.min(n.width,w),0),t.scale(-1,1);break;case gn:t.translate(0,Math.min(n.height,C)),t.scale(1,-1);break;case Hr:t.translate(Math.min(n.width,w),Math.min(n.height,C)),t.scale(-1,-1)}if(t.yc(),e.Gf("pictureRatioOptimization")&&!e.$i&&$!==void 0&&k!==null&&k.ratio!==1){t.save(),e=k.ratio;try{t.drawImage(k.source,a/e,l/e,Math.min(k.source.width,p/e),Math.min(k.source.height,c/e),s,T,Math.min(n.width,w),Math.min(n.height,C)),t instanceof Fu&&(this.bt=[a/e,l/e,Math.min(k.source.width,p/e),Math.min(k.source.height,c/e),s,T,Math.min(n.width,w),Math.min(n.height,C)])}catch(et){this.en=!1}t.restore()}else try{t.drawImage(i,a,l,p,c,s,T,Math.min(n.width,w),Math.min(n.height,C)),t instanceof Fu&&(this.bt=[a,l,p,c,s,T,Math.min(n.width,w),Math.min(n.height,C)])}catch(et){this.en=!1}switch(this.flip){case Vn:t.scale(-1,1),t.translate(-Math.min(n.width,w),0);break;case gn:t.scale(1,-1),t.translate(0,-Math.min(n.height,C));break;case Hr:t.scale(-1,-1),t.translate(-Math.min(n.width,w),-Math.min(n.height,C))}}}}},hh.prototype.Wl=function(t,e,i,n){var s=this.desiredSize,a=Qu(this,!0),l=this.Eg,c=this.qn,p=0,m=0;(c||!this.al&&l&&l.complete)&&(this.al=!0),l===null?(isFinite(s.width)||(t=0),isFinite(s.height)||(e=0)):(p=c?+l.width:l.naturalWidth,m=c?+l.height:l.naturalHeight),isFinite(s.width)||a===oe||a===mi?(isFinite(t)||(this.sourceRect.w()?t=this.sourceRect.width:l!==null&&(t=p)),i=0):l!==null&&this.al!==!1&&(t=this.sourceRect.w()?this.sourceRect.width:p),isFinite(s.height)||a===oe||a===Ii?(isFinite(e)||(this.sourceRect.w()?e=this.sourceRect.height:l!==null&&(e=m)),n=0):l!==null&&this.al!==!1&&(e=this.sourceRect.w()?this.sourceRect.height:m),isFinite(s.width)&&(t=s.width),isFinite(s.height)&&(e=s.height),s=this.maxSize,a=this.minSize,i=Math.max(i||0,a.width),n=Math.max(n||0,a.height),t=Math.min(s.width,t),e=Math.min(s.height,e),t=Math.max(i,t),e=Math.max(n,e),l===null||l.complete||(isFinite(t)||(t=0),isFinite(e)||(e=0)),yn(this.dc,t,e),this.Ge(0,0,t,e)},hh.prototype.eh=function(t,e,i,n){Hu(this,t,e,i,n)},St.Object.defineProperties(hh.prototype,{element:{get:function(){return this.Eg},set:function(t){var e=this.Eg;if(this.Uc=!0,e!==t){this.qn=t instanceof HTMLCanvasElement;var i=t instanceof HTMLImageElement;t===null||i||t instanceof HTMLVideoElement||this.qn||Mt("Picture.element must be an instance of Image, Canvas, or Video, not: "+t);var n=this.diagram;n!==null&&cl(n,this),this.Eg=t,t!==null&&i&&t.Bg===void 0&&(t.Bg=new te),n!==null&&i&&Du(n,this),t!==null&&(this.qn||t.complete===!0?(t.hn&&(t.ln instanceof Event&&this.Hd!==null?this.Hd(this,t.ln):t.sq===!0&&!t.ln&&this.Zg!==null&&t.eu&&this.Zg(this,t.eu)),t.sq=!0,this.desiredSize.w()||(ba(this,!1),this.v())):i&&a1(this,t)),this.g("element",e,t),this.N()}}},source:{get:function(){return this.qo},set:function(t){var e=this.qo;if(e!==t){this.Uc=!0,this.qo=t;var i=V0;if(ur){var n=null;if(i[t]!==void 0)n=i[t];else if(t!==""){30<t0&&(W0(),i=V0),n=we("img"),n.hn=!0,a1(this,n);var s=this.rl;s!==null&&(n.crossOrigin=s(this)),n.src=t,i[t]=n,t0++}this.element=n,n!==null&&n.__goCache===void 0&&(n.__goCache=new iy),this.v(),this.N()}this.g("source",e,t)}}},sourceCrossOrigin:{get:function(){return this.rl},set:function(t){if(this.rl!==t&&(this.rl=t,this.element!==null)){var e=this.element.getAttribute("src");t===null&&typeof e=="string"?this.element.crossOrigin=null:t!==null&&(this.element.crossOrigin=t(this)),this.element.src=e}}},sourceRect:{get:function(){return this.Xg},set:function(t){var e=this.Xg;e.D(t)||(this.Xg=t=t.J(),this.N(),this.g("sourceRect",e,t))}},imageStretch:{get:function(){return this.Nk},set:function(t){var e=this.Nk;e!==t&&(this.Nk=t,this.N(),this.g("imageStretch",e,t))}},flip:{get:function(){return this.Xf},set:function(t){var e=this.Xf;e!==t&&(this.Xf=t,this.N(),this.g("flip",e,t))}},imageAlignment:{get:function(){return this.Mk},set:function(t){var e=this.Mk;e.D(t)||(this.Mk=t=t.J(),this.N(),this.g("imageAlignment",e,t))}},errorFunction:{get:function(){return this.Hd},set:function(t){var e=this.Hd;e!==t&&(this.Hd=t,this.g("errorFunction",e,t))}},successFunction:{get:function(){return this.Zg},set:function(t){var e=this.Zg;e!==t&&(this.Zg=t,this.g("successFunction",e,t))}},naturalBounds:{get:function(){return this.dc}}}),hh.prototype.redraw=hh.prototype.redraw,hh.prototype.reloadSource=hh.prototype.hA;var t0=0,e0=4;hh.className="Picture",V0=new Bo,hh.clearCache=W0;function iy(){this.gi=null}function U0(t,e,i,n,s){t.gi===null&&(t.gi=[]);var a=new Pc(null),l=a.context,c=1/e;a.width=i/e,a.height=n/e,a.width!==0&&a.height!==0&&(e=new l1(a.Oa,e),i=1,0<t.gi.length&&(i=t.gi[t.gi.length-1],s=i.source,i=i.ratio),l.setTransform(c*i,0,0,c*i,0,0),l.yc(),l.drawImage(s,0,0),t.gi.push(e))}iy.className="PictureCacheArray";function l1(t,e){this.source=t,this.ratio=e}l1.className="PictureCacheInstance";function Bd(){this.os=new ve,this.mc=null}Bd.prototype.reset=function(t){t!==null?(t.ka(),this.os=t,t.figures.clear()):this.os=new ve,this.mc=null};function mp(t,e,i,n,s,a){t.mc=new fa,t.mc.startX=e,t.mc.startY=i,t.mc.isFilled=n,t.mc.isEvenOdd=a||!1,t.os.figures.add(t.mc),s!==void 0&&(t.mc.isShadowed=s)}function dx(t){var e=t.mc.segments.length;0<e&&t.mc.segments.M(e-1).close()}Bd.prototype.moveTo=function(t,e,i){i===void 0&&(i=!1);var n=new zn(oa);n.endX=t,n.endY=e,i&&n.close(),this.mc.segments.add(n)},Bd.prototype.lineTo=function(t,e,i){i===void 0&&(i=!1);var n=new zn(po);n.endX=t,n.endY=e,i&&n.close(),this.mc.segments.add(n)};function jc(t,e,i,n,s,a,l){var c;c===void 0&&(c=!1);var p=new zn($a);p.point1X=e,p.point1Y=i,p.point2X=n,p.point2Y=s,p.endX=a,p.endY=l,c&&p.close(),t.mc.segments.add(p)}function Fd(t,e,i,n,s){var a;a===void 0&&(a=!1);var l=new zn(ps);l.point1X=e,l.point1Y=i,l.endX=n,l.endY=s,a&&l.close(),t.mc.segments.add(l)}Bd.prototype.arcTo=function(t,e,i,n,s,a,l){a===void 0&&(a=0),l===void 0&&(l=!1);var c=new zn(sr);c.startAngle=t,c.sweepAngle=e,c.centerX=i,c.centerY=n,c.radiusX=s,c.radiusY=a!==0?a:s,l&&c.close(),this.mc.segments.add(c)};function gp(t,e,i,n,s,a,l,c){var p;p===void 0&&(p=!1),e=new zn(Vs,l,c,e,i,n,s,a),p&&e.close(),t.mc.segments.add(e)}function ny(t){var e=i0;return e!==null?(i0=null,e.reset(t),e):(e=new Bd,e.reset(t),e)}var i0=null;Bd.className="StreamGeometryContext";function Pl(t,e){var i=t.toLowerCase(),n=xt.Ze;n[t]=e,n[i]=t}Pl("Rectangle",function(t,e,i){t="r"+e+","+i;var n=xt.Mf[t];return n!==void 0||(n=new ve(ve.u),n.endX=e,n.endY=i,xt.Nf<xt.vm&&(xt.Mf[t]=n,xt.Nf++)),n}),Pl("Square",function(t,e,i){t="s"+e+","+i;var n=xt.Mf[t];return n!==void 0||(n=new ve(ve.u),n.endX=e,n.endY=i,n.defaultStretch=oi,xt.Nf<xt.vm&&(xt.Mf[t]=n,xt.Nf++)),n}),Pl("RoundedRectangle",function(t,e,i){t=t?t.parameter1:NaN,(isNaN(t)||0>t)&&(t=5),t=Math.min(t,e/3),t=Math.min(t,i/3);var n="rr"+e+","+i+","+t,s=xt.Mf[n];if(s!==void 0)return s;var a=t*xt.wg;return s=new ve().add(new fa(t,0,!0).add(new zn(po,e-t,0)).add(new zn($a,e,t,e-a,0,e,a)).add(new zn(po,e,i-t)).add(new zn($a,e-t,i,e,i-a,e-a,i)).add(new zn(po,t,i)).add(new zn($a,0,i-t,a,i,0,i-a)).add(new zn(po,0,t)).add(new zn($a,t,0,0,a,a,0).close())),1<a&&(s.spot1=new di(0,0,a,a),s.spot2=new di(1,1,-a,-a)),xt.Nf<xt.vm&&(xt.Mf[n]=s,xt.Nf++),s}),Pl("Border","RoundedRectangle"),Pl("Ellipse",function(t,e,i){t="e"+e+","+i;var n=xt.Mf[t];return n!==void 0||(n=new ve(ve.F),n.endX=e,n.endY=i,n.spot1=bu,n.spot2=rc,xt.Nf<xt.vm&&(xt.Mf[t]=n,xt.Nf++)),n}),Pl("Circle",function(t,e,i){t="c"+e+","+i;var n=xt.Mf[t];return n!==void 0||(n=new ve(ve.F),n.endX=e,n.endY=i,n.spot1=bu,n.spot2=rc,n.defaultStretch=oi,xt.Nf<xt.vm&&(xt.Mf[t]=n,xt.Nf++)),n}),Pl("TriangleRight",function(t,e,i){return new ve().add(new fa(0,0).add(new zn(po,e,.5*i)).add(new zn(po,0,i).close())).pm(0,.25,.5,.75)}),Pl("TriangleDown",function(t,e,i){return new ve().add(new fa(0,0).add(new zn(po,e,0)).add(new zn(po,.5*e,i).close())).pm(.25,0,.75,.5)}),Pl("TriangleLeft",function(t,e,i){return new ve().add(new fa(e,i).add(new zn(po,0,.5*i)).add(new zn(po,e,0).close())).pm(.5,.25,1,.75)}),Pl("TriangleUp",function(t,e,i){return new ve().add(new fa(e,i).add(new zn(po,0,i)).add(new zn(po,.5*e,0).close())).pm(.25,.5,.75,1)}),Pl("Triangle","TriangleUp"),Pl("Diamond",function(t,e,i){return new ve().add(new fa(.5*e,0).add(new zn(po,0,.5*i)).add(new zn(po,.5*e,i)).add(new zn(po,e,.5*i).close())).pm(.25,.25,.75,.75)}),Pl("LineH",function(t,e,i){return t=new ve(ve.j),t.startX=0,t.startY=i/2,t.endX=e,t.endY=i/2,t}),Pl("LineV",function(t,e,i){return t=new ve(ve.j),t.startX=e/2,t.startY=0,t.endX=e/2,t.endY=i,t}),Pl("None","Rectangle"),Pl("BarH","Rectangle"),Pl("BarV","Rectangle"),Pl("MinusLine","LineH"),Pl("PlusLine",function(t,e,i){return new ve().add(new fa(0,i/2,!1).add(new zn(po,e,i/2)).add(new zn(oa,e/2,0)).add(new zn(po,e/2,i)))}),Pl("XLine",function(t,e,i){return new ve().add(new fa(0,i,!1).add(new zn(po,e,0)).add(new zn(oa,0,0)).add(new zn(po,e,i)))}),Pl("LineRight",function(t,e,i){return new ve().add(new fa(.25*e,0,!1).add(new zn(po,.75*e,.5*i)).add(new zn(po,.25*e,i)))}),Pl("LineDown",function(t,e,i){return new ve().add(new fa(0,.25*i,!1).add(new zn(po,.5*e,.75*i)).add(new zn(po,e,.25*i)))}),Pl("LineLeft",function(t,e,i){return new ve().add(new fa(.75*e,0,!1).add(new zn(po,.25*e,.5*i)).add(new zn(po,.75*e,i)))}),Pl("LineUp",function(t,e,i){return new ve().add(new fa(0,.75*i,!1).add(new zn(po,.5*e,.25*i)).add(new zn(po,e,.75*i)))}),xt.um={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};function Z0(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=Yo,this.ir=null,this.jr="",this.lr=ds,this.Gq="",this.Hq=Fo,this.Pq=zs,this.Kq=Fa,this.Up=null,this.Cq=127,this.zr=ia,this.yr="gray",this.Vg=4}Z0.prototype.copy=function(){var t=new Z0;return t.zq=this.zq,t.Kp=this.Kp,t.tr=this.tr,t.vr=this.vr,t.ur=this.ur,t.oq=this.oq,t.fr=this.fr,t.hr=this.hr,t.gr=this.gr.J(),t.ir=this.ir,t.jr=this.jr,t.lr=this.lr.J(),t.Gq=this.Gq,t.Hq=this.Hq.J(),t.Pq=this.Pq.J(),t.Kq=this.Kq.J(),t.Up=this.Up,t.Cq=this.Cq,t.zr=this.zr.J(),t.yr=this.yr,t.Vg=this.Vg,t};function bi(t,e){t===void 0||t instanceof fl||typeof t=="string"?ce.call(this,t):(ce.call(this),t&&(e=t)),this.G=2408959,this.Tf="",this.P=null,this.Jg="",this.Qf=this.Ug=null,this.ec="",this.Ah=this.Ig=null,this.ke=new G(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new Tt,this.Rh=null,this.ag=NaN,e&&Object.assign(this,e)}li(bi,ce),bi.prototype.cloneProtected=function(t){ce.prototype.cloneProtected.call(this,t),t.G=this.G&-4097|49152,t.Tf=this.Tf,this.P!==null&&(t.P=this.P.nc?this.P:this.P.copy()),t.Jg=this.Jg,t.Qf=null,t.ec=this.ec,t.ke.assign(this.ke),t.Ao=this.Ao},L=bi.prototype,L.Af=function(t){ce.prototype.Af.call(this,t),t.oh(),t.Ug=null,t.nf=null,t.Rh=null},L.toString=function(){var t=Xi(this.constructor)+"#"+Io(this);return this.data!==null&&(t+="("+zr(this.data)+")"),t};function Ql(t){t.P===null?t.P=new Z0:t.P.nc&&(t.P=t.P.copy())}L.th=function(){ce.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},L.gk=function(t,e,i,n,s,a,l){var c=this.diagram;c!==null&&(t===qs&&e==="elements"?s instanceof ce?id(s,function(p){Pa(c.partManager,p),Wl(c,p)}):Du(c,s):t===aa&&e==="elements"&&(s instanceof ce?id(s,function(p){Vd(c.partManager,p,c)}):cl(c,s)),c.cb(t,e,i,n,s,a,l))},L.La=function(t){if(ce.prototype.La.call(this,t),this.data!==null){for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n];s instanceof ce&&id(s,function(a){a.data!==null&&a.La()})}for(e=this.adornments;e.next();)e.value.La(t)}},bi.prototype.updateRelationshipsFromData=function(){var t;this.data!==null&&((t=this.diagram)===null||t===void 0||t.partManager.updateRelationshipsFromData(this))},bi.prototype.Pj=function(t){var e=this.Qf;return e===null?null:e.I(t)},bi.prototype.bh=function(t,e){if(e!==null){var i=null,n=this.Qf;if(n!==null&&(i=n.I(t)),i!==e){if(i!==null){var s=i.diagram;s!==null&&s.remove(i)}n===null&&(this.Qf=n=new ci),e.Tf!==t&&(e.category=t),n.add(t,e),t=this.diagram,t!==null&&(t.add(e),t=e.adornedObject,t!==null&&(t=t.ih(),t!==null&&(e.data=t.data)))}}},bi.prototype.Jf=function(t){var e=this.Qf;if(e!==null){var i=e.I(t);if(i!==null){var n=i.diagram;n!==null&&n.remove(i)}e.remove(t),e.count===0&&(this.Qf=null)}},bi.prototype.Ej=function(){var t=this.Qf;if(t!==null){var e=gi();for(t=t.iterator;t.next();)e.push(t.key);t=e.length;for(var i=0;i<t;i++)this.Jf(e[i]);Ji(e)}},bi.prototype.updateAdornments=function(){var t=this.diagram;if(t!==null){for(var e=this.adornments;e.next();){var i=e.value;i.v(),i.placeholder&&i.placeholder.v()}t:{if(this.isSelected&&this.selectionAdorned&&(e=this.selectionObject,e!==null&&this.actualBounds.w()&&this.isVisible()&&e.Ed()&&e.actualBounds.w())){if(i=this.Pj("Selection"),i===null){if(i=this.selectionAdornmentTemplate,i===null&&(i=this.ph()?t.linkSelectionAdornmentTemplate:this instanceof Yi?t.groupSelectionAdornmentTemplate:t.nodeSelectionAdornmentTemplate),!(i instanceof pr))break t;Sh(i),i=i.copy(),i!==null&&(this.ph()&&this.selectionObject===this.path&&(i.type=ce.Link),i.adornedObject=e)}if(i!==null){i.type===ce.Link&&i.v(),this.bh("Selection",i);break t}}this.Jf("Selection")}for(px(this,t),e=this.adornments;e.next();)e.value.La()}},bi.prototype.Wb=function(){var t=this.diagram;t!==null&&(t.vd=!0,!(this.G&16384)&&(this.G|=16384))};function Fm(t){t.G&16384&&(t.updateAdornments(),t.G&=-16385)}function px(t,e){e.toolManager.mouseDownTools.each(function(i){i.isEnabled&&i.updateAdornments(t)}),e.toolManager.updateAdornments(t)}function Zg(t){if(vd(t)===!1){ry(t,!0),t.Uk();var e=t.diagram;e!==null&&(e.De.add(t),e.$b())}}function u1(t){if(t.G|=2097152,vd(t)!==!1){var e=t.position,i=t.location;i.w()&&e.w()||vp(t,e,i),i=t.Ib;var n=Tt.alloc().assign(i);i.ka(),i.x=e.x,i.y=e.y,i.freeze(),t.Xl(n,i),Tt.free(n),ry(t,!1)}}bi.prototype.Ge=function(t,e,i,n){var s=this.uc;s.h(t,e,i,n),this.Lb===null&&(this.Lb=new dn);var a=this.Lb;a.reset(),this.no(a,t,e,i,n),this.Lb=a,a.ws()||a.pp(s)},bi.prototype.no=function(t,e,i,n,s){if(this.Ca!==1&&t.scale(this.Ca),this.Kb!==0){var a=_n;this.locationSpot.sb()&&(a=this.locationSpot);var l=G.alloc();if(this.locationObject!==this)for(e=this.locationObject,i=e.naturalBounds,l.yi(i.x,i.y,i.width,i.height,a),e.Lb!==null&&e.Lb.Ga(l),l.offset(-e.measuredBounds.x,-e.measuredBounds.y),a=e.panel;a!==null&&a!==this;)a.Lb!==null&&a.Lb.Ga(l),l.offset(-a.measuredBounds.x,-a.measuredBounds.y),a=a.panel;else l.yi(e,i,n,s,a);t.rotate(this.Kb,l.x,l.y),G.free(l)}},bi.prototype.move=function(t,e){e===!0?this.location=t:this.position=t},bi.prototype.moveTo=function(t,e,i){t=G.allocAt(t,e),this.move(t,i),G.free(t)},bi.prototype.isVisible=function(){if(!this.visible)return!1;var t=this.layer;if(t!==null){if(!t.visible)return!1;if(t=t.diagram,t!==null&&t.animationManager.fv(this))return!0}return t=this.containingGroup,!!(t===null||t.isSubGraphExpanded&&t.isVisible())},bi.prototype.Zb=function(t){var e=this.diagram;t?(this.C(4),this.Wb(),e!==null&&e.De.add(this)):(this.C(8),this.Ej()),this.oh(),e!==null&&(e.Ya(),e.N())},bi.prototype.fb=function(t){if(this.name===t)return this;var e=this.Rh;if(e===null&&(this.Rh=e=new ci),e.I(t)!==null)return e.I(t);var i=ce.prototype.fb.call(this,t);return i!==null?(e.set(t,i),i):(e.set(t,null),null)};function zf(t,e,i,n){n===void 0&&(n=new G),i=i.Mc()?_n:i;var s=e.naturalBounds;if(n.h(s.width*i.x+i.offsetX,s.height*i.y+i.offsetY),e===null||e===t)return n;for(e.transform.Ga(n),e=e.panel;e!==null&&e!==t;)e.transform.Ga(n),e=e.panel;return t.Lb!==null&&t.Lb.Ga(n),n.offset(-t.uc.x,-t.uc.y),n}bi.prototype.mi=function(t){return t===void 0&&(t=new Tt),t.assign(this.actualBounds)},bi.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function xf(t){var e=G.alloc(),i=t.locationObject,n=i.naturalBounds,s=i instanceof pn?i.strokeWidth:0;if(e.yi(0,0,n.width+s,n.height+s,t.locationSpot),i!==t)for(e.offset(-s/2,-s/2),i.transform.Ga(e),i=i.panel;i!==null&&i!==t;)i.transform.Ga(e),i=i.panel;return t.Lb!==null&&t.Lb.Ga(e),e.offset(-t.uc.x,-t.uc.y),e}function of(t,e){var i=t.py;isNaN(t.ag)&&(t.ag=t1(t));var n=t.ag,s=2*n;if(!t.isShadowed)return i.h(e.x-1-n,e.y-1-n,e.width+2+s,e.height+2+s),i;n=e.x,s=e.y;var a=e.width;e=e.height;var l=t.shadowBlur;return t=t.shadowOffset,a+=l,e+=l,n-=l/2,s-=l/2,0<t.x?a+=t.x:(n+=t.x,a-=t.x),0<t.y?e+=t.y:(s+=t.y,e-=t.y),i.h(n-1,s-1,a+2,e+2),i}bi.prototype.arrange=function(){if(Vu(this)===!1)u1(this);else{au(this,!1);var t=this.Ib,e=Tt.alloc();e.assign(t);var i=zd(this);this.eh(0,0,this.uc.width,this.uc.height);var n=this.position;vp(this,n,this.location),t.ka(),t.x=n.x,t.y=n.y,t.freeze(),this.Xl(e,t),e.D(t)?this.Fd(i):!this.Zc()||xt.B(e.width,t.width)&&xt.B(e.height,t.height)||0<=this.vw&&this.C(16),Tt.free(e),ry(this,!1)}},L=bi.prototype,L.Xl=function(t,e){var i=this.diagram;if(i!==null){var n=!1;if(i.Zi===!1&&t.w()){var s=Tt.alloc();s.assign(i.documentBounds),s.Fv(i.padding),t.x>s.x&&t.y>s.y&&t.right<s.right&&t.bottom<s.bottom&&e.x>s.x&&e.y>s.y&&e.right<s.right&&e.bottom<s.bottom&&(n=!0),Tt.free(s)}!(this.G&65536)&&t.D(e)||zm(this,n,i),i.N(),!t.w()&&!e.w()||ls(t,e)||(this instanceof Ee&&!i.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},L.zv=function(t,e,i){if(this.ph()||!t.w())return!1;var n=this.diagram;return n!==null&&h1(this,n,t,e,i),this.pa=t,this.G&=-2097153,!this.ke.w()||n!==null&&!n.animationManager.isTicking&&n.undoManager.isUndoingRedoing||(n=this.ke,this.ke=new G(n.x+(t.x-e),n.y+(t.y-i)),this.g("location",n,this.ke.copy())),vd(this)===!1&&Vu(this)===!1&&(Zg(this),u1(this)),!0};function h1(t,e,i,n,s){e===null||t instanceof pr||(e=e.animationManager,e.zb&&dt(e,t,new G(n,s),i))}L.mm=function(t,e,i){var n=this.ke,s=this.pa;if(i){if(n.x===t&&n.y===e)return;vd(this)||Vu(this)?s.h(NaN,NaN):s.h(s.x+t-n.x,s.y+e-n.y),n.h(t,e)}else{if(s.x===t&&s.y===e)return;n.h(n.x+t-s.x,n.y+e-s.y),s.h(t,e)}Zg(this)},L.Av=function(){this.G&=-2097153,Zg(this)};function vp(t,e,i){var n=xf(t),s=t.diagram,a=i.w(),l=e.w();a&&l?t.G&2097152?c1(t,e,i,s,n):yp(t,e,i,s,n):a?c1(t,e,i,s,n):l&&yp(t,e,i,s,n),t.G|=2097152,G.free(n),t.Uk()}function c1(t,e,i,n,s){var a=e.x,l=e.y;e.h(i.x-s.x,i.y-s.y),n!==null&&(i=n.animationManager,(n=i.defaultAnimation.isAnimating)||!i.zb||t instanceof pr||dt(i,t,new G(a,l),e),n||e.x===a&&e.y===l||t.g("position",new G(a,l),e.copy()))}function yp(t,e,i,n,s){var a=i.copy();i.h(e.x+s.x,e.y+s.y),i.D(a)||n===null||t.g("location",a,i.copy())}function zm(t,e,i){Gg(t,!1),t instanceof Ee&&Ku(i,t),t.layer.isTemporary||e||i.Ya(),e=t.Ib;var n=i.viewportBounds;n.w()?zd(t)?($s(e,n)||t.Fd(!1),t.updateAdornments()):t.isVisible()&&e.Yc(n)?(t.Fd(!0),t.updateAdornments()):t.Wb():i.vd=!0}L.si=function(){return!0},L.Zc=function(){return!0},L.ph=function(){return!1},L.Dd=function(){return!0};function G0(t,e,i,n){e.constructor===t.constructor||d1||(d1=!0,_i('Should not change the class of the Part when changing category from "'+i+'" to "'+n+'"'),_i(" Old class: "+Xi(t.constructor)+", new class: "+Xi(e.constructor)+", part: "+t.toString())),t.Ej();var s=t.data;i=t.layerName;var a=t.isSelected,l=t.isHighlighted,c=!0,p=!0,m=!1;t instanceof Ee&&(c=t.isTreeLeaf,p=t.isTreeExpanded,m=t.wasTreeExpanded),e.Af(t),e.cloneProtected(t),t.Tf=n,t.svg!==null&&(t.svg.remove(),t.svg=null,t.Uc=!0),t.v(),t.N(),e=t.diagram,n=!0,e!==null&&(n=e.skipsUndoManager,e.skipsUndoManager=!0),t.ub=s,t.G=a?t.G|4096:t.G&-4097,t.G=l?t.G|524288:t.G&-524289,t instanceof Ee&&(t.U=c?t.U|4:t.U&-5,t.U=p?t.U|1:t.U&-2,t.U=m?t.U|2:t.U&-3),s!==null&&t.La(),s=t.layerName,s!==i&&(t.Jg=i,t.layerName=s),e!==null&&(e.skipsUndoManager=n),t.Zc()&&t.C(64)}bi.prototype.canCopy=function(){if(!this.copyable)return!1;var t=this.layer;return t===null?!0:t.allowCopy?(t=t.diagram,t===null?!0:!!t.allowCopy):!1},bi.prototype.canDelete=function(){if(!this.deletable)return!1;var t=this.layer;return t===null?!0:t.allowDelete?(t=t.diagram,t===null?!0:!!t.allowDelete):!1},bi.prototype.canEdit=function(){if(!this.textEditable)return!1;var t=this.layer;return t===null?!0:t.allowTextEdit?(t=t.diagram,t===null?!0:!!t.allowTextEdit):!1},bi.prototype.canGroup=function(){if(!this.groupable)return!1;var t=this.layer;return t===null?!0:t.allowGroup?(t=t.diagram,t===null?!0:!!t.allowGroup):!1},bi.prototype.canMove=function(){if(!this.movable)return!1;var t=this.layer;return t===null?!0:t.allowMove?(t=t.diagram,t===null?!0:!!t.allowMove):!1},bi.prototype.canReshape=function(){if(!this.reshapable)return!1;var t=this.layer;return t===null?!0:t.allowReshape?(t=t.diagram,t===null?!0:!!t.allowReshape):!1},bi.prototype.canResize=function(){if(!this.resizable)return!1;var t=this.layer;return t===null?!0:t.allowResize?(t=t.diagram,t===null?!0:!!t.allowResize):!1},bi.prototype.canRotate=function(){if(!this.rotatable)return!1;var t=this.layer;return t===null?!0:t.allowRotate?(t=t.diagram,t===null?!0:!!t.allowRotate):!1},bi.prototype.canSelect=function(){if(!this.selectable)return!1;var t=this.layer;return t===null?!0:t.allowSelect?(t=t.diagram,t===null?!0:!!t.allowSelect):!1};function vd(t){return(t.G&32768)!==0}function ry(t,e){t.G=e?t.G|32768:t.G&-32769}function Gg(t,e){t.G=e?t.G|65536:t.G&-65537}function zd(t){return(t.G&131072)!==0}L=bi.prototype,L.Fd=function(t){this.G=t?this.G|131072:this.G&-131073};function $m(t,e){t.G=e?t.G|1048576:t.G&-1048577}L.oh=function(){var t=this.containingGroup;t!==null&&(t.v(),t.placeholder!==null&&t.placeholder.v(),t.Bd())},L.N=function(){var t=this.diagram;t!==null&&!Vu(this)&&!vd(this)&&this.isVisible()&&this.Ib.w()&&t.N(of(this,this.Ib))},L.v=function(){ce.prototype.v.call(this);var t=this.diagram;t!==null&&(t.De.add(this),this instanceof Ee&&this.labeledLink!==null&&Rl(this.labeledLink),t.$b(!0))},L.Vo=function(t){t||(t=this.Ah,t!==null&&hy(t,this))},L.Wo=function(t){t||(t=this.Ah,t!==null&&cy(t,this))},L.Lj=function(){var t=this.data;if(t!==null){var e=this.diagram;e!==null&&(e=e.model,e!==null&&e.cm(t))}},L.oz=function(){return Xg(this,this)};function Xg(t,e){var i=e.containingGroup;return i!==null?1+Xg(t,i):e instanceof Ee&&(e=e.labeledLink,e!==null)?Xg(t,e):0}L.sz=function(){return f1(this,this)};function f1(t,e){var i=e.containingGroup;return i!==null||e instanceof Ee&&(i=e.labeledLink,i!==null)?f1(t,i):e}L.Td=function(t){return t instanceof Yi?oy(this,this,t):!1};function oy(t,e,i){if(e===i||i===null)return!1;var n=e.containingGroup;return n===null||n!==i&&!oy(t,n,i)?e instanceof Ee&&(e=e.labeledLink,e!==null)?oy(t,e,i):!1:!0}L.px=function(t){if(t===null)return null;if(this===t)return this.containingGroup;for(var e=this;e!==null;){if(e instanceof Yi&&$m(e,!0),e instanceof Ee){var i=e.labeledLink;i!==null&&(e=i)}e=e.containingGroup}for(i=null,e=t;e!==null;){if(e.G&1048576){i=e;break}e instanceof Ee&&(t=e.labeledLink,t!==null&&(e=t)),e=e.containingGroup}for(e=this;e!==null;)e instanceof Yi&&$m(e,!1),e instanceof Ee&&(t=e.labeledLink,t!==null&&(e=t)),e=e.containingGroup;return i},bi.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var t=this.layer;return!(t!==null&&t.isTemporary||this instanceof Ee&&this.isLinkLabel)},bi.prototype.C=function(t){if(t===void 0&&(t=16777215),this.isLayoutPositioned&&t&this.layoutConditions){var e=this.layer;e!==null&&e.isTemporary||this instanceof Ee&&this.isLinkLabel?e=!1:(e=this.diagram,e=!(e!==null&&e.undoManager.isUndoingRedoing))}else e=!1;if(e)if(e=this.Ah,e!==null){var i=e.layout;i!==null?i.C():e.C(t)}else t=this.diagram,t!==null&&(t=t.layout,t!==null&&t.C())};function jm(t){return t.isVisible()?(t=t.layer,!(t!==null&&t.isTemporary)):!1}function yd(t,e,i,n,s,a){if(a===void 0&&(a=null),!(t.contains(e)||a!==null&&!a(e)||e instanceof pr)){if(t.add(e),e instanceof Ee){if(i&&e instanceof Yi)for(var l=e.memberParts;l.next();)yd(t,l.value,i,n,s,a);if(s!==!1)for(l=e.linksConnected;l.next();){var c=l.value;if(!t.contains(c)){var p=c.fromNode,m=c.toNode;p=p===null||t.contains(p),m=m===null||t.contains(m),(s?p&&m:p||m)&&yd(t,c,i,n,s,a)}}if(1<n)for(e=e.Ou();e.next();)yd(t,e.value,i,n-1,s,a)}else if(e instanceof ge)for(e=e.labelNodes;e.next();)yd(t,e.value,i,n,s,a)}}St.Object.defineProperties(bi.prototype,{key:{get:function(){var t=this.diagram;if(t!==null)return t.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?Tr:this.Qf.iteratorValues}},layer:{get:function(){return this.Ig}},diagram:{get:function(){var t=this.Ig;return t==null?null:t.diagram}},layerName:{get:function(){return this.Jg},set:function(t){var e=this.Jg;if(e!==t){var i=this.diagram;if((i===null||i.Qj(t)!==null&&!i.partManager.addsToTemporaryLayer)&&(this.Jg=t,i!==null&&i.Ya(),this.g("layerName",e,t),e=this.layer,e!==null&&e.name!==t&&(i=e.diagram,i!==null&&(t=i.Qj(t),t!==null&&t!==e)))){var n=e.pc(-1,this,!0);if(0<=n&&i.cb(aa,"parts",e,this,null,n,!0),n=t.oi(99999999,this,!0),e.visible!==t.visible&&this.Zb(t.visible),0<=n&&i.cb(qs,"parts",t,null,this,!0,n),n=this.layerChanged,n!==null){var s=i.aa;i.aa=!0,n(this,e,t),i.aa=s}}}}},layerChanged:{get:function(){return this.P!==null?this.P.zq:null},set:function(t){var e=this.layerChanged;e!==t&&(Ql(this),this.P.zq=t,this.g("layerChanged",e,t))}},zOrder:{get:function(){return this.Ao},set:function(t){var e=this.Ao;if(e!==t){this.Ao=t;var i=this.layer;i!==null&&tr(i,-1,this),this.g("zOrder",e,t),t=this.diagram,t!==null&&t.N()}}},locationObject:{get:function(){if(this.nf===null){var t=this.locationObjectName;t!==""?(t=this.fb(t),t!==null?this.nf=t:this.nf=this):this instanceof pr?this.type!==ce.Link&&this.placeholder!==null?this.nf=this.placeholder:this.nf=this:this.nf=this}return this.nf.visible?this.nf:this}},minLocation:{get:function(){return this.P!==null?this.P.Pq:zs},set:function(t){var e=this.minLocation;e.D(t)||(t=t.J(),Ql(this),this.P.Pq=t,this.g("minLocation",e,t))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Fa},set:function(t){var e=this.maxLocation;e.D(t)||(t=t.J(),Ql(this),this.P.Kq=t,this.g("maxLocation",e,t))}},locationObjectName:{get:function(){return this.P!==null?this.P.Gq:""},set:function(t){var e=this.locationObjectName;e!==t&&(Ql(this),this.P.Gq=t,this.nf=null,this.v(),this.g("locationObjectName",e,t))}},locationSpot:{get:function(){return this.P!==null?this.P.Hq:Fo},set:function(t){var e=this.locationSpot;e.D(t)||(t=t.J(),Ql(this),this.P.Hq=t,this.v(),this.g("locationSpot",e,t))}},location:{get:function(){return this.ke},set:function(t){var e=t.x,i=t.y,n=this.ke;if(!(n.x===e||isNaN(n.x)&&isNaN(e))||!(n.y===i||isNaN(n.y)&&isNaN(i))){if(t=t.copy(),e=t,this.ph())e=!1;else{if(this.ke=e,this.G|=2097152,Vu(this)===!1&&(Zg(this),i=this.pa,i.w())){var s=this.diagram;if(s===null||s.animationManager.isTicking||!s.undoManager.isUndoingRedoing){var a=i.copy();i.h(i.x+(e.x-n.x),i.y+(e.y-n.y)),h1(this,s,i,a.x,a.y),this.g("position",a,i.copy())}}e=!0}e&&this.g("location",n,t.copy())}}},category:{get:function(){return this.Tf},set:function(t){var e=this.Tf;if(e!==t){this.svg!==null&&(this.svg.remove(),this.Uc=!0);var i=this.diagram,n=this.data,s=null;if(i!==null&&n!==null&&!(this instanceof pr)){var a=i.model.undoManager;a.isEnabled&&!a.isUndoingRedoing&&(s=this.clone(),s.O.addAll(this.O))}this.Tf=t,this.g("category",e,t),i===null||n===null||this instanceof pr?this instanceof pr&&(s=this.adornedPart,s!==null&&(t=s.Qf,t!==null&&t.remove(e),s.bh(this.category,this))):(a=i.model,a.undoManager.isUndoingRedoing||(this.ph()?(i.partManager.setLinkCategoryForData(n,t),i=i.partManager.findLinkTemplateForCategory(t),i!==null&&(Sh(i),i=i.copy(),i!==null&&G0(this,i,e,t))):(a!==null&&a.jm(n,t),i=M1(i.partManager,n,t),i!==null&&(Sh(i),i=i.copy(),i===null||i instanceof ge||(n=this.location.copy(),G0(this,i,e,t),this.location.w()||(this.location=n)))),s!==null&&(e=this.clone(),e.O.addAll(this.O),this.g("self",s,e))))}}},self:{get:function(){return this},set:function(t){G0(this,t,this.category,t.category)}},copyable:{get:function(){return(this.G&1)!==0},set:function(t){var e=(this.G&1)!==0;e!==t&&(this.G^=1,this.g("copyable",e,t))}},deletable:{get:function(){return(this.G&2)!==0},set:function(t){var e=(this.G&2)!==0;e!==t&&(this.G^=2,this.g("deletable",e,t))}},textEditable:{get:function(){return(this.G&4)!==0},set:function(t){var e=(this.G&4)!==0;e!==t&&(this.G^=4,this.g("textEditable",e,t),this.Wb())}},groupable:{get:function(){return(this.G&8)!==0},set:function(t){var e=(this.G&8)!==0;e!==t&&(this.G^=8,this.g("groupable",e,t))}},movable:{get:function(){return(this.G&16)!==0},set:function(t){var e=(this.G&16)!==0;e!==t&&(this.G^=16,this.g("movable",e,t))}},selectionAdorned:{get:function(){return(this.G&32)!==0},set:function(t){var e=(this.G&32)!==0;e!==t&&(this.G^=32,this.g("selectionAdorned",e,t),this.Wb())}},isInDocumentBounds:{get:function(){return(this.G&64)!==0},set:function(t){var e=(this.G&64)!==0;if(e!==t){this.G^=64;var i=this.diagram;i!==null&&i.Ya(),this.g("isInDocumentBounds",e,t)}}},isLayoutPositioned:{get:function(){return(this.G&128)!==0},set:function(t){var e=(this.G&128)!==0;e!==t&&(this.G^=128,this.g("isLayoutPositioned",e,t),this.C(t?4:8))}},selectable:{get:function(){return(this.G&256)!==0},set:function(t){var e=(this.G&256)!==0;e!==t&&(this.G^=256,this.g("selectable",e,t),this.Wb())}},reshapable:{get:function(){return(this.G&512)!==0},set:function(t){var e=(this.G&512)!==0;e!==t&&(this.G^=512,this.g("reshapable",e,t),this.Wb())}},resizable:{get:function(){return(this.G&1024)!==0},set:function(t){var e=(this.G&1024)!==0;e!==t&&(this.G^=1024,this.g("resizable",e,t),this.Wb())}},rotatable:{get:function(){return(this.G&2048)!==0},set:function(t){var e=(this.G&2048)!==0;e!==t&&(this.G^=2048,this.g("rotatable",e,t),this.Wb())}},isSelected:{get:function(){return(this.G&4096)!==0},set:function(t){var e=(this.G&4096)!==0;if(e!==t){var i=this.diagram;if(!t||this.canSelect()&&!(i!==null&&i.selection.count>=i.maxSelectionCount)){this.G^=4096;var n=!1;if(i!==null){n=i.skipsUndoManager,i.skipsUndoManager=!0;var s=i.selection;s.ka(),t?s.add(this):s.remove(this),s.freeze()}this.g("isSelected",e,t),this.Wb(),t=this.selectionChanged,t!==null&&t(this),i!==null&&(i.$b(),i.skipsUndoManager=n)}}}},isHighlighted:{get:function(){return(this.G&524288)!==0},set:function(t){var e=(this.G&524288)!==0;if(e!==t){this.G^=524288;var i=this.diagram;i!==null&&(i=i.highlighteds,i.ka(),t?i.add(this):i.remove(this),i.freeze()),this.g("isHighlighted",e,t),this.N(),t=this.highlightedChanged,t!==null&&t(this)}}},isShadowed:{get:function(){return(this.G&8192)!==0},set:function(t){var e=(this.G&8192)!==0;e!==t&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",e,t),this.N())}},isAnimated:{get:function(){return(this.G&262144)!==0},set:function(t){var e=(this.G&262144)!==0;e!==t&&(this.G^=262144,this.g("isAnimated",e,t))}},highlightedChanged:{get:function(){return this.P!==null?this.P.oq:null},set:function(t){var e=this.highlightedChanged;e!==t&&(Ql(this),this.P.oq=t,this.g("highlightedChanged",e,t))}},selectionObjectName:{get:function(){return this.P!==null?this.P.vr:""},set:function(t){var e=this.selectionObjectName;e!==t&&(Ql(this),this.P.vr=t,this.Ug=null,this.g("selectionObjectName",e,t))}},selectionAdornmentTemplate:{get:function(){return this.P!==null?this.P.tr:null},set:function(t){var e=this.selectionAdornmentTemplate;e!==t&&(Ql(this),this.P.tr=t,this.g("selectionAdornmentTemplate",e,t))}},selectionObject:{get:function(){if(this.Ug===null){var t=this.selectionObjectName;t!==null&&t!==""?(t=this.fb(t),t!==null?this.Ug=t:this.Ug=this):this instanceof ge?(t=this.path,t!==null?this.Ug=t:this.Ug=this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return this.P!==null?this.P.ur:null},set:function(t){var e=this.selectionChanged;e!==t&&(Ql(this),this.P.ur=t,this.g("selectionChanged",e,t))}},resizeAdornmentTemplate:{get:function(){return this.P!==null?this.P.fr:null},set:function(t){var e=this.resizeAdornmentTemplate;e!==t&&(Ql(this),this.P.fr=t,this.g("resizeAdornmentTemplate",e,t))}},resizeObjectName:{get:function(){return this.P!==null?this.P.hr:""},set:function(t){var e=this.resizeObjectName;e!==t&&(Ql(this),this.P.hr=t,this.g("resizeObjectName",e,t))}},resizeObject:{get:function(){var t=this.resizeObjectName;return t!==""&&(t=this.fb(t),t!==null)?t:this}},resizeCellSize:{get:function(){return this.P!==null?this.P.gr:Yo},set:function(t){var e=this.resizeCellSize;e.D(t)||(t=t.J(),Ql(this),this.P.gr=t,this.g("resizeCellSize",e,t))}},rotateAdornmentTemplate:{get:function(){return this.P!==null?this.P.ir:null},set:function(t){var e=this.rotateAdornmentTemplate;e!==t&&(Ql(this),this.P.ir=t,this.g("rotateAdornmentTemplate",e,t))}},rotateObjectName:{get:function(){return this.P!==null?this.P.jr:""},set:function(t){var e=this.rotateObjectName;e!==t&&(Ql(this),this.P.jr=t,this.g("rotateObjectName",e,t))}},rotateObject:{get:function(){var t=this.rotateObjectName;return t!==""&&(t=this.fb(t),t!==null)?t:this}},rotationSpot:{get:function(){return this.P!==null?this.P.lr:ds},set:function(t){var e=this.rotationSpot;e.D(t)||(t=t.J(),Ql(this),this.P.lr=t,this.g("rotationSpot",e,t))}},text:{get:function(){return this.ec},set:function(t){var e=this.ec;e!==t&&(this.ec=t,this.g("text",e,t))}},containingGroup:{get:function(){return this.Ah},set:function(t){if(this.Zc()){var e=this.Ah;if(e!==t){t===null||this!==t&&!t.Td(this)||(this===t&&Mt("Cannot make a Group a member of itself: "+this.toString()),Mt("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+t.toString())),this.C(2);var i=this.diagram;if(e!==null?cy(e,this):this instanceof Yi&&i!==null&&i.ai.remove(this),this.Ah=t,t!==null?hy(t,this):this instanceof Yi&&i!==null&&i.ai.add(this),this.C(1),i!==null&&i.aa){var n=this.data,s=i.model;if(n!==null&&s.Xj()){var a=s.wa(t!==null?t.data:null);s.mp(n,a)}}if(n=this.containingGroupChanged,n!==null&&(s=!0,i!==null&&(s=i.aa,i.aa=!0),n(this,e,t),i!==null&&(i.aa=s)),this instanceof Yi){for(i=new te,yd(i,this,!0,0,!0),i=i.iterator;i.next();)if(n=i.value,n instanceof Ee)for(n=n.linksConnected;n.next();)r0(n.value)}if(this instanceof Ee){for(i=this.linksConnected;i.next();)r0(i.value);i=this.labeledLink,i!==null&&r0(i)}this.g("containingGroup",e,t),t!==null&&(e=t.layer,e!==null&&tr(e,-1,t))}}else Mt("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return this.P!==null?this.P.Kp:null},set:function(t){var e=this.containingGroupChanged;e!==t&&(Ql(this),this.P.Kp=t,this.g("containingGroupChanged",e,t))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof Ee&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(t){var e=this.layoutConditions;e!==t&&(Ql(this),this.P.Cq=t,this.g("layoutConditions",e,t))}},dragComputation:{get:function(){return this.P!==null?this.P.Up:null},set:function(t){var e=this.dragComputation;e!==t&&(Ql(this),this.P.Up=t,this.g("dragComputation",e,t))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:ia},set:function(t){var e=this.shadowOffset;e.D(t)||(t=t.J(),Ql(this),this.P.zr=t,this.N(),this.g("shadowOffset",e,t))}},shadowColor:{get:function(){return this.P!==null?this.P.yr:"gray"},set:function(t){var e=this.shadowColor;e!==t&&(Ql(this),this.P.yr=t,this.N(),this.g("shadowColor",e,t))}},shadowBlur:{get:function(){return this.P!==null?this.P.Vg:4},set:function(t){var e=this.shadowBlur;e!==t&&(Ql(this),this.P.Vg=t,this.N(),this.g("shadowBlur",e,t))}}}),bi.prototype.invalidateLayout=bi.prototype.C,bi.prototype.findCommonContainingGroup=bi.prototype.px,bi.prototype.isMemberOf=bi.prototype.Td,bi.prototype.findTopLevelPart=bi.prototype.sz,bi.prototype.findSubGraphLevel=bi.prototype.oz,bi.prototype.ensureBounds=bi.prototype.Va,bi.prototype.getDocumentBounds=bi.prototype.mi,bi.prototype.findObject=bi.prototype.fb,bi.prototype.moveTo=bi.prototype.moveTo,bi.prototype.invalidateAdornments=bi.prototype.Wb,bi.prototype.clearAdornments=bi.prototype.Ej,bi.prototype.removeAdornment=bi.prototype.Jf,bi.prototype.addAdornment=bi.prototype.bh,bi.prototype.findAdornment=bi.prototype.Pj,bi.prototype.updateTargetBindings=bi.prototype.La;var d1=!1;bi.className="Part",bi.LayoutNone=0,bi.LayoutAdded=1,bi.LayoutRemoved=2,bi.LayoutShown=4,bi.LayoutHidden=8,bi.LayoutNodeSized=16,bi.LayoutGroupLayout=32,bi.LayoutNodeReplaced=64,bi.LayoutStandard=127,bi.LayoutAll=16777215;function pr(t,e){t===void 0||t instanceof fl||typeof t=="string"?bi.call(this,t):(bi.call(this),t&&(e=t)),this.G&=-257,this.Jg="Adornment",this.ue=null,this.Aw=0,this.Uw=!1,this.j=this.$a=null,e&&Object.assign(this,e)}li(pr,bi),pr.prototype.toString=function(){var t=this.adornedPart;return"Adornment("+this.category+")"+(t!==null?t.toString():"")},pr.prototype.updateRelationshipsFromData=function(){},pr.prototype.Ul=function(t){var e=this.adornedObject,i=e==null?void 0:e.part;if(i instanceof ge&&e instanceof pn){e=i.path,i.Ul(t),t=e.geometry,i=this.O.s,e=i.length;for(var n=0;n<e;n++){var s=i[n];s.isPanelMain&&s instanceof pn&&(s.ua=t)}}},pr.prototype.si=function(){var t=this.ue;return t===null?!0:(t=t.part,t===null||!Vu(t))},pr.prototype.Zc=function(){return!1},pr.prototype.gk=function(t,e,i,n,s,a,l){if(t===qs&&e==="elements"){if(s instanceof Wu)this.$a===null&&(this.$a=s);else if(s instanceof ce){var c=s.Nl(function(p){return p instanceof Wu});c instanceof Wu&&this.$a===null&&(this.$a=c)}}else t===aa&&e==="elements"&&this.$a!==null&&(n===this.$a?this.$a=null:n instanceof ce&&this.$a.rg(n)&&(this.$a=null));bi.prototype.gk.call(this,t,e,i,n,s,a,l)},pr.prototype.updateAdornments=function(){},pr.prototype.Lj=function(){},St.Object.defineProperties(pr.prototype,{placeholder:{get:function(){return this.$a}},adornedObject:{get:function(){return this.ue},set:function(t){var e=this.adornedPart,i=null;t!==null&&(i=t.part),e===null||t!==null&&e===i||e.Jf(this.category),this.ue=t,i!==null&&i.bh(this.category,this)}},adornedPart:{get:function(){var t=this.ue;return t!==null?t.part:null}},containingGroup:{get:function(){return null}}}),pr.className="Adornment";function xp(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=Sl,this.er=n0,this.Kr=this.ij=this.Nq=this.Mq=null}xp.prototype.copy=function(){var t=new xp;return t.Dq=this.Dq,t.Eq=this.Eq,t.gj=this.gj,t.Vr=this.Vr,t.yp=this.yp.J(),t.er=this.er,t.Mq=this.Mq,t.Nq=this.Nq,t.ij=this.ij,t.Kr=this.Kr,t};function Ee(t,e){t===void 0||t instanceof fl||typeof t=="string"?bi.call(this,t):(bi.call(this),t&&(e=t)),this.U=13,this.Ba=null,this.jb=new ue,this.wc=this.af=this.Yk=null,this.ci=!1,e&&Object.assign(this,e)}li(Ee,bi),Ee.prototype.cloneProtected=function(t){bi.prototype.cloneProtected.call(this,t),t.U=this.U,this.Ba!==null&&(t.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},L=Ee.prototype,L.Af=function(t){bi.prototype.Af.call(this,t),t.Bd(),t.af=this.af,t.wc=null};function wf(t){t.Ba===null?t.Ba=new xp:t.Ba.nc&&(t.Ba=t.Ba.copy())}L.th=function(){bi.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function sy(t,e){e!==null&&(t.af===null&&(t.af=new te),t.af.add(e))}function p1(t,e,i,n){if(e===null||t.af===null)return null;for(var s=t.af.iterator;s.next();){var a=s.value;if(a.Ds===t&&a.cv===e&&a.Ox===i&&a.Px===n||a.Ds===e&&a.cv===t&&a.Ox===n&&a.Px===i)return a}return null}L.Lz=function(t,e,i){e==null&&(e=""),i==null&&(i=""),t=p1(this,t,e,i),t!==null&&t.Sl()},L.gk=function(t,e,i,n,s,a,l){t===qs&&e==="elements"?this.wc=null:t===aa&&e==="elements"&&(this.wc=null),bi.prototype.gk.call(this,t,e,i,n,s,a,l)},L.Bd=function(t){for(var e=this.linksConnected;e.next();){var i=e.value;t!==void 0&&t.contains(i)||(Bh(i.fromPort),Bh(i.toPort),i.bb())}};function Km(t,e){for(t=t.linksConnected;t.next();){var i=t.value;(i.fromPort===e||i.toPort===e)&&(Bh(i.fromPort),Bh(i.toPort),i.bb())}}function Bh(t){if(t!==null){var e=t.Zn;e!==null&&e.Sl(),t=t.part,e=t.containingGroup,e===null||t.isVisible()||Bh(e.port)}}L.si=function(){return!0},Ee.prototype.getAvoidableRect=function(t){return t.set(this.actualBounds),t.Co(this.avoidableMargin),t},Ee.prototype.findVisibleNode=function(){for(var t=this;t!==null&&!t.isVisible();)t=t.containingGroup;return t},Ee.prototype.isVisible=function(){if(!bi.prototype.isVisible.call(this))return!1;var t=!0,e=Ru,i=this.diagram;if(i!==null&&(t=i.isTreePathToChildren,e=i.treeCollapsePolicy),e===Ru){if(t=this.pg(),t!==null&&!t.isTreeExpanded)return!1}else if(e===Fs){if(t=t?this.Oo():this.Po(),0<t.count&&t.all(function(n){return!n.isTreeExpanded}))return!1}else if(e===Oh&&(t=t?this.Oo():this.Po(),0<t.count&&t.any(function(n){return!n.isTreeExpanded})))return!1;return t=this.labeledLink,t!==null?t.isVisible():!0},Ee.prototype.Zb=function(t){bi.prototype.Zb.call(this,t);for(var e=this.linksConnected;e.next();){var i=e.value;if(t&&this.containingGroup!==null){var n=i.To(this);n===null||n.Td(this.containingGroup)||i.bb()}i.Zb(t)}},Ee.prototype.qx=function(){var t=new te,e=new te;return m1(this,this,t,e),e.iterator};function m1(t,e,i,n){if(e!==null&&!i.has(e)){i.add(e);var s=!0,a=t.diagram;a!==null&&(s=a.isTreePathToChildren),e.linksConnected.each(function(l){l.isTreeLink?(s?l.fromNode===e:l.toNode===e)&&m1(t,s?l.toNode:l.fromNode,i,n):n.add(l)})}}Ee.prototype.findLinksConnected=function(t){if(t===void 0&&(t=null),t===null)return this.jb.iterator;var e=new $r(this.jb),i=this;return e.predicate=function(n){return n.fromNode===i&&n.fromPortId===t||n.toNode===i&&n.toPortId===t},e},L=Ee.prototype,L.Mo=function(t){t===void 0&&(t=null);var e=new $r(this.jb),i=this;return e.predicate=function(n){return n.fromNode!==i?!1:t===null?!0:n.fromPortId===t},e},L.Sd=function(t){t===void 0&&(t=null);var e=new $r(this.jb),i=this;return e.predicate=function(n){return n.toNode!==i?!1:t===null?!0:n.toPortId===t},e},L.Mu=function(t){t===void 0&&(t=null);for(var e=null,i=null,n=this.jb.iterator;n.next();){var s=n.value;s.fromNode===this?(t===null||s.fromPortId===t)&&(s=s.toNode,e!==null?e.add(s):i!==null&&i!==s?(e=new te,e.add(i),e.add(s)):i=s):s.toNode!==this||t!==null&&s.toPortId!==t||(s=s.fromNode,e!==null?e.add(s):i!==null&&i!==s?(e=new te,e.add(i),e.add(s)):i=s)}return e!==null?e.iterator:i!==null?new yr(i):Tr},L.Po=function(t){t===void 0&&(t=null);for(var e=null,i=null,n=this.jb.iterator;n.next();){var s=n.value;s.fromNode!==this||t!==null&&s.fromPortId!==t||(s=s.toNode,e!==null?e.add(s):i!==null&&i!==s?(e=new te,e.add(i),e.add(s)):i=s)}return e!==null?e.iterator:i!==null?new yr(i):Tr},L.Oo=function(t){t===void 0&&(t=null);for(var e=null,i=null,n=this.jb.iterator;n.next();){var s=n.value;s.toNode!==this||t!==null&&s.toPortId!==t||(s=s.fromNode,e!==null?e.add(s):i!==null&&i!==s?(e=new te,e.add(i),e.add(s)):i=s)}return e!==null?e.iterator:i!==null?new yr(i):Tr},L.jz=function(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null);var n=new $r(this.jb),s=this;return n.predicate=function(a){return!((a.fromNode!==s||a.toNode!==t||e!==null&&a.fromPortId!==e||i!==null&&a.toPortId!==i)&&(a.fromNode!==t||a.toNode!==s||i!==null&&a.fromPortId!==i||e!==null&&a.toPortId!==e))},n},L.kz=function(t,e,i){e===void 0&&(e=null),i===void 0&&(i=null);var n=new $r(this.jb),s=this;return n.predicate=function(a){return!(a.fromNode!==s||a.toNode!==t||e!==null&&a.fromPortId!==e||i!==null&&a.toPortId!==i)},n};function Hm(t,e,i){Bh(i);var n=t.jb.contains(e);if(n||t.jb.add(e),!n||e.fromNode===e.toNode){var s=t.linkConnected;if(s!==null){var a=!0,l=t.diagram;l!==null&&(a=l.aa,l.aa=!0),s(t,e,i),l!==null&&(l.aa=a)}}!n&&e.isTreeLink&&(i=e.fromNode,e=e.toNode,i!==null&&e!==null&&i!==e&&(n=!0,t=t.diagram,t!==null&&(n=t.isTreePathToChildren),s=n?e:i,a=n?i:e,s.ci||(s.ci=a),!a.isTreeLeaf||t!==null&&t.undoManager.isUndoingRedoing||(n?i===a&&(a.isTreeLeaf=!1):e===a&&(a.isTreeLeaf=!1))))}function Yg(t,e,i){Bh(i);var n=t.jb.remove(e),s=null;if(n||e.toNode===e.fromNode){var a=t.linkDisconnected;if(s=t.diagram,a!==null){var l=!0;s!==null&&(l=s.aa,s.aa=!0),a(t,e,i),s!==null&&(s.aa=l)}}n&&e.isTreeLink&&(i=!0,s!==null&&(i=s.isTreePathToChildren),t=i?e.toNode:e.fromNode,e=i?e.fromNode:e.toNode,t!==null&&(t.ci=!1),e===null||e.isTreeLeaf||(e.jb.count===0?(e.ci=null,s!==null&&s.undoManager.isUndoingRedoing||(e.isTreeLeaf=!0)):Vm(e)))}function Vm(t){if(t.ci=!1,t.jb.count!==0){var e=!0,i=t.diagram;if(i===null||!i.undoManager.isUndoingRedoing){for(i!==null&&(e=i.isTreePathToChildren),i=t.jb.iterator;i.next();){var n=i.value;if(n.isTreeLink){if(e){if(n.fromNode===t){t.isTreeLeaf=!1;return}}else if(n.toNode===t){t.isTreeLeaf=!1;return}}}t.isTreeLeaf=!0}}}Ee.prototype.updateRelationshipsFromData=function(){var t=this.diagram;t!==null&&t.partManager.updateRelationshipsFromData(this)},L=Ee.prototype,L.Vo=function(t){bi.prototype.Vo.call(this,t),t||(Vm(this),t=this.Yk,t!==null&&qg(t,this))},L.Wo=function(t){bi.prototype.Wo.call(this,t),t||(t=this.Yk,t!==null&&t.wd!==null&&(t.wd.remove(this),t.v()))},L.Lj=function(){if(0<this.jb.count){var t=this.diagram;if(t!==null)for(var e=t.commandHandler!==null?t.commandHandler.deletesConnectedLinks:!0,i=this.jb.copy().iterator;i.next();){var n=i.value;e?t.remove(n):(n.fromNode===this&&(n.fromNode=null),n.toNode===this&&(n.toNode=null))}}this.labeledLink=null,bi.prototype.Lj.call(this)},L.ns=function(t){if(this.wc===null){if(t===""&&this.Te===!1)return this;ay(this)}var e=this.wc.I(t);return e!==null||t!==""&&(e=this.wc.I(""),e!==null)?e:this};function ay(t){t.wc===null?t.wc=new ci:t.wc.clear(),t.qm(t,function(e,i){ly(e,i)}),t.wc.count===0&&t.wc.add("",t)}function ly(t,e){var i=e.portId;i!==null&&t.wc!==null&&t.wc.add(i,e)}function uy(t,e,i){var n=e.portId;if(n!==null&&(t.wc!==null&&t.wc.remove(n),e=t.diagram,e!==null&&i)){for(i=null,t=t.findLinksConnected(n);t.next();)n=t.value,i===null&&(i=gi()),i.push(n);if(i!==null){for(t=0;t<i.length;t++)e.remove(i[t]);Ji(i)}}}L.Nz=function(t){if(t===null||t===this)return!1;var e=!0,i=this.diagram;if(i!==null&&(e=i.isTreePathToChildren),i=this,e)for(;i!==t;){e=null;for(var n=i.jb.iterator;n.next();){var s=n.value;if(s.isTreeLink&&(e=s.fromNode,e!==i&&e!==this))break}if(e===this||e===null||e===i)return!1;i=e}else for(;i!==t;){for(e=null,n=i.jb.iterator;n.next()&&(s=n.value,!s.isTreeLink||(e=s.toNode,e===i||e===this)););if(e===this||e===null||e===i)return!1;i=e}return!0},L.xz=function(){var t=!0,e=this.diagram;if(e!==null&&(t=e.isTreePathToChildren),e=this,t)for(;;){t=null;for(var i=e.jb.iterator;i.next();){var n=i.value;if(n.isTreeLink&&(t=n.fromNode,t!==e&&t!==this))break}if(t===this)return this;if(t===null||t===e)return e;e=t}else for(;;){for(t=null,i=e.jb.iterator;i.next()&&(n=i.value,!n.isTreeLink||(t=n.toNode,t===e||t===this)););if(t===this)return this;if(t===null||t===e)return e;e=t}},L.gz=function(t){if(t===null)return null;if(this===t)return this;for(var e=this;e!==null;)$m(e,!0),e=e.pg();var i=null;for(e=t;e!==null;){if(e.G&1048576){i=e;break}e=e.pg()}for(e=this;e!==null;)$m(e,!1),e=e.pg();return i},L.kh=function(){var t=!0,e=this.diagram;if(e!==null&&(t=e.isTreePathToChildren),e=this.jb.iterator,t){for(;e.next();)if(t=e.value,t.isTreeLink&&t.fromNode!==this)return t}else for(;e.next();)if(t=e.value,t.isTreeLink&&t.toNode!==this)return t;return null},L.pg=function(){var t=this.ci;if(t===null)return null;if(t instanceof Ee)return t;t=this.diagram,t=t!==null?t.isTreePathToChildren:!0;for(var e=this.jb.iterator;e.next();){var i=e.value;if(i.isTreeLink&&(i=t?i.fromNode:i.toNode,i!==this))return this.ci=i}return this.ci=null},L.vz=function(){function t(i,n){n.add(i);var s=i.kh();s!==null&&(n.add(s),i=i.pg(),i!==null&&t(i,n))}var e=new te;return t(this,e),e},L.uz=function(){return hc(this,this)};function hc(t,e){return e=e.pg(),e===null?0:1+hc(t,e)}L.Qo=function(){var t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren),e=new $r(this.jb);var i=this;return e.predicate=t?function(n){return!!(n.isTreeLink&&n.fromNode===i)}:function(n){return!!(n.isTreeLink&&n.toNode===i)},e},L.Ou=function(){var t=!0,e=this.diagram;e!==null&&(t=e.isTreePathToChildren);var i=e=null,n=this.jb.iterator;if(t)for(;n.next();)t=n.value,t.isTreeLink&&t.fromNode===this&&(t=t.toNode,e!==null?e.add(t):i!==null&&i!==t?(e=new ue,e.add(i),e.add(t)):i=t);else for(;n.next();)t=n.value,t.isTreeLink&&t.toNode===this&&(t=t.fromNode,e!==null?e.add(t):i!==null&&i!==t?(e=new ue,e.add(i),e.add(t)):i=t);return e!==null?e.iterator:i!==null?new yr(i):Tr},L.wz=function(t){t===void 0&&(t=1/0);var e=new te;return yd(e,this,!1,t,!0),e},Ee.prototype.collapseTree=function(t){t===void 0&&(t=1),1>t&&(t=1);var e=this.diagram;if(e!==null&&!e.Ue){e.Ue=!0;var i=new te;i.add(this),$f(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===Ru),e.Ue=!1}};function $f(t,e,i,n,s,a,l){if(1<n)for(var c=i?t.Mo():t.Sd();c.next();){var p=c.value;p.isTreeLink&&(p=p.To(t),p===null||p===t||e.contains(p)||(e.add(p),$f(p,e,i,n-1,s,a,l)))}else Wm(t,e,i,s,a,l)}function Wm(t,e,i,n,s,a){for(var l=s===t?!0:t.isTreeExpanded,c=i?t.Mo():t.Sd(),p={};c.next();){var m=c.value;if(m.isTreeLink&&(m=m.To(t),m!==null&&m!==t)){var v=e.contains(m);if(v||e.add(m),l){var w=i?m.Oo():m.Po();p.uv=t,w.all(function(C){return function(k){return k===C.uv||!k.isTreeExpanded}}(p))&&n.Aj(m,s),m.oh(),m.Zb(!1)}m.isTreeExpanded&&(m.wasTreeExpanded=m.isTreeExpanded,v||Wm(m,e,i,n,s,a))}p={uv:p.uv}}t.isTreeExpanded=!1}Ee.prototype.expandTree=function(t){t===void 0&&(t=2),2>t&&(t=2);var e=this.diagram;if(e!==null&&!e.Ue){e.Ue=!0;var i=new te;i.add(this),Jg(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===Ru),e.Ue=!1}};function Jg(t,e,i,n,s,a,l){for(var c=a===t?!1:t.isTreeExpanded,p=i?t.Mo():t.Sd(),m={};p.next();){var v=p.value;if(v.isTreeLink&&(c||v.fd||v.bb(),v=v.To(t),v!==null&&v!==t&&!e.contains(v))){if(e.add(v),!c){v.Zb(!0),v.oh();var w=i?v.Oo():v.Po();m.vv=t,w.all(function(C){return function(k){return k===C.vv||!k.isTreeExpanded}}(m))&&s.Cj(v,a)}(2<n||v.wasTreeExpanded)&&(v.wasTreeExpanded=!1,Jg(v,e,i,n-1,s,a,l))}m={vv:m.vv}}t.isTreeExpanded=!0}St.Object.defineProperties(Ee.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:n0},set:function(t){var e=this.portSpreading;e!==t&&(wf(this),this.Ba.er=t,this.g("portSpreading",e,t),t=this.diagram,t!==null&&t.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{get:function(){return(this.U&8)!==0},set:function(t){var e=(this.U&8)!==0;if(e!==t){this.U^=8;var i=this.diagram;i!==null&&Ku(i,this),this.g("avoidable",e,t)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:Sl},set:function(t){typeof t=="number"&&(t=new Ai(t));var e=this.avoidableMargin;if(!e.D(t)){t=t.J(),wf(this),this.Ba.yp=t;var i=this.diagram;i!==null&&Ku(i,this),this.g("avoidableMargin",e,t)}}},linksConnected:{get:function(){return this.jb.iterator}},linkConnected:{get:function(){return this.Ba!==null?this.Ba.Dq:null},set:function(t){var e=this.linkConnected;e!==t&&(wf(this),this.Ba.Dq=t,this.g("linkConnected",e,t))}},linkDisconnected:{get:function(){return this.Ba!==null?this.Ba.Eq:null},set:function(t){var e=this.linkDisconnected;e!==t&&(wf(this),this.Ba.Eq=t,this.g("linkDisconnected",e,t))}},linkValidation:{get:function(){return this.Ba!==null?this.Ba.gj:null},set:function(t){var e=this.linkValidation;e!==t&&(wf(this),this.Ba.gj=t,this.g("linkValidation",e,t))}},isLinkLabel:{get:function(){return this.Yk!==null}},labeledLink:{get:function(){return this.Yk},set:function(t){var e=this.Yk;if(e!==t){var i=this.diagram,n=this.data;if(e!==null){if(e.wd!==null&&(e.wd.remove(this),e.v()),i!==null&&n!==null&&!i.undoManager.isUndoingRedoing){var s=e.data,a=i.model;if(s!==null&&a.ri()){var l=a.wa(n);l!==void 0&&a.Qx(s,l)}}this.containingGroup=null}this.Yk=t,t!==null&&(qg(t,this),i===null||n===null||i.undoManager.isUndoingRedoing||(s=t.data,i=i.model,s!==null&&i.ri()&&(n=i.wa(n),n!==void 0&&i.Bu(s,n))),this.containingGroup=t.containingGroup),Rl(this),this.g("labeledLink",e,t)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&ay(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return(this.U&1)!==0},set:function(t){var e=(this.U&1)!==0;if(e!==t){this.U^=1;var i=this.diagram;if(this.g("isTreeExpanded",e,t),e=this.treeExpandedChanged,e!==null){var n=!0;i!==null&&(n=i.aa,i.aa=!0),e(this),i!==null&&(i.aa=n)}i!==null&&i.undoManager.isUndoingRedoing?this.Zb(t):t?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return(this.U&2)!==0},set:function(t){var e=(this.U&2)!==0;e!==t&&(this.U^=2,this.g("wasTreeExpanded",e,t))}},treeExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Vr:null},set:function(t){var e=this.treeExpandedChanged;e!==t&&(wf(this),this.Ba.Vr=t,this.g("treeExpandedChanged",e,t))}},isTreeLeaf:{get:function(){return(this.U&4)!==0},set:function(t){var e=(this.U&4)!==0;e!==t&&(this.U^=4,this.g("isTreeLeaf",e,t))}}}),Ee.prototype.expandTree=Ee.prototype.expandTree,Ee.prototype.collapseTree=Ee.prototype.collapseTree,Ee.prototype.findTreeParts=Ee.prototype.wz,Ee.prototype.findTreeChildrenNodes=Ee.prototype.Ou,Ee.prototype.findTreeChildrenLinks=Ee.prototype.Qo,Ee.prototype.findTreeLevel=Ee.prototype.uz,Ee.prototype.findTreeParentChain=Ee.prototype.vz,Ee.prototype.findTreeParentNode=Ee.prototype.pg,Ee.prototype.findTreeParentLink=Ee.prototype.kh,Ee.prototype.findCommonTreeParent=Ee.prototype.gz,Ee.prototype.findTreeRoot=Ee.prototype.xz,Ee.prototype.isInTreeOf=Ee.prototype.Nz,Ee.prototype.findPort=Ee.prototype.ns,Ee.prototype.findLinksTo=Ee.prototype.kz,Ee.prototype.findLinksBetween=Ee.prototype.jz,Ee.prototype.findNodesInto=Ee.prototype.Oo,Ee.prototype.findNodesOutOf=Ee.prototype.Po,Ee.prototype.findNodesConnected=Ee.prototype.Mu,Ee.prototype.findLinksInto=Ee.prototype.Sd,Ee.prototype.findLinksOutOf=Ee.prototype.Mo,Ee.prototype.findExternalTreeLinksConnected=Ee.prototype.qx,Ee.prototype.invalidateConnectedLinks=Ee.prototype.Bd,Ee.prototype.invalidateLinkBundle=Ee.prototype.Lz;var g1=new he(Ee,"SpreadingNone",10),n0=new he(Ee,"SpreadingEvenly",11),$d=new he(Ee,"SpreadingPacked",12);Ee.className="Node",Ee.SpreadingNone=g1,Ee.SpreadingEvenly=n0,Ee.SpreadingPacked=$d;function Yi(t,e){t===void 0||t instanceof fl||typeof t=="string"?Ee.call(this,t):(Ee.call(this),t&&(e=t)),this.U|=4608,this.Gn=new te,this.$a=null,this.Sc=new hs,this.Sc.group=this,this.gl=new te,this.tb=this.$p=null,e&&Object.assign(this,e)}li(Yi,Ee),Yi.prototype.cloneProtected=function(t){Ee.prototype.cloneProtected.call(this,t),this.U=this.U&-32769;var e=t.Nl(function(i){return i instanceof Wu});e instanceof Wu?t.$a=e:t.$a=null,this.Sc!==null?(t.Sc=this.Sc.copy(),t.Sc.group=t):(t.Sc!==null&&(t.Sc.group=null),t.Sc=null),this.tb!==null&&(t.tb=this.tb.copy())},L=Yi.prototype,L.Af=function(t){Ee.prototype.Af.call(this,t);var e=t.Rj();for(t=t.memberParts;t.next();){var i=t.value;if(i.v(),i.C(8),i.Ej(),i instanceof Ee)i.Bd(e);else if(i instanceof ge)for(i=i.labelNodes;i.next();)i.value.Bd(e)}},L.gk=function(t,e,i,n,s,a,l){if(t===qs&&e==="elements"){if(s instanceof Wu)this.$a===null?this.$a=s:this.$a!==s&&Mt("Cannot insert a second Placeholder into the visual tree of a Group.");else if(s instanceof ce){var c=s.Nl(function(p){return p instanceof Wu});c instanceof Wu&&(this.$a===null?this.$a=c:this.$a!==c&&Mt("Cannot insert a second Placeholder into the visual tree of a Group."))}}else t===aa&&e==="elements"&&this.$a!==null&&(n===this.$a?this.$a=null:n instanceof ce&&this.$a.rg(n)&&(this.$a=null));Ee.prototype.gk.call(this,t,e,i,n,s,a,l)},L.Xl=function(t,e){Ee.prototype.Xl.call(this,t,e),this.isClipping&&this.type!==ce.Spot&&this.isSubGraphExpanded&&(t=this.resizeObject,t instanceof ce&&(t=t.Pb()),this.tb===null&&(this.tb=new Tt),t.mi(this.tb),t instanceof pn&&this.tb.Bc(-t.strokeWidth,-t.strokeWidth))},L.eh=function(t,e,i,n){this.nf=this.$a,Ee.prototype.eh.call(this,t,e,i,n)},L.Va=function(){var t=this;t.isSubGraphExpanded&&this.memberParts.each(function(e){!t.computesBoundsIncludingLinks&&e instanceof ge||e.Va()}),Ee.prototype.Va.call(this)},L.si=function(){if(!Ee.prototype.si.call(this))return!1;for(var t=this.memberParts;t.next();){var e=t.value;if(e instanceof Ee){if(e.isVisible()&&Vu(e))return!1}else if(e instanceof ge&&e.isVisible()&&Vu(e)&&e.fromNode!==this&&e.toNode!==this)return!1}return!0};function hy(t,e){if(t.Gn.add(e)){e instanceof Yi&&t.gl.add(e);var i=t.memberAdded;if(i!==null){var n=!0,s=t.diagram;s!==null&&(n=s.aa,s.aa=!0),i(t,e),s!==null&&(s.aa=n)}t.isVisible()&&t.isSubGraphExpanded||e.Zb(!1)}e instanceof ge&&!t.computesBoundsIncludingLinks||(e=t.$a,e===null&&(e=t),e.v())}function cy(t,e){if(t.Gn.remove(e)){e instanceof Yi&&t.gl.remove(e);var i=t.memberRemoved;if(i!==null){var n=!0,s=t.diagram;s!==null&&(n=s.aa,s.aa=!0),i(t,e),s!==null&&(s.aa=n)}t.isVisible()&&t.isSubGraphExpanded||e.Zb(!0)}e instanceof ge&&!t.computesBoundsIncludingLinks||(e=t.$a,e===null&&(e=t),e.v())}L.Lj=function(){if(0<this.Gn.count){var t=this.diagram;if(t!==null)for(var e=this.Gn.copy().iterator;e.next();)t.remove(e.value)}Ee.prototype.Lj.call(this)},Yi.prototype.canAddMembers=function(t){var e=this.diagram;if(e===null)return!1;for(e=e.commandHandler,t=Rt(t).iterator;t.next();)if(!e.isValidMember(this,t.value))return!1;return!0},Yi.prototype.addMembers=function(t,e){var i=this.diagram;if(i===null)return!1;i=i.commandHandler;var n=!0;for(t=Rt(t).iterator;t.next();){var s=t.value;!e||i.isValidMember(this,s)?s.containingGroup=this:n=!1}return n},Yi.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var t=this.layer;return t===null||!t.allowUngroup?!1:(t=t.diagram,!!(t===null||t.allowUngroup))},L=Yi.prototype,L.Bd=function(t){var e=(this.U&65536)!==0;if(Ee.prototype.Bd.call(this,t),!e)for(!(this.U&65536)&&(this.U=this.U^65536),e=this.Lu();e.next();){var i=e.value;if(t===void 0||!t.contains(i)){var n=i.fromNode;n!==null&&n!==this&&n.Td(this)&&!n.isVisible()?(Bh(i.fromPort),Bh(i.toPort),i.bb()):(n=i.toNode,n!==null&&n!==this&&n.Td(this)&&!n.isVisible()&&(Bh(i.fromPort),Bh(i.toPort),i.bb()))}}},L.Lu=function(){var t=this.diagram!==null&&this.diagram.Pw;if(t&&this.$p!==null)return this.$p.iterator;var e=this.Rj();e.add(this);for(var i=new te,n=e.iterator;n.next();){var s=n.value;if(s instanceof Ee)for(s=s.linksConnected;s.next();){var a=s.value;e.contains(a)||i.add(a)}}return t&&(this.$p=i),i.iterator},L.iz=function(){var t=this.Rj();t.add(this);for(var e=new te,i=t.iterator;i.next();){var n=i.value;if(n instanceof Ee)for(n=n.linksConnected;n.next();){var s=n.value,a=s.fromNode;a===null||t.contains(a)&&a!==this||e.add(a),s=s.toNode,s===null||t.contains(s)&&s!==this||e.add(s)}}return e.iterator},L.hz=function(){function t(i,n){i!==null&&(n.add(i),t(i.containingGroup,n))}var e=new te;return t(this,e),e},L.Rj=function(){var t=new te;return yd(t,this,!0,0,!0),t.remove(this),t},L.Zb=function(t){Ee.prototype.Zb.call(this,t);for(var e=this.memberParts;e.next();)e.value.Zb(t)},Yi.prototype.collapseSubGraph=function(){var t=this.diagram;if(t!==null&&!t.Ue){t.Ue=!0;var e=this.Rj();v1(this,e,t,this),t.Ue=!1}};function v1(t,e,i,n){for(var s=t.memberParts;s.next();){var a=s.value;if(a.Zb(!1),a instanceof Yi&&a.isSubGraphExpanded&&(a.wasSubGraphExpanded=a.isSubGraphExpanded,v1(a,e,i,n)),a instanceof Ee)a.Bd(e),i.Aj(a,n);else if(a instanceof ge)for(a=a.labelNodes;a.next();)a.value.Bd(e)}t.isSubGraphExpanded=!1}Yi.prototype.expandSubGraph=function(){var t=this.diagram;if(t!==null&&!t.Ue){t.Ue=!0;var e=this.Rj();y1(this,e,t,this),t.Ue=!1}};function y1(t,e,i,n){for(var s=t.memberParts;s.next();){var a=s.value;if(a.Zb(!0),a instanceof Yi&&a.wasSubGraphExpanded&&(a.wasSubGraphExpanded=!1,y1(a,e,i,n)),a instanceof Ee)a.Bd(e),i.Cj(a,n);else if(a instanceof ge)for(a=a.labelNodes;a.next();)a.value.Bd(e)}t.isSubGraphExpanded=!0}Yi.prototype.move=function(t,e){e===void 0&&(e=!1);var i=e?this.location:this.position,n=i.x;i=i.y;var s=t.x,a=t.y;if(!(n===s||isNaN(n)&&isNaN(s))||!(i===a||isNaN(i)&&isNaN(a))){for(n=s-(isNaN(n)?0:n),i=a-(isNaN(i)?0:i),a=G.alloc(),Ee.prototype.move.call(this,t,e),t=new te,e=this.Rj().iterator;e.next();)s=e.value,s instanceof ge&&(s.suspendsRouting&&t.add(s),s.fd||s.fromNode!==this&&s.toNode!==this)&&(s.suspendsRouting=!0);for(e.reset();e.next();)if(s=e.value,!(s.ph()||s instanceof Ee&&s.isLinkLabel)){var l=s.position,c=s.location;l.w()?(a.x=l.x+n,a.y=l.y+i,s.position=a):c.w()&&(a.x=c.x+n,a.y=c.y+i,s.location=a)}for(e.reset();e.next();)s=e.value,s instanceof ge&&(s.suspendsRouting=t.contains(s),s.fd||s.fromNode!==this&&s.toNode!==this)&&(l=s.position,a.x=l.x+n,a.y=l.y+i,a.w()?s.move(a):s.bb(),dy(s)&&s.bb());G.free(a)}},St.Object.defineProperties(Yi.prototype,{placeholder:{get:function(){return this.$a}},computesBoundsAfterDrag:{get:function(){return(this.U&2048)!==0},set:function(t){var e=(this.U&2048)!==0;e!==t&&(this.U^=2048,this.g("computesBoundsAfterDrag",e,t))}},computesBoundsIncludingLinks:{get:function(){return(this.U&4096)!==0},set:function(t){var e=(this.U&4096)!==0;e!==t&&(this.U^=4096,this.g("computesBoundsIncludingLinks",e,t))}},computesBoundsIncludingLocation:{get:function(){return(this.U&8192)!==0},set:function(t){var e=(this.U&8192)!==0;e!==t&&(this.U^=8192,this.g("computesBoundsIncludingLocation",e,t))}},handlesDragDropForMembers:{get:function(){return(this.U&16384)!==0},set:function(t){var e=(this.U&16384)!==0;e!==t&&(this.U^=16384,this.g("handlesDragDropForMembers",e,t))}},memberParts:{get:function(){return this.Gn.iterator}},layout:{get:function(){return this.Sc},set:function(t){var e=this.Sc;if(e!==t){t!==null&&t.diagram!==null&&t.diagram.layout===t&&Mt("A layout cannot be both the Diagram.layout and a Group.layout: "+t),e!==null&&(e.diagram=null,e.group=null),this.Sc=t;var i=this.diagram;t!==null&&(t.diagram=i,t.group=this),i!==null&&(i.xh=!0),this.g("layout",e,t),i!==null&&i.$b()}}},memberAdded:{get:function(){return this.Ba!==null?this.Ba.Mq:null},set:function(t){var e=this.memberAdded;e!==t&&(wf(this),this.Ba.Mq=t,this.g("memberAdded",e,t))}},memberRemoved:{get:function(){return this.Ba!==null?this.Ba.Nq:null},set:function(t){var e=this.memberRemoved;e!==t&&(wf(this),this.Ba.Nq=t,this.g("memberRemoved",e,t))}},memberValidation:{get:function(){return this.Ba!==null?this.Ba.ij:null},set:function(t){var e=this.memberValidation;e!==t&&(wf(this),this.Ba.ij=t,this.g("memberValidation",e,t))}},ungroupable:{get:function(){return(this.U&256)!==0},set:function(t){var e=(this.U&256)!==0;e!==t&&(this.U^=256,this.g("ungroupable",e,t))}},isSubGraphExpanded:{get:function(){return(this.U&512)!==0},set:function(t){var e=(this.U&512)!==0;if(e!==t){this.U^=512;var i=this.diagram;if(this.g("isSubGraphExpanded",e,t),e=this.subGraphExpandedChanged,e!==null){var n=!0;i!==null&&(n=i.aa,i.aa=!0),e(this),i!==null&&(i.aa=n)}i!==null&&i.undoManager.isUndoingRedoing?(this.$a!==null&&this.$a.v(),this.memberParts.each(function(s){s.updateAdornments()})):t?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{get:function(){return(this.U&1024)!==0},set:function(t){var e=(this.U&1024)!==0;e!==t&&(this.U^=1024,this.g("wasSubGraphExpanded",e,t))}},subGraphExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Kr:null},set:function(t){var e=this.subGraphExpandedChanged;e!==t&&(wf(this),this.Ba.Kr=t,this.g("subGraphExpandedChanged",e,t))}},rh:{get:function(){return(this.U&32768)!==0},set:function(t){(this.U&32768)!==0!==t&&(this.U^=32768)}}}),Yi.prototype.expandSubGraph=Yi.prototype.expandSubGraph,Yi.prototype.collapseSubGraph=Yi.prototype.collapseSubGraph,Yi.prototype.findSubGraphParts=Yi.prototype.Rj,Yi.prototype.findContainingGroupChain=Yi.prototype.hz,Yi.prototype.findExternalNodesConnected=Yi.prototype.iz,Yi.prototype.findExternalLinksConnected=Yi.prototype.Lu,Yi.prototype.ensureBounds=Yi.prototype.Va,Yi.className="Group";function Wu(t){pt.call(this),this.yb=Ua,this.ko=new Tt(NaN,NaN,NaN,NaN),t&&Object.assign(this,t)}li(Wu,pt),Wu.prototype.cloneProtected=function(t){pt.prototype.cloneProtected.call(this,t),t.yb=this.yb.J(),t.ko=this.ko.copy()},Wu.prototype.gh=function(t){if(this.background===null&&this.areaBackground===null)return!1;var e=this.naturalBounds;return eo(0,0,e.width,e.height,t.x,t.y)},Wu.prototype.Wl=function(){var t=this.part;if(t!==null&&(t instanceof Yi||t instanceof pr)||Mt("Placeholder is not inside a Group or Adornment."),t instanceof Yi){var e=this.computeBorder(this.ko),i=this.minSize,n=this.dc;for(yn(n,(isFinite(i.width)?Math.max(i.width,e.width):e.width)||0,(isFinite(i.height)?Math.max(i.height,e.height):e.height)||0),this.Ge(0,0,n.width,n.height),n=t.memberParts,i=!1;n.next();)if(n.value.isVisible()){i=!0;break}n=t.diagram,!i||n===null||n.animationManager.Xu(t)||isNaN(e.x)||isNaN(e.y)||(i=G.alloc(),i.xi(e,t.locationSpot),i.D(t.location)||(t.location=i),G.free(i))}else{e=this.dc,i=this.yb,n=i.left+i.right;var s=i.top+i.bottom,a=t.adornedObject;t.angle=a.li();var l=0;a instanceof pn&&(l=a.strokeWidth);var c=a.Df(),p=a.naturalBounds,m=(p.width+l)*c;l=(p.height+l)*c,t.type!==ce.Link&&(c=a.ga(t.category==="Selection"?Fo:t.locationSpot,G.alloc()),t.location=c,G.free(c)),isNaN(m)||isNaN(l)?(t=a.ga(Fo,G.alloc()),m=Tt.allocAt(t.x,t.y,0,0),m.Ye(a.ga(uu,t)),m.Ye(a.ga(Ll,t)),m.Ye(a.ga(nu,t)),yn(e,m.width+n||0,m.height+s||0),this.Ge(-i.left,-i.top,e.width,e.height),G.free(t),Tt.free(m)):(yn(e,m+n||0,l+s||0),this.Ge(-i.left,-i.top,e.width,e.height))}},Wu.prototype.eh=function(t,e,i,n){this.actualBounds.h(t,e,i,n)},Wu.prototype.computeBorder=function(t){var e=this.part,i=e.diagram,n=i===null||!i.animationManager.isAnimating;if(i!==null&&e instanceof Yi&&!e.layer.isTemporary&&e.computesBoundsAfterDrag&&this.ko.w()){var s=i.toolManager.findTool("Dragging");if(s===i.currentTool&&(i=s.computeBorder(e,this.ko,t),i!==null))return i}i=Tt.alloc(),s=this.computeMemberBounds(i);var a=this.yb;return e instanceof Yi&&!e.isSubGraphExpanded?t.h(s.x-a.left,s.y-a.top,0,0):t.h(s.x-a.left,s.y-a.top,Math.max(s.width+a.left+a.right,0),Math.max(s.height+a.top+a.bottom,0)),Tt.free(i),n&&e instanceof Yi&&e.computesBoundsIncludingLocation&&e.location.w()&&t.Ye(e.location),t},Wu.prototype.computeMemberBounds=function(t){if(!(this.part instanceof Yi))return t.h(0,0,0,0),t;for(var e=this.part,i=1/0,n=1/0,s=-1/0,a=-1/0,l=e.memberParts;l.next();){var c=l.value;if(c.isVisible()){if(c instanceof ge&&(!e.computesBoundsIncludingLinks||lh(c)||c.fromNode===e||c.toNode===e))continue;c=c.actualBounds,c.left<i&&(i=c.left),c.top<n&&(n=c.top),c.right>s&&(s=c.right),c.bottom>a&&(a=c.bottom)}}return isFinite(i)&&isFinite(n)?t.h(i,n,s-i,a-n):(e=e.location,t.h(e.x,e.y,0,0)),t},St.Object.defineProperties(Wu.prototype,{padding:{get:function(){return this.yb},set:function(t){typeof t=="number"&&(t=new Ai(t));var e=this.yb;e.D(t)||(this.yb=t=t.J(),this.g("padding",e,t),this.v())}}}),Wu.className="Placeholder";function ge(t){bi.call(this,ce.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=eh,this.Om=0,this.Qm=eh,this.Rm=NaN,this.qj=gy,this.po=.5,this.wd=null,this.Nb=new ue().freeze(),this.Tg=this.Mg=null,this.ml=new Tt,this.ua=new ve,this.u=this.o=this.Sf=this.Wf=null,this.su=new G,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],t&&Object.assign(this,t)}li(ge,bi),ge.prototype.cloneProtected=function(t){bi.prototype.cloneProtected.call(this,t),t.Qa=this.Qa&-113,t.ff=this.ff,t.gn=this.gn,t.vf=this.vf,t.uo=this.uo,t.qk=this.qk,t.Om=this.Om,t.Qm=this.Qm,t.Rm=this.Rm,t.qj=this.qj,t.po=this.po,this.ba!==null&&(t.ba=this.ba.copy())},L=ge.prototype,L.Af=function(t){bi.prototype.Af.call(this,t),this.ff=t.ff,this.vf=t.vf,t.Mg=null,t.bb(),t.Sf=this.Sf;var e=t.fromPort;e!==null&&Bh(e),t=t.toPort,t!==null&&Bh(t)},L.qb=function(t){t.classType===ge?(t.value&2)===2?this.routing=t:t===Yh||t===Fh||t===el?this.curve=t:t===zh||t===Lu||t===s0?this.adjusting=t:t!==gy&&t!==eh&&Mt("Unknown Link enum value for a Link property: "+t):bi.prototype.qb.call(this,t)},L.Xc=function(){this.ba===null&&(this.ba=new op)},L.si=function(){var t=this.fromNode;if(t!==null){var e=t.findVisibleNode();if(e!==null&&(t=e),Vu(t)||vd(t))return!1}return t=this.toNode,!(t!==null&&(e=t.findVisibleNode(),e!==null&&(t=e),Vu(t)||vd(t)))},L.zv=function(){return!1},L.Av=function(){},L.Zc=function(){return!1},ge.prototype.computeAngle=function(t,e,i){return ge.computeAngle(e,i)},ge.computeAngle=function(t,e){switch(t){default:case eh:t=0;break;case J0:t=e;break;case Mp:t=e+90;break;case Xm:t=e-90;break;case yy:t=e+180;break;case nv:t=xt.bp(e),90<t&&270>t&&(t-=180);break;case q0:t=xt.bp(e+90),90<t&&270>t&&(t-=180);break;case Ym:t=xt.bp(e-90),90<t&&270>t&&(t-=180);break;case rv:if(t=xt.bp(e),45<t&&135>t||225<t&&315>t)return 0;90<t&&270>t&&(t-=180)}return xt.bp(t)};function r0(t){var e=t.fromNode,i=t.toNode,n=null;if(e!==null?n=i!==null?e.px(i):e.containingGroup:i!==null?n=i.containingGroup:n=null,e=n,i=t.Ah,i!==e){i!==null&&cy(i,t),t.Ah=e,e!==null&&hy(e,t);var s=t.containingGroupChanged;if(s!==null){var a=!0,l=t.diagram;l!==null&&(a=l.aa,l.aa=!0),s(t,i,e),l!==null&&(l.aa=a)}!t.fd||t.Lw!==i&&t.Mw!==i||t.bb()}if(t.isLabeledLink)for(t=t.labelNodes;t.next();)t.value.containingGroup=n}L=ge.prototype,L.oh=function(){var t=this.containingGroup;t!==null&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&bi.prototype.oh.call(this)},L.To=function(t){var e=this.fromNode;return t===e?this.toNode:e},L.Cz=function(t){var e=this.fromPort;return t===e?this.toPort:e};function qg(t,e){t.wd===null&&(t.wd=new te),t.wd.add(e),t.v()}L.Vo=function(t){if(bi.prototype.Vo.call(this,t),Kd(this)&&this.Xo(this.actualBounds),!t){t=this.ef;var e=null;t!==null&&(e=this.fromPort,Hm(t,this,e));var i=this.uf;if(i!==null){var n=this.toPort;i===t&&n===e||Hm(i,this,n)}Gm(this)}},L.Wo=function(t){if(bi.prototype.Wo.call(this,t),Kd(this)&&this.Xo(this.actualBounds),!t){t=this.ef;var e=null;t!==null&&(e=this.fromPort,Yg(t,this,e));var i=this.uf;if(i!==null){var n=this.toPort;i===t&&n===e||Yg(i,this,n)}Hd(this)}},L.Lj=function(){if(this.fd=!0,this.wd!==null){var t=this.diagram;if(t!==null)for(var e=this.wd.copy().iterator;e.next();)t.remove(e.value)}this.data!==null&&(t=this.diagram,t!==null&&t.partManager.removeDataForLink(this))},ge.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var t=this.diagram;t!==null&&t.partManager.updateRelationshipsFromData(this)}},ge.prototype.move=function(t,e){var i=e?this.location:this.position,n=i.x;isNaN(n)&&(n=0);var s=i.y;for(isNaN(s)&&(s=0),n=t.x-n,s=t.y-s,e===!0?bi.prototype.move.call(this,t,!1):(t=G.allocAt(i.x+n,i.y+s),bi.prototype.move.call(this,t,!1),G.free(t)),xd(this,n,s),t=this.labelNodes;t.next();)e=t.value,i=e.position,e.moveTo(i.x+n,i.y+s)},ge.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var t=this.layer;return t===null?!0:t.allowRelink?(t=t.diagram,!!(t===null||t.allowRelink)):!1},ge.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var t=this.layer;return t===null?!0:t.allowRelink?(t=t.diagram,!!(t===null||t.allowRelink)):!1},ge.prototype.computeMidPoint=function(t){var e=this.pointsCount;if(e===0)return t.assign(iu),t;if(e===1)return t.assign(this.i(0)),t;if(e===2){var i=this.i(0),n=this.i(1);return t.h((i.x+n.x)/2,(i.y+n.y)/2),t}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Yh))return this.ua.Pu(.5,t),t.add(this.i(0)),i=this.ua.figures.first(),t.offset(-i.startX,-i.startY),t;if(this.computeCurve()===Yh){if(e===3){i=this.i(0),n=this.i(1);var s=this.i(2);return xt.ax(i.x,i.y,n.x,n.y,n.x,n.y,s.x,s.y,t),t}if(n=(e-1)/3|0,i=3*(n/2|0),n%2===1){n=this.i(i),s=this.i(i+1);var a=this.i(i+2);i=this.i(i+3),xt.ax(n.x,n.y,s.x,s.y,a.x,a.y,i.x,i.y,t)}else t.assign(this.i(i));return t}var l=this.flattenedLengths;for(i=this.flattenedTotalLength,s=a=n=0;n<i/2&&a<e&&(s=l[a],!(n+s>i/2));)n+=s,a++;return e=this.i(a),a=this.i(a+1),1>Math.abs(e.x-a.x)?e.y>a.y?t.h(e.x,e.y-(i/2-n)):t.h(e.x,e.y+(i/2-n)):1>Math.abs(e.y-a.y)?e.x>a.x?t.h(e.x-(i/2-n),e.y):t.h(e.x+(i/2-n),e.y):(i=(i/2-n)/s,t.h(e.x+i*(a.x-e.x),e.y+i*(a.y-e.y))),t},ge.prototype.computeMidAngle=function(){var t=this.pointsCount;if(2>t)return NaN;if(t===2)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Yh))return this.ua.wx(.5);if(this.computeCurve()===Yh&&4<=t){var e=(t-1)/3|0,i=3*(e/2|0);if(e%2===1){i=Math.floor(i),t=this.i(i),e=this.i(i+1);var n=this.i(i+2);return i=this.i(i+3),xt.My(t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y)}if(0<i&&i+1<t)return this.i(i-1).ab(this.i(i+1))}e=this.flattenedLengths,n=this.flattenedTotalLength;var s=0;i=0;for(var a;s<n/2&&i<t&&(a=e[i],!(s+a>n/2));)s+=a,i++;if(e=this.i(i),n=this.i(i+1),1>Math.abs(e.x-n.x)&&1>Math.abs(e.y-n.y)){if(0<i&&i+2<t)return this.i(i-1).ab(this.i(i+2))}else{if(1>Math.abs(e.x-n.x))return e.y>n.y?270:90;if(1>Math.abs(e.y-n.y))return e.x>n.x?180:0}return e.ab(n)},L=ge.prototype,L.i=function(t){return this.Nb.s[t]},L.dd=function(t,e){this.Nb.cd(t,e)},L.L=function(t,e,i){this.Nb.cd(t,new G(e,i))},L.Kz=function(t,e){this.Nb.Gb(t,e)},L.m=function(t,e,i){this.Nb.Gb(t,new G(e,i))},L.ne=function(t){this.Nb.add(t)},L.yf=function(t,e){this.Nb.add(new G(t,e))},L.pv=function(t){this.Nb.mb(t)},L.Fj=function(){this.Nb.clear()};function xd(t,e,i){if(e!==0||i!==0)if(t.pointsCount===0)t.defaultFromPoint&&t.defaultFromPoint.offset(e,i),t.defaultToPoint&&t.defaultToPoint.offset(e,i);else{for(var n=t.fd,s=new ue,a=t.Nb.iterator;a.next();){var l=a.value;s.add(new G(l.x+e,l.y+i).freeze())}s.freeze(),a=t.Nb,t.Nb=s,l=t.diagram,isNaN(e)||isNaN(i)||l!==null&&l.animationManager.zb?t.v():(t.ke.h(t.ke.x+e,t.ke.y+i),t.pa.h(t.pa.x+e,t.pa.y+i),Rl(t)),n?Qg(t):(t.defaultFromPoint&&(t.defaultFromPoint=t.i(0)),t.defaultToPoint&&(t.defaultToPoint=t.i(t.pointsCount-1))),l!==null&&l.animationManager.zb&&ze(l.animationManager,t,s),t.g("points",a,s)}}L.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},L.zf=function(){if(this.Mg!==null){for(var t=this.Mg,e=this.Nb,i=1/0,n=1/0,s=t.s,a=s.length,l=0;l<a;l++){var c=s[l];i=Math.min(c.x,i),n=Math.min(c.y,n)}c=l=1/0;for(var p=e.s,m=p.length,v=0;v<m;v++){var w=p[v];l=Math.min(w.x,l),c=Math.min(w.y,c),w.freeze()}if(e.freeze(),m===a){for(a=0;a<m;a++)if(v=s[a],w=p[a],v.x-i!==w.x-l||v.y-n!==w.y-c){this.qc();break}}else this.qc();this.Mg=null,i=this.diagram,i!==null&&i.animationManager.zb&&ze(i.animationManager,this,e),Qg(this),this.g("points",t,e)}},L.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Qg(t){t.Nb.count===0?t.fd=!1:(t.fd=!0,t.cq=null,t.vt=NaN,t.defaultFromPoint=t.i(0),t.defaultToPoint=t.i(t.pointsCount-1),ev(t,!1))}L.bb=function(){if(!this.suspendsRouting){var t=this.diagram;if(t){if(t.As.contains(this)||t.undoManager.isUndoingRedoing||(t=t.animationManager,t.isTicking&&!t.isAnimating))return;this.Tg===null||t.isTicking||(this.Tg=null)}t=this.path,t!==null&&(this.fd=!1,this.v(),t.v())}},L.vg=function(){if(!this.fd&&!this.computingPoints){var t=!0;try{this.computingPoints=!0,this.uh(),t=this.computePoints()}catch(e){this.computingPoints=!1,this.rv()}finally{this.computingPoints=!1,t?this.zf():this.rv()}}},ge.prototype.computePoints=function(){if(this.diagram===null)return!1;var t=this.fromNode,e=null;if(t===null?(o0||(o0=new Ee,o0.desiredSize=un,o0.Va()),this.defaultFromPoint&&(o0.location=this.defaultFromPoint,o0.Va(),e=t=o0)):e=this.fromPort,e!==null&&!t.isVisible()){var i=t.findVisibleNode();i!==null&&i!==t?(t=i,e=i.port):t=i}if(this.Lw=t,t===null||!t.location.w())return!1;for(;!(e===null||e.actualBounds.w()&&e.Ed());)e=e.panel;if(e===null)return!1;var n=this.toNode,s=null;if(n===null?(Sp||(Sp=new Ee,Sp.desiredSize=un,Sp.Va()),this.defaultToPoint&&(Sp.location=this.defaultToPoint,Sp.Va(),s=n=Sp)):s=this.toPort,s===null||n.isVisible()||(i=n.findVisibleNode(),i!==null&&i!==n?(n=i,s=i.port):n=i),this.Mw=n,n===null||!n.location.w())return!1;for(;!(s===null||s.actualBounds.w()&&s.Ed());)s=s.panel;if(s===null)return!1;var a=this.pointsCount,l=this.computeSpot(!0,e);i=this.computeSpot(!1,s);var c=wp(l),p=wp(i),m=e===s&&e!==null,v=this.isOrthogonal,w=this.curve===Yh;this.Wf=m&&!v?w=!0:!1;var C=this.computeAdjusting()===eh||m;if(!v&&!m&&c&&p){if(c=!1,!C&&3<=a&&(C=this.getLinkPoint(t,e,l,!0,!1,n,s),p=this.getLinkPoint(n,s,i,!1,!1,t,e),c=this.adjustPoints(0,C,a-1,p))&&(C=this.getLinkPoint(t,e,l,!0,!1,n,s),p=this.getLinkPoint(n,s,i,!1,!1,t,e),this.adjustPoints(0,C,a-1,p)),!c)if(this.Fj(),w){a=this.getLinkPoint(t,e,l,!0,!1,n,s),C=this.getLinkPoint(n,s,i,!1,!1,t,e),c=C.x-a.x,p=C.y-a.y,m=this.computeCurviness(),w=v=0;var k=a.x+c/3,T=a.y+p/3,A=k,X=T;xt.B(p,0)?X=0<c?X-m:X+m:(v=-c/p,w=Math.sqrt(m*m/(v*v+1)),0>m&&(w=-w),A=(0>p?-1:1)*w+k,X=v*(A-k)+T),k=a.x+2*c/3,T=a.y+2*p/3;var $=k,J=T;xt.B(p,0)?J=0<c?J-m:J+m:($=(0>p?-1:1)*w+k,J=v*($-k)+T),this.Fj(),this.ne(a),this.yf(A,X),this.yf($,J),this.ne(C),this.dd(0,this.getLinkPoint(t,e,l,!0,!1,n,s)),this.dd(3,this.getLinkPoint(n,s,i,!1,!1,t,e))}else a=n,C=s,n=this.getLinkPoint(t,e,l,!0,!1,a,C),s=this.getLinkPoint(a,C,i,!1,!1,t,e),this.hasCurviness()?(C=s.x-n.x,i=s.y-n.y,l=this.computeCurviness(),t=n.x+C/2,e=n.y+i/2,a=t,c=e,xt.B(i,0)?c=0<C?c-l:c+l:(C=-C/i,a=Math.sqrt(l*l/(C*C+1)),0>l&&(a=-a),a=(0>i?-1:1)*a+t,c=C*(a-t)+e),this.ne(n),this.yf(a,c),this.ne(s)):(this.ne(n),this.ne(s),c=Tt.alloc(),e.mi(c),p=c.ca(s),C.mi(c),m=c.ca(n),(p||m)&&(l=e.ga(Um(l),new G),this.dd(0,this.getLinkPointFromPoint(t,e,l,s,!0,l)),i=C.ga(Um(i),new G),this.dd(1,this.getLinkPointFromPoint(a,C,i,n,!1,i))),Tt.free(c))}else{w=this.isAvoiding,C&&(v&&w||m)&&this.Fj();var et=m?this.computeCurviness():0;w=this.getLinkPoint(t,e,l,!0,v,n,s),k=A=T=0,(v||!c||m)&&(X=this.computeEndSegmentLength(t,e,l,!0),k=this.getLinkDirection(t,e,w,l,!0,v,n,s),m&&(c||l.D(i)||!v&&l.x+i.x===1&&l.y+i.y===1)&&(k-=v?90:30,0>et&&(k-=180)),0>k?k+=360:360<=k&&(k-=360),m&&(X+=Math.abs(et)*(v?1:2)),k===0?T=X:k===90?A=X:k===180?T=-X:k===270?A=-X:(T=X*Math.cos(k*Math.PI/180),A=X*Math.sin(k*Math.PI/180)),l.Mc()&&m&&(X=e.ga(_n,G.alloc()),$=G.allocAt(X.x+1e3*T,X.y+1e3*A),this.getLinkPointFromPoint(t,e,X,$,!0,w),G.free(X),G.free($))),X=this.getLinkPoint(n,s,i,!1,v,t,e);var st=J=$=0;if(v||!p||m){var mt=this.computeEndSegmentLength(n,s,i,!1);st=this.getLinkDirection(n,s,X,i,!1,v,t,e),m&&(p||l.D(i)||!v&&l.x+i.x===1&&l.y+i.y===1)&&(st+=v?0:30,0>et&&(st+=180)),0>st?st+=360:360<=st&&(st-=360),m&&(mt+=Math.abs(et)*(v?1:2)),st===0?$=mt:st===90?J=mt:st===180?$=-mt:st===270?J=-mt:($=mt*Math.cos(st*Math.PI/180),J=mt*Math.sin(st*Math.PI/180)),i.Mc()&&m&&(i=s.ga(_n,G.alloc()),l=G.allocAt(i.x+1e3*$,i.y+1e3*J),this.getLinkPointFromPoint(n,s,i,l,!1,X),G.free(i),G.free(l))}i=w,(v||!c||m)&&(i=new G(w.x+T,w.y+A)),l=X,(v||!p||m)&&(l=new G(X.x+$,X.y+J)),!C&&!v&&c&&3<a&&this.adjustPoints(0,w,a-2,l)?this.dd(a-1,X):!C&&!v&&p&&3<a&&this.adjustPoints(1,i,a-1,X)?this.dd(0,w):!C&&(v?6<=a:4<a)&&this.adjustPoints(1,i,a-2,l)?(this.dd(0,w),this.dd(a-1,X)):(this.Fj(),this.ne(w),(v||!c||m)&&this.ne(i),v&&this.addOrthoPoints(i,k,l,st,t,n),(v||!p||m)&&this.ne(l),this.ne(X))}return!0};function fy(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?(e.x>=t.x?e.x=t.x+9e9:e.x=t.x-9e9,e.y=t.y):(e.y>=t.y?e.y=t.y+9e9:e.y=t.y-9e9,e.x=t.x),e}ge.prototype.getLinkPointFromPoint=function(t,e,i,n,s,a){if(a===void 0&&(a=new G),t===null||e===null)return a.assign(i),a;if(t.isVisible()||(s=t.findVisibleNode(),s!==null&&s!==t&&(e=s.port)),t=null,s=e.panel,s===null||s.se()||(s=s.panel),s===null){s=n.x,n=n.y;var l=i.x;i=i.y}else{t=s.oe,s=1/(t.m11*t.m22-t.m12*t.m21),l=t.m22*s;var c=-t.m12*s,p=-t.m21*s,m=t.m11*s,v=s*(t.m21*t.dy-t.m22*t.dx),w=s*(t.m12*t.dx-t.m11*t.dy);s=n.x*l+n.y*p+v,n=n.x*c+n.y*m+w,l=i.x*l+i.y*p+v,i=i.x*c+i.y*m+w}return e.Sj(s,n,l,i,a),t!==null&&a.transform(t),a};function X0(t,e){var i=e.Zn;return i===null&&(i=new Ac,i.port=e,i.node=e.part,e.Zn=i),av(i,t)}ge.prototype.getLinkPoint=function(t,e,i,n,s,a,l,c){if(c===void 0&&(c=new G),i.sb()&&!wp(i))return e.ga(i,c),c;if(i.$c()){var p=X0(this,e);if(p!==null){if(c.assign(p.Zo),s&&this.routing===vy){var m=X0(this,l);if(m!==null&&p.Gl<m.Gl){p=G.alloc(),m=G.alloc();var v=new Tt(e.ga(Fo,p),e.ga(uu,m)),w=this.computeSpot(!n,l);t=this.getLinkPoint(a,l,w,!n,s,t,e,m),(i.Hf(hu)||i.Hf(ml))&&t.y>=v.y&&t.y<=v.y+v.height?c.y=t.y:(i.Hf(_h)||i.Hf(sl))&&t.x>=v.x&&t.x<=v.x+v.width&&(c.x=t.x),G.free(p),G.free(m)}}return c}}return i=e.ga(Um(i),G.alloc()),this.pointsCount>(s?6:2)?(l=n?this.i(1):this.i(this.pointsCount-2),s&&(l=fy(i,l.copy()))):(p=this.computeSpot(!n,l),a=G.alloc(),l=l.ga(Um(p),a),s&&(l=fy(i,l)),G.free(a)),this.getLinkPointFromPoint(t,e,i,l,n,c),G.free(i),c},ge.prototype.getLinkDirection=function(t,e,i,n,s,a,l,c){t:if(n.sb())var p=n.x>n.y?n.x>1-n.y?0:n.x<1-n.y?270:315:n.x<n.y?n.x>1-n.y?90:n.x<1-n.y?180:135:.5>n.x?225:.5<n.x?45:0;else{if(n.$c()&&(p=X0(this,e),p!==null))switch(p.Nc){case 1:p=270;break t;case 2:p=180;break t;default:case 4:p=0;break t;case 8:p=90;break t}p=e.ga(_n,G.alloc()),this.pointsCount>(a?6:2)?(c=s?this.i(1):this.i(this.pointsCount-2),c=a?fy(p,c.copy()):i):(i=G.alloc(),c=c.ga(_n,i),G.free(i)),i=Math.abs(c.x-p.x)>Math.abs(c.y-p.y)?c.x>=p.x?0:180:c.y>=p.y?90:270,G.free(p),p=i}return n.Mc()&&l.Td(t)&&(p+=180,360<=p&&(p-=360)),wp(n)||(t=e.li(),t===0)||(45<=t&&135>t?p+=90:135<=t&&225>t?p+=180:225<=t&&315>t&&(p+=270),360<=p&&(p-=360)),p},ge.prototype.computeEndSegmentLength=function(t,e,i,n){return e!==null&&i.$c()&&(t=X0(this,e),t!==null)?t.Ju:(t=n?this.fromEndSegmentLength:this.toEndSegmentLength,e!==null&&isNaN(t)&&(t=n?e.fromEndSegmentLength:e.toEndSegmentLength),isNaN(t)&&(t=10),t)},ge.prototype.computeSpot=function(t,e){return e===void 0&&(e=null),t?(t=e||this.fromPort,t===null?t=_n:(e=this.fromSpot,e.Xb()&&(e=t.fromSpot),t=e===ds?jr:e)):(t=e||this.toPort,t===null?t=_n:(e=this.toSpot,e.Xb()&&(e=t.toSpot),t=e===ds?jr:e)),t};function wp(t){return t===jr||t.x===.5&&t.y===.5}function Um(t){return t.x===.5&&t.y===.5?t:_n}ge.prototype.computeOtherPoint=function(t,e){return this.computeAdjusting()!==eh&&4<this.pointsCount?this.computeMidPoint(new G):(t=e.Zn,t=t!==null?av(t,this):null,t!==null?t.Zo:e.ga(_n))},ge.prototype.computeShortLength=function(t){if(t){if(t=this.fromShortLength,isNaN(t)){var e=this.fromPort;e!==null&&(t=e.fromShortLength)}return isNaN(t)?0:t}return t=this.toShortLength,isNaN(t)&&(e=this.toPort,e!==null&&(t=e.toShortLength)),isNaN(t)?0:t},ge.prototype.Cf=function(t,e,i,n,s,a){if(this.pickable===!1)return!1;e===void 0&&(e=null),i===void 0&&(i=null);var l=a;if(a===void 0&&(l=dn.alloc(),l.reset()),l.multiply(this.transform),this.fh(t,l))return Ig(this,e,i,s),a===void 0&&dn.free(l),!0;if(this.Yc(t,l)){var c=!1;if(!this.isAtomic)for(var p=this.O.s,m=p.length;m--;){var v=p[m];if(v.visible||v===this.locationObject){var w=v.actualBounds,C=this.naturalBounds;if(!(w.x>C.width||w.y>C.height||0>w.x+w.width||0>w.y+w.height)){if(w=dn.alloc(),w.set(l),v instanceof ce)c=v.Cf(t,e,i,n,s,w);else if(this.path===v){if(v instanceof pn)if(c=t,C=n,v.pickable===!1)c=!1;else if(w.multiply(v.transform),C)t:{var k=c,T=w;if(v.fh(k,T))c=!0;else{if(T===void 0&&(T=v.transform,k.Re(v.actualBounds))){c=!0;break t}c=k.left,C=k.right;var A=k.top;k=k.bottom;var X=G.alloc(),$=G.alloc(),J=G.alloc(),et=dn.alloc();et.set(T),et.bv(v.transform),et.Vj(),$.x=C,$.y=A,$.transform(et),X.x=c,X.y=A,X.transform(et),T=!1,dp(v,X,$,J)?T=!0:(X.x=C,X.y=k,X.transform(et),dp(v,X,$,J)?T=!0:($.x=c,$.y=k,$.transform(et),dp(v,X,$,J)?T=!0:(X.x=c,X.y=A,X.transform(et),dp(v,X,$,J)&&(T=!0)))),dn.free(et),G.free(X),G.free($),G.free(J),c=T}}else c=v.fh(c,w)}else c=xl(v,t,n,w);c&&(C=v,e!==null&&(C=e(v)),C&&(i===null||i(C))&&s.add(C)),dn.free(w)}}}return a===void 0&&dn.free(l),c||this.background!==null||this.areaBackground!==null}return a===void 0&&dn.free(l),!1},ge.prototype.computeCurve=function(){if(this.Wf===null){var t=this.fromPort,e=this.isOrthogonal;this.Wf=t!==null&&t===this.toPort&&!e}return this.Wf?Yh:this.curve},ge.prototype.computeCorner=function(){if(this.curve===Yh)return 0;var t=this.corner;return(isNaN(t)||0>t)&&(t=10),t},ge.prototype.findMidLabel=function(){for(var t=this.path,e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n];if(s!==t&&!s.isPanelMain&&(s.segmentIndex===-1/0||isNaN(s.segmentIndex)))return s}for(t=this.labelNodes;t.next();)if(e=t.value,e.segmentIndex===-1/0||isNaN(e.segmentIndex))return e;return null},ge.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var t=w1;t=Math.max(t,this.computeThickness());var e=this.fromPort,i=this.toPort;if(e!==null&&i!==null){var n=this.findMidLabel();if(n!==null){var s=n.naturalBounds,a=n.margin,l=isNaN(s.width)?30:s.width*n.scale+a.left+a.right;s=isNaN(s.height)?14:s.height*n.scale+a.top+a.bottom,n=n.segmentOrientation,n===J0||n===nv||n===yy?t=Math.max(t,s):n===Xm||n===Ym||n===Mp||n===q0?t=Math.max(t,l):(e=e.ga(_n).ab(i.ga(_n))/180*Math.PI,t=Math.max(t,Math.abs(Math.sin(e)*l)+Math.abs(Math.cos(e)*s)+1)),this.curve===Yh&&(t*=1.333)}}return t},ge.prototype.arrangeBundledLinks=function(t,e){if(e)for(e=0;e<t.length;e++){var i=t[e];i.computeAdjusting()===eh&&i.bb()}},ge.prototype.computeCurviness=function(){var t=this.curviness;if(isNaN(t)){t=x1;var e=this.Sf;if(e!==null){for(var i=gi(),n=0,s=e.links,a=0;a<s.length;a++){var l=s[a].computeSpacing();i.push(l),n+=l}for(n=-n/2,a=0;a<s.length;a++){if(s[a]===this){t=n+i[a]/2;break}n+=i[a]}e.Ds===this.fromNode&&(t=-t),Ji(i)}}return t},ge.prototype.computeThickness=function(){if(!this.isVisible())return 0;var t=this.path;return t!==null?Math.max(t.strokeWidth,1):1},ge.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},ge.prototype.adjustPoints=function(t,e,i,n){var s=this.computeAdjusting();if(this.isOrthogonal){if(s===Lu)return!1;s===s0&&(s=zh)}switch(s){case Lu:var a=this.i(t),l=this.i(i);if(!a.Xa(e)||!l.Xa(n)){s=a.x,a=a.y;var c=l.x-s,p=l.y-a,m=Math.sqrt(c*c+p*p);if(!xt.$(m,0)){if(xt.$(c,0))var v=0>p?-Math.PI/2:Math.PI/2;else v=Math.atan(p/Math.abs(c)),0>c&&(v=Math.PI-v);l=e.x;var w=e.y;c=n.x-l;var C=n.y-w;for(p=Math.sqrt(c*c+C*C),xt.$(c,0)?C=0>C?-Math.PI/2:Math.PI/2:(C=Math.atan(C/Math.abs(c)),0>c&&(C=Math.PI-C)),m=p/m,v=C-v,this.dd(t,e),t+=1;t<i;t++)e=this.i(t),c=e.x-s,p=e.y-a,e=Math.sqrt(c*c+p*p),xt.$(e,0)||(xt.$(c,0)?p=0>p?-Math.PI/2:Math.PI/2:(p=Math.atan(p/Math.abs(c)),0>c&&(p=Math.PI-p)),c=p+v,e*=m,this.L(t,l+e*Math.cos(c),w+e*Math.sin(c)));this.dd(i,n)}}return!0;case s0:if(a=this.i(t),w=this.i(i),!a.Xa(e)||!w.Xa(n)){s=a.x,a=a.y,l=w.x,w=w.y,m=(l-s)*(l-s)+(w-a)*(w-a),c=e.x,v=e.y,p=n.x,C=n.y;var k=1;if(p-c!==0){var T=(C-v)/(p-c);k=Math.sqrt(1+1/(T*T))}else T=9e9;for(this.dd(t,e),t+=1;t<i;t++){e=this.i(t);var A=e.x,X=e.y,$=.5;m!==0&&($=((s-A)*(s-l)+(a-X)*(a-w))/m);var J=s+$*(l-s),et=a+$*(w-a);e=Math.sqrt((A-J)*(A-J)+(X-et)*(X-et)),X<T*(A-J)+et&&(e=-e),0<T&&(e=-e),A=c+$*(p-c),$=v+$*(C-v),T!==0?(e=A+e/k,this.L(t,e,$-(e-A)/T)):this.L(t,A,$+e)}this.dd(i,n)}return!0;case zh:t:{if(this.isOrthogonal&&(s=this.i(t),a=this.i(t+1),l=this.i(t+2),c=a.x,v=a.y,w=c,m=v,xt.B(s.y,a.y)?xt.B(a.x,l.x)?v=e.y:xt.B(a.y,l.y)&&(c=e.x):xt.B(s.x,a.x)&&(xt.B(a.y,l.y)?c=e.x:xt.B(a.x,l.x)&&(v=e.y)),this.L(t+1,c,v),s=this.i(i),a=this.i(i-1),l=this.i(i-2),c=a.x,v=a.y,p=c,C=v,xt.B(s.y,a.y)?xt.B(a.x,l.x)?v=n.y:xt.B(a.y,l.y)&&(c=n.x):xt.B(s.x,a.x)&&(xt.B(a.y,l.y)?c=n.x:xt.B(a.x,l.x)&&(v=n.y)),this.L(i-1,c,v),dy(this))){this.L(t+1,w,m),this.L(i-1,p,C),i=!1;break t}this.dd(t,e),this.dd(i,n),i=!0}return i;default:return!1}},ge.prototype.addOrthoPoints=function(t,e,i,n,s,a){0>e?e+=360:360<=e&&(e-=360),0>n?n+=360:360<=n&&(n-=360);var l=n;e=315<=e||45>e?0:45<=e&&135>e?90:135<=e&&225>e?180:270,n=315<=n||45>n?0:45<=n&&135>n?90:135<=n&&225>n?180:270;var c=s.actualBounds.copy(),p=a.actualBounds.copy();if(c.w()&&p.w()){c.Bc(Jm,Jm),p.Bc(Jm,Jm),c.Ye(t),p.Ye(i);var m=G.alloc(),v=G.alloc();e===0?i.x>t.x||n===270&&i.y<t.y&&p.right>t.x||n===90&&i.y>t.y&&p.right>t.x?(m.h(i.x,t.y),v.h(i.x,(t.y+i.y)/2),n===180?(m.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1),v.x=m.x,v.y=i.y):n===270&&i.y<t.y||n===90&&i.y>t.y?(m.x=t.x<p.left?this.computeMidOrthoPosition(t.x,t.y,p.left,i.y,!1):t.x<p.right&&(n===270&&t.y<p.top||n===90&&t.y>p.bottom)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):p.right,v.x=m.x,v.y=i.y):n===0&&t.x<p.left&&t.y>p.top&&t.y<p.bottom&&(m.x=t.x,m.y=t.y<i.y?Math.min(i.y,p.top):Math.max(i.y,p.bottom),v.y=m.y)):(m.h(t.x,i.y),v.h((t.x+i.x)/2,i.y),(n===180||n===90&&i.y<c.top||n===270&&i.y>c.bottom)&&(n===180&&(p.ca(t)||c.ca(i))?m.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):i.y<t.y&&(n===180||n===90)?m.y=this.computeMidOrthoPosition(t.x,c.top,i.x,Math.max(i.y,p.bottom),!0):i.y>t.y&&(n===180||n===270)&&(m.y=this.computeMidOrthoPosition(t.x,c.bottom,i.x,Math.min(i.y,p.top),!0)),v.x=i.x,v.y=m.y),m.y>c.top&&m.y<c.bottom&&(i.x>=c.left&&i.x<=t.x||t.x<=p.right&&t.x>=i.x?(n===90||n===270)&&(m.h(Math.max((t.x+i.x)/2,t.x),t.y),v.h(m.x,i.y)):(m.y=n===270||(n===0||n===180)&&i.y<t.y?Math.min(i.y,n===0?c.top:Math.min(c.top,p.top)):Math.max(i.y,n===0?c.bottom:Math.max(c.bottom,p.bottom)),v.x=i.x,v.y=m.y))):e===180?i.x<t.x||n===270&&i.y<t.y&&p.left<t.x||n===90&&i.y>t.y&&p.left<t.x?(m.h(i.x,t.y),v.h(i.x,(t.y+i.y)/2),n===0?(m.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1),v.x=m.x,v.y=i.y):n===270&&i.y<t.y||n===90&&i.y>t.y?(m.x=t.x>p.right?this.computeMidOrthoPosition(t.x,t.y,p.right,i.y,!1):t.x>p.left&&(n===270&&t.y<p.top||n===90&&t.y>p.bottom)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):p.left,v.x=m.x,v.y=i.y):n===180&&t.x>p.right&&t.y>p.top&&t.y<p.bottom&&(m.x=t.x,m.y=t.y<i.y?Math.min(i.y,p.top):Math.max(i.y,p.bottom),v.y=m.y)):(m.h(t.x,i.y),v.h((t.x+i.x)/2,i.y),(n===0||n===90&&i.y<c.top||n===270&&i.y>c.bottom)&&(n===0&&(p.ca(t)||c.ca(i))?m.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):i.y<t.y&&(n===0||n===90)?m.y=this.computeMidOrthoPosition(t.x,c.top,i.x,Math.max(i.y,p.bottom),!0):i.y>t.y&&(n===0||n===270)&&(m.y=this.computeMidOrthoPosition(t.x,c.bottom,i.x,Math.min(i.y,p.top),!0)),v.x=i.x,v.y=m.y),m.y>c.top&&m.y<c.bottom&&(i.x<=c.right&&i.x>=t.x||t.x>=p.left&&t.x<=i.x?(n===90||n===270)&&(m.h(Math.min((t.x+i.x)/2,t.x),t.y),v.h(m.x,i.y)):(m.y=n===270||(n===0||n===180)&&i.y<t.y?Math.min(i.y,n===180?c.top:Math.min(c.top,p.top)):Math.max(i.y,n===180?c.bottom:Math.max(c.bottom,p.bottom)),v.x=i.x,v.y=m.y))):e===90?i.y>t.y||n===180&&i.x<t.x&&p.bottom>t.y||n===0&&i.x>t.x&&p.bottom>t.y?(m.h(t.x,i.y),v.h((t.x+i.x)/2,i.y),n===270?(m.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0),v.x=i.x,v.y=m.y):n===180&&i.x<t.x||n===0&&i.x>t.x?(m.y=t.y<p.top?this.computeMidOrthoPosition(t.x,t.y,i.x,p.top,!0):t.y<p.bottom&&(n===180&&t.x<p.left||n===0&&t.x>p.right)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):p.bottom,v.x=i.x,v.y=m.y):n===90&&t.y<p.top&&t.x>p.left&&t.x<p.right&&(m.x=t.x<i.x?Math.min(i.x,p.left):Math.max(i.x,p.right),m.y=t.y,v.x=m.x)):(m.h(i.x,t.y),v.h(i.x,(t.y+i.y)/2),(n===270||n===0&&i.x<c.left||n===180&&i.x>c.right)&&(n===270&&(p.ca(t)||c.ca(i))?m.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):i.x<t.x&&(n===270||n===0)?m.x=this.computeMidOrthoPosition(c.left,t.y,Math.max(i.x,p.right),i.y,!1):i.x>t.x&&(n===270||n===180)&&(m.x=this.computeMidOrthoPosition(c.right,t.y,Math.min(i.x,p.left),i.y,!1)),v.x=m.x,v.y=i.y),m.x>c.left&&m.x<c.right&&(i.y>=c.top&&i.y<=t.y||t.y<=p.bottom&&t.y>=i.y?(n===0||n===180)&&(m.h(t.x,Math.max((t.y+i.y)/2,t.y)),v.h(i.x,m.y)):(m.x=n===180||(n===90||n===270)&&i.x<t.x?Math.min(i.x,n===90?c.left:Math.min(c.left,p.left)):Math.max(i.x,n===90?c.right:Math.max(c.right,p.right)),v.x=m.x,v.y=i.y))):i.y<t.y||n===180&&i.x<t.x&&p.top<t.y||n===0&&i.x>t.x&&p.top<t.y?(m.h(t.x,i.y),v.h((t.x+i.x)/2,i.y),n===90?(m.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0),v.x=i.x,v.y=m.y):n===180&&i.x<t.x||n===0&&i.x>=t.x?(m.y=t.y>p.bottom?this.computeMidOrthoPosition(t.x,t.y,i.x,p.bottom,!0):t.y>p.top&&(n===180&&t.x<p.left||n===0&&t.x>p.right)?this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):p.top,v.x=i.x,v.y=m.y):n===270&&t.y>p.bottom&&t.x>p.left&&t.x<p.right&&(m.x=t.x<i.x?Math.min(i.x,p.left):Math.max(i.x,p.right),m.y=t.y,v.x=m.x)):(m.h(i.x,t.y),v.h(i.x,(t.y+i.y)/2),(n===90||n===0&&i.x<c.left||n===180&&i.x>c.right)&&(n===90&&(p.ca(t)||c.ca(i))?m.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):i.x<t.x&&(n===90||n===0)?m.x=this.computeMidOrthoPosition(c.left,t.y,Math.max(i.x,p.right),i.y,!1):i.x>t.x&&(n===90||n===180)&&(m.x=this.computeMidOrthoPosition(c.right,t.y,Math.min(i.x,p.left),i.y,!1)),v.x=m.x,v.y=i.y),m.x>c.left&&m.x<c.right&&(i.y<=c.bottom&&i.y>=t.y||t.y>=p.top&&t.y<=i.y?(n===0||n===180)&&(m.h(t.x,Math.min((t.y+i.y)/2,t.y)),v.h(i.x,m.y)):(m.x=n===180||(n===90||n===270)&&i.x<t.x?Math.min(i.x,n===270?c.left:Math.min(c.left,p.left)):Math.max(i.x,n===270?c.right:Math.max(c.right,p.right)),v.x=m.x,v.y=i.y)));var w=i;if(this.isAvoiding){var C=this.diagram;if(C===null||s===a||this.layer.isTemporary||!ou(C)||c.ca(w)&&!a.Td(s)||p.ca(t)&&!s.Td(a))e=!1;else{var k=Wh(C,!0,this.containingGroup,null);if(this.segmentIndex!==17&&k.Yj(Math.min(t.x,m.x),Math.min(t.y,m.y),Math.abs(t.x-m.x),Math.abs(t.y-m.y))&&k.Yj(Math.min(m.x,v.x),Math.min(m.y,v.y),Math.abs(m.x-v.x),Math.abs(m.y-v.y))&&k.Yj(Math.min(v.x,w.x),Math.min(v.y,w.y),Math.abs(v.x-w.x),Math.abs(v.y-w.y)))e=!1;else{s=t,a=w;var T=i=null;if(C.isVirtualized){C=k.bounds.copy(),C.Bc(-k.Ho,-k.Go);var A=G.alloc();tm(k,t.x,t.y)||(xt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,t.x,t.y,m.x,m.y,A)?(i=t=A.copy(),e=A.ab(m)):xt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,m.x,m.y,v.x,v.y,A)?(i=t=A.copy(),e=A.ab(v)):xt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,v.x,v.y,w.x,w.y,A)&&(i=t=A.copy(),e=A.ab(w))),tm(k,w.x,w.y)||(xt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,w.x,w.y,v.x,v.y,A)?(T=w=A.copy(),n=v.ab(A)):xt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,v.x,v.y,m.x,m.y,A)?(T=w=A.copy(),n=m.ab(A)):xt.Ff(C.x,C.y,C.x+C.width,C.y+C.height,m.x,m.y,t.x,t.y,A)&&(T=w=A.copy(),n=t.ab(A))),G.free(A)}c=c.copy().ed(p),c.Bc(k.Ho*k.Os,k.Go*k.Os),xy(k,t,e,w,n,c,!0),p=sf(k,w.x,w.y),!k.abort&&p>=em&&(b1(k),c.Bc(k.Ho*k.Hx,k.Go*k.Ix),xy(k,t,e,w,n,c,!1),p=sf(k,w.x,w.y)),!k.abort&&p<em&&sf(k,w.x,w.y)!==jf?(Zm(this,k,w.x,w.y,n,!0,l),c=this.i(2),4>this.pointsCount?(e===0||e===180?(c.x=t.x,c.y=w.y):(c.x=w.x,c.y=t.y),this.L(2,c.x,c.y),this.m(3,c.x,c.y)):(l=this.i(3),e===0||e===180?xt.B(c.x,l.x)?(c=e===0?Math.max(c.x,t.x):Math.min(c.x,t.x),this.L(2,c,t.y),this.L(3,c,l.y)):xt.B(c.y,l.y)?(Math.abs(t.y-c.y)<=k.Go/2&&(this.L(2,c.x,t.y),this.L(3,l.x,t.y)),this.m(2,c.x,t.y)):this.L(2,t.x,c.y):(e===90||e===270)&&(xt.B(c.y,l.y)?(c=e===90?Math.max(c.y,t.y):Math.min(c.y,t.y),this.L(2,t.x,c),this.L(3,l.x,c)):xt.B(c.x,l.x)?(Math.abs(t.x-c.x)<=k.Ho/2&&(this.L(2,t.x,c.y),this.L(3,t.x,l.y)),this.m(2,t.x,c.y)):this.L(2,c.x,t.y))),i!==null&&(t=this.i(1),l=this.i(2),t.x!==l.x&&t.y!==l.y?e===0||e===180?this.m(2,t.x,l.y):this.m(2,l.x,t.y):e===0||e===180?this.m(2,s.x,i.y):this.m(2,i.x,s.y)),T!==null&&(n===0||n===180?this.yf(a.x,T.y):this.yf(T.x,a.y)),e=!0):e=!1}}}else e=!1;e||(this.ne(m.copy()),this.ne(v.copy())),G.free(m),G.free(v)}},ge.prototype.computeMidOrthoPosition=function(t,e,i,n,s){var a=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(a=this.computeCurviness()),s?(e+n)/2+a:(t+i)/2+a};function dy(t){if(t.diagram===null||!t.isAvoiding||!ou(t.diagram))return!1;var e=t.points.s,i=e.length;if(4>i)return!1;t=Wh(t.diagram,!0,t.containingGroup,null);for(var n=1;n<i-2;n++){var s=e[n],a=e[n+1];if(!t.Yj(Math.min(s.x,a.x),Math.min(s.y,a.y),Math.abs(s.x-a.x),Math.abs(s.y-a.y)))return!0}return!1}function Zm(t,e,i,n,s,a,l){var c=e.Ho,p=e.Go,m=sf(e,i,n),v=i,w=n;for(s===0?v+=c:s===90?w+=p:s===180?v-=c:w-=p,s!==l&&m>Cp&&sf(e,v,w)!==m-1&&(sf(e,i-c,n)===m-1?(s=180,v=i-c,w=n):sf(e,i+c,n)===m-1?(s=0,v=i+c,w=n):sf(e,i,n-p)===m-1?(s=270,v=i,w=n-p):sf(e,i,n+p)===m-1&&(s=90,v=i,w=n+p));m>Cp&&sf(e,v,w)===m-1;)i=v,n=w,s===0?v+=c:s===90?w+=p:s===180?v-=c:w-=p,--m;a?m>Cp&&(s===180||s===0?i=Math.floor(i/c)*c+c/2:(s===90||s===270)&&(n=Math.floor(n/p)*p+p/2)):(i=Math.floor(i/c)*c+c/2,n=Math.floor(n/p)*p+p/2),m>Cp&&(a=s,l=i,v=n,s===0?(a=90,v+=p):s===90?(a=180,l-=c):s===180?(a=270,v-=p):s===270&&(a=0,l+=c),sf(e,l,v)===m-1?Zm(t,e,l,v,a,!1,a):(l=i,v=n,s===0?(a=270,v-=p):s===90?(a=0,l+=c):s===180?(a=90,v+=p):s===270&&(a=180,l-=c),sf(e,l,v)===m-1&&Zm(t,e,l,v,a,!1,a))),t.yf(i,n)}ge.prototype.ez=function(t){var e=t.x;t=t.y;for(var i=this.i(0),n=this.i(1),s=re(e,t,i.x,i.y,n.x,n.y),a=0,l=1;l<this.pointsCount-1;l++){i=this.i(l+1);var c=re(e,t,n.x,n.y,i.x,i.y);n=i,c<s&&(a=l,s=c)}return a},ge.prototype.qc=function(){this.lk=!1,this.v()},ge.prototype.Ul=function(t){if(!(!t&&(this.fd===!1||(t=this.Pb(),this.lk&&(t===null||t.geometry!==null))))&&(2>this.pointsCount?this.lk=!0:this.ua=this.makeGeometry(),t=this.path,t!==null)){t.ua=this.ua;for(var e=this.O.s,i=e.length,n=0;n<i;n++){var s=e[n];s!==t&&s.isPanelMain&&s instanceof pn&&(s.ua=this.ua)}}},ge.prototype.makeGeometry=function(){var t=this.ua,e=this.pointsCount,i=!1,n=this.diagram;n!==null&&Kd(this)&&n.Eh.contains(this)&&(this.ml.width!==0||this.ml.height!==0)&&(n.animationManager.isAnimating||n.currentTool!==n.toolManager)&&(i=!0);var s=this.i(0).copy(),a=s.copy();n=this.Nb.s;var l=this.computeCurve();if(l===Yh&&3<=e&&!xt.$(this.smoothness,0))if(e===3){var c=this.i(1);n=Math.min(s.x,c.x);var p=Math.min(s.y,c.y);c=this.i(2),n=Math.min(n,c.x),p=Math.min(p,c.y)}else{if(this.isOrthogonal)for(p=0;p<e;p++)c=n[p],a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y);else for(n=3;n<e;n+=3)n+3>=e&&(n=e-1),p=this.i(n),a.x=Math.min(p.x,a.x),a.y=Math.min(p.y,a.y);n=a.x,p=a.y}else{for(p=0;p<e;p++)c=n[p],a.x=Math.min(c.x,a.x),a.y=Math.min(c.y,a.y);n=a.x,p=a.y}if(n-=this.su.x,p-=this.su.y,s.x-=n,s.y-=p,e!==2||Kd(this)){if(t.type=ve.o,c=ny(t),this.computeShortLength(!0)!==0&&(s=bp(this,s,!0,a)),mp(c,s.x,s.y,!1),l===Yh&&3<=e&&!xt.$(this.smoothness,0))if(e===3)i=this.i(1),e=i.x-n,i=i.y-p,s=this.i(2).copy(),s.x-=n,s.y-=p,this.computeShortLength(!1)!==0&&(s=bp(this,s,!1,a)),jc(c,e,i,e,i,s.x,s.y);else if(this.isOrthogonal){e=G.allocAt(n,p),i=G.alloc(),i.assign(this.i(1)),a=G.allocAt(n,p),s=G.allocAt(n,p),l=this.i(0);for(var m,v=this.smoothness/3,w=1;w<this.pointsCount-1;w++){m=this.i(w);var C=l,k=m,T=this.i(jd(this,m,w,!1));if((!xt.$(C.x,k.x)||!xt.$(k.x,T.x))&&(!xt.$(C.y,k.y)||!xt.$(k.y,T.y))){var A=v;isNaN(A)&&(A=this.smoothness/3);var X=C.x;C=C.y;var $=k.x;k=k.y;var J=T.x;T=T.y;var et=A*Y0(X,C,$,k);A*=Y0($,k,J,T),xt.$(C,k)&&xt.$($,J)&&($>X?T>k?(a.x=$-et,a.y=k-et,s.x=$+A,s.y=k+A):(a.x=$-et,a.y=k+et,s.x=$+A,s.y=k-A):T>k?(a.x=$+et,a.y=k-et,s.x=$-A,s.y=k+A):(a.x=$+et,a.y=k+et,s.x=$-A,s.y=k-A)),xt.$(X,$)&&xt.$(k,T)&&(k>C?(J>$?(a.x=$-et,a.y=k-et,s.x=$+A):(a.x=$+et,a.y=k-et,s.x=$-A),s.y=k+A):(J>$?(a.x=$-et,a.y=k+et,s.x=$+A):(a.x=$+et,a.y=k+et,s.x=$-A),s.y=k-A)),(xt.$(X,$)&&xt.$($,J)||xt.$(C,k)&&xt.$(k,T))&&(X=.5*(X+J),C=.5*(C+T),a.x=X,a.y=C,s.x=X,s.y=C),(w===1||w===2&&xt.$(l.x,this.i(0).x)&&xt.$(l.y,this.i(0).y))&&(i.x=.5*(l.x+m.x),i.y=.5*(l.y+m.y)),jc(c,i.x-n,i.y-p,a.x-n,a.y-p,m.x-n,m.y-p),e.set(a),i.set(s),l=m}}m=l.x,l=l.y,v=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(v=bp(this,v.copy(),!1,Wa)),m=.5*(m+v.x),l=.5*(l+v.y),jc(c,s.x-n,s.y-p,m-n,l-p,v.x-n,v.y-p),G.free(e),G.free(i),G.free(a),G.free(s)}else for(i=3;i<e;i+=3)a=this.i(i-2),i+3>=e&&(i=e-1),s=this.i(i-1),l=this.i(i),i===e-1&&this.computeShortLength(!1)!==0&&(l=bp(this,l.copy(),!1,Wa)),jc(c,a.x-n,a.y-p,s.x-n,s.y-p,l.x-n,l.y-p);else{for(a=G.alloc(),a.assign(this.i(0)),s=G.alloc(),s.assign(a),l=this.computeCorner(),w=1,m=0;w<e;){if(w=jd(this,a,w,1<w),v=this.i(w),w>=e-1){if(!a.D(v))this.computeShortLength(!1)!==0&&(v=bp(this,v.copy(),!1,Wa)),od(this,c,-n,-p,a,v,i);else if(m===0)for(w=1;w<e;)s.assign(a),v=this.i(w++),od(this,c,-n,-p,a,v,i),a.assign(v);break}if(m=jd(this,v,w+1,w<e-3),w=-n,X=-p,C=v,$=this.i(m),A=i,xt.B(a.y,C.y)&&xt.B(C.x,$.x))if(T=Math.min(l,Math.abs(C.x-s.x)/2),T=et=Math.min(T,Math.abs($.y-C.y)/2),xt.B(T,0))od(this,c,w,X,a,C,A),a.assign(C);else{var st=C.x,mt=C.y;k=st,J=mt,C.x>a.x?st=C.x-T:st=C.x+T,$.y>C.y?J=C.y+et:J=C.y-et,$=G.allocAt(st,mt),od(this,c,w,X,a,$,A),G.free($),Fd(c,C.x+w,C.y+X,k+w,J+X),a.h(k,J)}else xt.B(a.x,C.x)&&xt.B(C.y,$.y)?(T=Math.min(l,Math.abs(C.y-s.y)/2),T=et=Math.min(T,Math.abs($.x-C.x)/2),xt.B(et,0)?(od(this,c,w,X,a,C,A),a.assign(C)):(st=C.x,mt=C.y,k=st,J=mt,C.y>a.y?mt=C.y-T:mt=C.y+T,$.x>C.x?k=C.x+et:k=C.x-et,$=G.allocAt(st,mt),od(this,c,w,X,a,$,A),G.free($),Fd(c,C.x+w,C.y+X,k+w,J+X),a.h(k,J))):(od(this,c,w,X,a,C,A),a.assign(C));s.assign(v),w=m}G.free(a)}i0=c}else c=this.i(1).copy(),c.x-=n,c.y-=p,this.computeShortLength(!0)!==0&&(s=bp(this,s,!0,a)),this.computeShortLength(!1)!==0&&(c=bp(this,c,!1,a)),t.type=ve.j,t.startX=s.x,t.startY=s.y,t.endX=c.x,t.endY=c.y;return this.lk=!0,t};function Y0(t,e,i,n){return t=i-t,isNaN(t)||t===1/0||t===-1/0?NaN:(0>t&&(t=-t),e=n-e,isNaN(e)||e===1/0||e===-1/0?NaN:(0>e&&(e=-e),xt.$(t,0)?e:xt.$(e,0)?t:Math.sqrt(t*t+e*e)))}function bp(t,e,i,n){var s=t.pointsCount;if(2>s)return e;if(i){var a=t.i(1);if(i=a.x-n.x,a=a.y-n.y,n=Y0(e.x,e.y,i,a),n===0)return e;s=s===2?.5*n:n,t=t.computeShortLength(!0),t>s&&(t=s),s=t*(a-e.y)/n,e.x+=t*(i-e.x)/n,e.y+=s}else{if(a=t.i(s-2),i=a.x-n.x,a=a.y-n.y,n=Y0(e.x,e.y,i,a),n===0)return e;s=s===2?.5*n:n,t=t.computeShortLength(!1),t>s&&(t=s),s=t*(e.y-a)/n,e.x-=t*(e.x-i)/n,e.y-=s}return e}function jd(t,e,i,n){for(var s=t.pointsCount,a=e;xt.$(e.x,a.x)&&xt.$(e.y,a.y);){if(i>=s)return s-1;a=t.i(i++)}if(!xt.$(e.x,a.x)&&!xt.$(e.y,a.y))return i-1;for(var l=a;xt.$(e.x,a.x)&&xt.$(a.x,l.x)&&(!n||(e.y>=a.y?a.y>=l.y:a.y<=l.y))||xt.$(e.y,a.y)&&xt.$(a.y,l.y)&&(!n||(e.x>=a.x?a.x>=l.x:a.x<=l.x));){if(i>=s)return s-1;l=t.i(i++)}return i-2}ge.prototype.computeJumpLength=function(){return 10};function od(t,e,i,n,s,a,l){if(!l&&Kd(t)){l=t.computeJumpLength();var c=l/2,p=[],m=0;if(t.isVisible()&&(m=tv(t,s,a,p)),0<m){if(xt.B(s.y,a.y))if(s.x<a.x)for(var v=0;v<m;){var w=Math.max(s.x,Math.min(p[v++]-c,a.x-l));e.lineTo(w+i,a.y+n);for(var C=w+i,k=Math.min(w+l,a.x);v<m&&(w=p[v],w<k+l);)v++,k=Math.min(w+c,a.x);w=a.y-l+n,k+=i;var T=a.y+n;t.curve===Fh?mp(e,k,T,!1):jc(e,C,w,k,w,k,T)}else for(--m;0<=m;){for(v=Math.min(s.x,Math.max(p[m--]+c,a.x+l)),e.lineTo(v+i,a.y+n),C=v+i,w=Math.max(v-l,a.x);0<=m&&(v=p[m],v>w-l);)m--,w=Math.max(v-c,a.x);v=a.y-l+n,w+=i,k=a.y+n,t.curve===Fh?mp(e,w,k,!1):jc(e,C,v,w,v,w,k)}else if(xt.B(s.x,a.x))if(s.y<a.y)for(v=0;v<m;){for(w=Math.max(s.y,Math.min(p[v++]-c,a.y-l)),e.lineTo(a.x+i,w+n),C=w+n,w=Math.min(w+l,a.y);v<m&&(k=p[v],k<w+l);)v++,w=Math.min(k+c,a.y);k=a.x-l+i,T=a.x+i,w+=n,t.curve===Fh?mp(e,T,w,!1):jc(e,k,C,k,w,T,w)}else for(--m;0<=m;){for(v=Math.min(s.y,Math.max(p[m--]+c,a.y+l)),e.lineTo(a.x+i,v+n),C=v+n,v=Math.max(v-l,a.y);0<=m&&(w=p[m],w>v-l);)m--,v=Math.max(w-c,a.y);w=a.x-l+i,k=a.x+i,v+=n,t.curve===Fh?mp(e,k,v,!1):jc(e,w,C,w,v,k,v)}}}e.lineTo(a.x+i,a.y+n)}function tv(t,e,i,n){var s=t.diagram;if(s===null||e.D(i))return 0;for(s=s.layers;s.next();){var a=s.value;if(a!==null&&a.visible){a=a.Pa.s;for(var l=a.length,c=0;c<l;c++){var p=a[c];if(p instanceof ge){if(p===t)return 0<n.length&&n.sort(function(v,w){return v-w}),n.length;if(p.isVisible()&&Kd(p)){var m=p.routeBounds;m.w()&&t.routeBounds.Yc(m)&&!t.usesSamePort(p)&&(m=p.path,m!==null&&m.Ed()&&py(e,i,n,p))}}}}}return 0<n.length&&n.sort(function(v,w){return v-w}),n.length}function py(t,e,i,n){for(var s=xt.B(t.y,e.y),a=n.pointsCount,l=n.i(0),c=G.alloc(),p=1;p<a;p++){var m=n.i(p);if(p<a-1){var v=n.i(p+1);if(l.y===m.y&&m.y===v.y){if(m.x>l.x&&v.x>=m.x||m.x<l.x&&v.x<=m.x)continue}else if(l.x===m.x&&m.x===v.x&&(m.y>l.y&&v.y>=m.y||m.y<l.y&&v.y<=m.y))continue}t:{v=t.x;var w=t.y,C=e.x,k=e.y,T=l.x;l=l.y;var A=m.x,X=m.y;if(xt.B(v,C)){if(!xt.B(w,k)&&xt.B(l,X)&&Math.min(w,k)<l&&Math.max(w,k)>l&&Math.min(T,A)<v&&Math.max(T,A)>v&&!xt.B(T,A)){c.x=v,c.y=l,v=!0;break t}}else if(xt.B(w,k)&&xt.B(T,A)&&Math.min(v,C)<T&&Math.max(v,C)>T&&Math.min(l,X)<w&&Math.max(l,X)>w&&!xt.B(l,X)){c.x=T,c.y=w,v=!0;break t}c.x=0,c.y=0,v=!1}v&&(s?i.push(c.x):i.push(c.y)),l=m}G.free(c)}function Kd(t){return t=t.curve,t===el||t===Fh}function ev(t,e){(e||Kd(t))&&(e=t.diagram,e===null||e.animationManager.isTicking||e.Eh.contains(t)||t.ml.width===0&&t.ml.height===0||e.Eh.add(t,t.ml.copy()))}ge.prototype.Xo=function(t){var e=this.layer;if(e!==null&&e.visible&&!e.isTemporary){var i=e.diagram;if(i!==null&&!i.animationManager.isTicking){var n=!1;for(i=i.layers;i.next();){var s=i.value;if(s.visible){if(s===e){n=!0;var a=!1;s=s.Pa.s;for(var l=s.length,c=0;c<l;c++){var p=s[c];p instanceof ge&&(p===this?a=!0:a&&my(this,p,t))}}else if(n)for(a=s.Pa.s,s=a.length,l=0;l<s;l++)c=a[l],c instanceof ge&&my(this,c,t)}}}}};function my(t,e,i){if(e!==null&&e.lk&&e.fd&&Kd(e)){var n=e.routeBounds;n.w()&&(t.routeBounds.Yc(n)||i.Yc(n))&&(t.usesSamePort(e)||e.qc())}}ge.prototype.usesSamePort=function(t){var e=this.pointsCount,i=t.pointsCount;if(0<e&&0<i){var n=this.i(0),s=t.i(0);if(n.Xa(s)||(e=this.i(e-1),t=t.i(i-1),e.Xa(t)||n.Xa(t)||e.Xa(s)))return!0}else if(this.fromNode===t.fromNode||this.toNode===t.toNode||this.fromNode===t.toNode||this.toNode===t.fromNode)return!0;return!1},ge.prototype.isVisible=function(){if(!bi.prototype.isVisible.call(this))return!1;var t=this.containingGroup,e=!0,i=this.diagram;if(i!==null&&(e=i.isTreePathToChildren),i=this.fromNode,i!==null){if(this.isTreeLink&&e&&!i.isTreeExpanded)return!1;if(i===t)return!0;for(var n=i;n!==null;){if(n.labeledLink===this)return!0;n=n.containingGroup}if(i=i.findVisibleNode(),i===null||i===t)return!1}if(i=this.toNode,i!==null){if(this.isTreeLink&&!e&&!i.isTreeExpanded)return!1;if(i===t)return!0;for(e=i;e!==null;){if(e.labeledLink===this)return!0;e=e.containingGroup}if(e=i.findVisibleNode(),e===null||e===t)return!1}return!0},ge.prototype.Zb=function(t){if(bi.prototype.Zb.call(this,t),t&&ev(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var e=this.wd.iterator;e.next();)e.value.Zb(t)},ge.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?zh:this.qk};function Gm(t){var e=t.ef;if(e!==null){var i=t.uf;if(i!==null&&isNaN(t.curviness)){for(var n=t.ff,s=t.vf,a=t=null,l=e.jb.s,c=l.length,p=0;p<c;p++){var m=l[p];(m.ef===e&&m.ff===n&&m.uf===i&&m.vf===s||m.ef===i&&m.ff===s&&m.uf===e&&m.vf===n)&&(a===null?a=m:(t===null&&(t=[],t.push(a)),t.push(m)))}if(t!==null){for(a=p1(e,i,n,s),a===null&&(a=new Q0(e,n,i,s),sy(e,a),sy(i,a)),a.links=t,e=0;e<t.length;e++)t[e].Sf=a;a.Sl()}}}}function Hd(t){var e=t.Sf;e!==null&&isNaN(t.curviness)&&(t.Sf=null,t=e.links.indexOf(t),0<=t&&(Lr(e.links,t),e.Sl()))}ge.prototype.ph=function(){return!0},St.Object.defineProperties(ge.prototype,{fromNode:{get:function(){return this.ef},set:function(t){var e=this.ef;if(e!==t){var i=this.fromPort;e!==null&&(this.uf!==e&&Yg(e,this,i),Hd(this),this.C(2)),this.ef=t,t!==null&&this.Zb(t.isVisible()),this.Wf=null,this.bb();var n=this.diagram;n!==null&&n.aa&&n.partManager.setFromNodeForLink(this,t,e);var s=this.fromPort,a=this.fromPortChanged;if(a!==null){var l=!0;n!==null&&(l=n.aa,n.aa=!0),a(this,i,s),n!==null&&(n.aa=l)}t!==null&&(this.uf!==t&&Hm(t,this,s),Gm(this),this.C(1)),this.g("fromNode",e,t),r0(this)}}},fromPortId:{get:function(){return this.ff},set:function(t){var e=this.ff;if(e!==t){var i=this.fromPort;i!==null&&Bh(i),Hd(this),this.ff=t;var n=this.fromPort;n!==null&&Bh(n);var s=this.diagram;if(s!==null){var a=this.data,l=s.model;a!==null&&l.ri()&&l.xv(a,t)}i!==n&&(this.Wf=null,this.bb(),a=this.fromPortChanged,a!==null&&(l=!0,s!==null&&(l=s.aa,s.aa=!0),a(this,i,n),s!==null&&(s.aa=l))),Gm(this),this.g("fromPortId",e,t)}}},fromPort:{get:function(){var t=this.ef;return t===null?null:t.ns(this.ff)}},fromPortChanged:{get:function(){return this.gn},set:function(t){var e=this.gn;e!==t&&(this.gn=t,this.g("fromPortChanged",e,t))}},toNode:{get:function(){return this.uf},set:function(t){var e=this.uf;if(e!==t){var i=this.toPort;e!==null&&(this.ef!==e&&Yg(e,this,i),Hd(this),this.C(2)),this.uf=t,t!==null&&this.Zb(t.isVisible()),this.Wf=null,this.bb();var n=this.diagram;n!==null&&n.aa&&n.partManager.setToNodeForLink(this,t,e);var s=this.toPort,a=this.toPortChanged;if(a!==null){var l=!0;n!==null&&(l=n.aa,n.aa=!0),a(this,i,s),n!==null&&(n.aa=l)}t!==null&&(this.ef!==t&&Hm(t,this,s),Gm(this),this.C(1)),this.g("toNode",e,t),r0(this)}}},toPortId:{get:function(){return this.vf},set:function(t){var e=this.vf;if(e!==t){var i=this.toPort;i!==null&&Bh(i),Hd(this),this.vf=t;var n=this.toPort;n!==null&&Bh(n);var s=this.diagram;if(s!==null){var a=this.data,l=s.model;a!==null&&l.ri()&&l.Cv(a,t)}i!==n&&(this.Wf=null,this.bb(),a=this.toPortChanged,a!==null&&(l=!0,s!==null&&(l=s.aa,s.aa=!0),a(this,i,n),s!==null&&(s.aa=l))),Gm(this),this.g("toPortId",e,t)}}},toPort:{get:function(){var t=this.uf;return t===null?null:t.ns(this.vf)}},toPortChanged:{get:function(){return this.uo},set:function(t){var e=this.uo;e!==t&&(this.uo=t,this.g("toPortChanged",e,t))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:ds},set:function(t){var e=this.fromSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.Xi=t,this.g("fromSpot",e,t),(e.$c()||t.$c())&&this.fromNode!==null&&Bh(this.fromPort),this.bb())}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:NaN},set:function(t){var e=this.fromEndSegmentLength;e!==t&&(0>t&&Re(t,">= 0",ge,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=t,this.g("fromEndSegmentLength",e,t),this.bb())}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:NaN},set:function(t){var e=this.fromShortLength;e!==t&&(this.Xc(),this.ba.Wi=t,this.qc(),this.g("fromShortLength",e,t))}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:ds},set:function(t){var e=this.toSpot;e.D(t)||(t=t.J(),this.Xc(),this.ba.yj=t,this.g("toSpot",e,t),(e.$c()||t.$c())&&this.toNode!==null&&Bh(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:NaN},set:function(t){var e=this.toEndSegmentLength;e!==t&&(0>t&&Re(t,">= 0",ge,"toEndSegmentLength"),this.Xc(),this.ba.wj=t,this.g("toEndSegmentLength",e,t),this.bb())}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:NaN},set:function(t){var e=this.toShortLength;e!==t&&(this.Xc(),this.ba.xj=t,this.qc(),this.g("toShortLength",e,t))}},isLabeledLink:{get:function(){return this.wd===null?!1:0<this.wd.count}},labelNodes:{get:function(){return this.wd===null?Tr:this.wd.iterator}},relinkableFrom:{get:function(){return(this.Qa&1)!==0},set:function(t){var e=(this.Qa&1)!==0;e!==t&&(this.Qa^=1,this.g("relinkableFrom",e,t),this.Wb())}},relinkableTo:{get:function(){return(this.Qa&2)!==0},set:function(t){var e=(this.Qa&2)!==0;e!==t&&(this.Qa^=2,this.g("relinkableTo",e,t),this.Wb())}},resegmentable:{get:function(){return(this.Qa&4)!==0},set:function(t){var e=(this.Qa&4)!==0;e!==t&&(this.Qa^=4,this.g("resegmentable",e,t),this.Wb())}},isTreeLink:{get:function(){return(this.Qa&8)!==0},set:function(t){var e=(this.Qa&8)!==0;e!==t&&(this.Qa^=8,this.g("isTreeLink",e,t),this.fromNode!==null&&Vm(this.fromNode),this.toNode!==null&&Vm(this.toNode))}},path:{get:function(){var t=this.Pb();return t instanceof pn?t:null}},routeBounds:{get:function(){this.vg();var t=this.ml,e=1/0,i=1/0,n=this.pointsCount;if(n===0)t.h(NaN,NaN,0,0);else{if(n===1)n=this.i(0),e=Math.min(n.x,e),i=Math.min(n.y,i),t.h(n.x,n.y,0,0);else if(n===2){n=this.i(0);var s=this.i(1);e=Math.min(n.x,s.x),i=Math.min(n.y,s.y),t.h(n.x,n.y,0,0),t.Ye(s)}else if(this.computeCurve()===Yh&&3<=n&&!this.isOrthogonal)if(s=this.i(0),e=s.x,i=s.y,t.h(e,i,0,0),n===3){n=this.i(1),e=Math.min(n.x,e),i=Math.min(n.y,i);var a=this.i(2);e=Math.min(a.x,e),i=Math.min(a.y,i),xt.Dl(s.x,s.y,n.x,n.y,n.x,n.y,a.x,a.y,.5,t)}else for(a=3;a<n;a+=3){var l=this.i(a-2);a+3>=n&&(a=n-1);var c=this.i(a-1),p=this.i(a);xt.Dl(s.x,s.y,l.x,l.y,c.x,c.y,p.x,p.y,.5,t),e=Math.min(p.x,e),i=Math.min(p.y,i),s=p}else for(s=this.i(0),a=this.i(1),e=Math.min(s.x,a.x),i=Math.min(s.y,a.y),t.h(s.x,s.y,0,0),t.Ye(a),s=2;s<n;s++)a=this.i(s),e=Math.min(a.x,e),i=Math.min(a.y,i),t.Ye(a);this.su.h(e-t.x,i-t.y)}return t}},midPoint:{get:function(){return this.vg(),this.computeMidPoint(new G)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Qg(this);for(var t=this.cq=[],e=this.pointsCount,i=0;i<e-1;i++){var n=this.i(i),s=this.i(i+1);xt.$(n.x,s.x)?(n=s.y-n.y,0>n&&(n=-n)):xt.$(n.y,s.y)?(n=s.x-n.x,0>n&&(n=-n)):n=Math.sqrt(n.Bf(s)),t.push(n)}}return this.cq}},flattenedTotalLength:{get:function(){var t=this.vt;if(isNaN(t)){for(var e=this.flattenedLengths,i=e.length,n=t=0;n<i;n++)t+=e[n];this.vt=t}return t}},points:{get:function(){return this.Nb},set:function(t){var e=this.Nb;if(e!==t){var i=null;if(Array.isArray(t)){var n=t.length%2===0;if(n){for(var s=0;s<t.length;s++)if(typeof t[s]!="number"||isNaN(t[s])){n=!1;break}}if(n)for(i=new ue,n=0;n<t.length/2;n++)s=new G(t[2*n],t[2*n+1]).freeze(),i.add(s);else{for(n=!0,s=0;s<t.length;s++){var a=t[s];if(!Qt(a)||typeof a.x!="number"||isNaN(a.x)||typeof a.y!="number"||isNaN(a.y)){n=!1;break}}if(n)for(i=new ue,n=0;n<t.length;n++)s=t[n],i.add(new G(s.x,s.y).freeze())}}else if(t instanceof ue)for(i=t.copy(),t=i.iterator;t.next();)t.value.freeze();else Mt("Link.points value is not an instance of List or Array: "+t);i.freeze(),this.Nb=i,this.qc(),Qg(this),t=this.diagram,t!==null&&(t.pi||t.undoManager.isUndoingRedoing||t.As.add(this),t.animationManager.zb&&ze(t.animationManager,this,i)),this.g("points",e,i)}}},pointsCount:{get:function(){return this.Nb.count}},fd:{get:function(){return(this.Qa&16)!==0},set:function(t){(this.Qa&16)!==0!==t&&(this.Qa^=16)}},suspendsRouting:{get:function(){return(this.Qa&32)!==0},set:function(t){(this.Qa&32)!==0!==t&&(this.Qa^=32)}},computingPoints:{get:function(){return(this.Qa&64)!==0},set:function(t){(this.Qa&64)!==0!==t&&(this.Qa^=64)}},defaultFromPoint:{get:function(){return this.o},set:function(t){this.o=t.copy()}},defaultToPoint:{get:function(){return this.u},set:function(t){this.u=t.copy()}},isOrthogonal:{get:function(){return(this.qj.value&2)===2}},isAvoiding:{get:function(){return(this.qj.value&4)===4}},lk:{get:function(){return(this.Qa&128)!==0},set:function(t){(this.Qa&128)!==0!==t&&(this.Qa^=128)}},geometry:{get:function(){if(!this.lk){if(this.vg(),2>this.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!wp(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var t=this.pointsCount;return t===0?0:2>=t?t-1:this.isOrthogonal||!wp(this.computeSpot(!1))?t-2:t-1}},adjusting:{get:function(){return this.qk},set:function(t){var e=this.qk;e!==t&&(this.qk=t,this.g("adjusting",e,t))}},corner:{get:function(){return this.Om},set:function(t){var e=this.Om;e!==t&&(this.Om=t,this.qc(),this.g("corner",e,t))}},curve:{get:function(){return this.Qm},set:function(t){var e=this.Qm;e!==t&&(this.Qm=t,this.bb(),this.qc(),ev(this,e===Fh||e===el||t===Fh||t===el),this.g("curve",e,t))}},curviness:{get:function(){return this.Rm},set:function(t){var e=this.Rm;e!==t&&(this.Rm=t,this.bb(),this.qc(),this.g("curviness",e,t))}},routing:{get:function(){return this.qj},set:function(t){var e=this.qj;e!==t&&(this.qj=t,this.Wf=null,this.bb(),ev(this,(e.value&2)===2||(t.value&2)===2),this.g("routing",e,t))}},smoothness:{get:function(){return this.po},set:function(t){var e=this.po;e!==t&&(this.po=t,this.qc(),this.g("smoothness",e,t))}},key:{get:function(){var t=this.diagram;if(t!==null&&t.model.ri())return t.model.Ac(this.data)}}}),ge.prototype.invalidateOtherJumpOvers=ge.prototype.Xo,ge.prototype.findClosestSegment=ge.prototype.ez,ge.prototype.updateRoute=ge.prototype.vg,ge.prototype.invalidateRoute=ge.prototype.bb,ge.prototype.rollbackRoute=ge.prototype.rv,ge.prototype.commitRoute=ge.prototype.zf,ge.prototype.startRoute=ge.prototype.uh,ge.prototype.clearPoints=ge.prototype.Fj,ge.prototype.removePoint=ge.prototype.pv,ge.prototype.addPointAt=ge.prototype.yf,ge.prototype.addPoint=ge.prototype.ne,ge.prototype.insertPointAt=ge.prototype.m,ge.prototype.insertPoint=ge.prototype.Kz,ge.prototype.setPointAt=ge.prototype.L,ge.prototype.setPoint=ge.prototype.dd,ge.prototype.getPoint=ge.prototype.i,ge.prototype.getOtherPort=ge.prototype.Cz,ge.prototype.getOtherNode=ge.prototype.To;var o0=null,Sp=null,gy=new he(ge,"Normal",1),iv=new he(ge,"Orthogonal",2),mx=new he(ge,"AvoidsNodes",6),vy=new he(ge,"AvoidsNodesStraight",7),eh=new he(ge,"None",0),Yh=new he(ge,"Bezier",9),Fh=new he(ge,"JumpGap",10),el=new he(ge,"JumpOver",11),zh=new he(ge,"End",17),Lu=new he(ge,"Scale",18),s0=new he(ge,"Stretch",19),J0=new he(ge,"OrientAlong",21),Mp=new he(ge,"OrientPlus90",22),Xm=new he(ge,"OrientMinus90",23),yy=new he(ge,"OrientOpposite",24),nv=new he(ge,"OrientUpright",25),q0=new he(ge,"OrientPlus90Upright",26),Ym=new he(ge,"OrientMinus90Upright",27),rv=new he(ge,"OrientUpright45",28),x1=16,w1=14,Jm=8;ge.className="Link",ge.Normal=gy,ge.Orthogonal=iv,ge.AvoidsNodes=mx,ge.AvoidsNodesStraight=vy,ge.None=eh,ge.Bezier=Yh,ge.JumpGap=Fh,ge.JumpOver=el,ge.End=zh,ge.Scale=Lu,ge.Stretch=s0,ge.OrientAlong=J0,ge.OrientPlus90=Mp,ge.OrientMinus90=Xm,ge.OrientOpposite=yy,ge.OrientUpright=nv,ge.OrientPlus90Upright=q0,ge.OrientMinus90Upright=Ym,ge.OrientUpright45=rv,ge.EndSegmentStep=8,ge.CurvinessStart=x1,ge.SpacingMin=w1,ge.OrthoShortCut=Jm;function Q0(t,e,i,n){Do(this),this.Fe=this.qq=!1,this.Ds=t,this.Ox=e,this.cv=i,this.Px=n,this.links=[]}Q0.prototype.Sl=function(){if(!this.qq){var t=this.links;0<t.length&&(t=t[0].diagram,t!==null&&(t.ow.add(this),this.Fe=t.undoManager.isUndoingRedoing))}this.qq=!0},Q0.prototype.Nv=function(){if(this.qq){this.qq=!1;var t=this.links;if(0<t.length){var e=t[0],i=e.diagram;i=i===null||i.pi&&!this.Fe,this.Fe=!1,e.arrangeBundledLinks(t,i),t.length===1&&(e.Sf=null,t.length=0)}t.length===0&&(t=this.Ds,this!==null&&t.af!==null&&t.af.remove(this),t=this.cv,this!==null&&t.af!==null&&t.af.remove(this))}},Q0.className="LinkBundle";function a0(t){Do(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=t.width,this.sc=t.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}a0.prototype.initialize=function(t){if(!(0>=t.width||0>=t.height)){var e=t.y,i=t.x+t.width,n=t.y+t.height;if(this.Nd=Math.floor((t.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((e-this.sc)/this.sc)*this.sc,this.En=Math.ceil((i+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((n+2*this.sc)/this.sc)*this.sc,t=1+(Math.ceil((this.En-this.Nd)/this.rc)|0),e=1+(Math.ceil((this.Fn-this.Od)/this.sc)|0),this.ac===null||this.di<t-1||this.ei<e-1){for(i=[],n=0;n<=t;n++)i[n]=new Uint32Array(e);this.ac=i,this.di=t-1,this.ei=e-1}if(t=by,this.ac!==null)for(e=0;e<=this.di;e++)if(i=this.ac[e],i.fill)i.fill(t);else for(n=0;n<=this.ei;n++)i[n]=t}};function tm(t,e,i){return t.Nd<=e&&e<=t.En&&t.Od<=i&&i<=t.Fn}function sf(t,e,i){return tm(t,e,i)?(e-=t.Nd,e/=t.rc,i-=t.Od,i/=t.sc,t.ac[e|0][i|0]):by}function b1(t){if(t.ac!==null)for(var e=0;e<=t.di;e++)for(var i=t.ac[e],n=0;n<=t.ei;n++)i[n]>=Cp&&(i[n]=by)}a0.prototype.Yj=function(t,e,i,n){if(t>this.En||t+i<this.Nd||e>this.Fn||e+n<this.Od)return!0;t=(t-this.Nd)/this.rc|0,e=(e-this.Od)/this.sc|0,i=Math.max(0,i)/this.rc+1|0;var s=Math.max(0,n)/this.sc+1|0;if(0>t&&(i+=t,t=0),0>e&&(s+=e,e=0),0>i||0>s)return!0;for(n=Math.min(t+i-1,this.di)|0,i=Math.min(e+s-1,this.ei)|0;t<=n;t++){s=this.ac[t];for(var a=e;a<=i;a++)if(s[a]===jf)return!1}return!0};function Kc(t,e,i,n,s,a,l,c,p){if(!(e<a||e>l||i<c||i>p)){var m=e|0,v=i|0,w=t.ac[m][v];if(w>=Cp&&w<em)for(s?v+=n:m+=n,w+=1;a<=m&&m<=l&&c<=v&&v<=p&&!(w>=t.ac[m][v]);)t.ac[m][v]=w,w+=1,s?v+=n:m+=n;if(m=s?v:m,s)if(0<n)for(i+=n;i<m;i+=n)Kc(t,e,i,1,!s,a,l,c,p),Kc(t,e,i,-1,!s,a,l,c,p);else for(i+=n;i>m;i+=n)Kc(t,e,i,1,!s,a,l,c,p),Kc(t,e,i,-1,!s,a,l,c,p);else if(0<n)for(e+=n;e<m;e+=n)Kc(t,e,i,1,!s,a,l,c,p),Kc(t,e,i,-1,!s,a,l,c,p);else for(e+=n;e>m;e+=n)Kc(t,e,i,1,!s,a,l,c,p),Kc(t,e,i,-1,!s,a,l,c,p)}}function ov(t,e,i,n,s,a,l,c,p){e|=0,i|=0;var m=jf,v=Cp;for(t.ac[e][i]=v;m===jf&&e>a&&e<l&&i>c&&i<p;)v+=1,t.ac[e][i]=v,s?i+=n:e+=n,m=t.ac[e][i]}function sv(t,e,i,n,s,a,l,c,p){e|=0,i|=0;var m=jf,v=em;for(t.ac[e][i]=v;m===jf&&e>a&&e<l&&i>c&&i<p;)t.ac[e][i]=v,s?i+=n:e+=n,m=t.ac[e][i]}function xy(t,e,i,n,s,a,l){if(t.ac!==null){t.abort=!1;var c=e.x,p=e.y;if(tm(t,c,p)){c-=t.Nd,c/=t.rc,p-=t.Od,p/=t.sc;var m=n.x,v=n.y;if(tm(t,m,v))if(m-=t.Nd,m/=t.rc,v-=t.Od,v/=t.sc,1>=Math.abs(c-m)&&1>=Math.abs(p-v))t.abort=!0;else{var w=a.x;n=a.y,e=a.x+a.width;var C=a.y+a.height;w-=t.Nd,w/=t.rc,n-=t.Od,n/=t.sc,e-=t.Nd,e/=t.rc,C-=t.Od,C/=t.sc,a=Math.max(0,Math.min(t.di,w|0)),e=Math.min(t.di,Math.max(0,e|0)),w=Math.max(0,Math.min(t.ei,n|0)),C=Math.min(t.ei,Math.max(0,C|0)),n=t.ac,c|=0,p|=0,m|=0,v|=0;var k=i===0||i===90?1:-1;if(i=i===90||i===270,n[c][p]===jf?(ov(t,c,p,k,i,a,e,w,C),ov(t,c,p,1,!i,a,e,w,C),ov(t,c,p,-1,!i,a,e,w,C)):ov(t,c,p,k,i,c,p,c,p),n[m][v]===jf?(sv(t,m,v,s===0||s===90?1:-1,s===90||s===270,a,e,w,C),sv(t,m,v,1,!(s===90||s===270),a,e,w,C),sv(t,m,v,-1,!(s===90||s===270),a,e,w,C)):sv(t,m,v,k,i,m,v,m,v),i=gi(),l&&wy(t,m,v,s,c,p,i))for((i[0]!==m||i[1]!==v)&&(i.unshift(v),i.unshift(m)),(i[i.length-2]!==c||i[i.length-1]!==p)&&(i.push(c),i.push(p)),t=Cp,s=i[i.length-2],l=i[i.length-1],n[s][l]=t++,a=i.length-4;0<=a;a-=2)for(s=i[a+2],l=i[a+3],e=i[a],m=i[a+1];e>s?s++:e<s?s--:m>l?l++:m<l&&l--,n[s][l]=t++,s!==e||l!==m;);else Kc(t,c,p,1,!1,a,e,w,C),Kc(t,c,p,-1,!1,a,e,w,C),Kc(t,c,p,1,!0,a,e,w,C),Kc(t,c,p,-1,!0,a,e,w,C);Ji(i)}}}}function wy(t,e,i,n,s,a,l){for(var c=t.ac,p=e,m=i;;){if(p===s&&m===a)return!0;var v=p,w=m;if(n===0)if(v<s)v++;else break;else if(n===90)if(w<a)w++;else break;else if(n===180)if(v>s)v--;else break;else if(w>a)w--;else break;var C=c[v][w];if(C===0||C===kp)break;p=v,m=w}for(;;){if(v=n,w=p,C=m,n===0?C<a?(v=90,C++):C>a&&(v=270,C--):n===90?w<s?(v=0,w++):w>s&&(v=180,w--):n===180?C<a?(v=90,C++):C>a&&(v=270,C--):w<s?(v=0,w++):w>s&&(v=180,w--),w=c[w][C],v!==n&&w!==0&&w!==kp){if(l.push(p),l.push(m),wy(t,p,m,v,s,a,l))return!0;l.pop(),l.pop()}if(c[p][m]=kp,n===0){if(p===e)return!1;p--}else if(n===90){if(m===i)return!1;m--}else if(n===180){if(p===e)return!1;p++}else{if(m===i)return!1;m++}}}St.Object.defineProperties(a0.prototype,{bounds:{get:function(){return new Tt(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(t){0<t&&t!==this.rc&&(this.rc=t,this.initialize(this.bounds))}},Go:{get:function(){return this.sc},set:function(t){0<t&&t!==this.sc&&(this.sc=t,this.initialize(this.bounds))}}});var jf=0,Cp=1,em=999999,by=em+1,kp=em+2;a0.className="PositionArray";function Ac(){Do(this),this.port=this.node=null,this.pe=[],this.ap=!1}Ac.prototype.toString=function(){for(var t=this.pe,e=this.node.toString()+" "+t.length.toString()+":",i=0;i<t.length;i++){var n=t[i];n!==null&&(e+=`
|
|
|
`+n.toString())}return e};function Sy(t,e,i,n){switch(e=e.offsetY,e){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(e){case 9:return 180<i?270:90;case 6:return 90<i&&270>=i?180:0}switch(t=180*Math.atan2(t.height,t.width)/Math.PI,e){case 3:return i>t&&i<=180+t?180:270;case 5:return i>180-t&&i<=360-t?270:0;case 12:return i>t&&i<=180+t?90:0;case 10:return i>180-t&&i<=360-t?180:90;case 7:return 90<i&&i<=180+t?180:i>180+t&&i<=360-t?270:0;case 13:return 180<i&&i<=360-t?270:i>t&&180>=i?90:0;case 14:return i>t&&i<=180-t?90:i>180-t&&270>=i?180:0;case 11:return i>180-t&&i<=180+t?180:i>180+t?270:90}return n&&e!==15&&(i-=15,0>i&&(i+=360)),i>t&&i<180-t?90:i>=180-t&&i<=180+t?180:i>180+t&&i<360-t?270:0}Ac.prototype.Sl=function(){this.pe.length=0};function av(t,e){var i=t.pe;if(i.length===0){t:if(!t.ap){i=t.ap,t.ap=!0;var n=null,s=t.node,a=s instanceof Yi?s:null;if(a===null||a.isSubGraphExpanded)var l=s.isTreeExpanded?s.findLinksConnected(t.port.portId):s.qx();else{if(!a.actualBounds.w()){t.ap=i;break t}n=a,l=n.Lu()}a=t.pe.length=0;var c=t.port.ga(Fo,G.alloc()),p=t.port.ga(uu,G.alloc());for(s=Tt.allocAt(c.x,c.y,0,0),s.Ye(p),G.free(c),G.free(p),c=G.allocAt(s.x+s.width/2,s.y+s.height/2),p=t.port.li(),l=l.iterator;l.next();){var m=l.value;if(m.isVisible()&&m.fromPort!==m.toPort){var v=m.fromPort===t.port||m.fromNode!==null&&m.fromNode.Td(n),w=m.computeSpot(v,t.port);if(w.$c()&&(v=v?m.toPort:m.fromPort,v!==null)){var C=v.part;if(C!==null){var k=C.findVisibleNode();k!==null&&k!==C&&(C=k,v=C.port),v=m.computeOtherPoint(C,v),C=c.ab(v),C-=p,0>C?C+=360:360<=C&&(C-=360),w=Sy(s,w,C,m.isOrthogonal),w===0?(w=4,180<C&&(C-=360)):w===90?(w=8,270<C&&(C-=360)):w===180?w=2:(w=1,90>C&&(C+=360)),k=t.pe[a],k===void 0?(k=new lv(m,C,w),t.pe[a]=k):(k.link=m,k.angle=C,k.Nc=w),k.hv.set(v),a++}}}}for(G.free(c),t.pe.sort(Ac.prototype.j),p=t.pe.length,n=-1,a=c=0;a<p;a++)l=t.pe[a],l!==void 0&&(l.Nc!==n&&(n=l.Nc,c=0),l.Uo=c,c++);for(n=-1,c=0,a=p-1;0<=a;a--)p=t.pe[a],p!==void 0&&(p.Nc!==n&&(n=p.Nc,c=p.Uo+1),p.Gl=c);if(a=t.pe,w=t.port,n=t.node.portSpreading,c=G.alloc(),p=G.alloc(),l=G.alloc(),m=G.alloc(),w.ga(Fo,c),w.ga(Ll,p),w.ga(uu,l),w.ga(nu,m),k=C=v=w=0,n===$d)for(var T=0;T<a.length;T++){var A=a[T];if(A!==null){var X=A.link.computeThickness();switch(A.Nc){case 8:C+=X;break;case 2:k+=X;break;case 1:w+=X;break;default:case 4:v+=X}}}var $=T=0,J=1,et=A=0;for(X=0;X<a.length;X++){var st=a[X];if(st!==null){if(T!==st.Nc){switch(T=st.Nc,T){case 8:var mt=l;$=m;break;case 2:mt=m,$=c;break;case 1:mt=c,$=p;break;default:case 4:mt=p,$=l}switch(A=$.x-mt.x,et=$.y-mt.y,T){case 8:C>Math.abs(A)?(J=Math.abs(A)/C,C=Math.abs(A)):J=1;break;case 2:k>Math.abs(et)?(J=Math.abs(et)/k,k=Math.abs(et)):J=1;break;case 1:w>Math.abs(A)?(J=Math.abs(A)/w,w=Math.abs(A)):J=1;break;default:case 4:v>Math.abs(et)?(J=Math.abs(et)/v,v=Math.abs(et)):J=1}$=0}var Pt=st.Zo;if(n===$d){switch(st=st.link.computeThickness(),st*=J,Pt.set(mt),T){case 8:Pt.x=mt.x+A/2+C/2-$-st/2;break;case 2:Pt.y=mt.y+et/2+k/2-$-st/2;break;case 1:Pt.x=mt.x+A/2-w/2+$+st/2;break;default:case 4:Pt.y=mt.y+et/2-v/2+$+st/2}$+=st}else{var De=.5;n===n0&&(De=(st.Uo+1)/(st.Gl+1)),Pt.x=mt.x+A*De,Pt.y=mt.y+et*De}}}for(G.free(c),G.free(p),G.free(l),G.free(m),mt=t.pe,a=0;a<mt.length;a++)n=mt[a],n!==null&&(n.Ju=t.computeEndSegmentLength(n));t.ap=i,Tt.free(s)}i=t.pe}for(t=0;t<i.length;t++)if(s=i[t],s!==null&&s.link===e)return s;return null}Ac.prototype.j=function(t,e){return t===e?0:t===null?-1:e===null?1:t.Nc<e.Nc?-1:t.Nc>e.Nc?1:t.angle<e.angle?-1:t.angle>e.angle?1:0},Ac.prototype.computeEndSegmentLength=function(t){var e=t.link,i=e.computeEndSegmentLength(this.node,this.port,jr,e.fromPort===this.port),n=t.Uo;if(0>n)return i;var s=t.Gl;if(1>=s||!e.isOrthogonal)return i;e=t.hv;var a=t.Zo;return(t.Nc===2||t.Nc===8)&&(n=s-1-n),((t=t.Nc===2||t.Nc===4)?e.y<a.y:e.x<a.x)?i+8*n:(t?e.y===a.y:e.x===a.x)?i:i+8*(s-1-n)},Ac.className="Knot";function lv(t,e,i){this.link=t,this.angle=e,this.Nc=i,this.hv=new G,this.Gl=this.Uo=0,this.Zo=new G,this.Ju=0}lv.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Nc.toString()+":"+this.Uo.toString()+"/"+this.Gl.toString()+" "+this.Zo.toString()+" "+this.Ju.toString()+" "+this.hv.toString()},lv.className="LinkInfo";function hs(t){Do(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new G(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,t&&Object.assign(this,t)}hs.prototype.cloneProtected=function(t){t.sn=this.sn,t.Gh=this.Gh,t.yn=this.yn,t.Am.assign(this.Am),t.vn=this.vn,t.un=this.un,t.Em=this.Em,t.xn=!0},hs.prototype.copy=function(){var t=new this.constructor;return this.cloneProtected(t),t},hs.prototype.qb=function(){},hs.prototype.toString=function(){var t=Xi(this.constructor);return t+="(",this.group!==null&&(t+=" in "+this.group),this.diagram!==null&&(t+=" for "+this.diagram),t+")"},hs.prototype.C=function(){if(this.isValidLayout){var t=this.diagram;if(t!==null&&!t.undoManager.isUndoingRedoing){var e=t.animationManager;!e.isTicking&&(e.defaultAnimation.isAnimating&&e.Cc(),this.isOngoing&&t.pi||this.isInitial&&!t.pi)&&(this.isValidLayout=!1,t.$b())}}},hs.prototype.createNetwork=function(){return new Zo(this)},hs.prototype.makeNetwork=function(t){var e=this.createNetwork();return t instanceof Ct?(e.lg(t.nodes,!0),e.lg(t.links,!0)):t instanceof Yi?e.lg(t.memberParts):e.lg(t.iterator),e},hs.prototype.updateParts=function(){this.isValidLayout=!0;var t=this.diagram;if(t===null&&this.network!==null)for(var e=this.network.vertexes.iterator;e.next();){var i=e.value.node;if(i!==null&&(t=i.diagram,t!==null))break}try{t!==null&&t.Ea("Layout"),this.commitLayout()}finally{t!==null&&t.eb("Layout")}},hs.prototype.commitLayout=function(){if(this.network!==null){for(var t=this.network.vertexes.iterator;t.next();)t.value.commit();if(this.isRouting)for(t=this.network.edges.iterator;t.next();)t.value.commit()}},hs.prototype.doLayout=function(t){var e=new te;t instanceof Ct?(wd(this,e,t.nodes,!0,this.rh,!0,!1,!0),wd(this,e,t.parts,!0,this.rh,!0,!1,!0)):t instanceof Yi?wd(this,e,t.memberParts,!1,this.rh,!0,!1,!0):e.addAll(t.iterator),0<e.count&&(t=this.diagram,t!==null&&t.Ea("Layout"),this.doMinimalNoNetworkLayout(e),t!==null&&t.eb("Layout")),this.isValidLayout=!0},hs.prototype.doMinimalNoNetworkLayout=function(t){var e=Math.ceil(Math.sqrt(t.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var i=this.arrangementOrigin.x,n=i,s=this.arrangementOrigin.y,a=0,l=0;for(t=t.iterator;t.next();){var c=t.value;im(c);var p=c.measuredBounds,m=p.width;p=p.height,c.moveTo(n,s),c instanceof Yi&&(c.rh=!1),n+=Math.max(m,50)+20,l=Math.max(l,Math.max(p,50)),a>=e-1?(a=0,n=i,s+=l+20,l=0):a++}},hs.prototype.doMinimalNetworkLayout=function(){var t=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var e=this.arrangementOrigin.x,i=e,n=this.arrangementOrigin.y,s=0,a=0,l=this.network.vertexes.iterator;l.next();){var c=l.value.node;if(!(c===null||c instanceof ge)&&(im(c),this.rh(c))){var p=c.measuredBounds,m=p.width;p=p.height,c.moveTo(i,n),c instanceof Yi&&(c.rh=!1),i+=Math.max(m,50)+20,a=Math.max(a,Math.max(p,50)),s>=t-1?(s=0,i=e,n+=a+20,a=0):s++}}},hs.prototype.rh=function(t){return!!(!t.location.w()||t instanceof Yi&&t.rh)};function wd(t,e,i,n,s,a,l,c){for(i=i.iterator;i.next();){var p=i.value;n&&!p.isTopLevel||s!==null&&!s(p)||!p.canLayout()||(a&&p instanceof Ee?p.isLinkLabel||(p instanceof Yi&&p.layout===null?wd(t,e,p.memberParts,!1,s,a,l,c):(im(p),e.add(p))):l&&p instanceof ge?e.add(p):!c||!p.Zc()||p instanceof Ee||(im(p),e.add(p)))}}function im(t){var e=t.actualBounds;(e.width===0||e.height===0||isNaN(e.width)||isNaN(e.height))&&t.Va()}hs.prototype.ni=function(t,e){var i=this.boundsComputation;return i!==null?(e||(e=new Tt),i(t,this,e)):e?(e.set(t.actualBounds),e):t.actualBounds},hs.prototype.ex=function(t){var e=new te;return t instanceof Ct?(wd(this,e,t.nodes,!0,null,!0,!0,!0),wd(this,e,t.links,!0,null,!0,!0,!0),wd(this,e,t.parts,!0,null,!0,!0,!0)):t instanceof Yi?wd(this,e,t.memberParts,!1,null,!0,!0,!0):wd(this,e,t.iterator,!1,null,!0,!0,!0),e},hs.prototype.initialOrigin=function(t){var e=this.group;if(e!==null){var i=e.position.copy();return(isNaN(i.x)||isNaN(i.y))&&i.set(t),e=e.placeholder,e!==null&&(i=e.ga(Fo),(isNaN(i.x)||isNaN(i.y))&&i.set(t),t=e.padding,i.x+=t.left,i.y+=t.top),i}return t},St.Object.defineProperties(hs.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},group:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t,t!==null&&(this.H=t.diagram))}},isOngoing:{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t)}},isInitial:{get:function(){return this.Gh},set:function(t){this.Gh=t,t||(this.xn=!0)}},isViewportSized:{get:function(){return this.yn},set:function(t){this.yn!==t&&(this.yn=t)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(t){this.vn!==t&&(this.vn=t)}},isRealtime:{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t)}},isValidLayout:{get:function(){return this.xn},set:function(t){this.xn!==t&&(this.xn=t,t||(t=this.diagram,t!==null&&(t.xh=!0)))}},network:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,t!==null&&(t.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(t){this.Em!==t&&(this.Em=t,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(t){this.Am.D(t)||(this.Am.assign(t),this.C())}}}),hs.prototype.collectParts=hs.prototype.ex,hs.prototype.getLayoutBounds=hs.prototype.ni,hs.prototype.invalidateLayout=hs.prototype.C,hs.className="Layout";function Zo(t){Do(this),this.Sc=t,this.wf=new te,this.ye=new te,this.Es=new ci,this.zs=new ci}Zo.prototype.clear=function(){if(this.wf)for(var t=this.wf.iterator;t.next();)t.value.clear();if(this.ye)for(t=this.ye.iterator;t.next();)t.value.clear();this.wf=new te,this.ye=new te,this.Es=new ci,this.zs=new ci},Zo.prototype.toString=function(t){t===void 0&&(t=0);var e="LayoutNetwork"+(this.layout!==null?"("+this.layout.toString()+")":"");if(0>=t)return e;if(e+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1<t){for(var i=this.wf.iterator;i.next();)e+=`
|
|
|
`+i.value.toString(t-1);for(i=this.ye.iterator;i.next();)e+=`
|
|
|
`+i.value.toString(t-1)}return e},Zo.prototype.createVertex=function(){return new Ha(this)},Zo.prototype.createEdge=function(){return new kh(this)},Zo.prototype.lg=function(t,e,i){if(t!==null){for(e===void 0&&(e=!1),i===void 0&&(i=null),i===null&&(i=function(l){if(l instanceof Ee)return!l.isLinkLabel;if(l instanceof ge){var c=l.fromNode;return c===null||c.isLinkLabel?!1:(l=l.toNode,!(l===null||l.isLinkLabel))}return!1}),t=t.iterator;t.next();){var n=t.value;if(n instanceof Ee&&(!e||n.isTopLevel)&&n.canLayout()&&i(n)){if(n instanceof Yi&&n.layout===null)this.lg(n.memberParts,!1);else if(this.ki(n)===null){var s=this.createVertex();s.node=n,this.dh(s)}}}for(t.reset();t.next();)if(n=t.value,n instanceof ge&&(!e||n.isTopLevel)&&n.canLayout()&&i(n)&&this.Lo(n)===null){var a=n.fromNode;s=n.toNode,a!==null&&s!==null&&a!==s&&(a=this.findGroupVertex(a),s=this.findGroupVertex(s),a!==null&&s!==null&&this.Zj(a,s,n))}}},Zo.prototype.findGroupVertex=function(t){if(t===null)return null;var e=t.findVisibleNode();if(e===null)return null;if(t=this.ki(e),t!==null)return t;for(e=e.containingGroup;e!==null;){if(t=this.ki(e),t!==null)return t;e=e.containingGroup}return null},L=Zo.prototype,L.dh=function(t){if(t!==null){this.wf.add(t);var e=t.node;e!==null&&this.Es.add(e,t),t.network=this}},L.Bl=function(t){if(t===null)return null;var e=this.ki(t);return e===null&&(e=this.createVertex(),e.node=t,this.dh(e)),e},L.Iu=function(t){if(t!==null&&l0(this,t)){for(var e=t.tg,i=e.count-1;0<=i;i--){var n=e.M(i);this.Mj(n)}for(e=t.mg,t=e.count-1;0<=t;t--)i=e.M(t),this.Mj(i)}};function l0(t,e){if(e===null)return!1;var i=t.wf.remove(e);return i&&(e=e.node,e!==null&&t.Es.remove(e)),i}L.Zy=function(t){t!==null&&(t=this.ki(t),t!==null&&this.Iu(t))},L.ki=function(t){return t===null?null:this.Es.I(t)},L.Bo=function(t){if(t!==null){uv(this,t);var e=t.toVertex;e!==null&&e.Cl(t),e=t.fromVertex,e!==null&&e.zl(t)}};function uv(t,e){if(e!==null){t.ye.add(e);var i=e.link;i!==null&&t.Lo(i)===null&&t.zs.add(i,e),e.network=t}}L.Dy=function(t){if(t===null)return null;var e=t.fromNode,i=t.toNode,n=this.Lo(t);return n===null?(n=this.createEdge(),n.link=t,e!==null&&(n.fromVertex=this.Bl(e)),i!==null&&(n.toVertex=this.Bl(i)),this.Bo(n)):(e!==null?n.fromVertex=this.Bl(e):n.fromVertex=null,i!==null?n.toVertex=this.Bl(i):n.toVertex=null),n},L.Mj=function(t){if(t!==null){var e=t.toVertex;e!==null&&e.Kl(t),e=t.fromVertex,e!==null&&e.Jl(t),hv(this,t)}};function hv(t,e){e!==null&&t.ye.remove(e)&&(e=e.link,e!==null&&t.zs.remove(e))}L.Yy=function(t){t!==null&&(t=this.Lo(t),t!==null&&this.Mj(t))},L.Lo=function(t){return t===null?null:this.zs.I(t)},L.Zj=function(t,e,i){if(t===null||e===null)return null;if(t.network===this&&e.network===this){var n=this.createEdge();return n.link=i,n.fromVertex=t,n.toVertex=e,this.Bo(n),n}return null},L.gm=function(t){if(t!==null){var e=t.fromVertex,i=t.toVertex;e!==null&&i!==null&&(e.Jl(t),i.Kl(t),t.gm(),e.Cl(t),i.zl(t))}},L.Ko=function(){for(var t=gi(),e=this.ye.iterator;e.next();){var i=e.value;i.fromVertex===i.toVertex&&t.push(i)}for(e=t.length,i=0;i<e;i++)this.Mj(t[i]);Ji(t)},Zo.prototype.deleteArtificialVertexes=function(){for(var t=gi(),e=this.wf.iterator;e.next();){var i=e.value;i.node===null&&i.data===null&&t.push(i)}for(i=t.length,e=0;e<i;e++)this.Iu(t[e]);for(e=gi(),i=this.ye.iterator;i.next();){var n=i.value;n.link===null&&n.data===null&&e.push(n)}for(i=e.length,n=0;n<i;n++)this.Mj(e[n]);Ji(t),Ji(e)};function gx(t){for(var e=gi(),i=t.ye.iterator;i.next();){var n=i.value;n.fromVertex!==null&&n.toVertex!==null||e.push(n)}for(i=e.length,n=0;n<i;n++)t.Mj(e[n]);Ji(e)}Zo.prototype.Zx=function(t){t===void 0&&(t=!0),t&&(this.deleteArtificialVertexes(),gx(this),this.Ko()),t=new ue;for(var e=!0;e;){e=!1;for(var i=this.wf.iterator;i.next();){var n=i.value;if(0<n.tg.count||0<n.mg.count){e=this.layout.createNetwork(),t.add(e),cv(this,e,n),e=!0;break}}}return t.sort(function(s,a){return s===null||a===null||s===a?0:a.vertexes.count-s.vertexes.count}),t};function cv(t,e,i){if(i!==null&&i.network!==e){l0(t,i),e.dh(i);for(var n=i.sourceEdges;n.next();){var s=n.value;s.network!==e&&(hv(t,s),uv(e,s),cv(t,e,s.fromVertex))}for(n=i.destinationEdges;n.next();)i=n.value,i.network!==e&&(hv(t,i),uv(e,i),cv(t,e,i.toVertex))}}Zo.prototype.dz=function(){for(var t=new te,e=this.wf.iterator;e.next();)t.add(e.value.node);for(e=this.ye.iterator;e.next();)t.add(e.value.link);return t},St.Object.defineProperties(Zo.prototype,{layout:{get:function(){return this.Sc},set:function(t){t!==null&&(this.Sc=t)}},vertexes:{get:function(){return this.wf}},edges:{get:function(){return this.ye}}}),Zo.prototype.findAllParts=Zo.prototype.dz,Zo.prototype.splitIntoSubNetworks=Zo.prototype.Zx,Zo.prototype.deleteSelfEdges=Zo.prototype.Ko,Zo.prototype.reverseEdge=Zo.prototype.gm,Zo.prototype.linkVertexes=Zo.prototype.Zj,Zo.prototype.findEdge=Zo.prototype.Lo,Zo.prototype.deleteLink=Zo.prototype.Yy,Zo.prototype.deleteEdge=Zo.prototype.Mj,Zo.prototype.addLink=Zo.prototype.Dy,Zo.prototype.addEdge=Zo.prototype.Bo,Zo.prototype.findVertex=Zo.prototype.ki,Zo.prototype.deleteNode=Zo.prototype.Zy,Zo.prototype.deleteVertex=Zo.prototype.Iu,Zo.prototype.addNode=Zo.prototype.Bl,Zo.prototype.addVertex=Zo.prototype.dh,Zo.prototype.addParts=Zo.prototype.lg,Zo.className="LayoutNetwork";function Ha(t){Do(this),this.ob=t,this.j=new Tt(0,0,10,10).freeze(),this.o=new G(5,5).freeze(),this.Sh=this.ub=null,this.tg=new ue,this.mg=new ue}Ha.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new ue,this.mg=new ue},Ha.prototype.toString=function(t){t===void 0&&(t=0);var e="LayoutVertex#"+Io(this);if(0<t&&(e+=this.node!==null?"("+this.node.toString()+")":"",1<t)){t="";for(var i=!0,n=this.tg.iterator;n.next();){var s=n.value;i?i=!1:t+=",",t+=s.toString(0)}for(s="",i=!0,n=this.mg.iterator;n.next();){var a=n.value;i?i=!1:s+=",",s+=a.toString(0)}e+=" sources: "+t+" destinations: "+s}return e},Ha.prototype.commit=function(){var t=this.ub;if(t!==null){var e=this.bounds,i=t.bounds;Qt(i)?(i.x=e.x,i.y=e.y,i.width=e.width,i.height=e.height):t.bounds=e.copy()}else if(t=this.node,t!==null){if(e=this.bounds,!(t instanceof Yi)){i=Tt.alloc(),t.Va();var n=this.network.layout.ni(t,i),s=t.locationObject.ga(_n);if(n.w()&&s.w()){t.moveTo(e.x+this.focusX-(s.x-n.x),e.y+this.focusY-(s.y-n.y)),Tt.free(i);return}Tt.free(i)}t.moveTo(e.x,e.y)}},Ha.prototype.Cl=function(t){t!==null&&(this.tg.contains(t)||this.tg.add(t))},Ha.prototype.Kl=function(t){t!==null&&this.tg.remove(t)},Ha.prototype.zl=function(t){t!==null&&(this.mg.contains(t)||this.mg.add(t))},Ha.prototype.Jl=function(t){t!==null&&this.mg.remove(t)};function My(t,e){return t=t.Sh,e=e.Sh,t?e?(t=t.text,e=e.text,t<e?-1:t>e?1:0):1:e!==null?-1:0}St.Object.defineProperties(Ha.prototype,{sourceEdgesArrayAccess:{get:function(){return this.tg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.mg._dataArray}},data:{get:function(){return this.ub},set:function(t){if(this.ub=t,t!==null&&t.bounds){var e=t.bounds;t=e.x;var i=e.y,n=e.width;e=e.height,this.o.h(n/2,e/2),this.j.h(t,i,n,e)}}},node:{get:function(){return this.Sh},set:function(t){if(this.Sh!==t){this.Sh=t,t.Va();var e=this.network.layout,i=Tt.alloc(),n=e.ni(t,i);e=n.x;var s=n.y,a=n.width;if(n=n.height,isNaN(e)&&(e=0),isNaN(s)&&(s=0),this.j.h(e,s,a,n),Tt.free(i),!(t instanceof Yi)&&(t=t.locationObject.ga(_n),t.w())){this.o.h(t.x-e,t.y-s);return}this.o.h(a/2,n/2)}}},bounds:{get:function(){return this.j},set:function(t){this.j.D(t)||this.j.assign(t)}},focus:{get:function(){return this.o},set:function(t){this.o.D(t)||this.o.assign(t)}},centerX:{get:function(){return this.j.x+this.o.x},set:function(t){var e=this.j;e.x+this.o.x!==t&&(e.ka(),e.x=t-this.o.x,e.freeze())}},centerY:{get:function(){return this.j.y+this.o.y},set:function(t){var e=this.j;e.y+this.o.y!==t&&(e.ka(),e.y=t-this.o.y,e.freeze())}},focusX:{get:function(){return this.o.x},set:function(t){var e=this.o;e.x!==t&&(e.ka(),e.x=t,e.freeze())}},focusY:{get:function(){return this.o.y},set:function(t){var e=this.o;e.y!==t&&(e.ka(),e.y=t,e.freeze())}},x:{get:function(){return this.j.x},set:function(t){var e=this.j;e.x!==t&&(e.ka(),e.x=t,e.freeze())}},y:{get:function(){return this.j.y},set:function(t){var e=this.j;e.y!==t&&(e.ka(),e.y=t,e.freeze())}},width:{get:function(){return this.j.width},set:function(t){var e=this.j;e.width!==t&&(e.ka(),e.width=t,e.freeze())}},height:{get:function(){return this.j.height},set:function(t){var e=this.j;e.height!==t&&(e.ka(),e.height=t,e.freeze())}},network:{get:function(){return this.ob},set:function(t){this.ob=t}},sourceVertexes:{get:function(){for(var t=new te,e=this.sourceEdges;e.next();)t.add(e.value.fromVertex);return t.iterator}},destinationVertexes:{get:function(){for(var t=new te,e=this.destinationEdges;e.next();)t.add(e.value.toVertex);return t.iterator}},vertexes:{get:function(){for(var t=new te,e=this.sourceEdges;e.next();)t.add(e.value.fromVertex);for(e=this.destinationEdges;e.next();)t.add(e.value.toVertex);return t.iterator}},sourceEdges:{get:function(){return this.tg.iterator}},destinationEdges:{get:function(){return this.mg.iterator}},edges:{get:function(){for(var t=new ue,e=this.sourceEdges;e.next();)t.add(e.value);for(e=this.destinationEdges;e.next();)t.add(e.value);return t.iterator}},edgesCount:{get:function(){return this.tg.count+this.mg.count}}}),Ha.prototype.deleteDestinationEdge=Ha.prototype.Jl,Ha.prototype.addDestinationEdge=Ha.prototype.zl,Ha.prototype.deleteSourceEdge=Ha.prototype.Kl,Ha.prototype.addSourceEdge=Ha.prototype.Cl,Ha.className="LayoutVertex",Ha.standardComparer=My,Ha.smartComparer=function(t,e){if(t!==null){if(e!==null){t=t.Sh;var i=e.Sh;if(t!==null){if(i!==null){for(e=t.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),t=i.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),i=0;i<e.length;i++)if(t[i]!==""&&t[i]!==void 0){var n=parseFloat(e[i]),s=parseFloat(t[i]);if(isNaN(n))if(isNaN(s)){if(e[i].localeCompare(t[i])!==0)return e[i].localeCompare(t[i])}else return 1;else{if(isNaN(s))return-1;if(n-s!==0)return n-s}}else if(e[i]!=="")return 1;return t[i]!==""&&t[i]!==void 0?-1:0}return 1}return i!==null?-1:0}return 1}return e!==null?-1:0};function kh(t){Do(this),this.nb=t,this.qd=this.kd=this.$k=this.ub=null}kh.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},kh.prototype.toString=function(t){t===void 0&&(t=0);var e="LayoutEdge#"+Io(this);return 0<t&&(e+=this.$k!==null?"("+this.$k.toString()+")":"",1<t&&(e+=" "+(this.kd?this.kd.toString():"null")+" --> "+(this.qd?this.qd.toString():"null"))),e},kh.prototype.gm=function(){var t=this.kd;this.kd=this.qd,this.qd=t},kh.prototype.commit=function(){},kh.prototype.Ax=function(t){return this.qd===t?this.kd:this.kd===t?this.qd:null},St.Object.defineProperties(kh.prototype,{network:{get:function(){return this.nb},set:function(t){this.nb=t}},data:{get:function(){return this.ub},set:function(t){this.ub!==t&&(this.ub=t)}},link:{get:function(){return this.$k},set:function(t){this.$k!==t&&(this.$k=t)}},fromVertex:{get:function(){return this.kd},set:function(t){this.kd!==t&&(this.kd=t)}},toVertex:{get:function(){return this.qd},set:function(t){this.qd!==t&&(this.qd=t)}}}),kh.prototype.getOtherVertex=kh.prototype.Ax,kh.className="LayoutEdge";function Fl(t){hs.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new fe(NaN,NaN).freeze(),this.tf=new fe(10,10).freeze(),this.Jb=nm,this.Rb=u0,this.nd=Qm,this.hd=Cy,t&&Object.assign(this,t)}li(Fl,hs),Fl.prototype.cloneProtected=function(t){hs.prototype.cloneProtected.call(this,t),t.zo=this.zo,t.yo=this.yo,t.yg.assign(this.yg),t.tf.assign(this.tf),t.Jb=this.Jb,t.Rb=this.Rb,t.nd=this.nd,t.hd=this.hd},Fl.prototype.qb=function(t){t.classType===Fl?t===Qm||t===dv||t===dl||t===fv?this.sorting=t:t===u0||t===cc?this.arrangement=t:t===nm||t===qm?this.alignment=t:Mt("Unknown enum value: "+t):hs.prototype.qb.call(this,t)},Fl.prototype.doLayout=function(t){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var e=this.ex(t);t=this.diagram;for(var i=e.copy().iterator;i.next();){var n=i.value;if(!n.ph()||n.fromNode===null&&n.toNode===null){if(n.Va(),n instanceof Yi)for(n=n.memberParts;n.next();)e.remove(n.value)}else e.remove(n)}var s=e.Fa();if(s.length!==0){switch(this.sorting){case fv:s.reverse();break;case Qm:s.sort(this.comparer);break;case dv:s.sort(this.comparer),s.reverse()}var a=this.wrappingColumn;isNaN(a)&&(a=0);var l=this.wrappingWidth;switch(isNaN(l)&&t!==null?(e=t.padding,l=Math.max(t.viewportBounds.width-e.left-e.right,0)):l=Math.max(this.wrappingWidth,0),0>=a&&0>=l&&(a=1),e=this.spacing.width,isFinite(e)||(e=0),i=this.spacing.height,isFinite(i)||(i=0),t!==null&&t.Ea("Layout"),n=[],this.alignment){case qm:var c=e,p=i,m=Tt.alloc(),v=Math.max(this.cellSize.width,1);if(!isFinite(v))for(var w=v=0;w<s.length;w++){var C=this.ni(s[w],m);v=Math.max(v,C.width)}if(v=Math.max(v+c,1),w=Math.max(this.cellSize.height,1),!isFinite(w))for(C=w=0;C<s.length;C++){var k=this.ni(s[C],m);w=Math.max(w,k.height)}w=Math.max(w+p,1),C=this.arrangement;for(var T=k=this.arrangementOrigin.x,A=this.arrangementOrigin.y,X=0,$=0,J=0;J<s.length;J++){var et=s[J],st=this.ni(et,m),mt=Math.ceil((st.width+c)/v)*v,Pt=Math.ceil((st.height+p)/w)*w;switch(C){case cc:var De=Math.abs(T-st.width);break;default:De=T+st.width}switch((0<a&&X>a-1||0<l&&0<X&&De-k>l)&&(n.push(new Tt(0,A,l+c,$)),X=0,T=k,A+=$,$=0),$=Math.max($,Pt),C){case cc:st=-st.width;break;default:st=0}switch(et.moveTo(T+st,A),C){case cc:T-=mt;break;default:T+=mt}X++}n.push(new Tt(0,A,l+c,$)),Tt.free(m);break;case nm:for(p=l,v=a,w=e,C=i,l=Tt.alloc(),k=Math.max(this.cellSize.width,1),a=A=m=0,c=G.alloc(),T=0;T<s.length;T++)$=s[T],X=this.ni($,l),$=zf($,$.locationObject,$.locationSpot,c),m=Math.max(m,$.x),A=Math.max(A,X.width-$.x),a=Math.max(a,$.y);switch(T=this.arrangement,T){case cc:m+=w;break;default:A+=w}k=isFinite(k)?Math.max(k+w,1):Math.max(m+A,1);var ti=$=this.arrangementOrigin.x;for(J=this.arrangementOrigin.y,A=0,p>=m&&(p-=m),m=et=0,mt=Math.max(this.cellSize.height,1),st=a=0,Pt=!0,X=G.alloc(),De=0;De<s.length;De++){var Ve=s[De],ye=this.ni(Ve,l),Yt=zf(Ve,Ve.locationObject,Ve.locationSpot,c);if(0<A)switch(T){case cc:ti=(ti-$-(ye.width-Yt.x))/k,ti=xt.$(Math.round(ti),ti)?Math.round(ti):Math.floor(ti),ti=ti*k+$;break;default:ti=(ti-$+Yt.x)/k,ti=xt.$(Math.round(ti),ti)?Math.round(ti):Math.ceil(ti),ti=ti*k+$}else switch(T){case cc:et=ti+Yt.x+ye.width;break;default:et=ti-Yt.x}switch(T){case cc:var sn=-(ti+Yt.x)+et;break;default:sn=ti+ye.width-Yt.x-et}if(0<v&&A>v-1||0<p&&0<A&&sn>p){for(n.push(new Tt(0,Pt?J-a:J,p+w,st+a+C)),ti=0;ti<A&&De!==A;ti++){sn=s[De-A+ti];var Ui=zf(sn,sn.locationObject,sn.locationSpot,X);sn.moveTo(sn.position.x,sn.position.y+a-Ui.y)}st+=C,J=Pt?J+st:J+(st+a),A=st=a=0,ti=$,Pt=!1}switch(ti===$&&(m=T===cc?Math.max(m,ye.width-Yt.x):Math.min(m,-Yt.x)),a=Math.max(a,Yt.y),st=Math.max(st,ye.height-Yt.y),isFinite(mt)&&(st=Math.max(st,Math.max(ye.height,mt)-Yt.y)),Pt?Ve.moveTo(ti-Yt.x,J-Yt.y):Ve.moveTo(ti-Yt.x,J),T){case cc:ti-=Yt.x+w;break;default:ti+=ye.width-Yt.x+w}A++}if(n.push(new Tt(0,J,p+w,(Pt?st:st+a)+C)),s.length!==A)for(p=0;p<A;p++)v=s[s.length-A+p],w=zf(v,v.locationObject,v.locationSpot,c),v.moveTo(v.position.x,v.position.y+a-w.y);if(G.free(c),G.free(X),T===cc)for(s=0;s<n.length;s++)a=n[s],a.width+=m,a.x-=m;else for(s=0;s<n.length;s++)a=n[s],a.x>m&&(a.width+=a.x-m,a.x=m);Tt.free(l)}for(c=a=l=s=0;c<n.length;c++)p=n[c],s=Math.min(s,p.x),l=Math.min(l,p.y),a=Math.max(a,p.x+p.width);this.arrangement===cc?this.commitLayers(n,new G(s+e/2-(a+s),l-i/2)):this.commitLayers(n,new G(s-e/2,l-i/2)),t!==null&&t.eb("Layout"),this.isValidLayout=!0}},Fl.prototype.commitLayers=function(){};function Cy(t,e){return t=t.text,e=e.text,t<e?-1:t>e?1:0}St.Object.defineProperties(Fl.prototype,{wrappingWidth:{get:function(){return this.zo},set:function(t){this.zo!==t&&(0<t||isNaN(t))&&(this.zo=t,this.isViewportSized=isNaN(t),this.C())}},wrappingColumn:{get:function(){return this.yo},set:function(t){this.yo!==t&&(0<t||isNaN(t))&&(this.yo=t,this.C())}},cellSize:{get:function(){return this.yg},set:function(t){this.yg.D(t)||(this.yg.assign(t),this.C())}},spacing:{get:function(){return this.tf},set:function(t){this.tf.D(t)||(this.tf.assign(t),this.C())}},alignment:{get:function(){return this.Jb},set:function(t){this.Jb===t||t!==nm&&t!==qm||(this.Jb=t,this.C())}},arrangement:{get:function(){return this.Rb},set:function(t){this.Rb===t||t!==u0&&t!==cc||(this.Rb=t,this.C())}},sorting:{get:function(){return this.nd},set:function(t){this.nd===t||t!==dl&&t!==fv&&t!==Qm&&t!==dv||(this.nd=t,this.C())}},comparer:{get:function(){return this.hd},set:function(t){this.hd!==t&&(this.hd=t,this.C())}}});var qm=new he(Fl,"Position",0),nm=new he(Fl,"Location",1),u0=new he(Fl,"LeftToRight",2),cc=new he(Fl,"RightToLeft",3),dl=new he(Fl,"Forward",4),fv=new he(Fl,"Reverse",5),Qm=new he(Fl,"Ascending",6),dv=new he(Fl,"Descending",7);Fl.className="GridLayout",Fl.standardComparer=Cy,Fl.smartComparer=function(t,e){if(t!==null){if(e!==null){t=t.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),e=e.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(var i=0;i<t.length;i++)if(e[i]!==""&&e[i]!==void 0){var n=parseFloat(t[i]),s=parseFloat(e[i]);if(isNaN(n))if(isNaN(s)){if(t[i].localeCompare(e[i])!==0)return t[i].localeCompare(e[i])}else return 1;else{if(isNaN(s))return-1;if(n-s!==0)return n-s}}else if(t[i]!=="")return 1;return e[i]!==""&&e[i]!==void 0?-1:0}return 1}return e!==null?-1:0},Fl.Position=qm,Fl.Location=nm,Fl.LeftToRight=u0,Fl.RightToLeft=cc,Fl.Forward=dl,Fl.Reverse=fv,Fl.Ascending=Qm,Fl.Descending=dv;function Dr(){this.On=new te,this.Dn=new te,this.Pa=new te,this.cf=new ci,this.bf=new ci,this.aj=new ci,this.H=null,this.tp=!1}L=Dr.prototype,L.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},L.Xe=function(t){this.H=t},L.oi=function(t){if(t instanceof Ee){if(this.On.add(t),t instanceof Yi){var e=t.containingGroup;e===null?this.H.ai.add(t):e.gl.add(t),e=t.layout,e!==null&&(e.diagram=this.H)}}else t instanceof ge?this.Dn.add(t):t instanceof pr||this.Pa.add(t);e=t.data,e===null||t instanceof pr||(t instanceof ge?this.bf.add(e,t):this.cf.add(e,t))},L.pc=function(t){if(t.Ej(),t instanceof Ee){if(this.On.remove(t),t instanceof Yi){var e=t.containingGroup;e===null?this.H.ai.remove(t):e.gl.remove(t),e=t.layout,e!==null&&(e.diagram=null)}}else t instanceof ge?this.Dn.remove(t):t instanceof pr||this.Pa.remove(t);e=t.data,e===null||t instanceof pr||(t instanceof ge?this.bf.remove(e):this.cf.remove(e))},L.Wd=function(){var t=this.H;if(t!==null){for(var e=t.nodeTemplateMap.iterator;e.next();){var i=e.value,n=e.key;(!i.Zc()||i instanceof Yi)&&Mt('Invalid node template in Diagram.nodeTemplateMap: template for "'+n+'" must be a Node or a simple Part, not a Group or Link: '+i)}for(e=t.groupTemplateMap.iterator;e.next();)i=e.value,n=e.key,i instanceof Yi||Mt('Invalid group template in Diagram.groupTemplateMap: template for "'+n+'" must be a Group, not a normal Node or Link: '+i);for(e=t.linkTemplateMap.iterator;e.next();)i=e.value,n=e.key,i instanceof ge||Mt('Invalid link template in Diagram.linkTemplateMap: template for "'+n+'" must be a Link, not a normal Node or simple Part: '+i);for(e=gi(),i=t.selection.iterator;i.next();)(n=i.value.data)&&e.push(n);for(i=gi(),t=t.highlighteds.iterator;t.next();)(n=t.value.data)&&i.push(n);for(t=gi(),n=this.nodes.iterator;n.next();){var s=n.value;s.data!==null&&(t.push(s.data),t.push(s.location))}for(n=this.links.iterator;n.next();)s=n.value,s.data!==null&&(t.push(s.data),t.push(s.location));for(n=this.parts.iterator;n.next();)s=n.value,s.data!==null&&(t.push(s.data),t.push(s.location));for(this.removeAllModeledParts(),this.addAllModeledParts(),n=0;n<e.length;n++)s=this.Lc(e[n]),s!==null&&(s.isSelected=!0);for(n=0;n<i.length;n++)s=this.Lc(i[n]),s!==null&&(s.isHighlighted=!0);for(n=0;n<t.length;n+=2)s=this.Lc(t[n]),s!==null&&(s.location=t[n+1]);Ji(e),Ji(i),Ji(t)}},Dr.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},Dr.prototype.addModeledParts=function(t,e){var i=this,n=this.diagram.model;t.forEach(function(s){n.lb(s)&&S1(i,s,!1)}),t.forEach(function(s){n.lb(s)&&i.resolveReferencesForData(s)}),e!==!1&&ah(this.diagram,!1)};function S1(t,e,i){if(e!=null&&!t.diagram.undoManager.isUndoingRedoing&&!t.cf.contains(e)){i===void 0&&(i=!0);t:{if(e!=null&&!t.H.undoManager.isUndoingRedoing&&!t.cf.contains(e)){var n=t.Ro(e),s=M1(t,e,n);if(s!==null&&(Sh(s),s=s.copy(),s!==null)){var a=t.diagram.skipsModelSourceBindings;t.diagram.skipsModelSourceBindings=!0,s.Tf=n,s.ub=e,t.tp&&(s.Jg="Tool"),t.diagram.add(s),s.ub=null,s.data=e,t.diagram.skipsModelSourceBindings=a,n=s;break t}}n=null}n!==null&&i&&t.resolveReferencesForData(e)}}Dr.prototype.insertLink=function(){return null},Dr.prototype.resolveReferencesForData=function(){},Dr.prototype.Ro=function(t){return this.H.model.Ro(t)};function M1(t,e,i){t=t.H;var n=t.model;return n.Xj()&&n.Yu(e)?(e=t.groupTemplateMap.I(i),e===null&&(e=t.groupTemplateMap.I(""),e===null&&(h0||(h0=!0,_i('No Group template found for category "'+i+'"'),_i(" Using default group template")),e=t.ly))):(e=t.nodeTemplateMap.I(i),e===null&&(e=t.nodeTemplateMap.I(""),e===null&&(pv||(pv=!0,_i('No Node template found for category "'+i+'"'),_i(" Using default node template")),e=t.ny))),e}Dr.prototype.getLinkCategoryForData=function(){return""},Dr.prototype.setLinkCategoryForData=function(){},Dr.prototype.setFromNodeForLink=function(){},Dr.prototype.setToNodeForLink=function(){},Dr.prototype.findLinkTemplateForCategory=function(t){var e=this.H,i=e.linkTemplateMap.I(t);return i===null&&(i=e.linkTemplateMap.I(""),i===null&&(mv||(mv=!0,_i('No Link template found for category "'+t+'"'),_i(" Using default link template")),i=e.my)),i},Dr.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},Dr.prototype.Gs=function(t){var e=this;t.forEach(function(i){e.ip(i)})},Dr.prototype.ip=function(t){t=this.Lc(t),t!==null&&(Cn(this.diagram,t,!1),this.unresolveReferencesForPart(t))},Dr.prototype.unresolveReferencesForPart=function(){},Dr.prototype.removeDataForLink=function(){},Dr.prototype.findPartForKey=function(t){return t==null?null:(t=this.H.model.hc(t),t!==null?this.cf.I(t):null)},Dr.prototype.Vb=function(t){return t==null||(t=this.H.model.hc(t),t===null)?null:(t=this.cf.I(t),t instanceof Ee?t:null)},Dr.prototype.findLinkForKey=function(){return null},L=Dr.prototype,L.Lc=function(t){if(t===null)return null;var e=this.cf.I(t);return e!==null?e:e=this.bf.I(t)},L.ii=function(t){return t===null?null:(t=this.cf.I(t),t instanceof Ee?t:null)},L.Kc=function(t){return t===null?null:this.bf.I(t)},L.ms=function(t){for(var e=0;e<arguments.length;++e);e=new te;for(var i=this.On.iterator;i.next();){var n=i.value,s=n.data;if(s!==null)for(var a=0;a<arguments.length;a++){var l=arguments[a];if(Qt(l)&&ky(this,s,l)){e.add(n);break}}}return e.iterator},L.ls=function(t){for(var e=0;e<arguments.length;++e);e=new te;for(var i=this.Dn.iterator;i.next();){var n=i.value,s=n.data;if(s!==null)for(var a=0;a<arguments.length;a++){var l=arguments[a];if(Qt(l)&&ky(this,s,l)){e.add(n);break}}}return e.iterator};function ky(t,e,i){for(var n in i){var s=e[n],a=i[n];if(ui(a)){if(!ui(s)||s.length<a.length)return!1;for(var l=0;l<s.length;l++){var c=a[l];if(c!==void 0&&!C1(t,s[l],c))return!1}}else if(!C1(t,s,a))return!1}return!0}function C1(t,e,i){if(typeof i=="function"){if(!i(e))return!1}else if(i instanceof RegExp){if(!e||!i.test(e.toString()))return!1}else if(Qt(e)&&Qt(i)){if(!ky(t,e,i))return!1}else if(e!==i)return!1;return!0}Dr.prototype.doModelChanged=function(t){if(this.H){var e=this.H;if(t.model===e.model){var i=t.change;if(e.doModelChanged(t),e.aa){e.aa=!1;try{var n=t.modelChange;if(n!=="")if(i===us){if(n==="nodeCategory"){var s=this.Lc(t.object),a=t.newValue;s!==null&&typeof a=="string"&&(s.category=a)}else n==="nodeDataArray"&&(this.Gs(t.oldValue),this.addModeledParts(t.newValue));e.isModified=!0}else if(i===qs){var l=t.newValue;n==="nodeDataArray"&&Qt(l)&&S1(this,l),e.isModified=!0}else if(i===aa){var c=t.oldValue;n==="nodeDataArray"&&Qt(c)&&this.ip(c),e.isModified=!0}else i===Hl&&(n==="SourceChanged"?t.object!==null?this.updateDataBindings(t.object,t.propertyName):(this.rp(),this.updateAllTargetBindings()):n==="ModelDisplaced"&&this.Wd());else if(i===us){var p=t.propertyName,m=t.object;m===e.model?(p==="nodeKeyProperty"||p==="nodeCategoryProperty")&&(e.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(m,p),e.isModified=!0}else if(i===qs||i===aa){var v=t.change===qs,w=v?t.newParam:t.oldParam,C=v?t.newValue:t.oldValue,k=this.aj.I(t.object);if(Array.isArray(k))for(t=0;t<k.length;t++){var T=k[t];if(v)Lm(T,C,w,!0);else if(!(0>w)){var A=w+cp(T);T.pc(A,!0),fp(T,A,w)}}e.isModified=!0}}finally{e.aa=!0}}}}},Dr.prototype.updateAllTargetBindings=function(t){t===void 0&&(t="");for(var e=this.parts.iterator;e.next();)e.value.La(t);for(e=this.nodes.iterator;e.next();)e.value.La(t);for(e=this.links.iterator;e.next();)e.value.La(t)},Dr.prototype.rp=function(){for(var t=this.H.model,e=new te,i=t.nodeDataArray,n=0;n<i.length;n++)e.add(i[n]);var s=[];for(this.nodes.each(function(l){l.data===null||e.contains(l.data)||s.push(l.data)}),this.parts.each(function(l){l.data===null||e.contains(l.data)||s.push(l.data)}),s.forEach(function(l){c0(t,l,!1)}),n=0;n<i.length;n++){var a=i[n];this.Lc(a)===null&&vv(t,a,!1)}for(this.refreshDataBoundLinks(),i=this.parts.iterator;i.next();)i.value.updateRelationshipsFromData();for(i=this.nodes.iterator;i.next();)i.value.updateRelationshipsFromData();for(i=this.links.iterator;i.next();)i.value.updateRelationshipsFromData()},Dr.prototype.refreshDataBoundLinks=function(){},Dr.prototype.updateRelationshipsFromData=function(){},Dr.prototype.updateDataBindings=function(t,e){if(typeof e=="string"){var i=this.Lc(t);if(i!==null)i.La(e);else{i=null;for(var n=this.aj.iterator;n.next();){for(var s=n.value,a=0;a<s.length;a++){var l=s[a].sx(t);l!==null&&(i===null&&(i=gi()),i.push(l))}if(i!==null)break}if(i!==null){for(n=0;n<i.length;n++)i[n].La(e);Ji(i)}}t===this.diagram.model.modelData&&this.updateAllTargetBindings(e)}};function Pa(t,e){var i=e.Hh;if(ui(i)){var n=t.aj.I(i);if(n===null)n=[],n.push(e),t.aj.add(i,n);else{for(t=0;t<n.length;t++)if(n[t]===e)return;n.push(e)}}}function Vd(t,e,i){id(e,function(l){l=l.O.s;for(var c=l.length,p=0;p<c;p++)cl(i,l[p])});var n=e.Hh;if(ui(n)){var s=t.aj.I(n);if(s!==null){for(var a=0;a<s.length;a++)if(s[a]===e){s.splice(a,1),s.length===0&&t.aj.remove(n);break}}}}Dr.prototype.Kj=function(t,e,i){i===void 0&&(i=!1);var n=new ci;if(ui(t))for(var s=0;s<t.length;s++)Wd(this,t[s],e,n,i);else for(t=t.iterator;t.next();)Wd(this,t.value,e,n,i);if(e!==null){i=e.model,t=e.toolManager.findTool("Dragging"),t=t!==null?t.dragOptions.dragsLink:e.Wm.dragsLink,s=new te;for(var a=new ci,l=n.iterator;l.next();){var c=l.value;if(c instanceof ge)t||c.fromNode!==null&&c.toNode!==null||s.add(c);else if(c instanceof Ee&&c.data!==null&&i.Tl()){var p=c;c=l.key;var m=c.pg();m!==null&&(m=n.I(m),m!==null?(i.qe(p.data,i.wa(m.data)),p=e.Kc(p.data),c=c.kh(),c!==null&&p!==null&&a.add(c,p)):i.qe(p.data,void 0))}}if(0<s.count&&e.Is(s,!1),0<a.count)for(i=a.iterator;i.next();)n.add(i.key,i.value)}if(e!==null&&this.H!==null&&(e=e.model,i=e.afterCopyFunction,i!==null)){var v=new ci;n.each(function(w){w.key.data!==null&&v.add(w.key.data,w.value.data)}),i(v,e,this.H.model)}for(e=n.iterator;e.next();)e.value.La();return n};function Wd(t,e,i,n,s){if(e===null||s&&!e.canCopy())return null;if(n.contains(e))return n.I(e);var a=t.copyPartData(e,i);if(!(a instanceof bi))return null;if(a.isSelected=!1,a.isHighlighted=!1,n.add(e,a),e instanceof Ee){for(var l=e.linksConnected;l.next();){var c=l.value;if(c.fromNode===e){var p=n.I(c);p!==null&&(p.fromNode=a)}c.toNode===e&&(c=n.I(c),c!==null&&(c.toNode=a))}if(e instanceof Yi&&a instanceof Yi)for(e=e.memberParts;e.next();)l=Wd(t,e.value,i,n,s),l instanceof ge||l===null||(l.containingGroup=a)}else if(e instanceof ge&&a instanceof ge)for(l=e.fromNode,l!==null&&(l=n.I(l),l!==null&&(a.fromNode=l)),l=e.toNode,l!==null&&(l=n.I(l),l!==null&&(a.toNode=l)),e=e.labelNodes;e.next();)l=Wd(t,e.value,i,n,s),l!==null&&l instanceof Ee&&(l.labeledLink=a);return a}Dr.prototype.copyPartData=function(t,e){var i=null,n=t.data;if(n!==null&&e!==null){var s=e.model;t instanceof ge||(n=s.copyNodeData(n),Qt(n)&&(s.xf(n),i=e.Lc(n)))}else Sh(t),i=t.copy(),i!==null&&(s=this.H,e!==null?e.add(i):n!==null&&s!==null&&s.commandHandler!==null&&s.commandHandler.copiesClipboardData&&(e=s.model,s=null,i instanceof ge||(s=e.copyNodeData(n)),Qt(s)&&(i.data=s)));return i},St.Object.defineProperties(Dr.prototype,{nodes:{get:function(){return this.On}},links:{get:function(){return this.Dn}},parts:{get:function(){return this.Pa}},diagram:{get:function(){return this.H}},addsToTemporaryLayer:{get:function(){return this.tp},set:function(t){this.tp=t}}}),Dr.prototype.updateAllRelationshipsFromData=Dr.prototype.rp,Dr.prototype.findLinksByExample=Dr.prototype.ls,Dr.prototype.findNodesByExample=Dr.prototype.ms,Dr.prototype.findLinkForData=Dr.prototype.Kc,Dr.prototype.findNodeForData=Dr.prototype.ii,Dr.prototype.findPartForData=Dr.prototype.Lc,Dr.prototype.findNodeForKey=Dr.prototype.Vb,Dr.prototype.removeModeledPart=Dr.prototype.ip,Dr.prototype.removeModeledParts=Dr.prototype.Gs,Dr.prototype.rebuildParts=Dr.prototype.Wd;var pv=!1,h0=!1,mv=!1;Dr.className="PartManager";function Nl(t){Dr.apply(this,arguments)}li(Nl,Dr),Nl.prototype.addAllModeledParts=function(){var t=this.diagram.model;this.addModeledParts(t.nodeDataArray),rm(this,t.linkDataArray)},Nl.prototype.addModeledParts=function(t){for(Dr.prototype.addModeledParts.call(this,t,!1),t=this.links.iterator;t.next();)r0(t.value);ah(this.diagram,!1)};function rm(t,e){e.forEach(function(i){k1(t,i)}),ah(t.diagram,!1)}function k1(t,e){if(e!=null&&!t.diagram.undoManager.isUndoingRedoing&&!t.bf.contains(e)){var i=t.getLinkCategoryForData(e),n=t.findLinkTemplateForCategory(i);if(n!==null){Sh(n);var s=n.copy();if(s!==null){n=t.diagram.skipsModelSourceBindings,t.diagram.skipsModelSourceBindings=!0,s.Tf=i,s.ub=e,i=t.diagram.model;var a=xv(i,e,!0);a!==""&&(s.fromPortId=a),a=Jh(i,e,!0),a!==void 0&&(a=t.Vb(a),a instanceof Ee&&(s.fromNode=a)),a=xv(i,e,!1),a!==""&&(s.toPortId=a),a=Jh(i,e,!1),a!==void 0&&(a=t.Vb(a),a instanceof Ee&&(s.toNode=a)),i=i.Ef(e),Array.isArray(i)&&i.forEach(function(l){l=t.Vb(l),l!==null&&(l.labeledLink=s)}),t.tp&&(s.Jg="Tool"),t.diagram.add(s),s.ub=null,s.data=e,t.diagram.skipsModelSourceBindings=n}}}}Nl.prototype.removeAllModeledParts=function(){var t=this.diagram.model;Ey(this,t.linkDataArray),this.Gs(t.nodeDataArray)};function Ey(t,e){e.forEach(function(i){t.ip(i)})}Nl.prototype.getLinkCategoryForData=function(t){return this.diagram.model.ps(t)},Nl.prototype.setLinkCategoryForData=function(t,e){return this.diagram.model.lp(t,e)},Nl.prototype.setFromNodeForLink=function(t,e){var i=this.diagram.model;i.wv(t.data,i.wa(e!==null?e.data:null))},Nl.prototype.setToNodeForLink=function(t,e){var i=this.diagram.model;i.Bv(t.data,i.wa(e!==null?e.data:null))},Nl.prototype.removeDataForLink=function(t){this.diagram.model.bm(t.data)},Nl.prototype.findPartForKey=function(t){var e=Dr.prototype.findPartForKey.call(this,t);return e===null&&(t=this.diagram.model.jh(t),t!==null)?this.bf.I(t):e},Nl.prototype.findLinkForKey=function(t){return t==null?null:(t=this.diagram.model.jh(t),t!==null?this.bf.I(t):null)},Nl.prototype.doModelChanged=function(t){var e=this;if(Dr.prototype.doModelChanged.call(this,t),this.diagram){var i=this.diagram;if(t.model===i.model){var n=t.change;if(i.aa){i.aa=!1;try{var s=t.modelChange;if(s!==""){if(n===us){if(s==="linkFromKey"){var a=this.Kc(t.object);if(a!==null){var l=this.Vb(t.newValue);a.fromNode=l}}else if(s==="linkToKey"){var c=this.Kc(t.object);if(c!==null){var p=this.Vb(t.newValue);c.toNode=p}}else if(s==="linkFromPortId"){var m=this.Kc(t.object);if(m!==null){var v=t.newValue;typeof v=="string"&&(m.fromPortId=v)}}else if(s==="linkToPortId"){var w=this.Kc(t.object);if(w!==null){var C=t.newValue;typeof C=="string"&&(w.toPortId=C)}}else if(s==="nodeGroupKey"){var k=this.Lc(t.object);if(k!==null){var T=t.newValue;if(T!==void 0){var A=this.Vb(T);A instanceof Yi?k.containingGroup=A:k.containingGroup=null}else k.containingGroup=null}}else if(s==="linkLabelKeys"){var X=this.Kc(t.object);if(X!==null){var $=t.oldValue,J=t.newValue;Array.isArray($)&&$.forEach(function(Yt){0<=J.indexOf(Yt)||(Yt=e.Vb(Yt),Yt!==null&&(Yt.labeledLink=null))}),Array.isArray(J)&&J.forEach(function(Yt){Yt=e.Vb(Yt),Yt!==null&&(Yt.labeledLink=X)})}}else if(s==="linkCategory"){var et=this.Kc(t.object),st=t.newValue;et!==null&&typeof st=="string"&&(et.category=st)}else s==="linkDataArray"&&(Ey(this,t.oldValue),rm(this,t.newValue));i.isModified=!0}else if(n===qs){var mt=t.newValue;if(s==="linkDataArray"&&typeof mt=="object"&&mt!==null)k1(this,mt);else if(s==="linkLabelKeys"&&Ep(mt)){var Pt=this.Kc(t.object),De=this.Vb(mt);Pt!==null&&De!==null&&(De.labeledLink=Pt)}i.isModified=!0}else if(n===aa){var ti=t.oldValue;if(s==="linkDataArray"&&typeof ti=="object"&&ti!==null)this.ip(ti);else if(s==="linkLabelKeys"&&Ep(ti)){var Ve=this.Vb(ti);Ve!==null&&(Ve.labeledLink=null)}i.isModified=!0}}else if(n===us){var ye=t.propertyName;t.object!==i.model||ye!=="linkFromKeyProperty"&&ye!=="linkToKeyProperty"&&ye!=="linkFromPortIdProperty"&&ye!=="linkToPortIdProperty"&&ye!=="linkLabelKeysProperty"&&ye!=="nodeIsGroupProperty"&&ye!=="nodeGroupKeyProperty"&&ye!=="linkCategoryProperty"||i.undoManager.isUndoingRedoing||this.Wd(),i.isModified=!0}}finally{i.aa=!0}}}}},Nl.prototype.refreshDataBoundLinks=function(){var t=this,e=this.diagram.model,i=new te,n=e.linkDataArray;n.forEach(function(a){i.add(a)});var s=[];this.links.each(function(a){a.data===null||i.contains(a.data)||s.push(a.data)}),s.forEach(function(a){Lp(e,a,!1)}),n.forEach(function(a){t.Kc(a)===null&&_1(e,a,!1)})},Nl.prototype.updateRelationshipsFromData=function(t){var e=t.data;if(e!==null){var i=t.diagram;if(i!==null){var n=i.model;if(t instanceof ge){var s=Jh(n,e,!0);if(s=i.Vb(s),t.fromNode=s,s=Jh(n,e,!1),s=i.Vb(s),t.toNode=s,e=n.Ef(e),0<e.length||0<t.labelNodes.count){if(e.length===1&&t.labelNodes.count===1){s=e[0];var a=t.labelNodes.first();if(n.wa(a.data)===s)return}s=new te().addAll(e);var l=new te;t.labelNodes.each(function(c){c.data!==null&&(c=n.wa(c.data),c!==void 0&&l.add(c))}),e=l.copy(),e.hp(s),s=s.copy(),s.hp(l),(0<e.count||0<s.count)&&(e.each(function(c){c=i.Vb(c),c!==null&&c.labeledLink===t&&(c.labeledLink=null)}),s.each(function(c){c=i.Vb(c),c!==null&&c.labeledLink!==t&&(c.labeledLink=t)}))}}else!(t instanceof pr)&&(e=n.lh(e),e=i.findPartForKey(e),e===null||e instanceof Yi)&&(t.containingGroup=e)}}},Nl.prototype.resolveReferencesForData=function(t){var e=this.diagram.model,i=e.wa(t);if(i!==void 0){var n=tg(e,i),s=this.Lc(t);if(n!==null&&s!==null){n=n.iterator;for(var a={};n.next();){var l=n.value;e.lb(l)?s instanceof Yi&&e.lh(l)===i&&(l=this.Lc(l),l!==null&&(l.containingGroup=s)):(a.link=this.Kc(l),a.link!==null&&s instanceof Ee&&(Jh(e,l,!0)===i&&(a.link.fromNode=s),Jh(e,l,!1)===i&&(a.link.toNode=s),l=e.Ef(l),Array.isArray(l)&&l.some(function(c){return function(p){return p===i?(s.labeledLink=c.link,!0):!1}}(a)))),a={link:a.link}}Dc(e,i)}t=e.lh(t),t!==void 0&&(t=this.Vb(t),t instanceof Yi&&(s.containingGroup=t))}},Nl.prototype.unresolveReferencesForPart=function(t){var e=this.diagram.model;if(t instanceof Ee){var i=e.wa(t.data);if(i!==void 0){for(var n=t.linksConnected;n.next();)af(e,i,n.value.data);if(t.isLinkLabel&&(n=t.labeledLink,n!==null&&af(e,i,n.data)),t instanceof Yi)for(t=t.memberParts;t.next();)n=t.value.data,e.lb(n)&&af(e,i,n)}}},Nl.prototype.copyPartData=function(t,e){var i=Dr.prototype.copyPartData.call(this,t,e);if(t instanceof ge)if(t=t.data,t!==null&&e!==null){var n=e.model;t=n.Jo(t),typeof t=="object"&&t!==null&&(n.fi(t),i=e.Kc(t))}else i!==null&&(e=this.diagram,t!==null&&e!==null&&e.commandHandler!==null&&e.commandHandler.copiesClipboardData&&(e=e.model.Jo(t),typeof e=="object"&&e!==null&&(i.data=e)));return i},Nl.prototype.insertLink=function(t,e,i,n){var s=this.diagram,a=s.model,l=s.toolManager.findTool("Linking"),c="";if(t!==null&&(e===null&&(e=t),c=e.portId,c===null&&(c="")),e="",i!==null&&(n===null&&(n=i),e=n.portId,e===null&&(e="")),n=l.archetypeLinkData,n instanceof ge){if(Sh(n),a=n.copy(),a!==null)return a.fromNode=t,a.fromPortId=c,a.toNode=i,a.toPortId=e,s.add(a),t=l.archetypeLabelNodeData,t instanceof Ee&&(Sh(t),t=t.copy(),t!==null&&(t.labeledLink=a,s.add(t))),a}else if(n!==null&&(n=a.Jo(n),typeof n=="object"&&n!==null))return t!==null&&am(a,n,a.wa(t.data),!0),lm(a,n,c,!0),i!==null&&am(a,n,a.wa(i.data),!1),lm(a,n,e,!1),a.fi(n),t=l.archetypeLabelNodeData,t===null||t instanceof Ee||(t=a.copyNodeData(t),typeof t=="object"&&t!==null&&(a.xf(t),t=a.wa(t),t!==void 0&&a.Bu(n,t))),s.Kc(n);return null},Nl.prototype.findLinkForKey=Nl.prototype.findLinkForKey,Nl.prototype.findPartForKey=Nl.prototype.findPartForKey,Nl.prototype.removeAllModeledParts=Nl.prototype.removeAllModeledParts,Nl.prototype.addModeledParts=Nl.prototype.addModeledParts,Nl.prototype.addAllModeledParts=Nl.prototype.addAllModeledParts,Nl.className="GraphLinksPartManager";function fc(){Dr.apply(this,arguments),this.Sg=null}li(fc,Dr);function Is(t,e,i){if(e!==null&&i!==null&&i.kh()===null){var n=t.diagram.toolManager.findTool("Linking"),s=e,a=i;if(t.diagram.isTreePathToChildren||(s=i,a=e),(n===null||!Ln(n,s,a,null,!0))&&(e=t.getLinkCategoryForData(i.data),n=t.findLinkTemplateForCategory(e),n!==null&&(Sh(n),n=n.copy(),n!==null))){var l=t.diagram.skipsModelSourceBindings;t.diagram.skipsModelSourceBindings=!0,n.Tf=e,n.ub=i.data,n.fromNode=s,n.toNode=a,t.diagram.add(n),n.ub=null,n.data=i.data,t.diagram.skipsModelSourceBindings=l}}}fc.prototype.getLinkCategoryForData=function(t){return this.diagram.model.ss(t)},fc.prototype.setLinkCategoryForData=function(t,e){this.diagram.model.Ms(t,e)},fc.prototype.setFromNodeForLink=function(t,e,i){var n=this.diagram.model;if(i===void 0&&(i=null),e=e!==null?e.data:null,this.diagram.isTreePathToChildren)n.qe(t.data,n.wa(e));else{var s=this.Sg;this.Sg=t,i!==null&&n.qe(i.data,void 0),n.qe(e,n.wa(t.toNode!==null?t.toNode.data:null)),this.Sg=s}},fc.prototype.setToNodeForLink=function(t,e,i){var n=this.diagram.model;if(i===void 0&&(i=null),e=e!==null?e.data:null,this.diagram.isTreePathToChildren){var s=this.Sg;this.Sg=t,i!==null&&n.qe(i.data,void 0),n.qe(e,n.wa(t.fromNode!==null?t.fromNode.data:null)),this.Sg=s}else n.qe(t.data,n.wa(e))},fc.prototype.removeDataForLink=function(t){this.diagram.model.qe(t.data,void 0)},fc.prototype.findLinkForKey=function(t){return t==null?null:(t=this.diagram.model.hc(t),t!==null?this.bf.I(t):null)},fc.prototype.doModelChanged=function(t){if(Dr.prototype.doModelChanged.call(this,t),this.diagram){var e=this.diagram;if(t.model===e.model){var i=t.change;if(e.aa){e.aa=!1;try{var n=t.modelChange;if(n!==""){if(i===us){if(n==="nodeParentKey"){var s=t.object,a=this.Vb(t.newValue),l=this.ii(s);if(this.Sg!==null)a!==null&&(this.Sg.data=s,this.Sg.category=this.getLinkCategoryForData(s));else if(l!==null){var c=l.kh();c!==null?a===null?e.remove(c):e.isTreePathToChildren?c.fromNode=a:c.toNode=a:Is(this,a,l)}}else if(n==="parentLinkCategory"){var p=this.ii(t.object),m=t.newValue;if(p!==null&&typeof m=="string"){var v=p.kh();v!==null&&(v.category=m)}}e.isModified=!0}}else if(i===us){var w=t.propertyName;t.object===e.model&&w==="nodeParentKeyProperty"&&(e.undoManager.isUndoingRedoing||this.Wd()),e.isModified=!0}}finally{e.aa=!0}}}}},fc.prototype.updateRelationshipsFromData=function(t){var e=t.data;if(e!==null){var i=t.diagram;if(i!==null){var n=i.model;t instanceof Ee&&(e=n.mh(e),e=i.Vb(e),n=t.pg(),e!==n&&(n=t.kh(),e!==null?n!==null?i.isTreePathToChildren?n.fromNode=e:n.toNode=e:Is(this,e,t):n!==null&&Cn(i,n,!1)))}}},fc.prototype.updateDataBindings=function(t,e){Dr.prototype.updateDataBindings.call(this,t,e),typeof e=="string"&&this.Lc(t)!==null&&(t=this.Kc(t),t!==null&&t.La(e))},fc.prototype.resolveReferencesForData=function(t){var e=this.diagram.model,i=e.wa(t);if(i!==void 0){var n=tg(e,i),s=this.Lc(t);if(n!==null&&s!==null){for(n=n.iterator;n.next();){var a=n.value;e.lb(a)&&s instanceof Ee&&e.mh(a)===i&&Is(this,s,this.ii(a))}Dc(e,i)}t=e.mh(t),t!==void 0&&s instanceof Ee&&(t=this.Vb(t),Is(this,t,s))}},fc.prototype.unresolveReferencesForPart=function(t){var e=this.diagram.model;if(t instanceof Ee){var i=e.wa(t.data),n=this.Kc(t.data);if(n!==null){n.isSelected=!1,n.isHighlighted=!1;var s=n.layer;if(s!==null){var a=s.pc(-1,n,!1);0<=a&&this.diagram.cb(aa,"parts",s,n,null,a,null),a=n.layerChanged,a!==null&&a(n,s,null)}}for(n=this.diagram.isTreePathToChildren,t=t.linksConnected;t.next();)s=t.value,s=(n?s.toNode:s.fromNode).data,e.lb(s)&&af(e,i,s)}},fc.prototype.insertLink=function(t,e,i){e=this.diagram.model;var n=t,s=i;return this.diagram.isTreePathToChildren||(n=i,s=t),n!==null&&s!==null?(e.qe(s.data,e.wa(n.data)),s.kh()):null},fc.prototype.findLinkForKey=fc.prototype.findLinkForKey,fc.className="TreePartManager";function ii(t,e){this.kl=new te,this.il=new te,this.Wv=`,
|
|
|
"insertedNodeKeys": `,this.jy=`,
|
|
|
"modifiedNodeData": `,this.Yv=`,
|
|
|
"removedNodeKeys": `,this.vh=null,Do(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new ci,this.Th="key",this.Bk=this.bl=null,this.Jm=this.Km=!1,this.Mm=!0,this.xm=null,this.lj="category",this.Vf=new ci,this.Lt=new ue,this.Wg=!1,this.o=null,this.undoManager=new ms,t!==void 0&&(ui(t)?this.nodeDataArray=t:e=t),e&&(Object.assign(this,e),t=e.Changed)&&(delete this.Changed,this.Pe(t))}ii.prototype.cloneProtected=function(t){t.xa=this.xa,t.Sm=this.Sm,t.Gg=this.Gg,t.Th=this.Th,t.bl=this.bl,t.Bk=this.Bk,t.Km=this.Km,t.Jm=this.Jm,t.Mm=this.Mm,t.xm=this.xm,t.lj=this.lj},ii.prototype.copy=function(){var t=new this.constructor;return this.cloneProtected(t),t},ii.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},ii.prototype.toString=function(t){if(t===void 0&&(t=0),1<t)return this.np();var e=(this.name!==""?this.name:"")+" Model";if(0<t){e+=`
|
|
|
node data:`,t=this.nodeDataArray;for(var i=t.length,n=0;n<i;n++){var s=t[n];e+=" "+this.wa(s)+":"+zr(s)}}return e},ii.prototype.xA=function(t){t.change!==Hl&&Mt("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+t.toString());var e=t.object;return t.isTransactionFinished&&e instanceof Ga?(E1(this,e),t=this.Qv(e,t.propertyName==="FinishedUndo"),this.vh=null,t):null},ii.prototype.Qv=function(t,e){var i=this,n=!1,s=new te,a=new te,l=new te,c=this.vh;t.changes.each(function(w){w.model===i&&(w.modelChange==="nodeDataArray"?w.change===qs?s.add(w.newValue):w.change===aa&&l.add(w.oldValue):i.lb(w.object)?a.add(w.object):w.change!==us||i.modelData!==w.object&&w.propertyName!=="modelData"?w.object!==null&&(c&&c.contains(w.object)?c.get(w.object).each(function(C){i.lb(C)&&a.add(C)}):w.object instanceof ii||i.ri()&&i.Jc(w.object)||Tu(i,w.object).each(function(C){a.add(C)})):n=!0)});var p=this.il;p.clear(),s.each(function(w){p.add(i.wa(w)),e||a.add(w)});var m=this.kl;m.clear(),l.each(function(w){m.add(i.wa(w)),e&&a.add(w)}),t=i.cloneDeep(a.Fa());var v=null;return n&&(v===null&&(v={}),v.modelData=this.cloneDeep(this.modelData)),0<p.count&&(v===null&&(v={}),e?v.removedNodeKeys=p.Fa():v.insertedNodeKeys=p.Fa()),0<t.length&&(v===null&&(v={}),v.modifiedNodeData=t),0<m.count&&(v===null&&(v={}),e?v.insertedNodeKeys=m.Fa():v.removedNodeKeys=m.Fa()),m.clear(),p.clear(),v},ii.prototype.cloneDeep=function(t){return bd(this,t,!0)};function bd(t,e,i,n,s,a){function l(w,C){c?(w.__gohashid===void 0&&a.push(w),n.set(w,C)):(w=ea++,n.set(w,C),s.set(w,e))}if(!Qt(e))return e;a||(a=[]);var c=Object.isExtensible(e);if(n||(n=new ci),c){var p=n.get(e);if(p)return p}else for(s||(s=new ci),p=s.iterator;p.next();){var m=p.key;if(p.value===e&&(m=n.get(m)))return m}if(Array.isArray(e)){p=[],l(e,p);for(var v=0;v<e.length;v++)p.push(bd(t,e[v],!1,n,s,a))}else if(e instanceof G||e instanceof fe||e instanceof Tt||e instanceof Ai||e instanceof di)p=e.copy(),l(e,p);else{if(e instanceof Br||e instanceof ve||e instanceof he)return e;if(e instanceof ue)p=new ue().addAll(bd(t,e.Fa(),!1,n,s,a)),l(e,p);else if(e instanceof te)p=new te().addAll(bd(t,e.Fa(),!1,n,s,a)),l(e,p);else if(e instanceof ci)p=new ci().addAll(bd(t,e.Fa(),!1,n,s,a)),l(e,p);else if(e instanceof Date)p=new Date(e.getTime()),l(e,p);else if(e instanceof RegExp)p=new RegExp(e),l(e,p),p.lastIndex=e.lastIndex;else if(typeof e.copy=="function")p=e.copy(),l(e,p);else for(v in p={},l(e,p),e)v!=="__gohashid"&&(p[v]=bd(t,e[v],!1,n,s,a))}return i&&a.forEach(function(w){delete w.__gohashid}),p}L=ii.prototype,L.quote=function(t){return JSON.stringify(t).replace(/[\u007F-\uFFFF]/g,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).substr(-4)})},L.rm=function(){var t="";return this.name!==""&&(t+=`,
|
|
|
"name": `+this.quote(this.name)),this.dataFormat!==""&&(t+=`,
|
|
|
"dataFormat": `+this.quote(this.dataFormat)),this.isReadOnly&&(t+=`,
|
|
|
"isReadOnly": `+this.isReadOnly),this.nodeKeyProperty!=="key"&&typeof this.nodeKeyProperty=="string"&&(t+=`,
|
|
|
"nodeKeyProperty": `+this.quote(this.nodeKeyProperty)),this.copiesArrays&&(t+=`,
|
|
|
"copiesArrays": true`),this.copiesArrayObjects&&(t+=`,
|
|
|
"copiesArrayObjects": true`),this.copiesKey||(t+=`,
|
|
|
"copiesKey": false`),this.nodeCategoryProperty!=="category"&&typeof this.nodeCategoryProperty=="string"&&(t+=`,
|
|
|
"nodeCategoryProperty": `+this.quote(this.nodeCategoryProperty)),t},L.gp=function(t){t.name&&(this.name=t.name),t.dataFormat&&(this.dataFormat=t.dataFormat),t.isReadOnly&&(this.isReadOnly=!0),t.nodeKeyProperty&&(this.nodeKeyProperty=t.nodeKeyProperty),t.copiesArrays&&(this.copiesArrays=!0),t.copiesArrayObjects&&(this.copiesArrayObjects=!0),t.copiesKey===!1&&(this.copiesKey=!1),t.nodeCategoryProperty&&(this.nodeCategoryProperty=t.nodeCategoryProperty)};function om(t,e){e=e.modelData,Qt(e)&&(t.dm(e),t.modelData=e)}L.Rv=function(){var t=this.modelData,e=!1,i;for(i in t)if(!vx(i,t[i])){e=!0;break}return t="",e&&(t=`,
|
|
|
"modelData": `+Ly(this,this.modelData)),t+`,
|
|
|
"nodeDataArray": `+tu(this,this.nodeDataArray,!0)},L.kv=function(t){om(this,t),t=t.nodeDataArray,ui(t)&&(this.dm(t),this.nodeDataArray=t)};function E1(t,e){function i(s,a){if((a=a.part)&&(a=a.data,s!==a)){var l=n.get(s);l===null?(l=new te,l.add(a),n.add(s,l)):l.add(a)}}var n=t.vh;n===null&&(n=new ci,e.changes.each(function(s){if(s.diagram!==null){var a=s.change;a===us?(s=s.object.panel)&&(a=s.data)&&i(a,s):(a===qs||a===aa)&&(s=s.object,(a=s.itemArray)&&i(a,s))}}),t.vh=n)}function Tu(t,e){for(var i=new te,n=0;n<t.nodeDataArray.length;n++){var s=t.nodeDataArray[n];gv(t,e,s,s,i)}return i}function gv(t,e,i,n,s){if(Array.isArray(i))for(var a=0;a<i.length;a++){var l=i[a];if(l===e)return s.add(n),!0;if(gv(t,e,l,n,s))return!0}else if(Qt(i)&&Object.getPrototypeOf(i)===Object.prototype)for(a in i){if(l=i[a],l===e)return s.add(n),!0;if(gv(t,e,l,n,s))return!0}return!1}L.Pv=function(t,e){var i=this,n=!1,s=new te,a=new te,l=new te,c=this.vh;t.changes.each(function(v){v.model===i&&(v.modelChange==="nodeDataArray"?v.change===qs?s.add(v.newValue):v.change===aa&&l.add(v.oldValue):i.lb(v.object)?a.add(v.object):v.change!==us||i.modelData!==v.object&&v.propertyName!=="modelData"?v.object!==null&&(c&&c.contains(v.object)?c.get(v.object).each(function(w){i.lb(w)&&a.add(w)}):v.object instanceof ii||i.ri()&&i.Jc(v.object)||Tu(i,v.object).each(function(w){a.add(w)})):n=!0)});var p=this.il;p.clear(),s.each(function(v){p.add(i.wa(v)),e||a.add(v)});var m=this.kl;return m.clear(),l.each(function(v){m.add(i.wa(v)),e&&a.add(v)}),t="",n&&(t+=`,
|
|
|
"modelData": `+Ly(this,this.modelData)),0<p.count&&(t+=(e?this.Yv:this.Wv)+tu(this,p.Fa(),!0)),0<a.count&&(t+=this.jy+tu(this,a.Fa(),!0)),0<m.count&&(t+=(e?this.Wv:this.Yv)+tu(this,m.Fa(),!0)),m.clear(),p.clear(),t},L.fp=function(t){(t.name!==void 0&&t.name!==this.name||t.dataFormat!==void 0&&t.dataFormat!==this.dataFormat||t.isReadOnly!==void 0&&t.isReadOnly!==this.isReadOnly||t.nodeKeyProperty!==void 0&&t.nodeKeyProperty!==this.nodeKeyProperty||t.copiesArrays!==void 0&&t.copiesArrays!==this.copiesArrays||t.copiesArrayObjects!==void 0&&t.copiesArrayObjects!==this.copiesArrayObjects||t.copiesKey!==void 0&&t.copiesKey!==this.copiesKey||t.nodeCategoryProperty!==void 0&&t.nodeCategoryProperty!==this.nodeCategoryProperty)&&Mt("applyIncrementalJson cannot change Model properties"),om(this,t);var e=t.insertedNodeKeys,i=t.modifiedNodeData,n=new ci;if(Array.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this.wa(a);l!=null&&n.set(l,a)}if(Array.isArray(e))for(s=e.length,a=0;a<s;a++){l=e[a];var c=this.hc(l);c===null&&(c=(c=n.get(l))?c:this.copyNodeData({}),this.km(c,l),this.xf(c))}if(Array.isArray(i)){for(e=i.length,n=0;n<e;n++)if(s=i[n],a=this.wa(s),a=this.hc(a),a!==null){for(var p in s)p==="__gohashid"||p===this.nodeKeyProperty||this.Wj()&&p===this.nodeIsGroupProperty||this.setDataProperty(a,p,s[p]);this.lm(s,a)}}if(t=t.removedNodeKeys,Array.isArray(t))for(i=t.length,p=0;p<i;p++)e=this.hc(t[p]),e!==null&&this.cm(e)},L.$x=function(t,e){t.change!==Hl&&Mt("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+t.toString());var i=t.object;return t.isTransactionFinished&&i instanceof Ga?(e===void 0&&(e=f0(this,this)),E1(this,i),t=this.Pv(i,t.propertyName==="FinishedUndo"),this.vh=null,e==="2"?'{ "incremental": 2'+t+"}":'{ "class": '+this.quote(e)+', "incremental": 1'+this.rm()+t+"}"):'{ "incremental": 0 }'},L.yA=function(t,e){return this.$x(t,e)},L.np=function(t){return t===void 0&&(t=f0(this,this)),'{ "class": '+this.quote(t)+this.rm()+this.Rv()+"}"},L.toJSON=function(t){return this.np(t)},L.Zw=function(t){var e=null;if(typeof t=="string")try{e=Kt.JSON.parse(t)}catch(n){}else typeof t=="object"?e=t:Mt("Unable to modify a Model from: "+t);var i=e.incremental;typeof i!="number"&&Mt("Unable to apply non-incremental changes to Model: "+t),i!==0&&(this.Ea("applyIncrementalJson"),this.fp(e),this.eb("applyIncrementalJson"))},L.Ky=function(t){return this.Zw(t)},ii.constructGraphLinksModel=function(){return new ii},L=ii.prototype,L.dm=function(t){if(ui(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];if(Qt(n)){var s=i;n=this.dm(n),Array.isArray(t)?t[s]=n:Mt("Cannot replace an object in an HTMLCollection or NodeList at "+s)}}else if(Qt(t)){for(e in t)if(i=t[e],Qt(i)&&(i=this.dm(i),t[e]=i,e==="points"&&Array.isArray(i))){for(s=i.length%2===0,n=0;n<i.length;n++)if(typeof i[n]!="number"){s=!1;break}if(s){for(s=new ue,n=0;n<i.length/2;n++)s.add(new G(i[2*n],i[2*n+1]));s.freeze(),t[e]=s}}return yx(t)}return t},L.sm=function(t){return t===void 0?"undefined":t===null?"null":t===!0?"true":t===!1?"false":typeof t=="string"?this.quote(t):typeof t=="number"?t===1/0?"9e9999":t===-1/0?"-9e9999":isNaN(t)?'{"class":"NaN"}':t.toString():t instanceof Date?'{"class":"Date", "value":"'+t.toJSON()+'"}':t instanceof Number?this.sm(t.valueOf()):ui(t)?tu(this,t):Qt(t)?Ly(this,t):typeof t=="function"?"null":t.toString()};function tu(t,e,i){i===void 0&&(i=!1);var n=e.length;if(0>=n)return"[]";var s=new Aa;s.add("["),i&&1<n&&s.add(`
|
|
|
`);for(var a=0;a<n;a++){var l=e[a];l!==void 0&&(0<a&&(s.add(","),i&&s.add(`
|
|
|
`)),s.add(t.sm(l)))}return i&&1<n&&s.add(`
|
|
|
`),s.add("]"),s.toString()}function vx(t,e){return e===void 0||t==="__gohashid"||t[0]==="_"||typeof e=="function"}function ih(t){return isNaN(t)?"NaN":t===1/0?"9e9999":t===-1/0?"-9e9999":t}function Ly(t,e){var i=e;if(i instanceof G)e={class:"go.Point",x:ih(i.x),y:ih(i.y)};else if(i instanceof fe)e={class:"go.Size",width:ih(i.width),height:ih(i.height)};else if(i instanceof Tt)e={class:"go.Rect",x:ih(i.x),y:ih(i.y),width:ih(i.width),height:ih(i.height)};else if(i instanceof Ai)e={class:"go.Margin",top:ih(i.top),right:ih(i.right),bottom:ih(i.bottom),left:ih(i.left)};else if(i instanceof di)i.sb()?e={class:"go.Spot",x:ih(i.x),y:ih(i.y),offsetX:ih(i.offsetX),offsetY:ih(i.offsetY)}:e={class:"go.Spot",enum:i.toString()};else if(i instanceof Br){if(e={class:"go.Brush",type:i.type.name},i.type===td?e.color=i.color:(i.type===ed||i.type===lc)&&(e.start=i.start,e.end=i.end,i.type===lc&&(i.startRadius!==0&&(e.startRadius=ih(i.startRadius)),isNaN(i.endRadius)||(e.endRadius=ih(i.endRadius)))),i.colorStops!==null){var n={};for(i=i.colorStops.iterator;i.next();)n[i.key]=i.value;e.colorStops=n}}else i instanceof ve?(e={class:"go.Geometry",type:i.type.name},i.startX!==0&&(e.startX=ih(i.startX)),i.startY!==0&&(e.startY=ih(i.startY)),i.endX!==0&&(e.endX=ih(i.endX)),i.endY!==0&&(e.endY=ih(i.endY)),i.spot1.D(Fo)||(e.spot1=i.spot1),i.spot2.D(uu)||(e.spot2=i.spot2),i.type===ve.o&&(e.path=ve.ia(i))):i instanceof he&&(e={class:"go.EnumValue",classType:f0(t,i.classType),name:i.name});n="{",i=!0;for(var s in e){var a=Ra(e,s);if(!vx(s,a))if(i?i=!1:n+=",",n+=t.quote(s)+":",s==="points"&&a instanceof ue){var l="[";for(a=a.iterator;a.next();){var c=a.value;1<l.length&&(l+=","),l+=t.sm(c.x),l+=",",l+=t.sm(c.y)}l+="]",n+=l}else n+=t.sm(a)}return n+"}"}function _u(t){return typeof t=="number"?t:t==="NaN"?NaN:t==="9e9999"?1/0:t==="-9e9999"?-1/0:parseFloat(t)}function yx(t){if(typeof t!="object")return t;var e=t.class||"";if(e==="NaN")return NaN;if(e==="Date")return new Date(t.value);if(e.indexOf("go.")!==0)return t;e=e.substr(3);var i=t;if(e==="Point")i=new G(_u(t.x),_u(t.y));else if(e==="Size")i=new fe(_u(t.width),_u(t.height));else if(e==="Rect")i=new Tt(_u(t.x),_u(t.y),_u(t.width),_u(t.height));else if(e==="Margin")i=new Ai(_u(t.top),_u(t.right),_u(t.bottom),_u(t.left));else if(e==="Spot")typeof t.enum=="string"?i=Xc(t.enum):i=new di(_u(t.x),_u(t.y),_u(t.offsetX),_u(t.offsetY));else if(e==="Brush"){if(i=new Br,i.type=ss(Br,t.type),typeof t.color=="string"&&(i.color=t.color),t.start instanceof di&&(i.start=t.start),t.end instanceof di&&(i.end=t.end),typeof t.startRadius=="number"&&(i.startRadius=_u(t.startRadius)),typeof t.endRadius=="number"&&(i.endRadius=_u(t.endRadius)),t=t.colorStops,Qt(t))for(var n in t)i.addColorStop(parseFloat(n),t[n])}else e==="Geometry"?(i=null,typeof t.path=="string"?i=ve.parse(t.path):i=new ve,i.type=ss(ve,t.type),typeof t.startX=="number"&&(i.startX=_u(t.startX)),typeof t.startY=="number"&&(i.startY=_u(t.startY)),typeof t.endX=="number"&&(i.endX=_u(t.endX)),typeof t.endY=="number"&&(i.endY=_u(t.endY)),t.spot1 instanceof di&&(i.spot1=t.spot1),t.spot2 instanceof di&&(i.spot2=t.spot2)):e==="EnumValue"&&(n=t.classType,n.indexOf("go.")===0&&(n=n.substr(3)),n=yv(n),typeof n=="function"&&(i=ss(n,t.name)));return i}L.Pe=function(t){return this.Lt.add(t),this},L.ik=function(t){this.Lt.remove(t)},L.ds=function(t){this.skipsUndoManager||this.undoManager.Tu(t);for(var e=this.Lt,i=e.length,n=0;n<i;n++)e.M(n)(t)},L.cb=function(t,e,i,n,s,a,l){pl(this,"",t,e,i,n,s,a,l)},L.g=function(t,e,i,n,s){pl(this,"",us,t,this,e,i,n,s)},L.Fs=function(t,e,i,n,s,a){pl(this,"",us,e,t,i,n,s,a)};function pl(t,e,i,n,s,a,l,c,p){c===void 0&&(c=null),p===void 0&&(p=null);var m=new mo;m.model=t,m.change=i,m.modelChange=e,m.propertyName=n,m.object=s,m.oldValue=a,m.oldParam=c,m.newValue=l,m.newParam=p,t.ds(m)}ii.prototype.changeState=function(t,e){if(t!==null&&t.model===this)if(t.change===us){var i=t.object,n=t.propertyName,s=t.I(e);n===this.nodeKeyProperty&&this.lb(i)&&(e=t.I(!e),e!==void 0&&this.kb.remove(e),s!==void 0&&this.kb.add(s,i)),cs(i,n,s)}else t.change===qs?(i=t.newParam,t.modelChange==="nodeDataArray"?(t=t.newValue,Qt(t)&&typeof i=="number"&&(n=this.wa(t),e?(this.Tc[i]===t&&Lr(this.Tc,i),n!==void 0&&this.kb.remove(n)):(this.Tc[i]!==t&&Mr(this.Tc,i,t),n!==void 0&&this.kb.add(n,t)))):t.modelChange===""?((n=t.object)&&!ui(n)&&t.propertyName&&(n=Ra(t.object,t.propertyName)),ui(n)&&typeof i=="number"&&(t=t.newValue,e?Lr(n,i):Mr(n,i,t))):Mt("unknown ChangedEvent.Insert modelChange: "+t.toString())):t.change===aa?(i=t.oldParam,t.modelChange==="nodeDataArray"?(t=t.oldValue,Qt(t)&&typeof i=="number"&&(n=this.wa(t),e?(this.Tc[i]!==t&&Mr(this.Tc,i,t),n!==void 0&&this.kb.add(n,t)):(this.Tc[i]===t&&Lr(this.Tc,i),n!==void 0&&this.kb.remove(n)))):t.modelChange===""?((n=t.object)&&!ui(n)&&t.propertyName&&(n=Ra(t.object,t.propertyName)),ui(n)&&typeof i=="number"&&(t=t.oldValue,e?Mr(n,i,t):Lr(n,i))):Mt("unknown ChangedEvent.Remove modelChange: "+t.toString())):t.change!==Hl&&Mt("unknown ChangedEvent: "+t.toString())},ii.prototype.Ea=function(t){return this.undoManager.Ea(t)},ii.prototype.eb=function(t){return this.undoManager.eb(t)},ii.prototype.Kf=function(){return this.undoManager.Kf()},ii.prototype.commit=function(t,e){e===void 0&&(e="");var i=this.skipsUndoManager;e===null&&(this.skipsUndoManager=!0,e=""),this.undoManager.Ea(e);var n=!1;try{t(this),n=!0}finally{n?this.undoManager.eb(e):this.undoManager.Kf(),this.skipsUndoManager=i}},L=ii.prototype,L.La=function(t,e){e===void 0&&(e=""),pl(this,"SourceChanged",Hl,e,t,null,null)},L.wa=function(t){if(t!==null){var e=this.Th;if(e!==""&&(e=Ra(t,e),e!==void 0)){if(Ep(e))return e;Mt("Key value for node data "+t+" is not a number or a string: "+e)}}},L.km=function(t,e){if(t!==null){var i=this.Th;if(i!=="")if(this.lb(t)){var n=Ra(t,i);n!==e&&this.hc(e)===null&&(cs(t,i,e),n!==void 0&&this.kb.remove(n),this.kb.add(e,t),pl(this,"nodeKey",us,i,t,n,e),typeof i=="string"&&this.La(t,i),this.jp(n,e))}else cs(t,i,e)}};function Ep(t){return typeof t=="number"||typeof t=="string"}L.lb=function(t){var e=this.wa(t);return e===void 0?!1:this.kb.I(e)===t},L.hc=function(t){return t===null&&Mt("Model.findNodeDataForKey:key must not be null"),t!==void 0&&Ep(t)?this.kb.I(t):null},L.$u=function(t){if(t!==null){var e=this.Th;if(e!==""){var i=this.wa(t);if(i===void 0||this.kb.contains(i)){var n=this.bl;if(n!==null&&(i=n(this,t),i!=null&&!this.kb.contains(i))){cs(t,e,i);return}if(typeof i=="string"){for(n=2;this.kb.contains(i+n);)n++;cs(t,e,i+n)}else if(i===void 0||typeof i=="number"){for(i=-this.kb.count-1;this.kb.contains(i);)i--;cs(t,e,i)}}}}},L.xf=function(t){t!==null&&(Co(t),this.lb(t)||vv(this,t,!0))};function vv(t,e,i){var n=t.wa(e);(n===void 0||t.kb.I(n)!==e)&&(t.$u(e),n=t.wa(e),n===void 0&&Mt("Model.makeNodeDataKeyUnique failed on "+e+". Data not added to Model."),t.kb.add(n,e),n=null,i&&(n=t.Tc.length,Mr(t.Tc,n,e)),pl(t,"nodeDataArray",qs,"nodeDataArray",t,null,e,null,n),t.fm(e),t.em(e))}L.Fy=function(t){if(ui(t))for(var e=t.length,i=0;i<e;i++)this.xf(t[i]);else for(t=t.iterator;t.next();)this.xf(t.value)},L.cm=function(t){t!==null&&c0(this,t,!0)};function c0(t,e,i){var n=t.wa(e);if(n!==void 0&&t.kb.remove(n),n=null,i){t:if(i=t.Tc,Array.isArray(i))n=i.indexOf(e);else{n=i.length;for(var s=0;s<n;s++)if(i[s]===e){n=s;break t}n=-1}if(0>n)return;Lr(t.Tc,n)}pl(t,"nodeDataArray",aa,"nodeDataArray",t,e,null,n,null),t.qp(e)}L.nA=function(t){if(ui(t))for(var e=t.length,i=0;i<e;i++)this.cm(t[i]);else for(t=t.iterator;t.next();)this.cm(t.value)},L.$z=function(t){if(t!==this.nodeDataArray&&ui(t)){var e=this.kl;e.clear(),e.addAll(this.kb.iteratorKeys);var i=this.il;i.clear();for(var n=t.length,s=0;s<n;s++){var a=t[s],l=this.wa(a);if(l!==void 0){i.add(l);var c=this.hc(l);c!==a&&(c!==null?(this.Do(c,a),this.lm(a,c)):(a=this.cloneDeep(a),this.km(a,l),this.xf(a)))}else l=this.cloneDeep(a),this.xf(l),i.add(this.wa(l))}for(t=e.iterator;t.next();)n=t.value,i.contains(n)||(n=this.hc(n))&&this.cm(n);e.clear(),i.clear()}},L.jp=function(t,e){e!==void 0&&(t=tg(this,t),t instanceof te&&this.Vf.add(e,t))},L.Lv=function(){},L.fm=function(){},L.em=function(){},L.qp=function(){};function af(t,e,i){if(e!==void 0){var n=t.Vf.I(e);n===null&&(n=new te,t.Vf.add(e,n)),n.add(i)}}function Dc(t,e,i){if(e!==void 0){var n=t.Vf.I(e);n instanceof te&&(i==null?t.Vf.remove(e):(n.remove(i),n.count===0&&t.Vf.remove(e)))}}function tg(t,e){return e===void 0?null:(t=t.Vf.I(e),t instanceof te?t:null)}L.Qy=function(t){t===void 0?this.Vf.clear():this.Vf.remove(t)},ii.prototype.copyNodeData=function(t){if(t===null)return null;var e=this.Bk;return t=e!==null?e(t,this):sm(this,t,!0),Qt(t)&&Do(t),t};function sm(t,e,i){if(t.copiesArrays&&Array.isArray(e)){var n=[];for(i=0;i<e.length;i++){var s=sm(t,e[i],t.copiesArrayObjects);n.push(s)}return Do(n),n}if(i&&Qt(e)){i=(i=e.constructor)?new i:{},s=t.copiesKey||typeof t.nodeKeyProperty!="string"?null:t.nodeKeyProperty;for(n in e)if(n==="__gohashid")i.__gohashid=void 0;else if(n===s)i[s]=void 0;else{var a=Ra(e,n),l=f0(t,a);l==="GraphObject"||l==="Diagram"||l==="Layer"||l==="RowColumnDefinition"||l==="AnimationManager"||l==="Tool"||l==="CommandHandler"||l==="Layout"||l==="InputEvent"||l==="DiagramEvent"||a instanceof ii||a instanceof ms||a instanceof Ga||a instanceof mo||(a=sm(t,a,!1)),cs(i,n,a)}return Do(i),i}return e instanceof G||e instanceof fe||e instanceof Tt||e instanceof di||e instanceof Ai?e.copy():e}ii.prototype.setDataProperty=function(t,e,i){if(this.lb(t)){if(e===this.nodeKeyProperty){this.km(t,i);return}if(e===this.nodeCategoryProperty){this.jm(t,i);return}}else!Ty&&t instanceof pt&&(Ty=!0,_i('Model.setDataProperty is modifying a GraphObject, "'+t.toString()+'"'),_i(" Is that really your intent?"));var n=Ra(t,e);n!==i&&(cs(t,e,i),this.Fs(t,e,n,i))},L=ii.prototype,L.set=function(t,e,i){this.setDataProperty(t,e,i)},L.Do=function(t,e){if(e){var i=this.lb(t),n;for(n in e)n==="__gohashid"||i&&n===this.nodeKeyProperty||this.setDataProperty(t,n,e[n])}},L.Ay=function(t,e){this.ts(t,-1,e)},L.ts=function(t,e,i){0>e&&(e=t.length),Mr(t,e,i),pl(this,"",qs,"",t,null,i,null,e)},L.ov=function(t,e){e===void 0&&(e=-1),t===this.Tc&&Mt("Model.removeArrayItem should not be called on the Model.nodeDataArray"),e===-1&&(e=t.length-1);var i=t[e];Lr(t,e),pl(this,"",aa,"",t,i,null,e,null)},L.Ro=function(t){if(t===null)return"";var e=this.lj;if(e===""||(e=Ra(t,e),e===void 0))return"";if(typeof e=="string")return e;Mt("getCategoryForNodeData found a non-string category for "+t+": "+e)},L.jm=function(t,e){if(t!==null){var i=this.lj;if(i!=="")if(this.lb(t)){var n=Ra(t,i);n===void 0&&(n=""),n!==e&&(cs(t,i,e),pl(this,"nodeCategory",us,i,t,n,e))}else cs(t,i,e)}},L.lm=function(t,e){this.jm(e,this.Ro(t))},L.Tl=function(){return!1},L.Wj=function(){return!1},L.ri=function(){return!1},L.xs=function(){return!1},L.Xj=function(){return!1};function eg(){return new ii}function f0(t,e){if(typeof e=="function"){if(e.className)return e.className;if(e.name)return e.name}else if(typeof e=="object"&&e!==null&&e.constructor)return f0(t,e.constructor);return typeof e}function yv(t){return Hc[t]?Hc[t]:Kt.go!==void 0&&Kt.go[t]?Kt.go[t]:null}function Ra(t,e){if(!t||!e)return null;try{if(typeof e=="function")var i=e(t);else typeof t.getAttribute=="function"?(i=t.getAttribute(e),i===null&&(i=void 0)):i=t[e]}catch(n){}return i}function cs(t,e,i){if(t&&e)try{typeof e=="function"?e(t,i):typeof t.setAttribute=="function"?t.setAttribute(e,i):t[e]=i}catch(n){}}St.Object.defineProperties(ii.prototype,{name:{get:function(){return this.xa},set:function(t){var e=this.xa;e!==t&&(this.xa=t,this.g("name",e,t))}},dataFormat:{get:function(){return this.Sm},set:function(t){var e=this.Sm;e!==t&&(this.Sm=t,this.g("dataFormat",e,t))}},isReadOnly:{get:function(){return this.Gg},set:function(t){var e=this.Gg;e!==t&&(this.Gg=t,this.g("isReadOnly",e,t))}},modelData:{get:function(){return this.j},set:function(t){var e=this.j;e!==t&&(this.j=t,this.g("modelData",e,t),this.La(t))}},undoManager:{get:function(){return this.o},set:function(t){var e=this.o;e!==t&&(e!==null&&e.Rx(this),this.o=t,t!==null&&t.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(t){this.Wg=t}},nodeKeyProperty:{get:function(){return this.Th},set:function(t){var e=this.Th;e!==t&&(t===""&&Mt("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&Mt("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Th=t,this.g("nodeKeyProperty",e,t))}},makeUniqueKeyFunction:{get:function(){return this.bl},set:function(t){var e=this.bl;e!==t&&(this.bl=t,this.g("makeUniqueKeyFunction",e,t))}},nodeDataArray:{get:function(){return this.Tc},set:function(t){var e=this.Tc;if(e!==t){this.kb.clear(),this.Lv();for(var i=t.length,n=0;n<i;n++){var s=t[n];Qt(s)||Mt("Model.nodeDataArray must only contain Objects, not: "+s),Co(s)}for(this.Tc=t,n=new ue,s=0;s<i;s++){var a=t[s],l=this.wa(a);l===void 0||this.kb.I(l)!==null?n.add(a):this.kb.add(l,a)}for(n=n.iterator;n.next();)s=n.value,this.$u(s),a=this.wa(s),a!==void 0&&this.kb.add(a,s);for(pl(this,"nodeDataArray",us,"nodeDataArray",this,e,t),e=0;e<i;e++)n=t[e],this.fm(n),this.em(n);Array.isArray(t)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{get:function(){return this.Bk},set:function(t){var e=this.Bk;e!==t&&(this.Bk=t,this.g("copyNodeDataFunction",e,t))}},copiesArrays:{get:function(){return this.Km},set:function(t){var e=this.Km;e!==t&&(this.Km=t,this.g("copiesArrays",e,t))}},copiesArrayObjects:{get:function(){return this.Jm},set:function(t){var e=this.Jm;e!==t&&(this.Jm=t,this.g("copiesArrayObjects",e,t))}},copiesKey:{get:function(){return this.Mm},set:function(t){var e=this.Mm;e!==t&&(this.Mm=t,this.g("copiesKey",e,t))}},afterCopyFunction:{get:function(){return this.xm},set:function(t){var e=this.xm;e!==t&&(this.xm=t,this.g("afterCopyFunction",e,t))}},nodeCategoryProperty:{get:function(){return this.lj},set:function(t){var e=this.lj;e!==t&&(this.lj=t,this.g("nodeCategoryProperty",e,t))}},type:{get:function(){return"Model"}}}),ii.prototype.setCategoryForNodeData=ii.prototype.jm,ii.prototype.getCategoryForNodeData=ii.prototype.Ro,ii.prototype.removeArrayItem=ii.prototype.ov,ii.prototype.insertArrayItem=ii.prototype.ts,ii.prototype.addArrayItem=ii.prototype.Ay,ii.prototype.assignAllDataProperties=ii.prototype.Do,ii.prototype.set=ii.prototype.set,ii.prototype.clearUnresolvedReferences=ii.prototype.Qy,ii.prototype.mergeNodeDataArray=ii.prototype.$z,ii.prototype.removeNodeDataCollection=ii.prototype.nA,ii.prototype.removeNodeData=ii.prototype.cm,ii.prototype.addNodeDataCollection=ii.prototype.Fy,ii.prototype.addNodeData=ii.prototype.xf,ii.prototype.makeNodeDataKeyUnique=ii.prototype.$u,ii.prototype.findNodeDataForKey=ii.prototype.hc,ii.prototype.containsNodeData=ii.prototype.lb,ii.prototype.setKeyForNodeData=ii.prototype.km,ii.prototype.getKeyForNodeData=ii.prototype.wa,ii.prototype.updateTargetBindings=ii.prototype.La,ii.prototype.commit=ii.prototype.commit,ii.prototype.rollbackTransaction=ii.prototype.Kf,ii.prototype.commitTransaction=ii.prototype.eb,ii.prototype.startTransaction=ii.prototype.Ea,ii.prototype.raiseDataChanged=ii.prototype.Fs,ii.prototype.raiseChanged=ii.prototype.g,ii.prototype.raiseChangedEvent=ii.prototype.cb,ii.prototype.removeChangedListener=ii.prototype.ik,ii.prototype.addChangedListener=ii.prototype.Pe,ii.prototype.writeJsonValue=ii.prototype.sm,ii.prototype.replaceJsonObjects=ii.prototype.dm,ii.prototype.applyIncrementalJSON=ii.prototype.Ky,ii.prototype.applyIncrementalJson=ii.prototype.Zw,ii.prototype.toJSON=ii.prototype.toJSON,ii.prototype.toJson=ii.prototype.np,ii.prototype.toIncrementalJSON=ii.prototype.yA,ii.prototype.toIncrementalJson=ii.prototype.$x,ii.prototype.toIncrementalData=ii.prototype.xA,ii.prototype.clear=ii.prototype.clear;var Ty=!1,Hc={};ii.className="Model",ii.fromJSON=ii.fromJson=function(t,e){e===void 0&&(e=null);var i=null;if(typeof t=="string")try{i=Kt.JSON.parse(t)}catch(a){}else typeof t=="object"?i=t:Mt("Unable to construct a Model from: "+t);if(e===null){t=null;var n=i.class;if(typeof n=="string")try{var s=null;n.indexOf("go.")===0?(n=n.substr(3),s=yv(n)):(s=yv(n),s===null&&(s=Kt[n])),typeof s=="function"&&(t=new s)}catch(a){}t===null||t instanceof ii?e=t:Mt("Unable to construct a Model of declared class: "+i.class)}return e===null&&(e=ii.constructGraphLinksModel()),e.gp(i),e.kv(i),e},ii.safePropertyValue=Ra,ii.safePropertySet=cs,Hc.Brush=Br,Hc.ChangedEvent=mo,Hc.Geometry=ve,Hc.Margin=Ai,Hc.Panel=ce,Hc.Point=G,Hc.Rect=Tt,Hc.Size=fe,Hc.Spot=di,Hc.Transaction=Ga,Hc.UndoManager=ms;function lo(t,e,i,n){Do(this),this._isFrozen=!1,t===void 0&&(t=""),e===void 0&&(e=t),i===void 0&&(i=null),this.j=-1,this.xd=null,this.xl=t,this.wl=this.to=0,this.Cr=null,this.wn=!1,this.sl=e,this.Im=i,n===void 0?(this.el=L1,this.wk=null):(this.el=ig,this.wk=n),this.st=new te}lo.prototype.copy=function(){var t=new lo;return t.xl=this.xl,t.to=this.to,t.wl=this.wl,t.Cr=this.Cr,t.wn=this.wn,t.sl=this.sl,t.Im=this.Im,t.el=this.el,t.wk=this.wk,t},L=lo.prototype,L.qb=function(t){t.classType===lo&&(this.mode=t)},L.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},L.freeze=function(){return this._isFrozen=!0,this},L.ka=function(){return this._isFrozen=!1,this},L.Kx=function(t){return t===void 0&&(t=null),this.mode=ig,this.backConverter=t,this},L.cp=function(t){return t===void 0&&(t=""),this.sourceName=t,this.isToModel=!1,this},L.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function _y(t,e,i){return t=t.sourceName,t===null||t===""?e:t==="/"?i.part:t==="."?i:t===".."?i.panel:e.fb(t)}L.Mv=function(t,e,i){var n=this.sl;if(i===void 0||n===""||n===i){i=this.xl;var s=this.Im;if(s===null&&i==="")_i("Binding error: target property is the empty string: "+this.toString());else{var a=e;if(n!==""&&(a=Ra(e,n)),a!==void 0)if(s===null)i!==""&&cs(t,i,a);else try{if(i!==""){var l=s(a,t);cs(t,i,l)}else s(a,t)}catch(c){}}}},L.sp=function(t,e,i,n){if(this.el===ig){var s=this.xl;if(i===void 0||s===i){i=this.sl;var a=this.wk,l=t;if(s!==""&&(l=Ra(t,s)),l!==void 0&&!this.st.contains(t))try{this.st.add(t);var c=n!==null?n.diagram:null,p=c!==null?c.model:null;if(a===null){if(i!=="")p!==null?p.setDataProperty(e,i,l):cs(e,i,l);else if(p!==null&&n!==null&&0<=n.itemIndex&&n.panel!==null&&Array.isArray(n.panel.itemArray)){var m=n.itemIndex,v=n.panel.itemArray;p.ov(v,m),p.ts(v,m,l)}}else try{if(i!==""){var w=a(l,e,p);p!==null?p.setDataProperty(e,i,w):cs(e,i,w)}else{var C=a(l,e,p);if(C!==void 0&&p!==null&&n!==null&&0<=n.itemIndex&&n.panel!==null&&Array.isArray(n.panel.itemArray)){var k=n.itemIndex,T=n.panel.itemArray;p.ov(T,k),p.ts(T,k,C)}}}catch(A){}}finally{this.st.remove(t)}}}},St.Object.defineProperties(lo.prototype,{Ai:{get:function(){return this.j},set:function(t){this._isFrozen&&ie(this),this.j=t}},targetProperty:{get:function(){return this.xl},set:function(t){this._isFrozen&&ie(this),this.xl=t}},sourceName:{get:function(){return this.Cr},set:function(t){this._isFrozen&&ie(this),this.Cr=t,t!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(t){this._isFrozen&&ie(this),this.wn=t}},sourceProperty:{get:function(){return this.sl},set:function(t){this._isFrozen&&ie(this),this.sl=t}},converter:{get:function(){return this.Im},set:function(t){this._isFrozen&&ie(this),this.Im=t}},backConverter:{get:function(){return this.wk},set:function(t){this._isFrozen&&ie(this),this.wk=t}},mode:{get:function(){return this.el},set:function(t){this._isFrozen&&ie(this),this.el=t}}}),lo.prototype.updateSource=lo.prototype.sp,lo.prototype.updateTarget=lo.prototype.Mv,lo.prototype.ofModel=lo.prototype.dA,lo.prototype.ofObject=lo.prototype.cp,lo.prototype.makeTwoWay=lo.prototype.Kx;var xx="Binding",L1=new he(lo,"OneWay",1),ig=new he(lo,"TwoWay",2);lo.className="Binding",lo.parseEnum=function(t,e){return function(i){return i=ss(t,i),i===null?e:i}},lo.toString=zr,lo.OneWay=L1,lo.TwoWay=ig;function nr(t,e,i){ii.call(this),this.Vv=`,
|
|
|
"insertedLinkKeys": `,this.iy=`,
|
|
|
"modifiedLinkData": `,this.Xv=`,
|
|
|
"removedLinkKeys": `,this.md=[],this.$f=new te,this.wb=new ci,this.Jh="",this.Ri=this.Ak=this.cl=null,this.lf="from",this.mf="to",this.fj=this.ej="",this.dj="category",this.je="",this.jl="isGroup",this.Je="group",this.Lm=!1,e!==void 0&&(this.linkDataArray=e),t!==void 0&&(ui(t)?this.nodeDataArray=t:i=t),i&&(Object.assign(this,i),t=i.Changed)&&(delete this.Changed,this.Pe(t))}li(nr,ii),nr.constructGraphLinksModel=ii.constructGraphLinksModel,nr.prototype.cloneProtected=function(t){ii.prototype.cloneProtected.call(this,t),t.Jh=this.Jh,t.cl=this.cl,t.Ak=this.Ak,t.lf=this.lf,t.mf=this.mf,t.ej=this.ej,t.fj=this.fj,t.dj=this.dj,t.je=this.je,t.jl=this.jl,t.Je=this.Je,t.Lm=this.Lm},L=nr.prototype,L.clear=function(){ii.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},L.toString=function(t){if(t===void 0&&(t=0),2<=t)return this.np();var e=(this.name!==""?this.name:"")+" GraphLinksModel";if(0<t){e+=`
|
|
|
node data:`,t=this.nodeDataArray;var i=t.length,n;for(n=0;n<i;n++){var s=t[n];e+=" "+this.wa(s)+":"+zr(s)}for(e+=`
|
|
|
link data:`,t=this.linkDataArray,i=t.length,n=0;n<i;n++)s=t[n],e+=" "+Jh(this,s,!0)+"-->"+Jh(this,s,!1)}return e},L.Qv=function(t,e){this.linkKeyProperty===""&&Mt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var i=ii.prototype.Qv.call(this,t,e),n=this,s=new te,a=new te,l=new te,c=this.vh;t.changes.each(function(v){v.model===n&&(v.modelChange==="linkDataArray"?v.change===qs?s.add(v.newValue):v.change===aa&&l.add(v.oldValue):n.Jc(v.object)?a.add(v.object):v.object!==null&&(v.object!==null&&c&&c.contains(v.object)?c.get(v.object).each(function(w){n.Jc(w)&&a.add(w)}):v.object instanceof ii||n.lb(v.object)||T1(n,v.object).each(function(w){a.add(w)})))});var p=this.il;p.clear(),s.each(function(v){p.add(n.Ac(v)),e||a.add(v)});var m=this.kl;return m.clear(),l.each(function(v){m.add(n.Ac(v)),e&&a.add(v)}),t=n.cloneDeep(a.Fa()),0<p.count&&(i===null&&(i={}),e?i.removedLinkKeys=p.Fa():i.insertedLinkKeys=p.Fa()),0<t.length&&(i===null&&(i={}),i.modifiedLinkData=t),0<m.count&&(i===null&&(i={}),e?i.insertedLinkKeys=m.Fa():i.removedLinkKeys=m.Fa()),m.clear(),p.clear(),i},L.rm=function(){var t=ii.prototype.rm.call(this),e="";return this.linkCategoryProperty!=="category"&&typeof this.linkCategoryProperty=="string"&&(e+=`,
|
|
|
"linkCategoryProperty": `+this.quote(this.linkCategoryProperty)),this.linkKeyProperty!==""&&typeof this.linkKeyProperty=="string"&&(e+=`,
|
|
|
"linkKeyProperty": `+this.quote(this.linkKeyProperty)),this.linkFromKeyProperty!=="from"&&typeof this.linkFromKeyProperty=="string"&&(e+=`,
|
|
|
"linkFromKeyProperty": `+this.quote(this.linkFromKeyProperty)),this.linkToKeyProperty!=="to"&&typeof this.linkToKeyProperty=="string"&&(e+=`,
|
|
|
"linkToKeyProperty": `+this.quote(this.linkToKeyProperty)),this.linkFromPortIdProperty!==""&&typeof this.linkFromPortIdProperty=="string"&&(e+=`,
|
|
|
"linkFromPortIdProperty": `+this.quote(this.linkFromPortIdProperty)),this.linkToPortIdProperty!==""&&typeof this.linkToPortIdProperty=="string"&&(e+=`,
|
|
|
"linkToPortIdProperty": `+this.quote(this.linkToPortIdProperty)),this.linkLabelKeysProperty!==""&&typeof this.linkLabelKeysProperty=="string"&&(e+=`,
|
|
|
"linkLabelKeysProperty": `+this.quote(this.linkLabelKeysProperty)),this.nodeIsGroupProperty!=="isGroup"&&typeof this.nodeIsGroupProperty=="string"&&(e+=`,
|
|
|
"nodeIsGroupProperty": `+this.quote(this.nodeIsGroupProperty)),this.nodeGroupKeyProperty!=="group"&&typeof this.nodeGroupKeyProperty=="string"&&(e+=`,
|
|
|
"nodeGroupKeyProperty": `+this.quote(this.nodeGroupKeyProperty)),t+e},L.gp=function(t){ii.prototype.gp.call(this,t),t.linkKeyProperty&&(this.linkKeyProperty=t.linkKeyProperty),t.linkFromKeyProperty&&(this.linkFromKeyProperty=t.linkFromKeyProperty),t.linkToKeyProperty&&(this.linkToKeyProperty=t.linkToKeyProperty),t.linkFromPortIdProperty&&(this.linkFromPortIdProperty=t.linkFromPortIdProperty),t.linkToPortIdProperty&&(this.linkToPortIdProperty=t.linkToPortIdProperty),t.linkCategoryProperty&&(this.linkCategoryProperty=t.linkCategoryProperty),t.linkLabelKeysProperty&&(this.linkLabelKeysProperty=t.linkLabelKeysProperty),t.nodeIsGroupProperty&&(this.nodeIsGroupProperty=t.nodeIsGroupProperty),t.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=t.nodeGroupKeyProperty)},L.Rv=function(){var t=ii.prototype.Rv.call(this),e=`,
|
|
|
"linkDataArray": `+tu(this,this.linkDataArray,!0);return t+e},L.kv=function(t){ii.prototype.kv.call(this,t),t=t.linkDataArray,Array.isArray(t)&&(this.dm(t),this.linkDataArray=t)};function T1(t,e){for(var i=new te,n=0;n<t.linkDataArray.length;n++){var s=t.linkDataArray[n];gv(t,e,s,s,i)}return i}L.Pv=function(t,e){this.linkKeyProperty===""&&Mt("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var i=ii.prototype.Pv.call(this,t,e),n=this,s=new te,a=new te,l=new te,c=this.vh;t.changes.each(function(v){v.model===n&&(v.modelChange==="linkDataArray"?v.change===qs?s.add(v.newValue):v.change===aa&&l.add(v.oldValue):n.Jc(v.object)?a.add(v.object):v.object!==null&&(v.object!==null&&c&&c.contains(v.object)?c.get(v.object).each(function(w){n.Jc(w)&&a.add(w)}):v.object instanceof ii||n.lb(v.object)||T1(n,v.object).each(function(w){a.add(w)})))});var p=this.il;p.clear(),s.each(function(v){p.add(n.Ac(v)),e||a.add(v)});var m=this.kl;return m.clear(),l.each(function(v){m.add(n.Ac(v)),e&&a.add(v)}),t=i,0<p.count&&(t+=(e?this.Xv:this.Vv)+tu(this,p.Fa(),!0)),0<a.count&&(t+=this.iy+tu(this,a.Fa(),!0)),0<m.count&&(t+=(e?this.Vv:this.Xv)+tu(this,m.Fa(),!0)),m.clear(),p.clear(),t},L.fp=function(t){(t.linkCategoryProperty!==void 0&&t.linkCategoryProperty!==this.linkCategoryProperty||t.linkKeyProperty!==void 0&&t.linkKeyProperty!==this.linkKeyProperty||t.linkFromKeyProperty!==void 0&&t.linkFromKeyProperty!==this.linkFromKeyProperty||t.linkToKeyProperty!==void 0&&t.linkToKeyProperty!==this.linkToKeyProperty||t.linkFromPortIdProperty!==void 0&&t.linkFromPortIdProperty!==this.linkFromPortIdProperty||t.linkToPortIdProperty!==void 0&&t.linkToPortIdProperty!==this.linkToPortIdProperty||t.linkLabelKeysProperty!==void 0&&t.linkLabelKeysProperty!==this.linkLabelKeysProperty||t.nodeIsGroupProperty!==void 0&&t.nodeIsGroupProperty!==this.nodeIsGroupProperty||t.nodeGroupKeyProperty!==void 0&&t.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&Mt("applyIncrementalJson cannot change Model properties"),ii.prototype.fp.call(this,t);var e=t.insertedLinkKeys;if(Array.isArray(e))for(var i=e.length,n=0;n<i;n++){var s=e[n],a=this.jh(s);a===null&&(a=this.Jo({}),this.Ks(a,s),this.fi(a))}if(e=t.modifiedLinkData,Array.isArray(e)){for(i=e.length,n=0;n<i;n++)if(s=e[n],a=this.Ac(s),a=this.jh(a),a!==null){for(var l in s)l!=="__gohashid"&&l!==this.linkKeyProperty&&this.setDataProperty(a,l,s[l]);P1(this,s,a)}}if(t=t.removedLinkKeys,Array.isArray(t))for(l=t.length,e=0;e<l;e++)i=this.jh(t[e]),i!==null&&this.bm(i)},nr.prototype.changeState=function(t,e){if(t!==null&&t.model===this){if(t.change===us){var i=t.object,n=t.propertyName;if(n===this.linkKeyProperty&&this.Jc(i)){var s=t.I(e);e=t.I(!e),e!==void 0&&this.wb.remove(e),s!==void 0&&this.wb.add(s,i),cs(i,n,s);return}}else if(t.change===qs){if(i=t.newParam,t.modelChange==="linkDataArray"){t=t.newValue,Qt(t)&&typeof i=="number"&&(n=this.Ac(t),e?(this.$f.remove(t),this.md[i]===t&&this.md.splice(i,1),n!==void 0&&this.wb.remove(n)):(this.$f.add(t),this.md[i]!==t&&this.md.splice(i,0,t),n!==void 0&&this.wb.add(n,t)));return}if(t.modelChange==="linkLabelKeys"){n=this.Ef(t.object),Array.isArray(n)&&typeof i=="number"&&(e?(i=n.indexOf(t.newValue),0<=i&&n.splice(i,1)):0>n.indexOf(t.newValue)&&n.splice(i,0,t.newValue));return}}else if(t.change===aa){if(i=t.oldParam,t.modelChange==="linkDataArray"){t=t.oldValue,Qt(t)&&typeof i=="number"&&(n=this.Ac(t),e?(this.$f.add(t),this.md[i]!==t&&this.md.splice(i,0,t),n!==void 0&&this.wb.add(n,t)):(this.$f.remove(t),this.md[i]===t&&this.md.splice(i,1),n!==void 0&&this.wb.remove(n)));return}if(t.modelChange==="linkLabelKeys"){n=this.Ef(t.object),Array.isArray(n)&&typeof i=="number"&&(e?0>n.indexOf(t.newValue)&&n.splice(i,0,t.newValue):(i=n.indexOf(t.newValue),0<=i&&n.splice(i,1)));return}}ii.prototype.changeState.call(this,t,e)}},L=nr.prototype,L.Vl=function(t){if(t!==void 0){var e=this.Ri;if(e!==null){var i=this.hc(t);i===null&&(i=this.copyNodeData(e),cs(i,this.nodeKeyProperty,t),this.xf(i))}return t}},L.yx=function(t){return Jh(this,t,!0)},L.wv=function(t,e){am(this,t,e,!0)},L.Bx=function(t){return Jh(this,t,!1)},L.Bv=function(t,e){am(this,t,e,!1)};function Jh(t,e,i){if(e!==null&&(t=i?t.lf:t.mf,t!==""&&(t=Ra(e,t),t!==void 0))){if(Ep(t))return t;Mt((i?"FromKey":"ToKey")+" value for link data "+e+" is not a number or a string: "+t)}}function am(t,e,i,n){if(i===null&&(i=void 0),e!==null){var s=n?t.lf:t.mf;if(s!=="")if(i=t.Vl(i),t.Jc(e)){var a=Ra(e,s);a!==i&&(Dc(t,a,e),cs(e,s,i),t.hc(i)===null&&af(t,i,e),pl(t,n?"linkFromKey":"linkToKey",us,s,e,a,i),typeof s=="string"&&t.La(e,s))}else cs(e,s,i)}}L.zx=function(t){return xv(this,t,!0)},L.xv=function(t,e){lm(this,t,e,!0)},L.Cx=function(t){return xv(this,t,!1)},L.Cv=function(t,e){lm(this,t,e,!1)};function xv(t,e,i){return e===null||(t=i?t.ej:t.fj,t==="")?"":(e=Ra(e,t),e===void 0?"":e)}function lm(t,e,i,n){if(e!==null){var s=n?t.ej:t.fj;if(s!=="")if(t.Jc(e)){var a=Ra(e,s);a===void 0&&(a=""),a!==i&&(cs(e,s,i),pl(t,n?"linkFromPortId":"linkToPortId",us,s,e,a,i),typeof s=="string"&&t.La(e,s))}else cs(e,s,i)}}L.Ef=function(t){if(t===null)return Tp;var e=this.je;return e===""?Tp:(t=Ra(t,e),t===void 0?Tp:t)},L.Ls=function(t,e){if(t!==null){var i=this.je;if(i!=="")if(this.Jc(t)){var n=Ra(t,i);if(n===void 0&&(n=Tp),n!==e){if(Array.isArray(n))for(var s=n.length,a=0;a<s;a++)Dc(this,n[a],t);for(cs(t,i,e),s=e.length,a=0;a<s;a++){var l=e[a];this.hc(l)===null&&af(this,l,t)}pl(this,"linkLabelKeys",us,i,t,n,e),typeof i=="string"&&this.La(t,i)}}else cs(t,i,e)}},L.Bu=function(t,e){if(e!=null&&t!==null){var i=this.je;if(i!==""){var n=Ra(t,i);if(n===void 0)i=[],i.push(e),this.Ls(t,i);else if(Array.isArray(n)){var s=n.indexOf(e);0<=s||(s=n.length,n.push(e),this.Jc(t)&&(this.hc(e)===null&&af(this,e,t),pl(this,"linkLabelKeys",qs,i,t,null,e,null,s)))}else Mt(i+" property is not an Array; cannot addLabelKeyForLinkData: "+t)}}},L.Qx=function(t,e){if(e!=null&&t!==null){var i=this.je;if(i!==""){var n=Ra(t,i);if(Array.isArray(n)){var s=n.indexOf(e);0>s||(n.splice(s,1),this.Jc(t)&&(Dc(this,e,t),pl(this,"linkLabelKeys",aa,i,t,e,null,s,null)))}else n!==void 0&&Mt(i+" property is not an Array; cannot removeLabelKeyforLinkData: "+t)}}},L.Ac=function(t){if(t!==null){var e=this.Jh;if(e!==""&&(e=Ra(t,e),e!==void 0)){if(Ep(e))return e;Mt("Key value for link data "+t+" is not a number or a string: "+e)}}},L.Ks=function(t,e){if(t!==null){var i=this.Jh;if(i!=="")if(this.Jc(t)){var n=Ra(t,i);n!==e&&this.jh(e)===null&&(cs(t,i,e),n!==void 0&&this.wb.remove(n),this.wb.add(e,t),pl(this,"linkKey",us,i,t,n,e),typeof i=="string"&&this.La(t,i))}else cs(t,i,e)}},L.jh=function(t){return t===null&&Mt("GraphLinksModel.findLinkDataForKey:key must not be null"),t!==void 0&&Ep(t)?this.wb.I(t):null},L.Bs=function(t){if(t!==null){var e=this.Jh;if(e!==""){var i=this.Ac(t);if(i===void 0||this.wb.contains(i)){var n=this.cl;if(n!==null&&(i=n(this,t),i!=null&&!this.wb.contains(i))){cs(t,e,i);return}if(typeof i=="string"){for(n=2;this.wb.contains(i+n);)n++;cs(t,e,i+n)}else if(i===void 0||typeof i=="number"){for(i=-this.wb.count-1;this.wb.contains(i);)i--;cs(t,e,i)}}}}},L.Jc=function(t){return t===null?!1:this.$f.contains(t)},L.fi=function(t){t!==null&&(Co(t),this.Jc(t)||_1(this,t,!0))};function _1(t,e,i){if(t.linkKeyProperty!==""){var n=t.Ac(e);if(n!==void 0&&t.wb.I(n)===e)return;t.Bs(e),n=t.Ac(e),n===void 0&&Mt("GraphLinksModel.makeLinkDataKeyUnique failed on "+e+". Data not added to model."),t.wb.add(n,e)}t.$f.add(e),n=null,i&&(n=t.md.length,t.md.splice(n,0,e)),pl(t,"linkDataArray",qs,"linkDataArray",t,null,e,null,n),Py(t,e)}L.Ey=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;i++)this.fi(t[i]);else for(t=t.iterator;t.next();)this.fi(t.value)},L.bm=function(t){t!==null&&Lp(this,t,!0)};function Lp(t,e,i){t.$f.remove(e);var n=t.Ac(e);if(n!==void 0&&t.wb.remove(n),n=null,i){if(n=t.md.indexOf(e),0>n)return;t.md.splice(n,1)}if(pl(t,"linkDataArray",aa,"linkDataArray",t,e,null,n,null),i=Jh(t,e,!0),Dc(t,i,e),i=Jh(t,e,!1),Dc(t,i,e),n=t.Ef(e),Array.isArray(n))for(var s=n.length,a=0;a<s;a++)i=n[a],Dc(t,i,e)}L.lA=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;i++)this.bm(t[i]);else for(t=t.iterator;t.next();)this.bm(t.value)},L.Zz=function(t){if(this.linkKeyProperty===""&&Mt("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),t!==this.linkDataArray&&ui(t)){var e=this.kl;e.clear(),e.addAll(this.wb.iteratorKeys);var i=this.il;i.clear();for(var n=t.length,s=0;s<n;s++){var a=t[s],l=this.Ac(a);if(l!==void 0){i.add(l);var c=this.jh(l);c!==a&&(c!==null?(this.Do(c,a),P1(this,a,c)):(a=this.cloneDeep(a),this.Ks(a,l),this.fi(a)))}else l=this.cloneDeep(a),this.fi(l),i.add(this.Ac(l))}for(t=e.iterator;t.next();)n=t.value,i.contains(n)||(n=this.jh(n))&&this.bm(n);e.clear(),i.clear()}};function Py(t,e){var i=Jh(t,e,!0);i=t.Vl(i),t.hc(i)===null&&af(t,i,e),i=Jh(t,e,!1),i=t.Vl(i),t.hc(i)===null&&af(t,i,e);var n=t.Ef(e);if(Array.isArray(n))for(var s=n.length,a=0;a<s;a++)i=n[a],t.hc(i)===null&&af(t,i,e)}L.Jo=function(t){if(t===null)return null;var e=this.Ak;return t=e!==null?e(t,this):sm(this,t,!0),Qt(t)&&(Do(t),this.lf!==""&&cs(t,this.lf,void 0),this.mf!==""&&cs(t,this.mf,void 0),this.je!==""&&cs(t,this.je,[])),t},L.Yu=function(t){if(t===null)return!1;var e=this.jl;return e===""?!1:!!Ra(t,e)},L.lh=function(t){if(t!==null){var e=this.Je;if(e!==""&&(e=Ra(t,e),e!==void 0)){if(Ep(e))return e;Mt("GroupKey value for node data "+t+" is not a number or a string: "+e)}}},L.mp=function(t,e){if(e===null&&(e=void 0),t!==null){var i=this.Je;if(i!=="")if(this.lb(t)){var n=Ra(t,i);n!==e&&(Dc(this,n,t),cs(t,i,e),this.hc(e)===null&&af(this,e,t),pl(this,"nodeGroupKey",us,i,t,n,e),typeof i=="string"&&this.La(t,i))}else cs(t,i,e)}},nr.prototype.copyNodeData=function(t){return t===null?null:(t=ii.prototype.copyNodeData.call(this,t),this.Ij||this.Je===""||Ra(t,this.Je)===void 0||cs(t,this.Je,void 0),t)},nr.prototype.setDataProperty=function(t,e,i){if(this.lb(t)){if(e===this.nodeKeyProperty){this.km(t,i);return}if(e===this.nodeCategoryProperty){this.jm(t,i);return}if(e===this.nodeGroupKeyProperty){this.mp(t,i);return}}else if(this.Jc(t)){if(e===this.linkFromKeyProperty){am(this,t,i,!0);return}if(e===this.linkToKeyProperty){am(this,t,i,!1);return}if(e===this.linkFromPortIdProperty){lm(this,t,i,!0);return}if(e===this.linkToPortIdProperty){lm(this,t,i,!1);return}if(e===this.linkKeyProperty){this.Ks(t,i);return}if(e===this.linkCategoryProperty){this.lp(t,i);return}if(e===this.linkLabelKeysProperty){this.Ls(t,i);return}}var n=Ra(t,e);n!==i&&(cs(t,e,i),this.Fs(t,e,n,i))},L=nr.prototype,L.Do=function(t,e){if(e){var i=this.lb(t),n=this.Jc(t),s;for(s in e)s==="__gohashid"||i&&s===this.nodeKeyProperty||i&&s===this.nodeIsGroupProperty&&Ra(t,s)===e[s]||n&&s===this.linkKeyProperty||this.setDataProperty(t,s,e[s])}},L.jp=function(t,e){ii.prototype.jp.call(this,t,e);for(var i=this.kb.iterator;i.next();)this.qv(i.value,t,e);for(i=this.$f.iterator;i.next();){var n=i.value,s=t,a=e;if(Jh(this,n,!0)===s){var l=this.lf;cs(n,l,a),pl(this,"linkFromKey",us,l,n,s,a),typeof l=="string"&&this.La(n,l)}if(Jh(this,n,!1)===s&&(l=this.mf,cs(n,l,a),pl(this,"linkToKey",us,l,n,s,a),typeof l=="string"&&this.La(n,l)),l=this.Ef(n),Array.isArray(l))for(var c=l.length,p=this.je,m=0;m<c;m++)l[m]===s&&(l[m]=a,pl(this,"linkLabelKeys",qs,p,n,s,a,m,m))}},L.qv=function(t,e,i){if(this.lh(t)===e){var n=this.Je;cs(t,n,i),pl(this,"nodeGroupKey",us,n,t,e,i),typeof n=="string"&&this.La(t,n)}},L.Lv=function(){ii.prototype.Lv.call(this);for(var t=this.linkDataArray,e=t.length,i=0;i<e;i++)Py(this,t[i])},L.fm=function(t){ii.prototype.fm.call(this,t),t=this.wa(t);var e=tg(this,t);if(e!==null){var i=gi();for(e=e.iterator;e.next();){var n=e.value;if(this.lb(n)){if(this.lh(n)===t){var s=this.Je;pl(this,"nodeGroupKey",us,s,n,t,t),typeof s=="string"&&this.La(n,s),i.push(n)}}else if(Jh(this,n,!0)===t&&(s=this.lf,pl(this,"linkFromKey",us,s,n,t,t),typeof s=="string"&&this.La(n,s),i.push(n)),Jh(this,n,!1)===t&&(s=this.mf,pl(this,"linkToKey",us,s,n,t,t),typeof s=="string"&&this.La(n,s),i.push(n)),s=this.Ef(n),Array.isArray(s))for(var a=s.length,l=this.je,c=0;c<a;c++)s[c]===t&&(pl(this,"linkLabelKeys",qs,l,n,t,t,c,c),i.push(n))}for(e=0;e<i.length;e++)Dc(this,t,i[e]);Ji(i)}},L.em=function(t){ii.prototype.em.call(this,t);var e=this.lh(t);this.hc(e)===null&&af(this,e,t)},L.qp=function(t){ii.prototype.qp.call(this,t);var e=this.lh(t);Dc(this,e,t)},L.ps=function(t){if(t===null)return"";var e=this.dj;if(e===""||(e=Ra(t,e),e===void 0))return"";if(typeof e=="string")return e;Mt("getCategoryForLinkData found a non-string category for "+t+": "+e)},nr.prototype.getLinkCategoryForData=function(t){return this.ps(t)},nr.prototype.lp=function(t,e){if(t!==null){var i=this.dj;if(i!=="")if(this.Jc(t)){var n=Ra(t,i);n===void 0&&(n=""),n!==e&&(cs(t,i,e),pl(this,"linkCategory",us,i,t,n,e),typeof i=="string"&&this.La(t,i))}else cs(t,i,e)}},nr.prototype.setLinkCategoryForData=function(t,e){this.lp(t,e)},L=nr.prototype,L.lm=function(t,e){ii.prototype.lm.call(this,t,e),this.mp(e,this.lh(t))};function P1(t,e,i){t.lp(i,t.ps(e)),t.wv(i,t.yx(e)),t.Bv(i,t.Bx(e)),t.Ls(i,t.Ef(e)),t.xv(i,t.zx(e)),t.Cv(i,t.Cx(e))}L.Wj=function(){return!0},L.ri=function(){return!0},L.xs=function(){return!0},L.Xj=function(){return!0},St.Object.defineProperties(nr.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(t){var e=this.Ri;e!==t&&(this.Ri=t,this.g("archetypeNodeData",e,t))}},linkFromKeyProperty:{get:function(){return this.lf},set:function(t){var e=this.lf;e!==t&&(this.lf=t,this.g("linkFromKeyProperty",e,t))}},linkToKeyProperty:{get:function(){return this.mf},set:function(t){var e=this.mf;e!==t&&(this.mf=t,this.g("linkToKeyProperty",e,t))}},linkFromPortIdProperty:{get:function(){return this.ej},set:function(t){var e=this.ej;e!==t&&(this.ej=t,this.g("linkFromPortIdProperty",e,t))}},linkToPortIdProperty:{get:function(){return this.fj},set:function(t){var e=this.fj;e!==t&&(this.fj=t,this.g("linkToPortIdProperty",e,t))}},linkLabelKeysProperty:{get:function(){return this.je},set:function(t){var e=this.je;e!==t&&(this.je=t,this.g("linkLabelKeysProperty",e,t))}},linkDataArray:{get:function(){return this.md},set:function(t){var e=this.md;if(e!==t){this.wb.clear();for(var i=t.length,n=0;n<i;n++){var s=t[n];Qt(s)||Mt("GraphLinksModel.linkDataArray must only contain Objects, not: "+s),Co(s)}if(this.md=t,this.linkKeyProperty!==""){for(n=new ue,s=0;s<i;s++){var a=t[s],l=this.Ac(a);l===void 0||this.wb.I(l)!==null?n.add(a):this.wb.add(l,a)}for(n=n.iterator;n.next();)s=n.value,this.Bs(s),a=this.Ac(s),a!==void 0&&this.wb.add(a,s)}for(n=new te,s=0;s<i;s++)n.add(t[s]);for(this.$f=n,pl(this,"linkDataArray",us,"linkDataArray",this,e,t),e=0;e<i;e++)Py(this,t[e])}}},linkKeyProperty:{get:function(){return this.Jh},set:function(t){var e=this.Jh;if(e!==t){this.Jh=t,this.wb.clear();for(var i=this.linkDataArray.length,n=0;n<i;n++){var s=this.linkDataArray[n],a=this.Ac(s);a===void 0&&(this.Bs(s),a=this.Ac(s)),a!==void 0&&this.wb.add(a,s)}this.g("linkKeyProperty",e,t)}}},makeUniqueLinkKeyFunction:{get:function(){return this.cl},set:function(t){var e=this.cl;e!==t&&(this.cl=t,this.g("makeUniqueLinkKeyFunction",e,t))}},copyLinkDataFunction:{get:function(){return this.Ak},set:function(t){var e=this.Ak;e!==t&&(this.Ak=t,this.g("copyLinkDataFunction",e,t))}},nodeIsGroupProperty:{get:function(){return this.jl},set:function(t){var e=this.jl;e!==t&&(this.jl=t,this.g("nodeIsGroupProperty",e,t))}},nodeGroupKeyProperty:{get:function(){return this.Je},set:function(t){var e=this.Je;e!==t&&(this.Je=t,this.g("nodeGroupKeyProperty",e,t))}},Ij:{get:function(){return this.Lm},set:function(t){this.Lm!==t&&(this.Lm=t)}},linkCategoryProperty:{get:function(){return this.dj},set:function(t){var e=this.dj;e!==t&&(this.dj=t,this.g("linkCategoryProperty",e,t))}},type:{get:function(){return"GraphLinksModel"}}}),nr.prototype.setCategoryForLinkData=nr.prototype.lp,nr.prototype.getCategoryForLinkData=nr.prototype.ps,nr.prototype.assignAllDataProperties=nr.prototype.Do,nr.prototype.setGroupKeyForNodeData=nr.prototype.mp,nr.prototype.getGroupKeyForNodeData=nr.prototype.lh,nr.prototype.isGroupForNodeData=nr.prototype.Yu,nr.prototype.copyLinkData=nr.prototype.Jo,nr.prototype.mergeLinkDataArray=nr.prototype.Zz,nr.prototype.removeLinkDataCollection=nr.prototype.lA,nr.prototype.removeLinkData=nr.prototype.bm,nr.prototype.addLinkDataCollection=nr.prototype.Ey,nr.prototype.addLinkData=nr.prototype.fi,nr.prototype.containsLinkData=nr.prototype.Jc,nr.prototype.makeLinkDataKeyUnique=nr.prototype.Bs,nr.prototype.findLinkDataForKey=nr.prototype.jh,nr.prototype.setKeyForLinkData=nr.prototype.Ks,nr.prototype.getKeyForLinkData=nr.prototype.Ac,nr.prototype.removeLabelKeyForLinkData=nr.prototype.Qx,nr.prototype.addLabelKeyForLinkData=nr.prototype.Bu,nr.prototype.setLabelKeysForLinkData=nr.prototype.Ls,nr.prototype.getLabelKeysForLinkData=nr.prototype.Ef,nr.prototype.setToPortIdForLinkData=nr.prototype.Cv,nr.prototype.getToPortIdForLinkData=nr.prototype.Cx,nr.prototype.setFromPortIdForLinkData=nr.prototype.xv,nr.prototype.getFromPortIdForLinkData=nr.prototype.zx,nr.prototype.setToKeyForLinkData=nr.prototype.Bv,nr.prototype.getToKeyForLinkData=nr.prototype.Bx,nr.prototype.setFromKeyForLinkData=nr.prototype.wv,nr.prototype.getFromKeyForLinkData=nr.prototype.yx,nr.prototype.clear=nr.prototype.clear;var Tp=Object.freeze([]);nr.className="GraphLinksModel",Hc.GraphLinksModel=nr,ii.constructGraphLinksModel=ii.constructGraphLinksModel=function(){return new nr},ii.initDiagramModel=eg=function(){return new nr};function nh(t,e){ii.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",t!==void 0&&(ui(t)?this.nodeDataArray=t:e=t),e&&(Object.assign(this,e),t=e.Changed)&&(delete this.Changed,this.Pe(t))}li(nh,ii),nh.constructGraphLinksModel=ii.constructGraphLinksModel,nh.prototype.cloneProtected=function(t){ii.prototype.cloneProtected.call(this,t),t.Ke=this.Ke,t.Nm=this.Nm,t.nj=this.nj},L=nh.prototype,L.toString=function(t){if(t===void 0&&(t=0),2<=t)return this.np();var e=(this.name!==""?this.name:"")+" TreeModel";if(0<t){e+=`
|
|
|
node data:`,t=this.nodeDataArray;for(var i=t.length,n=0;n<i;n++){var s=t[n];e+=" "+this.wa(s)+":"+zr(s)}}return e},L.rm=function(){var t=ii.prototype.rm.call(this),e="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(e+=`,
|
|
|
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),t+e},L.gp=function(t){ii.prototype.gp.call(this,t),t.nodeParentKeyProperty&&(this.nodeParentKeyProperty=t.nodeParentKeyProperty)},L.fp=function(t){t.nodeParentKeyProperty!==void 0&&t.nodeParentKeyProperty!==this.nodeParentKeyProperty&&Mt("applyIncrementalJson cannot change Model properties"),ii.prototype.fp.call(this,t)},L.Vl=function(t){return t},L.mh=function(t){if(t!==null){var e=this.Ke;if(e!==""&&(e=Ra(t,e),e!==void 0)){if(Ep(e))return e;Mt("ParentKey value for node data "+t+" is not a number or a string: "+e)}}},L.qe=function(t,e){if(e===null&&(e=void 0),t!==null){var i=this.Ke;if(i!=="")if(e=this.Vl(e),this.lb(t)){var n=Ra(t,i);n!==e&&(Dc(this,n,t),cs(t,i,e),this.hc(e)===null&&af(this,e,t),pl(this,"nodeParentKey",us,i,t,n,e),typeof i=="string"&&this.La(t,i))}else cs(t,i,e)}},L.ss=function(t){if(t===null)return"";var e=this.nj;return e===""||(e=Ra(t,e),e===void 0)?"":typeof e=="string"?e:(Mt("getParentLinkCategoryForNodeData found a non-string category for "+t+": "+e),"")},nh.prototype.getLinkCategoryForData=function(t){return this.ss(t)},nh.prototype.Ms=function(t,e){if(t!==null){var i=this.nj;if(i!=="")if(this.lb(t)){var n=Ra(t,i);n===void 0&&(n=""),n!==e&&(cs(t,i,e),pl(this,"parentLinkCategory",us,i,t,n,e),typeof i=="string"&&this.La(t,i))}else cs(t,i,e)}},nh.prototype.setLinkCategoryForData=function(t,e){this.Ms(t,e)},nh.prototype.copyNodeData=function(t){return t===null?null:(t=ii.prototype.copyNodeData.call(this,t),this.Jj||this.Ke===""||Ra(t,this.Ke)===void 0||cs(t,this.Ke,void 0),t)},nh.prototype.setDataProperty=function(t,e,i){if(this.lb(t)){if(e===this.nodeKeyProperty){this.km(t,i);return}if(e===this.nodeCategoryProperty){this.jm(t,i);return}if(e===this.nodeParentKeyProperty){this.qe(t,i);return}}var n=Ra(t,e);n!==i&&(cs(t,e,i),this.Fs(t,e,n,i))},L=nh.prototype,L.jp=function(t,e){ii.prototype.jp.call(this,t,e);for(var i=this.kb.iterator;i.next();)this.qv(i.value,t,e)},L.qv=function(t,e,i){if(this.mh(t)===e){var n=this.Ke;cs(t,n,i),pl(this,"nodeParentKey",us,n,t,e,i),typeof n=="string"&&this.La(t,n)}},L.fm=function(t){ii.prototype.fm.call(this,t),t=this.wa(t);var e=tg(this,t);if(e!==null){var i=gi();for(e=e.iterator;e.next();){var n=e.value;if(this.lb(n)&&this.mh(n)===t){var s=this.Ke;pl(this,"nodeParentKey",us,s,n,t,t),typeof s=="string"&&this.La(n,s),i.push(n)}}for(e=0;e<i.length;e++)Dc(this,t,i[e]);Ji(i)}},L.em=function(t){ii.prototype.em.call(this,t);var e=this.mh(t);e=this.Vl(e),this.hc(e)===null&&af(this,e,t)},L.qp=function(t){ii.prototype.qp.call(this,t);var e=this.mh(t);Dc(this,e,t)},L.lm=function(t,e){ii.prototype.lm.call(this,t,e),this.Ms(e,this.ss(t)),this.qe(e,this.mh(t))},L.Tl=function(){return!0},L.xs=function(){return!0},St.Object.defineProperties(nh.prototype,{nodeParentKeyProperty:{get:function(){return this.Ke},set:function(t){var e=this.Ke;e!==t&&(this.Ke=t,this.g("nodeParentKeyProperty",e,t))}},Jj:{get:function(){return this.Nm},set:function(t){this.Nm!==t&&(this.Nm=t)}},parentLinkCategoryProperty:{get:function(){return this.nj},set:function(t){var e=this.nj;e!==t&&(this.nj=t,this.g("parentLinkCategoryProperty",e,t))}},linkCategoryProperty:{get:function(){return this.parentLinkCategoryProperty},set:function(t){this.parentLinkCategoryProperty=t}},type:{get:function(){return"TreeModel"}}}),nh.prototype.setParentLinkCategoryForNodeData=nh.prototype.Ms,nh.prototype.getParentLinkCategoryForNodeData=nh.prototype.ss,nh.prototype.setParentKeyForNodeData=nh.prototype.qe,nh.prototype.getParentKeyForNodeData=nh.prototype.mh,nh.className="TreeModel",Hc.TreeModel=nh;function Os(t){hs.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=Vc,this.Ti=0,this.Zv=new G,this.Jp=this.me=0,this.Xr=new Xd,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=Vc,this.K=rh,this.nd=zu,this.hd=My,this.tf=6,this.Nn=Pp,t&&Object.assign(this,t)}li(Os,hs),Os.prototype.cloneProtected=function(t){hs.prototype.cloneProtected.call(this,t),t.eo=this.eo,t.Cm=this.Cm,t.ro=this.ro,t.ul=this.ul,t.Rb=this.Rb,t.K=this.K,t.nd=this.nd,t.hd=this.hd,t.tf=this.tf,t.Nn=this.Nn},Os.prototype.qb=function(t){t.classType===Os?t===bv||t===sd||t===wv||t===ca||t===zu?this.sorting=t:t===Gd||t===_p||t===rh||t===Zd?this.direction=t:t===$h||t===Ud||t===Vc||t===Wc?this.arrangement=t:(t===Uc||t===Pp)&&(this.nodeDiameterFormula=t):hs.prototype.qb.call(this,t)},Os.prototype.createNetwork=function(){return new ad(this)},Os.prototype.doLayout=function(t){if(this.network===null&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),t=this.network.vertexes,1>=t.count)t.count===1&&(t=t.first(),t.centerX=0,t.centerY=0);else{var e=new ue;e.addAll(t.iterator),t=new ue;var i=new ue,n=this.sort(e),s,a,l=this.Jp,c=this.arrangement,p=this.nodeDiameterFormula,m=this.radius;(!isFinite(m)||0>=m)&&(m=NaN);var v=this.aspectRatio;(!isFinite(v)||0>=v)&&(v=1);var w=this.startAngle;isFinite(w)||(w=0);var C=this.sweepAngle;if((!isFinite(C)||360<C||1>C)&&(C=360),e=this.spacing,isFinite(e)||(e=NaN),c===Wc&&p===Uc?c=Vc:c===Wc&&p!==Uc&&(c=this.arrangement),(this.direction===Gd||this.direction===_p)&&this.sorting!==zu){for(p=0;!(p>=n.length)&&(t.add(n.M(p)),!(p+1>=n.length));p+=2)i.add(n.M(p+1));this.direction===Gd?(this.arrangement===Wc&&t.reverse(),n=new ue,n.addAll(t),n.addAll(i)):(this.arrangement===Wc&&i.reverse(),n=new ue,n.addAll(i),n.addAll(t))}p=n.length;for(var k=a=s=0;k<n.length;k++){var T=w+C*a*(this.direction===rh?1:-1)/p,A=n.M(k).diameter;isNaN(A)&&(A=Md(n.M(k),T)),360>C&&(k===0||k===n.length-1)&&(A/=2),s+=A,a++}if(isNaN(m)||c===Wc){if(isNaN(e)&&(e=6),c!==Vc&&c!==Wc){for(a=-1/0,l=0;l<p;l++)k=n.M(l),s=n.M(l===p-1?0:l+1),isNaN(k.diameter)&&Md(k,0),isNaN(s.diameter)&&Md(s,0),a=Math.max(a,(k.diameter+s.diameter)/2);l=a+e,c===$h?m=(a+e)/(2*Math.PI/p):m=rg(this,l*(360<=C?p:p-1),v,w*Math.PI/180,C*Math.PI/180)}else m=rg(this,s+(360<=C?p:p-1)*(c!==Wc?e:1.6*e),v,w*Math.PI/180,C*Math.PI/180);a=m*v}else if(a=m*v,k=Ay(this,m,a,w*Math.PI/180,C*Math.PI/180),isNaN(e))(c===Vc||c===Wc)&&(e=(k-s)/(360<=C?p:p-1));else if(c===Vc||c===Wc)k=(k-s)/(360<=C?p:p-1),k<e?(m=rg(this,s+e*(360<=C?p:p-1),v,w*Math.PI/180,C*Math.PI/180),a=m*v):e=k;else{for(l=-1/0,s=0;s<p;s++)T=n.M(s),A=n.M(s===p-1?0:s+1),isNaN(T.diameter)&&Md(T,0),isNaN(A.diameter)&&Md(A,0),l=Math.max(l,(T.diameter+A.diameter)/2);l+=e,s=rg(this,l*(360<=C?p:p-1),v,w*Math.PI/180,C*Math.PI/180),s>m?(m=s,a=m*v):l=k/(360<=C?p:p-1)}if(this.kw=c,this.lc=m,this.Zm=v,this.lw=w,this.Wp=C,this.Ti=e,this.me=a,this.Jp=l,e=n,n=this.kw,c=this.lc,m=this.lw,v=this.Wp,w=this.Ti,C=this.me,p=this.Jp,this.direction!==Gd&&this.direction!==_p||n!==Wc)if(this.direction===Gd||this.direction===_p){switch(l=0,n){case Ud:l=180*um(this,c,C,m,p)/Math.PI;break;case Vc:p=e=0,l=t.first(),l!==null&&(e=Md(l,Math.PI/2)),l=i.first(),l!==null&&(p=Md(l,Math.PI/2)),l=180*um(this,c,C,m,w+(e+p)/2)/Math.PI;break;case $h:l=v/e.length}if(this.direction===Gd){switch(n){case Ud:ng(this,t,m,Zd);break;case Vc:Sd(this,t,m,Zd);break;case $h:d0(this,t,v/2,m,Zd)}switch(n){case Ud:ng(this,i,m+l,rh);break;case Vc:Sd(this,i,m+l,rh);break;case $h:d0(this,i,v/2,m+l,rh)}}else{switch(n){case Ud:ng(this,i,m,Zd);break;case Vc:Sd(this,i,m,Zd);break;case $h:d0(this,i,v/2,m,Zd)}switch(n){case Ud:ng(this,t,m+l,rh);break;case Vc:Sd(this,t,m+l,rh);break;case $h:d0(this,t,v/2,m+l,rh)}}}else switch(n){case Ud:ng(this,e,m,this.direction);break;case Vc:Sd(this,e,m,this.direction);break;case $h:d0(this,e,v,m,this.direction);break;case Wc:N1(this,e,v,m,this.direction)}else N1(this,e,v,m-v/2,rh)}this.updateParts(),this.network=null,this.isValidLayout=!0};function d0(t,e,i,n,s){var a=t.Wp,l=t.lc;t=t.me,n=n*Math.PI/180,i=i*Math.PI/180;for(var c=e.length,p=0;p<c;p++){var m=n+(s===rh?p*i/(360<=a?c:c-1):-(p*i)/c),v=e.M(p),w=l*Math.tan(m)/t;w=Math.sqrt((l*l+t*t*w*w)/(1+w*w)),v.centerX=w*Math.cos(m),v.centerY=w*Math.sin(m),v.actualAngle=180*m/Math.PI}}function Sd(t,e,i,n){var s=t.lc,a=t.me,l=t.Ti;i=i*Math.PI/180;for(var c=e.length,p=0;p<c;p++){var m=e.M(p),v=e.M(p===c-1?0:p+1),w=a*Math.sin(i);m.centerX=s*Math.cos(i),m.centerY=w,m.actualAngle=180*i/Math.PI,isNaN(m.diameter)&&Md(m,0),isNaN(v.diameter)&&Md(v,0),m=um(t,s,a,n===rh?i:-i,(m.diameter+v.diameter)/2+l),i+=n===rh?m:-m}}function ng(t,e,i,n){var s=t.lc,a=t.me,l=t.Jp;i=i*Math.PI/180;for(var c=e.length,p=0;p<c;p++){var m=e.M(p);m.centerX=s*Math.cos(i),m.centerY=a*Math.sin(i),m.actualAngle=180*i/Math.PI,m=um(t,s,a,n===rh?i:-i,l),i+=n===rh?m:-m}}function N1(t,e,i,n,s){var a=t.Wp;if(t.mj=0,t.Xr=new Xd,360>i){for(a=n+(s===rh?a:-a);0>a;)a+=360;a%=360,180<a&&(a-=360),a*=Math.PI/180,t.gt=a,A1(t,e,i,n,s)}else Ny(t,e,i,n,s);t.Xr.commit(e)}function Ny(t,e,i,n,s){var a=t.lc,l=t.Ti,c=t.Zm,p=a*Math.cos(n*Math.PI/180),m=t.me*Math.sin(n*Math.PI/180),v=e.Fa();if(v.length===3)v[0].centerX=a,v[0].centerY=0,v[1].centerX=v[0].centerX-v[0].width/2-v[1].width/2-l,v[1].y=v[0].y,v[2].centerX=(v[0].centerX+v[1].centerX)/2,v[2].y=v[0].y-v[2].height-l;else if(v.length===4)v[0].centerX=a,v[0].centerY=0,v[2].centerX=-v[0].centerX,v[2].centerY=v[0].centerY,v[1].centerX=0,v[1].y=Math.min(v[0].y,v[2].y)-v[1].height-l,v[3].centerX=0,v[3].y=Math.max(v[0].y+v[0].height+l,v[2].y+v[2].height+l);else{a=G.alloc();for(var w=0;w<v.length&&(v[w].centerX=p,v[w].centerY=m,!(w>=v.length-1));w++)D1(t,p,m,v,w,s,a)||I1(t,p,m,v,w,s,a),p=a.x,m=a.y;if(G.free(a),t.mj++,!(23<t.mj)){p=v[0].centerX,m=v[0].centerY,a=v[v.length-1].centerX,w=v[v.length-1].centerY;var C=Math.abs(p-a)-((v[0].width+v[v.length-1].width)/2+l),k=Math.abs(m-w)-((v[0].height+v[v.length-1].height)/2+l);l=0,1>Math.abs(k)?Math.abs(p-a)<(v[0].width+v[v.length-1].width)/2&&(l=0):l=0<k?k:1>Math.abs(C)?0:C,p=Math.abs(a)>Math.abs(w)?0<a!=m>w:0<w!=p<a,(p=s===rh?p:!p)&&(l=-Math.abs(l),l=Math.min(l,-v[v.length-1].width),l=Math.min(l,-v[v.length-1].height)),t.Xr.compare(l,v),1<Math.abs(l)&&(t.lc=8>t.mj?t.lc-l/(2*Math.PI):5>v.length&&10<l?t.lc/2:t.lc-(0<l?1.7:-2.3),t.me=t.lc*c,Ny(t,e,i,n,s))}}}function A1(t,e,i,n,s){for(var a=t.lc,l=t.me,c=t.Zm,p=a*Math.cos(n*Math.PI/180),m=l*Math.sin(n*Math.PI/180),v=G.alloc(),w=e.Fa(),C=0;C<w.length&&(w[C].centerX=p,w[C].centerY=m,!(C>=w.length-1));C++)D1(t,p,m,w,C,s,v)||I1(t,p,m,w,C,s,v),p=v.x,m=v.y;if(G.free(v),t.mj++,!(23<t.mj)){if(p=Math.atan2(m,p),p=s===rh?t.gt-p:p-t.gt,p=Math.abs(p)<Math.abs(p-2*Math.PI)?p:p-2*Math.PI,a=p*(a+l)/2,l=t.Xr,Math.abs(a)<Math.abs(l.Pl))for(l.Pl=a,l.mk=[],l.tm=[],p=0;p<w.length;p++)l.mk[p]=w[p].bounds.x,l.tm[p]=w[p].bounds.y;1<Math.abs(a)&&(t.lc=8>t.mj?t.lc-a/(2*Math.PI):t.lc-(0<a?1.7:-2.3),t.me=t.lc*c,A1(t,e,i,n,s))}}function D1(t,e,i,n,s,a,l){var c=t.lc,p=t.me,m=0;t=(n[s].width+n[s+1].width)/2+t.Ti;var v=!1;if(0<=i!=(a===rh)){if(a=e+t,a>c){if(a=e-t,a<-c)return l.x=a,l.y=m,!1;v=!0}}else if(a=e-t,a<-c){if(a=e+t,a>c)return l.x=a,l.y=m,!1;v=!0}return m=Math.sqrt(1-Math.min(1,a*a/(c*c)))*p,0>i!==v&&(m=-m),Math.abs(i-m)>(n[s].height+n[s+1].height)/2?(l.x=a,l.y=m,!1):(l.x=a,l.y=m,!0)}function I1(t,e,i,n,s,a,l){var c=t.lc,p=t.me,m=0;if(t=(n[s].height+n[s+1].height)/2+t.Ti,n=!1,0<=e!=(a===rh)){if(a=i-t,a<-p){if(a=i+t,a>p){l.x=m,l.y=a;return}n=!0}}else if(a=i+t,a>p){if(a=i-t,a<-p){l.x=m,l.y=a;return}n=!0}m=Math.sqrt(1-Math.min(1,a*a/(p*p)))*c,0>e!==n&&(m=-m),l.x=m,l.y=a}Os.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Os.prototype.commitNodes=function(){var t=this.group!==null&&this.group.placeholder!==null&&this.group.isSubGraphExpanded,e=t?this.group.location.copy():null,i=this.actualCenter;t?i=new G(0,0):(i.x=this.arrangementOrigin.x+this.lc,i.y=this.arrangementOrigin.y+this.me);for(var n=this.network.vertexes.iterator;n.next();){var s=n.value;s.x+=i.x,s.y+=i.y,s.commit()}t&&(this.group.Va(),t=this.group.position.copy(),i=this.group.location.copy(),e=e.re(i.re(t)),this.group.move(e),this.Zv=e.re(t))},Os.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()};function Ay(t,e,i,n,s){var a=t.ty;if(.001>Math.abs(t.Zm-1))return n!==void 0&&s!==void 0?s*e:2*Math.PI*e;t=e>i?Math.sqrt(e*e-i*i)/e:Math.sqrt(i*i-e*e)/i;for(var l=0,c=n!==void 0&&s!==void 0?s/(a+1):Math.PI/(2*(a+1)),p=0,m=0;m<=a;m++){n!==void 0&&s!==void 0?p=n+m*s/a:p=m*Math.PI/(2*a);var v=Math.sin(p);l+=Math.sqrt(1-t*t*v*v)*c}return n!==void 0&&s!==void 0?(e>i?e:i)*l:4*(e>i?e:i)*l}function rg(t,e,i,n,s){return e/(n!==void 0&&s!==void 0?Ay(t,1,i,n,s):Ay(t,1,i))}function um(t,e,i,n,s){if(.001>Math.abs(t.Zm-1))return s/e;var a=e>i?Math.sqrt(e*e-i*i)/e:Math.sqrt(i*i-e*e)/i,l=0;t=2*Math.PI/(700*t.network.vertexes.count),e>i&&(n+=Math.PI/2);for(var c=0;;c++){var p=Math.sin(n+c*t);if(l+=(e>i?e:i)*Math.sqrt(1-a*a*p*p)*t,l>=s)return c*t}}Os.prototype.sort=function(t){switch(this.sorting){case wv:break;case ca:t.reverse();break;case bv:t.sort(this.comparer);break;case sd:t.sort(this.comparer),t.reverse();break;case zu:return this.ak(og(t));default:Mt("Invalid sorting type.")}return t};function og(t){for(var e=[],i=0;i<t.length;i++)e.push(0);i=new ue;for(var n=0;n<t.length;n++){var s=-1,a=-1;if(n===0)for(var l=0;l<t.length;l++){var c=t.M(l).edgesCount;c>s&&(s=c,a=l)}else for(l=0;l<t.length;l++)c=e[l],c>s&&(s=c,a=l);for(i.add(t.M(a)),e[a]=-1,a=t.M(a),l=a.sourceEdges;l.next();)s=t.indexOf(l.value.fromVertex),0>s||0<=e[s]&&e[s]++;for(a=a.destinationEdges;a.next();)s=t.indexOf(a.value.toVertex),0>s||0<=e[s]&&e[s]++}return i}Os.prototype.ak=function(t){for(var e=[],i=0;i<t.length;i++){var n=t.M(i);e[i]=[];for(var s,a=n.destinationEdges;a.next();)s=t.indexOf(a.value.toVertex),s!==i&&0>e[i].indexOf(s)&&e[i].push(s);for(n=n.sourceEdges;n.next();)s=t.indexOf(n.value.fromVertex),s!==i&&0>e[i].indexOf(s)&&e[i].push(s)}for(a=[],i=0;i<e.length;i++)a[i]=0;i=[];var l=[],c=[];n=[],s=new ue;for(var p=0,m=0;m<e.length;m++){var v=e[m].length;if(v===1)n.push(m);else if(v===0)s.add(t.M(m));else{if(p===0)i.push(m);else{for(var w=v=1/0,C=-1,k=[],T=0;T<i.length;T++)0>e[i[T]].indexOf(i[T===i.length-1?0:T+1])&&k.push(T===i.length-1?0:T+1);if(k.length===0)for(T=0;T<i.length;T++)k.push(T);for(T=0;T<k.length;T++){for(var A=k[T],X=e[m],$=0,J=0;J<l.length;J++){var et=a[l[J]],st=a[c[J]];if(et<st){var mt=et;et=st}else mt=st;if(mt<A&&A<=et)for(st=0;st<X.length;st++){var Pt=X[st];0>i.indexOf(Pt)||mt<a[Pt]&&a[Pt]<et||mt===a[Pt]||et===a[Pt]||$++}else for(st=0;st<X.length;st++)Pt=X[st],0>i.indexOf(Pt)||mt<a[Pt]&&a[Pt]<et&&mt!==a[Pt]&&et!==a[Pt]&&$++}for(X=$,J=$=0;J<e[m].length;J++)mt=i.indexOf(e[m][J]),0<=mt&&(mt=Math.abs(A-(mt>=A?mt+1:mt)),$+=mt<i.length+1-mt?mt:i.length+1-mt);for(J=0;J<l.length;J++)mt=a[l[J]],et=a[c[J]],mt>=A&&mt++,et>=A&&et++,mt>et&&(st=et,et=mt,mt=st),et-mt<(i.length+2)/2==(mt<A&&A<=et)&&$++;(X<v||X===v&&$<w)&&(v=X,w=$,C=A)}for(i.splice(C,0,m),v=0;v<i.length;v++)a[i[v]]=v;for(v=0;v<e[m].length;v++)w=e[m][v],0<=i.indexOf(w)&&(l.push(m),c.push(w))}p++}}for(l=i.length;;){for(a=!0,c=0;c<n.length;c++)if(p=n[c],m=e[p][0],v=i.indexOf(m),0<=v){for(C=w=0;C<e[m].length;C++)k=i.indexOf(e[m][C]),0>k||k===v||(T=k>v?k-v:v-k,w+=k<v!=T>l-T?1:-1);i.splice(0>w?v:v+1,0,p),n.splice(c,1),c--}else a=!1;if(a)break;i.push(n[0]),n.splice(0,1)}for(e=0;e<i.length;e++)s.add(t.M(i[e]));return s},St.Object.defineProperties(Os.prototype,{radius:{get:function(){return this.eo},set:function(t){this.eo!==t&&(0<t||isNaN(t))&&(this.eo=t,this.C())}},aspectRatio:{get:function(){return this.Cm},set:function(t){this.Cm!==t&&0<t&&(this.Cm=t,this.C())}},startAngle:{get:function(){return this.ro},set:function(t){this.ro!==t&&(this.ro=t,this.C())}},sweepAngle:{get:function(){return this.ul},set:function(t){this.ul!==t&&(0<t&&360>=t?this.ul=t:this.ul=360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(t){this.Rb===t||t!==Wc&&t!==Vc&&t!==Ud&&t!==$h||(this.Rb=t,this.C())}},direction:{get:function(){return this.K},set:function(t){this.K===t||t!==rh&&t!==Zd&&t!==Gd&&t!==_p||(this.K=t,this.C())}},sorting:{get:function(){return this.nd},set:function(t){this.nd===t||t!==wv&&t!==ca&&t!==bv&&!sd&&t!==zu||(this.nd=t,this.C())}},comparer:{get:function(){return this.hd},set:function(t){this.hd!==t&&(this.hd=t,this.C())}},spacing:{get:function(){return this.tf},set:function(t){this.tf!==t&&(this.tf=t,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(t){this.Nn===t||t!==Pp&&t!==Uc||(this.Nn=t,this.C())}},actualXRadius:{get:function(){return this.lc}},actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}});var Vc=new he(Os,"ConstantSpacing",0),Ud=new he(Os,"ConstantDistance",1),$h=new he(Os,"ConstantAngle",2),Wc=new he(Os,"Packed",3),rh=new he(Os,"Clockwise",4),Zd=new he(Os,"Counterclockwise",5),Gd=new he(Os,"BidirectionalLeft",6),_p=new he(Os,"BidirectionalRight",7),wv=new he(Os,"Forwards",8),ca=new he(Os,"Reverse",9),bv=new he(Os,"Ascending",10),sd=new he(Os,"Descending",11),zu=new he(Os,"Optimized",12),Pp=new he(Os,"Pythagorean",13),Uc=new he(Os,"Circular",14);Os.className="CircularLayout",Os.ConstantSpacing=Vc,Os.ConstantDistance=Ud,Os.ConstantAngle=$h,Os.Packed=Wc,Os.Clockwise=rh,Os.Counterclockwise=Zd,Os.BidirectionalLeft=Gd,Os.BidirectionalRight=_p,Os.Forwards=wv,Os.Reverse=ca,Os.Ascending=bv,Os.Descending=sd,Os.Optimized=zu,Os.Pythagorean=Pp,Os.Circular=Uc;function Xd(){this.Pl=-1/0,this.tm=this.mk=null}Xd.prototype.compare=function(t,e){if(0<t&&0>this.Pl||Math.abs(t)<Math.abs(this.Pl)&&!(0>t&&0<this.Pl))for(this.Pl=t,this.mk=[],this.tm=[],t=0;t<e.length;t++)this.mk[t]=e[t].bounds.x,this.tm[t]=e[t].bounds.y},Xd.prototype.commit=function(t){if(this.mk!==null&&this.tm!==null)for(var e=0;e<this.mk.length;e++){var i=t.M(e);i.x=this.mk[e],i.y=this.tm[e]}},Xd.className="VertexArrangement";function ad(t){Zo.call(this,t)}li(ad,Zo),ad.prototype.createVertex=function(){return new hm(this)},ad.prototype.createEdge=function(){return new sg(this)},ad.className="CircularNetwork";function hm(t){Ha.call(this,t),this.u=this.Si=NaN}li(hm,Ha);function Md(t,e){var i=t.network;if(i===null)return NaN;if(i=i.layout,i===null)return NaN;if(i.arrangement===Wc)if(i.nodeDiameterFormula===Uc)t.Si=Math.max(t.width,t.height);else{if(i=Math.abs(Math.sin(e)),e=Math.abs(Math.cos(e)),i===0)return t.width;if(e===0)return t.height;t.Si=Math.min(t.height/i,t.width/e)}else t.Si=i.nodeDiameterFormula===Uc?Math.max(t.width,t.height):Math.sqrt(t.width*t.width+t.height*t.height);return t.Si}St.Object.defineProperties(hm.prototype,{diameter:{get:function(){return this.Si},set:function(t){this.Si!==t&&(this.Si=t)}},actualAngle:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}}}),hm.className="CircularVertex";function sg(t){kh.call(this,t)}li(sg,kh),sg.className="CircularEdge";function lu(t){hs.call(this),this.ah=null,this.An=0,this.$d=new fe(100,100).freeze(),this.Bm=!1,this.sf=!0,this.td=!1,this.dl=100,this.$m=1,this.Zf=1e3,this.In=10,this.fo=Math,this.Hk=.05,this.Gk=50,this.Ek=150,this.Fk=0,this.Vm=10,this.Um=5,t&&Object.assign(this,t)}li(lu,hs),lu.prototype.cloneProtected=function(t){hs.prototype.cloneProtected.call(this,t),t.$d.assign(this.$d),t.Bm=this.Bm,t.sf=this.sf,t.td=this.td,t.dl=this.dl,t.$m=this.$m,t.Zf=this.Zf,t.In=this.In,t.fo=this.fo,t.Hk=this.Hk,t.Gk=this.Gk,t.Ek=this.Ek,t.Fk=this.Fk,t.Vm=this.Vm,t.Um=this.Um},lu.prototype.createNetwork=function(){return new m0(this)},lu.prototype.doLayout=function(t){if(this.network===null&&(this.network=this.makeNetwork(t)),t=this.maxIterations,0<this.network.vertexes.count){this.network.Ko();for(var e=this.network.vertexes.iterator;e.next();){var i=e.value;i.charge=this.electricalCharge(i),i.mass=this.gravitationalMass(i)}for(e=this.network.edges.iterator;e.next();)i=e.value,i.stiffness=this.springStiffness(i),i.length=this.springLength(i);if(this.Cu(),this.An=0,this.needsClusterLayout()){e=this.network,i=e.Zx();for(var n=i.iterator;n.next();){this.network=n.value;for(var s=this.network.vertexes.iterator;s.next();){var a=s.value;a.Vd=a.vertexes.count,a.sh=1,a.Hj=null,a.We=null}Dy(this,0,t)}this.network=e;var l=n=i.iterator;n=this.arrangementSpacing;var c=l.count,p=!0;a=s=0;for(var m=gi(),v=0;v<c+e.vertexes.count+2;v++)m[v]=null;c=0,l.reset();for(var w=Tt.alloc();l.next();)if(v=l.value,this.computeBounds(v,w),p)p=!1,s=w.x+w.width/2,a=w.y+w.height/2,m[0]=new G(w.x+w.width+n.width,w.y),m[1]=new G(w.x,w.y+w.height+n.height),c=2;else{var C=R1(m,c,s,a,w.width,w.height,n),k=m[C],T=new G(k.x+w.width+n.width,k.y),A=new G(k.x,k.y+w.height+n.height);for(C+1<c&&m.splice(C+1,0,null),m[C]=T,m[C+1]=A,c++,C=k.x-w.x,k=k.y-w.y,v=v.vertexes.iterator;v.next();)T=v.value,T.centerX+=C,T.centerY+=k}for(Tt.free(w),v=e.vertexes.iterator;v.next();)l=v.value,C=l.bounds,2>c?(s=C.x+C.width/2,a=C.y+C.height/2,m[0]=new G(C.x+C.width+n.width,C.y),m[1]=new G(C.x,C.y+C.height+n.height),c=2):(p=R1(m,c,s,a,C.width,C.height,n),w=m[p],k=new G(w.x+C.width+n.width,w.y),C=new G(w.x,w.y+C.height+n.height),p+1<c&&m.splice(p+1,0,null),m[p]=k,m[p+1]=C,c++,l.centerX=w.x+l.width/2,l.centerY=w.y+l.height/2);for(Ji(m),n=i.iterator;n.next();){for(i=n.value,s=i.vertexes.iterator;s.next();)e.dh(s.value);for(i=i.edges.iterator;i.next();)e.Bo(i.value)}}B1(this,t),this.updateParts()}this.dl=t,this.network=null,this.isValidLayout=!0},lu.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var t=0,e=0,i=this.network.vertexes.first().bounds,n=this.network.vertexes.iterator;n.next();){if(n.value.bounds.Yc(i)&&(t++,2<t))return!0;if(10<e)break;e++}return!1},lu.prototype.computeBounds=function(t,e){var i=!0;for(t=t.vertexes.iterator;t.next();){var n=t.value;i?(i=!1,e.set(n.bounds)):e.ed(n.bounds)}return e};function Dy(t,e,i){if(wx(t,e)){var n=t.Zf;t.Zf*=1+1/(e+1);var s=Sv(t,e),a=Math.max(0,Math.max(Math.min(t.network.vertexes.count,i*(e+1)/11),10));for(t.maxIterations+=a,Dy(t,e+1,i),B1(t,a),O1(t,s),e=s.vertexes.Fa(),e.sort(function(l,c){return l===null||c===null||l===c?0:c.Vd-l.Vd}),i=0;i<e.length;i++)bx(t,e[i]);t.Zf=n}}function wx(t,e){if(10<e||3>t.network.vertexes.count)return!1;for(t.ah=t.network.vertexes.Fa(),t=t.ah,t.sort(function(i,n){return i===null||n===null||i===n?0:n.Vd-i.Vd}),e=t.length-1;0<=e&&1>=t[e].Vd;)e--;return 1<t.length-e}function Sv(t,e){for(var i=t.network,n=new m0(t),s=0;s<t.ah.length;s++){var a=t.ah[s];if(1<a.Vd){n.dh(a);var l=new z1;l.Rs=a.Vd,l.Ss=a.width,l.Qs=a.height,l.Sv=a.focus.x,l.Tv=a.focus.y,a.We===null&&(a.We=new ue),a.We.add(l),a.sv=a.We.count-1}else break}for(a=i.edges.iterator;a.next();){var c=a.value;s=c.fromVertex,l=c.toVertex,s.network===n&&l.network===n?n.Bo(c):s.network===n?(c=s.Hj,c===null&&(c=new ue,s.Hj=c),c.add(l),s.Vd--,s.sh+=l.sh):l.network===n&&(c=l.Hj,c===null&&(c=new ue,l.Hj=c),c.add(s),l.Vd--,l.sh+=s.sh)}for(s=n.edges.iterator;s.next();)a=s.value,a.length*=Math.max(1,xt.sqrt((a.fromVertex.sh+a.toVertex.sh)/(4*e+1)));for(e=n.vertexes.iterator;e.next();){s=e.value;var p=s.Hj;if(p!==null&&0<p.count&&(l=s.We.M(s.We.count-1).Rs-s.Vd,!(0>=l))){for(var m=c=0,v=p.count-l;v<p.count;v++){var w=p.M(v),C=null;for(a=w.edges.iterator;a.next();){var k=a.value;if(k.Ax(w)===s){C=k;break}}C!==null&&(m+=C.length,c+=w.width*w.height)}a=s.centerX,p=s.centerY,v=s.width,w=s.height,C=s.focus,k=v*w,1>k&&(k=1),c=xt.sqrt((c+k+m*m*4/(l*l))/k),l=(c-1)*v/2,c=(c-1)*w/2,s.bounds=new Tt(a-C.x-l,p-C.y-c,v+2*l,w+2*c),s.focus=new G(C.x+l,C.y+c)}}return t.network=n,i}function O1(t,e){for(var i=t.network.vertexes.iterator;i.next();){var n=i.value;if(n.network=e,n.We!==null){var s=n.We.M(n.sv);n.Vd=s.Rs;var a=s.Sv,l=s.Tv;n.bounds=new Tt(n.centerX-a,n.centerY-l,s.Ss,s.Qs),n.focus=new G(a,l),n.sv--}}for(i=t.network.edges.iterator;i.next();)i.value.network=e;t.network=e}function bx(t,e){var i=e.Hj;if(i!==null&&i.count!==0){var n=e.centerX,s=e.centerY,a=e.width,l=e.height;e.We!==null&&0<e.We.count&&(l=e.We.M(0),a=l.Ss,l=l.Qs),a=xt.sqrt(a*a+l*l)/2;for(var c=!1,p=l=0,m=0,v=e.vertexes.iterator;v.next();){var w=v.value;1>=w.Vd?p++:(c=!0,m++,l+=Math.atan2(e.centerY-w.centerY,e.centerX-w.centerX))}if(p!==0){for(0<m&&(l/=m),m=e=0,e=c?2*Math.PI/(p+1):2*Math.PI/p,p%2===0&&(m=e/2),1<i.count&&i.sort(function(k,T){return k===null||T===null||k===T?0:T.width*T.height-k.width*k.height}),c=p%2===0?0:1,i=i.iterator;i.next();)if(p=i.value,!(1<p.Vd||t.isFixed(p))){for(v=null,w=p.edges.iterator;w.next();){v=w.value;break}w=p.width;var C=p.height;w=xt.sqrt(w*w+C*C)/2,v=a+v.length+w,w=l+(e*(c/2>>1)+m)*(c%2===0?1:-1),p.centerX=n+v*Math.cos(w),p.centerY=s+v*Math.sin(w),c++}}}}function R1(t,e,i,n,s,a,l){var c=9e19,p=-1,m=0;t:for(;m<e;m++){var v=t[m],w=v.x-i,C=v.y-n;if(w=w*w+C*C,w<c){for(C=m-1;0<=C;C--)if(t[C].y>v.y&&t[C].x-v.x<s+l.width)continue t;for(C=m+1;C<e;C++)if(t[C].x>v.x&&t[C].y-v.y<a+l.height)continue t;p=m,c=w}}return p}lu.prototype.Cu=function(){if(this.comments)for(var t=this.network.vertexes.iterator;t.next();)this.addComments(t.value)},lu.prototype.addComments=function(t){var e=t.node;if(e!==null)for(e=e.Mu();e.next();){var i=e.value;if(i.category==="Comment"&&i.isVisible()){var n=this.network.ki(i);n===null&&(n=this.network.Bl(i)),n.charge=this.defaultCommentElectricalCharge,i=null;for(var s=n.destinationEdges;s.next();){var a=s.value;if(a.toVertex===t){i=a;break}}if(i===null){for(s=n.sourceEdges;s.next();)if(a=s.value,a.fromVertex===t){i=a;break}}i===null&&(i=this.network.Zj(t,n,null)),i.length=this.defaultCommentSpringLength}}};function p0(t,e){var i=t.bounds,n=i.x;t=i.y;var s=i.width;i=i.height;var a=e.bounds,l=a.x;e=a.y;var c=a.width;return a=a.height,n+s<l?t>e+a?(i=n+s-l,t=t-e-a,xt.sqrt(i*i+t*t)):t+i<e?(n=n+s-l,t=t+i-e,xt.sqrt(n*n+t*t)):l-(n+s):n>l+c?t>e+a?(i=n-l-c,t=t-e-a,xt.sqrt(i*i+t*t)):t+i<e?(n=n-l-c,t=t+i-e,xt.sqrt(n*n+t*t)):n-(l+c):t>e+a?t-(e+a):t+i<e?e-(t+i):.1}function B1(t,e){for(t.ah=null,e=t.An+e;t.An<e&&(t.An++,F1(t)););t.ah=null}function F1(t){t.ah===null&&(t.ah=t.network.vertexes.Fa());var e=t.ah;if(0>=e.length)return!1;var i=e[0];i.forceX=0,i.forceY=0;for(var n=i.centerX,s=n,a=i=i.centerY,l=1;l<e.length;l++){var c=e[l];c.forceX=0,c.forceY=0;var p=c.centerX;c=c.centerY,n=Math.min(n,p),s=Math.max(s,p),i=Math.min(i,c),a=Math.max(a,c)}(s=s-n>a-i)?e.sort(function(A,X){return A===null||X===null||A===X?0:A.centerX-X.centerX}):e.sort(function(A,X){return A===null||X===null||A===X?0:A.centerY-X.centerY}),i=t.Zf;var m=n=c=0;for(a=0;a<e.length;a++){l=e[a],n=l.bounds,c=l.focus,p=n.x+c.x;var v=n.y+c.y;n=l.charge*t.electricalFieldX(p,v),m=l.charge*t.electricalFieldY(p,v),n+=l.mass*t.gravitationalFieldX(p,v),m+=l.mass*t.gravitationalFieldY(p,v),l.forceX+=n,l.forceY+=m;for(var w=a+1;w<e.length;w++){var C=e[w];if(C!==l){n=C.bounds,c=C.focus,m=n.x+c.x;var k=n.y+c.y;if(p-m>i||m-p>i){if(s)break}else if(v-k>i||k-v>i){if(!s)break}else{var T=p0(l,C);1>T?(n=t.randomNumberGenerator,n===null&&(t.randomNumberGenerator=n=new ld),T=n.random(),c=n.random(),p>m?(n=Math.abs(C.bounds.right-l.bounds.x),n=(1+n)*T):p<m?(n=Math.abs(C.bounds.x-l.bounds.right),n=-(1+n)*T):(n=Math.max(C.width,l.width),n=(1+n)*T-n/2),v>k?(m=Math.abs(C.bounds.bottom-l.bounds.y),m=(1+m)*c):p<m?(m=Math.abs(C.bounds.y-l.bounds.bottom),m=-(1+m)*c):(m=Math.max(C.height,l.height),m=(1+m)*c-m/2)):(c=-(l.charge*C.charge)/(T*T),n=(m-p)/T*c,m=(k-v)/T*c),l.forceX+=n,l.forceY+=m,C.forceX-=n,C.forceY-=m}}}}for(s=t.network.edges.iterator;s.next();)c=s.value,i=c.fromVertex,a=c.toVertex,l=i.bounds,p=i.focus,n=l.x+p.x,l=l.y+p.y,v=a.bounds,w=a.focus,p=v.x+w.x,v=v.y+w.y,w=p0(i,a),1>w?(w=t.randomNumberGenerator,w===null&&(t.randomNumberGenerator=w=new ld),c=w.random(),w=w.random(),n=(n>p?1:-1)*(1+(a.width>i.width?a.width:i.width))*c,m=(l>v?1:-1)*(1+(a.height>i.height?a.height:i.height))*w):(c=c.stiffness*(w-c.length),n=(p-n)/w*c,m=(v-l)/w*c),i.forceX+=n,i.forceY+=m,a.forceX-=n,a.forceY-=m;for(s=n=0;s<e.length;s++)i=e[s],t.isFixed(i)?t.moveFixedVertex(i):n=Math.max(n,t.moveVertex(i)||0);return n>t.epsilonDistance*t.epsilonDistance}lu.prototype.moveVertex=function(t){var e=t.forceX,i=t.forceY,n=this.moveLimit;return e<-n?e=-n:e>n&&(e=n),i<-n?i=-n:i>n&&(i=n),t.centerX+=e,t.centerY+=i,e*e+i*i},lu.prototype.moveFixedVertex=function(){},lu.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},lu.prototype.yv=function(){if(this.setsPortSpots)for(var t=this.network.edges.iterator;t.next();){var e=t.value.link;e!==null&&(e.fromSpot=ds,e.toSpot=ds)}},lu.prototype.commitNodes=function(){var t=0,e=0;if(this.arrangesToOrigin){var i=Tt.alloc();this.computeBounds(this.network,i),e=this.arrangementOrigin,t=e.x-i.x,e=e.y-i.y,Tt.free(i)}i=Tt.alloc();for(var n=this.network.vertexes.iterator;n.next();){var s=n.value;(t!==0||e!==0)&&(i.assign(s.bounds),i.x+=t,i.y+=e,s.bounds=i),s.commit()}Tt.free(i)},lu.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},lu.prototype.springStiffness=function(t){return t=t.stiffness,isNaN(t)?this.Hk:t},lu.prototype.springLength=function(t){return t=t.length,isNaN(t)?this.Gk:t},lu.prototype.electricalCharge=function(t){return t=t.charge,isNaN(t)?this.Ek:t},lu.prototype.electricalFieldX=function(){return 0},lu.prototype.electricalFieldY=function(){return 0},lu.prototype.gravitationalMass=function(t){return t=t.mass,isNaN(t)?this.Fk:t},lu.prototype.gravitationalFieldX=function(){return 0},lu.prototype.gravitationalFieldY=function(){return 0},lu.prototype.isFixed=function(t){return t.isFixed},St.Object.defineProperties(lu.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(t){this.$d.D(t)||(this.$d.assign(t),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(t){this.Bm!==t&&(this.Bm=t,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(t){this.sf!==t&&(this.sf=t,this.C())}},comments:{get:function(){return this.td},set:function(t){this.td!==t&&(this.td=t,this.C())}},maxIterations:{get:function(){return this.dl},set:function(t){this.dl!==t&&0<=t&&(this.dl=t,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(t){this.$m!==t&&0<t&&(this.$m=t,this.C())}},infinityDistance:{get:function(){return this.Zf},set:function(t){this.Zf!==t&&1<t&&(this.Zf=t,this.C())}},moveLimit:{get:function(){return this.In},set:function(t){this.In!==t&&1<t&&(this.In=t,this.C())}},randomNumberGenerator:{get:function(){return this.fo},set:function(t){this.fo!==t&&(t!==null&&typeof t.random!="function"&&Mt('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+t),this.fo=t)}},defaultSpringStiffness:{get:function(){return this.Hk},set:function(t){this.Hk!==t&&(this.Hk=t,this.C())}},defaultSpringLength:{get:function(){return this.Gk},set:function(t){this.Gk!==t&&(this.Gk=t,this.C())}},defaultElectricalCharge:{get:function(){return this.Ek},set:function(t){this.Ek!==t&&(this.Ek=t,this.C())}},defaultGravitationalMass:{get:function(){return this.Fk},set:function(t){this.Fk!==t&&(this.Fk=t,this.C())}},defaultCommentSpringLength:{get:function(){return this.Vm},set:function(t){this.Vm!==t&&(this.Vm=t,this.C())}},defaultCommentElectricalCharge:{get:function(){return this.Um},set:function(t){this.Um!==t&&(this.Um=t,this.C())}}}),lu.className="ForceDirectedLayout";function z1(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}z1.className="ForceDirectedSubnet";function m0(t){Zo.call(this,t)}li(m0,Zo),m0.prototype.createVertex=function(){return new ag(this)},m0.prototype.createEdge=function(){return new lg(this)},m0.className="ForceDirectedNetwork";function ag(t){Ha.call(this,t),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}li(ag,Ha),St.Object.defineProperties(ag.prototype,{isFixed:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}},charge:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},mass:{get:function(){return this.Ha},set:function(t){this.Ha!==t&&(this.Ha=t)}},forceX:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}},forceY:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}}}),ag.className="ForceDirectedVertex";function lg(t){kh.call(this,t),this.j=this.o=NaN}li(lg,kh),St.Object.defineProperties(lg.prototype,{stiffness:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t)}},length:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t)}}}),lg.className="ForceDirectedEdge";function ld(){var t=0;t===void 0&&(t=42),this.seed=t,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}ld.prototype.random=function(){var t=this.seed%this.Q*this.ay-this.seed/this.Q*this.gy;return 0<t?this.seed=t:this.seed=t+this.ey,this.seed*this.by},ld.className="RandomNumberGenerator";function co(t){hs.call(this),this.kc=this.ie=25,this.K=0,this.Dk=Uu,this.Zk=kf,this.Qk=cm,this.bj=4,this.rk=j1,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new G,this.He=[],this.He.length=100,this.xw=this.ve=0,t&&Object.assign(this,t)}li(co,hs),co.prototype.cloneProtected=function(t){hs.prototype.cloneProtected.call(this,t),t.ie=this.ie,t.kc=this.kc,t.K=this.K,t.Dk=this.Dk,t.Zk=this.Zk,t.Qk=this.Qk,t.bj=this.bj,t.rk=this.rk,t.bg=this.bg,t.sf=this.sf,t.Cn=this.Cn,t.ve=this.ve},co.prototype.qb=function(t){t.classType===co?t.name.indexOf("Aggressive")===0?this.aggressiveOption=t:t.name.indexOf("Cycle")===0?this.cycleRemoveOption=t:t.name.indexOf("Init")===0?this.initializeOption=t:t.name.indexOf("Layer")===0?this.layeringOption=t:Mt("Unknown enum value: "+t):hs.prototype.qb.call(this,t)},co.prototype.createNetwork=function(){return new Mv(this)},co.prototype.doLayout=function(t){for(this.network===null&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.Iq=-1,this.Md=this.Hn=0,this.fl=this.Jn=this.kj=null,t=0;t<this.He.length;t++)this.He[t]=null;if(0<this.network.vertexes.count){for(this.network.Ko(),this.cycleRemoveOption!==lf&&this.removeCycles(),t=this.network.vertexes.iterator;t.next();)t.value.layer=-1;for(this.Ia=-1,this.assignLayers(),t.reset();t.next();)this.Ia=Math.max(this.Ia,t.value.layer);this.cycleRemoveOption===lf&&this.removeCycles(),t=this.network;for(var e=[],i=t.edges.iterator;i.next();){var n=i.value;n.valid=!1,e.push(n)}for(i=0;i<e.length;i++){n=e[i];var s=n.fromVertex,a=n.toVertex;if(!(n.valid||(s.node===null&&s.data===null||a.node===null&&a.data===null)&&s.layer===a.layer)){var l=0,c=0,p=0,m=0;if(n.link!==null){if(c=n.link,c===null)continue;var v=s.node;if(l=a.node,v===null||l===null)continue;var w=c.fromNode;p=c.toNode;for(var C=c.fromPort;C!==null&&!C.Ed();)C=C.panel;for(c=c.toPort;c!==null&&!c.Ed();)c=c.panel;if(n.rev){m=w;var k=C;w=p,C=c,p=m,c=k}var T=s.focus;m=a.focus;var A=n.rev?a.bounds:s.bounds;k=G.alloc(),v!==w?A.w()&&w.isVisible()?w.actualBounds.w()?(zf(w,C,_n,k),k.x+=w.actualBounds.x-A.x,k.y+=w.actualBounds.y-A.y):(zf(w,C,_n,k),k.w()||k.assign(T)):k.assign(T):A.w()?(zf(w,C,_n,k),k.w()||k.assign(T)):k.assign(T),w=n.rev?s.bounds:a.bounds,v=G.alloc(),l!==p?w.w()&&p.isVisible()?p.actualBounds.w()?(zf(p,c,_n,v),v.x+=p.actualBounds.x-w.x,v.y+=p.actualBounds.y-w.y):(zf(p,c,_n,v),v.w()||v.assign(m)):v.assign(m):w.w()?(zf(p,c,_n,v),v.w()||v.assign(m)):v.assign(m),this.K===90||this.K===270?(l=Math.round((k.x-T.x)/this.kc),p=k.x,c=Math.round((v.x-m.x)/this.kc),m=v.x):(l=Math.round((k.y-T.y)/this.kc),p=k.y,c=Math.round((v.y-m.y)/this.kc),m=v.y),G.free(k),G.free(v),n.portFromColOffset=l,n.portFromPos=p,n.portToColOffset=c,n.portToPos=m}else n.portFromColOffset=0,n.portFromPos=0,n.portToColOffset=0,n.portToPos=0;if(k=s.layer,v=a.layer,w=0,A=n.link,A!==null){var X=A.fromPort,$=A.toPort;if(X!==null&&$!==null){var J=A.fromNode;if(C=A.toNode,J!==null&&C!==null){var et=qh(this,!0),st=qh(this,!1),mt=this.setsPortSpots?et:A.computeSpot(!0,X);T=this.setsPortSpots?st:A.computeSpot(!1,$);var Pt=A.isOrthogonal;mt.$c()&&mt.Hf(st)&&T.$c()&&T.Hf(et)?w=0:(et=A.getLinkPoint(J,X,mt,!0,Pt,C,$,G.alloc()),st=A.getLinkDirection(J,X,et,mt,!0,Pt,C,$),G.free(et),mt.ys()||st!==Bt(this,n,!0)?this.setsPortSpots&&J!==null&&J.ports.count===1&&n.rev&&(w+=1):w+=1,mt=A.getLinkPoint(C,$,T,!1,Pt,J,X,G.alloc()),A=A.getLinkDirection(C,$,mt,T,!1,Pt,J,X),G.free(mt),T.ys()||A!==Bt(this,n,!1)?this.setsPortSpots&&C!==null&&C.ports.count===1&&n.rev&&(w+=2):w+=2)}}}if(C=w,w=C===1||C===3,(C=C===2||C===3)&&(T=t.createVertex(),T.node=null,T.Dj=1,T.layer=k,T.near=s,t.dh(T),s=t.Zj(s,T,n.link),s.valid=!1,s.rev=n.rev,s.portFromColOffset=l,s.portToColOffset=0,s.portFromPos=p,s.portToPos=0,s=T),A=1,w&&A--,k-v>A&&0<k){for(n.valid=!1,T=t.createVertex(),T.node=null,T.Dj=2,T.layer=k-1,t.dh(T),s=t.Zj(s,T,n.link),s.valid=!0,s.rev=n.rev,s.portFromColOffset=C?0:l,s.portToColOffset=0,s.portFromPos=C?0:p,s.portToPos=0,s=T,k--;k-v>A&&0<k;)T=t.createVertex(),T.node=null,T.Dj=3,T.layer=k-1,t.dh(T),s=t.Zj(s,T,n.link),s.valid=!0,s.rev=n.rev,s.portFromColOffset=0,s.portToColOffset=0,s.portFromPos=0,s.portToPos=0,s=T,k--;s=t.Zj(T,a,n.link),s.valid=!w,w&&(T.near=a),s.rev=n.rev,s.portFromColOffset=0,s.portToColOffset=c,s.portFromPos=0,s.portToPos=m}else n.valid=!0}}for(t=this.tc=[],e=0;e<=this.Ia;e++)t[e]=0;for(e=this.network.vertexes.iterator;e.next();)e.value.index=-1;for(this.initializeIndices(),this.Iq=-1,i=this.Md=this.Hn=0;i<=this.Ia;i++)t[i]>t[this.Md]&&(this.Iq=t[i]-1,this.Md=i),t[i]<t[this.Hn]&&(this.Hn=i);for(this.fl=[],i=0;i<t.length;i++)this.fl[i]=[];for(e.reset();e.next();)t=e.value,this.fl[t.layer][t.index]=t;for(this.Ra=-1,t=0;t<=this.Ia;t++){for(e=Sa(this,t),i=0,n=this.tc[t],a=0;a<n;a++)s=e[a],i+=this.nodeMinColumnSpace(s,!0),s.column=i,i+=1,i+=this.nodeMinColumnSpace(s,!1);this.Ra=Math.max(this.Ra,i-1),bl(this,t,e)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},co.prototype.linkMinLength=function(){return 1};function $1(t){var e=t.fromVertex.node||t.fromVertex.data;return t=t.toVertex.node||t.toVertex.data,e===null&&t===null?8:e===null||t===null?4:1}co.prototype.nodeMinLayerSpace=function(t,e){return t.node===null&&t.data===null?0:this.K===90||this.K===270?e?t.focus.y+10:t.bounds.height-t.focus.y+10:e?t.focus.x+10:t.bounds.width-t.focus.x+10},co.prototype.nodeMinColumnSpace=function(t,e){if(t.node===null&&t.data===null)return 0;var i=e?t.ev:t.dv;return i!==null?i:(i=this.K,i===90||i===270?e?t.ev=t.focus.x/this.kc+1|0:t.dv=(t.bounds.width-t.focus.x)/this.kc+1|0:e?t.ev=t.focus.y/this.kc+1|0:t.dv=(t.bounds.height-t.focus.y)/this.kc+1|0)};function ch(t){t.kj===null&&(t.kj=[]);for(var e=0,i=t.network.vertexes.iterator;i.next();){var n=i.value;t.kj[e]=n.layer,e++,t.kj[e]=n.column,e++,t.kj[e]=n.index,e++}return t.kj}function dc(t,e){var i=0;for(t=t.network.vertexes.iterator;t.next();){var n=t.value;n.layer=e[i],i++,n.column=e[i],i++,n.index=e[i],i++}}function Sx(t,e,i){var n=Sa(t,e),s=t.tc[e];(t.Jn===null||t.Jn.length<s*s)&&(t.Jn=[]);for(var a=t.Jn,l=0;l<s;l++){var c=0,p=n[l],m=p.near;if(m!==null&&m.layer===p.layer)if(p=m.index,p>l)for(var v=l+1;v<p;v++){var w=n[v];w.near===m&&w.Dj===m.Dj||c++}else for(v=l-1;v>p;v--)w=n[v],w.near===m&&w.Dj===m.Dj||c++;var C;if(0<=i)for(p=n[l].sourceEdgesArrayAccess,m=0;m<p.length;m++){var k=p[m];if(k.valid&&k.fromVertex.layer!==e)for(w=k.fromVertex.index,v=k.portToPos,k=k.portFromPos,C=m+1;C<p.length;C++){var T=p[C];if(T.valid&&T.fromVertex.layer!==e){var A=T.fromVertex.index,X=T.portToPos;T=T.portFromPos,v<X&&(w>A||w===A&&k>T)&&c++,X<v&&(A>w||A===w&&T>k)&&c++}}}if(0>=i){for(p=n[l].destinationEdgesArrayAccess,m=0;m<p.length;m++)if(k=p[m],k.valid&&k.toVertex.layer!==e)for(w=k.toVertex.index,v=k.portToPos,k=k.portFromPos,C=m+1;C<p.length;C++)T=p[C],T.valid&&T.toVertex.layer!==e&&(A=T.toVertex.index,X=T.portToPos,T=T.portFromPos,k<T&&(w>A||w===A&&v>X)&&c++,T<k&&(A>w||A===w&&X>v)&&c++)}for(a[l*s+l]=c,p=l+1;p<s;p++){var $=0,J=0;if(0<=i){c=n[l].sourceEdgesArrayAccess;var et=n[p].sourceEdgesArrayAccess;for(m=0;m<c.length;m++)if(k=c[m],k.valid&&k.fromVertex.layer!==e)for(w=k.fromVertex.index,k=k.portFromPos,C=0;C<et.length;C++)T=et[C],T.valid&&T.fromVertex.layer!==e&&(A=T.fromVertex.index,T=T.portFromPos,(w<A||w===A&&k<T)&&J++,(A<w||A===w&&T<k)&&$++)}if(0>=i){for(c=n[l].destinationEdgesArrayAccess,et=n[p].destinationEdgesArrayAccess,m=0;m<c.length;m++)if(k=c[m],k.valid&&k.toVertex.layer!==e)for(w=k.toVertex.index,v=k.portToPos,C=0;C<et.length;C++)T=et[C],T.valid&&T.toVertex.layer!==e&&(A=T.toVertex.index,X=T.portToPos,(w<A||w===A&&v<X)&&J++,(A<w||A===w&&X<v)&&$++)}a[l*s+p]=$,a[p*s+l]=J}}return bl(t,e,n),a}co.prototype.countCrossings=function(){for(var t=0,e=0;e<=this.Ia;e++)for(var i=Sx(this,e,1),n=this.tc[e],s=0;s<n;s++)for(var a=s;a<n;a++)t+=i[s*n+a];return t};function r(t){for(var e=0,i=0;i<=t.Ia;i++){for(var n=t,s=i,a=Sa(n,s),l=n.tc[s],c=0,p=0;p<l;p++){var m=a[p].destinationEdgesArrayAccess;if(m!==null)for(var v=0;v<m.length;v++){var w=m[v];if(w.valid&&w.toVertex.layer!==s){var C=w.fromVertex.column+w.portFromColOffset,k=w.toVertex.column+w.portToColOffset;c+=(Math.abs(C-k)+1)*$1(w)}}}bl(n,s,a),e+=c}return e}co.prototype.normalize=function(){var t=1/0;this.Ra=-1;for(var e=this.network.vertexes.iterator;e.next();){var i=e.value;t=Math.min(t,i.column-this.nodeMinColumnSpace(i,!0)),this.Ra=Math.max(this.Ra,i.column+this.nodeMinColumnSpace(i,!1))}for(e.reset();e.next();)e.value.column-=t;this.Ra-=t};function o(t,e,i){for(var n=Sa(t,e),s=t.tc[e],a=[],l=0;l<s;l++){var c=n[l],p=null;0>=i&&(p=c.sourceEdgesArrayAccess);var m=null;0<=i&&(m=c.destinationEdgesArrayAccess);var v=0,w=0,C=c.near;if(C!==null&&C.layer===c.layer&&(v+=C.column-1,w++),p!==null)for(C=0;C<p.length;C++){c=p[C];var k=c.fromVertex;c.valid&&!c.rev&&k.layer!==e&&(v+=k.column,w++)}if(m!==null)for(p=0;p<m.length;p++)c=m[p],C=c.toVertex,c.valid&&!c.rev&&C.layer!==e&&(v+=C.column,w++);a[l]=w===0?-1:v/w}return bl(t,e,n),a}function u(t,e,i){for(var n=Sa(t,e),s=t.tc[e],a=[],l=0;l<s;l++){var c=n[l],p=null;0>=i&&(p=c.sourceEdgesArrayAccess);var m=null;0<=i&&(m=c.destinationEdgesArrayAccess);var v=0,w=[],C=c.near;if(C!==null&&C.layer===c.layer&&(w[v]=C.column-1,v++),c=void 0,p!==null)for(C=0;C<p.length;C++){c=p[C];var k=c.fromVertex;c.valid&&!c.rev&&k.layer!==e&&(w[v]=k.column+c.portFromColOffset,v++)}if(m!==null)for(p=0;p<m.length;p++)c=m[p],C=c.toVertex,c.valid&&!c.rev&&C.layer!==e&&(w[v]=C.column+c.portToColOffset,v++);v===0?a[l]=-1:(w.sort(function(T,A){return T-A}),m=v>>1,a[l]=v&1?w[m]:w[m-1]+w[m]>>1)}return bl(t,e,n),a}function f(t,e,i,n,s,a){if(e.component===n){if(e.component=i,s)for(var l=e.destinationEdges;l.next();){var c=l.value,p=c.toVertex,m=e.layer-p.layer;c=t.linkMinLength(c),m===c&&f(t,p,i,n,s,a)}if(a)for(l=e.sourceEdges;l.next();)c=l.value,p=c.fromVertex,m=p.layer-e.layer,c=t.linkMinLength(c),m===c&&f(t,p,i,n,s,a)}}function g(t,e,i,n,s,a){if(e.component===n){if(e.component=i,s)for(var l=e.destinationEdges;l.next();)g(t,l.value.toVertex,i,n,s,a);if(a)for(e=e.sourceEdges;e.next();)g(t,e.value.fromVertex,i,n,s,a)}}co.prototype.removeCycles=function(){for(var t=this.network.edges.iterator;t.next();)t.value.rev=!1;switch(this.Dk){default:case Kf:t=this.network;var e=0,i=t.vertexes.count-1,n=[];n.length=i+1;for(var s=t.vertexes.iterator;s.next();)s.value.valid=!0;for(;b(t)!==null;){for(s=M(t);s!==null;)n[i]=s,i--,s.valid=!1,s=M(t);for(s=N(t);s!==null;)n[e]=s,e++,s.valid=!1,s=N(t);s=null;for(var a=0,l=this.network.vertexes.iterator;l.next();){var c=l.value;if(c.valid){for(var p=0,m=c.destinationEdges;m.next();)m.value.toVertex.valid&&p++;m=0;for(var v=c.sourceEdges;v.next();)v.value.fromVertex.valid&&m++;(s===null||a<p-m)&&(s=c,a=p-m)}}s!==null&&(n[e]=s,e++,s.valid=!1)}for(e=0;e<t.vertexes.count;e++)n[e].index=e;for(n=t.edges.iterator;n.next();)e=n.value,e.fromVertex.index>e.toVertex.index&&(t.gm(e),e.rev=!0);break;case Uu:for(n=this.network.vertexes.iterator;n.next();)t=n.value,t.Ll=-1,t.finish=-1;for(t=this.network.edges.iterator;t.next();)t.value.forest=!1;for(this.Kn=0,n.reset();n.next();)e=n.value,e.sourceEdges.count===0&&I(this,e);for(n.reset();n.next();)e=n.value,e.Ll===-1&&I(this,e);for(t.reset();t.next();)n=t.value,n.forest||(e=n.fromVertex,i=e.finish,s=n.toVertex,a=s.finish,s.Ll<e.Ll&&i<a&&(this.network.gm(n),n.rev=!0));break;case lf:for(t=this.network,e=t.vertexes.iterator,n=1/0;e.next();)n=Math.min(n,e.value.layer);if(1/0>n){if(0>n)for(e.reset();e.next();)e.value.layer-=n;for(n=[],e.reset();e.next();)i=e.value,s=n[i.layer],s===void 0?n[i.layer]=[i]:s.push(i);for(i=e=0;i<n.length;i++)if(s=n[i],!s||s.length===0)e++;else if(0<i)for(a=0;a<s.length;a++)s[a].layer-=e;for(n=t.edges.iterator;n.next();)e=n.value,e.fromVertex.layer<e.toVertex.layer&&(t.gm(e),e.rev=!0)}}};function b(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid)return e}return null}function M(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid){for(var i=!0,n=e.destinationEdges;n.next();)if(n.value.toVertex.valid){i=!1;break}if(i)return e}}return null}function N(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid){for(var i=!0,n=e.sourceEdges;n.next();)if(n.value.fromVertex.valid){i=!1;break}if(i)return e}}return null}function I(t,e){e.Ll=t.Kn,t.Kn++;for(var i=e.destinationEdges;i.next();){var n=i.value,s=n.toVertex;s.Ll===-1&&(n.forest=!0,I(t,s))}e.finish=t.Kn,t.Kn++}co.prototype.assignLayers=function(){switch(this.Zk){case Hf:B(this);break;case Ef:for(var t,e=this.network.vertexes.iterator;e.next();)t=lt(this,e.value),this.Ia=Math.max(t,this.Ia);for(e.reset();e.next();)t=e.value,t.layer=this.Ia-t.layer;break;default:case kf:for(B(this),e=this.network.vertexes.iterator;e.next();)e.value.valid=!1;for(e.reset();e.next();)t=e.value,t.sourceEdges.count===0&&Lt(this,t);for(t=1/0,e.reset();e.next();)t=Math.min(t,e.value.layer);for(this.Ia=-1,e.reset();e.next();){var i=e.value;i.layer-=t,this.Ia=Math.max(this.Ia,i.layer)}}};function B(t){for(var e=t.network.vertexes.iterator;e.next();){var i=U(t,e.value);t.Ia=Math.max(i,t.Ia)}}function U(t,e){var i=0;if(e.layer===-1){for(var n=e.destinationEdges;n.next();){var s=n.value,a=s.toVertex;s=t.linkMinLength(s),i=Math.max(i,U(t,a)+s)}e.layer=i}else i=e.layer;return i}function lt(t,e){var i=0;if(e.layer===-1){for(var n=e.sourceEdges;n.next();){var s=n.value,a=s.fromVertex;s=t.linkMinLength(s),i=Math.max(i,lt(t,a)+s)}e.layer=i}else i=e.layer;return i}function Lt(t,e){if(!e.valid){e.valid=!0;for(var i=e.destinationEdges;i.next();)Lt(t,i.value.toVertex);for(i=t.network.vertexes.iterator;i.next();)i.value.component=-1;for(var n=e.sourceEdgesArrayAccess,s=n.length,a=0;a<s;a++){var l=n[a],c=l.fromVertex,p=l.toVertex;l=t.linkMinLength(l),c.layer-p.layer>l&&f(t,c,0,-1,!0,!1)}for(f(t,e,1,-1,!0,!0);e.component!==0;){for(a=0,n=1/0,c=0,p=null,l=t.network.vertexes.iterator;l.next();){var m=l.value;if(m.component===1){var v=0,w=!1,C=m.sourceEdgesArrayAccess;s=C.length;for(var k=0;k<s;k++){var T=C[k],A=T.fromVertex;v+=1,A.component!==1&&(a+=1,A=A.layer-m.layer,T=t.linkMinLength(T),n=Math.min(n,A-T))}for(C=m.destinationEdgesArrayAccess,s=C.length,k=0;k<s;k++)T=C[k].toVertex,--v,T.component!==1?--a:w=!0;(p===null||v<c)&&!w&&(p=m,c=v)}}if(0<a){for(i.reset();i.next();)s=i.value,s.component===1&&(s.layer+=n);e.component=0}else p.component=0}for(i=t.network.vertexes.iterator;i.next();)i.value.component=-1;for(f(t,e,1,-1,!0,!1);e.component!==0;){for(n=0,s=1/0,a=0,c=null,p=t.network.vertexes.iterator;p.next();)if(l=p.value,l.component===1){for(m=0,v=!1,C=l.sourceEdgesArrayAccess,w=C.length,k=0;k<w;k++)T=C[k].fromVertex,m+=1,T.component!==1?n+=1:v=!0;for(C=l.destinationEdgesArrayAccess,w=C.length,k=0;k<w;k++)T=C[k],A=T.toVertex,--m,A.component!==1&&(--n,A=l.layer-A.layer,T=t.linkMinLength(T),s=Math.min(s,A-T));(c===null||m>a)&&!v&&(c=l,a=m)}if(0>n){for(i.reset();i.next();)n=i.value,n.component===1&&(n.layer-=s);e.component=0}else c.component=0}}}function Bt(t,e,i){return t.K===90?i&&!e.rev||!i&&e.rev?270:90:t.K===180?i&&!e.rev||!i&&e.rev?0:180:t.K===270?i&&!e.rev||!i&&e.rev?90:270:i&&!e.rev||!i&&e.rev?180:0}co.prototype.initializeIndices=function(){switch(this.Qk){default:case Cx:for(var t=this.network.vertexes.iterator;t.next();){var e=t.value,i=e.layer;e.index=this.tc[i],this.tc[i]++}break;case cm:for(t=this.network.vertexes.iterator,e=this.Ia;0<=e;e--)for(t.reset();t.next();)i=t.value,i.layer===e&&i.index===-1&&jt(this,i);break;case Mx:for(t=this.network.vertexes.iterator,e=0;e<=this.Ia;e++)for(t.reset();t.next();)i=t.value,i.layer===e&&i.index===-1&&je(this,i)}};function jt(t,e){var i=e.layer;for(e.index=t.tc[i],t.tc[i]++,e=e.destinationEdgesArrayAccess,i=!0;i;){i=!1;for(var n=0;n<e.length-1;n++){var s=e[n],a=e[n+1];s.portFromColOffset>a.portFromColOffset&&(i=!0,e[n]=a,e[n+1]=s)}}for(i=0;i<e.length;i++)n=e[i],n.valid&&(n=n.toVertex,n.index===-1&&jt(t,n))}function je(t,e){var i=e.layer;e.index=t.tc[i],t.tc[i]++,e=e.sourceEdgesArrayAccess;for(var n=!0;n;)for(n=!1,i=0;i<e.length-1;i++){var s=e[i],a=e[i+1];s.portToColOffset>a.portToColOffset&&(n=!0,e[i]=a,e[i+1]=s)}for(i=0;i<e.length;i++)n=e[i],n.valid&&(n=n.fromVertex,n.index===-1&&je(t,n))}co.prototype.reduceCrossings=function(){var t=this.countCrossings(),e=ch(this),i,n;for(i=0;i<this.bj;i++){for(n=0;n<=this.Ia;n++)Zi(this,n,1),Le(this,n,1);var s=this.countCrossings();for(s<t&&(t=s,e=ch(this)),n=this.Ia;0<=n;n--)Zi(this,n,-1),Le(this,n,-1);s=this.countCrossings(),s<t&&(t=s,e=ch(this))}for(dc(this,e),i=0;i<this.bj;i++){for(n=0;n<=this.Ia;n++)Zi(this,n,0),Le(this,n,0);for(s=this.countCrossings(),s<t&&(t=s,e=ch(this)),n=this.Ia;0<=n;n--)Zi(this,n,0),Le(this,n,0);s=this.countCrossings(),s<t&&(t=s,e=ch(this))}dc(this,e);var a,l,c;switch(this.rk){case kx:break;case Ex:for(c=t+1;(n=this.countCrossings())<c;)for(c=n,i=this.Ia;0<=i;i--)for(l=0;l<=i;l++){for(a=!0;a;)for(a=!1,n=i;n>=l;n--)a=Le(this,n,-1)||a;for(s=this.countCrossings(),s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=i;n>=l;n--)a=Le(this,n,1)||a;for(s=this.countCrossings(),s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=Le(this,n,1)||a;for(s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=Le(this,n,-1)||a;for(s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=i;n>=l;n--)a=Le(this,n,0)||a;for(s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=Le(this,n,0)||a;s>=t?dc(this,e):(t=s,e=ch(this))}break;default:case j1:for(i=this.Ia,l=0,c=t+1;(n=this.countCrossings())<c;){for(c=n,a=!0;a;)for(a=!1,n=i;n>=l;n--)a=Le(this,n,-1)||a;for(s=this.countCrossings(),s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=i;n>=l;n--)a=Le(this,n,1)||a;for(s=this.countCrossings(),s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=Le(this,n,1)||a;for(s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=Le(this,n,-1)||a;for(s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=i;n>=l;n--)a=Le(this,n,0)||a;for(s>=t?dc(this,e):(t=s,e=ch(this)),a=!0;a;)for(a=!1,n=l;n<=i;n++)a=Le(this,n,0)||a;s>=t?dc(this,e):(t=s,e=ch(this))}}dc(this,e)};function Zi(t,e,i){var n=Sa(t,e),s=t.tc[e],a=u(t,e,i),l=o(t,e,i);for(i=0;i<s;i++)l[i]===-1&&(l[i]=n[i].column),a[i]===-1&&(a[i]=n[i].column);for(var c=!0,p;c;)for(c=!1,i=0;i<s-1;i++)(a[i+1]<a[i]||a[i+1]===a[i]&&l[i+1]<l[i])&&(c=!0,p=a[i],a[i]=a[i+1],a[i+1]=p,p=l[i],l[i]=l[i+1],l[i+1]=p,p=n[i],n[i]=n[i+1],n[i+1]=p);for(i=a=0;i<s;i++)p=n[i],p.index=i,a+=t.nodeMinColumnSpace(p,!0),p.column=a,a+=1,a+=t.nodeMinColumnSpace(p,!1);bl(t,e,n)}function Le(t,e,i){var n=Sa(t,e),s=t.tc[e];i=Sx(t,e,i);var a,l=[];for(a=0;a<s;a++)l[a]=-1;var c=[];for(a=0;a<s;a++)c[a]=-1;for(var p=!1,m=!0;m;)for(m=!1,a=0;a<s-1;a++){var v=i[n[a].index*s+n[a+1].index],w=i[n[a+1].index*s+n[a].index],C=0,k=0,T=n[a].column,A=n[a+1].column,X=t.nodeMinColumnSpace(n[a],!0),$=t.nodeMinColumnSpace(n[a],!1),J=t.nodeMinColumnSpace(n[a+1],!0),et=t.nodeMinColumnSpace(n[a+1],!1);X=T-X+J,$=A-$+et;var st=n[a].sourceEdges.iterator;for(st.reset();st.next();)if(J=st.value,et=J.fromVertex,J.valid&&et.layer===e){for(J=0;n[J]!==et;)J++;J<a&&(C+=2*(a-J),k+=2*(a+1-J)),J===a+1&&(C+=1),J>a+1&&(C+=4*(J-a),k+=4*(J-(a+1)))}for(st=n[a].destinationEdges.iterator,st.reset();st.next();)if(J=st.value,et=J.toVertex,J.valid&&et.layer===e){for(J=0;n[J]!==et;)J++;J===a+1&&(k+=1)}for(st=n[a+1].sourceEdges.iterator,st.reset();st.next();)if(J=st.value,et=J.fromVertex,J.valid&&et.layer===e){for(J=0;n[J]!==et;)J++;J<a&&(C+=2*(a+1-J),k+=2*(a-J)),J===a&&(k+=1),J>a+1&&(C+=4*(J-(a+1)),k+=4*(J-a))}for(st=n[a+1].destinationEdges.iterator,st.reset();st.next();)if(J=st.value,et=J.toVertex,J.valid&&et.layer===e){for(J=0;n[J]!==et;)J++;J===a&&(C+=1)}J=et=0,st=l[n[a].index];var mt=c[n[a].index],Pt=l[n[a+1].index],De=c[n[a+1].index];st!==-1&&(et+=Math.abs(st-T),J+=Math.abs(st-$)),mt!==-1&&(et+=Math.abs(mt-T),J+=Math.abs(mt-$)),Pt!==-1&&(et+=Math.abs(Pt-A),J+=Math.abs(Pt-X)),De!==-1&&(et+=Math.abs(De-A),J+=Math.abs(De-X)),(k<C-.5||k===C&&w<v-.5||k===C&&w===v&&J<et-.5)&&(m=p=!0,n[a].column=$,n[a+1].column=X,v=n[a],n[a]=n[a+1],n[a+1]=v)}for(a=0;a<s;a++)n[a].index=a;return bl(t,e,n),p}co.prototype.straightenAndPack=function(){if(this.ve===0){var t=(this.bg&1)!==0,e=(this.bg&$2)!==0;if(1e3<this.network.edges.count&&e&&(t=!1),t){var i=[];for(e=0;e<=this.Ia;e++)i[e]=0;for(var n,s=this.network.vertexes.iterator;s.next();){var a=s.value;e=a.layer,n=a.column,a=this.nodeMinColumnSpace(a,!1),i[e]=Math.max(i[e],n+a)}for(s.reset();s.next();)a=s.value,e=a.layer,n=a.column,a.column=(8*(this.Ra-i[e])>>1)+8*n;this.Ra*=8}if(this.bg&2)for(i=!0;i;){for(i=!1,e=this.Md+1;e<=this.Ia;e++)i=Ci(this,e,1)||i;for(e=this.Md-1;0<=e;e--)i=Ci(this,e,-1)||i;i=Ci(this,this.Md,0)||i}if(this.bg&4){for(e=this.Md+1;e<=this.Ia;e++)Oi(this,e,1);for(e=this.Md-1;0<=e;e--)Oi(this,e,-1);Oi(this,this.Md,0)}if(t&&(Er(this,-1),Er(this,1)),this.bg&2)for(i=!0;i;){for(i=!1,i=Ci(this,this.Md,0)||i,e=this.Md+1;e<=this.Ia;e++)i=Ci(this,e,0)||i;for(e=this.Md-1;0<=e;e--)i=Ci(this,e,0)||i}}else wl(this)};function Ci(t,e,i){for(var n=!1;en(t,e,i);)n=!0;return n}function en(t,e,i){var n,s=Sa(t,e),a=t.tc[e],l=o(t,e,-1);if(0<i)for(n=0;n<a;n++)l[n]=-1;var c=o(t,e,1);if(0>i)for(n=0;n<a;n++)c[n]=-1;for(var p=!1,m=!0;m;)for(m=!1,n=0;n<a;n++){var v=s[n].column,w=t.nodeMinColumnSpace(s[n],!0),C=t.nodeMinColumnSpace(s[n],!1),k=0;0>n-1||v-s[n-1].column-1>w+t.nodeMinColumnSpace(s[n-1],!1)?k=v-1:k=v,w=n+1>=a||s[n+1].column-v-1>C+t.nodeMinColumnSpace(s[n+1],!0)?v+1:v;var T=C=0,A=0;if(0>=i)for(var X=s[n].sourceEdges.iterator;X.next();){var $=X.value,J=$.fromVertex;if($.valid&&J.layer!==e){var et=$1($),st=$.portFromColOffset;$=$.portToColOffset,J=J.column,C+=(Math.abs(v+$-(J+st))+1)*et,T+=(Math.abs(k+$-(J+st))+1)*et,A+=(Math.abs(w+$-(J+st))+1)*et}}if(0<=i)for(X=s[n].destinationEdges.iterator;X.next();)$=X.value,J=$.toVertex,$.valid&&J.layer!==e&&(et=$1($),st=$.portFromColOffset,$=$.portToColOffset,J=J.column,C+=(Math.abs(v+st-(J+$))+1)*et,T+=(Math.abs(k+st-(J+$))+1)*et,A+=(Math.abs(w+st-(J+$))+1)*et);$=st=et=0,X=l[s[n].index],J=c[s[n].index],X!==-1&&(et+=Math.abs(X-v),st+=Math.abs(X-k),$+=Math.abs(X-w)),J!==-1&&(et+=Math.abs(J-v),st+=Math.abs(J-k),$+=Math.abs(J-w)),T<C||T===C&&st<et?(m=p=!0,s[n].column=k):(A<C||A===C&&$<et)&&(m=p=!0,s[n].column=w)}return bl(t,e,s),t.normalize(),p}function Oi(t,e,i){var n=Sa(t,e),s=t.tc[e],a=u(t,e,i),l=[];for(i=0;i<s;i++)l[i]=a[i];for(a=!0;a;)for(a=!1,i=0;i<s;i++){var c=n[i].column,p=t.nodeMinColumnSpace(n[i],!0),m=t.nodeMinColumnSpace(n[i],!1),v=0;if(l[i]===-1)if(i===0&&i===s-1)v=c;else if(i===0){var w=n[i+1].column;w-c===m+t.nodeMinColumnSpace(n[i+1],!0)?v=c-1:v=c}else i===s-1?(w=n[i-1].column,v=c-w===p+t.nodeMinColumnSpace(n[i-1],!1)?c+1:c):(w=n[i-1].column,p=w+t.nodeMinColumnSpace(n[i-1],!1)+p+1,w=n[i+1].column,m=w-t.nodeMinColumnSpace(n[i+1],!0)-m-1,v=(p+m)/2|0);else i===0&&i===s-1?v=l[i]:i===0?(w=n[i+1].column,m=w-t.nodeMinColumnSpace(n[i+1],!0)-m-1,v=Math.min(l[i],m)):i===s-1?(w=n[i-1].column,p=w+t.nodeMinColumnSpace(n[i-1],!1)+p+1,v=Math.max(l[i],p)):(w=n[i-1].column,p=w+t.nodeMinColumnSpace(n[i-1],!1)+p+1,w=n[i+1].column,m=w-t.nodeMinColumnSpace(n[i+1],!0)-m-1,p<l[i]&&l[i]<m?v=l[i]:p>=l[i]?v=p:m<=l[i]&&(v=m));v!==c&&(a=!0,n[i].column=v)}bl(t,e,n),t.normalize()}function hr(t,e){for(var i=!0,n=t.network.vertexes.iterator;n.next();){var s=n.value,a=t.nodeMinColumnSpace(s,!0),l=t.nodeMinColumnSpace(s,!1);if(s.column-a<=e&&s.column+l>=e){i=!1;break}}if(t=!1,i)for(n.reset();n.next();)i=n.value,i.column>e&&(--i.column,t=!0);return t}function Jr(t,e){var i=e+1,n,s=[],a=[];for(n=0;n<=t.Ia;n++)s[n]=!1,a[n]=!1;for(var l=t.network.vertexes.iterator;l.next();){n=l.value;var c=n.column-t.nodeMinColumnSpace(n,!0),p=n.column+t.nodeMinColumnSpace(n,!1);c<=e&&p>=e&&(s[n.layer]=!0),c<=i&&p>=i&&(a[n.layer]=!0)}for(c=!0,i=!1,n=0;n<=t.Ia;n++)c=c&&!(s[n]&&a[n]);if(c)for(l.reset();l.next();)t=l.value,t.column>e&&(--t.column,i=!0);return i}function Er(t,e){for(var i=0;i<=t.Ra;i++)for(;hr(t,i););for(t.normalize(),i=0;i<t.Ra;i++)for(;Jr(t,i););t.normalize();var n;if(0<e)for(i=0;i<=t.Ra;i++){var s=ch(t),a=r(t);for(n=a+1;a<n;){n=a,ta(t,i,1);var l=r(t);l>a?dc(t,s):l<a&&(a=l,s=ch(t))}}if(0>e)for(i=t.Ra;0<=i;i--)for(s=ch(t),a=r(t),n=a+1;a<n;)n=a,ta(t,i,-1),l=r(t),l>a?dc(t,s):l<a&&(a=l,s=ch(t));t.normalize()}function ta(t,e,i){t.le=0;for(var n=t.network.vertexes.iterator;n.next();)n.value.component=-1;if(0<i)for(n.reset();n.next();){var s=n.value;s.column-t.nodeMinColumnSpace(s,!0)<=e&&(s.component=t.le)}if(0>i)for(n.reset();n.next();)s=n.value,s.column+t.nodeMinColumnSpace(s,!1)>=e&&(s.component=t.le);for(t.le++,n.reset();n.next();)e=n.value,e.component===-1&&(g(t,e,t.le,-1,!0,!0),t.le++);var a;for(e=[],a=0;a<t.le*t.le;a++)e[a]=!1;for(s=[],a=0;a<(t.Ia+1)*(t.Ra+1);a++)s[a]=-1;for(n.reset();n.next();){a=n.value;for(var l=a.layer,c=Math.max(0,a.column-t.nodeMinColumnSpace(a,!0)),p=Math.min(t.Ra,a.column+t.nodeMinColumnSpace(a,!1));c<=p;c++)s[l*(t.Ra+1)+c]=a.component}for(a=0;a<=t.Ia;a++){if(0<i)for(l=0;l<t.Ra;l++)s[a*(t.Ra+1)+l]!==-1&&s[a*(t.Ra+1)+l+1]!==-1&&s[a*(t.Ra+1)+l]!==s[a*(t.Ra+1)+l+1]&&(e[s[a*(t.Ra+1)+l]*t.le+s[a*(t.Ra+1)+l+1]]=!0);if(0>i)for(l=t.Ra;0<l;l--)s[a*(t.Ra+1)+l]!==-1&&s[a*(t.Ra+1)+l-1]!==-1&&s[a*(t.Ra+1)+l]!==s[a*(t.Ra+1)+l-1]&&(e[s[a*(t.Ra+1)+l]*t.le+s[a*(t.Ra+1)+l-1]]=!0)}for(s=[],a=0;a<t.le;a++)s[a]=!0;for(l=[],l.push(0);l.length!==0;)if(p=l[l.length-1],l.pop(),s[p])for(s[p]=!1,a=0;a<t.le;a++)e[p*t.le+a]&&l.splice(0,0,a);if(0<i)for(n.reset();n.next();)t=n.value,s[t.component]&&--t.column;if(0>i)for(n.reset();n.next();)i=n.value,s[i.component]&&(i.column+=1)}function wl(t){for(var e=gi(),i=t.fl.length,n=0;n<=i;n++)e[n]=[];for(n=t.network.vertexes.iterator;n.next();){var s=n.value;e[i-s.layer][s.index]=s}i=new te,mn(e,i);var a=null,l=null,c=null,p=null,m=(t.ve&1)!==0,v=(t.ve&2)!==0,w=(t.ve&4)!==0,C=(t.ve&8)!==0;for(m&&(t.verticalAlignment(e,i,!0),a=Sf(t,e,!0,!1)),e.reverse(),w&&(t.verticalAlignment(e,i,!1),c=Sf(t,e,!1,!1)),n=qe(e),s=n.next();!s.done;s=n.next())s.value.reverse();C&&(t.verticalAlignment(e,i,!1),p=Sf(t,e,!1,!0)),e.reverse(),v&&(t.verticalAlignment(e,i,!0),l=Sf(t,e,!0,!0)),Ji(e),t.u(a,l,c,p),t.network.vertexes.each(function(k){var T=gi();m&&T.push(a.get(k)),v&&T.push(l.get(k)),w&&T.push(c.get(k)),C&&T.push(p.get(k)),T.sort(function(X,$){return X-$});var A=T.length;A=(T[Math.floor((A-1)/2)]+T[Math.ceil((A-1)/2)])/2,Ji(T),k.zc=A})}function mn(t,e){for(var i=t.length,n=1;n<i-1;n++)for(var s=0,a=0,l=t[n],c=t[n+1],p=0;a<c.length;p++){var m=c[p];t:{if(m.node===null){var v=Lx(m);if(0<v.length){v=v[0].node===null;break t}}v=!1}var w=v;if(p===c.length-1||w){for(v=l.length-1,w&&(v=Lx(m)[0].index);a<=p;){if(m=c[a],!m.bo){w=[];for(var C=qe(m.sourceEdgesArrayAccess),k=C.next();!k.done;k=C.next())k=k.value,k.valid&&w.push(k);m.bo=w}for(m=qe(m.bo),w=m.next();!w.done;w=m.next())w=w.value,C=w.fromVertex.index,(C<s||C>v)&&e.add(w);a++}s=v}}}co.prototype.verticalAlignment=function(t,e,i){bf(t),t=qe(t);for(var n=t.next();!n.done;n=t.next()){var s=-1;n=qe(n.value);for(var a=n.next();!a.done;a=n.next()){a=a.value;var l=i?Lx(a):j2(a),c=l.length;if(0<c){l.sort(function(w,C){return w.vi-C.vi});var p=(c-1)/2;for(c=Math.floor(p),p=Math.ceil(p);c<=p;c++)if(a.align===a){var m=l[c],v=void 0;v=i?K1(m,a):K1(a,m),!e.contains(v)&&s<m.vi&&(m.align=a,a.root=m.root,a.align=m.root,s=m.vi)}}}}};function bf(t){for(var e=0;e<t.length;e++)for(var i=t[e],n=0;n<i.length;n++){var s=i[n];s.root=s,s.align=s,s.Tz=e,s.vi=n}}function Sf(t,e,i,n){for(var s=t.K===90||t.K===270,a=qe(e),l=a.next();!l.done;l=a.next()){var c=qe(l.value);for(l=c.next();!l.done;l=c.next())l=l.value,l.sd=l,l.shift=1/0,l.zc=NaN,l.qg=0}for(l=t.K===90||t.K===270,a=qe(e),c=a.next();!c.done;c=a.next()){c=qe(c.value);for(var p=c.next();!p.done;p=c.next())if(p=p.value,p.root===p){for(var m=0,v=p;v.align!==p;){var w=v.align,C=l?v.width:v.height,k=l?w.width:w.height;if(i){var T=K1(v,w),A=T.portFromPos,X=T.portToPos;T.link!==null&&(v.node&&v.node!==T.link.fromNode&&(A=l?v.focusX:v.focusY),w.node&&w.node!==T.link.toNode&&(X=l?w.focusX:w.focusY))}else T=K1(w,v),A=T.portToPos,X=T.portFromPos,T.link!==null&&(v.node&&v.node!==T.link.toNode&&(A=l?v.focusX:v.focusY),w.node&&w.node!==T.link.fromNode&&(X=l?w.focusX:w.focusY));C=n?v.qg+(C-A)-(k-X):v.qg+A-X,w.qg=C,m=Math.min(m,C),v=v.align}v=p;do v.qg=v.qg-m,v=v.align;while(v!==p)}}for(i=qe(e),l=i.next();!l.done;l=i.next())for(a=qe(l.value),l=a.next();!l.done;l=a.next())l=l.value,l.root===l&&Mf(t,l,e);for(i=0;i<e.length;i++)if(!(0>=e[i].length)&&(l=e[i][0],l.sd===l)){l.sd.shift===1/0&&(l.sd.shift=0),l=i,c=0;do{for(a=e[l][c];a.align!==a.root;)a=a.align,l++,0<a.vi&&(c=fh(a,e),c.sd.shift=Math.min(c.sd.shift,a.sd.shift+a.zc+a.qg-(c.zc+c.qg+(s?c.width:c.height)+t.columnSpacing)));c=a.vi+1}while(l<e.length&&c<e[l].length&&a.sd===e[l][c].sd)}for(t=new ci,e=qe(e),l=e.next();!l.done;l=e.next())for(i=qe(l.value),l=i.next();!l.done;l=i.next())l=l.value,l.zc=l.zc+l.sd.shift+l.qg,a=s?l.width:l.height,t.add(l,n?-l.zc-a:l.zc);return t}function Mf(t,e,i){if(isNaN(e.zc)){e.zc=0;var n=e;do{if(0<n.vi){var s=fh(n,i),a=s.root;Mf(t,a,i),e.sd===e&&(e.sd=a.sd);var l=t.K===90||t.K===270?s.width:s.height;e.sd===a.sd&&(e.zc=Math.max(e.zc,a.zc+s.qg+l-n.qg+t.columnSpacing))}n=n.align}while(n!==e);for(;n.align!==e;)n=n.align,n.zc=e.zc,n.sd=e.sd}}function fh(t,e){var i=t.Tz;return t=t.vi,1>t&&Mt("Could not determine previous vertex in layer"),e[i][t-1]}co.prototype.u=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];i=-1;for(var n=gi(),s=gi(),a=1/0,l=0;4>l;l++)if(e[l]){var c=Cf(this,e[l],n,s,l);c<a&&(i=l,a=c)}for(a={},l=0;4>l;a={delta:a.delta},l++)e[l]&&(a.delta=l===0||l===2?n[i]-n[l]:s[i]-s[l],a.delta!==0&&e[l].each(function(p){return function(m){m.value+=p.delta}}(a)));Ji(n),Ji(s)};function Cf(t,e,i,n,s){if(!e||e.count===0)return i[s]=0,n[s]=0,1/0;var a=1/0,l=-1/0;return e.each(function(c){var p=c.key;c=c.value,p=t.K===90||t.K===270?p.width:p.height,c<a&&(a=c),c+p>l&&(l=c+p)}),i[s]=a,n[s]=l,l-a}co.prototype.commitLayout=function(){if(this.setsPortSpots)for(var t=qh(this,!0),e=qh(this,!1),i=this.network.edges.iterator;i.next();){var n=i.value.link;n!==null&&(n.fromSpot=t,n.toSpot=e)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()};function qh(t,e){return t.K===270?e?al:ka:t.K===90?e?ka:al:t.K===180?e?gl:qa:e?qa:gl}co.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var t=0;t<=this.Ia;t++)this.he[t]=0,this.Ld[t]=0,this.Kd[t]=0,this.Ta[t]=0;for(t=this.network.vertexes.iterator;t.next();){var e=t.value,i=e.layer;this.he[i]=Math.max(this.he[i],this.nodeMinLayerSpace(e,!0)),this.Ld[i]=Math.max(this.Ld[i],this.nodeMinLayerSpace(e,!1))}e=0,i=this.ie;for(var n=0;n<=this.Ia;n++){var s=i;0>=this.he[n]+this.Ld[n]&&(s=0),0<n&&(e+=s/2),this.K===90||this.K===0?(e+=this.Ld[n],this.Kd[n]=e,e+=this.he[n]):(e+=this.he[n],this.Kd[n]=e,e+=this.Ld[n]),n<this.Ia&&(e+=s/2),this.Ta[n]=e}for(i=e,e=this.arrangementOrigin,n=0;n<=this.Ia;n++)this.K===270?this.Kd[n]=e.y+this.Kd[n]:this.K===90?(this.Kd[n]=e.y+i-this.Kd[n],this.Ta[n]=i-this.Ta[n]):this.K===180?this.Kd[n]=e.x+this.Kd[n]:(this.Kd[n]=e.x+i-this.Kd[n],this.Ta[n]=i-this.Ta[n]);i=this.ve!==0,t.reset(),n=this.K===270||this.K===90;for(var a=1/0,l=s=1/0,c=-1/0;t.next();){var p=t.value,m=p.layer,v=p.column|0;n?(l=e.x+this.kc*v,m=this.Kd[m]):(l=this.Kd[m],m=e.y+this.kc*v),p.centerX=l,p.centerY=m,i&&isFinite(p.zc)&&(n?p.node?p.x=e.x+p.zc:p.centerX=e.x+p.zc:p.node?p.y=e.y+p.zc:p.centerY=e.y+p.zc),a=Math.min(p.x,a),s=Math.min(p.y,s),n?(l=a,c=Math.max(c,p.bounds.right)):(l=s,c=Math.max(c,p.bounds.bottom))}for(this.xw=c-l,a=e.x-a,e=e.y-s,this.Rf=new G(i&&n?0:a,i&&!n?0:e),t.reset();t.next();)i=t.value,i.x+=a,i.y+=e,i.commit()},co.prototype.Gu=function(){for(var t=0,e=this.ie,i=0;i<=this.Ia;i++)t+=this.he[i],t+=this.Ld[i];t+=this.Ia*e,e=[],i=this.ve!==0?this.xw:this.kc*this.Ra;for(var n=this.maxLayer;0<=n;n--)this.K===270?n===0?e.push(new Tt(0,0,i,Math.abs(this.Ta[0]))):e.push(new Tt(0,this.Ta[n-1],i,Math.abs(this.Ta[n-1]-this.Ta[n]))):this.K===90?n===0?e.push(new Tt(0,this.Ta[0],i,Math.abs(this.Ta[0]-t))):e.push(new Tt(0,this.Ta[n],i,Math.abs(this.Ta[n-1]-this.Ta[n]))):this.K===180?n===0?e.push(new Tt(0,0,Math.abs(this.Ta[0]),i)):e.push(new Tt(this.Ta[n-1],0,Math.abs(this.Ta[n-1]-this.Ta[n]),i)):n===0?e.push(new Tt(this.Ta[0],0,Math.abs(this.Ta[0]-t),i)):e.push(new Tt(this.Ta[n],0,Math.abs(this.Ta[n-1]-this.Ta[n]),i));this.commitLayers(e,this.Rf)},co.prototype.commitLayers=function(){},co.prototype.commitLinks=function(){for(var t=this.network.edges.iterator,e;t.next();)e=t.value.link,e!==null&&(e.uh(),e.Fj(),e.zf());for(t.reset();t.next();)e=t.value.link,e!==null&&e.vg();for(t.reset();t.next();){var i=t.value;if(e=i.link,e!==null){e.uh();var n=e,s=n.fromNode,a=n.toNode,l=n.fromPort,c=n.toPort;if(s!==null){var p=s.findVisibleNode();p!==null&&p!==s&&(s=p,l=p.port)}a!==null&&(p=a.findVisibleNode(),p!==null&&p!==a&&(a=p,c=p.port));var m=e.computeSpot(!0,l);p=e.computeSpot(!1,c);var v=i.fromVertex,w=i.toVertex;if(i.valid)e.curve===Yh&&e.pointsCount===4&&(v.column===w.column&&this.alignOption===0?(i=e.getLinkPoint(s,l,m,!0,!1,a,c),c=e.getLinkPoint(a,c,p,!1,!1,s,l),i.w()||i.set(s.actualBounds.center),c.w()||c.set(a.actualBounds.center),e.Fj(),e.yf(i.x,i.y),e.yf((2*i.x+c.x)/3,(2*i.y+c.y)/3),e.yf((i.x+2*c.x)/3,(i.y+2*c.y)/3),e.yf(c.x,c.y)):(i=n=!1,l!==null&&m===jr&&(n=!0),c!==null&&p===jr&&(i=!0),(n||i)&&(p=null,n&&(p=e.getLinkPointFromPoint(s,l,l.ga(_n),e.i(3),!0),p.w()||p.set(s.actualBounds.center),e.L(0,p.x,p.y)),s=null,i&&(s=e.getLinkPointFromPoint(a,c,c.ga(_n),e.i(0),!1),s.w()||s.set(a.actualBounds.center),e.L(3,s.x,s.y)),p&&(a=e.i(2),e.L(1,(2*p.x+a.x)/3,(2*p.y+a.y)/3)),s&&(a=e.i(1),e.L(2,(2*s.x+a.x)/3,(2*s.y+a.y)/3))))),e.zf();else if(v.layer===w.layer)e.zf();else{var C=!1,k=!1,T=this.ie,A=e.firstPickIndex+1;if(e.isOrthogonal){k=!0;var X=e.pointsCount;4<X&&e.points.removeRange(2,X-3)}else if(e.curve===Yh)C=!0,X=e.pointsCount,4<X&&e.points.removeRange(2,X-3),X===4&&(A=2);else{X=e.pointsCount;var $=m===jr,J=p===jr;2<X&&$&&J?e.points.removeRange(1,X-2):3<X&&$&&!J?e.points.removeRange(1,X-3):3<X&&!$&&J?e.points.removeRange(2,X-2):4<X&&!$&&!J&&e.points.removeRange(2,X-3)}if(i.rev){for(;w!==null&&v!==w;){var et=X=null;for($=w.sourceEdges.iterator;$.next()&&(J=$.value,J.link!==i.link||(X=J.fromVertex,et=J.toVertex,X.node!==null)););if(X===null)break;if(X!==v){$=e.i(A-1).x,J=e.i(A-1).y;var st=X.centerX,mt=X.centerY;if(k)this.K===180||this.K===0?A===e.firstPickIndex+1?(e.m(A++,$,J),e.m(A++,$,mt)):(et!==null?et.centerY:J)!==mt&&(et=this.Ta[X.layer-1]+this.Rf.x,e.m(A++,et,J),e.m(A++,et,mt)):A===e.firstPickIndex+1?(e.m(A++,$,J),e.m(A++,st,J)):(et!==null?et.centerX:$)!==st&&(et=this.Ta[X.layer-1]+this.Rf.y,e.m(A++,$,et),e.m(A++,st,et));else if(A===e.firstPickIndex+1){et=Math.max(10,this.he[w.layer]);var Pt=Math.max(10,this.Ld[w.layer]);if(C)this.K===180?st<=w.bounds.x?(w=w.bounds.x,e.m(A++,w-et,mt),e.m(A++,w,mt),e.m(A++,w+Pt,mt)):(e.m(A++,st-et,mt),e.m(A++,st,mt),e.m(A++,st+Pt,mt)):this.K===90?mt>=w.bounds.bottom?(w=w.bounds.y+w.bounds.height,e.m(A++,st,w+Pt),e.m(A++,st,w),e.m(A++,st,w-et)):(e.m(A++,st,mt+Pt),e.m(A++,st,mt),e.m(A++,st,mt-et)):this.K===270?mt<=w.bounds.y?(w=w.bounds.y,e.m(A++,st,w-et),e.m(A++,st,w),e.m(A++,st,w+Pt)):(e.m(A++,st,mt-et),e.m(A++,st,mt),e.m(A++,st,mt+Pt)):this.K===0&&(st>=w.bounds.right?(w=w.bounds.x+w.bounds.width,e.m(A++,w+Pt,mt),e.m(A++,w,mt),e.m(A++,w-et,mt)):(e.m(A++,st+Pt,mt),e.m(A++,st,mt),e.m(A++,st-et,mt)));else{e.m(A++,$,J);var De=0;this.K===180||this.K===0?((this.K===180?st>=w.bounds.right:st<=w.bounds.x)&&(De=(this.K===0?-et:Pt)/2),e.m(A++,$+De,mt)):((this.K===270?mt>=w.bounds.bottom:mt<=w.bounds.y)&&(De=(this.K===90?-et:Pt)/2),e.m(A++,st,J+De)),e.m(A++,st,mt)}}else et=Math.max(10,this.he[X.layer]),Pt=Math.max(10,this.Ld[X.layer]),C?this.K===180?(e.m(A++,st-et-T,mt),e.m(A++,Math.min(st-et+T/2,st),mt),e.m(A++,st,mt),e.m(A++,st,mt),e.m(A++,Math.max(st+Pt-T/2,st),mt),e.m(A++,st+Pt+T,mt)):this.K===90?(e.m(A++,st,mt+Pt+T),e.m(A++,st,Math.max(mt+Pt-T/2,mt)),e.m(A++,st,mt),e.m(A++,st,mt),e.m(A++,st,Math.min(mt-et+T/2,mt)),e.m(A++,st,mt-et-T)):this.K===270?(e.m(A++,st,mt-et-T),e.m(A++,st,Math.min(mt-et+T/2,mt)),e.m(A++,st,mt),e.m(A++,st,mt),e.m(A++,st,Math.max(mt+Pt-T/2,mt)),e.m(A++,st,mt+Pt+T)):(e.m(A++,st+Pt+T,mt),e.m(A++,Math.max(st+Pt-T/2,st),mt),e.m(A++,st,mt),e.m(A++,st,mt),e.m(A++,Math.min(st-et+T/2,st),mt),e.m(A++,st-et-T,mt)):e.m(A++,st,mt)}w=X}(c===null||m!==jr||k)&&($=e.i(A-1).x,J=e.i(A-1).y,st=e.i(A).x,mt=e.i(A).y,k?(T=this.Ld[v.layer],this.K===180||this.K===0?(k=J,k>=v.bounds.y&&k<=v.bounds.bottom&&(this.K===180?st>=v.bounds.x:st<=v.bounds.right)&&(w=v.centerX+(this.K===180?-T:T),k<v.bounds.y+v.bounds.height/2?k=v.bounds.y-this.kc/2:k=v.bounds.bottom+this.kc/2,e.m(A++,w,J),e.m(A++,w,k)),e.m(A++,st,k)):(k=$,k>=v.bounds.x&&k<=v.bounds.right&&(this.K===270?mt>=v.bounds.y:mt<=v.bounds.bottom)&&(w=v.centerY+(this.K===270?-T:T),k<v.bounds.x+v.bounds.width/2?k=v.bounds.x-this.kc/2:k=v.bounds.right+this.kc/2,e.m(A++,$,w),e.m(A++,k,w)),e.m(A++,k,mt)),e.m(A++,st,mt)):C?(et=Math.max(10,this.he[v.layer]),Pt=Math.max(10,this.Ld[v.layer]),this.K===180&&st>=v.bounds.x?(w=v.bounds.x+v.bounds.width,e.L(A-2,w,J),e.L(A-1,w+Pt,J)):this.K===90&&mt<=v.bounds.bottom?(w=v.bounds.y,e.L(A-2,$,w),e.L(A-1,$,w-et)):this.K===270&&mt>=v.bounds.y?(w=v.bounds.y+v.bounds.height,e.L(A-2,$,w),e.L(A-1,$,w+Pt)):this.K===0&&st<=v.bounds.right&&(w=v.bounds.x,e.L(A-2,w,J),e.L(A-1,w-et,J))):(et=Math.max(10,this.he[v.layer]),Pt=Math.max(10,this.Ld[v.layer]),k=0,this.K===180||this.K===0?((this.K===180?st<=v.bounds.x:st>=v.bounds.right)&&(k=(this.K===0?Pt:-et)/2),e.m(A++,st+k,J)):((this.K===270?mt<=v.bounds.y:mt>=v.bounds.bottom)&&(k=(this.K===90?Pt:-et)/2),e.m(A++,$,mt+k)),e.m(A++,st,mt)))}else{for(;v!==null&&v!==w;){for(et=X=null,v=v.destinationEdges.iterator;v.next()&&($=v.value,$.link!==i.link||(X=$.toVertex,et=$.fromVertex,et.node!==null&&(et=null),X.node!==null)););if(X===null)break;X!==w&&($=e.i(A-1).x,J=e.i(A-1).y,st=X.centerX,mt=X.centerY,k?this.K===180||this.K===0?(et!==null?et.centerY:J)!==mt&&(et=this.Ta[X.layer]+this.Rf.x,A===e.firstPickIndex+1&&(et=this.K===0?Math.max(et,$):Math.min(et,$)),e.m(A++,et,J),e.m(A++,et,mt)):(et!==null?et.centerX:$)!==st&&(et=this.Ta[X.layer]+this.Rf.y,A===e.firstPickIndex+1&&(et=this.K===90?Math.max(et,J):Math.min(et,J)),e.m(A++,$,et),e.m(A++,st,et)):(et=Math.max(10,this.he[X.layer]),Pt=Math.max(10,this.Ld[X.layer]),C?this.K===180?(e.m(A++,st+Pt+T,mt),e.m(A++,Math.max(st+Pt-T/2,st),mt),e.m(A++,st,mt),e.m(A++,st,mt),e.m(A++,Math.min(st-et+T/2,st),mt),e.m(A++,st-et-T,mt)):this.K===90?(e.m(A++,st,mt-et-T),e.m(A++,st,Math.min(mt-et+T/2,mt)),e.m(A++,st,mt),e.m(A++,st,mt),e.m(A++,st,Math.max(mt+Pt-T/2,mt)),e.m(A++,st,mt+Pt+T)):this.K===270?(e.m(A++,st,mt+Pt+T),e.m(A++,st,Math.max(mt+Pt-T/2,mt)),e.m(A++,st,mt),e.m(A++,st,mt),e.m(A++,st,Math.min(mt-et+T/2,mt)),e.m(A++,st,mt-et-T)):(e.m(A++,st-et-T,mt),e.m(A++,Math.min(st-et+T/2,st),mt),e.m(A++,st,mt),e.m(A++,st,mt),e.m(A++,Math.max(st+Pt-T/2,st),mt),e.m(A++,st+Pt+T,mt)):this.K===180?(e.m(A++,st+Pt,mt),e.m(A++,st-et,mt)):this.K===90?(e.m(A++,st,mt-et),e.m(A++,st,mt+Pt)):this.K===270?(e.m(A++,st,mt+Pt),e.m(A++,st,mt-et)):(e.m(A++,st-et,mt),e.m(A++,st+Pt,mt)))),v=X}k&&($=e.i(A-1).x,J=e.i(A-1).y,st=e.i(A).x,mt=e.i(A).y,this.K===180||this.K===0?J!==mt&&(et=this.K===0?Math.min(Math.max((st+$)/2,this.Ta[w.layer]+this.Rf.x),st):Math.max(Math.min((st+$)/2,this.Ta[w.layer]+this.Rf.x),st),e.m(A++,et,J),e.m(A++,et,mt)):$!==st&&(et=this.K===90?Math.min(Math.max((mt+J)/2,this.Ta[w.layer]+this.Rf.y),mt):Math.max(Math.min((mt+J)/2,this.Ta[w.layer]+this.Rf.y),mt),e.m(A++,$,et),e.m(A++,st,et)))}n!==null&&C&&4<=e.pointsCount&&(l!==null&&(l=m===jr?e.getLinkPointFromPoint(s,l,l.ga(_n),e.i(3),!0):e.i(0),m===jr&&(m=e.i(2),n=e.i(3),this.direction===90||this.direction===270?(e.L(1,(l.x+m.x)/2,m.y),e.L(2,n.x,(m.y+n.y)/2)):(e.L(1,m.x,(l.y+m.y)/2),e.L(2,(m.x+n.x)/2,n.y))),l.w()||l.set(s.actualBounds.center),e.L(0,l.x,l.y)),c!==null&&(s=p===jr?e.getLinkPointFromPoint(a,c,c.ga(_n),e.i(e.pointsCount-4),!1):e.i(e.pointsCount-1),p===jr&&(c=e.i(e.pointsCount-3),p=e.i(e.pointsCount-4),this.direction===90||this.direction===270?(e.L(e.pointsCount-2,(s.x+c.x)/2,c.y),e.L(e.pointsCount-2,p.x,(c.y+p.y)/2)):(e.L(e.pointsCount-2,c.x,(s.y+c.y)/2),e.L(e.pointsCount-3,(c.x+p.x)/2,p.y))),s.w()||s.set(a.actualBounds.center),e.L(e.pointsCount-1,s.x,s.y))),e.zf(),i.commit()}}}this.avoidOrthogonalOverlaps()},co.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var t=new ue,e=this.network.edges.iterator;e.next();){var i=e.value.link;i!==null&&i.isOrthogonal&&!t.contains(i)&&t.add(i)}if(0<t.count)if(this.K===90||this.K===270){for(e=0,i=[],t=t.iterator;t.next();){var n=t.value;if(n!==null&&n.isOrthogonal)for(var s=2;s<n.pointsCount-3;s++){var a=n.i(s),l=n.i(s+1);if(this.B(a.y,l.y)&&!this.B(a.x,l.x)){var c=new g0;c.layer=Math.floor(a.y/2);var p=n.i(0),m=n.i(n.pointsCount-1);if(c.first=p.x*p.x+p.y,c.jc=m.x*m.x+m.y,c.rd=Math.min(a.x,l.x),c.Ic=Math.max(a.x,l.x),c.index=s,c.link=n,s+2<n.pointsCount){p=n.i(s-1),m=n.i(s+2);var v=0;p.y<a.y?v=m.y<a.y?3:a.x<l.x?2:1:p.y>a.y&&(v=m.y>a.y?0:l.x<a.x?2:1),c.j=v}i.push(c)}}}if(1<i.length)for(i.sort(this.Vx),t=0;t<i.length;){for(a=i[t].layer,n=t+1;n<i.length&&i[n].layer===a;)n++;if(1<n-t)for(a=t;a<n;){for(l=i[a].Ic,s=t+1;s<n&&i[s].rd<l;)l=Math.max(l,i[s].Ic),s++;if(l=s-a,1<l){for(this.zi(i,this.Js,a,a+l),v=1,c=i[a].jc,p=a;p<s;p++)m=i[p],m.jc!==c&&(v++,c=m.jc);this.zi(i,this.Ux,a,a+l);var w=1;for(c=i[a].first,p=a;p<s;p++)m=i[p],m.first!==c&&(w++,c=m.first);for(p=!0,m=w,v<w?(p=!1,m=v,c=i[a].jc,this.zi(i,this.Js,a,a+l)):c=i[a].first,v=0,w=a;w<s;w++){var C=i[w];(p?C.first:C.jc)!==c&&(v++,c=p?C.first:C.jc);var k=C.link;a=k.i(C.index),l=k.i(C.index+1);var T=this.linkSpacing*(v-(m-1)/2);e++,k.uh(),k.L(C.index,a.x,a.y+T),k.L(C.index+1,l.x,l.y+T),k.zf()}}a=s}t=n}}else{for(e=0,i=[],t=t.iterator;t.next();)if(n=t.value,n!==null&&n.isOrthogonal)for(s=2;s<n.pointsCount-3;s++)a=n.i(s),l=n.i(s+1),this.B(a.x,l.x)&&!this.B(a.y,l.y)&&(c=new g0,c.layer=Math.floor(a.x/2),p=n.i(0),m=n.i(n.pointsCount-1),c.first=p.x+p.y*p.y,c.jc=m.x+m.y*m.y,c.rd=Math.min(a.y,l.y),c.Ic=Math.max(a.y,l.y),c.index=s,c.link=n,s+2<n.pointsCount&&(p=n.i(s-1),m=n.i(s+2),v=0,p.x<a.x?v=m.x<a.x?3:a.y<l.y?2:1:p.x>a.x&&(v=m.x>a.x?0:l.y<a.y?2:1),c.j=v),i.push(c));if(1<i.length)for(i.sort(this.Vx),t=0;t<i.length;){for(a=i[t].layer,n=t+1;n<i.length&&i[n].layer===a;)n++;if(1<n-t)for(a=t;a<n;){for(l=i[a].Ic,s=t+1;s<n&&i[s].rd<l;)l=Math.max(l,i[s].Ic),s++;if(l=s-a,1<l){for(this.zi(i,this.Js,a,a+l),v=1,c=i[a].jc,p=a;p<s;p++)m=i[p],m.jc!==c&&(v++,c=m.jc);for(this.zi(i,this.Ux,a,a+l),w=1,c=i[a].first,p=a;p<s;p++)m=i[p],m.first!==c&&(w++,c=m.first);for(p=!0,m=w,v<w?(p=!1,m=v,c=i[a].jc,this.zi(i,this.Js,a,a+l)):c=i[a].first,v=0,w=a;w<s;w++)C=i[w],(p?C.first:C.jc)!==c&&(v++,c=p?C.first:C.jc),k=C.link,a=k.i(C.index),l=k.i(C.index+1),T=this.linkSpacing*(v-(m-1)/2),e++,k.uh(),k.L(C.index,a.x+T,a.y),k.L(C.index+1,l.x+T,l.y),k.zf()}a=s}t=n}}}},L=co.prototype,L.Vx=function(t,e){return t instanceof g0&&e instanceof g0&&t!==e?t.layer<e.layer?-1:t.layer>e.layer?1:t.rd<e.rd?-1:t.rd>e.rd?1:t.Ic<e.Ic?-1:t.Ic>e.Ic?1:0:0},L.Ux=function(t,e){return t instanceof g0&&e instanceof g0&&t!==e?t.first<e.first?-1:t.first>e.first||t.j<e.j?1:t.j>e.j||t.rd<e.rd?-1:t.rd>e.rd?1:t.Ic<e.Ic?-1:t.Ic>e.Ic?1:0:0},L.Js=function(t,e){return t instanceof g0&&e instanceof g0&&t!==e?t.jc<e.jc?-1:t.jc>e.jc||t.j<e.j?1:t.j>e.j||t.rd<e.rd?-1:t.rd>e.rd?1:t.Ic<e.Ic?-1:t.Ic>e.Ic?1:0:0},L.B=function(t,e){return t-=e,-1<t&&1>t},L.zi=function(t,e,i,n){var s=t.length,a=n-i;if(!(1>=a))if((0>i||i>=s-1)&&Mt("not in range 0 <= from < length: "+i),a===2)n=t[i],s=t[i+1],0<e(n,s)&&(t[i]=s,t[i+1]=n);else if(i===0)if(n>=s)t.sort(e);else for(i=t.slice(0,n),i.sort(e),e=0;e<n;e++)t[e]=i[e];else if(n>=s)for(n=t.slice(i),n.sort(e),e=i;e<s;e++)t[e]=n[e-i];else for(s=t.slice(i,n),s.sort(e),e=i;e<n;e++)t[e]=s[e-i]};function Sa(t,e){var i=t.tc[e];if(i>=t.He.length){for(var n=[],s=0;s<t.He.length;s++)n[s]=t.He[s];t.He=n}for(t.He[i]===void 0||t.He[i]===null?n=[]:(n=t.He[i],t.He[i]=null),t=t.fl[e],e=0;e<t.length;e++)i=t[e],n[i.index]=i;return n}function bl(t,e,i){t.He[t.tc[e]]=i}St.Object.defineProperties(co.prototype,{layerSpacing:{get:function(){return this.ie},set:function(t){this.ie!==t&&0<=t&&(this.ie=t,this.C())}},columnSpacing:{get:function(){return this.kc},set:function(t){this.kc!==t&&0<t&&(this.kc=t,this.C())}},direction:{get:function(){return this.K},set:function(t){this.K!==t&&(t===0||t===90||t===180||t===270?(this.K=t,this.C()):Mt("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(t){this.Dk===t||t!==Kf&&t!==Uu&&t!==lf||(this.Dk=t,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(t){this.Zk===t||t!==kf&&t!==Hf&&t!==Ef||(this.Zk=t,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(t){this.Qk===t||t!==cm&&t!==Mx&&t!==Cx||(this.Qk=t,this.C())}},iterations:{get:function(){return this.bj},set:function(t){this.bj!==t&&0<=t&&(this.bj=t,this.C())}},aggressiveOption:{get:function(){return this.rk},set:function(t){this.rk===t||t!==kx&&t!==j1&&t!==Ex||(this.rk=t,this.C())}},packOption:{get:function(){return this.bg},set:function(t){this.bg!==t&&0<=t&&8>t&&(this.bg=t,this.C())}},alignOption:{get:function(){return this.ve},set:function(t){this.ve!==t&&0<=t&&16>t&&(this.ve=t,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(t){this.sf!==t&&(this.sf=t,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(t){this.Cn!==t&&0<=t&&(this.Cn=t,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var Uu=new he(co,"CycleDepthFirst",0),Kf=new he(co,"CycleGreedy",1),lf=new he(co,"CycleFromLayers",2),kf=new he(co,"LayerOptimalLinkLength",0),Hf=new he(co,"LayerLongestPathSink",1),Ef=new he(co,"LayerLongestPathSource",2),cm=new he(co,"InitDepthFirstOut",0),Mx=new he(co,"InitDepthFirstIn",1),Cx=new he(co,"InitNaive",2),kx=new he(co,"AggressiveNone",0),j1=new he(co,"AggressiveLess",1),Ex=new he(co,"AggressiveMore",2),$2=8;co.className="LayeredDigraphLayout",co.CycleDepthFirst=Uu,co.CycleGreedy=Kf,co.CycleFromLayers=lf,co.LayerOptimalLinkLength=kf,co.LayerLongestPathSink=Hf,co.LayerLongestPathSource=Ef,co.InitDepthFirstOut=cm,co.InitDepthFirstIn=Mx,co.InitNaive=Cx,co.AggressiveNone=kx,co.AggressiveLess=j1,co.AggressiveMore=Ex,co.PackNone=0,co.PackExpand=1,co.PackStraighten=2,co.PackMedian=4,co.PackAll=15,co.AlignNone=0,co.AlignUpperLeft=1,co.AlignUpperRight=2,co.AlignLowerLeft=4,co.AlignLowerRight=8,co.AlignAll=15;function g0(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}g0.className="SegInfo";function Mv(t){Zo.call(this,t)}li(Mv,Zo),Mv.prototype.createVertex=function(){return new Zc(this)},Mv.prototype.createEdge=function(){return new Iy(this)},Mv.className="LayeredDigraphNetwork";function Zc(t){Ha.call(this,t),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}li(Zc,Ha);function Gx(t,e){return t.index-e.index}function K1(t,e){if(!t.$n){for(var i=[],n=qe(t.destinationEdgesArrayAccess),s=n.next();!s.done;s=n.next())s=s.value,s.valid&&i.push(s);t.$n=i}for(t=qe(t.$n),i=t.next();!i.done;i=t.next())if(i=i.value,i.toVertex===e)return i;Mt("Unable to find destination edge to given vertex")}function Lx(t){if(!t.co){for(var e=[],i=qe(t.sourceEdgesArrayAccess),n=i.next();!n.done;n=i.next())n=n.value,n.valid&&e.push(n.fromVertex);e.sort(Gx),t.co=e}return t.co}function j2(t){if(!t.ao){for(var e=[],i=qe(t.destinationEdgesArrayAccess),n=i.next();!n.done;n=i.next())n=n.value,n.valid&&e.push(n.toVertex);e.sort(Gx),t.ao=e}return t.ao}Zc.prototype.Cl=function(t){Ha.prototype.Cl.call(this,t),this.bo=this.co=null},Zc.prototype.Kl=function(t){Ha.prototype.Kl.call(this,t),this.bo=this.co=null},Zc.prototype.zl=function(t){Ha.prototype.zl.call(this,t),this.$n=this.ao=null},Zc.prototype.Jl=function(t){Ha.prototype.Jl.call(this,t),this.$n=this.ao=null},St.Object.defineProperties(Zc.prototype,{layer:{get:function(){return this.Ig},set:function(t){this.Ig!==t&&(this.Ig=t)}},column:{get:function(){return this.Ag},set:function(t){this.Ag!==t&&(this.Ag=t)}},index:{get:function(){return this.Za},set:function(t){this.Za!==t&&(this.Za=t)}},component:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},near:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}}}),Zc.prototype.deleteDestinationEdge=Zc.prototype.Jl,Zc.prototype.addDestinationEdge=Zc.prototype.zl,Zc.prototype.deleteSourceEdge=Zc.prototype.Kl,Zc.prototype.addSourceEdge=Zc.prototype.Cl,Zc.className="LayeredDigraphVertex";function Iy(t){kh.call(this,t),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}li(Iy,kh),St.Object.defineProperties(Iy.prototype,{fromVertex:{get:function(){return this.kd},set:function(t){this.kd!==t&&(this.kd=t)}},toVertex:{get:function(){return this.qd},set:function(t){this.qd!==t&&(this.qd=t)}},valid:{get:function(){return this.Ha},set:function(t){this.Ha!==t&&(this.Ha=t)}},rev:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}},forest:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t)}},portFromPos:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},portToPos:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}},portFromColOffset:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t)}},portToColOffset:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}}}),Iy.className="LayeredDigraphEdge";function Hn(t){hs.call(this),this.Ub=new te,this.Wn=U1,this.ud=Cd,this.vo=G1,this.Bq=Fx,this.$v=[],this.td=!0,this.Rb=X1,this.$d=new fe(10,10).freeze();var e=new fg(this);this.W=new uf(e),this.Y=new uf(e),this.ru=[],t&&Object.assign(this,t)}li(Hn,hs),Hn.prototype.cloneProtected=function(t){hs.prototype.cloneProtected.call(this,t),t.Wn=this.Wn,t.vo=this.vo,t.Bq=this.Bq,t.td=this.td,t.Rb=this.Rb,t.$d.assign(this.$d),t.W.copyInheritedPropertiesFrom(this.W),t.Y.copyInheritedPropertiesFrom(this.Y)},Hn.prototype.qb=function(t){t.classType===Hn?t.name.indexOf("Alignment")===0?this.alignment=t:t.name.indexOf("Arrangement")===0?this.arrangement=t:t.name.indexOf("Compaction")===0?this.compaction=t:t.name.indexOf("Path")===0?this.path=t:t.name.indexOf("Sorting")===0?this.sorting=t:t.name.indexOf("Style")===0?this.treeStyle=t:Mt("Unknown enum value: "+t):hs.prototype.qb.call(this,t)},Hn.prototype.createNetwork=function(){return new fg(this)},Hn.prototype.makeNetwork=function(t){function e(n){if(n instanceof Ee)return!n.isLinkLabel&&n.category!=="Comment";if(n instanceof ge){var s=n.fromNode;return s===null||s.isLinkLabel||s.category==="Comment"?!1:(n=n.toNode,!(n===null||n.isLinkLabel||n.category==="Comment"))}return!1}var i=this.createNetwork();return t instanceof Ct?(i.lg(t.nodes,!0,e),i.lg(t.links,!0,e)):t instanceof Yi?i.lg(t.memberParts,!1,e):i.lg(t.iterator,!1,e),i},Hn.prototype.doLayout=function(t){this.network===null&&(this.network=this.makeNetwork(t)),this.arrangement!==Y1&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var e=this.diagram;if(e===null&&t instanceof Ct&&(e=t),this.path===U1&&e!==null?this.ud=e.isTreePathToChildren?Cd:hg:this.ud=this.path===U1?Cd:this.path,0<this.network.vertexes.count){for(this.network.Ko(),t=this.network.vertexes.iterator;t.next();)e=t.value,e.initialized=!1,e.level=0,e.parent=null,e.children=[];if(0<this.Ub.count){for(t=new te,e=this.Ub.iterator;e.next();){var i=e.value;i instanceof Ee?(i=this.network.ki(i),i!==null&&t.add(i)):i instanceof uf&&t.add(i)}this.Ub=t}for(this.Ub.count===0&&this.findRoots(),t=this.Ub.copy().iterator;t.next();)e=t.value,e.initialized||(e.initialized=!0,Tx(this,e));for(e=this.network.vertexes,t=null;t=K2(e),0<t.count;)e=Xx(this,t),e!==null&&this.Ub.add(e),e.initialized=!0,Tx(this,e),e=t;for(t=this.Ub.iterator;t.next();)e=t.value,e instanceof uf&&Jx(this,e);for(t=this.Ub.iterator;t.next();)e=t.value,e instanceof uf&&qx(this,e);for(t=this.Ub.iterator;t.next();)e=t.value,e instanceof uf&&Qx(this,e);if(this.Cu(),this.layerStyle===J1){for(t=[],e=this.network.vertexes.iterator;e.next();){i=e.value;var n=i.parent;n===null&&(n=i),n=n.angle===0||n.angle===180;var s=t[i.level];s===void 0&&(s=0),t[i.level]=Math.max(s,n?i.width:i.height)}for(e=0;e<t.length;e++)t[e]===void 0&&(t[e]=0);for(this.$v=t,e=this.network.vertexes.iterator;e.next();)i=e.value,n=i.parent,n===null&&(n=i),n.angle===0||n.angle===180?(n.angle===180&&(i.focusX+=t[i.level]-i.width),i.width=t[i.level]):(n.angle===270&&(i.focusY+=t[i.level]-i.height),i.height=t[i.level])}else if(this.layerStyle===zx)for(t=this.network.vertexes.iterator;t.next();){for(e=t.value,i=e.angle===0||e.angle===180,n=-1,s=0;s<e.children.length;s++){var a=e.children[s];n=Math.max(n,i?a.width:a.height)}if(0<=n)for(s=0;s<e.children.length;s++)a=e.children[s],i?(e.angle===180&&(a.focusX+=n-a.width),a.width=n):(e.angle===270&&(a.focusY+=n-a.height),a.height=n)}for(t=this.Ub.iterator;t.next();)e=t.value,e instanceof uf&&this.layoutTree(e);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new te,this.isValidLayout=!0};function K2(t){var e=new te;for(t=t.iterator;t.next();){var i=t.value;i.initialized||e.add(i)}return e}Hn.prototype.findRoots=function(){for(var t=this.network.vertexes,e=t.iterator;e.next();){var i=e.value;switch(this.ud){case Cd:i.sourceEdges.count===0&&this.Ub.add(i);break;case hg:i.destinationEdges.count===0&&this.Ub.add(i);break;default:Mt("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(t=Xx(this,t),t!==null&&this.Ub.add(t))};function Xx(t,e){var i=999999,n=null;for(e=e.iterator;e.next();){var s=e.value;switch(t.ud){case Cd:s.sourceEdges.count<i&&(i=s.sourceEdges.count,n=s);break;case hg:s.destinationEdges.count<i&&(i=s.destinationEdges.count,n=s);break;default:Mt("Unhandled path value "+t.ud.toString())}}return n}function Tx(t,e){if(e!==null){switch(t.ud){case Cd:if(0<e.destinationEdges.count){for(var i=new ue,n=e.destinationVertexes;n.next();){var s=n.value;Yx(t,e,s)&&i.add(s)}0<i.count&&(e.children=i.Fa())}break;case hg:if(0<e.sourceEdges.count){for(i=new ue,n=e.sourceVertexes;n.next();)s=n.value,Yx(t,e,s)&&i.add(s);0<i.count&&(e.children=i.Fa())}break;default:Mt("Unhandled path value"+t.ud.toString())}for(i=e.children,n=i.length,s=0;s<n;s++){var a=i[s];a.initialized=!0,a.level=e.level+1,a.parent=e,t.Ub.remove(a)}for(e=0;e<n;e++)Tx(t,i[e])}}function Yx(t,e,i){if(i.initialized){if(e===null)var n=!1;else{for(n=e.parent;n!==null&&n!==i;)n=n.parent;n=n===i}if(n||i.level>e.level)return!1;t.removeChild(i.parent,i)}return!0}Hn.prototype.removeChild=function(t,e){if(t!==null&&e!==null){for(var i=t.children,n=0,s=0;s<i.length;s++)i[s]===e&&n++;if(0<n){n=Array(i.length-n);for(var a=s=0;a<i.length;a++)i[a]!==e&&(n[s++]=i[a]);t.children=n}}};function Jx(t,e){if(e!==null){t.initializeTreeVertexValues(e),e.alignment===Ld&&t.sortTreeVertexChildren(e);for(var i=0,n=e.childrenCount,s=0,a=e.children,l=a.length,c=0;c<l;c++){var p=a[c];Jx(t,p),i+=p.descendantCount+1,n=Math.max(n,p.maxChildrenCount),s=Math.max(s,p.maxGenerationCount)}e.descendantCount=i,e.maxChildrenCount=n,e.maxGenerationCount=0<n?s+1:0}}function H2(t,e){switch(t.vo){default:case G1:return e.parent!==null?e.parent:t.W;case Rx:return e.parent===null?t.W:e.parent.parent===null?t.Y:e.parent;case Ox:return e.parent!==null?e.parent.parent!==null?e.parent.parent:t.Y:t.W;case Ix:var i=!0;if(e.childrenCount===0)i=!1;else for(var n=e.children,s=n.length,a=0;a<s;a++)if(0<n[a].childrenCount){i=!1;break}return i&&e.parent!==null?t.Y:e.parent!==null?e.parent:t.W}}Hn.prototype.initializeTreeVertexValues=function(t){if(t.copyInheritedPropertiesFrom(H2(this,t)),t.parent!==null&&t.parent.alignment===Ld){for(var e=t.angle,i=t.parent.children,n=0;n<i.length&&t!==i[n];)n++;n%2===0?n!==i.length-1&&(e=e===90?180:e===180?270:e===270?180:270):e=e===90?0:e===180?90:e===270?0:90,t.angle=e}t.initialized=!0};function qx(t,e){if(e!==null){t.assignTreeVertexValues(e),e=e.children;for(var i=e.length,n=0;n<i;n++)qx(t,e[n])}}Hn.prototype.assignTreeVertexValues=function(){};function Qx(t,e){if(e!==null){e.alignment!==Ld&&t.sortTreeVertexChildren(e),e=e.children;for(var i=e.length,n=0;n<i;n++)Qx(t,e[n])}}Hn.prototype.sortTreeVertexChildren=function(t){switch(t.sorting){case Cv:break;case Ry:t.children.reverse();break;case By:t.children.sort(t.comparer);break;case Fy:t.children.sort(t.comparer),t.children.reverse();break;default:Mt("Unhandled sorting value "+t.sorting.toString())}},Hn.prototype.Cu=function(){if(this.comments)for(var t=this.network.vertexes.iterator;t.next();)this.addComments(t.value)},Hn.prototype.addComments=function(t){var e=t.angle,i=t.parent,n=0,s=!1;i!==null&&(n=i.angle,s=i.alignment,s=v0(s)),e=e===90||e===270,n=n===90||n===270,i=t.childrenCount===0;var a=0,l=0,c=0,p=t.commentSpacing;if(t.node!==null)for(var m=t.node.Mu();m.next();){var v=m.value;v.category==="Comment"&&v.canLayout()&&(t.comments===null&&(t.comments=[]),t.comments.push(v),v.Va(),v=v.measuredBounds,e&&!i||!s&&!n&&i||s&&n&&i?(a=Math.max(a,v.width),l+=v.height+Math.abs(c)):(a+=v.width+Math.abs(c),l=Math.max(l,v.height)),c=p)}t.comments!==null&&(e&&!i||!s&&!n&&i||s&&n&&i?(a+=Math.abs(t.commentMargin),l=Math.max(0,l-t.height)):(l+=Math.abs(t.commentMargin),a=Math.max(0,a-t.width)),s=Tt.allocAt(0,0,t.bounds.width+a,t.bounds.height+l),t.bounds=s,Tt.free(s))};function v0(t){return t===Np||t===Ld||t===Ap||t===Yd}function Oy(t){return t===Np||t===Ld}function _x(t){var e=t.parent;if(e!==null){var i=e.alignment;if(v0(i)){if(Oy(i)){for(e=e.children,i=0;i<e.length&&t!==e[i];)i++;return i%2===0}if(i===Ap)return!0}}return!1}Hn.prototype.layoutComments=function(t){if(t.comments!==null){var e=t.node.measuredBounds,i=t.parent,n=t.angle,s=0,a=!1;i!==null&&(s=i.angle,a=i.alignment,a=v0(a)),n=n===90||n===270,i=s===90||s===270;for(var l=t.childrenCount===0,c=_x(t),p=0,m=t.comments,v=m.length,w=G.alloc(),C=0;C<v;C++){var k=m[C],T=k.measuredBounds;if(n&&!l||!a&&!i&&l||a&&i&&l){if(135<s&&!a||i&&c)if(0<=t.commentMargin)for(w.h(t.bounds.x-t.commentMargin-T.width,t.bounds.y+p),k.move(w),k=k.Sd();k.next();){var A=k.value;A.fromSpot=gl,A.toSpot=qa}else for(w.h(t.bounds.x+2*t.focus.x-t.commentMargin,t.bounds.y+p),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=qa,A.toSpot=gl;else if(0<=t.commentMargin)for(w.h(t.bounds.x+2*t.focus.x+t.commentMargin,t.bounds.y+p),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=qa,A.toSpot=gl;else for(w.h(t.bounds.x+t.commentMargin-T.width,t.bounds.y+p),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=gl,A.toSpot=qa;p=0<=t.commentSpacing?p+(T.height+t.commentSpacing):p+(t.commentSpacing-T.height)}else{if(135<s&&!a||!i&&c)if(0<=t.commentMargin)for(w.h(t.bounds.x+p,t.bounds.y-t.commentMargin-T.height),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=al,A.toSpot=ka;else for(w.h(t.bounds.x+p,t.bounds.y+2*t.focus.y-t.commentMargin),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=ka,A.toSpot=al;else if(0<=t.commentMargin)for(w.h(t.bounds.x+p,t.bounds.y+2*t.focus.y+t.commentMargin),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=ka,A.toSpot=al;else for(w.h(t.bounds.x+p,t.bounds.y+t.commentMargin-T.height),k.move(w),k=k.Sd();k.next();)A=k.value,A.fromSpot=al,A.toSpot=ka;p=0<=t.commentSpacing?p+(T.width+t.commentSpacing):p+(t.commentSpacing-T.width)}}if(G.free(w),e=p-t.commentSpacing-(n?e.height:e.width),this.ud===Cd)for(t=t.destinationEdges;t.next();)s=t.value.link,s===null||s.isAvoiding||(s.fromEndSegmentLength=0<e?e:NaN);else for(t=t.sourceEdges;t.next();)s=t.value.link,s===null||s.isAvoiding||(s.toEndSegmentLength=0<e?e:NaN)}},Hn.prototype.layoutTree=function(t){if(t!==null){for(var e=t.children,i=e.length,n=0;n<i;n++)this.layoutTree(e[n]);switch(t.compaction){case Z1:t2(this,t);break;case zy:if(t.alignment===Ld)t2(this,t);else if(t.childrenCount===0)n=t.parent,i=!1,e=0,n!==null&&(e=n.angle,i=n.alignment,i=v0(i)),n=_x(t),t.S.h(0,0),t.Da.h(t.width,t.height),t.parent===null||t.comments===null||(e!==180&&e!==270||i)&&!n?t.la.h(0,0):e===180&&!i||(e===90||e===270)&&n?t.la.h(t.width-2*t.focus.x,0):t.la.h(0,t.height-2*t.focus.y),t.Yo=null,t.kp=null;else{var s=Lf(t);e=s===90||s===270;var a=0,l=t.children,c=l.length;for(i=0;i<c;i++)n=l[i],a=Math.max(a,e?n.Da.width:n.Da.height);var p=t.alignment;n=p===kd;var m=p===Ed,v=v0(p),w=Math.max(0,t.breadthLimit);i=this.computeLayerSpacing(t);var C=t.nodeSpacing,k=this.computeNodeIndent(t),T=t.rowSpacing,A=0;(n||m||t.hm||t.im&&t.maxGenerationCount===1)&&(A=Math.max(0,t.rowIndent)),n=t.width;var X=t.height,$=0,J=0,et=0,st=null,mt=null,Pt=0,De=0,ti=0,Ve=0,ye=0,Yt=0,sn=0,Ui=0;if(v&&!Oy(p)&&135<s&&l.reverse(),Oy(p))if(1<c)for(var Vr=0;Vr<c;Vr++)Vr%2===0&&Vr!==c-1&&(Ui=Math.max(Ui,e?l[Vr].Da.width:l[Vr].Da.height));else c===1&&(Ui=e?l[0].Da.width:l[0].Da.height);if(v){switch(p){case Np:J=135>s?e2(this,t,l,Ui,$,J):i2(this,t,l,Ui,$,J),Ui=J.x,$=J.width,J=J.height;break;case Ap:for(st=0;st<c;st++)mt=l[st],w=mt.Da,et=Yt===0?0:T,e?(mt.S.h(a-w.width,Ve+et),$=Math.max($,w.width),J=Math.max(J,Ve+et+w.height),Ve+=et+w.height):(mt.S.h(ti+et,a-w.height),$=Math.max($,ti+et+w.width),J=Math.max(J,w.height),ti+=et+w.width),Yt++;break;case Yd:for(st=0;st<c;st++)mt=l[st],a=mt.Da,w=Yt===0?0:T,e?(mt.S.h(C/2+t.focus.x,Ve+w),$=Math.max($,a.width),J=Math.max(J,Ve+w+a.height),Ve+=w+a.height):(mt.S.h(ti+w,C/2+t.focus.y),$=Math.max($,ti+w+a.width),J=Math.max(J,a.height),ti+=w+a.width),Yt++}st=Qh(this,2),mt=Qh(this,2),e?(st[0].h(0,0),st[1].h(0,J),mt[0].h($,0)):(st[0].h(0,0),st[1].h($,0),mt[0].h(0,J)),mt[1].h($,J)}else for(Vr=0;Vr<c;Vr++){var is=l[Vr],zl=is.Da;if(e){0<w&&0<Yt&&ti+C+zl.width>w&&(ti<a&&fm(t,p,a-ti,0,sn,Vr-1),ye++,Yt=0,sn=Vr,et=J,ti=0,Ve=135<s?-J-T:J+T),V1(this,is,0,Ve);var eu=0;if(Yt===0)st=is.Yo,mt=is.kp,Pt=zl.width,De=zl.height,(st===null||mt===null||s!==Lf(is))&&(st=Qh(this,2),mt=Qh(this,2),st[0].h(0,0),st[1].h(0,De),mt[0].h(Pt,0),mt[1].h(Pt,De));else{var dh=gi();De=n2(this,t,is,st,mt,Pt,De,dh),eu=De.x,st=dh[0],mt=dh[1],Pt=De.width,De=De.height,Ji(dh),ti<zl.width&&0>eu&&(ug(t,-eu,0,sn,Vr-1),W1(st,-eu,0),W1(mt,-eu,0),eu=0)}is.S.h(eu,Ve),$=Math.max($,Pt),J=Math.max(J,et+(ye===0?0:T)+zl.height),ti=Pt}else 0<w&&0<Yt&&Ve+C+zl.height>w&&(Ve<a&&fm(t,p,0,a-Ve,sn,Vr-1),ye++,Yt=0,sn=Vr,et=$,Ve=0,ti=135<s?-$-T:$+T),V1(this,is,ti,0),eu=0,Yt===0?(st=is.Yo,mt=is.kp,Pt=zl.width,De=zl.height,(st===null||mt===null||s!==Lf(is))&&(st=Qh(this,2),mt=Qh(this,2),st[0].h(0,0),st[1].h(Pt,0),mt[0].h(0,De),mt[1].h(Pt,De))):(dh=gi(),De=n2(this,t,is,st,mt,Pt,De,dh),eu=De.x,st=dh[0],mt=dh[1],Pt=De.width,De=De.height,Ji(dh),Ve<zl.height&&0>eu&&(ug(t,0,-eu,sn,Vr-1),W1(st,0,-eu),W1(mt,0,-eu),eu=0)),is.S.h(ti,eu),J=Math.max(J,De),$=Math.max($,et+(ye===0?0:T)+zl.width),Ve=De;Yt++}switch(0<ye&&(e?(J+=Math.max(0,i),ti<$&&fm(t,p,$-ti,0,sn,c-1),0<A&&(m||ug(t,A,0,0,c-1),$+=A)):($+=Math.max(0,i),Ve<J&&fm(t,p,0,J-Ve,sn,c-1),0<A&&(m||ug(t,0,A,0,c-1),J+=A))),A=m=0,p){case kv:e?m+=$/2-t.focus.x-k/2:A+=J/2-t.focus.y-k/2;break;case cg:0<ye?e?m+=$/2-t.focus.x-k/2:A+=J/2-t.focus.y-k/2:e?(Ui=l[0].S.x+l[0].la.x,m+=Ui+(l[c-1].S.x+l[c-1].la.x+2*l[c-1].focus.x-Ui)/2-t.focus.x-k/2):(Ui=l[0].S.y+l[0].la.y,A+=Ui+(l[c-1].S.y+l[c-1].la.y+2*l[c-1].focus.y-Ui)/2-t.focus.y-k/2);break;case kd:e?(m-=k,$+=k):(A-=k,J+=k);break;case Ed:e?(m+=$-t.width+k,$+=k):(A+=J-t.height+k,J+=k);break;case Np:e?1<c?m+=Ui+C/2-t.focus.x:m+=l[0].focus.x-t.focus.x+l[0].la.x:1<c?A+=Ui+C/2-t.focus.y:A+=l[0].focus.y-t.focus.y+l[0].la.y;break;case Ap:e?m+=$+C/2-t.focus.x:A+=J+C/2-t.focus.y;break;case Yd:break;default:J=this.customAlignment(t,m,A,$,J),m=J[0],A=J[1],$=J[2],J=J[3]}for(k=0;k<c;k++)Ui=l[k],e?Ui.S.h(Ui.S.x+Ui.la.x-m,Ui.S.y+(135<s?(v?-J:-Ui.Da.height)+Ui.la.y-i:X+i+Ui.la.y)):Ui.S.h(Ui.S.x+(135<s?(v?-$:-Ui.Da.width)+Ui.la.x-i:n+i+Ui.la.x),Ui.S.y+Ui.la.y-A);if(c=l=0,v?e?($=Px(t,$,m),0>m&&(m=0),135<s&&(A+=J+i),J+=X+i,p===Yd&&(l+=C/2+t.focus.x),c+=X+i):(135<s&&(m+=$+i),$+=n+i,J=Nx(t,J,A),0>A&&(A=0),p===Yd&&(c+=C/2+t.focus.y),l+=n+i):e?(t.comments===null?n>$&&($=Ax(p,n-$,0),l=$.x,c=$.y,$=n,m=0):$=Px(t,$,m),0>m&&(l-=m,m=0),135<s&&(A+=J+i),J=Math.max(Math.max(J,X),J+X+i),c+=X+i):(135<s&&(m+=$+i),$=Math.max(Math.max($,n),$+n+i),t.comments===null?X>J&&(J=Ax(p,0,X-J),l=J.x,c=J.y,J=X,A=0):J=Nx(t,J,A),0>A&&(c-=A,A=0),l+=n+i),0<ye)s=Qh(this,4),ye=Qh(this,4),e?(s[2].h(0,X+i),s[3].h(s[2].x,J),ye[2].h($,s[2].y),ye[3].h(ye[2].x,s[3].y)):(s[2].h(n+i,0),s[3].h($,s[2].y),ye[2].h(s[2].x,J),ye[3].h(s[3].x,ye[2].y));else{for(s=Qh(this,st.length+2),ye=Qh(this,mt.length+2),p=0;p<st.length;p++)v=st[p],s[p+2].h(v.x+l,v.y+c);for(p=0;p<mt.length;p++)v=mt[p],ye[p+2].h(v.x+l,v.y+c)}e?(s[0].h(m,0),s[1].h(s[0].x,X),s[2].y<s[1].y&&(s[2].x>s[0].x?s[2].assign(s[1]):s[1].assign(s[2])),s[3].y<s[2].y&&(s[3].x>s[0].x?s[3].assign(s[2]):s[2].assign(s[3])),ye[0].h(m+n,0),ye[1].h(ye[0].x,X),ye[2].y<ye[1].y&&(ye[2].x<ye[0].x?ye[2].assign(ye[1]):ye[1].assign(ye[2])),ye[3].y<ye[2].y&&(ye[3].x<ye[0].x?ye[3].assign(ye[2]):ye[2].assign(ye[3])),s[2].y-=i/2,ye[2].y-=i/2):(s[0].h(0,A),s[1].h(n,s[0].y),s[2].x<s[1].x&&(s[2].y>s[0].y?s[2].assign(s[1]):s[1].assign(s[2])),s[3].x<s[2].x&&(s[3].y>s[0].y?s[3].assign(s[2]):s[2].assign(s[3])),ye[0].h(0,A+X),ye[1].h(n,ye[0].y),ye[2].x<ye[1].x&&(ye[2].y<ye[0].y?ye[2].assign(ye[1]):ye[1].assign(ye[2])),ye[3].x<ye[2].x&&(ye[3].y<ye[0].y?ye[3].assign(ye[2]):ye[2].assign(ye[3])),s[2].x-=i/2,ye[2].x-=i/2),Vf(this,st),Vf(this,mt),t.Yo=s,t.kp=ye,t.la.h(m,A),t.Da.h($,J)}break;default:Mt("Unhandled compaction value "+t.compaction.toString())}}};function t2(t,e){if(e.childrenCount===0){var i=!1,n=0;e.parent!==null&&(n=e.parent.angle,i=e.parent.alignment,i=v0(i));var s=_x(e);e.S.h(0,0),e.Da.h(e.width,e.height),e.parent===null||e.comments===null||(n!==180&&n!==270||i)&&!s?e.la.h(0,0):n===180&&!i||(n===90||n===270)&&s?e.la.h(e.width-2*e.focus.x,0):e.la.h(0,e.height-2*e.focus.y)}else{n=Lf(e),i=n===90||n===270;var a=0;s=e.children;for(var l=s.length,c=0;c<l;c++){var p=s[c];a=Math.max(a,i?p.Da.width:p.Da.height)}var m=e.alignment,v=m===kd,w=m===Ed;c=v0(m);var C=Math.max(0,e.breadthLimit);p=t.computeLayerSpacing(e);var k=e.nodeSpacing,T=t.computeNodeIndent(e),A=v||w?0:T/2,X=e.rowSpacing,$=0;(v||w||e.hm||e.im&&e.maxGenerationCount===1)&&($=Math.max(0,e.rowIndent)),v=e.width;var J=e.height,et=0,st=0,mt=0,Pt=0,De=0,ti=0,Ve=0,ye=0,Yt=0,sn=0;if(c&&!Oy(m)&&135<n&&s.reverse(),Oy(m))if(1<l)for(var Ui=0;Ui<l;Ui++){var Vr=s[Ui],is=Vr.Da;Ui%2===0&&Ui!==l-1?Yt=Math.max(Yt,(i?is.width:is.height)+t.computeBusNodeSpacing(Vr)-k):Ui%2!==0&&(sn=Math.max(sn,(i?is.width:is.height)+t.computeBusNodeSpacing(Vr)-k))}else l===1&&(Yt=i?s[0].Da.width:s[0].Da.height);if(c)switch(m){case Np:case Ld:st=135>n?e2(t,e,s,Yt,et,st):i2(t,e,s,Yt,et,st),Yt=st.x,et=st.width,st=st.height;break;case Ap:for(C=0;C<l;C++)A=s[C],mt=A.Da,sn=Ve===0?0:X,i?(A.S.h(a-mt.width,De+sn),et=Math.max(et,mt.width),st=Math.max(st,De+sn+mt.height),De+=sn+mt.height):(A.S.h(Pt+sn,a-mt.height),et=Math.max(et,Pt+sn+mt.width),st=Math.max(st,mt.height),Pt+=sn+mt.width),Ve++;break;case Yd:for(a=0;a<l;a++)C=s[a],A=C.Da,mt=Ve===0?0:X,i?(C.S.h(k/2+e.focus.x,De+mt),et=Math.max(et,A.width),st=Math.max(st,De+mt+A.height),De+=mt+A.height):(C.S.h(Pt+mt,k/2+e.focus.y),et=Math.max(et,Pt+mt+A.width),st=Math.max(st,A.height),Pt+=mt+A.width),Ve++}else for(sn=0;sn<l;sn++)Ui=s[sn],Vr=Ui.Da,i?(0<C&&0<Ve&&Pt+k+Vr.width>C&&(Pt<a&&fm(e,m,a-Pt,0,ye,sn-1),ti++,Ve=0,ye=sn,mt=st,Pt=0,De=135<n?-st-X:st+X),is=Ve===0?A:k,V1(t,Ui,0,De),Ui.S.h(Pt+is,De),et=Math.max(et,Pt+is+Vr.width),st=Math.max(st,mt+(ti===0?0:X)+Vr.height),Pt+=is+Vr.width):(0<C&&0<Ve&&De+k+Vr.height>C&&(De<a&&fm(e,m,0,a-De,ye,sn-1),ti++,Ve=0,ye=sn,mt=et,De=0,Pt=135<n?-et-X:et+X),is=Ve===0?A:k,V1(t,Ui,Pt,0),Ui.S.h(Pt,De+is),st=Math.max(st,De+is+Vr.height),et=Math.max(et,mt+(ti===0?0:X)+Vr.width),De+=is+Vr.height),Ve++;switch(0<ti&&(i?(st+=Math.max(0,p),Pt<et&&fm(e,m,et-Pt,0,ye,l-1),0<$&&(w||ug(e,$,0,0,l-1),et+=$)):(et+=Math.max(0,p),De<st&&fm(e,m,0,st-De,ye,l-1),0<$&&(w||ug(e,0,$,0,l-1),st+=$))),$=w=0,m){case kv:i?w+=et/2-e.focus.x-T/2:$+=st/2-e.focus.y-T/2;break;case cg:0<ti?i?w+=et/2-e.focus.x-T/2:$+=st/2-e.focus.y-T/2:i?(t=s[0].S.x+s[0].la.x,w+=t+(s[l-1].S.x+s[l-1].la.x+2*s[l-1].focus.x-t)/2-e.focus.x-T/2):(t=s[0].S.y+s[0].la.y,$+=t+(s[l-1].S.y+s[l-1].la.y+2*s[l-1].focus.y-t)/2-e.focus.y-T/2);break;case kd:i?(w-=T,et+=T):($-=T,st+=T);break;case Ed:i?(w+=et-e.width+T,et+=T):($+=st-e.height+T,st+=T);break;case Np:case Ld:i?1<l?w+=Yt+k/2-e.focus.x:w+=s[0].focus.x-e.focus.x+s[0].la.x:1<l?$+=Yt+k/2-e.focus.y:$+=s[0].focus.y-e.focus.y+s[0].la.y;break;case Ap:i?w+=et+k/2-e.focus.x:$+=st+k/2-e.focus.y;break;case Yd:break;default:t=t.customAlignment(e,w,$,et,st),w=t[0],$=t[1],et=t[2],st=t[3]}for(t=0;t<l;t++)T=s[t],i?T.S.h(T.S.x+T.la.x-w,T.S.y+(135<n?(c?-st:-T.Da.height)+T.la.y-p:J+p+T.la.y)):T.S.h(T.S.x+(135<n?(c?-et:-T.Da.width)+T.la.x-p:v+p+T.la.x),T.S.y+T.la.y-$);i?(et=Px(e,et,w),0>w&&(w=0),135<n&&($+=st+p),st=Math.max(Math.max(st,J),st+J+p)):(135<n&&(w+=et+p),et=Math.max(Math.max(et,v),et+v+p),st=Nx(e,st,$),0>$&&($=0)),e.la.h(w,$),e.Da.h(et,st)}}Hn.prototype.customAlignment=function(t,e,i,n,s){return[e,i,n,s]};function e2(t,e,i,n,s,a){var l=i.length;if(l===0)return new Tt(n,0,s,a);if(l===1)return e=i[0],s=e.Da.width,a=e.Da.height,new Tt(n,0,s,a);for(var c=e.nodeSpacing,p=e.rowSpacing,m=Lf(e)===90,v=0,w=0,C=0,k=0;k<l;k++)if(!(k%2!==0||1<l&&k===l-1)){var T=i[k],A=T.Da,X=v===0?0:p;if(m){var $=t.computeBusNodeSpacing(T)-c;T.S.h(n-(A.width+$),C+X),s=Math.max(s,A.width+$),a=Math.max(a,C+X+A.height),C+=X+A.height}else $=t.computeBusNodeSpacing(T)-c,T.S.h(w+X,n-(A.height+$)),a=Math.max(a,A.height+$),s=Math.max(s,w+X+A.width),w+=X+A.width;v++}for(v=0,T=w,k=C,m?(w=n+c,C=0):(w=0,C=n+c),A=0;A<l;A++)if(A%2!==0){X=i[A],$=X.Da;var J=v===0?0:p;if(m){var et=t.computeBusNodeSpacing(X)-c;X.S.h(w+et,C+J),s=Math.max(s,w+$.width+et),a=Math.max(a,C+J+$.height),C+=J+$.height}else et=t.computeBusNodeSpacing(X)-c,X.S.h(w+J,C+et),s=Math.max(s,w+J+$.width),a=Math.max(a,C+$.height+et),w+=J+$.width;v++}return 1<l&&l%2===1&&(i=i[l-1],l=i.Da,t=t.computeBusLastRowSpacing(i,m?Math.max(Math.abs(k),Math.abs(C)):Math.max(Math.abs(T),Math.abs(w))),m?(i.S.h(n+c/2-i.focus.x-i.la.x,a+t),m=n+c/2-i.focus.x-i.la.x,s=Math.max(s,m+l.width),0>m&&(s-=m),a=Math.max(a,Math.max(k,C)+t+l.height),0>i.S.x&&(n=H1(e,i.S.x,!1,n,c))):(i.S.h(s+t,n+c/2-i.focus.y-i.la.y),s=Math.max(s,Math.max(T,w)+t+l.width),C=n+c/2-i.focus.y-i.la.y,a=Math.max(a,C+l.height),0>C&&(a-=C),0>i.S.y&&(n=H1(e,i.S.y,!0,n,c)))),new Tt(n,0,s,a)}function i2(t,e,i,n,s,a){var l=i.length;if(l===0)return new Tt(n,0,s,a);if(l===1)return i=i[0],s=i.Da.width,a=i.Da.height,new Tt(n,0,s,a);for(var c=e.nodeSpacing,p=e.rowSpacing,m=Lf(e)===270,v=0,w=0,C=0,k=0;k<l;k++)if(!(k%2!==0||1<l&&k===l-1)){var T=i[k],A=T.Da,X=v===0?0:p;if(m){var $=t.computeBusNodeSpacing(T)-c;C-=X+A.height,T.S.h(n-(A.width+$),C),s=Math.max(s,A.width+$),a=Math.max(a,Math.abs(C))}else $=t.computeBusNodeSpacing(T)-c,w-=X+A.width,T.S.h(w,n-(A.height+$)),a=Math.max(a,A.height+$),s=Math.max(s,Math.abs(w));v++}for(v=0,T=w,k=C,m?(w=n+c,C=0):(w=0,C=n+c),A=0;A<l;A++)if(A%2!==0){X=i[A],$=X.Da;var J=v===0?0:p;if(m){var et=t.computeBusNodeSpacing(X)-c;C-=J+$.height,X.S.h(w+et,C),s=Math.max(s,w+$.width+et),a=Math.max(a,Math.abs(C))}else et=t.computeBusNodeSpacing(X)-c,w-=J+$.width,X.S.h(w,C+et),a=Math.max(a,C+$.height+et),s=Math.max(s,Math.abs(w));v++}for(1<l&&l%2===1&&(p=i[l-1],v=p.Da,t=t.computeBusLastRowSpacing(p,m?Math.max(Math.abs(k),Math.abs(C)):Math.max(Math.abs(T),Math.abs(w))),m?(p.S.h(n+c/2-p.focus.x-p.la.x,-a-v.height-t),w=n+c/2-p.focus.x-p.la.x,s=Math.max(s,w+v.width),0>w&&(s-=w),a=Math.max(a,Math.abs(Math.min(k,C))+t+v.height),0>p.S.x&&(n=H1(e,p.S.x,!1,n,c))):(p.S.h(-s-v.width-t,n+c/2-p.focus.y-p.la.y),s=Math.max(s,Math.abs(Math.min(T,w))+t+v.width),C=n+c/2-p.focus.y-p.la.y,a=Math.max(a,C+v.height),0>C&&(a-=C),0>p.S.y&&(n=H1(e,p.S.y,!0,n,c)))),e=0;e<l;e++)c=i[e],m?c.S.h(c.S.x,c.S.y+a):c.S.h(c.S.x+s,c.S.y);return new Tt(n,0,s,a)}Hn.prototype.computeBusNodeSpacing=function(t){return t.parent===null?0:t.parent.nodeSpacing},Hn.prototype.computeBusLastRowSpacing=function(t){return t.parent===null?0:t.parent.rowSpacing};function H1(t,e,i,n,s){t=t.children;for(var a=t.length,l=0;l<a;l++)i?t[l].S.h(t[l].S.x,t[l].S.y-e):t[l].S.h(t[l].S.x-e,t[l].S.y);return e=t[a-1],Math.max(n,i?e.la.y+e.focus.y-s/2:e.la.x+e.focus.x-s/2)}function Px(t,e,i){switch(t.alignment){case cg:case kv:return i+t.width>e&&(e=i+t.width),0>i&&(e-=i),e;case kd:return t.width>e?t.width:e;case Ed:return 2*t.focus.x>e?t.width:e+t.width-2*t.focus.x;case Np:case Ld:return Math.max(t.width,Math.max(e,i+t.width)-Math.min(0,i));case Ap:return t.width-t.focus.x+t.nodeSpacing/2+e;case Yd:return Math.max(t.width,t.focus.x+t.nodeSpacing/2+e);default:return e}}function Nx(t,e,i){switch(t.alignment){case cg:case kv:return i+t.height>e&&(e=i+t.height),0>i&&(e-=i),e;case kd:return t.height>e?t.height:e;case Ed:return 2*t.focus.y>e?t.height:e+t.height-2*t.focus.y;case Np:case Ld:return Math.max(t.height,Math.max(e,i+t.height)-Math.min(0,i));case Ap:return t.height-t.focus.y+t.nodeSpacing/2+e;case Yd:return Math.max(t.height,t.focus.y+t.nodeSpacing/2+e);default:return e}}function Ax(t,e,i){switch(t){case kv:e/=2,i/=2;break;case cg:e/=2,i/=2;break;case kd:i=e=0;break;case Ed:break;default:Mt("Unhandled alignment value "+t.toString())}return new G(e,i)}function fm(t,e,i,n,s,a){e=Ax(e,i,n),ug(t,e.x,e.y,s,a)}function ug(t,e,i,n,s){if(e!==0||i!==0)for(t=t.children;n<=s;n++){var a=t[n].S;a.x+=e,a.y+=i}}function V1(t,e,i,n){var s=e.parent;switch(t.ud){case Cd:for(t=e.sourceEdges;t.next();)e=t.value,e.fromVertex===s&&e.relativePoint.h(i,n);break;case hg:for(t=e.destinationEdges;t.next();)e=t.value,e.toVertex===s&&e.relativePoint.h(i,n);break;default:Mt("Unhandled path value "+t.ud.toString())}}function W1(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];s.x+=e,s.y+=i}}function n2(t,e,i,n,s,a,l,c){var p=Lf(e),m=p===90||p===270,v=e.nodeSpacing;e=n;var w=s;n=a;var C=l,k=i.Yo,T=i.kp;l=i.Da;var A=m?Math.max(C,l.height):Math.max(n,l.width);if((k===null||p!==Lf(i))&&(k=Qh(t,2),T=Qh(t,2),m?(k[0].h(0,0),k[1].h(0,l.height),T[0].h(l.width,0),T[1].h(T[0].x,k[1].y)):(k[0].h(0,0),k[1].h(l.width,0),T[0].h(0,l.height),T[1].h(k[1].x,T[0].y))),m){if(C=9999999,!(w===null||2>w.length||k===null||2>k.length))for(s=i=0;i<w.length&&s<k.length;){a=w[i];var X=k[s];p=X.x,m=X.y,p+=n;var $=a;i+1<w.length&&($=w[i+1]);var J=X;X=J.x,J=J.y,s+1<k.length&&(J=k[s+1],X=J.x,J=J.y,X+=n);var et=C;a.y===m?et=p-a.x:a.y>m&&a.y<J?et=p+(a.y-m)/(J-m)*(X-p)-a.x:m>a.y&&m<$.y&&(et=p-(a.x+(m-a.y)/($.y-a.y)*($.x-a.x))),et<C&&(C=et),$.y<=a.y?i++:J<=m?s++:($.y<=J&&i++,J<=$.y&&s++)}if(C=n-C,C+=v,i=k,s=C,e===null||2>e.length||i===null||2>i.length)n=null;else{for(v=Qh(t,e.length+i.length),n=a=p=0;a<i.length&&i[a].y<e[0].y;)m=i[a++],v[n++].h(m.x+s,m.y);for(;p<e.length;)m=e[p++],v[n++].h(m.x,m.y);for(p=e[e.length-1].y;a<i.length&&i[a].y<=p;)a++;for(;a<i.length&&i[a].y>p;)m=i[a++],v[n++].h(m.x+s,m.y);for(i=Qh(t,n),p=0;p<n;p++)i[p].assign(v[p]);Vf(t,v),n=i}if(a=T,p=C,w===null||2>w.length||a===null||2>a.length)s=null;else{for(v=Qh(t,w.length+a.length),s=m=i=0;i<w.length&&w[i].y<a[0].y;)$=w[i++],v[s++].h($.x,$.y);for(;m<a.length;)$=a[m++],v[s++].h($.x+p,$.y);for(a=a[a.length-1].y;i<w.length&&w[i].y<=a;)i++;for(;i<w.length&&w[i].y>a;)p=w[i++],v[s++].h(p.x,p.y);for(a=Qh(t,s),i=0;i<s;i++)a[i].assign(v[i]);Vf(t,v),s=a}return a=Math.max(0,C)+l.width,l=A,Vf(t,e),Vf(t,k),Vf(t,w),Vf(t,T),c[0]=n,c[1]=s,new Tt(C,0,a,l)}if(n=9999999,!(w===null||2>w.length||k===null||2>k.length))for(s=i=0;i<w.length&&s<k.length;)a=w[i],X=k[s],p=X.x,m=X.y,m+=C,$=a,i+1<w.length&&($=w[i+1]),J=X,X=J.x,J=J.y,s+1<k.length&&(J=k[s+1],X=J.x,J=J.y,J+=C),et=n,a.x===p?et=m-a.y:a.x>p&&a.x<X?et=m+(a.x-p)/(X-p)*(J-m)-a.y:p>a.x&&p<$.x&&(et=m-(a.y+(p-a.x)/($.x-a.x)*($.y-a.y))),et<n&&(n=et),$.x<=a.x?i++:X<=p?s++:($.x<=X&&i++,X<=$.x&&s++);if(C-=n,C+=v,i=k,s=C,e===null||2>e.length||i===null||2>i.length)n=null;else{for(v=Qh(t,e.length+i.length),n=a=p=0;a<i.length&&i[a].x<e[0].x;)m=i[a++],v[n++].h(m.x,m.y+s);for(;p<e.length;)m=e[p++],v[n++].h(m.x,m.y);for(p=e[e.length-1].x;a<i.length&&i[a].x<=p;)a++;for(;a<i.length&&i[a].x>p;)m=i[a++],v[n++].h(m.x,m.y+s);for(i=Qh(t,n),p=0;p<n;p++)i[p].assign(v[p]);Vf(t,v),n=i}if(a=T,p=C,w===null||2>w.length||a===null||2>a.length)s=null;else{for(v=Qh(t,w.length+a.length),s=m=i=0;i<w.length&&w[i].x<a[0].x;)$=w[i++],v[s++].h($.x,$.y);for(;m<a.length;)$=a[m++],v[s++].h($.x,$.y+p);for(a=a[a.length-1].x;i<w.length&&w[i].x<=a;)i++;for(;i<w.length&&w[i].x>a;)p=w[i++],v[s++].h(p.x,p.y);for(a=Qh(t,s),i=0;i<s;i++)a[i].assign(v[i]);Vf(t,v),s=a}return a=A,l=Math.max(0,C)+l.height,Vf(t,e),Vf(t,k),Vf(t,w),Vf(t,T),c[0]=n,c[1]=s,new Tt(C,0,a,l)}function Qh(t,e){if(t=t.ru[e],t!==void 0&&(t=t.pop(),t!==void 0))return t;t=[];for(var i=0;i<e;i++)t[i]=new G;return t}function Vf(t,e){var i=e.length,n=t.ru[i];n===void 0&&(n=[],t.ru[i]=n),n.push(e)}Hn.prototype.arrangeTrees=function(){if(this.Rb===Y1)for(var t=this.Ub.iterator;t.next();){var e=t.value;if(e instanceof uf){var i=e.node;if(i!==null){var n=i.position;i=n.x,n=n.y,isFinite(i)||(i=0),isFinite(n)||(n=0),Dx(this,e,i,n)}}}else{for(t=[],e=this.Ub.iterator;e.next();)i=e.value,i instanceof uf&&t.push(i);switch(this.sorting){case Cv:break;case Ry:t.reverse();break;case By:t.sort(this.comparer);break;case Fy:t.sort(this.comparer),t.reverse();break;default:Mt("Unhandled sorting value "+this.sorting.toString())}for(i=this.arrangementOrigin,e=i.x,i=i.y,n=0;n<t.length;n++){var s=t[n];switch(Dx(this,s,e+s.la.x,i+s.la.y),this.Rb){case X1:i+=s.Da.height+this.$d.height;break;case Bx:e+=s.Da.width+this.$d.width;break;default:Mt("Unhandled arrangement value "+this.Rb.toString())}}}};function Dx(t,e,i,n){if(e!==null){e.x=i,e.y=n,e=e.children;for(var s=e.length,a=0;a<s;a++){var l=e[a];Dx(t,l,i+l.S.x,n+l.S.y)}}}Hn.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Hn.prototype.commitNodes=function(){for(var t=this.network.vertexes.iterator;t.next();)t.value.commit();for(t.reset();t.next();)this.layoutComments(t.value)},Hn.prototype.Gu=function(){if(this.layerStyle===J1){for(var t=this.$v,e=[],i=null,n=this.network.vertexes.iterator;n.next();){var s=n.value;i===null?i=s.bounds.copy():i.ed(s.bounds);var a=e[s.level];a===void 0?a=this.computeLayerSpacing(s):a=Math.max(a,this.computeLayerSpacing(s)),e[s.level]=a}for(n=0;n<e.length;n++)e[n]===void 0&&(e[n]=0);if(this.angle===90||this.angle===270?(i.Bc(this.nodeSpacing/2,this.layerSpacing),n=new G(-this.nodeSpacing/2,-this.layerSpacing/2)):(i.Bc(this.layerSpacing,this.nodeSpacing/2),n=new G(-this.layerSpacing/2,-this.nodeSpacing/2)),s=[],i=this.angle===90||this.angle===270?i.width:i.height,a=0,this.angle===180||this.angle===270)for(var l=0;l<t.length;l++)a+=t[l]+e[l];for(l=0;l<t.length;l++){var c=t[l]+e[l];this.angle===270?(a-=c,s.push(new Tt(0,a,i,c))):this.angle===90?(s.push(new Tt(0,a,i,c)),a+=c):this.angle===180?(a-=c,s.push(new Tt(a,0,c,i))):(s.push(new Tt(a,0,c,i)),a+=c)}this.commitLayers(s,n)}},Hn.prototype.commitLayers=function(){},Hn.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},Hn.prototype.yv=function(){for(var t=this.Ub.iterator;t.next();){var e=t.value;e instanceof uf&&r2(this,e)}};function r2(t,e){if(e!==null){t.setPortSpots(e),e=e.children;for(var i=e.length,n=0;n<i;n++)r2(t,e[n])}}Hn.prototype.setPortSpots=function(t){var e=t.alignment;if(v0(e)){var i=this.ud===Cd,n=Lf(t);switch(n){case 0:var s=qa;break;case 90:s=ka;break;case 180:s=gl;break;default:s=al}var a=t.children,l=a.length;switch(e){case Np:case Ld:for(e=0;e<l;e++){var c=a[e];if(c=(i?c.sourceEdges:c.destinationEdges).first(),c!==null&&(c=c.link,c!==null)){var p=n===90||n===270?gl:al;if(l===1||e===l-1&&l%2===1)switch(n){case 0:p=gl;break;case 90:p=al;break;case 180:p=qa;break;default:p=ka}else e%2===0&&(p=n===90||n===270?qa:ka);i?(t.setsPortSpot&&(c.fromSpot=s),t.setsChildPortSpot&&(c.toSpot=p)):(t.setsPortSpot&&(c.fromSpot=p),t.setsChildPortSpot&&(c.toSpot=s))}}break;case Ap:for(n=n===90||n===270?qa:ka,a=i?t.destinationEdges:t.sourceEdges;a.next();)l=a.value.link,l!==null&&(i?(t.setsPortSpot&&(l.fromSpot=s),t.setsChildPortSpot&&(l.toSpot=n)):(t.setsPortSpot&&(l.fromSpot=n),t.setsChildPortSpot&&(l.toSpot=s)));break;case Yd:for(n=n===90||n===270?gl:al,a=i?t.destinationEdges:t.sourceEdges;a.next();)l=a.value.link,l!==null&&(i?(t.setsPortSpot&&(l.fromSpot=s),t.setsChildPortSpot&&(l.toSpot=n)):(t.setsPortSpot&&(l.fromSpot=n),t.setsChildPortSpot&&(l.toSpot=s)))}}else if(i=Lf(t),this.ud===Cd){for(s=t.destinationEdges;s.next();)if(n=s.value.link,n!==null){if(t.setsPortSpot)if(t.portSpot.Xb())switch(i){case 0:n.fromSpot=qa;break;case 90:n.fromSpot=ka;break;case 180:n.fromSpot=gl;break;default:n.fromSpot=al}else n.fromSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.Xb())switch(i){case 0:n.toSpot=gl;break;case 90:n.toSpot=al;break;case 180:n.toSpot=qa;break;default:n.toSpot=ka}else n.toSpot=t.childPortSpot}}else for(s=t.sourceEdges;s.next();)if(n=s.value.link,n!==null){if(t.setsPortSpot)if(t.portSpot.Xb())switch(i){case 0:n.toSpot=qa;break;case 90:n.toSpot=ka;break;case 180:n.toSpot=gl;break;default:n.toSpot=al}else n.toSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.Xb())switch(i){case 0:n.fromSpot=gl;break;case 90:n.fromSpot=al;break;case 180:n.fromSpot=qa;break;default:n.fromSpot=ka}else n.fromSpot=t.childPortSpot}};function Lf(t){return t=t.angle,45>=t?0:135>=t?90:225>=t?180:315>=t?270:0}Hn.prototype.computeLayerSpacing=function(t){var e=Lf(t);e=e===90||e===270;var i=t.layerSpacing;if(0<t.layerSpacingParentOverlap){var n=Math.min(1,t.layerSpacingParentOverlap);i-=e?t.height*n:t.width*n}return i<(e?-t.height:-t.width)&&(i=e?-t.height:-t.width),i},Hn.prototype.computeNodeIndent=function(t){var e=Lf(t),i=t.nodeIndent;if(0<t.nodeIndentPastParent){var n=Math.min(1,t.nodeIndentPastParent);i+=e===90||e===270?t.width*n:t.height*n}return i=Math.max(0,i)},St.Object.defineProperties(Hn.prototype,{roots:{get:function(){return this.Ub},set:function(t){this.Ub!==t&&(this.Ub=t,this.C())}},path:{get:function(){return this.Wn},set:function(t){this.Wn!==t&&(this.Wn=t,this.C())}},treeStyle:{get:function(){return this.vo},set:function(t){this.Rb===t||t!==G1&&t!==Ox&&t!==Ix&&t!==Rx||(this.vo=t,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(t){this.Rb===t||t!==Fx&&t!==zx&&t!==J1||(this.Bq=t,this.C())}},comments:{get:function(){return this.td},set:function(t){this.td!==t&&(this.td=t,this.C())}},arrangement:{get:function(){return this.Rb},set:function(t){this.Rb===t||t!==X1&&t!==Bx&&t!==Y1||(this.Rb=t,this.C())}},arrangementSpacing:{get:function(){return this.$d},set:function(t){this.$d.D(t)||(this.$d.assign(t),this.C())}},rootDefaults:{get:function(){return this.W},set:function(t){this.W!==t&&(this.W=t,this.C())}},alternateDefaults:{get:function(){return this.Y},set:function(t){this.Y!==t&&(this.Y=t,this.C())}},sorting:{get:function(){return this.W.sorting},set:function(t){this.W.sorting===t||t!==Cv&&t!==Ry&&t!==By&&!Fy||(this.W.sorting=t,this.C())}},comparer:{get:function(){return this.W.comparer},set:function(t){this.W.comparer!==t&&(this.W.comparer=t,this.C())}},angle:{get:function(){return this.W.angle},set:function(t){this.W.angle!==t&&(t===0||t===90||t===180||t===270?(this.W.angle=t,this.C()):Mt("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(){return this.W.alignment},set:function(t){this.W.alignment!==t&&(this.W.alignment=t,this.C())}},nodeIndent:{get:function(){return this.W.nodeIndent},set:function(t){this.W.nodeIndent!==t&&0<=t&&(this.W.nodeIndent=t,this.C())}},nodeIndentPastParent:{get:function(){return this.W.nodeIndentPastParent},set:function(t){this.W.nodeIndentPastParent!==t&&0<=t&&1>=t&&(this.W.nodeIndentPastParent=t,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(t){this.W.nodeSpacing!==t&&(this.W.nodeSpacing=t,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(t){this.W.layerSpacing!==t&&(this.W.layerSpacing=t,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(t){this.W.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.W.layerSpacingParentOverlap=t,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(t){this.W.compaction===t||t!==Z1&&t!==zy||(this.W.compaction=t,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(t){this.W.breadthLimit!==t&&0<=t&&(this.W.breadthLimit=t,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(t){this.W.rowSpacing!==t&&(this.W.rowSpacing=t,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(t){this.W.rowIndent!==t&&0<=t&&(this.W.rowIndent=t,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(t){this.W.commentSpacing!==t&&(this.W.commentSpacing=t,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(t){this.W.commentMargin!==t&&(this.W.commentMargin=t,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(t){this.W.setsPortSpot!==t&&(this.W.setsPortSpot=t,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(t){this.W.portSpot.D(t)||(this.W.portSpot=t,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(t){this.W.setsChildPortSpot!==t&&(this.W.setsChildPortSpot=t,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(t){this.W.childPortSpot.D(t)||(this.W.childPortSpot=t,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(t){this.Y.sorting===t||t!==Cv&&t!==Ry&&t!==By&&!Fy||(this.Y.sorting=t,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(t){this.Y.comparer!==t&&(this.Y.comparer=t,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(t){this.Y.angle===t||t!==0&&t!==90&&t!==180&&t!==270||(this.Y.angle=t,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(t){this.Y.alignment!==t&&(this.Y.alignment=t,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(t){this.Y.nodeIndent!==t&&0<=t&&(this.Y.nodeIndent=t,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(t){this.Y.nodeIndentPastParent!==t&&0<=t&&1>=t&&(this.Y.nodeIndentPastParent=t,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(t){this.Y.nodeSpacing!==t&&(this.Y.nodeSpacing=t,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(t){this.Y.layerSpacing!==t&&(this.Y.layerSpacing=t,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(t){this.Y.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.Y.layerSpacingParentOverlap=t,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(t){this.Y.compaction===t||t!==Z1&&t!==zy||(this.Y.compaction=t,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(t){this.Y.breadthLimit!==t&&0<=t&&(this.Y.breadthLimit=t,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(t){this.Y.rowSpacing!==t&&(this.Y.rowSpacing=t,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(t){this.Y.rowIndent!==t&&0<=t&&(this.Y.rowIndent=t,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(t){this.Y.commentSpacing!==t&&(this.Y.commentSpacing=t,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(t){this.Y.commentMargin!==t&&(this.Y.commentMargin=t,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(t){this.Y.setsPortSpot!==t&&(this.Y.setsPortSpot=t,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(t){this.Y.portSpot.D(t)||(this.Y.portSpot=t,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(t){this.Y.setsChildPortSpot!==t&&(this.Y.setsChildPortSpot=t,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(t){this.Y.childPortSpot.D(t)||(this.Y.childPortSpot=t,this.C())}}});var U1=new he(Hn,"PathDefault",-1),Cd=new he(Hn,"PathDestination",0),hg=new he(Hn,"PathSource",1),Cv=new he(Hn,"SortingForwards",10),Ry=new he(Hn,"SortingReverse",11),By=new he(Hn,"SortingAscending",12),Fy=new he(Hn,"SortingDescending",13),kv=new he(Hn,"AlignmentCenterSubtrees",20),cg=new he(Hn,"AlignmentCenterChildren",21),kd=new he(Hn,"AlignmentStart",22),Ed=new he(Hn,"AlignmentEnd",23),Np=new he(Hn,"AlignmentBus",24),Ld=new he(Hn,"AlignmentBusBranching",25),Ap=new he(Hn,"AlignmentTopLeftBus",26),Yd=new he(Hn,"AlignmentBottomRightBus",27),Z1=new he(Hn,"CompactionNone",30),zy=new he(Hn,"CompactionBlock",31),G1=new he(Hn,"StyleLayered",40),Ix=new he(Hn,"StyleLastParents",41),Ox=new he(Hn,"StyleAlternating",42),Rx=new he(Hn,"StyleRootOnly",43),X1=new he(Hn,"ArrangementVertical",50),Bx=new he(Hn,"ArrangementHorizontal",51),Y1=new he(Hn,"ArrangementFixedRoots",52),Fx=new he(Hn,"LayerIndividual",60),zx=new he(Hn,"LayerSiblings",61),J1=new he(Hn,"LayerUniform",62);Hn.className="TreeLayout",Hn.PathDefault=U1,Hn.PathDestination=Cd,Hn.PathSource=hg,Hn.SortingForwards=Cv,Hn.SortingReverse=Ry,Hn.SortingAscending=By,Hn.SortingDescending=Fy,Hn.AlignmentCenterSubtrees=kv,Hn.AlignmentCenterChildren=cg,Hn.AlignmentStart=kd,Hn.AlignmentEnd=Ed,Hn.AlignmentBus=Np,Hn.AlignmentBusBranching=Ld,Hn.AlignmentTopLeftBus=Ap,Hn.AlignmentBottomRightBus=Yd,Hn.CompactionNone=Z1,Hn.CompactionBlock=zy,Hn.StyleLayered=G1,Hn.StyleLastParents=Ix,Hn.StyleAlternating=Ox,Hn.StyleRootOnly=Rx,Hn.ArrangementVertical=X1,Hn.ArrangementHorizontal=Bx,Hn.ArrangementFixedRoots=Y1,Hn.LayerIndividual=Fx,Hn.LayerSiblings=zx,Hn.LayerUniform=J1;function fg(t){Zo.call(this,t)}li(fg,Zo),fg.prototype.createVertex=function(){return new uf(this)},fg.prototype.createEdge=function(){return new Ev(this)},fg.className="TreeNetwork";function uf(t){Ha.call(this,t),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new G(0,0),this.Da=new fe(0,0),this.la=new G(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Cv,this.hd=My,this.Kb=0,this.Jb=cg,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=zy,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=ds,this.wr=!0,this.Dp=ds}li(uf,Ha),uf.prototype.copyInheritedPropertiesFrom=function(t){t!==null&&(this.nd=t.sorting,this.hd=t.comparer,this.Kb=t.angle,this.Jb=t.alignment,this.Uq=t.nodeIndent,this.Vq=t.nodeIndentPastParent,this.Wq=t.nodeSpacing,this.ie=t.layerSpacing,this.Aq=t.layerSpacingParentOverlap,this.Hp=t.compaction,this.Ap=t.breadthLimit,this.nr=t.rowSpacing,this.mr=t.rowIndent,this.Gp=t.commentSpacing,this.Fp=t.commentMargin,this.xr=t.setsPortSpot,this.dr=t.portSpot,this.wr=t.setsChildPortSpot,this.Dp=t.childPortSpot)},St.Object.defineProperties(uf.prototype,{initialized:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}},parent:{get:function(){return this.hb},set:function(t){this.hb!==t&&(this.hb=t)}},children:{get:function(){return this.u},set:function(t){if(this.u!==t){if(t!==null)for(var e=t.length,i=0;i<e;i++);this.u=t}}},level:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}},descendantCount:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}},maxChildrenCount:{get:function(){return this.Ha},set:function(t){this.Ha!==t&&(this.Ha=t)}},maxGenerationCount:{get:function(){return this.nb},set:function(t){this.nb!==t&&(this.nb=t)}},comments:{get:function(){return this.td},set:function(t){if(this.td!==t){if(t!==null)for(var e=t.length,i=0;i<e;i++);this.td=t}}},sorting:{get:function(){return this.nd},set:function(t){this.nd!==t&&(this.nd=t)}},comparer:{get:function(){return this.hd},set:function(t){this.hd!==t&&(this.hd=t)}},angle:{get:function(){return this.Kb},set:function(t){this.Kb!==t&&(this.Kb=t)}},alignment:{get:function(){return this.Jb},set:function(t){this.Jb!==t&&(this.Jb=t)}},nodeIndent:{get:function(){return this.Uq},set:function(t){this.Uq!==t&&(this.Uq=t)}},nodeIndentPastParent:{get:function(){return this.Vq},set:function(t){this.Vq!==t&&(this.Vq=t)}},nodeSpacing:{get:function(){return this.Wq},set:function(t){this.Wq!==t&&(this.Wq=t)}},layerSpacing:{get:function(){return this.ie},set:function(t){this.ie!==t&&(this.ie=t)}},layerSpacingParentOverlap:{get:function(){return this.Aq},set:function(t){this.Aq!==t&&(this.Aq=t)}},compaction:{get:function(){return this.Hp},set:function(t){this.Hp!==t&&(this.Hp=t)}},breadthLimit:{get:function(){return this.Ap},set:function(t){this.Ap!==t&&(this.Ap=t)}},rowSpacing:{get:function(){return this.nr},set:function(t){this.nr!==t&&(this.nr=t)}},rowIndent:{get:function(){return this.mr},set:function(t){this.mr!==t&&(this.mr=t)}},commentSpacing:{get:function(){return this.Gp},set:function(t){this.Gp!==t&&(this.Gp=t)}},commentMargin:{get:function(){return this.Fp},set:function(t){this.Fp!==t&&(this.Fp=t)}},setsPortSpot:{get:function(){return this.xr},set:function(t){this.xr!==t&&(this.xr=t)}},portSpot:{get:function(){return this.dr},set:function(t){this.dr.D(t)||(this.dr=t)}},setsChildPortSpot:{get:function(){return this.wr},set:function(t){this.wr!==t&&(this.wr=t)}},childPortSpot:{get:function(){return this.Dp},set:function(t){this.Dp.D(t)||(this.Dp=t)}},childrenCount:{get:function(){return this.children.length}},relativePosition:{get:function(){return this.S},set:function(t){this.S.set(t)}},subtreeSize:{get:function(){return this.Da},set:function(t){this.Da.set(t)}},subtreeOffset:{get:function(){return this.la},set:function(t){this.la.set(t)}}}),uf.className="TreeVertex";function Ev(t){kh.call(this,t),this.$t=new G(0,0)}li(Ev,kh),Ev.prototype.commit=function(){var t=this.link;if(t!==null&&!t.isAvoiding){var e=this.network.layout,i=null,n=null;switch(e.ud){case Cd:i=this.fromVertex,n=this.toVertex;break;case hg:i=this.toVertex,n=this.fromVertex;break;default:Mt("Unhandled path value "+e.ud.toString())}if(i!==null&&n!==null){var s=this.$t;if(s.x!==0||s.y!==0||i.qA){n=i.bounds;var a=Lf(i),l=e.computeLayerSpacing(i),c=i.rowSpacing;t.vg();var p=t.curve===Yh,m=t.isOrthogonal,v;if(t.uh(),m||p){for(v=2;4<t.pointsCount;)t.pv(2);var w=t.i(1),C=t.i(2)}else{for(v=1;3<t.pointsCount;)t.pv(1);w=t.i(0),C=t.i(t.pointsCount-1)}var k=t.i(t.pointsCount-1);a===0?(i.alignment===Ed?(a=n.bottom+s.y,s.y===0&&w.y>k.y+i.rowIndent&&(a=Math.min(a,Math.max(w.y,a-e.computeNodeIndent(i))))):i.alignment===kd?(a=n.top+s.y,s.y===0&&w.y<k.y-i.rowIndent&&(a=Math.max(a,Math.min(w.y,a+e.computeNodeIndent(i))))):a=i.hm||i.im&&i.maxGenerationCount===1?n.top-i.la.y+s.y:n.y+n.height/2+s.y,p?(t.m(v,w.x,a),v++,t.m(v,n.right+l,a),v++,t.m(v,n.right+l+(s.x-c)/3,a),v++,t.m(v,n.right+l+2*(s.x-c)/3,a),v++,t.m(v,n.right+l+(s.x-c),a),v++,t.m(v,C.x,a)):(m&&(t.m(v,n.right+l/2,w.y),v++),t.m(v,n.right+l/2,a),v++,t.m(v,n.right+l+s.x-(m?c/2:c),a),v++,m&&t.m(v,t.i(v-1).x,C.y))):a===90?(i.alignment===Ed?(a=n.right+s.x,s.x===0&&w.x>k.x+i.rowIndent&&(a=Math.min(a,Math.max(w.x,a-e.computeNodeIndent(i))))):i.alignment===kd?(a=n.left+s.x,s.x===0&&w.x<k.x-i.rowIndent&&(a=Math.max(a,Math.min(w.x,a+e.computeNodeIndent(i))))):a=i.hm||i.im&&i.maxGenerationCount===1?n.left-i.la.x+s.x:n.x+n.width/2+s.x,p?(t.m(v,a,w.y),v++,t.m(v,a,n.bottom+l),v++,t.m(v,a,n.bottom+l+(s.y-c)/3),v++,t.m(v,a,n.bottom+l+2*(s.y-c)/3),v++,t.m(v,a,n.bottom+l+(s.y-c)),v++,t.m(v,a,C.y)):(m&&(t.m(v,w.x,n.bottom+l/2),v++),t.m(v,a,n.bottom+l/2),v++,t.m(v,a,n.bottom+l+s.y-(m?c/2:c)),v++,m&&t.m(v,C.x,t.i(v-1).y))):a===180?(i.alignment===Ed?(a=n.bottom+s.y,s.y===0&&w.y>k.y+i.rowIndent&&(a=Math.min(a,Math.max(w.y,a-e.computeNodeIndent(i))))):i.alignment===kd?(a=n.top+s.y,s.y===0&&w.y<k.y-i.rowIndent&&(a=Math.max(a,Math.min(w.y,a+e.computeNodeIndent(i))))):a=i.hm||i.im&&i.maxGenerationCount===1?n.top-i.la.y+s.y:n.y+n.height/2+s.y,p?(t.m(v,w.x,a),v++,t.m(v,n.left-l,a),v++,t.m(v,n.left-l+(s.x+c)/3,a),v++,t.m(v,n.left-l+2*(s.x+c)/3,a),v++,t.m(v,n.left-l+(s.x+c),a),v++,t.m(v,C.x,a)):(m&&(t.m(v,n.left-l/2,w.y),v++),t.m(v,n.left-l/2,a),v++,t.m(v,n.left-l+s.x+(m?c/2:c),a),v++,m&&t.m(v,t.i(v-1).x,C.y))):a===270?(i.alignment===Ed?(a=n.right+s.x,s.x===0&&w.x>k.x+i.rowIndent&&(a=Math.min(a,Math.max(w.x,a-e.computeNodeIndent(i))))):i.alignment===kd?(a=n.left+s.x,s.x===0&&w.x<k.x-i.rowIndent&&(a=Math.max(a,Math.min(w.x,a+e.computeNodeIndent(i))))):a=i.hm||i.im&&i.maxGenerationCount===1?n.left-i.la.x+s.x:n.x+n.width/2+s.x,p?(t.m(v,a,w.y),v++,t.m(v,a,n.top-l),v++,t.m(v,a,n.top-l+(s.y+c)/3),v++,t.m(v,a,n.top-l+2*(s.y+c)/3),v++,t.m(v,a,n.top-l+(s.y+c)),v++,t.m(v,a,C.y)):(m&&(t.m(v,w.x,n.top-l/2),v++),t.m(v,a,n.top-l/2),v++,t.m(v,a,n.top-l+s.y+(m?c/2:c)),v++,m&&t.m(v,C.x,t.i(v-1).y))):Mt("Invalid angle "+a),t.zf()}else s=n,t=this.link,n=this.network.layout,e=Lf(i),e!==Lf(s)&&(l=n.computeLayerSpacing(i),c=i.bounds,i=s.bounds,e===0&&i.left-c.right<l+1||e===90&&i.top-c.bottom<l+1||e===180&&c.left-i.right<l+1||e===270&&c.top-i.bottom<l+1||(t.vg(),i=t.curve===Yh,s=t.isOrthogonal,n=v0(this.fromVertex.alignment),t.uh(),e===0?(e=c.right+l/2,i?t.pointsCount===4&&(i=t.i(3).y,t.L(1,e-20,t.i(1).y),t.m(2,e-20,i),t.m(3,e,i),t.m(4,e+20,i),t.L(5,t.i(5).x,i)):s?n?t.L(3,t.i(2).x,t.i(4).y):t.pointsCount===6&&(t.L(2,e,t.i(2).y),t.L(3,e,t.i(3).y)):t.pointsCount===4?t.m(2,e,t.i(2).y):t.pointsCount===3?t.L(1,e,t.i(2).y):t.pointsCount===2&&t.m(1,e,t.i(1).y)):e===90?(e=c.bottom+l/2,i?t.pointsCount===4&&(i=t.i(3).x,t.L(1,t.i(1).x,e-20),t.m(2,i,e-20),t.m(3,i,e),t.m(4,i,e+20),t.L(5,i,t.i(5).y)):s?n?t.L(3,t.i(2).x,t.i(4).y):t.pointsCount===6&&(t.L(2,t.i(2).x,e),t.L(3,t.i(3).x,e)):t.pointsCount===4?t.m(2,t.i(2).x,e):t.pointsCount===3?t.L(1,t.i(2).x,e):t.pointsCount===2&&t.m(1,t.i(1).x,e)):e===180?(e=c.left-l/2,i?t.pointsCount===4&&(i=t.i(3).y,t.L(1,e+20,t.i(1).y),t.m(2,e+20,i),t.m(3,e,i),t.m(4,e-20,i),t.L(5,t.i(5).x,i)):s?n?t.L(3,t.i(2).x,t.i(4).y):t.pointsCount===6&&(t.L(2,e,t.i(2).y),t.L(3,e,t.i(3).y)):t.pointsCount===4?t.m(2,e,t.i(2).y):t.pointsCount===3?t.L(1,e,t.i(2).y):t.pointsCount===2&&t.m(1,e,t.i(1).y)):e===270&&(e=c.top-l/2,i?t.pointsCount===4&&(i=t.i(3).x,t.L(1,t.i(1).x,e+20),t.m(2,i,e+20),t.m(3,i,e),t.m(4,i,e-20),t.L(5,i,t.i(5).y)):s?n?t.L(3,t.i(2).x,t.i(4).y):t.pointsCount===6&&(t.L(2,t.i(2).x,e),t.L(3,t.i(3).x,e)):t.pointsCount===4?t.m(2,t.i(2).x,e):t.pointsCount===3?t.L(1,t.i(2).x,e):t.pointsCount===2&&t.m(1,t.i(1).x,e)),t.zf()))}}},St.Object.defineProperties(Ev.prototype,{fromVertex:{get:function(){return this.kd},set:function(t){this.kd!==t&&(this.kd=t)}},toVertex:{get:function(){return this.qd},set:function(t){this.qd!==t&&(this.qd=t)}},relativePoint:{get:function(){return this.$t},set:function(t){this.$t.set(t)}}}),Ev.className="TreeEdge",Rr.prototype.initializeStandardTools=function(){this.gb("Action",new Ps,this.mouseDownTools),this.gb("Relinking",new go,this.mouseDownTools),this.gb("LinkReshaping",new Zr,this.mouseDownTools),this.gb("Rotating",new Qr,this.mouseDownTools),this.gb("Resizing",new Cr,this.mouseDownTools),this.gb("Linking",new xn,this.mouseMoveTools),this.gb("Dragging",new as,this.mouseMoveTools),this.gb("DragSelecting",new Ns,this.mouseMoveTools),this.gb("Panning",new gs,this.mouseMoveTools),this.gb("ContextMenu",new Ks,this.mouseUpTools),this.gb("TextEditing",new mr,this.mouseUpTools),this.gb("ClickCreating",new xs,this.mouseUpTools),this.gb("ClickSelecting",new io,this.mouseUpTools)},yf("Horizontal",new _g),yf("Spot",new Sm),yf("Table",new up),yf("Viewbox",new Nc),yf("TableRow",new hp),yf("TableColumn",new I0),yf("Graduated",new Rd),yf("Grid",new Mm),Tc.add("GraphLinksModel",Nl),Tc.add("TreeModel",fc);var q1=Kt.go,$x={get licenseKey(){return Ct.licenseKey},set licenseKey(t){Ct.licenseKey=t},get version(){return Ct.version},Group:Yi,EnumValue:he,List:ue,Set:te,Map:ci,Point:G,Size:fe,Rect:Tt,Margin:Ai,Spot:di,Geometry:ve,PathFigure:fa,PathSegment:zn,InputEvent:_s,DiagramEvent:sa,ChangedEvent:mo,Model:ii,GraphLinksModel:nr,TreeModel:nh,Binding:lo,Transaction:Ga,UndoManager:ms,CommandHandler:H,Tool:Jn,DraggingTool:as,DraggingInfo:Eu,DraggingOptions:d,LinkingBaseTool:Di,LinkingTool:xn,RelinkingTool:go,LinkReshapingTool:Zr,ResizingTool:Cr,RotatingTool:Qr,ClickSelectingTool:io,ActionTool:Ps,ClickCreatingTool:xs,HTMLInfo:la,ContextMenuTool:Ks,DragSelectingTool:Ns,PanningTool:gs,TextEditingTool:mr,ToolManager:Rr,Animation:Li,AnimationManager:Es,AnimationTrigger:nn,Layer:ji,Diagram:Ct,Palette:x,Overview:S,Brush:Br,GraphObject:pt,Panel:ce,RowColumnDefinition:tl,Shape:pn,TextBlock:ao,Picture:hh,Part:bi,Adornment:pr,Node:Ee,Link:ge,Placeholder:Wu,Layout:hs,LayoutNetwork:Zo,LayoutVertex:Ha,LayoutEdge:kh,GridLayout:Fl,PanelLayout:fl,CircularLayout:Os,CircularNetwork:ad,CircularVertex:hm,CircularEdge:sg,ForceDirectedLayout:lu,ForceDirectedNetwork:m0,ForceDirectedVertex:ag,ForceDirectedEdge:lg,LayeredDigraphLayout:co,LayeredDigraphNetwork:Mv,LayeredDigraphVertex:Zc,LayeredDigraphEdge:Iy,TreeLayout:Hn,TreeNetwork:fg,TreeVertex:uf,TreeEdge:Ev};typeof q1=="object"&&q1.version&&_i("WARNING: a `go` object on the root object is already defined. "+("Debug"in q1?"debug ":"")+"version: "+q1.version+", replaced with version: "+$x.version),Ct.prototype.go=$x,Kt.go=$x,typeof Wr.exports=="object"&&(Wr.exports=typeof j.g!="undefined"?j.g.go:self.go)}();var Nt=typeof j.g!="undefined"?j.g.go:self.go;const At=typeof j.g!="undefined"?j.g.go:self.go,vt=At.Group,Et=At.EnumValue,gt=At.List,ft=At.Set,ct=At.Map,ot=At.Point,F=At.Size,Y=At.Rect,ee=At.Margin,ne=At.Spot,Fe=At.Geometry,le=At.PathFigure,Zt=At.PathSegment,zt=At.InputEvent,Q=At.DiagramEvent,se=At.ChangedEvent,$e=At.Model,Vt=At.GraphLinksModel,Wt=At.TreeModel,kt=At.Binding,it=At.Transaction,Ot=At.UndoManager,qt=At.CommandHandler,Te=At.Tool,_e=At.DraggingTool,fi=At.DraggingInfo,Ht=At.LinkingBaseTool,pe=At.LinkingTool,Ke=At.RelinkingTool,ki=At.LinkReshapingTool,pi=At.ResizingTool,Sn=At.RotatingTool,Sr=At.ClickSelectingTool,Ki=At.ActionTool,It=At.ClickCreatingTool,tt=At.HTMLInfo,de=At.ContextMenuTool,hi=At.DragSelectingTool,Ze=At.PanningTool,Ye=At.TextEditingTool,Ae=At.ToolManager,Wi=At.Animation,En=At.AnimationManager,an=At.AnimationTrigger,vi=At.Layer,ai=At.Diagram,zi=At.Palette,$i=At.Overview,q=At.Brush,D=At.GraphObject,_=At.Panel,K=At.RowColumnDefinition,z=At.Shape,P=At.TextBlock,bt=At.TextBlockMetrics,Gt=At.Picture,Pe=At.Part,He=At.Adornment,ei=At.Node,si=At.Link,Gi=At.Placeholder,er=At.Layout,rr=At.LayoutNetwork,Se=At.LayoutVertex,We=At.LayoutEdge,Go=At.GridLayout,$o=At.PanelLayout,yo=At.CircularLayout,Fr=At.CircularNetwork,Ro=At.CircularVertex,uo=At.CircularEdge,Ao=At.ForceDirectedLayout,fs=At.ForceDirectedNetwork,Ya=At.ForceDirectedVertex,Ja=At.ForceDirectedEdge,jl=At.LayeredDigraphLayout,Na=At.LayeredDigraphNetwork,xo=At.LayeredDigraphVertex,rl=At.LayeredDigraphEdge,Va=At.TreeLayout,Kl=At.TreeNetwork,ga=At.TreeVertex,Xs=At.TreeEdge,Me=At.version},15979:function(Wr,Ti,j){"use strict";j.d(Ti,{hP:function(){return $i}});var Nt=function(q,D){return(Nt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,K){_.__proto__=K}||function(_,K){for(var z in K)Object.prototype.hasOwnProperty.call(K,z)&&(_[z]=K[z])})(q,D)};function At(q,D){function _(){this.constructor=q}Nt(q,D),q.prototype=D===null?Object.create(D):(_.prototype=D.prototype,new _)}function vt(q,D,_,K){return new(_||(_=Promise))(function(z,P){function bt(He){try{Pe(K.next(He))}catch(ei){P(ei)}}function Gt(He){try{Pe(K.throw(He))}catch(ei){P(ei)}}function Pe(He){var ei;He.done?z(He.value):(ei=He.value,ei instanceof _?ei:new _(function(si){si(ei)})).then(bt,Gt)}Pe((K=K.apply(q,D||[])).next())})}function Et(q,D){var _,K,z,P,bt={label:0,sent:function(){if(1&z[0])throw z[1];return z[1]},trys:[],ops:[]};return P={next:Gt(0),throw:Gt(1),return:Gt(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function Gt(Pe){return function(He){return function(ei){if(_)throw new TypeError("Generator is already executing.");for(;bt;)try{if(_=1,K&&(z=2&ei[0]?K.return:ei[0]?K.throw||((z=K.return)&&z.call(K),0):K.next)&&!(z=z.call(K,ei[1])).done)return z;switch(K=0,z&&(ei=[2&ei[0],z.value]),ei[0]){case 0:case 1:z=ei;break;case 4:return bt.label++,{value:ei[1],done:!1};case 5:bt.label++,K=ei[1],ei=[0];continue;case 7:ei=bt.ops.pop(),bt.trys.pop();continue;default:if(z=bt.trys,!((z=z.length>0&&z[z.length-1])||ei[0]!==6&&ei[0]!==2)){bt=0;continue}if(ei[0]===3&&(!z||ei[1]>z[0]&&ei[1]<z[3])){bt.label=ei[1];break}if(ei[0]===6&&bt.label<z[1]){bt.label=z[1],z=ei;break}if(z&&bt.label<z[2]){bt.label=z[2],bt.ops.push(ei);break}z[2]&&bt.ops.pop(),bt.trys.pop();continue}ei=D.call(q,bt)}catch(si){ei=[6,si],K=0}finally{_=z=0}if(5&ei[0])throw ei[1];return{value:ei[0]?ei[1]:void 0,done:!0}}([Pe,He])}}}function gt(){for(var q=0,D=0,_=arguments.length;D<_;D++)q+=arguments[D].length;var K=Array(q),z=0;for(D=0;D<_;D++)for(var P=arguments[D],bt=0,Gt=P.length;bt<Gt;bt++,z++)K[z]=P[bt];return K}var ft=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(D,_){for(var K=0,z=_;K<z.length;K++){var P=z[K],bt=P[0],Gt=P[1];D.setAttribute(bt,Gt)}},q.createRect=function(D,_,K){var z=document.createElementNS("http://www.w3.org/2000/svg","rect");return z.setAttribute("width",D.toString()),z.setAttribute("height",_.toString()),K&&q.setAttributes(z,K),z},q.createLine=function(D,_,K,z,P){var bt=document.createElementNS("http://www.w3.org/2000/svg","line");return bt.setAttribute("x1",D.toString()),bt.setAttribute("y1",_.toString()),bt.setAttribute("x2",K.toString()),bt.setAttribute("y2",z.toString()),P&&q.setAttributes(bt,P),bt},q.createPolygon=function(D,_){var K=document.createElementNS("http://www.w3.org/2000/svg","polygon");return K.setAttribute("points",D),_&&q.setAttributes(K,_),K},q.createCircle=function(D,_){var K=document.createElementNS("http://www.w3.org/2000/svg","circle");return K.setAttribute("cx",(D/2).toString()),K.setAttribute("cy",(D/2).toString()),K.setAttribute("r",D.toString()),_&&q.setAttributes(K,_),K},q.createEllipse=function(D,_,K){var z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return z.setAttribute("cx",(D/2).toString()),z.setAttribute("cy",(_/2).toString()),z.setAttribute("rx",(D/2).toString()),z.setAttribute("ry",(_/2).toString()),K&&q.setAttributes(z,K),z},q.createGroup=function(D){var _=document.createElementNS("http://www.w3.org/2000/svg","g");return D&&q.setAttributes(_,D),_},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(D,_,K,z,P,bt,Gt){var Pe=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(Pe,[["id",D],["orient",_],["markerWidth",K.toString()],["markerHeight",z.toString()],["refX",P.toString()],["refY",bt.toString()]]),Pe.appendChild(Gt),Pe},q.createText=function(D){var _=document.createElementNS("http://www.w3.org/2000/svg","text");return _.setAttribute("x","0"),_.setAttribute("y","0"),D&&q.setAttributes(_,D),_},q.createTSpan=function(D,_){var K=document.createElementNS("http://www.w3.org/2000/svg","tspan");return K.textContent=D,_&&q.setAttributes(K,_),K},q.createImage=function(D){var _=document.createElementNS("http://www.w3.org/2000/svg","image");return D&&q.setAttributes(_,D),_},q.createPoint=function(D,_){var K=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return K.x=D,K.y=_,K},q.createPath=function(D,_){var K=document.createElementNS("http://www.w3.org/2000/svg","path");return K.setAttribute("d",D),_&&q.setAttributes(K,_),K},q}(),ct=function(){function q(){}return q.addKey=function(D){q.key=D},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),ot=function(){function q(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return q.prototype.rasterize=function(D,_,K){var z=this;return new Promise(function(P){var bt=K!==void 0?K:document.createElement("canvas");D===null&&(z.markersOnly=!0,z.naturalSize=!1);var Gt=document.createElementNS("http://www.w3.org/2000/svg","svg");Gt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Gt.setAttribute("width",_.width.baseVal.valueAsString),Gt.setAttribute("height",_.height.baseVal.valueAsString),Gt.setAttribute("viewBox","0 0 "+_.viewBox.baseVal.width.toString()+" "+_.viewBox.baseVal.height.toString()),Gt.innerHTML=_.innerHTML,z.naturalSize===!0?(Gt.width.baseVal.value=D.naturalWidth,Gt.height.baseVal.value=D.naturalHeight):z.width!==void 0&&z.height!==void 0&&(Gt.width.baseVal.value=z.width,Gt.height.baseVal.value=z.height),bt.width=Gt.width.baseVal.value,bt.height=Gt.height.baseVal.value;var Pe=Gt.outerHTML,He=bt.getContext("2d");z.markersOnly!==!0&&He.drawImage(D,0,0,bt.width,bt.height);var ei=window.URL,si=new Image(bt.width,bt.height);si.setAttribute("crossOrigin","anonymous");var Gi=new Blob([Pe],{type:"image/svg+xml"}),er=ei.createObjectURL(Gi);si.onload=function(){He.drawImage(si,0,0),ei.revokeObjectURL(er);var rr=bt.toDataURL(z.imageType,z.imageQuality);P(rr)},si.src=er})},q}(),F=function(){},Y=function(){function q(D){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+D+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(D){return this.styleSheet===void 0&&this.addStyleSheet(),D.name=""+this.classNamePrefix+D.localName,this.classes.push(D),this.styleSheet.sheet.insertRule("."+D.name+" {"+D.style+"}",this.styleSheet.sheet.cssRules.length),D},q.prototype.addRule=function(D){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(D),this.styleSheet.sheet.insertRule(D.selector+" {"+D.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var D;this.styleSheet=document.createElement("style"),((D=this.styleSheetRoot)!==null&&D!==void 0?D:document.head).appendChild(this.styleSheet),this.addRule(new ee("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ee("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new ee("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new ne("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new ne("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},q.prototype.removeStyleSheet=function(){var D;this.styleSheet&&(((D=this.styleSheetRoot)!==null&&D!==void 0?D:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),ee=function(q,D){this.selector=q,this.style=D},ne=function(q,D){this.localName=q,this.style=D},Fe=function(){function q(D,_,K,z,P){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=D,this.displayMode=_,this.markerItems=K,this.uiStyleSettings=z,this.styles=P,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return q.prototype.show=function(D){var _=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=D,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",this.uiContainer.appendChild(K),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(P){var bt=document.createElement("div");bt.className=""+_.toolbarButtonStyleClass.name,bt.setAttribute("data-type-name",P.typeName),bt.innerHTML=P.icon,bt.addEventListener("click",function(){_.markerToolbarButtonClicked(bt,P)}),_.buttons.push(bt),_.markerButtons.push(bt)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(z),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},q.prototype.addButtonClickListener=function(D){this.buttonClickListeners.push(D)},q.prototype.removeButtonClickListener=function(D){this.buttonClickListeners.indexOf(D)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(D),1)},q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var D=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var _=0;_<this.markerButtons.length;_++)_<D||_===D&&this.markerButtons.length-1===D?this.markerButtonBlock.appendChild(this.markerButtons[_]):(_===D&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[_]))}},q.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},q.prototype.resetButtonStyles=function(){var D=this;this.buttons.forEach(function(_){_.className=_.className.replace(D.uiStyleSettings.toolbarButtonStyleColorsClassName?D.uiStyleSettings.toolbarButtonStyleColorsClassName:D.toolbarButtonStyleColorsClass.name,"").trim(),_.className=_.className.replace(D.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?D.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:D.toolbarActiveButtonStyleColorsClass.name,"").trim(),_.className+=" "+(D.uiStyleSettings.toolbarButtonStyleColorsClassName?D.uiStyleSettings.toolbarButtonStyleColorsClassName:D.toolbarButtonStyleColorsClass.name)})},q.prototype.addActionButton=function(D,_,K){var z=this,P=document.createElement("div");switch(P.className=""+this.toolbarButtonStyleClass.name,P.innerHTML=_,P.setAttribute("data-action",K),P.addEventListener("click",function(){z.actionToolbarButtonClicked(P,K)}),K){case"select":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":P.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":P.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":P.style.fill=this.uiStyleSettings.closeButtonColor}D.appendChild(P),this.buttons.push(P)},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ne("toolbar",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ne("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ne("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ne("toolbar-overflow-block",`
|
|
|
position: absolute;
|
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
z-index: 10;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new ne("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var D=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ne("toolbar_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px;
|
|
|
padding: `+D+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ne("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new ee("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new ee("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},q.prototype.markerToolbarButtonClicked=function(D,_){this.setActiveButton(D),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("marker",_)}),this.markerButtonOverflowBlock.style.display="none"},q.prototype.actionToolbarButtonClicked=function(D,_){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(K){return K("action",_)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},q.prototype.setActiveButton=function(D){this.resetButtonStyles(),D.className=D.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),D.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},q.prototype.setActiveMarkerButton=function(D){var _=this.markerButtons.find(function(K){return K.getAttribute("data-type-name")===D});_&&this.setActiveButton(_)},q.prototype.setCurrentMarker=function(D){var _=this;this.currentMarker=D,this.buttons.filter(function(K){return/delete|notes/.test(K.getAttribute("data-action"))}).forEach(function(K){_.currentMarker===void 0?(K.style.fillOpacity="0.4",K.style.pointerEvents="none"):(K.style.fillOpacity="1",K.style.pointerEvents="all")})},q}(),le=function(){function q(D,_,K,z){this.panels=[],this.panelButtons=[],this.markerjsContainer=D,this.displayMode=_,this.uiStyleSettings=K,this.styles=z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return q.prototype.addStyles=function(){var D;this.toolboxStyleClass=this.styles.addClass(new ne("toolbox",`
|
|
|
width: 100%;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
font-family: sans-serif;
|
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
|
overflow: hidden;
|
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ne("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var _=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ne("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ne("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ne("toolbox-panel-row",`
|
|
|
display: flex;
|
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
|
cursor: default;
|
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ne("toolbox-panel-row_colors",`
|
|
|
background-color: `+((D=this.uiStyleSettings.toolboxBackgroundColor)!==null&&D!==void 0?D:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ne("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*_)+`px;
|
|
|
padding: `+_+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new ee("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new ee("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},q.prototype.show=function(D){var _;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=D,this.uiContainer.className=this.toolboxStyleClass.name+" "+((_=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},q.prototype.setPanelButtons=function(D){var _,K,z=this;this.panels=D,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((_=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&_!==void 0?_:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(P){var bt;P.uiStyleSettings=z.uiStyleSettings;var Gt=document.createElement("div");Gt.className=z.toolboxButtonStyleClass.name+" "+((bt=z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&bt!==void 0?bt:z.toolboxButtonStyleColorsClass.name),Gt.innerHTML=P.icon,Gt.title=P.title,Gt.addEventListener("click",function(){z.panelButtonClick(P)}),z.panelButtons.push(Gt),z.buttonRow.appendChild(Gt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},q.prototype.panelButtonClick=function(D){var _=this,K=-1;if(D!==this.activePanel){K=this.panels.indexOf(D),this.panelRow.innerHTML="";var z=D.getUi();z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(z),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=D}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){_.displayMode==="inline"?_.panelRow.style.display="none":_.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(P,bt){var Gt,Pe;P.className=_.toolboxButtonStyleClass.name+" "+(bt===K?""+((Gt=_.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Gt!==void 0?Gt:_.toolboxActiveButtonStyleColorsClass.name):""+((Pe=_.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:_.toolboxButtonStyleColorsClass.name))})},q}(),Zt=function(q,D){this.title=q,this.icon=D},zt=function(q){function D(_,K,z,P){var bt=q.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return bt.colors=[],bt.addTransparent=!1,bt.colorBoxes=[],bt.colors=K,bt.currentColor=z,bt.setCurrentColor=bt.setCurrentColor.bind(bt),bt.getColorBox=bt.getColorBox.bind(bt),bt}return At(D,q),D.prototype.getUi=function(){var _=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.whiteSpace="nowrap",this.colors.forEach(function(z){var P=_.getColorBox(z);K.appendChild(P),_.colorBoxes.push(P)}),K},D.prototype.getColorBox=function(_){var K=this,z=this.uiStyleSettings.toolbarHeight/4,P=this.uiStyleSettings.toolbarHeight-z,bt=document.createElement("div");bt.style.display="inline-block",bt.style.boxSizing="content-box",bt.style.width=P-2+"px",bt.style.height=P-2+"px",bt.style.padding="1px",bt.style.marginRight="2px",bt.style.marginBottom="2px",bt.style.borderWidth="2px",bt.style.borderStyle="solid",bt.style.borderRadius=(P+2)/2+"px",bt.style.borderColor=_===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",bt.addEventListener("click",function(){K.setCurrentColor(_,bt)});var Gt=document.createElement("div");return Gt.style.display="inline-block",Gt.style.width=P-2+"px",Gt.style.height=P-2+"px",Gt.style.backgroundColor=_,Gt.style.borderRadius=P/2+"px",_==="transparent"&&(Gt.style.fill=this.uiStyleSettings.toolboxAccentColor,Gt.innerHTML=`<svg viewBox="0 0 24 24">
|
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
|
</svg>`),bt.appendChild(Gt),bt},D.prototype.setCurrentColor=function(_,K){var z=this;this.currentColor=_,this.colorBoxes.forEach(function(P){P.style.borderColor=P===K?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(_)},D}(Zt),Q=function(){function q(D,_,K){this._state="new",this._isSelected=!1,this._container=D,this._overlayContainer=_,this.globalSettings=K,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),q.prototype.ownsTarget=function(D){return!1},Object.defineProperty(q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},q.prototype.pointerDown=function(D,_){},q.prototype.dblClick=function(D,_){},q.prototype.manipulate=function(D){},q.prototype.pointerUp=function(D){this.stateChanged()},q.prototype.dispose=function(){},q.prototype.addMarkerVisualToContainer=function(D){this.container.childNodes.length>0?this.container.insertBefore(D,this.container.childNodes[0]):this.container.appendChild(D)},q.prototype.getState=function(){return{typeName:q.typeName,state:this.state,notes:this.notes}},q.prototype.restoreState=function(D){this._state=D.state,this.notes=D.notes},q.prototype.scale=function(D,_){},q.prototype.colorChanged=function(D){this.onColorChanged&&this.onColorChanged(D),this.stateChanged()},q.prototype.fillColorChanged=function(D){this.onFillColorChanged&&this.onFillColorChanged(D),this.stateChanged()},q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var D=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),D.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(D)&&this.onStateChanged(this)}},q.typeName="MarkerBase",q}(),se=function(){function q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return q.prototype.findGripByVisual=function(D){return this.topLeft.ownsTarget(D)?this.topLeft:this.topCenter.ownsTarget(D)?this.topCenter:this.topRight.ownsTarget(D)?this.topRight:this.centerLeft.ownsTarget(D)?this.centerLeft:this.centerRight.ownsTarget(D)?this.centerRight:this.bottomLeft.ownsTarget(D)?this.bottomLeft:this.bottomCenter.ownsTarget(D)?this.bottomCenter:this.bottomRight.ownsTarget(D)?this.bottomRight:void 0},q}(),$e=function(){function q(){this.GRIP_SIZE=10,this.visual=ft.createGroup(),this.visual.appendChild(ft.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ft.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(D){return D===this.visual||D===this.visual.childNodes[0]||D===this.visual.childNodes[1]},q}(),Vt=function(){function q(){}return q.toITransformMatrix=function(D){return{a:D.a,b:D.b,c:D.c,d:D.d,e:D.e,f:D.f}},q.toSVGMatrix=function(D,_){return D.a=_.a,D.b=_.b,D.c=_.c,D.d=_.d,D.e=_.e,D.f=_.f,D},q}(),Wt=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.left=0,P.top=0,P.width=0,P.height=0,P.defaultSize={x:50,y:20},P.offsetX=0,P.offsetY=0,P.rotationAngle=0,P.CB_DISTANCE=10,P._suppressMarkerCreateEvent=!1,P.container.transform.baseVal.appendItem(ft.createTransform()),P.setupControlBox(),P}return At(D,q),Object.defineProperty(D.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(D.prototype,"visual",{get:function(){return this._visual},set:function(_){this._visual=_;var K=ft.createTransform();this._visual.transform.baseVal.appendItem(K)},enumerable:!1,configurable:!0}),D.prototype.ownsTarget=function(_){return!!q.prototype.ownsTarget.call(this,_)||!!(this.controlGrips.findGripByVisual(_)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(_))},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.state==="new"&&(this.left=_.x,this.top=_.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var z=this.unrotatePoint(_);if(this.manipulationStartX=z.x,this.manipulationStartY=z.y,this.offsetX=z.x-this.left,this.offsetY=z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(K),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K)){this.activeGrip=this.rotatorGrip;var P=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=P.x-this.width/2,this.top=P.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var bt=this.container.transform.baseVal.getItem(0);bt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(bt,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},D.prototype.pointerUp=function(_){var K=this.state;q.prototype.pointerUp.call(this,_),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(_),this._state="select",K==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},D.prototype.moveVisual=function(_){this.visual.style.transform="translate("+_.x+"px, "+_.y+"px)"},D.prototype.manipulate=function(_){var K=this.unrotatePoint(_);this.state==="creating"?this.resize(_):this.state==="move"?(this.left=this.manipulationStartLeft+(K.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(K.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(K):this.state==="rotate"&&this.rotate(_)},D.prototype.resize=function(_){var K=this.manipulationStartLeft,z=this.manipulationStartWidth,P=this.manipulationStartTop,bt=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:K=this.manipulationStartLeft+_.x-this.manipulationStartX,z=this.manipulationStartWidth+this.manipulationStartLeft-K;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:z=this.manipulationStartWidth+_.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:P=this.manipulationStartTop+_.y-this.manipulationStartY,bt=this.manipulationStartHeight+this.manipulationStartTop-P;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:bt=this.manipulationStartHeight+_.y-this.manipulationStartY}z>=0?(this.left=K,this.width=z):(this.left=K+z,this.width=-z),bt>=0?(this.top=P,this.height=bt):(this.top=P+bt,this.height=-bt),this.setSize()},D.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},D.prototype.rotate=function(_){if(Math.abs(_.x-this.centerX)>.1){var K=Math.sign(_.x-this.centerX);this.rotationAngle=180*Math.atan((_.y-this.centerY)/(_.x-this.centerX))/Math.PI+90*K,this.applyRotation()}},D.prototype.applyRotation=function(){var _=this.container.transform.baseVal.getItem(0);_.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(_,0)},D.prototype.rotatePoint=function(_){if(this.rotationAngle===0)return _;var K=this.container.getCTM(),z=ft.createPoint(_.x,_.y);return{x:(z=z.matrixTransform(K)).x,y:z.y}},D.prototype.unrotatePoint=function(_){if(this.rotationAngle===0)return _;var K=this.container.getCTM();K=K.inverse();var z=ft.createPoint(_.x,_.y);return{x:(z=z.matrixTransform(K)).x,y:z.y}},D.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},D.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},D.prototype.setupControlBox=function(){this.controlBox=ft.createGroup();var _=ft.createTransform();_.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(_),this.container.appendChild(this.controlBox),this.controlRect=ft.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ft.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new se,this.addControlGrips(),this.controlBox.style.display="none"},D.prototype.adjustControlBox=function(){var _=this.controlBox.transform.baseVal.getItem(0);_.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(_,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},D.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},D.prototype.createGrip=function(){var _=new $e;return _.visual.transform.baseVal.appendItem(ft.createTransform()),this.controlBox.appendChild(_.visual),_},D.prototype.positionGrips=function(){var _=this.controlGrips.topLeft.GRIP_SIZE,K=-_/2,z=K,P=(this.width+this.CB_DISTANCE)/2-_/2,bt=(this.height+this.CB_DISTANCE)/2-_/2,Gt=this.height+this.CB_DISTANCE-_/2,Pe=this.width+this.CB_DISTANCE-_/2;this.positionGrip(this.controlGrips.topLeft.visual,K,z),this.positionGrip(this.controlGrips.topCenter.visual,P,z),this.positionGrip(this.controlGrips.topRight.visual,Pe,z),this.positionGrip(this.controlGrips.centerLeft.visual,K,bt),this.positionGrip(this.controlGrips.centerRight.visual,Pe,bt),this.positionGrip(this.controlGrips.bottomLeft.visual,K,Gt),this.positionGrip(this.controlGrips.bottomCenter.visual,P,Gt),this.positionGrip(this.controlGrips.bottomRight.visual,Pe,Gt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,P,z-3*this.CB_DISTANCE)},D.prototype.positionGrip=function(_,K,z){var P=_.transform.baseVal.getItem(0);P.setTranslate(K,z),_.transform.baseVal.replaceItem(P,0)},D.prototype.hideControlBox=function(){this.controlBox.style.display="none"},D.prototype.showControlBox=function(){this.controlBox.style.display=""},D.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Vt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Vt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},q.prototype.getState.call(this))},D.prototype.restoreState=function(_){q.prototype.restoreState.call(this,_);var K=_;this.left=K.left,this.top=K.top,this.width=K.width,this.height=K.height,this.rotationAngle=K.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Vt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,K.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Vt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,K.containerTransformMatrix))},D.prototype.scale=function(_,K){q.prototype.scale.call(this,_,K);var z=this.rotatePoint({x:this.left,y:this.top}),P=this.unrotatePoint({x:z.x*_,y:z.y*K});this.left=P.x,this.top=P.y,this.width=this.width*_,this.height=this.height*K,this.adjustControlBox()},D}(Q),kt=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.createVisual=P.createVisual.bind(P),P}return At(D,q),D.prototype.ownsTarget=function(_){return!(!q.prototype.ownsTarget.call(this,_)&&_!==this.visual)},D.prototype.createVisual=function(){this.visual=ft.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},D.prototype.manipulate=function(_){q.prototype.manipulate.call(this,_)},D.prototype.resize=function(_){q.prototype.resize.call(this,_),this.setSize()},D.prototype.setSize=function(){q.prototype.setSize.call(this),ft.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},D.prototype.pointerUp=function(_){q.prototype.pointerUp.call(this,_),this.setSize()},D.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&&ft.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},D.prototype.setFillColor=function(_){this.fillColor=_,this.visual&&ft.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},D.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&&ft.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},D.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&&ft.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},D.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this))},D.prototype.restoreState=function(_){var K=_;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),q.prototype.restoreState.call(this,_),this.setSize()},D.prototype.scale=function(_,K){q.prototype.scale.call(this,_,K),this.setSize()},D.title="Rectangle marker",D}(Wt),it=function(q){function D(_,K,z,P){var bt=q.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return bt.widths=[],bt.widthBoxes=[],bt.widths=K,bt.currentWidth=z,bt.setCurrentWidth=bt.setCurrentWidth.bind(bt),bt}return At(D,q),D.prototype.getUi=function(){var _=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.widths.forEach(function(z){var P=document.createElement("div");P.style.display="flex",P.style.flexGrow="2",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=z===_.currentWidth?_.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){_.setCurrentWidth(z,P)}),K.appendChild(P);var bt=document.createElement("div");bt.innerText=z.toString(),bt.style.marginRight="5px",P.appendChild(bt);var Gt=document.createElement("div");Gt.style.minHeight="20px",Gt.style.flexGrow="2",Gt.style.display="flex",Gt.style.alignItems="center";var Pe=document.createElement("hr");Pe.style.minWidth="20px",Pe.style.border="0px",Pe.style.borderTop=z+"px solid "+_.uiStyleSettings.toolboxColor,Pe.style.flexGrow="2",Gt.appendChild(Pe),P.appendChild(Gt),_.widthBoxes.push(P)}),K},D.prototype.setCurrentWidth=function(_,K){var z=this;this.currentWidth=_,this.widthBoxes.forEach(function(P){P.style.borderColor=P===K?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},D}(Zt),Ot=function(q){function D(_,K,z,P){var bt=q.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return bt.styles=[],bt.styleBoxes=[],bt.styles=K,bt.currentStyle=z,bt.setCurrentStyle=bt.setCurrentStyle.bind(bt),bt}return At(D,q),D.prototype.getUi=function(){var _=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",this.styles.forEach(function(z){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/_.styles.length-5+"%",P.style.borderColor=z===_.currentStyle?_.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){_.setCurrentStyle(z,P)}),K.appendChild(P);var bt=document.createElement("div");bt.style.minHeight="20px",bt.style.flexGrow="2",bt.style.overflow="hidden";var Gt=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+_.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(z!==""?'stroke-dasharray="'+z+'"':"")+` />
|
|
|
</svg>`;bt.innerHTML=Gt,P.appendChild(bt),_.styleBoxes.push(P)}),K},D.prototype.setCurrentStyle=function(_,K){var z=this;this.currentStyle=_,this.styleBoxes.forEach(function(P){P.style.borderColor=P===K?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},D}(Zt),qt=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.strokePanel=new zt("Line color",z.defaultColorSet,z.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new it("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Ot("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return At(D,q),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=q.prototype.getState.call(this);return _.typeName=D.typeName,_},D.typeName="FrameMarker",D.title="Frame marker",D.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',D}(kt),Te=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},_e=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.x1=0,P.y1=0,P.x2=0,P.y2=0,P.defaultLength=50,P.manipulationStartX=0,P.manipulationStartY=0,P.manipulationStartX1=0,P.manipulationStartY1=0,P.manipulationStartX2=0,P.manipulationStartY2=0,P.setupControlBox(),P}return At(D,q),D.prototype.ownsTarget=function(_){return!!q.prototype.ownsTarget.call(this,_)||!(!this.grip1.ownsTarget(_)&&!this.grip2.ownsTarget(_))},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.manipulationStartX=_.x,this.manipulationStartY=_.y,this.state==="new"&&(this.x1=_.x,this.y1=_.y,this.x2=_.x,this.y2=_.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(K)?this.activeGrip=this.grip1:this.grip2.ownsTarget(K)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},D.prototype.pointerUp=function(_){var K=this.state;q.prototype.pointerUp.call(this,_),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(_),this._state="select",K==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},D.prototype.adjustVisual=function(){},D.prototype.manipulate=function(_){this.state==="creating"?this.resize(_):this.state==="move"?(this.x1=this.manipulationStartX1+_.x-this.manipulationStartX,this.y1=this.manipulationStartY1+_.y-this.manipulationStartY,this.x2=this.manipulationStartX2+_.x-this.manipulationStartX,this.y2=this.manipulationStartY2+_.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(_)},D.prototype.resize=function(_){switch(this.activeGrip){case this.grip1:this.x1=_.x,this.y1=_.y;break;case this.grip2:case void 0:this.x2=_.x,this.y2=_.y}this.adjustVisual(),this.adjustControlBox()},D.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},D.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},D.prototype.setupControlBox=function(){this.controlBox=ft.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},D.prototype.adjustControlBox=function(){this.positionGrips()},D.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},D.prototype.createGrip=function(){var _=new $e;return _.visual.transform.baseVal.appendItem(ft.createTransform()),this.controlBox.appendChild(_.visual),_},D.prototype.positionGrips=function(){var _=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-_/2,this.y1-_/2),this.positionGrip(this.grip2.visual,this.x2-_/2,this.y2-_/2)},D.prototype.positionGrip=function(_,K,z){var P=_.transform.baseVal.getItem(0);P.setTranslate(K,z),_.transform.baseVal.replaceItem(P,0)},D.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},q.prototype.getState.call(this))},D.prototype.restoreState=function(_){q.prototype.restoreState.call(this,_);var K=_;this.x1=K.x1,this.y1=K.y1,this.x2=K.x2,this.y2=K.y2},D.prototype.scale=function(_,K){q.prototype.scale.call(this,_,K),this.x1=this.x1*_,this.y1=this.y1*K,this.x2=this.x2*_,this.y2=this.y2*K,this.adjustVisual(),this.adjustControlBox()},D}(Q),fi=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.strokePanel=new zt("Line color",z.defaultColorSet,z.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new it("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Ot("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return At(D,q),D.prototype.ownsTarget=function(_){return!(!q.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorLine&&_!==this.visibleLine)},D.prototype.createVisual=function(){this.visual=ft.createGroup(),this.selectorLine=ft.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ft.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},D.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ft.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ft.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ft.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},D.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},D.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},D.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},q.prototype.getState.call(this));return _.typeName=D.typeName,_},D.prototype.restoreState=function(_){q.prototype.restoreState.call(this,_);var K=_;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.createVisual(),this.adjustVisual()},D.typeName="LineMarker",D.title="Line marker",D.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',D}(_e),Ht=function(q){function D(_,K,z,P){var bt=q.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return bt.fonts=[],bt.fontBoxes=[],bt.fonts=K,bt.currentFont=z,bt.setCurrentFont=bt.setCurrentFont.bind(bt),bt}return At(D,q),D.prototype.getUi=function(){var _=this,K=document.createElement("div");return K.style.overflow="hidden",K.style.flexGrow="2",this.fonts.forEach(function(z){var P=document.createElement("div");P.style.display="inline-block",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/_.fonts.length-5+"%",P.style.borderColor=z===_.currentFont?_.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){_.setCurrentFont(z,P)}),K.appendChild(P);var bt=document.createElement("div");bt.style.display="flex",bt.style.minHeight="20px",bt.style.flexGrow="2",bt.style.fontFamily=z,bt.style.overflow="hidden";var Gt=document.createElement("div");Gt.style.whiteSpace="nowrap",Gt.style.overflow="hidden",Gt.style.textOverflow="ellipsis",Gt.innerHTML="The quick brown fox jumps over the lazy dog",bt.appendChild(Gt),P.appendChild(bt),_.fontBoxes.push(P)}),K},D.prototype.setCurrentFont=function(_,K){var z=this;this.currentFont=_,this.fontBoxes.forEach(function(P){P.style.borderColor=P===K?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},D}(Zt),pe=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.color="transparent",P.padding=5,P.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",P.text=P.DEFAULT_TEXT,P.isMoved=!1,P.color=z.defaultColor,P.fontFamily=z.defaultFontFamily,P.defaultSize={x:100,y:30},P.setColor=P.setColor.bind(P),P.setFont=P.setFont.bind(P),P.renderText=P.renderText.bind(P),P.sizeText=P.sizeText.bind(P),P.textEditDivClicked=P.textEditDivClicked.bind(P),P.showTextEditor=P.showTextEditor.bind(P),P.setSize=P.setSize.bind(P),P.positionTextEditor=P.positionTextEditor.bind(P),P.colorPanel=new zt("Color",z.defaultColorSet,z.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.fontFamilyPanel=new Ht("Font",z.defaultFontFamilies,z.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P}return At(D,q),D.prototype.ownsTarget=function(_){if(q.prototype.ownsTarget.call(this,_)||_===this.visual||_===this.textElement||_===this.bgRectangle)return!0;var K=!1;return this.textElement.childNodes.forEach(function(z){z===_&&(K=!0)}),K},D.prototype.createVisual=function(){this.visual=ft.createGroup(),this.bgRectangle=ft.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ft.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ft.createTransform()),this.textElement.transform.baseVal.appendItem(ft.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.isMoved=!1,this.pointerDownPoint=_,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},D.prototype.renderText=function(){var _=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(K){_.textElement.appendChild(ft.createTSpan(K.trim()===""?" ":K.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},D.prototype.getTextScale=function(){var _=this.textElement.getBBox(),K=1;if(_.width>0&&_.height>0){var z=(1*this.width-this.width*this.padding*2/100)/_.width,P=(1*this.height-this.height*this.padding*2/100)/_.height;K=Math.min(z,P)}return K},D.prototype.getTextPosition=function(_){var K=this.textElement.getBBox(),z=0,P=0;return K.width>0&&K.height>0&&(z=(this.width-K.width*_)/2,P=this.height/2-K.height*_/2),{x:z,y:P}},D.prototype.sizeText=function(){var _=this.textElement.getBBox(),K=this.getTextScale(),z=this.getTextPosition(K);z.y-=_.y*K,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+z.x+"px, "+z.y+"px) scale("+K+", "+K+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(z.x,z.y),this.textElement.transform.baseVal.getItem(1).setScale(K,K))},D.prototype.manipulate=function(_){q.prototype.manipulate.call(this,_),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(_.x-this.pointerDownPoint.x)>5||Math.abs(_.y-this.pointerDownPoint.y)>5)},D.prototype.resize=function(_){q.prototype.resize.call(this,_),this.isMoved=!0,this.setSize(),this.sizeText()},D.prototype.setSize=function(){q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ft.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ft.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},D.prototype.pointerUp=function(_){var K=this.state;K==="creating"&&(this._suppressMarkerCreateEvent=!0),q.prototype.pointerUp.call(this,_),this.setSize(),(K==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},D.prototype.showTextEditor=function(){var _=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(K){K.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var K=Number.parseFloat(_.textEditor.style.fontSize);_.textEditor.clientWidth>=Number.parseInt(_.textEditor.style.maxWidth)&&K>.9;)K-=.1,_.textEditor.style.fontSize=Math.max(K,.9)+"em"}),this.textEditor.addEventListener("keyup",function(K){K.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(K){if(K.clipboardData){var z=K.clipboardData.getData("text"),P=window.getSelection();if(!P.rangeCount)return!1;P.deleteFromDocument(),P.getRangeAt(0).insertNode(document.createTextNode(z)),K.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){_.textEditDivClicked(_.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},D.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var _=this.getTextScale(),K=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),z=this.textElement.getBBox(),P={x:z.width*_,y:z.height*_};K.x-=P.x/2,K.y-=P.y/2,this.textEditor.style.top=K.y+"px",this.textEditor.style.left=K.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-K.x+"px",this.textEditor.style.fontSize=Math.max(16*_,12)+"px",this.textElement.style.display="none"}},D.prototype.textEditDivClicked=function(_){this.text=_.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},D.prototype.select=function(){q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},D.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),q.prototype.deselect.call(this)},D.prototype.dblClick=function(_,K){q.prototype.dblClick.call(this,_,K),this.showTextEditor()},D.prototype.setColor=function(_){this.textElement&&ft.setAttributes(this.textElement,[["fill",_]]),this.color=_,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(_)},D.prototype.setFont=function(_){this.textElement&&ft.setAttributes(this.textElement,[["font-family",_]]),this.fontFamily=_,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},D.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},D.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},q.prototype.getState.call(this));return _.typeName=D.typeName,_},D.prototype.restoreState=function(_){var K=_;this.color=K.color,this.fontFamily=K.fontFamily,this.padding=K.padding,this.text=K.text,this.createVisual(),q.prototype.restoreState.call(this,_),this.setSize()},D.prototype.scale=function(_,K){q.prototype.scale.call(this,_,K),this.setSize(),this.sizeText(),this.positionTextEditor()},D.typeName="TextMarker",D.title="Text marker",D.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',D}(Wt),Ke=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.color="transparent",P.lineWidth=3,P.drawing=!1,P.pixelRatio=1,P.color=z.defaultColor,P.lineWidth=z.defaultStrokeWidth,P.pixelRatio=z.freehandPixelRatio,P.setColor=P.setColor.bind(P),P.addCanvas=P.addCanvas.bind(P),P.finishCreation=P.finishCreation.bind(P),P.setLineWidth=P.setLineWidth.bind(P),P.colorPanel=new zt("Color",z.defaultColorSet,z.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.lineWidthPanel=new it("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.lineWidthPanel.onWidthChanged=P.setLineWidth,P}return At(D,q),D.prototype.ownsTarget=function(_){return!(!q.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.drawingImage)},D.prototype.createVisual=function(){this.visual=ft.createGroup(),this.drawingImage=ft.createImage(),this.visual.appendChild(this.drawingImage);var _=ft.createTransform();this.visual.transform.baseVal.appendItem(_),this.addMarkerVisualToContainer(this.visual)},D.prototype.pointerDown=function(_,K){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(_.x,_.y),this.drawing=!0):q.prototype.pointerDown.call(this,_,K)},D.prototype.manipulate=function(_){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(_.x,_.y),this.canvasContext.stroke()):q.prototype.manipulate.call(this,_)},D.prototype.resize=function(_){q.prototype.resize.call(this,_),ft.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ft.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},D.prototype.pointerUp=function(_){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):q.prototype.pointerUp.call(this,_)},D.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},D.prototype.select=function(){this.state==="creating"&&this.finishCreation(),q.prototype.select.call(this)},D.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),q.prototype.deselect.call(this)},D.prototype.finishCreation=function(){for(var _=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),K=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],z=K[0],P=K[1],bt=K[2],Gt=K[3],Pe=!1,He=0;He<this.canvasElement.height;He++)for(var ei=0;ei<this.canvasElement.width;ei++)_.data[He*this.canvasElement.width*4+4*ei+3]>0&&(Pe=!0,He<P&&(P=He),ei<z&&(z=ei),He>Gt&&(Gt=He),ei>bt&&(bt=ei));if(Pe){this.left=z/this.pixelRatio,this.top=P/this.pixelRatio,this.width=(bt-z)/this.pixelRatio,this.height=(Gt-P)/this.pixelRatio;var si=document.createElement("canvas");si.width=bt-z,si.height=Gt-P,si.getContext("2d").putImageData(this.canvasContext.getImageData(z,P,bt-z,Gt-P),0,0),this.drawingImgUrl=si.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},D.prototype.setDrawingImage=function(){ft.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ft.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},D.prototype.setColor=function(_){this.color=_,this.colorChanged(_)},D.prototype.setLineWidth=function(_){this.lineWidth=_},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=Object.assign({drawingImgUrl:this.drawingImgUrl},q.prototype.getState.call(this));return _.typeName=D.typeName,_},D.prototype.restoreState=function(_){this.createVisual(),q.prototype.restoreState.call(this,_),this.drawingImgUrl=_.drawingImgUrl,this.setDrawingImage()},D.prototype.scale=function(_,K){q.prototype.scale.call(this,_,K),this.setDrawingImage()},D.typeName="FreehandMarker",D.title="Freehand marker",D.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',D}(Wt),ki=function(q){function D(_,K,z){var P=q.call(this,_,z||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return P.typeBoxes=[],P.currentType=K,P.setCurrentType=P.setCurrentType.bind(P),P}return At(D,q),D.prototype.getUi=function(){var _=this,K=document.createElement("div");K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2";for(var z=function(Gt){var Pe="both";switch(Gt){case 0:Pe="both";break;case 1:Pe="start";break;case 2:Pe="end";break;case 3:Pe="none"}var He=document.createElement("div");if(He.style.display="flex",He.style.flexGrow="2",He.style.alignItems="center",He.style.justifyContent="space-between",He.style.padding="5px",He.style.borderWidth="2px",He.style.borderStyle="solid",He.style.borderColor=Pe===P.currentType?P.uiStyleSettings.toolboxAccentColor:"transparent",He.addEventListener("click",function(){_.setCurrentType(Pe,He)}),K.appendChild(He),Pe==="both"||Pe==="start"){var ei=document.createElement("div");ei.style.display="flex",ei.style.alignItems="center",ei.style.minHeight="20px",ei.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,5 10,0 10,10" fill="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,ei.style.marginLeft="5px",He.appendChild(ei)}var si=document.createElement("div");si.style.display="flex",si.style.alignItems="center",si.style.minHeight="20px",si.style.flexGrow="2";var Gi=document.createElement("hr");if(Gi.style.minWidth="20px",Gi.style.border="0px",Gi.style.borderTop="3px solid "+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee"),Gi.style.flexGrow="2",si.appendChild(Gi),He.appendChild(si),Pe==="both"||Pe==="end"){var er=document.createElement("div");er.style.display="flex",er.style.alignItems="center",er.style.minHeight="20px",er.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
|
<polygon points="0,0 10,5 0,10" fill="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
|
</svg>`,er.style.marginRight="5px",He.appendChild(er)}P.typeBoxes.push(He)},P=this,bt=0;bt<4;bt++)z(bt);return K},D.prototype.setCurrentType=function(_,K){var z=this;this.currentType=_,this.typeBoxes.forEach(function(P){P.style.borderColor=P===K?z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},D}(Zt),pi=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.arrowType="end",P.arrowBaseHeight=10,P.arrowBaseWidth=10,P.getArrowPoints=P.getArrowPoints.bind(P),P.setArrowType=P.setArrowType.bind(P),P.arrowTypePanel=new ki("Arrow type","end"),P.arrowTypePanel.onArrowTypeChanged=P.setArrowType,P}return At(D,q),D.prototype.ownsTarget=function(_){return!(!q.prototype.ownsTarget.call(this,_)&&_!==this.arrow1&&_!==this.arrow2)},D.prototype.getArrowPoints=function(_,K){var z=this.arrowBaseWidth+2*this.strokeWidth,P=this.arrowBaseHeight+2*this.strokeWidth;return _-z/2+","+(K+P/2)+" "+_+","+(K-P/2)+" "+(_+z/2)+","+(K+P/2)},D.prototype.createTips=function(){this.arrow1=ft.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ft.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ft.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ft.createTransform()),this.visual.appendChild(this.arrow2)},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.state==="creating"&&this.createTips()},D.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ft.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ft.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var _=0;Math.abs(this.x1-this.x2)>.1&&(_=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var K=this.arrow1.transform.baseVal.getItem(0);K.setRotate(_,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(K,0);var z=this.arrow2.transform.baseVal.getItem(0);z.setRotate(_+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(z,0)}},D.prototype.setArrowType=function(_){this.arrowType=_,this.adjustVisual(),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=Object.assign({arrowType:this.arrowType},q.prototype.getState.call(this));return _.typeName=D.typeName,_},D.prototype.restoreState=function(_){q.prototype.restoreState.call(this,_);var K=_;this.arrowType=K.arrowType,this.createTips(),this.adjustVisual()},D.typeName="ArrowMarker",D.title="Arrow marker",D.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',D}(fi),Sn=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.fillColor=z.defaultFillColor,P.strokeWidth=0,P.fillPanel=new zt("Color",z.defaultColorSet,z.defaultFillColor),P.fillPanel.onColorChanged=P.setFillColor,P}return At(D,q),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=q.prototype.getState.call(this);return _.typeName=D.typeName,_},D.typeName="CoverMarker",D.title="Cover marker",D.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',D}(kt),Sr=function(q){function D(_,K,z,P){var bt=q.call(this,_,P||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return bt.opacities=[],bt.opacityBoxes=[],bt.opacities=K,bt.currentOpacity=z,bt.setCurrentOpacity=bt.setCurrentOpacity.bind(bt),bt}return At(D,q),D.prototype.getUi=function(){var _=this,K=document.createElement("div");return K.style.display="flex",K.style.overflow="hidden",K.style.flexGrow="2",K.style.justifyContent="space-between",this.opacities.forEach(function(z){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="center",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=z===_.currentOpacity?_.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){_.setCurrentOpacity(z,P)}),K.appendChild(P);var bt=document.createElement("div");bt.innerText=100*z+"%",P.appendChild(bt),_.opacityBoxes.push(P)}),K},D.prototype.setCurrentOpacity=function(_,K){var z=this;this.currentOpacity=_,this.opacityBoxes.forEach(function(P){P.style.borderColor=P===K?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},D}(Zt),Ki=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.setOpacity=P.setOpacity.bind(P),P.fillColor=z.defaultHighlightColor,P.strokeWidth=0,P.opacity=z.defaultHighlightOpacity,P.fillPanel=new zt("Color",z.defaultColorSet,P.fillColor),P.fillPanel.onColorChanged=P.setFillColor,P.opacityPanel=new Sr("Opacity",z.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return At(D,q),D.prototype.setOpacity=function(_){this.opacity=_,this.visual&&ft.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=q.prototype.getState.call(this);return _.typeName=D.typeName,_},D.typeName="HighlightMarker",D.title="Highlight marker",D.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',D}(Sn),It='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',tt='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',de=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.bgColor="transparent",P.tipPosition={x:0,y:0},P.tipBase1Position={x:0,y:0},P.tipBase2Position={x:0,y:0},P.tipMoving=!1,P.color=z.defaultStrokeColor,P.bgColor=z.defaultFillColor,P.fontFamily=z.defaultFontFamily,P.defaultSize={x:100,y:30},P.setBgColor=P.setBgColor.bind(P),P.getTipPoints=P.getTipPoints.bind(P),P.positionTip=P.positionTip.bind(P),P.setTipPoints=P.setTipPoints.bind(P),P.colorPanel=new zt("Text color",z.defaultColorSet,P.color,It),P.colorPanel.onColorChanged=P.setColor,P.bgColorPanel=new zt("Fill color",z.defaultColorSet,P.bgColor,tt),P.bgColorPanel.onColorChanged=P.setBgColor,P.fontFamilyPanel=new Ht("Font",z.defaultFontFamilies,z.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P.tipGrip=new $e,P.tipGrip.visual.transform.baseVal.appendItem(ft.createTransform()),P.controlBox.appendChild(P.tipGrip.visual),P}return At(D,q),D.prototype.ownsTarget=function(_){return q.prototype.ownsTarget.call(this,_)||this.tipGrip.ownsTarget(_)||this.tip===_},D.prototype.createTip=function(){ft.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ft.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},D.prototype.pointerDown=function(_,K){this.state==="new"&&q.prototype.pointerDown.call(this,_,K),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(K)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):q.prototype.pointerDown.call(this,_,K)},D.prototype.pointerUp=function(_){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,q.prototype.pointerUp.call(this,_);else{var K=this.state==="creating";q.prototype.pointerUp.call(this,_),this.setTipPoints(K),this.positionTip()}},D.prototype.manipulate=function(_){if(this.tipMoving){var K=this.unrotatePoint(_);this.tipPosition={x:K.x-this.manipulationStartLeft,y:K.y-this.manipulationStartTop},this.positionTip()}else q.prototype.manipulate.call(this,_)},D.prototype.setBgColor=function(_){this.bgRectangle&&this.tip&&(ft.setAttributes(this.bgRectangle,[["fill",_]]),ft.setAttributes(this.tip,[["fill",_]])),this.bgColor=_,this.fillColorChanged(_)},D.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},D.prototype.setTipPoints=function(_){_===void 0&&(_=!1);var K=Math.min(this.height/2,15),z=this.height/5;_&&(this.tipPosition={x:K+z/2,y:this.height+20});var P=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(z=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:0},this.tipBase2Position={x:K+z,y:0}):(this.tipBase1Position={x:0,y:K},this.tipBase2Position={x:0,y:K+z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(z=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-z,y:0},this.tipBase2Position={x:this.width-K,y:0}):(this.tipBase1Position={x:this.width,y:K},this.tipBase2Position={x:this.width,y:K+z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?P<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(z=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-K-z,y:this.height},this.tipBase2Position={x:this.width-K,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-K-z},this.tipBase2Position={x:this.width,y:this.height-K}):P<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(z=this.width/5,K=Math.min(this.width/2,15),this.tipBase1Position={x:K,y:this.height},this.tipBase2Position={x:K+z,y:this.height}):(this.tipBase1Position={x:0,y:this.height-K},this.tipBase2Position={x:0,y:this.height-K-z})},D.prototype.resize=function(_){q.prototype.resize.call(this,_),this.positionTip()},D.prototype.positionTip=function(){ft.setAttributes(this.tip,[["points",this.getTipPoints()]]);var _=this.tipGrip.visual.transform.baseVal.getItem(0);_.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(_,0)},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),D.prototype.select=function(){this.positionTip(),q.prototype.select.call(this)},D.prototype.getState=function(){var _=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},q.prototype.getState.call(this));return _.typeName=D.typeName,_},D.prototype.restoreState=function(_){var K=_;this.bgColor=K.bgColor,this.tipPosition=K.tipPosition,q.prototype.restoreState.call(this,_),this.createTip(),this.setTipPoints()},D.prototype.scale=function(_,K){q.prototype.scale.call(this,_,K),this.tipPosition={x:this.tipPosition.x*_,y:this.tipPosition.y*K},this.positionTip()},D.typeName="CalloutMarker",D.title="Callout marker",D.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',D}(pe),hi=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.fillColor=z.defaultFillColor,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.setOpacity=P.setOpacity.bind(P),P.createVisual=P.createVisual.bind(P),P.strokePanel=new zt("Line color",gt(z.defaultColorSet,["transparent"]),z.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.fillPanel=new zt("Fill color",gt(z.defaultColorSet,["transparent"]),P.fillColor,tt),P.fillPanel.onColorChanged=P.setFillColor,P.strokeWidthPanel=new it("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Ot("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P.opacityPanel=new Sr("Opacity",z.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return At(D,q),D.prototype.ownsTarget=function(_){return!(!q.prototype.ownsTarget.call(this,_)&&_!==this.visual)},D.prototype.createVisual=function(){this.visual=ft.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},D.prototype.manipulate=function(_){q.prototype.manipulate.call(this,_)},D.prototype.resize=function(_){q.prototype.resize.call(this,_),this.setSize()},D.prototype.setSize=function(){q.prototype.setSize.call(this),ft.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},D.prototype.pointerUp=function(_){q.prototype.pointerUp.call(this,_),this.setSize()},D.prototype.setStrokeColor=function(_){this.strokeColor=_,this.visual&&ft.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},D.prototype.setFillColor=function(_){this.fillColor=_,this.visual&&ft.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(_),this.stateChanged()},D.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.visual&&ft.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},D.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.visual&&ft.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},D.prototype.setOpacity=function(_){this.opacity=_,this.visual&&ft.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this));return _.typeName=D.typeName,_},D.prototype.restoreState=function(_){var K=_;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.opacity=K.opacity,this.createVisual(),q.prototype.restoreState.call(this,_),this.setSize()},D.prototype.scale=function(_,K){q.prototype.scale.call(this,_,K),this.setSize()},D.typeName="EllipseMarker",D.title="Ellipse marker",D.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',D}(Wt),Ze=function(q){function D(_,K,z){return q.call(this,_,K,z)||this}return At(D,q),Object.defineProperty(D.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),D.prototype.ownsTarget=function(_){return!(!q.prototype.ownsTarget.call(this,_)&&_!==this.tip1&&_!==this.tip2)},D.prototype.createTips=function(){this.tip1=ft.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ft.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ft.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ft.createTransform()),this.visual.appendChild(this.tip2)},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.state==="creating"&&this.createTips()},D.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ft.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ft.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var _=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),K=this.tip1.transform.baseVal.getItem(0);K.setRotate(_,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(K,0);var z=this.tip2.transform.baseVal.getItem(0);z.setRotate(_+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(z,0)}},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=q.prototype.getState.call(this);return _.typeName=D.typeName,_},D.prototype.restoreState=function(_){q.prototype.restoreState.call(this,_),this.createTips(),this.adjustVisual()},D.typeName="MeasurementMarker",D.title="Measurement marker",D.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',D}(fi),Ye=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.strokePanel.colors=z.defaultColorSet,P.fillColor="transparent",P}return At(D,q),Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=q.prototype.getState.call(this);return _.typeName=D.typeName,_},D.typeName="EllipseFrameMarker",D.title="Ellipse frame marker",D.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',D}(hi),Ae=function(){function q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),q.prototype.addUndoStep=function(D){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(D)||(this.undoStack.push(D),JSON.stringify(this.lastRedoStep)!==JSON.stringify(D)&&this.redoStack.splice(0,this.redoStack.length))},q.prototype.replaceLastUndoStep=function(D){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=D)},q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},q.prototype.undo=function(){if(this.undoStack.length>1){var D=this.undoStack.pop();return D!==void 0&&this.redoStack.push(D),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},q}(),Wi=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.curveX=0,P.curveY=0,P.manipulationStartCurveX=0,P.manipulationStartCurveY=0,P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.positionGrips=P.positionGrips.bind(P),P.addControlGrips=P.addControlGrips.bind(P),P.adjustVisual=P.adjustVisual.bind(P),P.setupControlBox=P.setupControlBox.bind(P),P.resize=P.resize.bind(P),P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.strokePanel=new zt("Line color",z.defaultColorSet,z.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new it("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Ot("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return At(D,q),D.prototype.ownsTarget=function(_){return!(!q.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.selectorCurve&&_!==this.visibleCurve&&!this.curveGrip.ownsTarget(_))},D.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},D.prototype.createVisual=function(){this.visual=ft.createGroup(),this.selectorCurve=ft.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ft.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=_.x,this.curveY=_.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(K)&&(this.activeGrip=this.curveGrip,this._state="resize")},D.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ft.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ft.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ft.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},D.prototype.setupControlBox=function(){q.prototype.setupControlBox.call(this),this.curveControlLine1=ft.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ft.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},D.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,q.prototype.addControlGrips.call(this)},D.prototype.positionGrips=function(){q.prototype.positionGrips.call(this);var _=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-_/2,this.curveY-_/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},D.prototype.manipulate=function(_){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+_.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+_.y-this.manipulationStartY),q.prototype.manipulate.call(this,_)},D.prototype.resize=function(_){this.activeGrip===this.curveGrip&&(this.curveX=_.x,this.curveY=_.y),q.prototype.resize.call(this,_),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},D.prototype.setStrokeColor=function(_){this.strokeColor=_,this.adjustVisual(),this.colorChanged(_)},D.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.adjustVisual()},D.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.adjustVisual()},D.prototype.scale=function(_,K){this.curveX=this.curveX*_,this.curveY=this.curveY*K,q.prototype.scale.call(this,_,K)},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},q.prototype.getState.call(this));return _.typeName=D.typeName,_},D.prototype.restoreState=function(_){q.prototype.restoreState.call(this,_);var K=_;this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.curveX=K.curveX,this.curveY=K.curveY,this.createVisual(),this.adjustVisual()},D.typeName="CurveMarker",D.title="Curve marker",D.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',D}(_e),En=function(q){function D(_,K,z){var P=q.call(this,_,K,z)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.textColor="transparent",P.fontSize="1rem",P.isMoved=!1,P.captionText="Caption",P.PADDING=5,P.captionBoxWidth=0,P.captionBoxHeight=0,P.strokeColor=z.defaultColor,P.strokeWidth=z.defaultStrokeWidth,P.strokeDasharray=z.defaultStrokeDasharray,P.fillColor=z.defaultFillColor,P.textColor=z.defaultStrokeColor,P.fontFamily=z.defaultFontFamily,P.fontSize=z.defaultCaptionFontSize,P.captionText=z.defaultCaptionText,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.createVisual=P.createVisual.bind(P),P.sizeCaption=P.sizeCaption.bind(P),P.setCaptionText=P.setCaptionText.bind(P),P.showTextEditor=P.showTextEditor.bind(P),P.positionTextEditor=P.positionTextEditor.bind(P),P.finishTextEditing=P.finishTextEditing.bind(P),P.setFont=P.setFont.bind(P),P.setTextColor=P.setTextColor.bind(P),P.strokePanel=new zt("Line color",gt(z.defaultColorSet,["transparent"]),P.strokeColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.fillPanel=new zt("Fill color",gt(z.defaultColorSet,["transparent"]),P.fillColor,tt),P.fillPanel.onColorChanged=P.setFillColor,P.strokeWidthPanel=new it("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new Ot("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P.fontFamilyPanel=new Ht("Font",z.defaultFontFamilies,z.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P.textColorPanel=new zt("Text color",z.defaultColorSet,P.textColor,It),P.textColorPanel.onColorChanged=P.setTextColor,P}return At(D,q),D.prototype.ownsTarget=function(_){return!(!q.prototype.ownsTarget.call(this,_)&&_!==this.visual&&_!==this.frame&&_!==this.captionBg&&_!==this.captionElement)},D.prototype.createVisual=function(){this.visual=ft.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=ft.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=ft.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=ft.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},D.prototype.setCaptionText=function(_){this.captionText=_,this.captionElement.textContent=this.captionText,this.sizeCaption()},D.prototype.pointerDown=function(_,K){q.prototype.pointerDown.call(this,_,K),this.isMoved=!1,this.pointerDownPoint=_,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(_),this._state="creating")},D.prototype.manipulate=function(_){q.prototype.manipulate.call(this,_),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(_.x-this.pointerDownPoint.x)>5||Math.abs(_.y-this.pointerDownPoint.y)>5)},D.prototype.resize=function(_){q.prototype.resize.call(this,_),this.setSize()},D.prototype.sizeCaption=function(){var _=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=_.width+2*this.PADDING,this.captionBoxHeight=_.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),ft.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),ft.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},D.prototype.showTextEditor=function(){var _=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(K){K.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(K){K.key==="Enter"&&_.finishTextEditing(_.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(K){K.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){_.finishTextEditing(_.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){_.finishTextEditing(_.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},D.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},D.prototype.finishTextEditing=function(_){this.setCaptionText(_.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},D.prototype.setFont=function(_){this.captionElement&&ft.setAttributes(this.captionElement,[["font-family",_]]),this.fontFamily=_,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},D.prototype.setTextColor=function(_){this.captionElement&&ft.setAttributes(this.captionElement,[["fill",_]]),this.textColor=_,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},D.prototype.setSize=function(){q.prototype.setSize.call(this),ft.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},D.prototype.pointerUp=function(_){q.prototype.pointerUp.call(this,_),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},D.prototype.dblClick=function(_,K){q.prototype.dblClick.call(this,_,K),this.showTextEditor()},D.prototype.setStrokeColor=function(_){this.strokeColor=_,this.frame&&ft.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(_),this.stateChanged()},D.prototype.setFillColor=function(_){this.fillColor=_,this.captionBg&&ft.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(_),this.stateChanged()},D.prototype.setStrokeWidth=function(_){this.strokeWidth=_,this.frame&&ft.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},D.prototype.setStrokeDasharray=function(_){this.strokeDasharray=_,this.frame&&ft.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(D.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),D.prototype.getState=function(){var _=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},q.prototype.getState.call(this));return _.typeName=this.typeName,_},D.prototype.restoreState=function(_){var K=_;this.fillColor=K.fillColor,this.strokeColor=K.strokeColor,this.strokeWidth=K.strokeWidth,this.strokeDasharray=K.strokeDasharray,this.textColor=K.textColor,this.fontFamily=K.fontFamily,this.captionText=K.captionText,this.fontSize=K.fontSize,this.createVisual(),q.prototype.restoreState.call(this,_),this.setSize()},D.prototype.scale=function(_,K){q.prototype.scale.call(this,_,K),this.setSize()},D.typeName="CaptionFrameMarker",D.title="Caption frame marker",D.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',D}(Wt),an=function(){function q(D,_){_===void 0&&(_=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=D,this.cancelable=_}return Object.defineProperty(q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),q.prototype.preventDefault=function(){this._defaultPrevented=!0},q}(),vi=function(q){function D(_,K,z){var P=q.call(this,_,!1)||this;return P.dataUrl=K,P.state=z,P}return At(D,q),D}(an),ai=function(q){function D(_,K,z){z===void 0&&(z=!1);var P=q.call(this,_,z)||this;return P.marker=K,P}return At(D,q),D}(an),zi=function(){function q(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return q.prototype.addEventListener=function(D,_){this[D].push(_)},q.prototype.removeEventListener=function(D,_){var K=this[D].indexOf(_);K>-1&&this[D].splice(K,1)},q}(),$i=function(){function q(D){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Te,this._isOpen=!1,this.undoRedoManager=new Ae,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new zi,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=q.instanceCounter++,this.styles=new Y(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=D,this.targetRoot=document.body,this.width=D.clientWidth,this.height=D.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(q.prototype,"ALL_MARKER_TYPES",{get:function(){return[qt,Ke,pi,pe,Ye,hi,Ki,de,Ze,Sn,fi,Wi,En]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[qt,Ke,pi,pe,hi,Ki,de]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[qt,Ke,pi,pe,Ki]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(D){var _=this;this._availableMarkerTypes.splice(0),D.forEach(function(K){if(typeof K=="string"){var z=_.ALL_MARKER_TYPES.find(function(P){return P.typeName===K});z!==void 0&&_._availableMarkerTypes.push(z)}else _._availableMarkerTypes.push(K)})},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(D){this._zoomLevel=D,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ct.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},q.prototype.show=function(){var D=this;this.styles.styleSheetRoot===void 0&&F.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=F.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(_){return _(new an(D))})},q.prototype.render=function(){return vt(this,void 0,void 0,function(){var D;return Et(this,function(_){switch(_.label){case 0:return this.setCurrentMarker(),(D=new ot).naturalSize=this.renderAtNaturalSize,D.imageType=this.renderImageType,D.imageQuality=this.renderImageQuality,D.markersOnly=this.renderMarkersOnly,D.width=this.renderWidth,D.height=this.renderHeight,[4,D.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return _.sent(),[4,D.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,_.sent()]}})})},q.prototype.close=function(D){var _=this;if(D===void 0&&(D=!1),this.isOpen){var K=!1;D||this.eventListeners.beforeclose.forEach(function(z){var P=new an(_,!0);z(P),P.defaultPrevented&&(K=!0)}),K||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(z){return z(new an(_))}),this.detachEvents(),this._isOpen=!1)}},q.prototype.addMarkersToToolbar=function(){for(var D,_=[],K=0;K<arguments.length;K++)_[K]=arguments[K];(D=this._availableMarkerTypes).push.apply(D,_)},q.prototype.addRenderEventListener=function(D){this.addEventListener("render",function(_){D(_.dataUrl,_.state)})},q.prototype.removeRenderEventListener=function(D){},q.prototype.addCloseEventListener=function(D){this.addEventListener("close",function(){D()})},q.prototype.removeCloseEventListener=function(D){},q.prototype.setupResizeObserver=function(){var D=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){D.resize(D.target.clientWidth,D.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return D.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupTargetResize=function(){var D=1*this.target.clientWidth/this.target.clientHeight,_=this.editorCanvas.clientWidth/D>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*D:this.editorCanvas.clientWidth,K=_<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/D;this.resize(_,K)},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.prototype.resize=function(D,_){this._isResizing=!0;var K=D/this.imageWidth,z=_/this.imageHeight;this.imageWidth=Math.round(D),this.imageHeight=Math.round(_),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(K,z),this._isResizing=!1},q.prototype.scaleMarkers=function(D,_){var K,z=this;this._currentMarker&&this._currentMarker instanceof pe?this._currentMarker.scale(D,_):(K=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(P){P!==z._currentMarker&&P.scale(D,_)}),K!==void 0&&this.setCurrentMarker(K)},q.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},q.prototype.setTopLeft=function(){var D=this.editingTarget.getBoundingClientRect(),_=this.editorCanvas.getBoundingClientRect();this.left=D.left-_.left,this.top=D.top-_.top},q.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},q.prototype.addDefs=function(){for(var D,_=[],K=0;K<arguments.length;K++)_[K]=arguments[K];this.defs=ft.createDefs(),this.addDefsToImage(),(D=this.defs).append.apply(D,_)},q.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},q.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},q.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},q.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},q.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},q.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},q.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},q.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var D=document.createElement("a");D.href="https://markerjs.com/",D.target="_blank",D.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',D.title="Powered by marker.js",D.style.display="grid",D.style.alignItems="center",D.style.justifyItems="center",D.style.padding="3px",D.style.width="20px",D.style.height="20px",this.logoUI.appendChild(D),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},q.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},q.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var D=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=D+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Fe(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new le(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},q.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.removeMarker=function(D){this.markerImage.removeChild(D.container),this.markers.indexOf(D)>-1&&this.markers.splice(this.markers.indexOf(D),1),D.dispose()},q.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},q.prototype.toolbarButtonClicked=function(D,_){if(D==="marker"&&_!==void 0)this.createNewMarker(_);else if(D==="action")switch(_){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},q.prototype.deleteSelectedMarker=function(){var D=this;if(this._currentMarker!==void 0){var _=!1;if(this.eventListeners.markerbeforedelete.forEach(function(z){var P=new ai(D,D._currentMarker,!0);z(P),P.defaultPrevented&&(_=!0)}),!_){var K=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(z){return z(new ai(D,K))})}}},q.prototype.clear=function(){var D=this,_=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(bt){var Gt=new ai(D,void 0,!0);bt(Gt),Gt.defaultPrevented&&(_=!0)}),!_)){this.setCurrentMarker();for(var K=function(bt){var Gt=z.markers[bt];z.setCurrentMarker(z.markers[bt]),z._currentMarker.dispose(),z.markerImage.removeChild(z._currentMarker.container),z.markers.splice(z.markers.indexOf(z._currentMarker),1),z.eventListeners.markerdelete.forEach(function(Pe){return Pe(new ai(D,Gt))})},z=this,P=this.markers.length-1;P>=0;P--)K(P);this.addUndoStep()}},Object.defineProperty(q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),q.prototype.showNotesEditor=function(){var D;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(D=this._currentMarker.notes)!==null&&D!==void 0?D:"",this.overlayContainer.appendChild(this.notesArea))},q.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},q.prototype.addUndoStep=function(){var D=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var _=this.getState(),K=this.undoRedoManager.getLastUndoStep();if(!K||K.width===_.width&&K.height===_.height){var z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(_),z<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(P){return P(new an(D))})}else this.undoRedoManager.replaceLastUndoStep(_),this.eventListeners.statechange.forEach(function(P){return P(new an(D))})}},q.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},q.prototype.undoStep=function(){var D=this,_=this.undoRedoManager.undo();_!==void 0&&(this.restoreState(_),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new an(D))}))},q.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},q.prototype.redoStep=function(){var D=this,_=this.undoRedoManager.redo();_!==void 0&&(this.restoreState(_),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(K){return K(new an(D))}))},q.prototype.stepZoom=function(){var D=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=D<this.zoomSteps.length-1?this.zoomSteps[D+1]:this.zoomSteps[0]},q.prototype.panTo=function(D){this.contentDiv.scrollBy({left:this.prevPanPoint.x-D.x,top:this.prevPanPoint.y-D.y}),this.prevPanPoint=D},q.prototype.startRenderAndClose=function(){return vt(this,void 0,void 0,function(){var D,_,K=this;return Et(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return D=z.sent(),_=this.getState(),this.eventListeners.render.forEach(function(P){return P(new vi(K,D,_))}),this.close(!0),[2]}})})},q.prototype.getState=function(D){D===!0&&this.setCurrentMarker();var _={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(K){return _.markers.push(K.getState())}),_},q.prototype.restoreState=function(D){var _=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);D.markers.forEach(function(K){var z=_._availableMarkerTypes.find(function(bt){return bt.typeName===K.typeName});if(z!==void 0){var P=_.addNewMarker(z);P.restoreState(K),_.markers.push(P)}}),D.width&&D.height&&(D.width!==this.imageWidth||D.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/D.width,this.imageHeight/D.height),this.eventListeners.restorestate.forEach(function(K){return K(new an(_))})},q.prototype.addNewMarker=function(D){var _=ft.createGroup();return this.markerImage.appendChild(_),new D(_,this.overlayContainer,this.settings)},q.prototype.createNewMarker=function(D){var _,K=this;(_=typeof D=="string"?this._availableMarkerTypes.find(function(z){return z.typeName===D}):D)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(_),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(_.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(z){return z(new ai(K,K._currentMarker))}))},q.prototype.markerCreated=function(D){var _=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(D),this.setCurrentMarker(D),D instanceof Ke&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ke):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(K){return K(new ai(_,_._currentMarker))})},q.prototype.colorChanged=function(D){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=D,this.settings.defaultStrokeColor=D)},q.prototype.fillColorChanged=function(D){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=D)},q.prototype.markerStateChanged=function(D){var _=this;this.eventListeners.markerchange.forEach(function(K){return K(new ai(_,D))})},q.prototype.setCurrentMarker=function(D){var _=this;this._currentMarker!==D&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(K){return K(new ai(_,_._currentMarker))})),this._currentMarker=D,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(K){return K(new ai(_,_._currentMarker))}))},q.prototype.onPointerDown=function(D){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||D.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var _=this.markers.find(function(K){return K.ownsTarget(D.target)});_!==void 0?(this.setCurrentMarker(_),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(D.clientX,D.clientY),D.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:D.clientX,y:D.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(D.clientX,D.clientY))},q.prototype.onDblClick=function(D){if(this._isFocused||this.focus(),this.mode==="select"){var _=this.markers.find(function(K){return K.ownsTarget(D.target)});_!==void 0&&_!==this._currentMarker&&this.setCurrentMarker(_),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(D.clientX,D.clientY),D.target):this.setCurrentMarker()}},q.prototype.onPointerMove=function(D){this.touchPoints!==1&&D.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||D.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(D.clientX,D.clientY)):this.zoomLevel>1&&this.panTo({x:D.clientX,y:D.clientY}))},q.prototype.onPointerUp=function(D){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(D.clientX,D.clientY)),this.isDragging=!1,this.addUndoStep()},q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},q.prototype.onKeyUp=function(D){this._currentMarker===void 0||this.notesArea!==void 0||D.key!=="Delete"&&D.key!=="Backspace"||this.deleteSelectedMarker()},q.prototype.clientToLocalCoordinates=function(D,_){var K=this.markerImage.getBoundingClientRect();return{x:(D-K.left)/this.zoomLevel,y:(_-K.top)/this.zoomLevel}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var D=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=D+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},q.prototype.addLicenseKey=function(D){ct.addKey(D)},q.prototype.addEventListener=function(D,_){this.eventListeners.addEventListener(D,_)},q.prototype.removeEventListener=function(D,_){this.eventListeners.removeEventListener(D,_)},q.prototype.renderState=function(D){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(D),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),q.prototype.focus=function(){var D=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(_){return _(new an(D))}))},q.prototype.blur=function(){var D=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(_){return _(new an(D))}))},q.instanceCounter=0,q}()},95860:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return Vt}});var Nt=j(87462),At=j(1413),vt=j(4942),Et=j(97685),gt=j(45987),ft=j(94184),ct=j.n(ft),ot=j(67294);function F(Wt){var kt=ot.useRef();kt.current=Wt;var it=ot.useCallback(function(){for(var Ot,qt=arguments.length,Te=new Array(qt),_e=0;_e<qt;_e++)Te[_e]=arguments[_e];return(Ot=kt.current)===null||Ot===void 0?void 0:Ot.call.apply(Ot,[kt].concat(Te))},[]);return it}function Y(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ee=Y()?ot.useLayoutEffect:ot.useEffect,ne=function(kt,it){var Ot=ot.useRef(!0);ee(function(){return kt(Ot.current)},it),ee(function(){return Ot.current=!1,function(){Ot.current=!0}},[])},Fe=function(kt,it){ne(function(Ot){if(!Ot)return kt()},it)},le=null;function Zt(Wt){var kt=ot.useRef(!1),it=ot.useState(Wt),Ot=(0,Et.Z)(it,2),qt=Ot[0],Te=Ot[1];ot.useEffect(function(){return kt.current=!1,function(){kt.current=!0}},[]);function _e(fi,Ht){Ht&&kt.current||Te(fi)}return[qt,_e]}function zt(Wt){return Wt!==void 0}function Q(Wt,kt){var it=kt||{},Ot=it.defaultValue,qt=it.value,Te=it.onChange,_e=it.postState,fi=Zt(function(){return zt(qt)?qt:zt(Ot)?typeof Ot=="function"?Ot():Ot:typeof Wt=="function"?Wt():Wt}),Ht=(0,Et.Z)(fi,2),pe=Ht[0],Ke=Ht[1],ki=qt!==void 0?qt:pe,pi=_e?_e(ki):ki,Sn=F(Te),Sr=Zt([ki]),Ki=(0,Et.Z)(Sr,2),It=Ki[0],tt=Ki[1];Fe(function(){var hi=It[0];pe!==hi&&Sn(pe,hi)},[It]),Fe(function(){zt(qt)||Ke(qt)},[qt]);var de=F(function(hi,Ze){Ke(hi,Ze),tt([ki],Ze)});return[pi,de]}var se=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],$e=(0,ot.forwardRef)(function(Wt,kt){var it,Ot=Wt.prefixCls,qt=Ot===void 0?"rc-checkbox":Ot,Te=Wt.className,_e=Wt.style,fi=Wt.checked,Ht=Wt.disabled,pe=Wt.defaultChecked,Ke=pe===void 0?!1:pe,ki=Wt.type,pi=ki===void 0?"checkbox":ki,Sn=Wt.title,Sr=Wt.onChange,Ki=(0,gt.Z)(Wt,se),It=(0,ot.useRef)(null),tt=Q(Ke,{value:fi}),de=(0,Et.Z)(tt,2),hi=de[0],Ze=de[1];(0,ot.useImperativeHandle)(kt,function(){return{focus:function(){var En;(En=It.current)===null||En===void 0||En.focus()},blur:function(){var En;(En=It.current)===null||En===void 0||En.blur()},input:It.current}});var Ye=ct()(qt,Te,(it={},(0,vt.Z)(it,"".concat(qt,"-checked"),hi),(0,vt.Z)(it,"".concat(qt,"-disabled"),Ht),it)),Ae=function(En){Ht||("checked"in Wt||Ze(En.target.checked),Sr==null||Sr({target:(0,At.Z)((0,At.Z)({},Wt),{},{type:pi,checked:En.target.checked}),stopPropagation:function(){En.stopPropagation()},preventDefault:function(){En.preventDefault()},nativeEvent:En.nativeEvent}))};return ot.createElement("span",{className:Ye,title:Sn,style:_e},ot.createElement("input",(0,Nt.Z)({},Ki,{className:"".concat(qt,"-input"),ref:It,onChange:Ae,disabled:Ht,checked:!!hi,type:pi})),ot.createElement("span",{className:"".concat(qt,"-inner")}))}),Vt=$e},82523:function(Wr,Ti){"use strict";var j;var Nt=Symbol.for("react.element"),At=Symbol.for("react.portal"),vt=Symbol.for("react.fragment"),Et=Symbol.for("react.strict_mode"),gt=Symbol.for("react.profiler"),ft=Symbol.for("react.provider"),ct=Symbol.for("react.context"),ot=Symbol.for("react.server_context"),F=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),Fe=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),Zt;Zt=Symbol.for("react.module.reference");function zt(Q){if(typeof Q=="object"&&Q!==null){var se=Q.$$typeof;switch(se){case Nt:switch(Q=Q.type,Q){case vt:case gt:case Et:case Y:case ee:return Q;default:switch(Q=Q&&Q.$$typeof,Q){case ot:case ct:case F:case Fe:case ne:case ft:return Q;default:return se}}case At:return se}}}j=ct,j=ft,j=Nt,j=F,j=vt,j=Fe,j=ne,j=At,j=gt,j=Et,j=Y,j=ee,j=function(){return!1},j=function(){return!1},j=function(Q){return zt(Q)===ct},j=function(Q){return zt(Q)===ft},j=function(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===Nt},j=function(Q){return zt(Q)===F},j=function(Q){return zt(Q)===vt},j=function(Q){return zt(Q)===Fe},j=function(Q){return zt(Q)===ne},j=function(Q){return zt(Q)===At},j=function(Q){return zt(Q)===gt},j=function(Q){return zt(Q)===Et},j=function(Q){return zt(Q)===Y},j=function(Q){return zt(Q)===ee},j=function(Q){return typeof Q=="string"||typeof Q=="function"||Q===vt||Q===gt||Q===Et||Q===Y||Q===ee||Q===le||typeof Q=="object"&&Q!==null&&(Q.$$typeof===Fe||Q.$$typeof===ne||Q.$$typeof===ft||Q.$$typeof===ct||Q.$$typeof===F||Q.$$typeof===Zt||Q.getModuleId!==void 0)},j=zt},27183:function(Wr,Ti,j){"use strict";j(82523)},67656:function(Wr,Ti,j){"use strict";j.r(Ti),j.d(Ti,{BaseInput:function(){return Y},default:function(){return $e}});var Nt=j(87462),At=j(1413),vt=j(4942),Et=j(71002),gt=j(94184),ft=j.n(gt),ct=j(67294),ot=j(87887),F=function(Wt){var kt,it,Ot=Wt.inputElement,qt=Wt.prefixCls,Te=Wt.prefix,_e=Wt.suffix,fi=Wt.addonBefore,Ht=Wt.addonAfter,pe=Wt.className,Ke=Wt.style,ki=Wt.disabled,pi=Wt.readOnly,Sn=Wt.focused,Sr=Wt.triggerFocus,Ki=Wt.allowClear,It=Wt.value,tt=Wt.handleReset,de=Wt.hidden,hi=Wt.classes,Ze=Wt.classNames,Ye=Wt.dataAttrs,Ae=Wt.styles,Wi=Wt.components,En=(Wi==null?void 0:Wi.affixWrapper)||"span",an=(Wi==null?void 0:Wi.groupWrapper)||"span",vi=(Wi==null?void 0:Wi.wrapper)||"span",ai=(Wi==null?void 0:Wi.groupAddon)||"span",zi=(0,ct.useRef)(null),$i=function(si){var Gi;(Gi=zi.current)!==null&&Gi!==void 0&&Gi.contains(si.target)&&(Sr==null||Sr())},q=function(){var si;if(!Ki)return null;var Gi=!ki&&!pi&&It,er="".concat(qt,"-clear-icon"),rr=(0,Et.Z)(Ki)==="object"&&Ki!==null&&Ki!==void 0&&Ki.clearIcon?Ki.clearIcon:"\u2716";return ct.createElement("span",{onClick:tt,onMouseDown:function(We){return We.preventDefault()},className:ft()(er,(si={},(0,vt.Z)(si,"".concat(er,"-hidden"),!Gi),(0,vt.Z)(si,"".concat(er,"-has-suffix"),!!_e),si)),role:"button",tabIndex:-1},rr)},D=(0,ct.cloneElement)(Ot,{value:It,hidden:de,className:ft()((kt=Ot.props)===null||kt===void 0?void 0:kt.className,!(0,ot.X3)(Wt)&&!(0,ot.He)(Wt)&&pe)||null,style:(0,At.Z)((0,At.Z)({},(it=Ot.props)===null||it===void 0?void 0:it.style),!(0,ot.X3)(Wt)&&!(0,ot.He)(Wt)?Ke:{})});if((0,ot.X3)(Wt)){var _,K="".concat(qt,"-affix-wrapper"),z=ft()(K,(_={},(0,vt.Z)(_,"".concat(K,"-disabled"),ki),(0,vt.Z)(_,"".concat(K,"-focused"),Sn),(0,vt.Z)(_,"".concat(K,"-readonly"),pi),(0,vt.Z)(_,"".concat(K,"-input-with-clear-btn"),_e&&Ki&&It),_),!(0,ot.He)(Wt)&&pe,hi==null?void 0:hi.affixWrapper,Ze==null?void 0:Ze.affixWrapper),P=(_e||Ki)&&ct.createElement("span",{className:ft()("".concat(qt,"-suffix"),Ze==null?void 0:Ze.suffix),style:Ae==null?void 0:Ae.suffix},q(),_e);D=ct.createElement(En,(0,Nt.Z)({className:z,style:(0,At.Z)((0,At.Z)({},(0,ot.He)(Wt)?void 0:Ke),Ae==null?void 0:Ae.affixWrapper),hidden:!(0,ot.He)(Wt)&&de,onClick:$i},Ye==null?void 0:Ye.affixWrapper,{ref:zi}),Te&&ct.createElement("span",{className:ft()("".concat(qt,"-prefix"),Ze==null?void 0:Ze.prefix),style:Ae==null?void 0:Ae.prefix},Te),(0,ct.cloneElement)(Ot,{value:It,hidden:null}),P)}if((0,ot.He)(Wt)){var bt="".concat(qt,"-group"),Gt="".concat(bt,"-addon"),Pe=ft()("".concat(qt,"-wrapper"),bt,hi==null?void 0:hi.wrapper),He=ft()("".concat(qt,"-group-wrapper"),pe,hi==null?void 0:hi.group);return ct.createElement(an,{className:He,style:Ke,hidden:de},ct.createElement(vi,{className:Pe},fi&&ct.createElement(ai,{className:Gt},fi),(0,ct.cloneElement)(D,{hidden:null}),Ht&&ct.createElement(ai,{className:Gt},Ht)))}return D},Y=F,ee=j(74902),ne=j(97685),Fe=j(45987),le=j(21770),Zt=j(98423),zt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],Q=(0,ct.forwardRef)(function(Vt,Wt){var kt=Vt.autoComplete,it=Vt.onChange,Ot=Vt.onFocus,qt=Vt.onBlur,Te=Vt.onPressEnter,_e=Vt.onKeyDown,fi=Vt.prefixCls,Ht=fi===void 0?"rc-input":fi,pe=Vt.disabled,Ke=Vt.htmlSize,ki=Vt.className,pi=Vt.maxLength,Sn=Vt.suffix,Sr=Vt.showCount,Ki=Vt.type,It=Ki===void 0?"text":Ki,tt=Vt.classes,de=Vt.classNames,hi=Vt.styles,Ze=(0,Fe.Z)(Vt,zt),Ye=(0,le.Z)(Vt.defaultValue,{value:Vt.value}),Ae=(0,ne.Z)(Ye,2),Wi=Ae[0],En=Ae[1],an=(0,ct.useState)(!1),vi=(0,ne.Z)(an,2),ai=vi[0],zi=vi[1],$i=(0,ct.useRef)(null),q=function(He){$i.current&&(0,ot.nH)($i.current,He)};(0,ct.useImperativeHandle)(Wt,function(){return{focus:q,blur:function(){var He;(He=$i.current)===null||He===void 0||He.blur()},setSelectionRange:function(He,ei,si){var Gi;(Gi=$i.current)===null||Gi===void 0||Gi.setSelectionRange(He,ei,si)},select:function(){var He;(He=$i.current)===null||He===void 0||He.select()},input:$i.current}}),(0,ct.useEffect)(function(){zi(function(Pe){return Pe&&pe?!1:Pe})},[pe]);var D=function(He){Vt.value===void 0&&En(He.target.value),$i.current&&(0,ot.rJ)($i.current,He,it)},_=function(He){Te&&He.key==="Enter"&&Te(He),_e==null||_e(He)},K=function(He){zi(!0),Ot==null||Ot(He)},z=function(He){zi(!1),qt==null||qt(He)},P=function(He){En(""),q(),$i.current&&(0,ot.rJ)($i.current,He,it)},bt=function(){var He=(0,Zt.Z)(Vt,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return ct.createElement("input",(0,Nt.Z)({autoComplete:kt},He,{onChange:D,onFocus:K,onBlur:z,onKeyDown:_,className:ft()(Ht,(0,vt.Z)({},"".concat(Ht,"-disabled"),pe),de==null?void 0:de.input),style:hi==null?void 0:hi.input,ref:$i,size:Ke,type:It}))},Gt=function(){var He=Number(pi)>0;if(Sn||Sr){var ei=(0,ot.D7)(Wi),si=(0,ee.Z)(ei).length,Gi=(0,Et.Z)(Sr)==="object"?Sr.formatter({value:ei,count:si,maxLength:pi}):"".concat(si).concat(He?" / ".concat(pi):"");return ct.createElement(ct.Fragment,null,!!Sr&&ct.createElement("span",{className:ft()("".concat(Ht,"-show-count-suffix"),(0,vt.Z)({},"".concat(Ht,"-show-count-has-suffix"),!!Sn),de==null?void 0:de.count),style:(0,At.Z)({},hi==null?void 0:hi.count)},Gi),Sn)}return null};return ct.createElement(Y,(0,Nt.Z)({},Ze,{prefixCls:Ht,className:ki,inputElement:bt(),handleReset:P,value:(0,ot.D7)(Wi),focused:ai,triggerFocus:q,suffix:Gt(),disabled:pe,classes:tt,classNames:de,styles:hi}))}),se=Q,$e=se},87887:function(Wr,Ti,j){"use strict";j.d(Ti,{D7:function(){return gt},He:function(){return Nt},X3:function(){return At},nH:function(){return Et},rJ:function(){return vt}});function Nt(ft){return!!(ft.addonBefore||ft.addonAfter)}function At(ft){return!!(ft.prefix||ft.suffix||ft.allowClear)}function vt(ft,ct,ot,F){if(ot){var Y=ct;if(ct.type==="click"){var ee=ft.cloneNode(!0);Y=Object.create(ct,{target:{value:ee},currentTarget:{value:ee}}),ee.value="",ot(Y);return}if(F!==void 0){Y=Object.create(ct,{target:{value:ft},currentTarget:{value:ft}}),ft.value=F,ot(Y);return}ot(Y)}}function Et(ft,ct){if(ft){ft.focus(ct);var ot=ct||{},F=ot.cursor;if(F){var Y=ft.value.length;switch(F){case"start":ft.setSelectionRange(0,0);break;case"end":ft.setSelectionRange(Y,Y);break;default:ft.setSelectionRange(0,Y)}}}}function gt(ft){return typeof ft=="undefined"||ft===null?"":String(ft)}},52073:function(Wr,Ti,j){"use strict";j.d(Ti,{iz:function(){return Hh},ck:function(){return ho},BW:function(){return mf},sN:function(){return ho},Wd:function(){return Rr},ZP:function(){return Ec},Xl:function(){return er}});var Nt=j(87462),At=j(4942),vt=j(1413),Et=j(74902),gt=j(97685),ft=j(45987),ct=j(94184),ot=j.n(ct),F=j(67294),Y=j.t(F,2),ee=j(48555);function ne(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Fe=ne()?F.useLayoutEffect:F.useEffect,le=function(ht,wt){var Ft=F.useRef(!0);Fe(function(){return ht(Ft.current)},wt),Fe(function(){return Ft.current=!1,function(){Ft.current=!0}},[])},Zt=function(ht,wt){le(function(Ft){if(!Ft)return ht()},wt)},zt=le,Q=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],se=void 0;function $e(Z,ht){var wt=Z.prefixCls,Ft=Z.invalidate,Ut=Z.item,Ie=Z.renderItem,ke=Z.responsive,Ri=Z.responsiveDisabled,qi=Z.registerSize,fn=Z.itemKey,Ar=Z.className,qn=Z.style,Dn=Z.children,$n=Z.display,Di=Z.order,Wn=Z.component,Ln=Wn===void 0?"div":Wn,cr=(0,ft.Z)(Z,Q),wr=ke&&!$n;function xn(Ko){qi(fn,Ko)}F.useEffect(function(){return function(){xn(null)}},[]);var Qi=Ie&&Ut!==se?Ie(Ut):Dn,So;Ft||(So={opacity:wr?0:1,height:wr?0:se,overflowY:wr?"hidden":se,order:ke?Di:se,pointerEvents:wr?"none":se,position:wr?"absolute":se});var jo={};wr&&(jo["aria-hidden"]=!0);var go=F.createElement(Ln,(0,Nt.Z)({className:ot()(!Ft&&wt,Ar),style:(0,vt.Z)((0,vt.Z)({},So),qn)},jo,cr,{ref:ht}),Qi);return ke&&(go=F.createElement(ee.Z,{onResize:function(Zr){var zo=Zr.offsetWidth;xn(zo)},disabled:Ri},go)),go}var Vt=F.forwardRef($e);Vt.displayName="Item";var Wt=Vt;function kt(Z){var ht=F.useRef();ht.current=Z;var wt=F.useCallback(function(){for(var Ft,Ut=arguments.length,Ie=new Array(Ut),ke=0;ke<Ut;ke++)Ie[ke]=arguments[ke];return(Ft=ht.current)===null||Ft===void 0?void 0:Ft.call.apply(Ft,[ht].concat(Ie))},[]);return wt}var it=j(73935),Ot=function(ht){return+setTimeout(ht,16)},qt=function(ht){return clearTimeout(ht)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ot=function(ht){return window.requestAnimationFrame(ht)},qt=function(ht){return window.cancelAnimationFrame(ht)});var Te=0,_e=new Map;function fi(Z){_e.delete(Z)}var Ht=function(ht){var wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Te+=1;var Ft=Te;function Ut(Ie){if(Ie===0)fi(Ft),ht();else{var ke=Ot(function(){Ut(Ie-1)});_e.set(Ft,ke)}}return Ut(wt),Ft};Ht.cancel=function(Z){var ht=_e.get(Z);return fi(ht),qt(ht)};var pe=Ht;function Ke(Z){if(typeof MessageChannel=="undefined")pe(Z);else{var ht=new MessageChannel;ht.port1.onmessage=function(){return Z()},ht.port2.postMessage(void 0)}}function ki(){var Z=F.useRef(null),ht=function(Ft){Z.current||(Z.current=[],Ke(function(){(0,it.unstable_batchedUpdates)(function(){Z.current.forEach(function(Ut){Ut()}),Z.current=null})})),Z.current.push(Ft)};return ht}function pi(Z,ht){var wt=F.useState(ht),Ft=(0,gt.Z)(wt,2),Ut=Ft[0],Ie=Ft[1],ke=kt(function(Ri){Z(function(){Ie(Ri)})});return[Ut,ke]}var Sn=F.createContext(null),Sr=["component"],Ki=["className"],It=["className"],tt=function(ht,wt){var Ft=F.useContext(Sn);if(!Ft){var Ut=ht.component,Ie=Ut===void 0?"div":Ut,ke=(0,ft.Z)(ht,Sr);return F.createElement(Ie,(0,Nt.Z)({},ke,{ref:wt}))}var Ri=Ft.className,qi=(0,ft.Z)(Ft,Ki),fn=ht.className,Ar=(0,ft.Z)(ht,It);return F.createElement(Sn.Provider,{value:null},F.createElement(Wt,(0,Nt.Z)({ref:wt,className:ot()(Ri,fn)},qi,Ar)))},de=F.forwardRef(tt);de.displayName="RawItem";var hi=de,Ze=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Ye="responsive",Ae="invalidate";function Wi(Z){return"+ ".concat(Z.length," ...")}function En(Z,ht){var wt=Z.prefixCls,Ft=wt===void 0?"rc-overflow":wt,Ut=Z.data,Ie=Ut===void 0?[]:Ut,ke=Z.renderItem,Ri=Z.renderRawItem,qi=Z.itemKey,fn=Z.itemWidth,Ar=fn===void 0?10:fn,qn=Z.ssr,Dn=Z.style,$n=Z.className,Di=Z.maxCount,Wn=Z.renderRest,Ln=Z.renderRawRest,cr=Z.suffix,wr=Z.component,xn=wr===void 0?"div":wr,Qi=Z.itemComponent,So=Z.onVisibleChange,jo=(0,ft.Z)(Z,Ze),go=qn==="full",Ko=ki(),Zr=pi(Ko,null),zo=(0,gt.Z)(Zr,2),da=zo[0],Cs=zo[1],ys=da||0,pa=pi(Ko,new Map),Cr=(0,gt.Z)(pa,2),Qr=Cr[0],io=Cr[1],Ps=pi(Ko,0),xs=(0,gt.Z)(Ps,2),Ns=xs[0],gs=xs[1],la=pi(Ko,0),Da=(0,gt.Z)(la,2),Ks=Da[0],va=Da[1],oo=pi(Ko,0),vs=(0,gt.Z)(oo,2),ks=vs[0],Ia=vs[1],ll=(0,F.useState)(null),ja=(0,gt.Z)(ll,2),Oa=ja[0],Qa=ja[1],mr=(0,F.useState)(null),Dl=(0,gt.Z)(mr,2),ul=Dl[0],Cu=Dl[1],To=F.useMemo(function(){return ul===null&&go?Number.MAX_SAFE_INTEGER:ul||0},[ul,da]),Au=(0,F.useState)(!1),Ml=(0,gt.Z)(Au,2),du=Ml[0],pu=Ml[1],yl="".concat(Ft,"-item"),Xu=Math.max(Ns,Ks),ru=Di===Ye,ya=Ie.length&&ru,ju=Di===Ae,hl=ya||typeof Di=="number"&&Ie.length>Di,Qs=(0,F.useMemo)(function(){var ri=Ie;return ya?da===null&&go?ri=Ie:ri=Ie.slice(0,Math.min(Ie.length,ys/Ar)):typeof Di=="number"&&(ri=Ie.slice(0,Di)),ri},[Ie,Ar,da,Di,ya]),Il=(0,F.useMemo)(function(){return ya?Ie.slice(To+1):Ie.slice(Qs.length)},[Ie,Qs,ya,To]),Es=(0,F.useCallback)(function(ri,Mi){var Bi;return typeof qi=="function"?qi(ri):(Bi=qi&&(ri==null?void 0:ri[qi]))!==null&&Bi!==void 0?Bi:Mi},[qi]),R=(0,F.useCallback)(ke||function(ri){return ri},[ke]);function V(ri,Mi,Bi){ul===ri&&(Mi===void 0||Mi===Oa)||(Cu(ri),Bi||(pu(ri<Ie.length-1),So==null||So(ri)),Mi!==void 0&&Qa(Mi))}function at(ri,Mi){Cs(Mi.clientWidth)}function dt(ri,Mi){io(function(Bi){var Li=new Map(Bi);return Mi===null?Li.delete(ri):Li.set(ri,Mi),Li})}function Dt(ri,Mi){va(Mi),gs(Ks)}function _t(ri,Mi){Ia(Mi)}function Xt(ri){return Qr.get(Es(Qs[ri],ri))}zt(function(){if(ys&&typeof Xu=="number"&&Qs){var ri=ks,Mi=Qs.length,Bi=Mi-1;if(!Mi){V(0,null);return}for(var Li=0;Li<Mi;Li+=1){var Ni=Xt(Li);if(go&&(Ni=Ni||0),Ni===void 0){V(Li-1,void 0,!0);break}if(ri+=Ni,Bi===0&&ri<=ys||Li===Bi-1&&ri+Xt(Bi)<=ys){V(Bi,null);break}else if(ri+Xu>ys){V(Li-1,ri-Ni-ks+Ks);break}}cr&&Xt(0)+ks>ys&&Qa(null)}},[ys,Qr,Ks,ks,Es,Qs]);var Ne=du&&!!Il.length,Xe={};Oa!==null&&ya&&(Xe={position:"absolute",left:Oa,top:0});var ze={prefixCls:yl,responsive:ya,component:Qi,invalidate:ju},Qe=Ri?function(ri,Mi){var Bi=Es(ri,Mi);return F.createElement(Sn.Provider,{key:Bi,value:(0,vt.Z)((0,vt.Z)({},ze),{},{order:Mi,item:ri,itemKey:Bi,registerSize:dt,display:Mi<=To})},Ri(ri,Mi))}:function(ri,Mi){var Bi=Es(ri,Mi);return F.createElement(Wt,(0,Nt.Z)({},ze,{order:Mi,key:Bi,item:ri,renderItem:R,itemKey:Bi,registerSize:dt,display:Mi<=To}))},Be,xi={order:Ne?To:Number.MAX_SAFE_INTEGER,className:"".concat(yl,"-rest"),registerSize:Dt,display:Ne};if(Ln)Ln&&(Be=F.createElement(Sn.Provider,{value:(0,vt.Z)((0,vt.Z)({},ze),xi)},Ln(Il)));else{var Oe=Wn||Wi;Be=F.createElement(Wt,(0,Nt.Z)({},ze,xi),typeof Oe=="function"?Oe(Il):Oe)}var wi=F.createElement(xn,(0,Nt.Z)({className:ot()(!ju&&Ft,$n),style:Dn,ref:ht},jo),Qs.map(Qe),hl?Be:null,cr&&F.createElement(Wt,(0,Nt.Z)({},ze,{responsive:ru,responsiveDisabled:!ya,order:To,className:"".concat(yl,"-suffix"),registerSize:_t,display:!0,style:Xe}),cr));return ru&&(wi=F.createElement(ee.Z,{onResize:at,disabled:!ya},wi)),wi}var an=F.forwardRef(En);an.displayName="Overflow",an.Item=hi,an.RESPONSIVE=Ye,an.INVALIDATE=Ae;var vi=an,ai=vi,zi=j(21770),$i=j(80334),q=j(91881),D=F.createContext(null);function _(Z,ht){return Z===void 0?null:"".concat(Z,"-").concat(ht)}function K(Z){var ht=F.useContext(D);return _(ht,Z)}var z=j(56982),P=["children","locked"],bt=F.createContext(null);function Gt(Z,ht){var wt=(0,vt.Z)({},Z);return Object.keys(ht).forEach(function(Ft){var Ut=ht[Ft];Ut!==void 0&&(wt[Ft]=Ut)}),wt}function Pe(Z){var ht=Z.children,wt=Z.locked,Ft=(0,ft.Z)(Z,P),Ut=F.useContext(bt),Ie=(0,z.Z)(function(){return Gt(Ut,Ft)},[Ut,Ft],function(ke,Ri){return!wt&&(ke[0]!==Ri[0]||!(0,q.Z)(ke[1],Ri[1],!0))});return F.createElement(bt.Provider,{value:Ie},ht)}var He=[],ei=F.createContext(null);function si(){return F.useContext(ei)}var Gi=F.createContext(He);function er(Z){var ht=F.useContext(Gi);return F.useMemo(function(){return Z!==void 0?[].concat((0,Et.Z)(ht),[Z]):ht},[ht,Z])}var rr=F.createContext(null),Se=F.createContext({}),We=Se,Go=j(15105),$o=j(75164),yo=function(Z){if(!Z)return!1;if(Z instanceof Element){if(Z.offsetParent)return!0;if(Z.getBBox){var ht=Z.getBBox(),wt=ht.width,Ft=ht.height;if(wt||Ft)return!0}if(Z.getBoundingClientRect){var Ut=Z.getBoundingClientRect(),Ie=Ut.width,ke=Ut.height;if(Ie||ke)return!0}}return!1};function Fr(Z){var ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(yo(Z)){var wt=Z.nodeName.toLowerCase(),Ft=["input","select","textarea","button"].includes(wt)||Z.isContentEditable||wt==="a"&&!!Z.getAttribute("href"),Ut=Z.getAttribute("tabindex"),Ie=Number(Ut),ke=null;return Ut&&!Number.isNaN(Ie)?ke=Ie:Ft&&ke===null&&(ke=0),Ft&&Z.disabled&&(ke=null),ke!==null&&(ke>=0||ht&&ke<0)}return!1}function Ro(Z){var ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,wt=(0,Et.Z)(Z.querySelectorAll("*")).filter(function(Ft){return Fr(Ft,ht)});return Fr(Z,ht)&&wt.unshift(Z),wt}var uo=null;function Ao(){uo=document.activeElement}function fs(){uo=null}function Ya(){if(uo)try{uo.focus()}catch(Z){}}function Ja(Z,ht){if(ht.keyCode===9){var wt=Ro(Z),Ft=wt[ht.shiftKey?0:wt.length-1],Ut=Ft===document.activeElement||Z===document.activeElement;if(Ut){var Ie=wt[ht.shiftKey?wt.length-1:0];Ie.focus(),ht.preventDefault()}}}var jl=Go.Z.LEFT,Na=Go.Z.RIGHT,xo=Go.Z.UP,rl=Go.Z.DOWN,Va=Go.Z.ENTER,Kl=Go.Z.ESC,ga=Go.Z.HOME,Xs=Go.Z.END,Me=[xo,rl,jl,Na];function L(Z,ht,wt,Ft){var Ut,Ie,ke,Ri,qi="prev",fn="next",Ar="children",qn="parent";if(Z==="inline"&&Ft===Va)return{inlineTrigger:!0};var Dn=(Ut={},(0,At.Z)(Ut,xo,qi),(0,At.Z)(Ut,rl,fn),Ut),$n=(Ie={},(0,At.Z)(Ie,jl,wt?fn:qi),(0,At.Z)(Ie,Na,wt?qi:fn),(0,At.Z)(Ie,rl,Ar),(0,At.Z)(Ie,Va,Ar),Ie),Di=(ke={},(0,At.Z)(ke,xo,qi),(0,At.Z)(ke,rl,fn),(0,At.Z)(ke,Va,Ar),(0,At.Z)(ke,Kl,qn),(0,At.Z)(ke,jl,wt?Ar:qn),(0,At.Z)(ke,Na,wt?qn:Ar),ke),Wn={inline:Dn,horizontal:$n,vertical:Di,inlineSub:Dn,horizontalSub:Di,verticalSub:Di},Ln=(Ri=Wn["".concat(Z).concat(ht?"":"Sub")])===null||Ri===void 0?void 0:Ri[Ft];switch(Ln){case qi:return{offset:-1,sibling:!0};case fn:return{offset:1,sibling:!0};case qn:return{offset:-1,sibling:!1};case Ar:return{offset:1,sibling:!1};default:return null}}function yi(Z){for(var ht=Z;ht;){if(ht.getAttribute("data-menu-list"))return ht;ht=ht.parentElement}return null}function qe(Z,ht){for(var wt=Z||document.activeElement;wt;){if(ht.has(wt))return wt;wt=wt.parentElement}return null}function Si(Z,ht){var wt=Ro(Z,!0);return wt.filter(function(Ft){return ht.has(Ft)})}function Vi(Z,ht,wt){var Ft=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Z)return null;var Ut=Si(Z,ht),Ie=Ut.length,ke=Ut.findIndex(function(Ri){return wt===Ri});return Ft<0?ke===-1?ke=Ie-1:ke-=1:Ft>0&&(ke+=1),ke=(ke+Ie)%Ie,Ut[ke]}function ln(Z,ht,wt,Ft,Ut,Ie,ke,Ri,qi,fn){var Ar=F.useRef(),qn=F.useRef();qn.current=ht;var Dn=function(){$o.Z.cancel(Ar.current)};return F.useEffect(function(){return function(){Dn()}},[]),function($n){var Di=$n.which;if([].concat(Me,[Va,Kl,ga,Xs]).includes(Di)){var Wn,Ln,cr,wr=function(){Wn=new Set,Ln=new Map,cr=new Map;var Cr=Ie();return Cr.forEach(function(Qr){var io=document.querySelector("[data-menu-id='".concat(_(Ft,Qr),"']"));io&&(Wn.add(io),cr.set(io,Qr),Ln.set(Qr,io))}),Wn};wr();var xn=Ln.get(ht),Qi=qe(xn,Wn),So=cr.get(Qi),jo=L(Z,ke(So,!0).length===1,wt,Di);if(!jo&&Di!==ga&&Di!==Xs)return;(Me.includes(Di)||[ga,Xs].includes(Di))&&$n.preventDefault();var go=function(Cr){if(Cr){var Qr=Cr,io=Cr.querySelector("a");io!=null&&io.getAttribute("href")&&(Qr=io);var Ps=cr.get(Cr);Ri(Ps),Dn(),Ar.current=(0,$o.Z)(function(){qn.current===Ps&&Qr.focus()})}};if([ga,Xs].includes(Di)||jo.sibling||!Qi){var Ko;!Qi||Z==="inline"?Ko=Ut.current:Ko=yi(Qi);var Zr,zo=Si(Ko,Wn);Di===ga?Zr=zo[0]:Di===Xs?Zr=zo[zo.length-1]:Zr=Vi(Ko,Wn,Qi,jo.offset),go(Zr)}else if(jo.inlineTrigger)qi(So);else if(jo.offset>0)qi(So,!0),Dn(),Ar.current=(0,$o.Z)(function(){wr();var pa=Qi.getAttribute("aria-controls"),Cr=document.getElementById(pa),Qr=Vi(Cr,Wn);go(Qr)},5);else if(jo.offset<0){var da=ke(So,!0),Cs=da[da.length-2],ys=Ln.get(Cs);qi(Cs,!1),go(ys)}}fn==null||fn($n)}}function fr(Z){Promise.resolve().then(Z)}var no="__RC_UTIL_PATH_SPLIT__",wo=function(ht){return ht.join(no)},ro=function(ht){return ht.split(no)},li="rc-menu-more";function St(){var Z=F.useState({}),ht=(0,gt.Z)(Z,2),wt=ht[1],Ft=(0,F.useRef)(new Map),Ut=(0,F.useRef)(new Map),Ie=F.useState([]),ke=(0,gt.Z)(Ie,2),Ri=ke[0],qi=ke[1],fn=(0,F.useRef)(0),Ar=(0,F.useRef)(!1),qn=function(){Ar.current||wt({})},Dn=(0,F.useCallback)(function(xn,Qi){var So=wo(Qi);Ut.current.set(So,xn),Ft.current.set(xn,So),fn.current+=1;var jo=fn.current;fr(function(){jo===fn.current&&qn()})},[]),$n=(0,F.useCallback)(function(xn,Qi){var So=wo(Qi);Ut.current.delete(So),Ft.current.delete(xn)},[]),Di=(0,F.useCallback)(function(xn){qi(xn)},[]),Wn=(0,F.useCallback)(function(xn,Qi){var So=Ft.current.get(xn)||"",jo=ro(So);return Qi&&Ri.includes(jo[0])&&jo.unshift(li),jo},[Ri]),Ln=(0,F.useCallback)(function(xn,Qi){return xn.some(function(So){var jo=Wn(So,!0);return jo.includes(Qi)})},[Wn]),cr=function(){var Qi=(0,Et.Z)(Ft.current.keys());return Ri.length&&Qi.push(li),Qi},wr=(0,F.useCallback)(function(xn){var Qi="".concat(Ft.current.get(xn)).concat(no),So=new Set;return(0,Et.Z)(Ut.current.keys()).forEach(function(jo){jo.startsWith(Qi)&&So.add(Ut.current.get(jo))}),So},[]);return F.useEffect(function(){return function(){Ar.current=!0}},[]),{registerPath:Dn,unregisterPath:$n,refreshOverflowKeys:Di,isSubPathKey:Ln,getKeyPath:Wn,getKeys:cr,getSubPathKeys:wr}}function $t(Z){var ht=F.useRef(Z);ht.current=Z;var wt=F.useCallback(function(){for(var Ft,Ut=arguments.length,Ie=new Array(Ut),ke=0;ke<Ut;ke++)Ie[ke]=arguments[ke];return(Ft=ht.current)===null||Ft===void 0?void 0:Ft.call.apply(Ft,[ht].concat(Ie))},[]);return Z?wt:void 0}var xe=Math.random().toFixed(5).toString().slice(2),Ue=0;function Kt(Z){var ht=(0,zi.Z)(Z,{value:Z}),wt=(0,gt.Z)(ht,2),Ft=wt[0],Ut=wt[1];return F.useEffect(function(){Ue+=1;var Ie="".concat(xe,"-").concat(Ue);Ut("rc-menu-uuid-".concat(Ie))},[]),Ft}var yt=j(15671),me=j(43144),Ce=j(60136),we=j(51630),Mt=j(98423),ie=j(42550);function Re(Z,ht,wt,Ft){var Ut=F.useContext(bt),Ie=Ut.activeKey,ke=Ut.onActive,Ri=Ut.onInactive,qi={active:Ie===Z};return ht||(qi.onMouseEnter=function(fn){wt==null||wt({key:Z,domEvent:fn}),ke(Z)},qi.onMouseLeave=function(fn){Ft==null||Ft({key:Z,domEvent:fn}),Ri(Z)}),qi}function _i(Z){var ht=F.useContext(bt),wt=ht.mode,Ft=ht.rtl,Ut=ht.inlineIndent;if(wt!=="inline")return null;var Ie=Z;return Ft?{paddingRight:Ie*Ut}:{paddingLeft:Ie*Ut}}function Qt(Z){var ht=Z.icon,wt=Z.props,Ft=Z.children,Ut;return ht===null||ht===!1?null:(typeof ht=="function"?Ut=F.createElement(ht,(0,vt.Z)({},wt)):typeof ht!="boolean"&&(Ut=ht),Ut||Ft||null)}var ui=["item"];function vr(Z){var ht=Z.item,wt=(0,ft.Z)(Z,ui);return Object.defineProperty(wt,"item",{get:function(){return(0,$i.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),ht}}),wt}var Mr=["title","attribute","elementRef"],Lr=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],gi=["active"],Ji=function(Z){(0,Ce.Z)(wt,Z);var ht=(0,we.Z)(wt);function wt(){return(0,yt.Z)(this,wt),ht.apply(this,arguments)}return(0,me.Z)(wt,[{key:"render",value:function(){var Ut=this.props,Ie=Ut.title,ke=Ut.attribute,Ri=Ut.elementRef,qi=(0,ft.Z)(Ut,Mr),fn=(0,Mt.Z)(qi,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,$i.ZP)(!ke,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),F.createElement(ai.Item,(0,Nt.Z)({},ke,{title:typeof Ie=="string"?Ie:void 0},fn,{ref:Ri}))}}]),wt}(F.Component),Xi=F.forwardRef(function(Z,ht){var wt,Ft=Z.style,Ut=Z.className,Ie=Z.eventKey,ke=Z.warnKey,Ri=Z.disabled,qi=Z.itemIcon,fn=Z.children,Ar=Z.role,qn=Z.onMouseEnter,Dn=Z.onMouseLeave,$n=Z.onClick,Di=Z.onKeyDown,Wn=Z.onFocus,Ln=(0,ft.Z)(Z,Lr),cr=K(Ie),wr=F.useContext(bt),xn=wr.prefixCls,Qi=wr.onItemClick,So=wr.disabled,jo=wr.overflowDisabled,go=wr.itemIcon,Ko=wr.selectedKeys,Zr=wr.onActive,zo=F.useContext(We),da=zo._internalRenderMenuItem,Cs="".concat(xn,"-item"),ys=F.useRef(),pa=F.useRef(),Cr=So||Ri,Qr=(0,ie.x1)(ht,pa),io=er(Ie),Ps=function(ja){return{key:Ie,keyPath:(0,Et.Z)(io).reverse(),item:ys.current,domEvent:ja}},xs=qi||go,Ns=Re(Ie,Cr,qn,Dn),gs=Ns.active,la=(0,ft.Z)(Ns,gi),Da=Ko.includes(Ie),Ks=_i(io.length),va=function(ja){if(!Cr){var Oa=Ps(ja);$n==null||$n(vr(Oa)),Qi(Oa)}},oo=function(ja){if(Di==null||Di(ja),ja.which===Go.Z.ENTER){var Oa=Ps(ja);$n==null||$n(vr(Oa)),Qi(Oa)}},vs=function(ja){Zr(Ie),Wn==null||Wn(ja)},ks={};Z.role==="option"&&(ks["aria-selected"]=Da);var Ia=F.createElement(Ji,(0,Nt.Z)({ref:ys,elementRef:Qr,role:Ar===null?"none":Ar||"menuitem",tabIndex:Ri?null:-1,"data-menu-id":jo&&cr?null:cr},Ln,la,ks,{component:"li","aria-disabled":Ri,style:(0,vt.Z)((0,vt.Z)({},Ks),Ft),className:ot()(Cs,(wt={},(0,At.Z)(wt,"".concat(Cs,"-active"),gs),(0,At.Z)(wt,"".concat(Cs,"-selected"),Da),(0,At.Z)(wt,"".concat(Cs,"-disabled"),Cr),wt),Ut),onClick:va,onKeyDown:oo,onFocus:vs}),fn,F.createElement(Qt,{props:(0,vt.Z)((0,vt.Z)({},Z),{},{isSelected:Da}),icon:xs}));return da&&(Ia=da(Ia,Z,{selected:Da})),Ia});function zr(Z,ht){var wt=Z.eventKey,Ft=si(),Ut=er(wt);return F.useEffect(function(){if(Ft)return Ft.registerPath(wt,Ut),function(){Ft.unregisterPath(wt,Ut)}},[Ut]),Ft?null:F.createElement(Xi,(0,Nt.Z)({},Z,{ref:ht}))}var ho=F.forwardRef(zr),Tn=["className","children"],Pi=function(ht,wt){var Ft=ht.className,Ut=ht.children,Ie=(0,ft.Z)(ht,Tn),ke=F.useContext(bt),Ri=ke.prefixCls,qi=ke.mode,fn=ke.rtl;return F.createElement("ul",(0,Nt.Z)({className:ot()(Ri,fn&&"".concat(Ri,"-rtl"),"".concat(Ri,"-sub"),"".concat(Ri,"-").concat(qi==="inline"?"inline":"vertical"),Ft),role:"menu"},Ie,{"data-menu-list":!0,ref:wt}),Ut)},os=F.forwardRef(Pi);os.displayName="SubMenuList";var qr=os,bo=j(50344);function he(Z,ht){return(0,bo.Z)(Z).map(function(wt,Ft){if(F.isValidElement(wt)){var Ut,Ie,ke=wt.key,Ri=(Ut=(Ie=wt.props)===null||Ie===void 0?void 0:Ie.eventKey)!==null&&Ut!==void 0?Ut:ke,qi=Ri==null;qi&&(Ri="tmp_key-".concat([].concat((0,Et.Z)(ht),[Ft]).join("-")));var fn={key:Ri,eventKey:Ri};return F.cloneElement(wt,fn)}return wt})}function ss(Z){"@babel/helpers - typeof";return ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ht){return typeof ht}:function(ht){return ht&&typeof Symbol=="function"&&ht.constructor===Symbol&&ht!==Symbol.prototype?"symbol":typeof ht},ss(Z)}function Aa(Z,ht){if(ss(Z)!="object"||!Z)return Z;var wt=Z[Symbol.toPrimitive];if(wt!==void 0){var Ft=wt.call(Z,ht||"default");if(ss(Ft)!="object")return Ft;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ht==="string"?String:Number)(Z)}function Bo(Z){var ht=Aa(Z,"string");return ss(ht)=="symbol"?ht:ht+""}function Ma(Z,ht,wt){return(ht=Bo(ht))in Z?Object.defineProperty(Z,ht,{value:wt,enumerable:!0,configurable:!0,writable:!0}):Z[ht]=wt,Z}function Lo(Z,ht){var wt=Object.keys(Z);if(Object.getOwnPropertySymbols){var Ft=Object.getOwnPropertySymbols(Z);ht&&(Ft=Ft.filter(function(Ut){return Object.getOwnPropertyDescriptor(Z,Ut).enumerable})),wt.push.apply(wt,Ft)}return wt}function Tr(Z){for(var ht=1;ht<arguments.length;ht++){var wt=arguments[ht]!=null?arguments[ht]:{};ht%2?Lo(Object(wt),!0).forEach(function(Ft){Ma(Z,Ft,wt[Ft])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(wt)):Lo(Object(wt)).forEach(function(Ft){Object.defineProperty(Z,Ft,Object.getOwnPropertyDescriptor(wt,Ft))})}return Z}function yr(Z){if(Array.isArray(Z))return Z}function $r(Z,ht){var wt=Z==null?null:typeof Symbol!="undefined"&&Z[Symbol.iterator]||Z["@@iterator"];if(wt!=null){var Ft,Ut,Ie,ke,Ri=[],qi=!0,fn=!1;try{if(Ie=(wt=wt.call(Z)).next,ht===0){if(Object(wt)!==wt)return;qi=!1}else for(;!(qi=(Ft=Ie.call(wt)).done)&&(Ri.push(Ft.value),Ri.length!==ht);qi=!0);}catch(Ar){fn=!0,Ut=Ar}finally{try{if(!qi&&wt.return!=null&&(ke=wt.return(),Object(ke)!==ke))return}finally{if(fn)throw Ut}}return Ri}}function dr(Z,ht){(ht==null||ht>Z.length)&&(ht=Z.length);for(var wt=0,Ft=Array(ht);wt<ht;wt++)Ft[wt]=Z[wt];return Ft}function ue(Z,ht){if(Z){if(typeof Z=="string")return dr(Z,ht);var wt={}.toString.call(Z).slice(8,-1);return wt==="Object"&&Z.constructor&&(wt=Z.constructor.name),wt==="Map"||wt==="Set"?Array.from(Z):wt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(wt)?dr(Z,ht):void 0}}function Wo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function te(Z,ht){return yr(Z)||$r(Z,ht)||ue(Z,ht)||Wo()}function Do(Z,ht){if(Z==null)return{};var wt={};for(var Ft in Z)if({}.hasOwnProperty.call(Z,Ft)){if(ht.includes(Ft))continue;wt[Ft]=Z[Ft]}return wt}function Co(Z,ht){if(Z==null)return{};var wt,Ft,Ut=Do(Z,ht);if(Object.getOwnPropertySymbols){var Ie=Object.getOwnPropertySymbols(Z);for(Ft=0;Ft<Ie.length;Ft++)wt=Ie[Ft],ht.includes(wt)||{}.propertyIsEnumerable.call(Z,wt)&&(Ut[wt]=Z[wt])}return Ut}var Io=j(98924),ea=F.createContext(null),Nr=ea,Xn=j(8410),fo=[];function Ys(Z,ht){var wt=F.useState(function(){if(!(0,Io.Z)())return null;var Di=document.createElement("div");return Di}),Ft=(0,gt.Z)(wt,1),Ut=Ft[0],Ie=F.useRef(!1),ke=F.useContext(Nr),Ri=F.useState(fo),qi=(0,gt.Z)(Ri,2),fn=qi[0],Ar=qi[1],qn=ke||(Ie.current?void 0:function(Di){Ar(function(Wn){var Ln=[Di].concat((0,Et.Z)(Wn));return Ln})});function Dn(){Ut.parentElement||document.body.appendChild(Ut),Ie.current=!0}function $n(){var Di;(Di=Ut.parentElement)===null||Di===void 0||Di.removeChild(Ut),Ie.current=!1}return(0,Xn.Z)(function(){return Z?ke?ke(Dn):Dn():$n(),$n},[Z]),(0,Xn.Z)(function(){fn.length&&(fn.forEach(function(Di){return Di()}),Ar(fo))},[fn]),[Ut,qn]}var Xo=j(48981),ci=j(74204);function G(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var Wa="rc-util-locker-".concat(Date.now()),zs=0;function Fa(Z){var ht=!!Z,wt=F.useState(function(){return zs+=1,"".concat(Wa,"_").concat(zs)}),Ft=(0,gt.Z)(wt,1),Ut=Ft[0];(0,Xn.Z)(function(){if(ht){var Ie=(0,ci.o)(document.body).width,ke=G();(0,Xo.hq)(`
|
|
|
html body {
|
|
|
overflow-y: hidden;
|
|
|
`.concat(ke?"width: calc(100% - ".concat(Ie,"px);"):"",`
|
|
|
}`),Ut)}else(0,Xo.jL)(Ut);return function(){(0,Xo.jL)(Ut)}},[ht,Ut])}var ia=!1;function iu(Z){return typeof Z=="boolean"&&(ia=Z),ia}var Pu=function(ht){return ht===!1?!1:!(0,Io.Z)()||!ht?null:typeof ht=="string"?document.querySelector(ht):typeof ht=="function"?ht():ht},Th=F.forwardRef(function(Z,ht){var wt=Z.open,Ft=Z.autoLock,Ut=Z.getContainer,Ie=Z.debug,ke=Z.autoDestroy,Ri=ke===void 0?!0:ke,qi=Z.children,fn=F.useState(wt),Ar=(0,gt.Z)(fn,2),qn=Ar[0],Dn=Ar[1],$n=qn||wt;F.useEffect(function(){(Ri||wt)&&Dn(wt)},[wt,Ri]);var Di=F.useState(function(){return Pu(Ut)}),Wn=(0,gt.Z)(Di,2),Ln=Wn[0],cr=Wn[1];F.useEffect(function(){var Cs=Pu(Ut);cr(Cs!=null?Cs:null)});var wr=Ys($n&&!Ln,Ie),xn=(0,gt.Z)(wr,2),Qi=xn[0],So=xn[1],jo=Ln!=null?Ln:Qi;Fa(Ft&&wt&&(0,Io.Z)()&&(jo===Qi||jo===document.body));var go=null;if(qi&&(0,ie.Yr)(qi)&&ht){var Ko=qi;go=Ko.ref}var Zr=(0,ie.x1)(go,ht);if(!$n||!(0,Io.Z)()||Ln===void 0)return null;var zo=jo===!1||iu(),da=qi;return ht&&(da=F.cloneElement(qi,{ref:Zr})),F.createElement(Nr.Provider,{value:So},zo?da:(0,it.createPortal)(da,jo))}),rt=Th,ut=rt;function re(Z){return Z instanceof HTMLElement||Z instanceof SVGElement}function be(Z){return Z&&_typeof(Z)==="object"&&re(Z.nativeElement)?Z.nativeElement:re(Z)?Z:null}function Ge(Z){var ht=be(Z);if(ht)return ht;if(Z instanceof React.Component){var wt;return(wt=ReactDOM.findDOMNode)===null||wt===void 0?void 0:wt.call(ReactDOM,Z)}return null}function ni(Z){var ht;return Z==null||(ht=Z.getRootNode)===null||ht===void 0?void 0:ht.call(Z)}function fe(Z){return ni(Z)instanceof ShadowRoot}function un(Z){return fe(Z)?ni(Z):null}function An(Z){var ht=F.useRef();ht.current=Z;var wt=F.useCallback(function(){for(var Ft,Ut=arguments.length,Ie=new Array(Ut),ke=0;ke<Ut;ke++)Ie[ke]=arguments[ke];return(Ft=ht.current)===null||Ft===void 0?void 0:Ft.call.apply(Ft,[ht].concat(Ie))},[]);return wt}function xr(Z){if(Array.isArray(Z))return Z}function Ur(Z,ht){var wt=Z==null?null:typeof Symbol!="undefined"&&Z[Symbol.iterator]||Z["@@iterator"];if(wt!=null){var Ft,Ut,Ie,ke,Ri=[],qi=!0,fn=!1;try{if(Ie=(wt=wt.call(Z)).next,ht===0){if(Object(wt)!==wt)return;qi=!1}else for(;!(qi=(Ft=Ie.call(wt)).done)&&(Ri.push(Ft.value),Ri.length!==ht);qi=!0);}catch(Ar){fn=!0,Ut=Ar}finally{try{if(!qi&&wt.return!=null&&(ke=wt.return(),Object(ke)!==ke))return}finally{if(fn)throw Ut}}return Ri}}function Zn(Z,ht){(ht==null||ht>Z.length)&&(ht=Z.length);for(var wt=0,Ft=new Array(ht);wt<ht;wt++)Ft[wt]=Z[wt];return Ft}function ko(Z,ht){if(Z){if(typeof Z=="string")return Zn(Z,ht);var wt=Object.prototype.toString.call(Z).slice(8,-1);if(wt==="Object"&&Z.constructor&&(wt=Z.constructor.name),wt==="Map"||wt==="Set")return Array.from(Z);if(wt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(wt))return Zn(Z,ht)}}function Yo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(Z,ht){return xr(Z)||Ur(Z,ht)||ko(Z,ht)||Yo()}function Ms(Z){"@babel/helpers - typeof";return Ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ht){return typeof ht}:function(ht){return ht&&typeof Symbol=="function"&&ht.constructor===Symbol&&ht!==Symbol.prototype?"symbol":typeof ht},Ms(Z)}function na(Z,ht){if(Ms(Z)!=="object"||Z===null)return Z;var wt=Z[Symbol.toPrimitive];if(wt!==void 0){var Ft=wt.call(Z,ht||"default");if(Ms(Ft)!=="object")return Ft;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ht==="string"?String:Number)(Z)}function Tt(Z){var ht=na(Z,"string");return Ms(ht)==="symbol"?ht:String(ht)}function yn(Z,ht,wt){return ht=Tt(ht),ht in Z?Object.defineProperty(Z,ht,{value:wt,enumerable:!0,configurable:!0,writable:!0}):Z[ht]=wt,Z}function Yn(Z,ht){var wt=Object.keys(Z);if(Object.getOwnPropertySymbols){var Ft=Object.getOwnPropertySymbols(Z);ht&&(Ft=Ft.filter(function(Ut){return Object.getOwnPropertyDescriptor(Z,Ut).enumerable})),wt.push.apply(wt,Ft)}return wt}function Ir(Z){for(var ht=1;ht<arguments.length;ht++){var wt=arguments[ht]!=null?arguments[ht]:{};ht%2?Yn(Object(wt),!0).forEach(function(Ft){yn(Z,Ft,wt[Ft])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Z,Object.getOwnPropertyDescriptors(wt)):Yn(Object(wt)).forEach(function(Ft){Object.defineProperty(Z,Ft,Object.getOwnPropertyDescriptor(wt,Ft))})}return Z}function ls(){var Z=Ir({},Y);return Z.useId}var Jo=0;function ra(){}var $s=ls(),or=$s?function(ht){var wt=$s();return ht||wt}:function(ht){var wt=F.useState("ssr-id"),Ft=Oo(wt,2),Ut=Ft[0],Ie=Ft[1];return F.useEffect(function(){var ke=Jo;Jo+=1,Ie("rc_unique_".concat(ke))},[]),ht||Ut};function eo(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Fn=eo()?F.useLayoutEffect:F.useEffect,hn=function(ht,wt){var Ft=F.useRef(!0);Fn(function(){return ht(Ft.current)},wt),Fn(function(){return Ft.current=!1,function(){Ft.current=!0}},[])},_r=function(ht,wt){hn(function(Ft){if(!Ft)return ht()},wt)},Or=hn,Ai=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Z=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Z)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Z==null?void 0:Z.substr(0,4))};function kl(){return kl=Object.assign?Object.assign.bind():function(Z){for(var ht=1;ht<arguments.length;ht++){var wt=arguments[ht];for(var Ft in wt)({}).hasOwnProperty.call(wt,Ft)&&(Z[Ft]=wt[Ft])}return Z},kl.apply(null,arguments)}var El=j(62874),Ua=j(8399);function Sl(Z,ht,wt){var Ft=F.useRef({});return(!("value"in Ft.current)||wt(Ft.current.condition,ht))&&(Ft.current.value=Z(),Ft.current.condition=ht),Ft.current.value}var xu=Symbol.for("react.element"),di=Symbol.for("react.transitional.element"),jr=Symbol.for("react.fragment");function Fo(Z){return Z&&Ms(Z)==="object"&&(Z.$$typeof===xu||Z.$$typeof===di)&&Z.type===jr}var Ca=function(ht,wt){typeof ht=="function"?ht(wt):Ms(ht)==="object"&&ht&&"current"in ht&&(ht.current=wt)},Ll=function(){for(var ht=arguments.length,wt=new Array(ht),Ft=0;Ft<ht;Ft++)wt[Ft]=arguments[Ft];var Ut=wt.filter(Boolean);return Ut.length<=1?Ut[0]:function(Ie){wt.forEach(function(ke){Ca(ke,Ie)})}},ol=function(){for(var ht=arguments.length,wt=new Array(ht),Ft=0;Ft<ht;Ft++)wt[Ft]=arguments[Ft];return Sl(function(){return Ll.apply(void 0,wt)},wt,function(Ut,Ie){return Ut.length!==Ie.length||Ut.every(function(ke,Ri){return ke!==Ie[Ri]})})},_n=function(ht){var wt,Ft;if(!ht)return!1;if(Za(ht)&&ht.props.propertyIsEnumerable("ref"))return!0;var Ut=(0,Ua.isMemo)(ht)?ht.type.type:ht.type;return!(typeof Ut=="function"&&!((wt=Ut.prototype)!==null&&wt!==void 0&&wt.render)&&Ut.$$typeof!==Ua.ForwardRef||typeof ht=="function"&&!((Ft=ht.prototype)!==null&&Ft!==void 0&&Ft.render)&&ht.$$typeof!==Ua.ForwardRef)};function Za(Z){return(0,F.isValidElement)(Z)&&!Fo(Z)}var nu=function(ht){return Za(ht)&&_n(ht)},Tl=function(ht){if(ht&&Za(ht)){var wt=ht;return wt.props.propertyIsEnumerable("ref")?wt.props.ref:wt.ref}return null};function uu(Z){var ht=Z.prefixCls,wt=Z.align,Ft=Z.arrow,Ut=Z.arrowPos,Ie=Ft||{},ke=Ie.className,Ri=Ie.content,qi=Ut.x,fn=qi===void 0?0:qi,Ar=Ut.y,qn=Ar===void 0?0:Ar,Dn=F.useRef();if(!wt||!wt.points)return null;var $n={position:"absolute"};if(wt.autoArrow!==!1){var Di=wt.points[0],Wn=wt.points[1],Ln=Di[0],cr=Di[1],wr=Wn[0],xn=Wn[1];Ln===wr||!["t","b"].includes(Ln)?$n.top=qn:Ln==="t"?$n.top=0:$n.bottom=0,cr===xn||!["l","r"].includes(cr)?$n.left=fn:cr==="l"?$n.left=0:$n.right=0}return F.createElement("div",{ref:Dn,className:ot()("".concat(ht,"-arrow"),ke),style:$n},Ri)}function _h(Z){var ht=Z.prefixCls,wt=Z.open,Ft=Z.zIndex,Ut=Z.mask,Ie=Z.motion;return Ut?F.createElement(El.Z,kl({},Ie,{motionAppear:!0,visible:wt,removeOnLeave:!0}),function(ke){var Ri=ke.className;return F.createElement("div",{style:{zIndex:Ft},className:ot()("".concat(ht,"-mask"),Ri)})}):null}var hu=F.memo(function(Z){var ht=Z.children;return ht},function(Z,ht){return ht.cache}),ml=hu,sl=F.forwardRef(function(Z,ht){var wt=Z.popup,Ft=Z.className,Ut=Z.prefixCls,Ie=Z.style,ke=Z.target,Ri=Z.onVisibleChanged,qi=Z.open,fn=Z.keepDom,Ar=Z.fresh,qn=Z.onClick,Dn=Z.mask,$n=Z.arrow,Di=Z.arrowPos,Wn=Z.align,Ln=Z.motion,cr=Z.maskMotion,wr=Z.forceRender,xn=Z.getPopupContainer,Qi=Z.autoDestroy,So=Z.portal,jo=Z.zIndex,go=Z.onMouseEnter,Ko=Z.onMouseLeave,Zr=Z.onPointerEnter,zo=Z.ready,da=Z.offsetX,Cs=Z.offsetY,ys=Z.offsetR,pa=Z.offsetB,Cr=Z.onAlign,Qr=Z.onPrepare,io=Z.stretch,Ps=Z.targetWidth,xs=Z.targetHeight,Ns=typeof wt=="function"?wt():wt,gs=qi||fn,la=(xn==null?void 0:xn.length)>0,Da=F.useState(!xn||!la),Ks=te(Da,2),va=Ks[0],oo=Ks[1];if(Or(function(){!va&&la&&ke&&oo(!0)},[va,la,ke]),!va)return null;var vs="auto",ks={left:"-1000vw",top:"-1000vh",right:vs,bottom:vs};if(zo||!qi){var Ia,ll=Wn.points,ja=Wn.dynamicInset||((Ia=Wn._experimental)===null||Ia===void 0?void 0:Ia.dynamicInset),Oa=ja&&ll[0][1]==="r",Qa=ja&&ll[0][0]==="b";Oa?(ks.right=ys,ks.left=vs):(ks.left=da,ks.right=vs),Qa?(ks.bottom=pa,ks.top=vs):(ks.top=Cs,ks.bottom=vs)}var mr={};return io&&(io.includes("height")&&xs?mr.height=xs:io.includes("minHeight")&&xs&&(mr.minHeight=xs),io.includes("width")&&Ps?mr.width=Ps:io.includes("minWidth")&&Ps&&(mr.minWidth=Ps)),qi||(mr.pointerEvents="none"),F.createElement(So,{open:wr||gs,getContainer:xn&&function(){return xn(ke)},autoDestroy:Qi},F.createElement(_h,{prefixCls:Ut,open:qi,zIndex:jo,mask:Dn,motion:cr}),F.createElement(ee.Z,{onResize:Cr,disabled:!qi},function(Dl){return F.createElement(El.Z,kl({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:wr,leavedClassName:"".concat(Ut,"-hidden")},Ln,{onAppearPrepare:Qr,onEnterPrepare:Qr,visible:qi,onVisibleChanged:function(Cu){var To;Ln==null||(To=Ln.onVisibleChanged)===null||To===void 0||To.call(Ln,Cu),Ri(Cu)}}),function(ul,Cu){var To=ul.className,Au=ul.style,Ml=ot()(Ut,To,Ft);return F.createElement("div",{ref:Ll(Dl,ht,Cu),className:Ml,style:Tr(Tr(Tr(Tr({"--arrow-x":"".concat(Di.x||0,"px"),"--arrow-y":"".concat(Di.y||0,"px")},ks),mr),Au),{},{boxSizing:"border-box",zIndex:jo},Ie),onMouseEnter:go,onMouseLeave:Ko,onPointerEnter:Zr,onClick:qn},$n&&F.createElement(uu,{prefixCls:Ut,arrow:$n,arrowPos:Di,align:Wn}),F.createElement(ml,{cache:!qi&&!Ar},Ns))})}))}),Js=sl,$u=F.forwardRef(function(Z,ht){var wt=Z.children,Ft=Z.getTriggerDOMNode,Ut=_n(wt),Ie=F.useCallback(function(Ri){Ca(ht,Ft?Ft(Ri):Ri)},[Ft]),ke=ol(Ie,wt.ref);return Ut?F.cloneElement(wt,{ref:ke}):wt}),Nu=$u,df=F.createContext(null),jh=df;function cu(Z){return Z?Array.isArray(Z)?Z:[Z]:[]}function Zu(Z,ht,wt,Ft){return F.useMemo(function(){var Ut=cu(wt!=null?wt:ht),Ie=cu(Ft!=null?Ft:ht),ke=new Set(Ut),Ri=new Set(Ie);return Z&&(ke.has("hover")&&(ke.delete("hover"),ke.add("click")),Ri.has("hover")&&(Ri.delete("hover"),Ri.add("click"))),[ke,Ri]},[Z,ht,wt,Ft])}var js=function(Z){if(!Z)return!1;if(Z instanceof Element){if(Z.offsetParent)return!0;if(Z.getBBox){var ht=Z.getBBox(),wt=ht.width,Ft=ht.height;if(wt||Ft)return!0}if(Z.getBoundingClientRect){var Ut=Z.getBoundingClientRect(),Ie=Ut.width,ke=Ut.height;if(Ie||ke)return!0}}return!1};function gh(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],wt=arguments.length>2?arguments[2]:void 0;return wt?Z[0]===ht[0]:Z[0]===ht[0]&&Z[1]===ht[1]}function yc(Z,ht,wt,Ft){for(var Ut=wt.points,Ie=Object.keys(Z),ke=0;ke<Ie.length;ke+=1){var Ri,qi=Ie[ke];if(gh((Ri=Z[qi])===null||Ri===void 0?void 0:Ri.points,Ut,Ft))return"".concat(ht,"-placement-").concat(qi)}return""}function Gu(Z,ht,wt,Ft){return ht||(wt?{motionName:"".concat(Z,"-").concat(wt)}:Ft?{motionName:Ft}:null)}function ds(Z){return Z.ownerDocument.defaultView}function xc(Z){for(var ht=[],wt=Z==null?void 0:Z.parentElement,Ft=["hidden","scroll","clip","auto"];wt;){var Ut=ds(wt).getComputedStyle(wt),Ie=Ut.overflowX,ke=Ut.overflowY,Ri=Ut.overflow;[Ie,ke,Ri].some(function(qi){return Ft.includes(qi)})&&ht.push(wt),wt=wt.parentElement}return ht}function za(Z){var ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(Z)?ht:Z}function wu(Z){return za(parseFloat(Z),0)}function fu(Z,ht){var wt=Tr({},Z);return(ht||[]).forEach(function(Ft){if(!(Ft instanceof HTMLBodyElement||Ft instanceof HTMLHtmlElement)){var Ut=ds(Ft).getComputedStyle(Ft),Ie=Ut.overflow,ke=Ut.overflowClipMargin,Ri=Ut.borderTopWidth,qi=Ut.borderBottomWidth,fn=Ut.borderLeftWidth,Ar=Ut.borderRightWidth,qn=Ft.getBoundingClientRect(),Dn=Ft.offsetHeight,$n=Ft.clientHeight,Di=Ft.offsetWidth,Wn=Ft.clientWidth,Ln=wu(Ri),cr=wu(qi),wr=wu(fn),xn=wu(Ar),Qi=za(Math.round(qn.width/Di*1e3)/1e3),So=za(Math.round(qn.height/Dn*1e3)/1e3),jo=(Di-Wn-wr-xn)*Qi,go=(Dn-$n-Ln-cr)*So,Ko=Ln*So,Zr=cr*So,zo=wr*Qi,da=xn*Qi,Cs=0,ys=0;if(Ie==="clip"){var pa=wu(ke);Cs=pa*Qi,ys=pa*So}var Cr=qn.x+zo-Cs,Qr=qn.y+Ko-ys,io=Cr+qn.width+2*Cs-zo-da-jo,Ps=Qr+qn.height+2*ys-Ko-Zr-go;wt.left=Math.max(wt.left,Cr),wt.top=Math.max(wt.top,Qr),wt.right=Math.min(wt.right,io),wt.bottom=Math.min(wt.bottom,Ps)}}),wt}function al(Z){var ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,wt="".concat(ht),Ft=wt.match(/^(.*)\%$/);return Ft?Z*(parseFloat(Ft[1])/100):parseFloat(wt)}function gl(Z,ht){var wt=ht||[],Ft=te(wt,2),Ut=Ft[0],Ie=Ft[1];return[al(Z.width,Ut),al(Z.height,Ie)]}function qa(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[Z[0],Z[1]]}function ka(Z,ht){var wt=ht[0],Ft=ht[1],Ut,Ie;return wt==="t"?Ie=Z.y:wt==="b"?Ie=Z.y+Z.height:Ie=Z.y+Z.height/2,Ft==="l"?Ut=Z.x:Ft==="r"?Ut=Z.x+Z.width:Ut=Z.x+Z.width/2,{x:Ut,y:Ie}}function bu(Z,ht){var wt={t:"b",b:"t",l:"r",r:"l"};return Z.map(function(Ft,Ut){return Ut===ht?wt[Ft]||"c":Ft}).join("")}function rc(Z,ht,wt,Ft,Ut,Ie,ke){var Ri=F.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Ut[Ft]||{}}),qi=te(Ri,2),fn=qi[0],Ar=qi[1],qn=F.useRef(0),Dn=F.useMemo(function(){return ht?xc(ht):[]},[ht]),$n=F.useRef({}),Di=function(){$n.current={}};Z||Di();var Wn=An(function(){if(ht&&wt&&Z){let Ho=function(Eo,Rs){var Us=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Au,Vo=xs.x+Eo,ha=xs.y+Rs,Zs=Vo+ks,Vl=ha+vs,Ta=Math.max(Vo,Us.left),Xa=Math.max(ha,Us.top),Yu=Math.min(Zs,Us.right),Ts=Math.min(Vl,Us.bottom);return Math.max(0,(Yu-Ta)*(Ts-Xa))},La=function(){Xr=xs.y+xi,In=Xr+vs,nn=xs.x+Be,vo=nn+ks};var wr,xn,Qi=ht,So=Qi.ownerDocument,jo=ds(Qi),go=jo.getComputedStyle(Qi),Ko=go.width,Zr=go.height,zo=go.position,da=Qi.style.left,Cs=Qi.style.top,ys=Qi.style.right,pa=Qi.style.bottom,Cr=Tr(Tr({},Ut[Ft]),Ie),Qr=So.createElement("div");(wr=Qi.parentElement)===null||wr===void 0||wr.appendChild(Qr),Qr.style.left="".concat(Qi.offsetLeft,"px"),Qr.style.top="".concat(Qi.offsetTop,"px"),Qr.style.position=zo,Qr.style.height="".concat(Qi.offsetHeight,"px"),Qr.style.width="".concat(Qi.offsetWidth,"px"),Qi.style.left="0",Qi.style.top="0",Qi.style.right="auto",Qi.style.bottom="auto";var io;if(Array.isArray(wt))io={x:wt[0],y:wt[1],width:0,height:0};else{var Ps=wt.getBoundingClientRect();io={x:Ps.x,y:Ps.y,width:Ps.width,height:Ps.height}}var xs=Qi.getBoundingClientRect(),Ns=So.documentElement,gs=Ns.clientWidth,la=Ns.clientHeight,Da=Ns.scrollWidth,Ks=Ns.scrollHeight,va=Ns.scrollTop,oo=Ns.scrollLeft,vs=xs.height,ks=xs.width,Ia=io.height,ll=io.width,ja={left:0,top:0,right:gs,bottom:la},Oa={left:-oo,top:-va,right:Da-oo,bottom:Ks-va},Qa=Cr.htmlRegion,mr="visible",Dl="visibleFirst";Qa!=="scroll"&&Qa!==Dl&&(Qa=mr);var ul=Qa===Dl,Cu=fu(Oa,Dn),To=fu(ja,Dn),Au=Qa===mr?To:Cu,Ml=ul?To:Au;Qi.style.left="auto",Qi.style.top="auto",Qi.style.right="0",Qi.style.bottom="0";var du=Qi.getBoundingClientRect();Qi.style.left=da,Qi.style.top=Cs,Qi.style.right=ys,Qi.style.bottom=pa,(xn=Qi.parentElement)===null||xn===void 0||xn.removeChild(Qr);var pu=za(Math.round(ks/parseFloat(Ko)*1e3)/1e3),yl=za(Math.round(vs/parseFloat(Zr)*1e3)/1e3);if(pu===0||yl===0||re(wt)&&!js(wt))return;var Xu=Cr.offset,ru=Cr.targetOffset,ya=gl(xs,Xu),ju=te(ya,2),hl=ju[0],Qs=ju[1],Il=gl(io,ru),Es=te(Il,2),R=Es[0],V=Es[1];io.x-=R,io.y-=V;var at=Cr.points||[],dt=te(at,2),Dt=dt[0],_t=dt[1],Xt=qa(_t),Ne=qa(Dt),Xe=ka(io,Xt),ze=ka(xs,Ne),Qe=Tr({},Cr),Be=Xe.x-ze.x+hl,xi=Xe.y-ze.y+Qs,Oe=Ho(Be,xi),wi=Ho(Be,xi,To),ri=ka(io,["t","l"]),Mi=ka(xs,["t","l"]),Bi=ka(io,["b","r"]),Li=ka(xs,["b","r"]),Ni=Cr.overflow||{},Hi=Ni.adjustX,Gn=Ni.adjustY,cn=Ni.shiftX,ir=Ni.shiftY,Qn=function(Rs){return typeof Rs=="boolean"?Rs:Rs>=0},Xr,In,nn,vo;La();var Kr=Qn(Gn),gr=Ne[0]===Xt[0];if(Kr&&Ne[0]==="t"&&(In>Ml.bottom||$n.current.bt)){var kn=xi;gr?kn-=vs-Ia:kn=ri.y-Li.y-Qs;var ji=Ho(Be,kn),rn=Ho(Be,kn,To);ji>Oe||ji===Oe&&(!ul||rn>=wi)?($n.current.bt=!0,xi=kn,Qs=-Qs,Qe.points=[bu(Ne,0),bu(Xt,0)]):$n.current.bt=!1}if(Kr&&Ne[0]==="b"&&(Xr<Ml.top||$n.current.tb)){var On=xi;gr?On+=vs-Ia:On=Bi.y-Mi.y-Qs;var tr=Ho(Be,On),Ws=Ho(Be,On,To);tr>Oe||tr===Oe&&(!ul||Ws>=wi)?($n.current.tb=!0,xi=On,Qs=-Qs,Qe.points=[bu(Ne,0),bu(Xt,0)]):$n.current.tb=!1}var Ct=Qn(Hi),_o=Ne[1]===Xt[1];if(Ct&&Ne[1]==="l"&&(vo>Ml.right||$n.current.rl)){var Mn=Be;_o?Mn-=ks-ll:Mn=ri.x-Li.x-hl;var jn=Ho(Mn,xi),ws=Ho(Mn,xi,To);jn>Oe||jn===Oe&&(!ul||ws>=wi)?($n.current.rl=!0,Be=Mn,hl=-hl,Qe.points=[bu(Ne,1),bu(Xt,1)]):$n.current.rl=!1}if(Ct&&Ne[1]==="r"&&(nn<Ml.left||$n.current.lr)){var Ea=Be;_o?Ea+=ks-ll:Ea=Bi.x-Mi.x-hl;var Pn=Ho(Ea,xi),vn=Ho(Ea,xi,To);Pn>Oe||Pn===Oe&&(!ul||vn>=wi)?($n.current.lr=!0,Be=Ea,hl=-hl,Qe.points=[bu(Ne,1),bu(Xt,1)]):$n.current.lr=!1}La();var tn=cn===!0?0:cn;typeof tn=="number"&&(nn<To.left&&(Be-=nn-To.left-hl,io.x+ll<To.left+tn&&(Be+=io.x-To.left+ll-tn)),vo>To.right&&(Be-=vo-To.right-hl,io.x>To.right-tn&&(Be+=io.x-To.right+tn)));var so=ir===!0?0:ir;typeof so=="number"&&(Xr<To.top&&(xi-=Xr-To.top-Qs,io.y+Ia<To.top+so&&(xi+=io.y-To.top+Ia-so)),In>To.bottom&&(xi-=In-To.bottom-Qs,io.y>To.bottom-so&&(xi+=io.y-To.bottom+so)));var Po=xs.x+Be,No=Po+ks,ar=xs.y+xi,Mo=ar+vs,qo=io.x,Je=qo+ll,br=io.y,wn=br+Ia,lr=Math.max(Po,qo),Rn=Math.min(No,Je),kr=(lr+Rn)/2,Ls=kr-Po,As=Math.max(ar,br),Gr=Math.min(Mo,wn),ma=(As+Gr)/2,Qo=ma-ar;ke==null||ke(ht,Qe);var bs=du.right-xs.x-(Be+xs.width),ua=du.bottom-xs.y-(xi+xs.height);Ar({ready:!0,offsetX:Be/pu,offsetY:xi/yl,offsetR:bs/pu,offsetB:ua/yl,arrowX:Ls/pu,arrowY:Qo/yl,scaleX:pu,scaleY:yl,align:Qe})}}),Ln=function(){qn.current+=1;var xn=qn.current;Promise.resolve().then(function(){qn.current===xn&&Wn()})},cr=function(){Ar(function(xn){return Tr(Tr({},xn),{},{ready:!1})})};return Or(cr,[Ft]),Or(function(){Z||cr()},[Z]),[fn.ready,fn.offsetX,fn.offsetY,fn.offsetR,fn.offsetB,fn.arrowX,fn.arrowY,fn.scaleX,fn.scaleY,fn.align,Ln]}function Hs(Z){if(Array.isArray(Z))return dr(Z)}function Xc(Z){if(typeof Symbol!="undefined"&&Z[Symbol.iterator]!=null||Z["@@iterator"]!=null)return Array.from(Z)}function wc(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bc(Z){return Hs(Z)||Xc(Z)||ue(Z)||wc()}function dn(Z,ht,wt,Ft,Ut){Or(function(){if(Z&&ht&&wt){let qn=function(){Ft(),Ut()};var Ie=ht,ke=wt,Ri=xc(Ie),qi=xc(ke),fn=ds(ke),Ar=new Set([fn].concat(bc(Ri),bc(qi)));return Ar.forEach(function(Dn){Dn.addEventListener("scroll",qn,{passive:!0})}),fn.addEventListener("resize",qn,{passive:!0}),Ft(),function(){Ar.forEach(function(Dn){Dn.removeEventListener("scroll",qn),fn.removeEventListener("resize",qn)})}}},[Z,ht,wt])}var Oc={},xt=[],ve=function(ht){xt.push(ht)};function Kh(Z,ht){if(0)var wt}function Sc(Z,ht){if(0)var wt}function Ph(){Oc={}}function Nh(Z,ht,wt){!ht&&!Oc[wt]&&(Z(!1,wt),Oc[wt]=!0)}function Su(Z,ht){Nh(Kh,Z,ht)}function Mc(Z,ht){Nh(Sc,Z,ht)}Su.preMessage=ve,Su.resetWarned=Ph,Su.noteOnce=Mc;var Cc=null,fa=function(ht){return+setTimeout(ht,16)},zn=function(ht){return clearTimeout(ht)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(fa=function(ht){return window.requestAnimationFrame(ht)},zn=function(ht){return window.cancelAnimationFrame(ht)});var vl=0,Al=new Map;function oa(Z){Al.delete(Z)}var po=function(ht){var wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;vl+=1;var Ft=vl;function Ut(Ie){if(Ie===0)oa(Ft),ht();else{var ke=fa(function(){Ut(Ie-1)});Al.set(Ft,ke)}}return Ut(wt),Ft};po.cancel=function(Z){var ht=Al.get(Z);return oa(Z),zn(ht)};var $a=po;function ps(Z,ht,wt,Ft,Ut,Ie,ke,Ri){var qi=F.useRef(Z),fn=F.useRef(!1);qi.current!==Z&&(fn.current=!0,qi.current=Z),F.useEffect(function(){var Ar=$a(function(){fn.current=!1});return function(){$a.cancel(Ar)}},[Z]),F.useEffect(function(){if(ht&&Ft&&(!Ut||Ie)){var Ar=function(){var zo=!1,da=function(pa){var Cr=pa.target;zo=ke(Cr)},Cs=function(pa){var Cr=pa.target;!fn.current&&qi.current&&!zo&&!ke(Cr)&&Ri(!1)};return[da,Cs]},qn=Ar(),Dn=te(qn,2),$n=Dn[0],Di=Dn[1],Wn=Ar(),Ln=te(Wn,2),cr=Ln[0],wr=Ln[1],xn=ds(Ft);xn.addEventListener("mousedown",$n,!0),xn.addEventListener("click",Di,!0),xn.addEventListener("contextmenu",Di,!0);var Qi=un(wt);if(Qi&&(Qi.addEventListener("mousedown",cr,!0),Qi.addEventListener("click",wr,!0),Qi.addEventListener("contextmenu",wr,!0)),0)var So,jo,go,Ko;return function(){xn.removeEventListener("mousedown",$n,!0),xn.removeEventListener("click",Di,!0),xn.removeEventListener("contextmenu",Di,!0),Qi&&(Qi.removeEventListener("mousedown",cr,!0),Qi.removeEventListener("click",wr,!0),Qi.removeEventListener("contextmenu",wr,!0))}}},[ht,wt,Ft,Ut,Ie])}var sr=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function Vs(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ut,ht=F.forwardRef(function(wt,Ft){var Ut=wt.prefixCls,Ie=Ut===void 0?"rc-trigger-popup":Ut,ke=wt.children,Ri=wt.action,qi=Ri===void 0?"hover":Ri,fn=wt.showAction,Ar=wt.hideAction,qn=wt.popupVisible,Dn=wt.defaultPopupVisible,$n=wt.onPopupVisibleChange,Di=wt.afterPopupVisibleChange,Wn=wt.mouseEnterDelay,Ln=wt.mouseLeaveDelay,cr=Ln===void 0?.1:Ln,wr=wt.focusDelay,xn=wt.blurDelay,Qi=wt.mask,So=wt.maskClosable,jo=So===void 0?!0:So,go=wt.getPopupContainer,Ko=wt.forceRender,Zr=wt.autoDestroy,zo=wt.destroyPopupOnHide,da=wt.popup,Cs=wt.popupClassName,ys=wt.popupStyle,pa=wt.popupPlacement,Cr=wt.builtinPlacements,Qr=Cr===void 0?{}:Cr,io=wt.popupAlign,Ps=wt.zIndex,xs=wt.stretch,Ns=wt.getPopupClassNameFromAlign,gs=wt.fresh,la=wt.alignPoint,Da=wt.onPopupClick,Ks=wt.onPopupAlign,va=wt.arrow,oo=wt.popupMotion,vs=wt.maskMotion,ks=wt.popupTransitionName,Ia=wt.popupAnimation,ll=wt.maskTransitionName,ja=wt.maskAnimation,Oa=wt.className,Qa=wt.getTriggerDOMNode,mr=Co(wt,sr),Dl=Zr||zo||!1,ul=F.useState(!1),Cu=te(ul,2),To=Cu[0],Au=Cu[1];Or(function(){Au(Ai())},[]);var Ml=F.useRef({}),du=F.useContext(jh),pu=F.useMemo(function(){return{registerSubPopup:function(Kn,Pr){Ml.current[Kn]=Pr,du==null||du.registerSubPopup(Kn,Pr)}}},[du]),yl=or(),Xu=F.useState(null),ru=te(Xu,2),ya=ru[0],ju=ru[1],hl=An(function(Cn){re(Cn)&&ya!==Cn&&ju(Cn),du==null||du.registerSubPopup(yl,Cn)}),Qs=F.useState(null),Il=te(Qs,2),Es=Il[0],R=Il[1],V=F.useRef(null),at=An(function(Cn){re(Cn)&&Es!==Cn&&(R(Cn),V.current=Cn)}),dt=F.Children.only(ke),Dt=(dt==null?void 0:dt.props)||{},_t={},Xt=An(function(Cn){var Kn,Pr,Ss=Es;return(Ss==null?void 0:Ss.contains(Cn))||((Kn=un(Ss))===null||Kn===void 0?void 0:Kn.host)===Cn||Cn===Ss||(ya==null?void 0:ya.contains(Cn))||((Pr=un(ya))===null||Pr===void 0?void 0:Pr.host)===Cn||Cn===ya||Object.values(Ml.current).some(function(Nn){return(Nn==null?void 0:Nn.contains(Cn))||Cn===Nn})}),Ne=Gu(Ie,oo,Ia,ks),Xe=Gu(Ie,vs,ja,ll),ze=F.useState(Dn||!1),Qe=te(ze,2),Be=Qe[0],xi=Qe[1],Oe=qn!=null?qn:Be,wi=An(function(Cn){qn===void 0&&xi(Cn)});Or(function(){xi(qn||!1)},[qn]);var ri=F.useRef(Oe);ri.current=Oe;var Mi=An(function(Cn){(0,it.flushSync)(function(){Oe!==Cn&&(wi(Cn),$n==null||$n(Cn))})}),Bi=F.useRef(),Li=function(){clearTimeout(Bi.current)},Ni=function(Kn){var Pr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Li(),Pr===0?Mi(Kn):Bi.current=setTimeout(function(){Mi(Kn)},Pr*1e3)};F.useEffect(function(){return Li},[]);var Hi=F.useState(!1),Gn=te(Hi,2),cn=Gn[0],ir=Gn[1];Or(function(Cn){(!Cn||Oe)&&ir(!0)},[Oe]);var Qn=F.useState(null),Xr=te(Qn,2),In=Xr[0],nn=Xr[1],vo=F.useState([0,0]),Kr=te(vo,2),gr=Kr[0],kn=Kr[1],ji=function(Kn){kn([Kn.clientX,Kn.clientY])},rn=rc(Oe,ya,la?gr:Es,pa,Qr,io,Ks),On=te(rn,11),tr=On[0],Ws=On[1],Ct=On[2],_o=On[3],Mn=On[4],jn=On[5],ws=On[6],Ea=On[7],Pn=On[8],vn=On[9],tn=On[10],so=Zu(To,qi,fn,Ar),Po=te(so,2),No=Po[0],ar=Po[1],Mo=No.has("click"),qo=ar.has("click")||ar.has("contextMenu"),Je=An(function(){cn||tn()}),br=function(){ri.current&&la&&qo&&Ni(!1)};dn(Oe,Es,ya,Je,br),Or(function(){Je()},[gr,pa]),Or(function(){Oe&&!(Qr!=null&&Qr[pa])&&Je()},[JSON.stringify(io)]);var wn=F.useMemo(function(){var Cn=yc(Qr,Ie,vn,la);return ot()(Cn,Ns==null?void 0:Ns(vn))},[vn,Ns,Qr,Ie,la]);F.useImperativeHandle(Ft,function(){return{nativeElement:V.current,forceAlign:Je}});var lr=F.useState(0),Rn=te(lr,2),kr=Rn[0],Ls=Rn[1],As=F.useState(0),Gr=te(As,2),ma=Gr[0],Qo=Gr[1],bs=function(){if(xs&&Es){var Kn=Es.getBoundingClientRect();Ls(Kn.width),Qo(Kn.height)}},ua=function(){bs(),Je()},Ho=function(Kn){ir(!1),tn(),Di==null||Di(Kn)},La=function(){return new Promise(function(Kn){bs(),nn(function(){return Kn})})};Or(function(){In&&(tn(),In(),nn(null))},[In]);function Eo(Cn,Kn,Pr,Ss){_t[Cn]=function(Nn){var Yr;Ss==null||Ss(Nn),Ni(Kn,Pr);for(var Fi=arguments.length,Un=new Array(Fi>1?Fi-1:0),ae=1;ae<Fi;ae++)Un[ae-1]=arguments[ae];(Yr=Dt[Cn])===null||Yr===void 0||Yr.call.apply(Yr,[Dt,Nn].concat(Un))}}(Mo||qo)&&(_t.onClick=function(Cn){var Kn;ri.current&&qo?Ni(!1):!ri.current&&Mo&&(ji(Cn),Ni(!0));for(var Pr=arguments.length,Ss=new Array(Pr>1?Pr-1:0),Nn=1;Nn<Pr;Nn++)Ss[Nn-1]=arguments[Nn];(Kn=Dt.onClick)===null||Kn===void 0||Kn.call.apply(Kn,[Dt,Cn].concat(Ss))}),ps(Oe,qo,Es,ya,Qi,jo,Xt,Ni);var Rs=No.has("hover"),Us=ar.has("hover"),Vo,ha;Rs&&(Eo("onMouseEnter",!0,Wn,function(Cn){ji(Cn)}),Eo("onPointerEnter",!0,Wn,function(Cn){ji(Cn)}),Vo=function(){(Oe||cn)&&Ni(!0,Wn)},la&&(_t.onMouseMove=function(Cn){var Kn;(Kn=Dt.onMouseMove)===null||Kn===void 0||Kn.call(Dt,Cn)})),Us&&(Eo("onMouseLeave",!1,cr),Eo("onPointerLeave",!1,cr),ha=function(){Ni(!1,cr)}),No.has("focus")&&Eo("onFocus",!0,wr),ar.has("focus")&&Eo("onBlur",!1,xn),No.has("contextMenu")&&(_t.onContextMenu=function(Cn){var Kn;ri.current&&ar.has("contextMenu")?Ni(!1):(ji(Cn),Ni(!0)),Cn.preventDefault();for(var Pr=arguments.length,Ss=new Array(Pr>1?Pr-1:0),Nn=1;Nn<Pr;Nn++)Ss[Nn-1]=arguments[Nn];(Kn=Dt.onContextMenu)===null||Kn===void 0||Kn.call.apply(Kn,[Dt,Cn].concat(Ss))}),Oa&&(_t.className=ot()(Dt.className,Oa));var Zs=Tr(Tr({},Dt),_t),Vl={},Ta=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Ta.forEach(function(Cn){mr[Cn]&&(Vl[Cn]=function(){for(var Kn,Pr=arguments.length,Ss=new Array(Pr),Nn=0;Nn<Pr;Nn++)Ss[Nn]=arguments[Nn];(Kn=Zs[Cn])===null||Kn===void 0||Kn.call.apply(Kn,[Zs].concat(Ss)),mr[Cn].apply(mr,Ss)})});var Xa=F.cloneElement(dt,Tr(Tr({},Zs),Vl)),Yu={x:jn,y:ws},Ts=va?Tr({},va!==!0?va:{}):null;return F.createElement(F.Fragment,null,F.createElement(ee.Z,{disabled:!Oe,ref:at,onResize:ua},F.createElement(Nu,{getTriggerDOMNode:Qa},Xa)),F.createElement(jh.Provider,{value:pu},F.createElement(Js,{portal:Z,ref:hl,prefixCls:Ie,popup:da,className:ot()(Cs,wn),style:ys,target:Es,onMouseEnter:Vo,onMouseLeave:ha,onPointerEnter:Vo,zIndex:Ps,open:Oe,keepDom:cn,fresh:gs,onClick:Da,mask:Qi,motion:Ne,maskMotion:Xe,onVisibleChanged:Ho,onPrepare:La,forceRender:Ko,autoDestroy:Dl,getPopupContainer:go,align:vn,arrow:Ts,arrowPos:Yu,ready:tr,offsetX:Ws,offsetY:Ct,offsetR:_o,offsetB:Mn,onAlign:Je,stretch:xs,targetWidth:kr/Ea,targetHeight:ma/Pn})))});return ht}var _s=Vs(ut),sa={adjustX:1,adjustY:1},mo={topLeft:{points:["bl","tl"],overflow:sa},topRight:{points:["br","tr"],overflow:sa},bottomLeft:{points:["tl","bl"],overflow:sa},bottomRight:{points:["tr","br"],overflow:sa},leftTop:{points:["tr","tl"],overflow:sa},leftBottom:{points:["br","bl"],overflow:sa},rightTop:{points:["tl","tr"],overflow:sa},rightBottom:{points:["bl","br"],overflow:sa}},Hl={topLeft:{points:["bl","tl"],overflow:sa},topRight:{points:["br","tr"],overflow:sa},bottomLeft:{points:["tl","bl"],overflow:sa},bottomRight:{points:["tr","br"],overflow:sa},rightTop:{points:["tr","tl"],overflow:sa},rightBottom:{points:["br","bl"],overflow:sa},leftTop:{points:["tl","tr"],overflow:sa},leftBottom:{points:["bl","br"],overflow:sa}},us=null;function qs(Z,ht,wt){if(ht)return ht;if(wt)return wt[Z]||wt.other}var aa={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Ga(Z){var ht=Z.prefixCls,wt=Z.visible,Ft=Z.children,Ut=Z.popup,Ie=Z.popupStyle,ke=Z.popupClassName,Ri=Z.popupOffset,qi=Z.disabled,fn=Z.mode,Ar=Z.onVisibleChange,qn=F.useContext(bt),Dn=qn.getPopupContainer,$n=qn.rtl,Di=qn.subMenuOpenDelay,Wn=qn.subMenuCloseDelay,Ln=qn.builtinPlacements,cr=qn.triggerSubMenuAction,wr=qn.forceSubMenuRender,xn=qn.rootClassName,Qi=qn.motion,So=qn.defaultMotions,jo=F.useState(!1),go=(0,gt.Z)(jo,2),Ko=go[0],Zr=go[1],zo=$n?(0,vt.Z)((0,vt.Z)({},Hl),Ln):(0,vt.Z)((0,vt.Z)({},mo),Ln),da=aa[fn],Cs=qs(fn,Qi,So),ys=F.useRef(Cs);fn!=="inline"&&(ys.current=Cs);var pa=(0,vt.Z)((0,vt.Z)({},ys.current),{},{leavedClassName:"".concat(ht,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Cr=F.useRef();return F.useEffect(function(){return Cr.current=(0,$o.Z)(function(){Zr(wt)}),function(){$o.Z.cancel(Cr.current)}},[wt]),F.createElement(_s,{prefixCls:ht,popupClassName:ot()("".concat(ht,"-popup"),(0,At.Z)({},"".concat(ht,"-rtl"),$n),ke,xn),stretch:fn==="horizontal"?"minWidth":null,getPopupContainer:Dn,builtinPlacements:zo,popupPlacement:da,popupVisible:Ko,popup:Ut,popupStyle:Ie,popupAlign:Ri&&{offset:Ri},action:qi?[]:[cr],mouseEnterDelay:Di,mouseLeaveDelay:Wn,onPopupVisibleChange:Ar,forceRender:wr,popupMotion:pa,fresh:!0},Ft)}function ms(Z){var ht=Z.id,wt=Z.open,Ft=Z.keyPath,Ut=Z.children,Ie="inline",ke=F.useContext(bt),Ri=ke.prefixCls,qi=ke.forceSubMenuRender,fn=ke.motion,Ar=ke.defaultMotions,qn=ke.mode,Dn=F.useRef(!1);Dn.current=qn===Ie;var $n=F.useState(!Dn.current),Di=(0,gt.Z)($n,2),Wn=Di[0],Ln=Di[1],cr=Dn.current?wt:!1;F.useEffect(function(){Dn.current&&Ln(!1)},[qn]);var wr=(0,vt.Z)({},qs(Ie,fn,Ar));Ft.length>1&&(wr.motionAppear=!1);var xn=wr.onVisibleChanged;return wr.onVisibleChanged=function(Qi){return!Dn.current&&!Qi&&Ln(!0),xn==null?void 0:xn(Qi)},Wn?null:F.createElement(Pe,{mode:Ie,locked:!Dn.current},F.createElement(El.Z,(0,Nt.Z)({visible:cr},wr,{forceRender:qi,removeOnLeave:!1,leavedClassName:"".concat(Ri,"-hidden")}),function(Qi){var So=Qi.className,jo=Qi.style;return F.createElement(qr,{id:ht,className:So,style:jo},Ut)}))}var pf=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Jn=["active"],Ad=function(ht){var wt,Ft=ht.style,Ut=ht.className,Ie=ht.title,ke=ht.eventKey,Ri=ht.warnKey,qi=ht.disabled,fn=ht.internalPopupClose,Ar=ht.children,qn=ht.itemIcon,Dn=ht.expandIcon,$n=ht.popupClassName,Di=ht.popupOffset,Wn=ht.popupStyle,Ln=ht.onClick,cr=ht.onMouseEnter,wr=ht.onMouseLeave,xn=ht.onTitleClick,Qi=ht.onTitleMouseEnter,So=ht.onTitleMouseLeave,jo=(0,ft.Z)(ht,pf),go=K(ke),Ko=F.useContext(bt),Zr=Ko.prefixCls,zo=Ko.mode,da=Ko.openKeys,Cs=Ko.disabled,ys=Ko.overflowDisabled,pa=Ko.activeKey,Cr=Ko.selectedKeys,Qr=Ko.itemIcon,io=Ko.expandIcon,Ps=Ko.onItemClick,xs=Ko.onOpenChange,Ns=Ko.onActive,gs=F.useContext(We),la=gs._internalRenderSubMenuItem,Da=F.useContext(rr),Ks=Da.isSubPathKey,va=er(),oo="".concat(Zr,"-submenu"),vs=Cs||qi,ks=F.useRef(),Ia=F.useRef(),ll=qn!=null?qn:Qr,ja=Dn!=null?Dn:io,Oa=da.includes(ke),Qa=!ys&&Oa,mr=Ks(Cr,ke),Dl=Re(ke,vs,Qi,So),ul=Dl.active,Cu=(0,ft.Z)(Dl,Jn),To=F.useState(!1),Au=(0,gt.Z)(To,2),Ml=Au[0],du=Au[1],pu=function(_t){vs||du(_t)},yl=function(_t){pu(!0),cr==null||cr({key:ke,domEvent:_t})},Xu=function(_t){pu(!1),wr==null||wr({key:ke,domEvent:_t})},ru=F.useMemo(function(){return ul||(zo!=="inline"?Ml||Ks([pa],ke):!1)},[zo,ul,pa,Ml,ke,Ks]),ya=_i(va.length),ju=function(_t){vs||(xn==null||xn({key:ke,domEvent:_t}),zo==="inline"&&xs(ke,!Oa))},hl=$t(function(Dt){Ln==null||Ln(vr(Dt)),Ps(Dt)}),Qs=function(_t){zo!=="inline"&&xs(ke,_t)},Il=function(){Ns(ke)},Es=go&&"".concat(go,"-popup"),R=F.createElement("div",(0,Nt.Z)({role:"menuitem",style:ya,className:"".concat(oo,"-title"),tabIndex:vs?null:-1,ref:ks,title:typeof Ie=="string"?Ie:null,"data-menu-id":ys&&go?null:go,"aria-expanded":Qa,"aria-haspopup":!0,"aria-controls":Es,"aria-disabled":vs,onClick:ju,onFocus:Il},Cu),Ie,F.createElement(Qt,{icon:zo!=="horizontal"?ja:void 0,props:(0,vt.Z)((0,vt.Z)({},ht),{},{isOpen:Qa,isSubMenu:!0})},F.createElement("i",{className:"".concat(oo,"-arrow")}))),V=F.useRef(zo);if(zo!=="inline"&&va.length>1?V.current="vertical":V.current=zo,!ys){var at=V.current;R=F.createElement(Ga,{mode:at,prefixCls:oo,visible:!fn&&Qa&&zo!=="inline",popupClassName:$n,popupOffset:Di,popupStyle:Wn,popup:F.createElement(Pe,{mode:at==="horizontal"?"vertical":at},F.createElement(qr,{id:Es,ref:Ia},Ar)),disabled:vs,onVisibleChange:Qs},R)}var dt=F.createElement(ai.Item,(0,Nt.Z)({role:"none"},jo,{component:"li",style:Ft,className:ot()(oo,"".concat(oo,"-").concat(zo),Ut,(wt={},(0,At.Z)(wt,"".concat(oo,"-open"),Qa),(0,At.Z)(wt,"".concat(oo,"-active"),ru),(0,At.Z)(wt,"".concat(oo,"-selected"),mr),(0,At.Z)(wt,"".concat(oo,"-disabled"),vs),wt)),onMouseEnter:yl,onMouseLeave:Xu}),R,!ys&&F.createElement(ms,{id:Es,open:Qa,keyPath:va},Ar));return la&&(dt=la(dt,ht,{selected:mr,active:ru,open:Qa,disabled:vs})),F.createElement(Pe,{onItemClick:hl,mode:zo==="horizontal"?"vertical":zo,itemIcon:ll,expandIcon:ja},dt)};function Rr(Z){var ht=Z.eventKey,wt=Z.children,Ft=er(ht),Ut=he(wt,Ft),Ie=si();F.useEffect(function(){if(Ie)return Ie.registerPath(ht,Ft),function(){Ie.unregisterPath(ht,Ft)}},[Ft]);var ke;return Ie?ke=Ut:ke=F.createElement(Ad,Z,Ut),F.createElement(Gi.Provider,{value:Ft},ke)}var kc=j(71002),Ah=["className","title","eventKey","children"],Pf=["children"],Yf=function(ht){var wt=ht.className,Ft=ht.title,Ut=ht.eventKey,Ie=ht.children,ke=(0,ft.Z)(ht,Ah),Ri=F.useContext(bt),qi=Ri.prefixCls,fn="".concat(qi,"-item-group");return F.createElement("li",(0,Nt.Z)({role:"presentation"},ke,{onClick:function(qn){return qn.stopPropagation()},className:ot()(fn,wt)}),F.createElement("div",{role:"presentation",className:"".concat(fn,"-title"),title:typeof Ft=="string"?Ft:void 0},Ft),F.createElement("ul",{role:"group",className:"".concat(fn,"-list")},Ie))};function mf(Z){var ht=Z.children,wt=(0,ft.Z)(Z,Pf),Ft=er(wt.eventKey),Ut=he(ht,Ft),Ie=si();return Ie?Ut:F.createElement(Yf,(0,Mt.Z)(wt,["warnKey"]),Ut)}function Hh(Z){var ht=Z.className,wt=Z.style,Ft=F.useContext(bt),Ut=Ft.prefixCls,Ie=si();return Ie?null:F.createElement("li",{role:"separator",className:ot()("".concat(Ut,"-item-divider"),ht),style:wt})}var Rc=["label","children","key","type"];function as(Z){return(Z||[]).map(function(ht,wt){if(ht&&(0,kc.Z)(ht)==="object"){var Ft=ht,Ut=Ft.label,Ie=Ft.children,ke=Ft.key,Ri=Ft.type,qi=(0,ft.Z)(Ft,Rc),fn=ke!=null?ke:"tmp-".concat(wt);return Ie||Ri==="group"?Ri==="group"?F.createElement(mf,(0,Nt.Z)({key:fn},qi,{title:Ut}),as(Ie)):F.createElement(Rr,(0,Nt.Z)({key:fn},qi,{title:Ut}),as(Ie)):Ri==="divider"?F.createElement(Hh,(0,Nt.Z)({key:fn},qi)):F.createElement(ho,(0,Nt.Z)({key:fn},qi),Ut)}return null}).filter(function(ht){return ht})}function oc(Z,ht,wt){var Ft=Z;return ht&&(Ft=as(ht)),he(Ft,wt)}var Jf=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],oh=[],dd=F.forwardRef(function(Z,ht){var wt,Ft,Ut=Z,Ie=Ut.prefixCls,ke=Ie===void 0?"rc-menu":Ie,Ri=Ut.rootClassName,qi=Ut.style,fn=Ut.className,Ar=Ut.tabIndex,qn=Ar===void 0?0:Ar,Dn=Ut.items,$n=Ut.children,Di=Ut.direction,Wn=Ut.id,Ln=Ut.mode,cr=Ln===void 0?"vertical":Ln,wr=Ut.inlineCollapsed,xn=Ut.disabled,Qi=Ut.disabledOverflow,So=Ut.subMenuOpenDelay,jo=So===void 0?.1:So,go=Ut.subMenuCloseDelay,Ko=go===void 0?.1:go,Zr=Ut.forceSubMenuRender,zo=Ut.defaultOpenKeys,da=Ut.openKeys,Cs=Ut.activeKey,ys=Ut.defaultActiveFirst,pa=Ut.selectable,Cr=pa===void 0?!0:pa,Qr=Ut.multiple,io=Qr===void 0?!1:Qr,Ps=Ut.defaultSelectedKeys,xs=Ut.selectedKeys,Ns=Ut.onSelect,gs=Ut.onDeselect,la=Ut.inlineIndent,Da=la===void 0?24:la,Ks=Ut.motion,va=Ut.defaultMotions,oo=Ut.triggerSubMenuAction,vs=oo===void 0?"hover":oo,ks=Ut.builtinPlacements,Ia=Ut.itemIcon,ll=Ut.expandIcon,ja=Ut.overflowedIndicator,Oa=ja===void 0?"...":ja,Qa=Ut.overflowedIndicatorPopupClassName,mr=Ut.getPopupContainer,Dl=Ut.onClick,ul=Ut.onOpenChange,Cu=Ut.onKeyDown,To=Ut.openAnimation,Au=Ut.openTransitionName,Ml=Ut._internalRenderMenuItem,du=Ut._internalRenderSubMenuItem,pu=(0,ft.Z)(Ut,Jf),yl=F.useMemo(function(){return oc($n,Dn,oh)},[$n,Dn]),Xu=F.useState(!1),ru=(0,gt.Z)(Xu,2),ya=ru[0],ju=ru[1],hl=F.useRef(),Qs=Kt(Wn),Il=Di==="rtl",Es=(0,zi.Z)(zo,{value:da,postState:function(Rn){return Rn||oh}}),R=(0,gt.Z)(Es,2),V=R[0],at=R[1],dt=function(Rn){var kr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Ls(){at(Rn),ul==null||ul(Rn)}kr?(0,it.flushSync)(Ls):Ls()},Dt=F.useState(V),_t=(0,gt.Z)(Dt,2),Xt=_t[0],Ne=_t[1],Xe=F.useRef(!1),ze=F.useMemo(function(){return(cr==="inline"||cr==="vertical")&&wr?["vertical",wr]:[cr,!1]},[cr,wr]),Qe=(0,gt.Z)(ze,2),Be=Qe[0],xi=Qe[1],Oe=Be==="inline",wi=F.useState(Be),ri=(0,gt.Z)(wi,2),Mi=ri[0],Bi=ri[1],Li=F.useState(xi),Ni=(0,gt.Z)(Li,2),Hi=Ni[0],Gn=Ni[1];F.useEffect(function(){Bi(Be),Gn(xi),Xe.current&&(Oe?at(Xt):dt(oh))},[Be,xi]);var cn=F.useState(0),ir=(0,gt.Z)(cn,2),Qn=ir[0],Xr=ir[1],In=Qn>=yl.length-1||Mi!=="horizontal"||Qi;F.useEffect(function(){Oe&&Ne(V)},[V]),F.useEffect(function(){return Xe.current=!0,function(){Xe.current=!1}},[]);var nn=St(),vo=nn.registerPath,Kr=nn.unregisterPath,gr=nn.refreshOverflowKeys,kn=nn.isSubPathKey,ji=nn.getKeyPath,rn=nn.getKeys,On=nn.getSubPathKeys,tr=F.useMemo(function(){return{registerPath:vo,unregisterPath:Kr}},[vo,Kr]),Ws=F.useMemo(function(){return{isSubPathKey:kn}},[kn]);F.useEffect(function(){gr(In?oh:yl.slice(Qn+1).map(function(lr){return lr.key}))},[Qn,In]);var Ct=(0,zi.Z)(Cs||ys&&((wt=yl[0])===null||wt===void 0?void 0:wt.key),{value:Cs}),_o=(0,gt.Z)(Ct,2),Mn=_o[0],jn=_o[1],ws=$t(function(lr){jn(lr)}),Ea=$t(function(){jn(void 0)});(0,F.useImperativeHandle)(ht,function(){return{list:hl.current,focus:function(Rn){var kr,Ls=Mn!=null?Mn:(kr=yl.find(function(Qo){return!Qo.props.disabled}))===null||kr===void 0?void 0:kr.key;if(Ls){var As,Gr,ma;(As=hl.current)===null||As===void 0||(Gr=As.querySelector("li[data-menu-id='".concat(_(Qs,Ls),"']")))===null||Gr===void 0||(ma=Gr.focus)===null||ma===void 0||ma.call(Gr,Rn)}}}});var Pn=(0,zi.Z)(Ps||[],{value:xs,postState:function(Rn){return Array.isArray(Rn)?Rn:Rn==null?oh:[Rn]}}),vn=(0,gt.Z)(Pn,2),tn=vn[0],so=vn[1],Po=function(Rn){if(Cr){var kr=Rn.key,Ls=tn.includes(kr),As;io?Ls?As=tn.filter(function(ma){return ma!==kr}):As=[].concat((0,Et.Z)(tn),[kr]):As=[kr],so(As);var Gr=(0,vt.Z)((0,vt.Z)({},Rn),{},{selectedKeys:As});Ls?gs==null||gs(Gr):Ns==null||Ns(Gr)}!io&&V.length&&Mi!=="inline"&&dt(oh)},No=$t(function(lr){Dl==null||Dl(vr(lr)),Po(lr)}),ar=$t(function(lr,Rn){var kr=V.filter(function(As){return As!==lr});if(Rn)kr.push(lr);else if(Mi!=="inline"){var Ls=On(lr);kr=kr.filter(function(As){return!Ls.has(As)})}(0,q.Z)(V,kr,!0)||dt(kr,!0)}),Mo=function(Rn,kr){var Ls=kr!=null?kr:!V.includes(Rn);ar(Rn,Ls)},qo=ln(Mi,Mn,Il,Qs,hl,rn,ji,jn,Mo,Cu);F.useEffect(function(){ju(!0)},[]);var Je=F.useMemo(function(){return{_internalRenderMenuItem:Ml,_internalRenderSubMenuItem:du}},[Ml,du]),br=Mi!=="horizontal"||Qi?yl:yl.map(function(lr,Rn){return F.createElement(Pe,{key:lr.key,overflowDisabled:Rn>Qn},lr)}),wn=F.createElement(ai,(0,Nt.Z)({id:Wn,ref:hl,prefixCls:"".concat(ke,"-overflow"),component:"ul",itemComponent:ho,className:ot()(ke,"".concat(ke,"-root"),"".concat(ke,"-").concat(Mi),fn,(Ft={},(0,At.Z)(Ft,"".concat(ke,"-inline-collapsed"),Hi),(0,At.Z)(Ft,"".concat(ke,"-rtl"),Il),Ft),Ri),dir:Di,style:qi,role:"menu",tabIndex:qn,data:br,renderRawItem:function(Rn){return Rn},renderRawRest:function(Rn){var kr=Rn.length,Ls=kr?yl.slice(-kr):null;return F.createElement(Rr,{eventKey:li,title:Oa,disabled:In,internalPopupClose:kr===0,popupClassName:Qa},Ls)},maxCount:Mi!=="horizontal"||Qi?ai.INVALIDATE:ai.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Rn){Xr(Rn)},onKeyDown:qo},pu));return F.createElement(We.Provider,{value:Je},F.createElement(D.Provider,{value:Qs},F.createElement(Pe,{prefixCls:ke,rootClassName:Ri,mode:Mi,openKeys:V,rtl:Il,disabled:xn,motion:ya?Ks:null,defaultMotions:ya?va:null,activeKey:Mn,onActive:ws,onInactive:Ea,selectedKeys:tn,inlineIndent:Da,subMenuOpenDelay:jo,subMenuCloseDelay:Ko,forceSubMenuRender:Zr,builtinPlacements:ks,triggerSubMenuAction:vs,getPopupContainer:mr,itemIcon:Ia,expandIcon:ll,onItemClick:No,onOpenChange:ar},F.createElement(rr.Provider,{value:Ws},wn),F.createElement("div",{style:{display:"none"},"aria-hidden":!0},F.createElement(ei.Provider,{value:tr},yl)))))}),sc=dd,Mu=sc;Mu.Item=ho,Mu.SubMenu=Rr,Mu.ItemGroup=mf,Mu.Divider=Hh;var Ec=Mu},99962:function(Wr,Ti){"use strict";var j;var Nt=Symbol.for("react.element"),At=Symbol.for("react.portal"),vt=Symbol.for("react.fragment"),Et=Symbol.for("react.strict_mode"),gt=Symbol.for("react.profiler"),ft=Symbol.for("react.provider"),ct=Symbol.for("react.context"),ot=Symbol.for("react.server_context"),F=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),Fe=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),Zt;Zt=Symbol.for("react.module.reference");function zt(Q){if(typeof Q=="object"&&Q!==null){var se=Q.$$typeof;switch(se){case Nt:switch(Q=Q.type,Q){case vt:case gt:case Et:case Y:case ee:return Q;default:switch(Q=Q&&Q.$$typeof,Q){case ot:case ct:case F:case Fe:case ne:case ft:return Q;default:return se}}case At:return se}}}j=ct,j=ft,j=Nt,Ti.ForwardRef=F,j=vt,j=Fe,j=ne,j=At,j=gt,j=Et,j=Y,j=ee,j=function(){return!1},j=function(){return!1},j=function(Q){return zt(Q)===ct},j=function(Q){return zt(Q)===ft},j=function(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===Nt},j=function(Q){return zt(Q)===F},j=function(Q){return zt(Q)===vt},j=function(Q){return zt(Q)===Fe},Ti.isMemo=function(Q){return zt(Q)===ne},j=function(Q){return zt(Q)===At},j=function(Q){return zt(Q)===gt},j=function(Q){return zt(Q)===Et},j=function(Q){return zt(Q)===Y},j=function(Q){return zt(Q)===ee},j=function(Q){return typeof Q=="string"||typeof Q=="function"||Q===vt||Q===gt||Q===Et||Q===Y||Q===ee||Q===le||typeof Q=="object"&&Q!==null&&(Q.$$typeof===Fe||Q.$$typeof===ne||Q.$$typeof===ft||Q.$$typeof===ct||Q.$$typeof===F||Q.$$typeof===Zt||Q.getModuleId!==void 0)},j=zt},8399:function(Wr,Ti,j){"use strict";Wr.exports=j(99962)},66680:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return At}});var Nt=j(67294);function At(vt){var Et=Nt.useRef();Et.current=vt;var gt=Nt.useCallback(function(){for(var ft,ct=arguments.length,ot=new Array(ct),F=0;F<ct;F++)ot[F]=arguments[F];return(ft=Et.current)===null||ft===void 0?void 0:ft.call.apply(ft,[Et].concat(ot))},[]);return gt}},21770:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ft}});var Nt=j(97685),At=j(66680),vt=j(8410),Et=j(63896);function gt(ct){return ct!==void 0}function ft(ct,ot){var F=ot||{},Y=F.defaultValue,ee=F.value,ne=F.onChange,Fe=F.postState,le=(0,Et.Z)(function(){return gt(ee)?ee:gt(Y)?typeof Y=="function"?Y():Y:typeof ct=="function"?ct():ct}),Zt=(0,Nt.Z)(le,2),zt=Zt[0],Q=Zt[1],se=ee!==void 0?ee:zt,$e=Fe?Fe(se):se,Vt=(0,At.Z)(ne),Wt=(0,Et.Z)([se]),kt=(0,Nt.Z)(Wt,2),it=kt[0],Ot=kt[1];(0,vt.o)(function(){var Te=it[0];zt!==Te&&Vt(zt,Te)},[it]),(0,vt.o)(function(){gt(ee)||Q(ee)},[ee]);var qt=(0,At.Z)(function(Te,_e){Q(Te,_e),Ot([se],_e)});return[$e,qt]}},91881:function(Wr,Ti,j){"use strict";var Nt=j(71002),At=j(80334);function vt(Et,gt){var ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ct=new Set;function ot(F,Y){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,ne=ct.has(F);if((0,At.ZP)(!ne,"Warning: There may be circular references"),ne)return!1;if(F===Y)return!0;if(ft&&ee>1)return!1;ct.add(F);var Fe=ee+1;if(Array.isArray(F)){if(!Array.isArray(Y)||F.length!==Y.length)return!1;for(var le=0;le<F.length;le++)if(!ot(F[le],Y[le],Fe))return!1;return!0}if(F&&Y&&(0,Nt.Z)(F)==="object"&&(0,Nt.Z)(Y)==="object"){var Zt=Object.keys(F);return Zt.length!==Object.keys(Y).length?!1:Zt.every(function(zt){return ot(F[zt],Y[zt],Fe)})}return!1}return ot(Et,gt)}Ti.Z=vt},98423:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return At}});var Nt=j(1413);function At(vt,Et){var gt=(0,Nt.Z)({},vt);return Array.isArray(Et)&&Et.forEach(function(ft){delete gt[ft]}),gt}},73299:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return Xs}});var Nt=j(87462),At=j(1413),vt=j(71002),Et=j(97685),gt=j(4942),ft=j(45987),ct=j(67294),ot=j(73935),F=j(94184),Y=j.n(F),ee=j(48555),ne=ct.forwardRef(function(Me,L){var yi=Me.height,qe=Me.offsetY,Si=Me.offsetX,Vi=Me.children,ln=Me.prefixCls,fr=Me.onInnerResize,no=Me.innerProps,wo=Me.rtl,ro=Me.extra,li={},St={display:"flex",flexDirection:"column"};if(qe!==void 0){var $t;li={height:yi,position:"relative",overflow:"hidden"},St=(0,At.Z)((0,At.Z)({},St),{},($t={transform:"translateY(".concat(qe,"px)")},(0,gt.Z)($t,wo?"marginRight":"marginLeft",-Si),(0,gt.Z)($t,"position","absolute"),(0,gt.Z)($t,"left",0),(0,gt.Z)($t,"right",0),(0,gt.Z)($t,"top",0),$t))}return ct.createElement("div",{style:li},ct.createElement(ee.Z,{onResize:function(Ue){var Kt=Ue.offsetHeight;Kt&&fr&&fr()}},ct.createElement("div",(0,Nt.Z)({style:St,className:Y()((0,gt.Z)({},"".concat(ln,"-holder-inner"),ln)),ref:L},no),Vi,ro)))});ne.displayName="Filler";var Fe=ne,le=function(L){return+setTimeout(L,16)},Zt=function(L){return clearTimeout(L)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(le=function(L){return window.requestAnimationFrame(L)},Zt=function(L){return window.cancelAnimationFrame(L)});var zt=0,Q=new Map;function se(Me){Q.delete(Me)}var $e=function(L){var yi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;zt+=1;var qe=zt;function Si(Vi){if(Vi===0)se(qe),L();else{var ln=le(function(){Si(Vi-1)});Q.set(qe,ln)}}return Si(yi),qe};$e.cancel=function(Me){var L=Q.get(Me);return se(L),Zt(L)};var Vt=$e;function Wt(Me,L){var yi="touches"in Me?Me.touches[0]:Me;return yi[L?"pageX":"pageY"]}var kt=ct.forwardRef(function(Me,L){var yi,qe=Me.prefixCls,Si=Me.rtl,Vi=Me.scrollOffset,ln=Me.scrollRange,fr=Me.onStartMove,no=Me.onStopMove,wo=Me.onScroll,ro=Me.horizontal,li=Me.spinSize,St=Me.containerSize,$t=Me.style,xe=Me.thumbStyle,Ue=ct.useState(!1),Kt=(0,Et.Z)(Ue,2),yt=Kt[0],me=Kt[1],Ce=ct.useState(null),we=(0,Et.Z)(Ce,2),Mt=we[0],ie=we[1],Re=ct.useState(null),_i=(0,Et.Z)(Re,2),Qt=_i[0],ui=_i[1],vr=!Si,Mr=ct.useRef(),Lr=ct.useRef(),gi=ct.useState(!1),Ji=(0,Et.Z)(gi,2),Xi=Ji[0],zr=Ji[1],ho=ct.useRef(),Tn=function(){clearTimeout(ho.current),zr(!0),ho.current=setTimeout(function(){zr(!1)},3e3)},Pi=ln-St||0,os=St-li||0,qr=Pi>0,bo=ct.useMemo(function(){if(Vi===0||Pi===0)return 0;var $r=Vi/Pi;return $r*os},[Vi,Pi,os]),he=function(dr){dr.stopPropagation(),dr.preventDefault()},ss=ct.useRef({top:bo,dragging:yt,pageY:Mt,startTop:Qt});ss.current={top:bo,dragging:yt,pageY:Mt,startTop:Qt};var Aa=function(dr){me(!0),ie(Wt(dr,ro)),ui(ss.current.top),fr(),dr.stopPropagation(),dr.preventDefault()};ct.useEffect(function(){var $r=function(te){te.preventDefault()},dr=Mr.current,ue=Lr.current;return dr.addEventListener("touchstart",$r),ue.addEventListener("touchstart",Aa),function(){dr.removeEventListener("touchstart",$r),ue.removeEventListener("touchstart",Aa)}},[]);var Bo=ct.useRef();Bo.current=Pi;var Ma=ct.useRef();Ma.current=os,ct.useEffect(function(){if(yt){var $r,dr=function(te){var Do=ss.current,Co=Do.dragging,Io=Do.pageY,ea=Do.startTop;if(Vt.cancel($r),Co){var Nr=Wt(te,ro)-Io,Xn=ea;!vr&&ro?Xn-=Nr:Xn+=Nr;var fo=Bo.current,Ys=Ma.current,Xo=Ys?Xn/Ys:0,ci=Math.ceil(Xo*fo);ci=Math.max(ci,0),ci=Math.min(ci,fo),$r=Vt(function(){wo(ci,ro)})}},ue=function(){me(!1),no()};return window.addEventListener("mousemove",dr),window.addEventListener("touchmove",dr),window.addEventListener("mouseup",ue),window.addEventListener("touchend",ue),function(){window.removeEventListener("mousemove",dr),window.removeEventListener("touchmove",dr),window.removeEventListener("mouseup",ue),window.removeEventListener("touchend",ue),Vt.cancel($r)}}},[yt]),ct.useEffect(function(){Tn()},[Vi]),ct.useImperativeHandle(L,function(){return{delayHidden:Tn}});var Lo="".concat(qe,"-scrollbar"),Tr={position:"absolute",visibility:Xi&&qr?null:"hidden"},yr={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return ro?(Tr.height=8,Tr.left=0,Tr.right=0,Tr.bottom=0,yr.height="100%",yr.width=li,vr?yr.left=bo:yr.right=bo):(Tr.width=8,Tr.top=0,Tr.bottom=0,vr?Tr.right=0:Tr.left=0,yr.width="100%",yr.height=li,yr.top=bo),ct.createElement("div",{ref:Mr,className:Y()(Lo,(yi={},(0,gt.Z)(yi,"".concat(Lo,"-horizontal"),ro),(0,gt.Z)(yi,"".concat(Lo,"-vertical"),!ro),(0,gt.Z)(yi,"".concat(Lo,"-visible"),Xi),yi)),style:(0,At.Z)((0,At.Z)({},Tr),$t),onMouseDown:he,onMouseMove:Tn},ct.createElement("div",{ref:Lr,className:Y()("".concat(Lo,"-thumb"),(0,gt.Z)({},"".concat(Lo,"-thumb-moving"),yt)),style:(0,At.Z)((0,At.Z)({},yr),xe),onMouseDown:Aa}))}),it=kt;function Ot(Me){var L=Me.children,yi=Me.setRef,qe=ct.useCallback(function(Si){yi(Si)},[]);return ct.cloneElement(L,{ref:qe})}function qt(Me,L,yi,qe,Si,Vi,ln){var fr=ln.getKey;return Me.slice(L,yi+1).map(function(no,wo){var ro=L+wo,li=Vi(no,ro,{style:{width:qe}}),St=fr(no);return ct.createElement(Ot,{key:St,setRef:function(xe){return Si(no,xe)}},li)})}function Te(Me){return Me instanceof HTMLElement||Me instanceof SVGElement}function _e(Me){return Te(Me)?Me:Me instanceof ct.Component?ot.findDOMNode(Me):null}var fi=j(15671),Ht=j(43144),pe=function(){function Me(){(0,fi.Z)(this,Me),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,Ht.Z)(Me,[{key:"set",value:function(yi,qe){this.maps[yi]=qe,this.id+=1}},{key:"get",value:function(yi){return this.maps[yi]}}]),Me}(),Ke=pe;function ki(Me,L,yi){var qe=ct.useState(0),Si=(0,Et.Z)(qe,2),Vi=Si[0],ln=Si[1],fr=(0,ct.useRef)(new Map),no=(0,ct.useRef)(new Ke),wo=(0,ct.useRef)();function ro(){Vt.cancel(wo.current)}function li(){var $t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ro();var xe=function(){fr.current.forEach(function(Kt,yt){if(Kt&&Kt.offsetParent){var me=_e(Kt),Ce=me.offsetHeight;no.current.get(yt)!==Ce&&no.current.set(yt,me.offsetHeight)}}),ln(function(Kt){return Kt+1})};$t?xe():wo.current=Vt(xe)}function St($t,xe){var Ue=Me($t),Kt=fr.current.get(Ue);xe?(fr.current.set(Ue,xe),li()):fr.current.delete(Ue),!Kt!=!xe&&(xe?L==null||L($t):yi==null||yi($t))}return(0,ct.useEffect)(function(){return ro},[]),[St,li,no.current,Vi]}function pi(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Sn=pi()?ct.useLayoutEffect:ct.useEffect,Sr=function(L,yi){var qe=ct.useRef(!0);Sn(function(){return L(qe.current)},yi),Sn(function(){return qe.current=!1,function(){qe.current=!0}},[])},Ki=function(L,yi){Sr(function(qe){if(!qe)return L()},yi)},It=Sr;function tt(Me){var L=ct.useRef();L.current=Me;var yi=ct.useCallback(function(){for(var qe,Si=arguments.length,Vi=new Array(Si),ln=0;ln<Si;ln++)Vi[ln]=arguments[ln];return(qe=L.current)===null||qe===void 0?void 0:qe.call.apply(qe,[L].concat(Vi))},[]);return yi}function de(Me){var L=React.useRef(!1),yi=React.useState(Me),qe=_slicedToArray(yi,2),Si=qe[0],Vi=qe[1];React.useEffect(function(){return L.current=!1,function(){L.current=!0}},[]);function ln(fr,no){no&&L.current||Vi(fr)}return[Si,ln]}function hi(Me){return Me!==void 0}function Ze(Me,L){var yi=L||{},qe=yi.defaultValue,Si=yi.value,Vi=yi.onChange,ln=yi.postState,fr=useState(function(){return hi(Si)?Si:hi(qe)?typeof qe=="function"?qe():qe:typeof Me=="function"?Me():Me}),no=_slicedToArray(fr,2),wo=no[0],ro=no[1],li=Si!==void 0?Si:wo,St=ln?ln(li):li,$t=useEvent(Vi),xe=useState([li]),Ue=_slicedToArray(xe,2),Kt=Ue[0],yt=Ue[1];useLayoutUpdateEffect(function(){var Ce=Kt[0];wo!==Ce&&$t(wo,Ce)},[Kt]),useLayoutUpdateEffect(function(){hi(Si)||ro(Si)},[Si]);var me=useEvent(function(Ce,we){ro(Ce,we),yt([li],we)});return[St,me]}var Ye=j(31461);function Ae(Me,L,yi){var qe=React.useRef({});return(!("value"in qe.current)||yi(qe.current.condition,L))&&(qe.current.value=Me(),qe.current.condition=L),qe.current.value}function Wi(Me,L){typeof Me=="function"?Me(L):_typeof(Me)==="object"&&Me&&"current"in Me&&(Me.current=L)}function En(){for(var Me=arguments.length,L=new Array(Me),yi=0;yi<Me;yi++)L[yi]=arguments[yi];var qe=L.filter(function(Si){return Si});return qe.length<=1?qe[0]:function(Si){L.forEach(function(Vi){Wi(Vi,Si)})}}function an(){for(var Me=arguments.length,L=new Array(Me),yi=0;yi<Me;yi++)L[yi]=arguments[yi];return useMemo(function(){return En.apply(void 0,L)},L,function(qe,Si){return qe.length!==Si.length||qe.every(function(Vi,ln){return Vi!==Si[ln]})})}function vi(Me){var L,yi,qe=isMemo(Me)?Me.type.type:Me.type;return!(typeof qe=="function"&&!((L=qe.prototype)!==null&&L!==void 0&&L.render)||typeof Me=="function"&&!((yi=Me.prototype)!==null&&yi!==void 0&&yi.render))}function ai(Me){return!isValidElement(Me)||isFragment(Me)?!1:vi(Me)}function zi(Me,L,yi,qe){if(!L.length)return yi;var Si=_toArray(L),Vi=Si[0],ln=Si.slice(1),fr;return!Me&&typeof Vi=="number"?fr=[]:Array.isArray(Me)?fr=_toConsumableArray(Me):fr=_objectSpread({},Me),qe&&yi===void 0&&ln.length===1?delete fr[Vi][ln[0]]:fr[Vi]=zi(fr[Vi],ln,yi,qe),fr}function $i(Me,L,yi){var qe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return L.length&&qe&&yi===void 0&&!get(Me,L.slice(0,-1))?Me:zi(Me,L,yi,qe)}function q(Me){return _typeof(Me)==="object"&&Me!==null&&Object.getPrototypeOf(Me)===Object.prototype}function D(Me){return Array.isArray(Me)?[]:{}}var _=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function K(){for(var Me=arguments.length,L=new Array(Me),yi=0;yi<Me;yi++)L[yi]=arguments[yi];var qe=D(L[0]);return L.forEach(function(Si){function Vi(ln,fr){var no=new Set(fr),wo=get(Si,ln),ro=Array.isArray(wo);if(ro||q(wo)){if(!no.has(wo)){no.add(wo);var li=get(qe,ln);ro?qe=$i(qe,ln,[]):(!li||_typeof(li)!=="object")&&(qe=$i(qe,ln,D(wo))),_(wo).forEach(function(St){Vi([].concat(_toConsumableArray(ln),[St]),no)})}}else qe=$i(qe,ln,wo)}Vi([])}),qe}var z={},P=[],bt=function(L){P.push(L)};function Gt(Me,L){if(0)var yi}function Pe(Me,L){if(0)var yi}function He(){z={}}function ei(Me,L,yi){!L&&!z[yi]&&(Me(!1,yi),z[yi]=!0)}function si(Me,L){ei(Gt,Me,L)}function Gi(Me,L){ei(Pe,Me,L)}si.preMessage=bt,si.resetWarned=He,si.noteOnce=Gi;var er=null,rr=10;function Se(Me,L,yi,qe,Si,Vi,ln,fr){var no=ct.useRef(),wo=ct.useState(null),ro=(0,Et.Z)(wo,2),li=ro[0],St=ro[1];return It(function(){if(li&&li.times<rr){if(!Me.current){St(function(Tn){return(0,At.Z)({},Tn)});return}Vi();var $t=li.targetAlign,xe=li.originAlign,Ue=li.index,Kt=li.offset,yt=Me.current.clientHeight,me=!1,Ce=$t,we=null;if(yt){for(var Mt=$t||xe,ie=0,Re=0,_i=0,Qt=Math.min(L.length-1,Ue),ui=0;ui<=Qt;ui+=1){var vr=Si(L[ui]);Re=ie;var Mr=yi.get(vr);_i=Re+(Mr===void 0?qe:Mr),ie=_i}for(var Lr=Mt==="top"?Kt:yt-Kt,gi=Qt;gi>=0;gi-=1){var Ji=Si(L[gi]),Xi=yi.get(Ji);if(Xi===void 0){me=!0;break}if(Lr-=Xi,Lr<=0)break}switch(Mt){case"top":we=Re-Kt;break;case"bottom":we=_i-yt+Kt;break;default:{var zr=Me.current.scrollTop,ho=zr+yt;Re<zr?Ce="top":_i>ho&&(Ce="bottom")}}we!==null&&ln(we),we!==li.lastTop&&(me=!0)}me&&St(function(Tn){return(0,At.Z)((0,At.Z)({},Tn),{},{times:Tn.times+1,targetAlign:Ce,lastTop:we})})}},[li,Me.current]),function($t){if($t==null){fr();return}if(Vt.cancel(no.current),typeof $t=="number")ln($t);else if($t&&(0,vt.Z)($t)==="object"){var xe,Ue=$t.align;"index"in $t?xe=$t.index:xe=L.findIndex(function(me){return Si(me)===$t.key});var Kt=$t.offset,yt=Kt===void 0?0:Kt;St({times:0,index:xe,offset:yt,originAlign:Ue})}}}function We(Me,L,yi,qe){var Si=yi-Me,Vi=L-yi,ln=Math.min(Si,Vi)*2;if(qe<=ln){var fr=Math.floor(qe/2);return qe%2?yi+fr+1:yi-fr}return Si>Vi?yi-(qe-Vi):yi+(qe-Si)}function Go(Me,L,yi){var qe=Me.length,Si=L.length,Vi,ln;if(qe===0&&Si===0)return null;qe<Si?(Vi=Me,ln=L):(Vi=L,ln=Me);var fr={__EMPTY_ITEM__:!0};function no(xe){return xe!==void 0?yi(xe):fr}for(var wo=null,ro=Math.abs(qe-Si)!==1,li=0;li<ln.length;li+=1){var St=no(Vi[li]),$t=no(ln[li]);if(St!==$t){wo=li,ro=ro||St!==no(ln[li+1]);break}}return wo===null?null:{index:wo,multiple:ro}}function $o(Me,L,yi){var qe=ct.useState(Me),Si=(0,Et.Z)(qe,2),Vi=Si[0],ln=Si[1],fr=ct.useState(null),no=(0,Et.Z)(fr,2),wo=no[0],ro=no[1];return ct.useEffect(function(){var li=Go(Vi||[],Me||[],L);(li==null?void 0:li.index)!==void 0&&(yi==null||yi(li.index),ro(Me[li.index])),ln(Me)},[Me]),[wo]}var yo=(typeof navigator=="undefined"?"undefined":(0,vt.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Fr=yo,Ro=function(Me,L){var yi=(0,ct.useRef)(!1),qe=(0,ct.useRef)(null);function Si(){clearTimeout(qe.current),yi.current=!0,qe.current=setTimeout(function(){yi.current=!1},50)}var Vi=(0,ct.useRef)({top:Me,bottom:L});return Vi.current.top=Me,Vi.current.bottom=L,function(ln){var fr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,no=ln<0&&Vi.current.top||ln>0&&Vi.current.bottom;return fr&&no?(clearTimeout(qe.current),yi.current=!1):(!no||yi.current)&&Si(),!yi.current&&no}};function uo(Me,L,yi,qe,Si){var Vi=(0,ct.useRef)(0),ln=(0,ct.useRef)(null),fr=(0,ct.useRef)(null),no=(0,ct.useRef)(!1),wo=Ro(L,yi);function ro(Kt,yt){Vt.cancel(ln.current),Vi.current+=yt,fr.current=yt,!wo(yt)&&(Fr||Kt.preventDefault(),ln.current=Vt(function(){var me=no.current?10:1;Si(Vi.current*me),Vi.current=0}))}function li(Kt,yt){Si(yt,!0),Fr||Kt.preventDefault()}var St=(0,ct.useRef)(null),$t=(0,ct.useRef)(null);function xe(Kt){if(Me){Vt.cancel($t.current),$t.current=Vt(function(){St.current=null},2);var yt=Kt.deltaX,me=Kt.deltaY,Ce=Kt.shiftKey,we=yt,Mt=me;(St.current==="sx"||!St.current&&Ce&&me&&!yt)&&(we=me,Mt=0,St.current="sx");var ie=Math.abs(we),Re=Math.abs(Mt);St.current===null&&(St.current=qe&&ie>Re?"x":"y"),St.current==="y"?ro(Kt,Mt):li(Kt,we)}}function Ue(Kt){Me&&(no.current=Kt.detail===fr.current)}return[xe,Ue]}var Ao=14/15;function fs(Me,L,yi){var qe=(0,ct.useRef)(!1),Si=(0,ct.useRef)(0),Vi=(0,ct.useRef)(null),ln=(0,ct.useRef)(null),fr,no=function(St){if(qe.current){var $t=Math.ceil(St.touches[0].pageY),xe=Si.current-$t;Si.current=$t,yi(xe)&&St.preventDefault(),clearInterval(ln.current),ln.current=setInterval(function(){xe*=Ao,(!yi(xe,!0)||Math.abs(xe)<=.1)&&clearInterval(ln.current)},16)}},wo=function(){qe.current=!1,fr()},ro=function(St){fr(),St.touches.length===1&&!qe.current&&(qe.current=!0,Si.current=Math.ceil(St.touches[0].pageY),Vi.current=St.target,Vi.current.addEventListener("touchmove",no),Vi.current.addEventListener("touchend",wo))};fr=function(){Vi.current&&(Vi.current.removeEventListener("touchmove",no),Vi.current.removeEventListener("touchend",wo))},It(function(){return Me&&L.current.addEventListener("touchstart",ro),function(){var li;(li=L.current)===null||li===void 0||li.removeEventListener("touchstart",ro),fr(),clearInterval(ln.current)}},[Me])}var Ya=20;function Ja(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,yi=Me/L*100;return isNaN(yi)&&(yi=0),yi=Math.max(yi,Ya),yi=Math.min(yi,Me/2),Math.floor(yi)}function jl(Me,L,yi,qe){var Si=ct.useMemo(function(){return[new Map,[]]},[Me,yi.id,qe]),Vi=(0,Et.Z)(Si,2),ln=Vi[0],fr=Vi[1],no=function(ro){var li=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ro,St=ln.get(ro),$t=ln.get(li);if(St===void 0||$t===void 0)for(var xe=Me.length,Ue=fr.length;Ue<xe;Ue+=1){var Kt,yt=Me[Ue],me=L(yt);ln.set(me,Ue);var Ce=(Kt=yi.get(me))!==null&&Kt!==void 0?Kt:qe;if(fr[Ue]=(fr[Ue-1]||0)+Ce,me===ro&&(St=Ue),me===li&&($t=Ue),St!==void 0&&$t!==void 0)break}return{top:fr[St-1]||0,bottom:fr[$t]}};return no}var Na=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],xo=[],rl={overflowY:"auto",overflowAnchor:"none"};function Va(Me,L){var yi=Me.prefixCls,qe=yi===void 0?"rc-virtual-list":yi,Si=Me.className,Vi=Me.height,ln=Me.itemHeight,fr=Me.fullHeight,no=fr===void 0?!0:fr,wo=Me.style,ro=Me.data,li=Me.children,St=Me.itemKey,$t=Me.virtual,xe=Me.direction,Ue=Me.scrollWidth,Kt=Me.component,yt=Kt===void 0?"div":Kt,me=Me.onScroll,Ce=Me.onVirtualScroll,we=Me.onVisibleChange,Mt=Me.innerProps,ie=Me.extraRender,Re=Me.styles,_i=(0,ft.Z)(Me,Na),Qt=!!($t!==!1&&Vi&&ln),ui=Qt&&ro&&(ln*ro.length>Vi||!!Ue),vr=xe==="rtl",Mr=Y()(qe,(0,gt.Z)({},"".concat(qe,"-rtl"),vr),Si),Lr=ro||xo,gi=(0,ct.useRef)(),Ji=(0,ct.useRef)(),Xi=(0,ct.useState)(0),zr=(0,Et.Z)(Xi,2),ho=zr[0],Tn=zr[1],Pi=(0,ct.useState)(0),os=(0,Et.Z)(Pi,2),qr=os[0],bo=os[1],he=(0,ct.useState)(!1),ss=(0,Et.Z)(he,2),Aa=ss[0],Bo=ss[1],Ma=function(){Bo(!0)},Lo=function(){Bo(!1)},Tr=ct.useCallback(function(Fn){return typeof St=="function"?St(Fn):Fn==null?void 0:Fn[St]},[St]),yr={getKey:Tr};function $r(Fn){Tn(function(hn){var _r;typeof Fn=="function"?_r=Fn(hn):_r=Fn;var Or=ni(_r);return gi.current.scrollTop=Or,Or})}var dr=(0,ct.useRef)({start:0,end:Lr.length}),ue=(0,ct.useRef)(),Wo=$o(Lr,Tr),te=(0,Et.Z)(Wo,1),Do=te[0];ue.current=Do;var Co=ki(Tr,null,null),Io=(0,Et.Z)(Co,4),ea=Io[0],Nr=Io[1],Xn=Io[2],fo=Io[3],Ys=ct.useMemo(function(){if(!Qt)return{scrollHeight:void 0,start:0,end:Lr.length-1,offset:void 0};if(!ui){var Fn;return{scrollHeight:((Fn=Ji.current)===null||Fn===void 0?void 0:Fn.offsetHeight)||0,start:0,end:Lr.length-1,offset:void 0}}for(var hn=0,_r,Or,Ai,kl=Lr.length,El=0;El<kl;El+=1){var Ua=Lr[El],Sl=Tr(Ua),xu=Xn.get(Sl),di=hn+(xu===void 0?ln:xu);di>=ho&&_r===void 0&&(_r=El,Or=hn),di>ho+Vi&&Ai===void 0&&(Ai=El),hn=di}return _r===void 0&&(_r=0,Or=0,Ai=Math.ceil(Vi/ln)),Ai===void 0&&(Ai=Lr.length-1),Ai=Math.min(Ai+1,Lr.length-1),{scrollHeight:hn,start:_r,end:Ai,offset:Or}},[ui,Qt,ho,Lr,fo,Vi]),Xo=Ys.scrollHeight,ci=Ys.start,G=Ys.end,Wa=Ys.offset;dr.current.start=ci,dr.current.end=G;var zs=ct.useState({width:0,height:Vi}),Fa=(0,Et.Z)(zs,2),ia=Fa[0],iu=Fa[1],Pu=function(hn){iu({width:hn.width||hn.offsetWidth,height:hn.height||hn.offsetHeight})},Th=(0,ct.useRef)(),rt=(0,ct.useRef)(),ut=ct.useMemo(function(){return Ja(ia.width,Ue)},[ia.width,Ue]),re=ct.useMemo(function(){return Ja(ia.height,Xo)},[ia.height,Xo]),be=Xo-Vi,Ge=(0,ct.useRef)(be);Ge.current=be;function ni(Fn){var hn=Fn;return Number.isNaN(Ge.current)||(hn=Math.min(hn,Ge.current)),hn=Math.max(hn,0),hn}var fe=ho<=0,un=ho>=be,An=Ro(fe,un),xr=function(){return{x:vr?-qr:qr,y:ho}},Ur=(0,ct.useRef)(xr()),Zn=tt(function(){if(Ce){var Fn=xr();(Ur.current.x!==Fn.x||Ur.current.y!==Fn.y)&&(Ce(Fn),Ur.current=Fn)}});function ko(Fn,hn){var _r=Fn;hn?((0,ot.flushSync)(function(){bo(_r)}),Zn()):$r(_r)}function Yo(Fn){var hn=Fn.currentTarget.scrollTop;hn!==ho&&$r(hn),me==null||me(Fn),Zn()}var Oo=function(hn){var _r=hn,Or=Ue-ia.width;return _r=Math.max(_r,0),_r=Math.min(_r,Or),_r},Ms=tt(function(Fn,hn){hn?((0,ot.flushSync)(function(){bo(function(_r){var Or=_r+(vr?-Fn:Fn);return Oo(Or)})}),Zn()):$r(function(_r){var Or=_r+Fn;return Or})}),na=uo(Qt,fe,un,!!Ue,Ms),Tt=(0,Et.Z)(na,2),yn=Tt[0],Yn=Tt[1];fs(Qt,gi,function(Fn,hn){return An(Fn,hn)?!1:(yn({preventDefault:function(){},deltaY:Fn}),!0)}),It(function(){function Fn(_r){Qt&&_r.preventDefault()}var hn=gi.current;return hn.addEventListener("wheel",yn),hn.addEventListener("DOMMouseScroll",Yn),hn.addEventListener("MozMousePixelScroll",Fn),function(){hn.removeEventListener("wheel",yn),hn.removeEventListener("DOMMouseScroll",Yn),hn.removeEventListener("MozMousePixelScroll",Fn)}},[Qt]),It(function(){Ue&&bo(function(Fn){return Oo(Fn)})},[ia.width,Ue]);var Ir=function(){var hn,_r;(hn=Th.current)===null||hn===void 0||hn.delayHidden(),(_r=rt.current)===null||_r===void 0||_r.delayHidden()},ls=Se(gi,Lr,Xn,ln,Tr,function(){return Nr(!0)},$r,Ir);ct.useImperativeHandle(L,function(){return{getScrollInfo:xr,scrollTo:function(hn){function _r(Or){return Or&&(0,vt.Z)(Or)==="object"&&("left"in Or||"top"in Or)}_r(hn)?(hn.left!==void 0&&bo(Oo(hn.left)),ls(hn.top)):ls(hn)}}}),It(function(){if(we){var Fn=Lr.slice(ci,G+1);we(Fn,Lr)}},[ci,G,Lr]);var Jo=jl(Lr,Tr,Xn,ln),ra=ie==null?void 0:ie({start:ci,end:G,virtual:ui,offsetX:qr,offsetY:Wa,rtl:vr,getSize:Jo}),$s=qt(Lr,ci,G,Ue,ea,li,yr),or=null;Vi&&(or=(0,At.Z)((0,gt.Z)({},no?"height":"maxHeight",Vi),rl),Qt&&(or.overflowY="hidden",Ue&&(or.overflowX="hidden"),Aa&&(or.pointerEvents="none")));var eo={};return vr&&(eo.dir="rtl"),ct.createElement("div",(0,Nt.Z)({style:(0,At.Z)((0,At.Z)({},wo),{},{position:"relative"}),className:Mr},eo,_i),ct.createElement(ee.Z,{onResize:Pu},ct.createElement(yt,{className:"".concat(qe,"-holder"),style:or,ref:gi,onScroll:Yo,onMouseEnter:Ir},ct.createElement(Fe,{prefixCls:qe,height:Xo,offsetX:qr,offsetY:Wa,scrollWidth:Ue,onInnerResize:Nr,ref:Ji,innerProps:Mt,rtl:vr,extra:ra},$s))),ui&&Xo>Vi&&ct.createElement(it,{ref:Th,prefixCls:qe,scrollOffset:ho,scrollRange:Xo,rtl:vr,onScroll:ko,onStartMove:Ma,onStopMove:Lo,spinSize:re,containerSize:ia.height,style:Re==null?void 0:Re.verticalScrollBar,thumbStyle:Re==null?void 0:Re.verticalScrollBarThumb}),ui&&Ue&&ct.createElement(it,{ref:rt,prefixCls:qe,scrollOffset:qr,scrollRange:Ue,rtl:vr,onScroll:ko,onStartMove:Ma,onStopMove:Lo,spinSize:ut,containerSize:ia.width,horizontal:!0,style:Re==null?void 0:Re.horizontalScrollBar,thumbStyle:Re==null?void 0:Re.horizontalScrollBarThumb}))}var Kl=ct.forwardRef(Va);Kl.displayName="List";var ga=Kl,Xs=ga},66392:function(Wr,Ti){"use strict";var j;var Nt=Symbol.for("react.element"),At=Symbol.for("react.portal"),vt=Symbol.for("react.fragment"),Et=Symbol.for("react.strict_mode"),gt=Symbol.for("react.profiler"),ft=Symbol.for("react.provider"),ct=Symbol.for("react.context"),ot=Symbol.for("react.server_context"),F=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),Fe=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),Zt;Zt=Symbol.for("react.module.reference");function zt(Q){if(typeof Q=="object"&&Q!==null){var se=Q.$$typeof;switch(se){case Nt:switch(Q=Q.type,Q){case vt:case gt:case Et:case Y:case ee:return Q;default:switch(Q=Q&&Q.$$typeof,Q){case ot:case ct:case F:case Fe:case ne:case ft:return Q;default:return se}}case At:return se}}}j=ct,j=ft,j=Nt,j=F,j=vt,j=Fe,j=ne,j=At,j=gt,j=Et,j=Y,j=ee,j=function(){return!1},j=function(){return!1},j=function(Q){return zt(Q)===ct},j=function(Q){return zt(Q)===ft},j=function(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===Nt},j=function(Q){return zt(Q)===F},j=function(Q){return zt(Q)===vt},j=function(Q){return zt(Q)===Fe},j=function(Q){return zt(Q)===ne},j=function(Q){return zt(Q)===At},j=function(Q){return zt(Q)===gt},j=function(Q){return zt(Q)===Et},j=function(Q){return zt(Q)===Y},j=function(Q){return zt(Q)===ee},j=function(Q){return typeof Q=="string"||typeof Q=="function"||Q===vt||Q===gt||Q===Et||Q===Y||Q===ee||Q===le||typeof Q=="object"&&Q!==null&&(Q.$$typeof===Fe||Q.$$typeof===ne||Q.$$typeof===ft||Q.$$typeof===ct||Q.$$typeof===F||Q.$$typeof===Zt||Q.getModuleId!==void 0)},j=zt},31461:function(Wr,Ti,j){"use strict";j(66392)},84279:function(Wr,Ti,j){"use strict";var Nt=Object.defineProperty,At=Object.defineProperties,vt=Object.getOwnPropertyDescriptors,Et=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,ct=(r,o,u)=>o in r?Nt(r,o,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[o]=u,ot=(r,o)=>{for(var u in o||(o={}))gt.call(o,u)&&ct(r,u,o[u]);if(Et)for(var u of Et(o))ft.call(o,u)&&ct(r,u,o[u]);return r},F=(r,o)=>At(r,vt(o)),Y=r=>typeof r=="symbol"?r:r+"",ee=(r,o)=>{var u={};for(var f in r)gt.call(r,f)&&o.indexOf(f)<0&&(u[f]=r[f]);if(r!=null&&Et)for(var f of Et(r))o.indexOf(f)<0&&ft.call(r,f)&&(u[f]=r[f]);return u};function ne(r){return Array.isArray(r)}var Fe={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function le(){return"window"in globalThis&&"document"in globalThis}function Zt(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function zt(){return typeof navigator.vibrate=="function"}function Q(){var r,o;if(!le())return"other";const u=(o=(r=navigator.userAgentData)==null?void 0:r.platform)!=null?o:navigator.platform;return/^mac/i.test(u)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(u)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function se(){if(!le())return!0;if(/firefox/i.test(navigator.userAgent)){const r=navigator.userAgent.match(/firefox\/(\d+)/i);return r?parseInt(r[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const r=navigator.userAgent.match(/edg\/(\d+)/i);return r?parseInt(r[1])>=79:!1}return!0}function $e(){return HTMLElement.prototype.hasOwnProperty("popover")}var Vt={strings:Fe,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return Vt._locale||(Vt._locale=le()?navigator.language.slice(0,5):"en-US"),Vt._locale},set locale(r){Vt._locale=r,Vt._numberFormatter=void 0,Vt.dirty=!0},get numberFormatter(){return Vt._numberFormatter||(Vt._numberFormatter=new Intl.NumberFormat(Vt.locale)),Vt._numberFormatter},merge(r,o){if(typeof r=="string"&&o)Vt.strings[r]=ot(ot({},Vt.strings[r]),o),Vt.dirty=!0;else for(const u of Object.keys(r))Vt.merge(u,r[u])},get dirty(){return Vt._dirty},set dirty(r){Vt._dirty||Vt._dirty===r||(Vt._dirty=!0,setTimeout(()=>{Vt._dirty=!1,this._subscribers.forEach(o=>o==null?void 0:o())},0))},subscribe(r){return Vt._subscribers.push(r),Vt._subscribers.length-1},unsubscribe(r){r<0||r>=Vt._subscribers.length||(Vt._subscribers[r]=void 0)},update(r){let o=r.querySelectorAll("[data-l10n-tooltip]");for(const u of o){const f=u.getAttribute("data-l10n-tooltip");if(f){const g=Wt(f);g&&u.setAttribute("data-tooltip",g)}}o=r.querySelectorAll("[data-l10n-arial-label]");for(const u of o){const f=u.getAttribute("data-l10n-arial-label");if(f){const g=Wt(f);g&&u.setAttribute("aria-label",g)}}}};function Wt(r,...o){if(r===void 0)return;let u="";const f=Vt.locale;Vt.strings[f]&&(u=Vt.strings[f][r]);const g=f.slice(0,2);if(!u&&Vt.strings[g]&&(u=Vt.strings[g][r]),u||(u=Vt.strings.en[r]),!u)return;const b=/(%@|%([0-9]+)\$@)/g;let M=b.exec(u),N=0;for(;M;){if(o[N++]){const B=M[2]?parseInt(M[2],10)-1:N-1;let U=o[B];typeof U=="number"&&(U=Vt.numberFormatter.format(U)),u=u.replace(M[1],U)}M=b.exec(u)}return u=u.replace(/%%/g,"%"),u}var kt={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},it={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Ot={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},qt={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},Te={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},_e={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function fi(r){var o,u,f,g,b,M;const N=r.split("!");let I,B,U,lt=255,Lt=255,Bt=255,jt=-1;const je=N.length>0&&N[0].startsWith("-");je&&(N[0]=N[0].slice(1));for(let Zi=0;Zi<N.length;Zi++){I=lt,B=Lt,U=Bt;const Le=(o=N[Zi].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:o[1],Ci=Le==null?void 0:Le.toLowerCase(),en=Le&&(M=(b=(g=(f=(u=qt[Ci])!=null?u:qt[Te[Le]])!=null?f:it[Le])!=null?g:_e[Le])!=null?b:kt[Le])!=null?M:N[Zi].trim();let Oi=en.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(Oi!=null&&Oi[1]&&Oi[2]&&Oi[3])lt=Math.max(0,Math.min(255,Number.parseInt(Oi[1],16))),Lt=Math.max(0,Math.min(255,Number.parseInt(Oi[2],16))),Bt=Math.max(0,Math.min(255,Number.parseInt(Oi[3],16)));else if(Oi=en.match(/^#([\da-f]{3})$/i),Oi!=null&&Oi[1]){const hr=Number.parseInt(Oi[1][0],16),Jr=Number.parseInt(Oi[1][1],16),Er=Number.parseInt(Oi[1][2],16);lt=Math.max(0,Math.min(255,hr*16+hr)),Lt=Math.max(0,Math.min(255,Jr*16+Jr)),Bt=Math.max(0,Math.min(255,Er*16+Er))}else if(Oi=en.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),Oi!=null&&Oi[1]&&Oi[2]&&Oi[3])lt=Math.max(0,Math.min(255,Number.parseInt(Oi[1]))),Lt=Math.max(0,Math.min(255,Number.parseInt(Oi[2]))),Bt=Math.max(0,Math.min(255,Number.parseInt(Oi[3])));else return;jt>=0&&(lt=(1-jt)*lt+jt*I,Lt=(1-jt)*Lt+jt*B,Bt=(1-jt)*Bt+jt*U,jt=-1),Zi+1<N.length&&(jt=Math.max(0,Math.min(100,Number.parseInt(N[++Zi])))/100)}return jt>=0&&(lt=jt*lt+(1-jt)*I,Lt=jt*Lt+(1-jt)*B,Bt=jt*Bt+(1-jt)*U),je&&(lt=255-lt,Lt=255-Lt,Bt=255-Bt),"#"+("00"+Math.round(lt).toString(16)).slice(-2)+("00"+Math.round(Lt).toString(16)).slice(-2)+("00"+Math.round(Bt).toString(16)).slice(-2)}function Ht(r){var o,u;return r=r.trim(),(u=(o=Ot[r.toLowerCase()])!=null?o:Ot[Te[r]])!=null?u:fi(r)}function pe(r){if(!r||r[0]!=="#")return;r=r.slice(1);let o;return r.length<=4?(o={r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16)},r.length===4&&(o.a=parseInt(r[3]+r[3],16)/255)):(o={r:parseInt(r[0]+r[1],16),g:parseInt(r[2]+r[3],16),b:parseInt(r[4]+r[5],16)},r.length===8&&(o.a=parseInt(r[6]+r[7],16)/255)),o&&o.a===void 0&&(o.a=1),o}function Ke(r,o,u){return u<0&&(u+=6),u>=6&&(u-=6),u<1?(o-r)*u+r:u<3?o:u<4?(o-r)*(4-u)+r:r}function ki(r){let[o,u,f]=[r.h,r.s,r.l];o=(o+360)%360/60,f=Math.max(0,Math.min(f,1)),u=Math.max(0,Math.min(u,1));const g=f<=.5?f*(u+1):f+u-f*u,b=f*2-g;return{r:Math.round(255*Ke(b,g,o+2)),g:Math.round(255*Ke(b,g,o)),b:Math.round(255*Ke(b,g,o-2))}}function pi(r){return r<0?0:r>255?255:Math.round(r)}function Sn(r){const{r:o,g:u,b:f}=r;let g=((1<<24)+(pi(o)<<16)+(pi(u)<<8)+pi(f)).toString(16).slice(1);return g[0]===g[1]&&g[2]===g[3]&&g[4]===g[5]&&g[6]===g[7]&&(g=g[0]+g[2]+g[4]),"#"+g}function Sr(r){let{r:o,g:u,b:f}=r;o=o/255,u=u/255,f=f/255;const g=Math.min(o,u,f),b=Math.max(o,u,f),M=b-g;let N,I;b===g?N=0:o===b?N=(u-f)/M:u===b?N=2+(f-o)/M:f===b&&(N=4+(o-u)/M),N=Math.min(N*60,360),N<0&&(N+=360);const B=(g+b)/2;return b===g?I=0:B<=.5?I=M/(b+g):I=M/(2-b-g),{h:N,s:I,l:B}}function Ki(r){let o=pe(r);if(!o)return r;let{h:u,s:f,l:g}=Sr(o);return f+=.1,g-=.1,Sn(ki({h:u,s:f,l:g}))}var It={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},tt={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},de=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function hi(r,o,u){if(!/[A-Za-z\d]/.test(r)||(u==="up"&&(u=void 0),!o&&!u))return r;const f=r.codePointAt(0);if(f===void 0)return r;for(const g of de)if((!o||g.variant===o)&&(!u||g.style===u)&&f>=g.offset&&f<g.offset+g.len){const b=g.start+f-g.offset;return String.fromCodePoint(tt[b]||b)}return r}function Ze(r){var o;if((r<119808||r>120831)&&(r<8448||r>8527))return{char:String.fromCodePoint(r)};for(const u in tt)if(tt[u]===r){r=(o=u.codePointAt(0))!=null?o:0;break}for(const u of de)if(r>=u.start&&r<u.start+u.len)return{char:String.fromCodePoint(r-u.start+u.offset),variant:u.variant,style:u.style};return{char:String.fromCodePoint(r)}}function Ye(r){var o;let u="";for(const f of r){if("{}<>[]$&#^_%:'\u02DC".includes(f)){u+=f;continue}const g=(o=f.codePointAt(0))!=null?o:0;let b=It[g];if(b)b.startsWith("\\")?u+=b+" ":u+=b;else{const{char:M,variant:N,style:I}=Ze(g);switch(b=M,N){case"double-struck":b=`\\mathbb{${b}}`;break;case"fraktur":b=`\\mathfrak{${b}}`;break;case"script":b=`\\mathscr{${b}}`;break;case"sans-serif":b=`\\mathsf{${b}}`;break;case"monospace":b=`\\mathtt{${b}}`;break;case"calligraphic":b=`\\mathcal{${b}}`;break}switch(I){case"bold":b=`\\mathbf{${b}}`;break;case"italic":b=`\\mathit{${b}}`;break;case"bolditalic":b=`\\mathbfit{${b}}`;break}u+=b}}return u}function Ae(r){return r?Array.isArray(r)?r:typeof r=="object"&&"group"in r?r.group:[]:[]}var Wi={},En=ot({},It),an={},vi={},ai={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},zi={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},$i={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},q={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:$i},"amsmath.sty":{package:zi,primitive:!0},"texvc.sty":{package:ai,primitive:!1}},D={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},_=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,K,z;se()?(K=new RegExp("\\p{Letter}","u"),z=new RegExp("[0-9\\p{Letter}]","u")):(K=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,z=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function P(r,o,u="mord",f){o!==void 0&&(Wi[r]={definitionType:"symbol",type:u,variant:f,codepoint:o},En[o]||(En[o]=r))}function bt(r,o,u){if(typeof r=="string"){for(let f=0;f<r.length;f++){const g=r.charAt(f);P(g,g.codePointAt(0))}return}for(const[f,g,b,M]of r)P(f,g,b!=null?b:o,M!=null?M:u)}function Gt(r,o){for(let u=r;u<=o;u++)P(String.fromCodePoint(u),u)}function Pe(r){var o;return(o=vi[r])!=null?o:null}function He(r,o){var u,f;if(o.length===0||o==="\\"||!o.startsWith("\\"))return[];const g=[];for(const M in an)M.startsWith(o)&&!an[M].infix&&g.push({match:M,frequency:(u=an[M].frequency)!=null?u:0});for(const M in Wi)M.startsWith(o)&&g.push({match:M,frequency:(f=Wi[M].frequency)!=null?f:0});const b=o.substring(1);for(const M of Object.keys(r.options.macros))M.startsWith(b)&&g.push({match:"\\"+M,frequency:0});return g.sort((M,N)=>{var I,B;return M.frequency===N.frequency?M.match.length===N.match.length?M.match<N.match?-1:1:M.match.length-N.match.length:((I=N.frequency)!=null?I:0)-((B=M.frequency)!=null?B:0)}),g.map(M=>M.match)}function ei(r){let o="auto";const u=r.match(/:([^=]+)/);return u&&(o=u[1].trim()),o}function si(r){if(!r)return[];const o=[];let u=r.split("]");if(u[0].startsWith("[")){o.push({isOptional:!0,type:ei(u[0].slice(1))});for(let f=1;f<=u.length;f++)o.push(...si(u[f]))}else if(u=r.split("}"),u[0].startsWith("{")){o.push({isOptional:!1,type:ei(u[0].slice(1))});for(let f=1;f<=u.length;f++)o.push(...si(u[f]))}return o}function Gi(r){if(!r)return"";let o="",u=!0;for(const f of r)typeof f.value=="string"?o+=f.value:u=!1;return u?o:""}function er(r,o){typeof r=="string"&&(r=[r]);const u={tabular:!1,params:[],createAtom:o};for(const f of r)vi[f]=u}function rr(r,o,u){typeof r=="string"&&(r=[r]);const g={tabular:!0,params:si(o),createAtom:u};for(const b of r)vi[b]=g}function Se(r,o,u){var f,g;u||(u={});const b={definitionType:"function",params:si(o),ifMode:u.ifMode,isFunction:(f=u.isFunction)!=null?f:!1,applyMode:u.applyMode,infix:(g=u.infix)!=null?g:!1,parse:u.parse,createAtom:u.createAtom,applyStyle:u.applyStyle,serialize:u.serialize,render:u.render};if(typeof r=="string")an["\\"+r]=b;else for(const M of r)an["\\"+M]=b}var We;function Go(r){return We||(We=yo(q)),r?yo(ot(ot({},We),r)):We}function $o(r,o){var u,f,g,b;if(typeof r=="string"){let M=0;const N=r;return/(^|[^\\])#1/.test(N)&&(M=1),/(^|[^\\])#2/.test(N)&&(M=2),/(^|[^\\])#3/.test(N)&&(M=3),/(^|[^\\])#4/.test(N)&&(M=4),/(^|[^\\])#5/.test(N)&&(M=5),/(^|[^\\])#6/.test(N)&&(M=6),/(^|[^\\])#7/.test(N)&&(M=7),/(^|[^\\])#8/.test(N)&&(M=8),/(^|[^\\])#9/.test(N)&&(M=9),{expand:(u=o==null?void 0:o.expand)!=null?u:!0,captureSelection:(f=o==null?void 0:o.captureSelection)!=null?f:!0,args:M,def:N}}return ot({expand:(g=o==null?void 0:o.expand)!=null?g:!0,captureSelection:(b=o==null?void 0:o.captureSelection)!=null?b:!0,args:0},r)}function yo(r){if(!r)return{};const o={};for(const u of Object.keys(r)){const f=r[u];if(f==null)delete o[u];else if(typeof f=="object"&&"package"in f)for(const g of Object.keys(f.package))o[g]=$o(f.package[g],{expand:!f.primitive,captureSelection:f.captureSelection});else o[u]=$o(f)}return o}function Fr(r,o="math"){if(!r||r.length===0)return null;let u=null;if(r.startsWith("\\")){if(u=an[r],u)return!u.ifMode||u.ifMode===o?u:null;o==="math"?u=Wi[r]:D[r]&&(u={definitionType:"symbol",type:"mord",codepoint:D[r]})}else if(o==="math"){if(u=Wi[r],!u&&r.length===1){const f=uo("math",r.codePointAt(0));return f.startsWith("\\")?F(ot({},Fr(f,"math")),{command:f}):null}}else D[r]?u={definitionType:"symbol",type:"mord",codepoint:D[r]}:o==="text"&&(u={definitionType:"symbol",type:"mord",codepoint:r.codePointAt(0)});return u!=null?u:null}function Ro(r,o){if(!r.startsWith("\\"))return null;const u=r.slice(1);return o[u]}function uo(r,o){if(o===void 0)return"";if(r==="math"&&En[o])return En[o];if(r==="text"){const u=Object.keys(D).find(f=>D[f]===o);return u||String.fromCodePoint(o)}return String.fromCodePoint(o)}var Ao=[0,.68889,0,0,.72222],fs=[0,.68889,0,0,.66667],Ya=[0,.68889,0,0,.77778],Ja=[0,.68889,0,0,.61111],jl=[.16667,.68889,0,0,.77778],Na=[0,.68889,0,0,.55556],xo=[0,0,0,0,.25],rl=[0,.825,0,0,2.33334],Va=[0,.9,0,0,2.33334],Kl=[0,.68889,0,0,.54028],ga=[-.03598,.46402,0,0,.5],Xs=[-.13313,.36687,0,0,1],Me=[.01354,.52239,0,0,1],L=[.01354,.52239,0,0,1.11111],yi=[0,.54986,0,0,1],qe=[0,.69224,0,0,.5],Si=[0,.43056,0,0,1],Vi=[.08198,.58198,0,0,.77778],ln=[.19444,.69224,0,0,.41667],fr=[.1808,.675,0,0,1],no=[.19444,.69224,0,0,.83334],wo=[.13667,.63667,0,0,1],ro=[-.064,.437,0,0,1.334],li=[.08167,.58167,0,0,.77778],St=[0,.69224,0,0,.72222],$t=[0,.69224,0,0,.66667],xe=[-.13313,.36687,0,0,.77778],Ue=[.06062,.54986,0,0,.77778],Kt=[0,.69224,0,0,.77778],yt=[.25583,.75583,0,0,.77778],me=[.25142,.75726,0,0,.77778],Ce=[.20576,.70576,0,0,.77778],we=[.30274,.79383,0,0,.77778],Mt=[.22958,.72958,0,0,.77778],ie=[.1808,.675,0,0,.77778],Re=[.13667,.63667,0,0,.77778],_i=[.13597,.63597,0,0,.77778],Qt=[.03517,.54986,0,0,.77778],ui=[0,.675,0,0,.77778],vr=[.19444,.69224,0,0,.61111],Mr=[0,.54986,0,0,.76042],Lr=[0,.54986,0,0,.66667],gi=[.0391,.5391,0,0,.77778],Ji=[.03517,.54986,0,0,1.33334],Xi=[.38569,.88569,0,0,.77778],zr=[.23222,.74111,0,0,.77778],ho=[.19444,.69224,0,0,.77778],Tn=[0,.37788,0,0,.5],Pi=[0,.54986,0,0,.72222],os=[0,.69224,0,0,.83334],qr=[.11111,.69224,0,0,.66667],bo=[.26167,.75726,0,0,.77778],he=[.48256,.98256,0,0,.77778],ss=[.28481,.79383,0,0,.77778],Aa=[.08167,.58167,0,0,.22222],Bo=[.08167,.58167,0,0,.38889],Ma=[0,.43056,.04028,0,.66667],Lo=[.41951,.91951,0,0,.77778],Tr=[.24982,.74947,0,0,.38865],yr=[.08319,.58283,0,0,.75623],$r=[0,.10803,0,0,.27764],dr=[0,.47534,0,0,.50181],ue=[.18906,.47534,0,0,.50181],Wo=[0,.69141,0,0,.50181],te=[.24982,.74947,0,0,.27764],Do=[0,.69141,0,0,.21471],Co=[.25,.75,0,0,.44722],Io=[0,.64444,0,0,.575],ea=[.08556,.58556,0,0,.89444],Nr=[0,.69444,0,0,.89444],Xn=[0,.68611,0,0,.9],fo=[0,.68611,0,0,.86944],Ys=[.25,.75,0,0,.575],Xo=[.25,.75,0,0,.31944],ci=[0,.69444,0,0,.63889],G=[0,.69444,0,0,.31944],Wa=[0,.44444,0,0,.63889],zs=[0,.44444,0,0,.51111],Fa=[0,.69444,0,0,.575],ia=[.13333,.63333,0,0,.89444],iu=[0,.44444,0,0,.31944],Pu=[0,.69444,0,0,.86944],Th=[0,.68611,0,0,.69166],rt=[0,.68611,0,0,.83055],ut=[0,.68611,0,0,.89444],re=[0,.69444,0,0,.60278],be=[.19444,.69444,0,0,.51111],Ge=[0,.69444,0,0,.83055],ni=[-.10889,.39111,0,0,1.14999],fe=[.19444,.69444,0,0,.575],un=[.19444,.69444,0,0,1.14999],An=[.19444,.69444,0,0,.70277],xr=[.05556,.75,0,0,.575],Ur=[0,.68611,0,0,.95833],Zn=[.08556,.58556,0,0,.76666],ko=[-.02639,.47361,0,0,.575],Yo=[0,.44444,0,0,.89444],Oo=[0,.55556,0,0,.76666],Ms=[-.10889,.39111,0,0,.89444],na=[.00222,.50222,0,0,.89444],Tt=[.19667,.69667,0,0,.89444],yn=[.08556,.58556,0,0,1.14999],Yn=[0,.69444,0,0,.70277],Ir=[-.02778,.47222,0,0,.575],ls=[.25,.75,0,0,.51111],Jo=[-.13889,.36111,0,0,1.14999],ra=[.19444,.69444,0,0,1.02222],$s=[.12963,.69444,0,0,.89444],or=[.19444,.69444,0,0,.44722],eo=[0,.64444,.13167,0,.59111],Fn=[.19444,.64444,.13167,0,.59111],hn=[0,.68611,.17208,0,.8961],_r=[.19444,.44444,.105,0,.53222],Or=[0,.44444,.085,0,.82666],Ai=[0,.69444,.06709,0,.59111],kl=[0,.69444,.12945,0,.35555],El=[0,.69444,0,0,.94888],Ua=[0,.69444,.11472,0,.59111],Sl=[0,.68611,.10778,0,.88555],xu=[0,.69444,.07939,0,.62055],di=[0,.69444,.12417,0,.30667],jr=[0,.64444,.13556,0,.51111],Fo=[.19444,.64444,.13556,0,.51111],Ca=[0,.68333,.16389,0,.74333],Ll=[.19444,.43056,.08847,0,.46],ol=[0,.43056,.07514,0,.71555],_n=[0,.69444,.06646,0,.51111],Za=[0,.69444,0,0,.83129],nu=[0,.69444,.1225,0,.51111],Tl=[0,.68333,.09403,0,.76666],uu=[0,.68333,.11111,0,.76666],_h=[0,.69444,.06961,0,.51444],hu=[0,.69444,0,0,.27778],ml=[.25,.75,0,0,.38889],sl=[0,.64444,0,0,.5],Js=[0,.69444,0,0,.77778],$u=[0,.68333,0,0,.75],Nu=[0,.68333,0,0,.77778],df=[0,.68333,0,0,.68056],jh=[0,.68333,0,0,.72222],cu=[.25,.75,0,0,.5],Zu=[.25,.75,0,0,.27778],js=[0,.69444,0,0,.5],gh=[0,.69444,0,0,.55556],yc=[0,.43056,0,0,.44445],Gu=[0,.43056,0,0,.5],ds=[.19444,.43056,0,0,.55556],xc=[0,.43056,0,0,.55556],za=[.08333,.58333,0,0,.77778],wu=[0,.43056,0,0,.27778],fu=[0,.66786,0,0,.27778],al=[0,.69444,0,0,.75],gl=[0,.66786,0,0,.5],qa=[0,.68333,0,0,.625],ka=[.19444,.69444,0,0,.44445],bu=[0,.69444,0,0,.72222],rc=[.19444,.69444,0,0,.5],Hs=[.19444,.69444,0,0,1],Xc=[.011,.511,0,0,1.126],wc=[.19444,.69444,0,0,.61111],bc=[.05556,.75,0,0,.5],dn=[0,.68333,0,0,.83334],Oc=[.0391,.5391,0,0,.66667],xt=[-.05555,.44445,0,0,.5],ve=[0,.43056,0,0,.77778],Kh=[0,.55556,0,0,.66667],Sc=[-.03625,.46375,0,0,.77778],Ph=[-.01688,.48312,0,0,.77778],Nh=[.0391,.5391,0,0,1],Su=[0,.69444,0,0,.61111],Mc=[-.03472,.46528,0,0,.5],Cc=[.25,.75,0,0,.44445],fa=[-.14236,.35764,0,0,1],zn=[.244,.744,0,0,.412],vl=[.19444,.69444,0,0,.88889],Al=[.12963,.69444,0,0,.77778],oa=[.19444,.69444,0,0,.38889],po=[.011,.511,0,0,1.638],$a=[.19444,.69444,0,0,0],ps=[0,.44444,0,0,.575],sr=[.19444,.44444,0,0,.575],Vs=[0,.68611,0,0,.75555],_s=[0,.69444,0,0,.66759],sa=[0,.68611,0,0,.80555],mo=[0,.68611,.08229,0,.98229],Hl=[0,.68611,0,0,.76666],us=[0,.44444,0,0,.58472],qs=[.19444,.44444,0,0,.6118],aa=[.19444,.43056,0,0,.5],Ga=[0,.68333,.02778,.08334,.76278],ms=[0,.68333,.08125,.05556,.83125],pf=[0,.43056,0,.05556,.48472],Jn=[.19444,.43056,0,.08334,.51702],Ad=[.25,.75,0,0,.42778],Rr=[0,.69444,0,0,.55],kc=[0,.69444,0,0,.73334],Ah=[0,.69444,0,0,.79445],Pf=[0,.69444,0,0,.51945],Yf=[0,.69444,0,0,.70278],mf=[0,.69444,0,0,.76389],Hh=[.25,.75,0,0,.34306],Rc=[0,.69444,0,0,.56111],as=[0,.69444,0,0,.25556],oc=[.19444,.45833,0,0,.56111],Jf=[0,.45833,0,0,.56111],oh=[0,.69444,0,0,.30556],dd=[0,.69444,0,0,.58056],sc=[0,.69444,0,0,.67223],Mu=[0,.69444,0,0,.85556],Ec=[0,.69444,0,0,.55834],Z=[0,.65556,.11156,0,.5],ht=[0,.69444,.08094,0,.70834],wt=[.17014,0,0,0,.44445],Ft=[0,.69444,.0799,0,.5],Ut=[0,.69444,0,0,.73752],Ie=[0,.69444,.09205,0,.5],ke=[0,.69444,.09031,0,.77778],Ri=[0,.69444,.07816,0,.27778],qi=[0,.69444,.00316,0,.5],fn=[.19444,.69444,0,0,.83334],Ar=[.05556,.75,0,0,.83334],qn=[0,.75,0,0,.5],Dn=[.125,.08333,0,0,.27778],$n=[0,.08333,0,0,.27778],Di=[0,.65556,0,0,.5],Wn=[0,.69444,0,0,.47222],Ln=[0,.69444,0,0,.66667],cr=[0,.69444,0,0,.59722],wr=[0,.69444,0,0,.54167],xn=[0,.69444,0,0,.70834],Qi=[.25,.75,0,0,.28889],So=[0,.69444,0,0,.51667],jo=[0,.44444,0,0,.44445],go=[.19444,.44444,0,0,.51667],Ko=[0,.44444,0,0,.38333],Zr=[0,.44444,0,0,.51667],zo=[0,.69444,0,0,.83334],da=[.35001,.85,0,0,.45834],Cs=[.35001,.85,0,0,.57778],ys=[.35001,.85,0,0,.41667],pa=[.35001,.85,0,0,.58334],Cr=[0,.72222,0,0,.55556],Qr=[1e-5,.6,0,0,.66667],io=[1e-5,.6,0,0,.77778],Ps=[.25001,.75,0,0,.94445],xs=[.306,.805,.19445,0,.47222],Ns=[.30612,.805,.19445,0,.47222],gs=[.25001,.75,0,0,.83334],la=[.35001,.85,0,0,.47222],Da=[.25001,.75,0,0,1.11111],Ks=[.65002,1.15,0,0,.59722],va=[.65002,1.15,0,0,.81111],oo=[.65002,1.15,0,0,.47222],vs=[.65002,1.15,0,0,.66667],ks=[0,.75,0,0,1],Ia=[.55001,1.05,0,0,1.27778],ll=[.862,1.36,.44445,0,.55556],ja=[.86225,1.36,.44445,0,.55556],Oa=[.55001,1.05,0,0,1.11111],Qa=[.65002,1.15,0,0,.52778],mr=[.65002,1.15,0,0,.61111],Dl=[.55001,1.05,0,0,1.51112],ul=[.95003,1.45,0,0,.73611],Cu=[.95003,1.45,0,0,1.04445],To=[.95003,1.45,0,0,.52778],Au=[.95003,1.45,0,0,.75],Ml=[0,.75,0,0,1.44445],du=[.95003,1.45,0,0,.58334],pu=[1.25003,1.75,0,0,.79167],yl=[1.25003,1.75,0,0,1.27778],Xu=[1.25003,1.75,0,0,.58334],ru=[1.25003,1.75,0,0,.80556],ya=[0,.825,0,0,1.8889],ju=[1.25003,1.75,0,0,.63889],hl=[.64502,1.155,0,0,.875],Qs=[1e-5,.6,0,0,.875],Il=[-99e-5,.601,0,0,.66667],Es=[.64502,1.155,0,0,.66667],R=[1e-5,.9,0,0,.88889],V=[.65002,1.15,0,0,.88889],at=[.90001,0,0,0,.88889],dt=[-.00499,.605,0,0,1.05556],Dt=[0,.12,0,0,.45],_t=[0,.61111,0,0,.525],Xt=[.08333,.69444,0,0,.525],Ne=[-.08056,.53055,0,0,.525],Xe=[-.05556,.55556,0,0,.525],ze=[0,.43056,0,0,.525],Qe=[.22222,.43056,0,0,.525],Be=[0,0,0,0,.525],xi={"AMS-Regular":{32:xo,65:Ao,66:fs,67:Ao,68:Ao,69:fs,70:Ja,71:Ya,72:Ya,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:Ya,76:fs,77:[0,.68889,0,0,.94445],78:Ao,79:jl,80:Ja,81:jl,82:Ao,83:Na,84:fs,85:Ao,86:Ao,87:[0,.68889,0,0,1],88:Ao,89:Ao,90:fs,107:Na,160:xo,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:Na,295:Kl,710:rl,732:Va,770:rl,771:Va,989:li,1008:Ma,8245:[0,.54986,0,0,.275],8463:Kl,8487:Ao,8498:Na,8502:fs,8503:[0,.68889,0,0,.44445],8504:fs,8513:[0,.68889,0,0,.63889],8592:ga,8594:ga,8602:Xs,8603:Xs,8606:Me,8608:Me,8610:L,8611:L,8619:yi,8620:yi,8621:[-.13313,.37788,0,0,1.38889],8622:Xs,8624:qe,8625:qe,8630:Si,8631:Si,8634:Vi,8635:Vi,8638:ln,8639:ln,8642:ln,8643:ln,8644:fr,8646:fr,8647:fr,8648:no,8649:fr,8650:no,8651:Me,8652:Me,8653:Xs,8654:Xs,8655:Xs,8666:wo,8667:wo,8669:[-.13313,.37788,0,0,1],8672:ro,8674:ro,8705:[0,.825,0,0,.5],8708:Na,8709:li,8717:[0,.43056,0,0,.42917],8722:ga,8724:[.08198,.69224,0,0,.77778],8726:li,8733:Kt,8736:St,8737:St,8738:[.03517,.52239,0,0,.72222],8739:Aa,8740:[.25142,.74111,0,0,.27778],8741:Bo,8742:[.25142,.74111,0,0,.5],8756:$t,8757:$t,8764:xe,8765:[-.13313,.37788,0,0,.77778],8769:xe,8770:Sc,8774:we,8776:Ph,8778:li,8782:Ue,8783:Ue,8785:Vi,8786:Vi,8787:Vi,8790:Kt,8791:Mt,8796:[.08198,.91667,0,0,.77778],8806:yt,8807:yt,8808:me,8809:me,8812:[.25583,.75583,0,0,.5],8814:Ce,8815:Ce,8816:we,8817:we,8818:Mt,8819:Mt,8822:ie,8823:ie,8828:Re,8829:Re,8830:Mt,8831:Mt,8832:Ce,8833:Ce,8840:we,8841:we,8842:_i,8843:_i,8847:Qt,8848:Qt,8858:Vi,8859:Vi,8861:Vi,8862:ui,8863:ui,8864:ui,8865:ui,8872:[0,.69224,0,0,.61111],8873:St,8874:[0,.69224,0,0,.88889],8876:Ja,8877:Ja,8878:Ao,8879:Ao,8882:Qt,8883:Qt,8884:Re,8885:Re,8888:[0,.54986,0,0,1.11111],8890:ds,8891:vr,8892:vr,8901:[0,.54986,0,0,.27778],8903:li,8905:li,8906:li,8907:Kt,8908:Kt,8909:[-.03598,.46402,0,0,.77778],8910:Mr,8911:Mr,8912:Qt,8913:Qt,8914:Lr,8915:Lr,8916:$t,8918:gi,8919:gi,8920:Ji,8921:Ji,8922:Xi,8923:Xi,8926:Re,8927:Re,8928:we,8929:we,8934:zr,8935:zr,8936:zr,8937:zr,8938:Ce,8939:Ce,8940:we,8941:we,8994:ho,8995:ho,9416:[.15559,.69224,0,0,.90222],9484:qe,9488:qe,9492:Tn,9496:Tn,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:ui,9633:ui,9650:Pi,9651:Pi,9654:Qt,9660:Pi,9661:Pi,9664:Qt,9674:qr,9733:[.19444,.69224,0,0,.94445],10003:os,10016:os,10731:qr,10846:[.19444,.75583,0,0,.61111],10877:Re,10878:Re,10885:yt,10886:yt,10887:_i,10888:_i,10889:bo,10890:bo,10891:he,10892:he,10901:Re,10902:Re,10933:me,10934:me,10935:bo,10936:bo,10937:bo,10938:bo,10949:yt,10950:yt,10955:ss,10956:ss,57350:Aa,57351:Bo,57352:li,57353:Ma,57356:me,57357:me,57358:Lo,57359:we,57360:we,57361:Lo,57366:me,57367:me,57368:me,57369:me,57370:_i,57371:_i},"Caligraphic-Regular":{32:xo,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:xo},"Fraktur-Regular":{32:xo,33:[0,.69141,0,0,.29574],34:Do,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:Tr,41:Tr,42:[0,.62119,0,0,.27764],43:yr,44:$r,45:yr,46:$r,47:[.24982,.74947,0,0,.50181],48:dr,49:dr,50:dr,51:ue,52:ue,53:ue,54:Wo,55:ue,56:Wo,57:ue,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:te,93:te,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:xo,8216:Do,8217:Do,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:xo,33:[0,.69444,0,0,.35],34:re,35:[.19444,.69444,0,0,.95833],36:xr,37:[.05556,.75,0,0,.95833],38:Nr,39:G,40:Co,41:Co,42:[0,.75,0,0,.575],43:ia,44:[.19444,.15556,0,0,.31944],45:Ko,46:[0,.15556,0,0,.31944],47:Ys,48:Io,49:Io,50:Io,51:Io,52:Io,53:Io,54:Io,55:Io,56:Io,57:Io,58:iu,59:[.19444,.44444,0,0,.31944],60:ea,61:Ms,62:ea,63:[0,.69444,0,0,.54305],64:Nr,65:fo,66:[0,.68611,0,0,.81805],67:rt,68:[0,.68611,0,0,.88194],69:Vs,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Xn,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Th,77:[0,.68611,0,0,1.09166],78:Xn,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:fo,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Xo,92:Ys,93:Xo,94:Fa,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:ci,99:zs,100:ci,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:ci,105:G,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:G,109:[0,.44444,0,0,.95833],110:Wa,111:ps,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:Wa,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:zs,123:Ys,124:Xo,125:Ys,126:[.35,.34444,0,0,.575],160:xo,163:[0,.69444,0,0,.86853],168:Fa,172:[0,.44444,0,0,.76666],176:Pu,177:ia,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:ia,216:[.04861,.73472,0,0,.89444],223:cr,230:[0,.44444,0,0,.83055],247:ia,248:[.09722,.54167,0,0,.575],305:iu,338:[0,.68611,0,0,1.16944],339:Yo,567:[.19444,.44444,0,0,.35139],710:Fa,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Fa,715:Fa,728:Fa,729:G,730:Pu,732:Fa,733:Fa,915:Th,916:Ur,920:ut,923:sa,926:Hl,928:Xn,931:rt,933:ut,934:rt,936:ut,937:rt,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:G,8217:G,8220:re,8221:re,8224:be,8225:be,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:_s,8465:Ge,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:Ge,8501:Yn,8592:ni,8593:fe,8594:ni,8595:fe,8596:ni,8597:Ys,8598:un,8599:un,8600:un,8601:un,8636:ni,8637:ni,8640:ni,8641:ni,8656:ni,8657:An,8658:ni,8659:An,8660:ni,8661:[.25,.75,0,0,.70277],8704:ci,8706:[0,.69444,.06389,0,.62847],8707:ci,8709:xr,8711:Ur,8712:Zn,8715:Zn,8722:ia,8723:ia,8725:Ys,8726:Ys,8727:Ir,8728:ko,8729:ko,8730:[.18,.82,0,0,.95833],8733:Yo,8734:[0,.44444,0,0,1.14999],8736:St,8739:Xo,8741:Ys,8743:Oo,8744:Oo,8745:Oo,8746:Oo,8747:[.19444,.69444,.12778,0,.56875],8764:Ms,8768:[.19444,.69444,0,0,.31944],8771:na,8776:[.02444,.52444,0,0,.89444],8781:na,8801:na,8804:Tt,8805:Tt,8810:yn,8811:yn,8826:ea,8827:ea,8834:ea,8835:ea,8838:Tt,8839:Tt,8846:Oo,8849:Tt,8850:Tt,8851:Oo,8852:Oo,8853:ia,8854:ia,8855:ia,8856:ia,8857:ia,8866:Yn,8867:Yn,8868:Nr,8869:Nr,8900:ko,8901:[-.02639,.47361,0,0,.31944],8902:Ir,8968:ls,8969:ls,8970:ls,8971:ls,8994:Jo,8995:Jo,9651:ra,9657:Ir,9661:ra,9667:Ir,9711:un,9824:$s,9825:$s,9826:$s,9827:$s,9837:[0,.75,0,0,.44722],9838:or,9839:or,10216:Co,10217:Co,10815:Xn,10927:Tt,10928:Tt,57376:$a},"Main-BoldItalic":{32:xo,33:[0,.69444,.11417,0,.38611],34:xu,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:kl,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:eo,49:eo,50:eo,51:eo,52:Fn,53:eo,54:eo,55:Fn,56:eo,57:eo,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Ua,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:hn,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:hn,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:Ai,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:_r,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:_r,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:xo,168:[0,.69444,.11473,0,.59111],176:El,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:Or,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:Or,567:[.19444,.44444,.04611,0,.385],710:Ai,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:kl,730:El,732:Ua,733:Ua,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:hn,931:[0,.68611,.11431,0,.82666],933:Sl,934:[0,.68611,.05632,0,.82666],936:Sl,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:kl,8217:kl,8220:[0,.69444,.16772,0,.62055],8221:xu},"Main-Italic":{32:xo,33:di,34:_h,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:di,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:jr,49:jr,50:jr,51:jr,52:Fo,53:jr,54:jr,55:Fo,56:jr,57:jr,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:nu,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:Ca,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:Ca,79:Tl,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:Ca,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:_n,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:Ll,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:Ll,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:xo,168:[0,.66786,.10474,0,.51111],176:Za,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:ol,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:ol,710:_n,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Za,732:[0,.66786,.11585,0,.51111],733:nu,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Tl,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Ca,931:[0,.68333,.12028,0,.71555],933:uu,934:[0,.68333,.05986,0,.71555],936:uu,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:di,8217:di,8220:[0,.69444,.1685,0,.51444],8221:_h,8463:Kl},"Main-Regular":{32:xo,33:hu,34:js,35:fn,36:bc,37:Ar,38:Js,39:hu,40:ml,41:ml,42:qn,43:za,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:cu,48:sl,49:sl,50:sl,51:sl,52:sl,53:sl,54:sl,55:sl,56:sl,57:sl,58:wu,59:[.19444,.43056,0,0,.27778],60:gi,61:xe,62:gi,63:Wn,64:Js,65:$u,66:[0,.68333,0,0,.70834],67:jh,68:[0,.68333,0,0,.76389],69:df,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:$u,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Nu,76:qa,77:[0,.68333,0,0,.91667],78:$u,79:Nu,80:df,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:jh,85:$u,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:$u,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Zu,92:cu,93:Zu,94:js,95:[.31,.12056,.02778,0,.5],97:Gu,98:gh,99:yc,100:gh,101:yc,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:gh,105:fu,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:hu,109:[0,.43056,0,0,.83334],110:xc,111:Gu,112:ds,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:xc,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:yc,123:cu,124:Zu,125:cu,126:[.35,.31786,0,0,.5],160:xo,163:[0,.69444,0,0,.76909],167:ka,168:gl,172:[0,.43056,0,0,.66667],176:al,177:za,182:wc,184:wt,198:[0,.68333,0,0,.90278],215:za,216:[.04861,.73194,0,0,.77778],223:js,230:[0,.43056,0,0,.72222],247:za,248:[.09722,.52778,0,0,.5],305:wu,338:[0,.68333,0,0,1.01389],339:ve,567:[.19444,.43056,0,0,.30556],710:js,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:js,715:js,728:js,729:fu,730:al,732:gl,733:js,915:qa,916:dn,920:Nu,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:$u,931:jh,933:Nu,934:jh,936:Nu,937:jh,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:hu,8217:hu,8220:js,8221:js,8224:ka,8225:ka,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Kl,8465:bu,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:bu,8501:Su,8592:Xs,8593:rc,8594:Xs,8595:rc,8596:Xs,8597:cu,8598:Hs,8599:Hs,8600:Hs,8601:Hs,8614:[.011,.511,0,0,1],8617:Xc,8618:Xc,8636:Xs,8637:Xs,8640:Xs,8641:Xs,8652:[.011,.671,0,0,1],8656:Xs,8657:wc,8658:Xs,8659:wc,8660:Xs,8661:[.25,.75,0,0,.61111],8704:gh,8706:[0,.69444,.05556,.08334,.5309],8707:gh,8709:bc,8711:dn,8712:Oc,8715:Oc,8722:za,8723:za,8725:cu,8726:cu,8727:Mc,8728:xt,8729:xt,8730:[.2,.8,0,0,.83334],8733:ve,8734:Si,8736:St,8739:Zu,8741:cu,8743:Kh,8744:Kh,8745:Kh,8746:Kh,8747:[.19444,.69444,.11111,0,.41667],8764:xe,8768:[.19444,.69444,0,0,.27778],8771:Sc,8773:[-.022,.589,0,0,1],8776:Ph,8781:Sc,8784:[-.133,.67,0,0,.778],8801:Sc,8804:_i,8805:_i,8810:Nh,8811:Nh,8826:gi,8827:gi,8834:gi,8835:gi,8838:_i,8839:_i,8846:Kh,8849:_i,8850:_i,8851:Kh,8852:Kh,8853:za,8854:za,8855:za,8856:za,8857:za,8866:Su,8867:Su,8868:Js,8869:Js,8872:[.249,.75,0,0,.867],8900:xt,8901:[-.05555,.44445,0,0,.27778],8902:Mc,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:Cc,8969:Cc,8970:Cc,8971:Cc,8994:fa,8995:fa,9136:zn,9137:zn,9651:vl,9657:Mc,9661:vl,9667:Mc,9711:Hs,9824:Al,9825:Al,9826:Al,9827:Al,9837:[0,.75,0,0,.38889],9838:oa,9839:oa,10216:ml,10217:ml,10222:zn,10223:zn,10229:[.011,.511,0,0,1.609],10230:po,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:po,10815:$u,10927:_i,10928:_i,57376:$a},"Math-BoldItalic":{32:xo,48:ps,49:ps,50:ps,51:sr,52:sr,53:sr,54:Io,55:sr,56:Io,57:sr,65:fo,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:mo,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Vs,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:_s,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:us,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:xo,915:[0,.68611,.15972,0,.65694],916:Ur,920:[0,.68611,.03194,0,.86722],923:sa,926:[0,.68611,.07458,0,.84125],928:mo,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Hl,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:us,960:[0,.44444,.03704,0,.68241],961:qs,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:qs,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:xo,48:Gu,49:Gu,50:Gu,51:aa,52:aa,53:aa,54:sl,55:aa,56:sl,57:aa,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:ms,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:Ga,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:pf,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:xo,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Ga,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:ms,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:pf,960:[0,.43056,.03588,0,.57003],961:Jn,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:Jn,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:xo,33:[0,.69444,0,0,.36667],34:Ec,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:oh,40:Ad,41:Ad,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:Rr,49:Rr,50:Rr,51:Rr,52:Rr,53:Rr,54:Rr,55:Rr,56:Rr,57:Rr,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:Pf,64:kc,65:kc,66:kc,67:Yf,68:Ah,69:[0,.69444,0,0,.64167],70:Su,71:kc,72:Ah,73:[0,.69444,0,0,.33056],74:Pf,75:mf,76:dd,77:[0,.69444,0,0,.97778],78:Ah,79:Ah,80:Yf,81:[.10556,.69444,0,0,.79445],82:Yf,83:Su,84:kc,85:mf,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:kc,89:[0,.69444,.0275,0,.73334],90:sc,91:Hh,93:Hh,94:Rr,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Rc,99:[0,.45833,0,0,.48889],100:Rc,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Rc,105:as,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:as,109:[0,.45833,0,0,.86667],110:Jf,111:[0,.45833,0,0,.55],112:oc,113:oc,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Jf,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:xo,168:Rr,176:kc,180:Rr,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Rr,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Rr,729:oh,730:kc,732:Rr,733:Rr,915:dd,916:[0,.69444,0,0,.91667],920:Mu,923:sc,926:kc,928:Ah,931:Ah,933:Mu,934:Ah,936:Mu,937:Ah,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:oh,8217:oh,8220:Ec,8221:Ec},"SansSerif-Italic":{32:xo,33:[0,.69444,.05733,0,.31945],34:qi,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:Ri,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:Dn,45:[0,.44444,.01946,0,.33333],46:$n,47:[.25,.75,.13164,0,.5],48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:Ln,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:ht,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:wr,77:[0,.69444,.08094,0,.875],78:ht,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:Ft,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:xo,168:[0,.67937,.06385,0,.5],176:Ut,184:wt,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Ft,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Ie,715:js,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Ut,732:[0,.67659,.08826,0,.5],733:Ie,915:[0,.69444,.13372,0,.54167],916:zo,920:[0,.69444,.07555,0,.77778],923:Su,926:[0,.69444,.12816,0,.66667],928:ht,931:[0,.69444,.11983,0,.72222],933:ke,934:[0,.69444,.04603,0,.72222],936:ke,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Ri,8217:Ri,8220:[0,.69444,.14205,0,.5],8221:qi},"SansSerif-Regular":{32:xo,33:[0,.69444,0,0,.31945],34:js,35:fn,36:bc,37:Ar,38:[0,.69444,0,0,.75834],39:hu,40:ml,41:ml,42:qn,43:za,44:Dn,45:[0,.44444,0,0,.33333],46:$n,47:cu,48:Di,49:Di,50:Di,51:Di,52:Di,53:Di,54:Di,55:Di,56:Di,57:Di,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Wn,64:Ln,65:Ln,66:Ln,67:ci,68:[0,.69444,0,0,.72223],69:cr,70:[0,.69444,0,0,.56945],71:Ln,72:xn,73:hu,74:Wn,75:[0,.69444,0,0,.69445],76:wr,77:[0,.69444,0,0,.875],78:xn,79:[0,.69444,0,0,.73611],80:ci,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:gh,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:Ln,89:[0,.69444,.025,0,.66667],90:Su,91:Qi,93:Qi,94:js,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:So,99:jo,100:So,101:jo,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:So,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:Zr,111:[0,.44444,0,0,.5],112:go,113:go,114:[0,.44444,.01389,0,.34167],115:Ko,116:[0,.57143,0,0,.36111],117:Zr,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:xo,168:[0,.67937,0,0,.5],176:Ln,184:wt,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:js,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:js,715:js,728:js,729:[0,.67937,0,0,.27778],730:Ln,732:[0,.67659,0,0,.5],733:js,915:wr,916:zo,920:Js,923:Su,926:Ln,928:xn,931:bu,933:Js,934:bu,936:Js,937:bu,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:hu,8217:hu,8220:js,8221:js},"Script-Regular":{32:xo,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:xo},"Size1-Regular":{32:xo,40:da,41:da,47:Cs,91:ys,92:Cs,93:ys,123:pa,125:pa,160:xo,710:Cr,732:Cr,770:Cr,771:Cr,8214:[-99e-5,.601,0,0,.77778],8593:Qr,8595:Qr,8657:io,8659:io,8719:Ps,8720:Ps,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:Ns,8748:xs,8749:xs,8750:Ns,8896:gs,8897:gs,8898:gs,8899:gs,8968:la,8969:la,8970:la,8971:la,9168:Il,10216:la,10217:la,10752:Da,10753:Da,10754:Da,10756:gs,10758:gs},"Size2-Regular":{32:xo,40:Ks,41:Ks,47:va,91:oo,92:va,93:oo,123:vs,125:vs,160:xo,710:ks,732:ks,770:ks,771:ks,8719:Ia,8720:Ia,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:ja,8748:ll,8749:ll,8750:ja,8896:Oa,8897:Oa,8898:Oa,8899:Oa,8968:Qa,8969:Qa,8970:Qa,8971:Qa,10216:mr,10217:mr,10752:Dl,10753:Dl,10754:Dl,10756:Oa,10758:Oa},"Size3-Regular":{32:xo,40:ul,41:ul,47:Cu,91:To,92:Cu,93:To,123:Au,125:Au,160:xo,710:Ml,732:Ml,770:Ml,771:Ml,8730:[.95003,1.45,0,0,1],8968:du,8969:du,8970:du,8971:du,10216:Au,10217:Au},"Size4-Regular":{32:xo,40:pu,41:pu,47:yl,91:Xu,92:yl,93:Xu,123:ru,125:ru,160:xo,710:ya,732:ya,770:ya,771:ya,8730:[1.25003,1.75,0,0,1],8968:ju,8969:ju,8970:ju,8971:ju,9115:hl,9116:Qs,9117:hl,9118:hl,9119:Qs,9120:hl,9121:Es,9122:Il,9123:Es,9124:Es,9125:Il,9126:Es,9127:R,9128:V,9129:at,9130:[0,.3,0,0,.88889],9131:R,9132:V,9133:at,9143:[.88502,.915,0,0,1.05556],10216:ru,10217:ru,57344:dt,57345:dt,57680:Dt,57681:Dt,57682:Dt,57683:Dt},"Typewriter-Regular":{32:Be,33:_t,34:_t,35:_t,36:Xt,37:Xt,38:_t,39:_t,40:Xt,41:Xt,42:[0,.52083,0,0,.525],43:Ne,44:[.13889,.125,0,0,.525],45:Ne,46:[0,.125,0,0,.525],47:Xt,48:_t,49:_t,50:_t,51:_t,52:_t,53:_t,54:_t,55:_t,56:_t,57:_t,58:ze,59:[.13889,.43056,0,0,.525],60:Xe,61:[-.19549,.41562,0,0,.525],62:Xe,63:_t,64:_t,65:_t,66:_t,67:_t,68:_t,69:_t,70:_t,71:_t,72:_t,73:_t,74:_t,75:_t,76:_t,77:_t,78:_t,79:_t,80:_t,81:[.13889,.61111,0,0,.525],82:_t,83:_t,84:_t,85:_t,86:_t,87:_t,88:_t,89:_t,90:_t,91:Xt,92:Xt,93:Xt,94:_t,95:[.09514,0,0,0,.525],96:_t,97:ze,98:_t,99:ze,100:_t,101:ze,102:_t,103:Qe,104:_t,105:_t,106:[.22222,.61111,0,0,.525],107:_t,108:_t,109:ze,110:ze,111:ze,112:Qe,113:Qe,114:ze,115:ze,116:[0,.55358,0,0,.525],117:ze,118:ze,119:ze,120:ze,121:Qe,122:ze,123:Xt,124:Xt,125:Xt,126:_t,127:_t,160:Be,176:_t,184:[.19445,0,0,0,.525],305:ze,567:Qe,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:_t,715:_t,728:_t,730:_t,770:_t,771:_t,776:_t,915:_t,916:_t,920:_t,923:_t,926:_t,928:_t,931:_t,933:_t,934:_t,936:_t,937:_t,8216:_t,8217:_t,8242:_t,9251:[.11111,.21944,0,0,.525]}},Oe=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,wi=10,ri=.25,Mi=1.2,Bi=.431,Li={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[Bi,Bi,Bi],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[ri,ri,ri],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},Ni=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Hi=5,Gn={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function cn(r,o){r===void 0&&(r=77);const u=xi[o][r];if(u)return{defaultMetrics:!1,depth:u[0],height:u[1],italic:u[2],skew:u[3],width:u[4]};if(r===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const f=String.fromCodePoint(r);if(f in Gn)r=Gn[f].codePointAt(0);else if(Oe.test(f))return r=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var ir={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Qn={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},Xr={doubleleftarrow:`M262 157
|
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
|
|
|
c -179 0 -524 -115 -524 -115
|
|
|
c -5 -1 -9 -5 -9 -10
|
|
|
c 0 -1 1 -2 1 -3
|
|
|
l 4 -22
|
|
|
c 1 -5 5 -9 11 -9
|
|
|
h 2
|
|
|
s 338 93 512 92
|
|
|
c 174 0 513 -92 513 -92
|
|
|
h 2
|
|
|
c 5 0 9 4 11 9
|
|
|
l 5 22
|
|
|
c 1 6 -2 12 -8 13
|
|
|
c 0 0 -342 115 -520 115
|
|
|
z
|
|
|
`,leftgroup:`M400000 80
|
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
|
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
|
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function In(r){if(Qn[r]){const[B,U,lt]=Qn[r],Lt=`<span class="stretchy" style="height:${lt}em"><svg width="100%" height="${lt}em" viewBox="0 0 ${B} ${U}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Xr[r]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*lt/2)/100}em;min-width:0">${Lt}</span>`}const[o,u,f,g]=ir[r];let b,M;const N=f/1e3;o.length===3?(b=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],M=["xMinYMin","xMidYMin","xMaxYMin"]):o.length===2?(b=["slice-1-of-2","slice-2-of-2"],M=["xMinYMin","xMaxYMin"]):(b=["slice-1-of-1"],M=[g]);const I=o.map((B,U)=>`<span class="${b[U]}" style=height:${N}em><svg width=400em height=${N}em viewBox="0 0 400000 ${f}" preserveAspectRatio="${M[U]} slice"><path fill="currentcolor" d="${Xr[B]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${N}em;min-width:${u}em;">${I}</span>`}function nn(r){return ir[r]?ir[r][2]/1e3:Qn[r][2]}function vo(r){const o=[];for(let u=0;u<r.length;u++){let f=r.charCodeAt(u);if(f===13&&r.charCodeAt(u+1)===10&&(f=10,u++),(f===13||f===12)&&(f=10),f===0&&(f=65533),f>=55296&&f<=56319){const g=r.charCodeAt(u+1);if(g>=56320&&g<=57343){const b=f-55296,M=g-56320;f=Kp(2,16)+b*Kp(2,10)+M,u++}}o.push(f)}return o}var Kr=8205,gr=[[Kr,1],[65038,2],[127995,5],[129456,4],[917536,96]],kn,ji=[127462,127487];function rn(r){var o;if(kn===void 0){kn={};for(const u of gr)for(let f=u[0];f<=u[0]+u[1]-1;f++)kn[f]=!0}return(o=kn[r])!=null?o:!1}function On(r){return r>=ji[0]&&r<=ji[1]}function tr(r){if(/^[\u0020-\u00FF]*$/.test(r))return r;const o=[],u=vo(r);let f=0;for(;f<u.length;){const g=u[f++],b=u[f];if(b===Kr){const M=f-1;for(f+=2;u[f]===Kr;)f+=2;o.push(String.fromCodePoint(...u.slice(M,f-M+1)))}else if(rn(b)){const M=f-1;for(;rn(u[f]);)f+=u[f]===Kr?2:1;o.push(String.fromCodePoint(...u.slice(M,2*f-M-1)))}else On(g)?(f+=1,o.push(String.fromCodePoint(...u.slice(f-2,2)))):o.push(String.fromCodePoint(g))}return o}var Ws=class{constructor(r){this.obeyspaces=!1,this.pos=0,this.s=tr(r)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(r){const o=typeof this.s=="string"?r.exec(this.s.slice(this.pos)):r.exec(this.s.slice(this.pos).join(""));return o!=null&&o[0]?(this.pos+=o[0].length,o[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const r=this.get();if(r==="\\"){if(!this.end()){let o=this.match(/^[a-zA-Z\*]+/);return o?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):o=this.get(),"\\"+o}}else{if(r==="{")return"<{>";if(r==="}")return"<}>";if(r==="^"){if(this.peek()==="^"){this.get();const o=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(o)return String.fromCodePoint(Number.parseInt(o.slice(o.lastIndexOf("^")+1),16))}return r}else if(r==="#"){if(!this.end()){let o=!1;if(/[\d?@]/.test(this.peek())&&(o=!0,this.pos+1<this.s.length)){const u=this.s[this.pos+1];o=/[^\dA-Za-z]/.test(u)}return o?"#"+this.get():"#"}}else if(r==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return r}};function Ct(r,o){var u,f,g,b;const M=[];let N=r.next();if(N&&N!=="\\relax"){if(N==="\\noexpand")N=r.next(),N&&M.push(N);else if(N==="\\obeyspaces")r.obeyspaces=!0;else if(N==="\\bgroup")M.push("<{>");else if(N==="\\egroup")M.push("<}>");else if(N==="\\string"){if(N=r.next(),N)if(N.startsWith("\\"))for(const I of N)M.push(I==="\\"?"\\backslash":I);else N==="<{>"?M.push("\\{"):N==="<space>"?M.push("~"):N==="<}>"&&M.push("\\}")}else if(N==="\\csname"){for(;r.peek()==="<space>";)r.next();let I="",B=!1,U=[];do{if(U.length===0)if(/^#[\d?@]$/.test(r.peek())){const lt=r.get().slice(1);U=_o((f=(u=o==null?void 0:o(lt))!=null?u:o==null?void 0:o("?"))!=null?f:"\\placeholder{}",o),N=U[0]}else N=r.next(),U=N?[N]:[];B=U.length===0,!B&&N==="\\endcsname"&&(B=!0,U.shift()),B||(B=N==="<$>"||N==="<$$>"||N==="<{>"||N==="<}>"||typeof N=="string"&&N.length>1&&N.startsWith("\\")),B||(I+=U.shift())}while(!B);I&&M.push("\\"+I),M.push(...U)}else if(N!=="\\endcsname")if(N.length>1&&N.startsWith("#")){const I=N.slice(1);M.push(..._o((b=(g=o==null?void 0:o(I))!=null?g:o==null?void 0:o("?"))!=null?b:"\\placeholder{}",o))}else M.push(N)}return M}function _o(r,o=null){const u=[];let f="";for(const M of r.toString().split(/\r?\n/)){f&&u.push(f),f=" ";const N=M.match(/((?:\\%)|[^%])*/);N!==null&&u.push(N[0])}const g=new Ws(Ye(u.join(""))),b=[];do b.push(...Ct(g,o));while(!g.end());return b}function Mn(r){let o="";const u=[];for(const f of r)f&&(o&&/^[a-zA-Z\*]/.test(f)&&u.push(o),u.push(f),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(f)&&u.push(" "),o=/\\[a-zA-Z]+\*?$/.test(f)?" ":"");return u.join("")}function jn(r,...o){return console.assert(r.startsWith("\\")),o.length===0?r:Mn([r,...o.map(u=>`{${u}}`)])}function ws(r){return Mn(r.map(o=>{var u;return(u={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[o])!=null?u:o}))}var Ea=class Gy{constructor(o){Gy._registry[o]=this}static createAtom(o,u,f){return Gy._registry[o].createAtom(u,Fr(u,o),f)}static serialize(o,u){var f;if(!o||o.length===0)return"";if((f=u.skipStyles)!=null&&f){const g=[];for(const b of vn(o)){const M=Gy._registry[b[0].mode];g.push(...M.serialize(b,u))}return Mn(g)}return Mn(No(o,u))}static getFont(o,u,f){return Gy._registry[o].getFont(u,f)}};Ea._registry={};var Pn=Ea;function vn(r){const o=[];let u=[],f="NONE";for(const g of r)g.type!=="first"&&(g.mode!==f?(u.length>0&&o.push(u),u=[g],f=g.mode):u.push(g));return u.length>0&&o.push(u),o}function tn(r,o){const u=[];let f=[],g;for(const b of r)if(b.type!=="first"&&b.style){let M;o==="variant"?(M=b.style.variant,b.style.variantStyle&&b.style.variantStyle!=="up"&&(M+="-"+b.style.variantStyle)):M=b.style[o],M===g?f.push(b):(f.length>0&&u.push(f),f=[b],g=M)}return f.length>0&&u.push(f),u}function so(r,o){var u;const{parent:f}=r[0],g=f==null?void 0:f.computedStyle.color,b=[];for(const M of vn(r)){const N=o.defaultMode;for(const I of tn(M,"color")){const B=I[0].computedStyle,U=Pn._registry[I[0].mode].serialize(I,F(ot({},o),{defaultMode:N==="text"?"text":"math"}));!o.skipStyles&&B.color&&B.color!=="none"&&(!f||g!==B.color)?b.push(jn("\\textcolor",(u=B.verbatimColor)!=null?u:B.color,Mn(U))):b.push(Mn(U))}}return b}function Po(r,o){const{parent:u}=r[0],f=u==null?void 0:u.computedStyle.backgroundColor;return tn(r,"backgroundColor").map(g=>{var b;if(g.length>0||g[0].type!=="box"){const M=g[0].computedStyle;if(M.backgroundColor&&M.backgroundColor!=="none"&&(!u||f!==M.backgroundColor))return jn("\\colorbox",(b=M.verbatimBackgroundColor)!=null?b:M.backgroundColor,Mn(so(g,F(ot({},o),{defaultMode:"text"}))))}return Mn(so(g,o))})}function No(r,o){if(r.length===0)return[];const{parent:u}=r[0],f=u==null?void 0:u.computedStyle.fontSize,g=[];for(const b of tn(r,"fontSize")){const M=b[0].computedStyle.fontSize,N=Po(b,o);N&&(M&&M!=="auto"&&(!u||f!==M)?g.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][M],...N):g.push(...N))}return g}function ar(r){return r?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[r]:void 0}function Mo(r){if(r.length===0)return"ord";const o=ar(r[0].type),u=ar(r[r.length-1].type);return o&&o===u?o:"ord"}function qo(r,o){if(typeof r=="string")return r;if(typeof r=="number"){console.assert(Number.isFinite(r));const u=Math.ceil(100*r)/100;return u===0?"0":u.toString()+(o!=null?o:"")}return""}var Je=class s2{constructor(o,u){var f,g,b,M,N;if(typeof o=="number"?this.value=String.fromCodePoint(o):typeof o=="string"?this.value=o:ne(o)?this.children=o.filter(B=>B!==null):o&&o instanceof s2&&(this.children=[o]),this.children)for(const B of this.children)B.parent=this;this.type=(f=u==null?void 0:u.type)!=null?f:"ignore",this.isSelected=(u==null?void 0:u.isSelected)===!0,u!=null&&u.caret&&(this.caret=u.caret),this.classes=(g=u==null?void 0:u.classes)!=null?g:"",this.isTight=(b=u==null?void 0:u.isTight)!=null?b:!1,u!=null&&u.attributes&&(this.attributes=u.attributes);let I=u==null?void 0:u.fontFamily;u!=null&&u.style&&this.value&&(I=(N=Pn.getFont((M=u.mode)!=null?M:"math",this,F(ot({variant:"normal"},u.style),{letterShapeStyle:u.letterShapeStyle})))!=null?N:void 0),I||(I="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(u==null?void 0:u.maxFontSize)!==void 0&&(this.maxFontSize=u.maxFontSize),kr(this,I)}set atomID(o){o===void 0||o.length===0||(this.id=o)}selected(o){if(this.isSelected!==o&&(this.isSelected=o,this.children))for(const u of this.children)u.selected(o)}setStyle(o,u,f){if(u===void 0)return;const g=qo(u,f);g.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[o]=g)}setTop(o){Number.isFinite(o)&&Math.abs(o)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=qo(o,"em"),this.height-=o,this.depth+=o)}get left(){var o;return(o=this.cssProperties)!=null&&o["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(o){Number.isFinite(o)&&(o===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=qo(o,"em")))}set right(o){Number.isFinite(o)&&(o===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=qo(o,"em")))}set bottom(o){Number.isFinite(o)&&(o===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=qo(o,"em")))}get width(){return this._width*this.scale}set width(o){this._width=o,this.hasExplicitWidth=!0}set softWidth(o){}get height(){return this._height*this.scale}set height(o){this._height=o}get depth(){return this._depth*this.scale}set depth(o){this._depth=o}wrap(o){const u=o.parent;if(!u)return this;o.isPhantom&&this.setStyle("opacity",0);const f=o.color;f&&f!==u.color&&this.setStyle("color",f);let g=o.backgroundColor;this.isSelected&&(g=Ki(g)),g&&g!==u.backgroundColor&&(this.setStyle("background-color",g),this.setStyle("display","inline-block"));const b=o.scalingFactor;return this.scale=b,this.skew*=b,this.italic*=b,this}toMarkup(){var o,u,f,g;let b=(o=this.value)!=null?o:"";if(this.children)for(const Bt of this.children)b+=Bt.toMarkup();let M="";if(this.svgBody)M=In(this.svgBody);else if(this.svgOverlay){M='<span style="',M+="display: inline-block;",M+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,M+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,M+='">',M+=b,M+="</span>",M+='<svg style="position:absolute;overflow:visible;',M+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const Bt=(u=this.cssProperties)==null?void 0:u.padding;Bt?(M+=`top:${Bt};`,M+=`left:${Bt};`,M+=`width:calc(100% - 2 * ${Bt} );`):M+="top:0;left:0;width:100%;",M+="z-index:2;",M+='"',this.svgStyle&&(M+=this.svgStyle),M+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,M+=`>${this.svgOverlay}</svg>`}let N="";const I=this.classes.split(" ");I.push((f={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?f:""),this.caret==="latex"&&I.push("ML__latex-caret"),this.isSelected&&I.push("ML__selected");const B=I.length===1?I[0]:I.filter((Bt,jt,je)=>Bt.length>0&&je.indexOf(Bt)===jt).join(" ");if(B.length>0&&(N+=` class="${B}"`),this.id&&(N+=` data-atom-id=${this.id}`),this.cssId&&(N+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(N+=" "+Object.keys(this.attributes).map(Bt=>`${Bt}="${this.attributes[Bt]}"`).join(" ")),this.htmlData){const Bt=this.htmlData.split(",");for(const jt of Bt){const je=jt.match(/([^=]+)=(.+$)/);if(je){const Zi=je[1].trim().replace(/ /g,"-");Zi&&(N+=` data-${Zi}="${je[2]}" `)}else{const Zi=jt.trim().replace(/ /g,"-");Zi&&(N+=` data-${Zi} `)}}}const U=(g=this.cssProperties)!=null?g:{};this.hasExplicitWidth&&U.width===void 0&&(U.width=`${Math.ceil(this._width*100)/100}em`);const lt=Object.keys(U).map(Bt=>`${Bt}:${U[Bt]}`);if(this.scale!==void 0&&this.scale!==1&&(b.length>0||M.length>0)&<.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const Bt=this.htmlStyle.split(";");let jt="";for(const je of Bt){const Zi=je.match(/([^=]+):(.+$)/);if(Zi){const Le=Zi[1].trim().replace(/ /g,"-");Le&&(jt+=`${Le}:${Zi[2]};`)}}jt&&(N+=` style="${jt}"`)}lt.length>0&&(N+=` style="${lt.join(";")}"`);let Lt="";return N.length>0||M.length>0?Lt=`<span${N}>${b}${M}</span>`:Lt=b,this.caret==="text"?Lt+='<span class="ML__text-caret"></span>':this.caret==="math"&&(Lt+='<span class="ML__caret"></span>'),Lt}tryCoalesceWith(o){if(this.svgBody||!this.value||o.svgBody||!o.value)return!1;const u=this.children&&this.children.length>0,f=o.children&&o.children.length>0;if(u||f)return!1;if(o.cssProperties||this.cssProperties){for(const I of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(o.cssProperties&&I in o.cssProperties||this.cssProperties&&I in this.cssProperties)return!1}const g=this.cssProperties?Object.keys(this.cssProperties).length:0,b=o.cssProperties?Object.keys(o.cssProperties).length:0;if(g!==b)return!1;if(g>0){for(const I of Object.keys(this.cssProperties))if(this.cssProperties[I]!==o.cssProperties[I])return!1}const M=this.classes.trim().replace(/\s+/g," ").split(" "),N=o.classes.trim().replace(/\s+/g," ").split(" ");if(M.length!==N.length)return!1;M.sort(),N.sort();for(const[I,B]of M.entries())if(B==="vertical-separator"||B!==N[I])return!1;return this.value+=o.value,this.height=Math.max(this.height,o.height),this.depth=Math.max(this.depth,o.depth),this._width=this._width+o._width,this.maxFontSize=Math.max(this.maxFontSize,o.maxFontSize),this.italic=o.italic,!0}};function br(r){if(!r||r.length===0)return[];r[0].children=br(r[0].children);const o=[r[0]];for(let u=1;u<r.length;u++)o[o.length-1].tryCoalesceWith(r[u])||(r[u].children=br(r[u].children),o.push(r[u]));return o}function wn(r){return r.children&&(r.children=br(r.children)),r}function lr(r,o){if(!r)return new Je(null,o);const u=new Je(null,{classes:"ML__strut",type:"ignore"});u.setStyle("height",Math.max(0,r.height),"em");const f=[u];if(r.depth!==0){const g=new Je(null,{classes:"ML__strut--bottom",type:"ignore"});g.setStyle("height",r.height+r.depth,"em"),g.setStyle("vertical-align",-r.depth,"em"),f.push(g)}return f.push(r),new Je(f,F(ot({},o),{type:"lift"}))}function Rn(r){const o=nn(r)/2,u=new Je(null,{maxFontSize:0});return u.height=o+.166,u.depth=o-.166,u.svgBody=r,u}function kr(r,o){var u;if(r.type==="latex"){r.height=.9,r.depth=.2,r._width=1;return}if(r.value){r.height=-1/0,r.depth=-1/0,r._width=0,r.skew=-1/0,r.italic=-1/0;for(let f=0;f<r.value.length;f++){const g=cn(r.value.codePointAt(f),o);r.height=Math.max(r.height,g.height),r.depth=Math.max(r.depth,g.depth),r._width+=g.width,r.skew=g.skew,r.italic=g.italic}return}if(r.children&&r.children.length>0){let f=-1/0,g=-1/0,b=0;for(const M of r.children)M.height>f&&(f=M.height),M.depth>g&&(g=M.depth),b=Math.max(b,(u=M.maxFontSize)!=null?u:0);r.height=f,r.depth=g,r._width=r.children.reduce((M,N)=>M+N.width,0),r.maxFontSize=b}}function Ls(r){if("individualShift"in r){const o=r.individualShift;let u=o[0];const f=[u],g=-u.shift-u.box.depth;let b=g;for(let M=1;M<o.length;M++){const N=o[M],I=-N.shift-b-N.box.depth,B=I-(u.box.height+u.box.depth);b=b+I,f.push(B),f.push(N),u=N}return[f,g]}if("top"in r){let o=r.top;for(const u of r.children)o-=typeof u=="number"?u:u.box.height+u.box.depth;return[r.children,o]}else{if("bottom"in r)return[r.children,-r.bottom];if("firstBaseline"in r){const o=r.firstBaseline[0];if(typeof o=="number")throw new Error("First child must be an element.");return[r.firstBaseline,-o.box.depth]}else if("shift"in r){const o=r.children[0];if(typeof o=="number")throw new Error("First child must be an element.");return[r.children,-o.box.depth-r.shift]}}return[null,0]}function As(r){var o;const[u,f]=Ls(r);if(!u)return[[],0,0];const g=new Je(null,{classes:"pstrut"});let b=0;for(const jt of u)if(typeof jt!="number"){const je=jt.box;b=Math.max(b,je.maxFontSize,je.height)}b+=2,g.height=b,g.setStyle("height",b,"em");const M=[];let N=f,I=f,B=f,U=0;for(const jt of u){if(typeof jt=="number")B+=jt;else{const je=jt.box,Zi=(o=jt.classes)!=null?o:[],Le=new Je([g,je],{classes:Zi.join(" "),style:jt.style});je.setStyle("height",je.height+je.depth,"em"),je.setStyle("display","inline-block"),Le.setStyle("top",-b-B-je.depth,"em"),jt.marginLeft&&Le.setStyle("margin-left",jt.marginLeft,"em"),jt.marginRight&&Le.setStyle("margin-right",jt.marginRight,"em"),M.push(Le),B+=je.height+je.depth,U=Math.max(U,Le.width)}N=Math.min(N,B),I=Math.max(I,B)}M.forEach(jt=>{jt.softWidth=U});const lt=new Je(M,{classes:"vlist"});if(lt.softWidth=U,lt.height=I,lt.setStyle("height",I,"em"),N>=0)return[[new Je(lt,{classes:"vlist-r"})],I,-N];const Lt=new Je(new Je(null),{classes:"vlist"});Lt.height=-N,Lt.setStyle("height",-N,"em");const Bt=new Je(8203,{classes:"vlist-s",maxFontSize:0});return Bt.softWidth=0,Bt.height=0,Bt.depth=0,[[new Je([lt,Bt],{classes:"vlist-r"}),new Je(Lt,{classes:"vlist-r"})],I,-N]}var Gr=class extends Je{constructor(r,o){var u;const[f,g,b]=As(r);super(f.length===1?f[0]:f,{type:o==null?void 0:o.type,classes:((u=o==null?void 0:o.classes)!=null?u:"")+" vlist-t"+(f.length===2?" vlist-t2":"")}),this.height=g,this.depth=b,this.softWidth=f.reduce((M,N)=>Math.max(M,N.width),0)}};function ma(r,o){var u,f,g,b,M;const N=r.metrics,I=new Je(o.base),B=(u=o.baseShift)!=null?u:0,U=(f=o.slant)!=null?f:0;let lt=0,Lt=0;o.above&&(lt=(g=o.aboveShift)!=null?g:Math.max(N.bigOpSpacing1,N.bigOpSpacing3-o.above.depth)),o.below&&(Lt=(b=o.belowShift)!=null?b:Math.max(N.bigOpSpacing2,N.bigOpSpacing4-o.below.height));let Bt=null;if(o.below&&o.above){const jt=N.bigOpSpacing5+o.below.height+o.below.depth+Lt+I.depth+B;Bt=new Gr({bottom:jt,children:[N.bigOpSpacing5,{box:o.below,marginLeft:-U,classes:["ML__center"]},Lt,{box:I,classes:["ML__center"]},lt,{box:o.above,marginLeft:U,classes:["ML__center"]},N.bigOpSpacing5]}).wrap(r)}else if(o.below&&!o.above)Bt=new Gr({top:I.height-B,children:[N.bigOpSpacing5,{box:o.below,marginLeft:-U,classes:["ML__center"]},Lt,{box:I,classes:["ML__center"]}]}).wrap(r);else if(!o.below&&o.above){const jt=I.depth+B;Bt=new Gr({bottom:jt,children:[{box:I,classes:["ML__center"]},lt,{box:o.above,marginLeft:U,classes:["ML__center"]},N.bigOpSpacing5]}).wrap(r)}else{const jt=I.depth+B;Bt=new Gr({bottom:jt,children:[{box:I},N.bigOpSpacing5]}).wrap(r)}return new Je(Bt,{type:(M=o.type)!=null?M:"op"})}var Qo=7,bs=6,ua=5,Ho=4,La=3,Eo=2,Rs=1,Us=0,Vo=class{constructor(r,o,u){this.id=r,this.sizeDelta=o,this.cramped=u;const f={"-4":2,"-3":1,0:0}[o];this.metrics=Object.keys(Li).reduce((g,b)=>F(ot({},g),{[b]:Li[b][f]}),{})}getFontSize(r){return Math.max(1,r+this.sizeDelta)}get sup(){return Zs[[Us,Rs,Us,Rs,Eo,La,Eo,La][this.id]]}get sub(){return Zs[[Us,Us,Us,Us,Eo,Eo,Eo,Eo][this.id]]}get fracNum(){return Zs[[Us,Rs,Us,Rs,Eo,La,Ho,ua][this.id]]}get fracDen(){return Zs[[Us,Us,Us,Us,Eo,Eo,Ho,Ho][this.id]]}get cramp(){return Zs[[Us,Us,Eo,Eo,Ho,Ho,bs,bs][this.id]]}get isTight(){return this.sizeDelta<0}},ha={7:new Vo(Qo,0,!1),6:new Vo(bs,0,!0),5:new Vo(ua,0,!1),4:new Vo(Ho,0,!0),3:new Vo(La,-3,!1),2:new Vo(Eo,-3,!0),1:new Vo(Rs,-4,!1),0:new Vo(Us,-4,!0)},Zs=F(ot({},ha),{displaystyle:ha[Qo],textstyle:ha[ua],scriptstyle:ha[La],scriptscriptstyle:ha[Rs]});function Vl(r,o){var u;if(!r)return 0;const f={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:wi,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(u=r.unit)!=null?u:"pt"];if(Number.isFinite(o)){const g=Kp(10,o);return Math.round(r.dimension/wi*f*g)/g}return r.dimension*f}function Ta(r,o){if(r===null)return 0;const u=Vl(r)/wi;if(Number.isFinite(o)){const f=Kp(10,o);return Math.round(u*f)/f}return u}function Xa(r){var o;return`${r.dimension}${(o=r.unit)!=null?o:"pt"}`}function Yu(r){let o=Xa(r.glue);return r.grow&&r.grow.dimension!==0&&(o+=` plus ${Xa(r.grow)}`),r.shrink&&r.shrink.dimension!==0&&(o+=` minus ${Xa(r.shrink)}`),o}function Ts(r){var o,u;if(r==null)return null;let f="";if("dimension"in r&&(f=`${r.dimension}${(o=r.unit)!=null?o:"pt"}`),"glue"in r&&(f=Yu(r)),"number"in r)if(!("base"in r)||r.base==="decimal")f=Number(r.number).toString();else if(r.base==="alpha")f=`\`${String.fromCodePoint(r.number)}`;else{const g=Math.round(r.number)>>>0;r.base==="hexadecimal"?(f=Number(g).toString(16).toUpperCase(),g<=255?f=f.padStart(2,"0"):g<=65535?f=f.padStart(4,"0"):g<=16777215?f=f.padStart(6,"0"):f=f.padStart(8,"0"),f=`"${f}`):r.base==="octal"&&(f=Number(g).toString(8),g<=63?f=f.padStart(2,"0"):g<=30583?f=f.padStart(4,"0"):f=f.padStart(8,"0"),f=`'${f}`)}return"register"in r&&("factor"in r&&(r.factor===-1?f="-":r.factor!==1&&(f=Number(r.factor).toString())),"global"in r&&r.global&&(f+="\\global"),f+=`\\${r.register}`),"string"in r&&(f=r.string),(u=r.relax)!=null&&u&&(f+="\\relax"),f}function Cn(r,o){return r==null?null:"number"in r?F(ot({},r),{number:r.number*o}):"register"in r?"factor"in r&&r.factor?F(ot({},r),{factor:r.factor*o}):F(ot({},r),{factor:o}):"dimension"in r?F(ot({},r),{dimension:r.dimension*o}):"glue"in r?r.shrink&&r.grow?{glue:Cn(r.glue,o),shrink:Cn(r.shrink,o),grow:Cn(r.grow,o)}:r.shrink?{glue:Cn(r.glue,o),shrink:Cn(r.shrink,o)}:r.grow?{glue:Cn(r.glue,o),grow:Cn(r.grow,o)}:{glue:Cn(r.glue,o)}:null}var Kn={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function Pr(){return ot({},Kn)}function Ss(){return{registers:Pr(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:Vt.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:fi,backgroundColorMap:Ht,getMacro:r=>Ro(r,Go())}}var Nn=class a2{constructor(o,u){var f,g,b,M,N,I,B,U,lt,Lt,Bt,jt,je,Zi,Le;let Ci;o!=null&&o.parent?(this.parent=o.parent,Ci=o.parent,this.registers={}):(Ci=ot(ot({},Ss()),(f=o==null?void 0:o.from)!=null?f:{}),this.registers=Ci.registers),Ci.atomIdsSettings&&(this.atomIdsSettings=ot({},Ci.atomIdsSettings)),this.renderPlaceholder=Ci.renderPlaceholder,this.isPhantom=(M=(b=o==null?void 0:o.isPhantom)!=null?b:(g=this.parent)==null?void 0:g.isPhantom)!=null?M:!1,this.letterShapeStyle=Ci.letterShapeStyle,this.minFontScale=Ci.minFontScale,u!=null&&u.color&&u.color!=="none"?this.color=u.color:this.color=(I=(N=this.parent)==null?void 0:N.color)!=null?I:"",u!=null&&u.backgroundColor&&u.backgroundColor!=="none"?this.backgroundColor=u.backgroundColor:this.backgroundColor=(U=(B=this.parent)==null?void 0:B.backgroundColor)!=null?U:"",u!=null&&u.fontSize&&u.fontSize!=="auto"&&u.fontSize!==((lt=this.parent)==null?void 0:lt.size)?this.size=u.fontSize:this.size=(Bt=(Lt=this.parent)==null?void 0:Lt.size)!=null?Bt:Hi;let en=(je=(jt=this.parent)==null?void 0:jt.mathstyle)!=null?je:Zs.displaystyle;if(typeof(o==null?void 0:o.mathstyle)=="string"){if(Ci instanceof a2)switch(o.mathstyle){case"cramp":en=en.cramp;break;case"superscript":en=en.sup;break;case"subscript":en=en.sub;break;case"numerator":en=en.fracNum;break;case"denominator":en=en.fracDen;break}switch(o.mathstyle){case"textstyle":en=Zs.textstyle;break;case"displaystyle":en=Zs.displaystyle;break;case"scriptstyle":en=Zs.scriptstyle;break;case"scriptscriptstyle":en=Zs.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=en,this.smartFence=Ci.smartFence,this.placeholderSymbol=Ci.placeholderSymbol,this.colorMap=(Zi=Ci.colorMap)!=null?Zi:Oi=>Oi,this.backgroundColorMap=(Le=Ci.backgroundColorMap)!=null?Le:Oi=>Oi,this.getMacro=Ci.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const o=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,o}scale(o){return o*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===Qo||this.mathstyle.id===bs}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(Ni[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(o){var u;if((u=this.registers)!=null&&u[o])return this.registers[o];if(this.parent)return this.parent.getRegister(o)}getRegisterAsNumber(o){const u=this.getRegister(o);if(typeof u=="number")return u;if(typeof u=="string")return Number(u)}getRegisterAsGlue(o){var u;if((u=this.registers)!=null&&u[o]){const f=this.registers[o];return typeof f=="object"&&"glue"in f?f:typeof f=="object"&&"dimension"in f?{glue:{dimension:f.dimension}}:typeof f=="number"?{glue:{dimension:f}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(o)}getRegisterAsEm(o,u){return Ta(this.getRegisterAsDimension(o),u)}getRegisterAsDimension(o){var u;if((u=this.registers)!=null&&u[o]){const f=this.registers[o];return typeof f=="object"&&"glue"in f?f.glue:typeof f=="object"&&"dimension"in f?f:typeof f=="number"?{dimension:f}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(o)}setRegister(o,u){if(u===void 0){delete this.registers[o];return}this.registers[o]=u}evaluate(o){if(!o||!("register"in o))return o;let u=this;if("global"in o&&o.global)for(;u.parent;)u=u.parent;let f=1;"factor"in o&&o.factor!==1&&o.factor!==void 0&&(f=o.factor);const g=u.getRegister(o.register);if(g===void 0)return;if(typeof g=="string")return{string:Number(g).toString()+g};if(typeof g=="number")return{number:f*g};const b=u.evaluate(g);if(b!==void 0)return"string"in b?{string:Number(g).toString()+b.string}:"number"in b?{number:f*b.number}:"dimension"in b?F(ot({},b),{dimension:f*b.dimension}):"glue"in b?F(ot({},b),{glue:F(ot({},b.glue),{dimension:f*b.glue.dimension}),shrink:b.shrink?F(ot({},b.shrink),{dimension:f*b.shrink.dimension}):void 0,grow:b.grow?F(ot({},b.grow),{dimension:f*b.grow.dimension}):void 0}):o}toDimension(o){const u=this.evaluate(o);return u===void 0?null:"dimension"in u?u:"glue"in u?u.glue:"number"in u?{dimension:u.number}:null}toEm(o,u){if(o===null)return 0;const f=this.toDimension(o);return f===null?0:Vl(f,u)/wi}toNumber(o){if(o===null)return null;const u=this.evaluate(o);return u===void 0?null:"number"in u?u.number:"dimension"in u?u.dimension:"glue"in u?u.glue.dimension:"string"in u?Number(u.string):null}toColor(o){var u,f;if(o===null)return null;const g=this.evaluate(o);return g===void 0?null:"string"in g?(f=(u=this.colorMap)==null?void 0:u.call(this,g.string))!=null?f:g.string:null}toBackgroundColor(o){var u,f;if(o===null)return null;const g=this.evaluate(o);return g===void 0?null:"string"in g?(f=(u=this.backgroundColorMap)==null?void 0:u.call(this,g.string))!=null?f:g.string:null}},Yr=["body","above","below","superscript","subscript"];function Fi(r){return typeof r=="string"&&Yr.includes(r)}function Un(r){return r!==void 0&&Array.isArray(r)&&r.length===2}var ae=class E0{constructor(o){var u,f,g,b,M,N;this.type=o.type,typeof o.value=="string"&&(this.value=o.value),this.command=(f=(u=o.command)!=null?u:this.value)!=null?f:"",this.mode=(g=o.mode)!=null?g:"math",o.isFunction&&(this.isFunction=!0),o.limits&&(this.subsupPlacement=o.limits),this.style=ot({},o.style),this.displayContainsHighlight=(b=o.displayContainsHighlight)!=null?b:!1,this.captureSelection=(M=o.captureSelection)!=null?M:!1,this.skipBoundary=(N=o.skipBoundary)!=null?N:!1,o.verbatimLatex!==void 0&&o.verbatimLatex!==null&&(this.verbatimLatex=o.verbatimLatex),o.args&&(this.args=o.args),o.body&&(this.body=o.body),this._changeCounter=0}static createBox(o,u,f){var g;if(!u)return null;const b=to(u),M=[];for(const I of b){const B=I[0].style,U=Bs(o,I,{style:{color:B.color,backgroundColor:B.backgroundColor,fontSize:B.fontSize}});U&&M.push(U)}if(M.length===0)return null;const N=((g=f==null?void 0:f.classes)!=null?g:"").trim();return M.length===1&&!N&&!(f!=null&&f.type)?M[0].wrap(o):new Je(M,{classes:N,type:f==null?void 0:f.type}).wrap(o)}static serialize(o,u){return Pn.serialize(o,u)}static commonAncestor(o,u){if(o===u||o.parent===u.parent)return o.parent;const f=new WeakSet;let{parent:g}=o;for(;g;)f.add(g),g=g.parent;for(g=u.parent;g;){if(f.has(g))return g;g=g.parent}console.assert(!!g)}static fromJson(o){return typeof o=="string"?new E0({type:"mord",value:o,mode:"math"}):new E0(o)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const o={};if(this.type&&(o.type=this.type),this.mode!=="math"&&(o.mode=this.mode),this.command&&this.command!==this.value&&(o.command=this.command),this.value!==void 0&&(o.value=this.value),this.style&&Object.keys(this.style).length>0&&(o.style=ot({},this.style)),this.verbatimLatex!==void 0&&(o.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(o.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(o.explicitSubsupPlacement=!0),this.isFunction&&(o.isFunction=!0),this.displayContainsHighlight&&(o.displayContainsHighlight=!0),this.isExtensibleSymbol&&(o.isExtensibleSymbol=!0),this.skipBoundary&&(o.skipBoundary=!0),this.captureSelection&&(o.captureSelection=!0),this.args&&(o.args=sh(this.args)),this._branches)for(const u of Object.keys(this._branches))this._branches[u]&&(o[u]=this._branches[u].filter(f=>f.type!=="first").map(f=>f.toJson()));return o.type==="mord"&&Object.keys(o).length===2&&"value"in o?o.value:o}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(o){if(o){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:u}=this;for(;u;)u.parent||u._changeCounter++,"verbatimLatex"in u&&(u.verbatimLatex=void 0),u._children=void 0,u=u.parent}}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=Fr(this.command,this.mode);return u!=null&&u.serialize?u.serialize(this,o):this.body&&this.command?Mn([jn(this.command,this.bodyToLatex(o)),this.supsubToLatex(o)]):this.body?Mn([this.bodyToLatex(o),this.supsubToLatex(o)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(o){var u;return Pn.serialize(this.body,F(ot({},o),{defaultMode:(u=o.defaultMode)!=null?u:this.latexMode}))}aboveToLatex(o){return Pn.serialize(this.above,o)}belowToLatex(o){return Pn.serialize(this.below,o)}supsubToLatex(o){let u="";if(o=F(ot({},o),{defaultMode:"math"}),this.branch("subscript")!==void 0){const f=Pn.serialize(this.subscript,o);f.length===0?u+="_{}":f.length===1?/^[0-9]$/.test(f)?u+=`_${f}`:u+=`_{${f}}`:u+=`_{${f}}`}if(this.branch("superscript")!==void 0){const f=Pn.serialize(this.superscript,o);f.length===0?u+="^{}":f.length===1?f==="\u2032"?u+="^\\prime ":f==="\u2033"?u+="^\\doubleprime ":/^[0-9]$/.test(f)?u+=`^${f}`:u+=`^{${f}}`:u+=`^{${f}}`}return u}get treeDepth(){let o=1,u=this.parent;for(;u;)u=u.parent,o+=1;return o}get inCaptureSelection(){let o=this;for(;o;){if(o.captureSelection)return!0;o=o.parent}return!1}get parentPrompt(){let o=this.parent;for(;o;){if(o.type==="prompt"&&!o.captureSelection)return o;o=o.parent}return null}branch(o){if(Fi(o)&&this._branches)return this._branches[o]}get branches(){if(!this._branches)return[];const o=[];for(const u of Yr)this._branches[u]&&o.push(u);return o}createBranch(o){return console.assert(Fi(o)),Fi(o)?(this._branches?this._branches[o]||(this._branches[o]=[this.makeFirstAtom(o)]):this._branches={[o]:[this.makeFirstAtom(o)]},this.isDirty=!0,this._branches[o]):[]}get row(){return Un(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Un(this.parentBranch)?this.parentBranch[1]:-1}get body(){var o;return(o=this._branches)==null?void 0:o.body}set body(o){this.setChildren(o,"body")}get superscript(){var o;return(o=this._branches)==null?void 0:o.superscript}set superscript(o){this.setChildren(o,"superscript")}get subscript(){var o;return(o=this._branches)==null?void 0:o.subscript}set subscript(o){this.setChildren(o,"subscript")}get above(){var o;return(o=this._branches)==null?void 0:o.above}set above(o){this.setChildren(o,"above")}get below(){var o;return(o=this._branches)==null?void 0:o.below}set below(o){this.setChildren(o,"below")}get computedStyle(){var o,u;const f=typeof this.style.verbatimColor=="string",g=typeof this.style.verbatimBackgroundColor=="string",b=ot(ot({},(u=(o=this.parent)==null?void 0:o.computedStyle)!=null?u:{}),this.style);return delete b.variant,delete b.variantStyle,g||delete b.verbatimBackgroundColor,f||delete b.verbatimColor,b}applyStyle(o){this.isDirty=!0,this.style=ot(ot({},this.style),o),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const u of this.children)u.applyStyle(o)}getInitialBaseElement(){var o,u,f;return this.hasEmptyBranch("body")?this:(console.assert(((o=this.body)==null?void 0:o[0].type)==="first"),(f=(u=this.body[1])==null?void 0:u.getInitialBaseElement())!=null?f:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(o){const u=this.branch(o);return u?(console.assert(u.length>0),console.assert(u[0].type==="first"),u.length===1):!0}setChildren(o,u){var f;if(!o||(console.assert(Fi(u)),!Fi(u)))return;console.assert(((f=o[0])==null?void 0:f.type)!=="first");const g=[this.makeFirstAtom(u),...o];this._branches?this._branches[u]=g:this._branches={[u]:g};for(const b of o)b.parent=this,b.parentBranch=u;this.isDirty=!0}makeFirstAtom(o){const u=new E0({type:"first",mode:this.mode});return u.parent=this,u.parentBranch=o,u}addChild(o,u){console.assert(o.type!=="first"),this.createBranch(u).push(o),this.isDirty=!0,o.parent=this,o.parentBranch=u}addChildBefore(o,u){console.assert(u.parentBranch!==void 0);const f=this.createBranch(u.parentBranch);f.splice(f.indexOf(u),0,o),this.isDirty=!0,o.parent=this,o.parentBranch=u.parentBranch}addChildAfter(o,u){console.assert(u.parentBranch!==void 0);const f=this.createBranch(u.parentBranch);f.splice(f.indexOf(u)+1,0,o),this.isDirty=!0,o.parent=this,o.parentBranch=u.parentBranch}addChildren(o,u){const f=this.createBranch(u);for(const g of o)g.parent=this,g.parentBranch=u,f.push(g);this.isDirty=!0}addChildrenAfter(o,u){console.assert(o.length===0||o[0].type!=="first"),console.assert(u.parentBranch!==void 0);const f=this.createBranch(u.parentBranch);f.splice(f.indexOf(u)+1,0,...o),this.isDirty=!0;for(const g of o)g.parent=this,g.parentBranch=u.parentBranch;return o[o.length-1]}removeBranch(o){const u=this.branch(o);if(Fi(o)&&(this._branches[o]=void 0),!u)return[];for(const f of u)f.parent=void 0,f.parentBranch=void 0;return console.assert(u[0].type==="first"),u.shift(),this.isDirty=!0,u}removeChild(o){if(console.assert(o.parent===this),o.type==="first")return;const u=this.branch(o.parentBranch),f=u.indexOf(o);console.assert(f>=0),u.splice(f,1),this.isDirty=!0,o.parent=void 0,o.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:o}=this;return o[o.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const o=this.parent.branch(this.parentBranch);return o[o.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const o=this.parent.branch(this.parentBranch);return o[o.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:o}=this;return o[o.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const o=[];for(const u of Yr)if(this._branches[u])for(const f of this._branches[u])o.push(...f.children),o.push(f);return this._children=o,o}render(o){if(this.type==="first"&&!o.atomIdsSettings)return null;const u=Fr(this.command,this.mode);if(u!=null&&u.render)return u.render(this,o);const f=new Nn({parent:o},this.style);let g=this.createBox(f,{classes:this.parent?"":"ML__base"});return g?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(g=this.attachSupsub(f,{base:g})),g.wrap(f)):null}attachSupsub(o,u){var f;const g=u.base,b=this.superscript,M=this.subscript;if(!b&&!M)return g;let N=null,I=null;const B=(f=u.isCharacterBox)!=null?f:this.isCharacterBox();let U=0;if(b){const je=new Nn({parent:o,mathstyle:"superscript"});N=E0.createBox(je,b),B||(U=g.height-o.metrics.supDrop*je.scalingFactor)}let lt=0;if(M){const je=new Nn({parent:o,mathstyle:"subscript"});I=E0.createBox(je,M),B||(lt=g.depth+o.metrics.subDrop*je.scalingFactor)}let Lt;o.isDisplayStyle?Lt=o.metrics.sup1:o.isCramped?Lt=o.metrics.sup3:Lt=o.metrics.sup2;const Bt=.5/wi/o.scalingFactor;let jt=null;if(I&&N){U=Math.max(U,Lt,N.depth+.25*o.metrics.xHeight),lt=Math.max(lt,o.metrics.sub2);const je=o.metrics.defaultRuleThickness;if(U-N.depth-(I.height-lt)<4*je){lt=4*je-(U-N.depth)+I.height;const Le=.8*o.metrics.xHeight-(U-N.depth);Le>0&&(U+=Le,lt-=Le)}const Zi=this.isExtensibleSymbol&&g.italic?-g.italic:0;jt=new Gr({individualShift:[{box:I,shift:lt,marginLeft:Zi},{box:N,shift:-U}]}).wrap(o)}else I&&!N?(lt=Math.max(lt,o.metrics.sub1,I.height-.8*Bi),jt=new Gr({shift:lt,children:[{box:I,marginRight:Bt,marginLeft:this.isCharacterBox()?-g.italic:0}]})):!I&&N&&(U=Math.max(U,Lt,N.depth+.25*Bi),jt=new Gr({shift:-U,children:[{box:N,marginRight:Bt}]}));return new Je([g,new Je(jt,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:u.type})}attachLimits(o,u){const f=this.superscript?E0.createBox(new Nn({parent:o,mathstyle:"superscript"},this.style),this.superscript):null,g=this.subscript?E0.createBox(new Nn({parent:o,mathstyle:"subscript"},this.style),this.subscript):null;return!f&&!g?u.base.wrap(o):ma(o,F(ot({},u),{above:f,below:g}))}bind(o,u){if(!u||o.isPhantom||this.value==="\u200B")return u;let f=this.parent;for(;f&&!f.captureSelection;)f=f.parent;return f!=null&&f.captureSelection||(this.id||(this.id=o.makeID()),u.atomID=this.id),u}createBox(o,u){var f,g,b,M;const N=(f=this.value)!=null?f:this.body,I=(g=u==null?void 0:u.boxType)!=null?g:ar(this.type);let B=(b=u==null?void 0:u.classes)!=null?b:"";this.mode==="text"&&(B+=" ML__text");const U=typeof N=="string"||N===void 0?new Je(N!=null?N:null,{type:I,isSelected:this.isSelected,mode:this.mode,maxFontSize:o.scalingFactor,style:F(ot({variant:"normal"},this.style),{fontSize:Math.max(1,o.size+o.mathstyle.sizeDelta)}),letterShapeStyle:o.letterShapeStyle,classes:B}):(M=E0.createBox(o,N,{type:I,classes:B}))!=null?M:new Je(null);return o.isTight&&(U.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(U.italic=0),U.right=U.italic,this.bind(o,U),this.caret&&!this.superscript&&!this.subscript&&(U.caret=this.caret),U}isDigit(){var o;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((o=this.body)==null?void 0:o.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var o;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((o=this.body)==null?void 0:o.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function to(r){let o;const u=[];let f=[];for(const g of r)if(!o&&!g.style)f.push(g);else{const b=g.computedStyle;o&&b.color===o.color&&b.backgroundColor===o.backgroundColor&&b.fontSize===o.fontSize?f.push(g):(f.length>0&&u.push(f),f=[g],o=b)}return f.length>0&&u.push(f),u}function Bs(r,o,u){var f,g,b,M,N;if(!o||o.length===0)return null;const I=new Nn({parent:r},u.style),B=!((f=I.atomIdsSettings)!=null&&f.groupNumbers);let U=[];if(o.length===1){const Lt=o[0],Bt=Lt.render(I);Bt&&(B&&Lt.isSelected&&Bt.selected(!0),U=[Bt])}else{let Lt="",Bt=!0;for(const jt of o){(g=I.atomIdsSettings)!=null&&g.groupNumbers&&Lt&&(Bt&&jt.isDigit()||!Bt&&_a(jt))&&(I.atomIdsSettings.overrideID=Lt);const je=jt.render(I);I.atomIdsSettings&&(I.atomIdsSettings.overrideID=void 0),je&&((b=I.atomIdsSettings)!=null&&b.groupNumbers&&((jt.isDigit()||_a(jt))&&(!Lt||Bt!==jt.isDigit())&&(Bt=jt.isDigit(),Lt=(M=jt.id)!=null?M:""),Lt&&(!(jt.isDigit()||_a(jt))||!jt.hasEmptyBranch("superscript")||!jt.hasEmptyBranch("subscript"))&&(Lt="")),B&&jt.isSelected&&je.selected(!0),U.push(je))}}if(U.length===0)return null;const lt=new Je(U,F(ot({isTight:I.isTight},u),{type:(N=u.type)!=null?N:"lift"}));return lt.isSelected=U.every(Lt=>Lt.isSelected),lt.wrap(I)}function _a(r){return r.mode==="text"}function sh(r){return r.map(o=>o===null?"<null>":Array.isArray(o)&&o[0]instanceof ae?{atoms:o.map(u=>u.toJson())}:typeof o=="object"&&"group"in o?{group:o.group.map(u=>u.toJson())}:o)}var Wl=class l2 extends ae{constructor(o,u,f){super({type:"text",command:o,mode:"text",displayContainsHighlight:!0}),this.value=u,this.verbatimLatex=u,this.applyStyle(f)}static fromJson(o){return new l2(o.command,o.value,o.style)}render(o){const u=this.createBox(o);return this.caret&&(u.caret=this.caret),u}_serialize(o){var u;return(u=this.verbatimLatex)!=null?u:uo("text",this.value.codePointAt(0))}};function Du(r,o){if(r.direction===o.direction){const u=r.ranges.length;if(o.ranges.length===u){let f=0;for(;f<u&&cl(r.ranges[f],o.ranges[f])==="equal";)f++;return f===u?"equal":"different"}}return"different"}function cl(r,o){return r[0]===o[0]&&r[1]===o[1]?"equal":"different"}function Ds(r){let o=1/0,u=-1/0;for(const f of r.ranges)o=Math.min(o,f[0],f[1]),u=Math.max(u,f[0],f[1]);return[o,u]}function ku(r){return typeof r=="number"&&!Number.isNaN(r)}function ah(r){return Array.isArray(r)&&r.length===2}function Lc(r){return r!=null&&typeof r=="object"&&"ranges"in r&&Array.isArray(r.ranges)}function Vh(r,o){const u=r.at(o);let f;if(u){f=u.mode;let g=u.parent;for(;!f&&g;)g&&(f=g.mode),g=g.parent}return f}function mu(r,o){if(!o)return"";if(typeof o=="string")return o;if(!r||o.after===void 0)return o.value;let u=!1,f=!1,g=!1,b=!1,M=!1,N=!1,I=!1,B=!1,U=!1,lt=!1,Lt=!1,Bt=!1,jt=!1,je=!1,Zi=!1,Le=r[0],Ci=0;for(;Le!=null&&Le.type&&/^(subsup|placeholder)$/.test(Le.type);)Ci+=1,Le=r[Ci];return u=!Le||Le.type==="first",Le&&(je=Le.mode==="text",f=!je&&Le.type==="mord"&&K.test(Le.value),g=!je&&Le.type==="mord"&&/\d+$/.test(Le.value),b=!je&&Le.isFunction,M=Le.type==="genfrac",N=Le.type==="surd",I=Le.type==="mbin",B=Le.type==="mrel",U=Le.type==="mop"||Le.type==="operator"||Le.type==="extensible-symbol",lt=Le.type==="mpunct"||Le.type==="minner",Lt=Le.type==="array",Bt=Le.type==="mopen",jt=Le.type==="mclose"||Le.type==="leftright",Zi=Le.type==="space"),o.after.includes("nothing")&&u||o.after.includes("letter")&&f||o.after.includes("digit")&&g||o.after.includes("function")&&b||o.after.includes("frac")&&M||o.after.includes("surd")&&N||o.after.includes("binop")&&I||o.after.includes("relop")&&B||o.after.includes("operator")&&U||o.after.includes("punct")&<||o.after.includes("array")&&Lt||o.after.includes("openfence")&&Bt||o.after.includes("closefence")&&jt||o.after.includes("text")&&je||o.after.includes("space")&&Zi?o.value:""}function Nf(r,o,u){return u?mu(r,u[o]):""}var gu={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function Dh(r,o){var u;let f=(u=o==null?void 0:o.format)!=null?u:"auto";return f==="auto"&&([f,r]=Df(r)),f==="ascii-math"?(r=r.replace(/\u2061/gu,""),r=r.replace(/\u3016/gu,"{"),r=r.replace(/\u3017/gu,"}"),r=r.replace(/([^\\])sinx/g,"$1\\sin x"),r=r.replace(/([^\\])cosx/g,"$1\\cos x "),r=r.replace(/\u2013/g,"-"),["ascii-math",ou(r,{inlineShortcuts:o==null?void 0:o.inlineShortcuts})]):["latex",r]}function ou(r,o){var u,f,g;if(!r)return"";let b=!1,M;const N=(u=o.inlineShortcuts)!=null?u:gu;if(!b&&(r.startsWith("^")||r.startsWith("_"))&&(M=Wh(r.slice(1),{inlineShortcuts:N,noWrap:!0}),r=r[0]+"{"+M.match+"}",r+=ou(M.rest,o),b=!0),b||(M=r.match(/^(sqrt|\u221A)(.*)/),M&&(M=Wh(M[2],{inlineShortcuts:N,noWrap:!0}),r="\\sqrt{"+((f=M.match)!=null?f:"\\placeholder{}")+"}",r+=ou(M.rest,o),b=!0)),b||(M=r.match(/^(\\cbrt|\u221B)(.*)/),M&&(M=Wh(M[2],{inlineShortcuts:N,noWrap:!0}),r="\\sqrt[3]{"+((g=M.match)!=null?g:"\\placeholder{}")+"}",r+=ou(M.rest,o),b=!0)),b||(M=r.match(/^abs(.*)/),M&&(M=Wh(M[1],{inlineShortcuts:N,noWrap:!0}),r="\\left|"+M.match+"\\right|",r+=ou(M.rest,o),b=!0)),b||(M=r.match(/^["”“](.*?)["”“](.*)/),M&&(r="\\text{"+M[1]+"}",r+=ou(M[2],o),b=!0)),b||(M=r.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),M&&(r=Af(M[1],N),r+=ou(M[2],o),b=!0)),!b&&/^([fgh])[^a-zA-Z]/.test(r)&&(M=Wh(r.slice(1),{inlineShortcuts:N,noWrap:!0}),r=r[1]==="("?r[0]+"\\left("+M.match+"\\right)":r[0]+M.match,r+=ou(M.rest,o),b=!0),b||(M=r.match(/^([a-zA-Z]+)(.*)/),M&&(r=Af(M[1],N),r+=ou(M[2],o),b=!0)),!b)if(M=Wh(r,{inlineShortcuts:N,noWrap:!0}),M.match&&M.rest[0]==="/"){const I=Wh(M.rest.slice(1),{inlineShortcuts:N,noWrap:!0});I.match&&(r="\\frac{"+M.match+"}{"+I.match+"}"+ou(I.rest,o)),b=!0}else M.match&&(r=r.startsWith("(")?"\\left("+M.match+"\\right)"+ou(M.rest,o):M.match+ou(M.rest,o),b=!0);return b||(M=r.match(/^(\s+)(.*)$/),M&&(r=" "+ou(M[2],o),b=!0)),r}function Wh(r,o){let u="";r=r.trim();let f=r,g=r.charAt(0),b={"(":")","{":"}","[":"]"}[g];if(b){let M=1,N=1;for(;N<r.length&&M>0;)r[N]===g&&M++,r[N]===b&&M--,N++;M===0?(o.noWrap&&g==="("?u=ou(r.substring(1,N-1),o):(g==="{"&&b==="}"&&(g="\\{",b="\\}"),u="\\left"+g+ou(r.substring(1,N-1),o)+"\\right"+b),f=r.slice(Math.max(0,N))):(u=r.substring(1,N),f="")}else{let M=r.match(/^([a-zA-Z]+)/);if(M){let N=Nf(null,r,o.inlineShortcuts);if(N)return N=N.replace("_{#?}",""),N=N.replace("^{#?}",""),{match:N,rest:r.slice(N.length)}}if(M=r.match(/^([a-zA-Z])/),M)return{match:M[1],rest:r.slice(1)};if(M=r.match(/^(-)?\d+(\.\d*)?/),M)return{match:M[0],rest:r.slice(M[0].length)};/^\\(left|right)/.test(r)||(M=r.match(/^(\\[a-zA-Z]+)/),M&&(f=r.slice(M[1].length),u=M[1]))}return{match:u,rest:f}}function Af(r,o){let u=Nf(null,r,o);return u?(u=u.replace("_{#?}",""),u=u.replace("^{#?}",""),u+=" "):u=r,u}var Yc=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function Ku(r){const o=r.trim();for(const u of Yc)if(o.startsWith(u[0])&&o.endsWith(u[1]))return[!0,o.substring(u[0].length,o.length-u[1].length)];return[!1,r]}function Df(r){if(r=r.trim(),r.length<=1)return["latex",r];let o;return[o,r]=Ku(r),o?["latex",r]:r.startsWith("`")&&r.endsWith("`")?(r=r.substring(1,r.length-1),["ascii-math",r]):r.includes("\\")?["latex",r]:/\$.+\$/.test(r)?["latex",`\\text{${r}}`]:[void 0,r]}var Jc="$$",Bc="$$",Tc=(r,o,u)=>(Yc.some(f=>o.startsWith(f[0])&&o.endsWith(f[1]))||(o=`${Jc} ${o} ${Bc}`),o),qc=class hx{constructor(o){hx._modes[o]=this}static onPaste(o,u,f){var g;if(!u.contentEditable&&u.userSelect==="none")return u.model.announce("plonk"),!1;if(typeof f=="string"){const M=new DataTransfer;M.setData("text/plain",f),f=M}const b=new ClipboardEvent("paste",{clipboardData:f,cancelable:!0});return(g=u.host)!=null&&g.dispatchEvent(b)?hx._modes[o].onPaste(u,f):!1}static copyToClipboard(o,u){if(!o.contentEditable&&o.userSelect==="none"){o.model.announce("plonk");return}const f=o.model,g=f.selectionIsCollapsed?[0,f.lastOffset]:Ds(f.selection),b=f.getValue(g,u);navigator.clipboard.writeText(b).then(()=>{},()=>o.model.announce("plonk"))}static onCopy(o,u){var f;if(!u.clipboardData)return;if(!o.contentEditable&&o.userSelect==="none"){o.model.announce("plonk");return}const g=o.model,b=g.selectionIsCollapsed?[0,g.lastOffset]:Ds(g.selection);let M=g.getAtoms(b);if(M.every(N=>N.mode==="text"||!N.mode))u.clipboardData.setData("text/plain",M.filter(N=>N instanceof Wl).map(N=>N.value).join(""));else if(M.every(N=>N.mode==="latex"))u.clipboardData.setData("text/plain",g.getAtoms(b,{includeChildren:!0}).map(N=>{var I;return(I=N.value)!=null?I:""}).join(""));else{let N;M.length===1&&M[0].verbatimLatex!==void 0?N=M[0].verbatimLatex:N=g.getValue(b,"latex-expanded"),u.clipboardData.setData("application/x-latex",N);try{u.clipboardData.setData("text/plain",o.options.onExport(o,N,b))}catch(I){}if(M.length===1){const I=M[0];(I.type==="root"||I.type==="group")&&(M=I.body.filter(B=>B.type!=="first"))}try{u.clipboardData.setData("application/json+mathlive",JSON.stringify(M.map(I=>I.toJson())))}catch(I){}if((f=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&f.ComputeEngine){const I=window.MathfieldElement.computeEngine;if(I)try{const B=I.jsonSerializationOptions;I.jsonSerializationOptions={metadata:["latex"]};const U=I.parse(g.getValue(b,"latex-unstyled"));I.jsonSerializationOptions=B;const lt=JSON.stringify(U.json);lt&&u.clipboardData.setData("application/json",lt)}catch(B){}}}u.preventDefault()}static insert(o,u,f={}){var g;const b=f.mode==="auto"?o.mode:(g=f.mode)!=null?g:o.mode;return hx._modes[b].insert(o,u,f)}onPaste(o,u){return!1}insert(o,u,f){return!1}};qc._modes={};var ur=qc,Ih=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],vh={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function xa(r){var o;return((o=r.element)==null?void 0:o.mathfield)===r}function Ul(r){var o,u;return(u=(o=r.querySelector(".ML__caret"))!=null?o:r.querySelector(".ML__text-caret"))!=null?u:r.querySelector(".ML__latex-caret")}function Iu(r){const o=Ul(r);if(!o)return null;const u=o.getBoundingClientRect();return{x:u.right,y:u.bottom,height:u.height}}function Uo(r){var o;if(!r.parent)return"root";let u=(o=r.parent.id)!=null?o:"";return u+=typeof r.parentBranch=="string"?"-"+r.parentBranch:`-${r.parentBranch[0]}/${r.parentBranch[0]}`,u}function ns(r,o,u){if(!o)return null;const f=r.field.getBoundingClientRect(),g=o.right-o.left,b=o.bottom-o.top,M=Math.ceil(o.left-f.left+r.field.scrollLeft*u),N=Math.ceil(o.top-f.top);return{left:M,right:M+g,top:N,bottom:N+b}}function Zl(r){const o=r.getBoundingClientRect(),u=parseInt(getComputedStyle(r).marginRight),f={top:o.top-1,bottom:o.bottom,left:o.left,right:o.right-1+u};if(r.children.length===0||r.tagName.toUpperCase()==="SVG")return f;for(const g of r.children)if(g.nodeType===1&&"atomId"in g.dataset&&!g.classList.contains("pstrut")){const b=Zl(g);f.left=Math.min(f.left,b.left),f.right=Math.max(f.right,b.right),f.top=Math.min(f.top,b.top),f.bottom=Math.max(f.bottom,b.bottom)}return f}function Gl(r,o){var u,f;if(!o.id)return null;let g=(f=(u=r.atomBoundsCache)==null?void 0:u.get(o.id))!=null?f:null;if(g!==null)return g;const b=r.field.querySelector(`[data-atom-id="${o.id}"]`);return g=b?Zl(b):null,r.atomBoundsCache&&(g?r.atomBoundsCache.set(o.id,g):r.atomBoundsCache.delete(o.id)),g!=null?g:null}function Cl(r,o,u){const f=new Map;for(const g of r.model.getAtoms(o,{includeChildren:!0})){if(u!=null&&u.excludeAtomsWithBackground&&g.style.backgroundColor)continue;const b=r.field,M=b.offsetWidth;let I=Math.floor(b.getBoundingClientRect().width)/M;I=isNaN(I)?1:I;const B=ns(r,Gl(r,g),I);if(B){const U=Uo(g);if(f.has(U)){const lt=f.get(U);f.set(U,{left:Math.min(lt.left,B.left),right:Math.max(lt.right,B.right),top:Math.min(lt.top,B.top),bottom:Math.max(lt.bottom,B.bottom)})}else f.set(U,B)}}return[...f.values()]}function Ou(r,o){return r.model.selection.ranges.reduce((u,f)=>u.concat(...Cl(r,f,o)),[])}function Xl(r,o){return r==="*"||o==="none"?!0:o==="same-origin"?!window.origin||r===window.origin:typeof o=="function"?o(r):!1}function Uh(r){let o=0,u=0;const f=r.offsetWidth,g=r.offsetHeight;for(;r instanceof HTMLElement;)o+=r.offsetTop,u+=r.offsetLeft,r=r.offsetParent;return new DOMRect(u,o,f,g)}var Ru=`@keyframes ML__caret-blink {
|
|
|
0%,
|
|
|
100% {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
50% {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
}
|
|
|
.ML__container {
|
|
|
display: inline-flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: space-between;
|
|
|
align-items: flex-end;
|
|
|
min-height: 39px;
|
|
|
/* Need some room for the virtual keyboard toggle */
|
|
|
width: 100%;
|
|
|
/* Encourage browsers to consider allocating a hardware accelerated
|
|
|
layer for this element. */
|
|
|
isolation: isolate;
|
|
|
/* Prevent the browser from trying to interpret touch gestures in the field */
|
|
|
/* "Disabling double-tap to zoom removes the need for browsers to
|
|
|
delay the generation of click events when the user taps the screen." */
|
|
|
touch-action: none;
|
|
|
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
|
|
|
--_selection-color: var(--selection-color, #000);
|
|
|
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
|
|
|
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
|
|
|
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
|
|
|
--_smart-fence-color: var(--smart-fence-color, currentColor);
|
|
|
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
|
|
|
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
|
|
|
--_correct-color: var(--correct-color, #10a000);
|
|
|
--_incorrect-color: var(--incorrect-color, #a01b00);
|
|
|
--_composition-background-color: var(--composition-background-color, #fff1c2);
|
|
|
--_composition-text-color: var(--composition-text-color, black);
|
|
|
--_composition-underline-color: var(--composition-underline-color, transparent);
|
|
|
}
|
|
|
/* This is the actual field content (formula) */
|
|
|
.ML__content {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
align-self: center;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
padding: 2px 3px 2px 1px;
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle,
|
|
|
.ML__menu-toggle {
|
|
|
box-sizing: border-box;
|
|
|
display: flex;
|
|
|
align-self: center;
|
|
|
align-items: center;
|
|
|
flex-shrink: 0;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
width: 34px;
|
|
|
height: 34px;
|
|
|
padding: 0;
|
|
|
margin-right: 4px;
|
|
|
cursor: pointer;
|
|
|
/* Avoid some weird blinking with :hover */
|
|
|
border-radius: 8px;
|
|
|
border: 1px solid transparent;
|
|
|
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
|
|
|
color: hsl(var(--_hue), 40%, 50%);
|
|
|
fill: currentColor;
|
|
|
background: transparent;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle:hover,
|
|
|
.ML__menu-toggle:hover {
|
|
|
background: hsla(0, 0%, 70%, 0.3);
|
|
|
color: #333;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle > span,
|
|
|
.ML__menu-toggle > span {
|
|
|
display: flex;
|
|
|
align-self: center;
|
|
|
align-items: center;
|
|
|
}
|
|
|
/* The invisible element used to capture keyboard events. We're just trying
|
|
|
really hard to make sure it doesn't show. */
|
|
|
.ML__keyboard-sink {
|
|
|
display: inline-block;
|
|
|
resize: none;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
/* Need these for Microsoft Edge */
|
|
|
position: fixed;
|
|
|
clip: rect(0 0 0 0);
|
|
|
/* Need this to prevent iOS Safari from auto-zooming */
|
|
|
font-size: 1em;
|
|
|
font-family: KaTeX_Main;
|
|
|
line-height: 0.5;
|
|
|
/* On Chromium, if this is 0, no keyboard events are received */
|
|
|
}
|
|
|
[part="placeholder"] {
|
|
|
color: var(--neutral-400);
|
|
|
}
|
|
|
.ML__composition {
|
|
|
background: var(--_composition-background-color);
|
|
|
color: var(--_composition-text-color);
|
|
|
text-decoration: underline var(--_composition-underline-color);
|
|
|
}
|
|
|
.ML__caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
width: 0;
|
|
|
display: inline-block;
|
|
|
height: 0.76em;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_caret-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.045em;
|
|
|
bottom: -0.05em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__text-caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
width: 0;
|
|
|
display: inline-block;
|
|
|
height: 0.76em;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_caret-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.045em;
|
|
|
bottom: -0.05em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__latex-caret::after {
|
|
|
content: '';
|
|
|
visibility: hidden;
|
|
|
--_caret-width: clamp(2px, 0.08em, 10px);
|
|
|
border: none;
|
|
|
border-radius: calc(var(--_caret-width) / 2);
|
|
|
border-right: var(--_caret-width) solid var(--_latex-color);
|
|
|
margin-right: calc(-1 * var(--_caret-width));
|
|
|
position: relative;
|
|
|
left: -0.019em;
|
|
|
animation: ML__caret-blink 1.05s step-end forwards infinite;
|
|
|
}
|
|
|
.ML__focused .ML__latex-caret::after,
|
|
|
.ML__focused .ML__text-caret::after,
|
|
|
.ML__focused .ML__caret::after {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.ML__focused .ML__text {
|
|
|
background: var(--_text-highlight-background-color);
|
|
|
}
|
|
|
/* When using smartFence, the anticipated closing fence is displayed
|
|
|
with this style */
|
|
|
.ML__smart-fence__close {
|
|
|
opacity: var(--_smart-fence-opacity);
|
|
|
color: var(--_smart-fence-color);
|
|
|
}
|
|
|
.ML__selected,
|
|
|
.ML__focused .ML__selected .ML__contains-caret,
|
|
|
.ML__focused .ML__selected .ML__smart-fence__close,
|
|
|
.ML__focused .ML__selected .ML__placeholder {
|
|
|
color: var(--_selection-color);
|
|
|
opacity: 1;
|
|
|
}
|
|
|
.ML__selection {
|
|
|
box-sizing: border-box;
|
|
|
background: var(--_selection-background-color) !important;
|
|
|
}
|
|
|
.ML__contains-caret.ML__close,
|
|
|
.ML__contains-caret.ML__open,
|
|
|
.ML__contains-caret > .ML__close,
|
|
|
.ML__contains-caret > .ML__open,
|
|
|
.ML__contains-caret .ML__sqrt-sign,
|
|
|
.ML__contains-caret .ML__sqrt-line {
|
|
|
color: var(--_caret-color);
|
|
|
}
|
|
|
.ML__contains-highlight {
|
|
|
box-sizing: border-box;
|
|
|
background: transparent;
|
|
|
}
|
|
|
.ML__focused .ML__contains-highlight {
|
|
|
background: var(--_contains-highlight-background-color);
|
|
|
}
|
|
|
.ML__raw-latex {
|
|
|
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
|
|
|
font-weight: 400;
|
|
|
font-size: 0.8em;
|
|
|
letter-spacing: -0.05em;
|
|
|
color: var(--_latex-color);
|
|
|
}
|
|
|
.ML__suggestion {
|
|
|
color: var(--neutral-500);
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
|
|
|
background: hsl(var(--_hue), 25%, 35%);
|
|
|
color: #fafafa;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle:focus {
|
|
|
outline: none;
|
|
|
border-radius: 8px;
|
|
|
border: 2px solid hsl(var(--_hue), 40%, 50%);
|
|
|
}
|
|
|
.ML__virtual-keyboard-toggle.is-pressed,
|
|
|
.ML__virtual-keyboard-toggle.is-active:hover,
|
|
|
.ML__virtual-keyboard-toggle.is-active {
|
|
|
background: hsl(var(--_hue), 25%, 35%);
|
|
|
color: #fafafa;
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
/* Add an attribute 'data-tooltip' to automatically show a
|
|
|
tooltip over a element on hover.
|
|
|
*/
|
|
|
[data-tooltip] {
|
|
|
position: relative;
|
|
|
}
|
|
|
[data-tooltip]::after {
|
|
|
content: attr(data-tooltip);
|
|
|
position: absolute;
|
|
|
display: block;
|
|
|
z-index: 2;
|
|
|
pointer-events: none;
|
|
|
right: auto;
|
|
|
top: calc(-100% - 4px);
|
|
|
width: max-content;
|
|
|
max-width: 200px;
|
|
|
padding: 8px 8px;
|
|
|
border-radius: 4px;
|
|
|
background: #616161;
|
|
|
color: #fff;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
text-align: center;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-style: normal;
|
|
|
font-weight: 400;
|
|
|
font-size: 13px;
|
|
|
/* Phone */
|
|
|
opacity: 0;
|
|
|
transform: scale(0.5);
|
|
|
}
|
|
|
@media only screen and (max-width: 767px) {
|
|
|
[data-tooltip]::after {
|
|
|
padding: 8px 16px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
}
|
|
|
menu [data-tooltip]::after {
|
|
|
left: 100%;
|
|
|
top: 0%;
|
|
|
}
|
|
|
menu .ML__base {
|
|
|
cursor: default;
|
|
|
}
|
|
|
/** Don't display if we're tracking, i.e. have the pointer down */
|
|
|
.tracking [data-tooltip]:hover::after {
|
|
|
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
|
|
|
visibility: hidden;
|
|
|
}
|
|
|
/** But do display if tracking and inside a menu */
|
|
|
.tracking menu li[data-tooltip]:hover::after,
|
|
|
[data-tooltip]:hover::after {
|
|
|
visibility: visible;
|
|
|
opacity: 1;
|
|
|
transform: scale(1);
|
|
|
transition-property: opacity, scale;
|
|
|
transition-duration: 0.15s;
|
|
|
transition-delay: 1s;
|
|
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__prompt {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.ML__editablePromptBox {
|
|
|
outline: 1px solid #acacac;
|
|
|
border-radius: 2px;
|
|
|
z-index: -1;
|
|
|
}
|
|
|
.ML__focusedPromptBox {
|
|
|
outline: highlight auto 1px;
|
|
|
}
|
|
|
.ML__lockedPromptBox {
|
|
|
background-color: rgba(142, 142, 141, 0.4);
|
|
|
z-index: -1;
|
|
|
}
|
|
|
.ML__correctPromptBox {
|
|
|
outline: 1px solid var(--_correct-color);
|
|
|
box-shadow: 0 0 5px var(--_correct-color);
|
|
|
}
|
|
|
.ML__incorrectPromptBox {
|
|
|
outline: 1px solid var(--_incorrect-color);
|
|
|
box-shadow: 0 0 5px var(--_incorrect-color);
|
|
|
}
|
|
|
.variant-submenu {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
padding: 8px;
|
|
|
}
|
|
|
.variant-submenu [part=menu-item] {
|
|
|
font-size: 2rem;
|
|
|
text-align: center;
|
|
|
margin: 0;
|
|
|
}
|
|
|
.insert-matrix-submenu {
|
|
|
display: grid;
|
|
|
padding: 8px;
|
|
|
align-content: center;
|
|
|
justify-content: center;
|
|
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
|
}
|
|
|
.insert-matrix-submenu [part=menu-item] {
|
|
|
font-size: 21px;
|
|
|
border: none;
|
|
|
border-radius: 0;
|
|
|
line-height: 21px;
|
|
|
text-align: center;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
}
|
|
|
.border-submenu [part=menu-item] {
|
|
|
font-size: 2rem;
|
|
|
line-height: 1.2;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.swatches-submenu {
|
|
|
--_swatch-size: 2rem;
|
|
|
--_columns: 4;
|
|
|
display: flex;
|
|
|
flex-flow: wrap;
|
|
|
padding: 8px;
|
|
|
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.menu-swatch {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
box-sizing: border-box;
|
|
|
width: fit-content;
|
|
|
height: fit-content;
|
|
|
margin: 2px;
|
|
|
padding: 0;
|
|
|
background: var(--neutral-200);
|
|
|
}
|
|
|
.menu-swatch > .label {
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
line-height: 0;
|
|
|
}
|
|
|
.menu-swatch > .label > span {
|
|
|
display: inline-block;
|
|
|
margin: 6px;
|
|
|
min-width: var(--_swatch-size);
|
|
|
min-height: var(--_swatch-size);
|
|
|
border-radius: 50%;
|
|
|
}
|
|
|
.menu-swatch.active {
|
|
|
background: var(--neutral-100);
|
|
|
scale: 1.4;
|
|
|
}
|
|
|
.menu-swatch.active > .label > span {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.menu-swatch .ui-checkmark,
|
|
|
.menu-swatch .ui-mixedmark {
|
|
|
position: absolute;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
color: white;
|
|
|
}
|
|
|
.menu-swatch.dark-contrast .ui-checkmark,
|
|
|
.menu-swatch.dark-contrast .ui-mixedmark {
|
|
|
color: #000;
|
|
|
}
|
|
|
`,Fs=`.ML__container {
|
|
|
min-height: auto !important;
|
|
|
--_hue: var(--hue, 212);
|
|
|
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
|
|
|
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
|
|
|
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
|
|
|
}
|
|
|
.ML__sr-only {
|
|
|
position: absolute;
|
|
|
width: 1px;
|
|
|
height: 1px;
|
|
|
margin: -1px;
|
|
|
padding: 0;
|
|
|
overflow: hidden;
|
|
|
clip: rect(0, 0, 0, 0);
|
|
|
clip-path: inset(50%);
|
|
|
white-space: nowrap;
|
|
|
border: 0;
|
|
|
}
|
|
|
.ML__is-inline {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__base {
|
|
|
visibility: inherit;
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
cursor: text;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
box-sizing: content-box;
|
|
|
border: 0;
|
|
|
outline: 0;
|
|
|
vertical-align: baseline;
|
|
|
font-weight: inherit;
|
|
|
font-family: inherit;
|
|
|
font-style: inherit;
|
|
|
text-decoration: none;
|
|
|
width: min-content;
|
|
|
}
|
|
|
.ML__strut,
|
|
|
.ML__strut--bottom {
|
|
|
display: inline-block;
|
|
|
min-height: 0.5em;
|
|
|
}
|
|
|
.ML__small-delim {
|
|
|
font-family: KaTeX_Main;
|
|
|
}
|
|
|
/* Text mode */
|
|
|
.ML__text {
|
|
|
font-family: var(--_text-font-family);
|
|
|
white-space: pre;
|
|
|
}
|
|
|
/* Use cmr for 'math upright' */
|
|
|
.ML__cmr {
|
|
|
font-family: KaTeX_Main;
|
|
|
font-style: normal;
|
|
|
}
|
|
|
.ML__mathit {
|
|
|
font-family: KaTeX_Math;
|
|
|
/* The KaTeX_Math font is italic by default, so the font-style below is only
|
|
|
useful when a fallback font is used
|
|
|
*/
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__mathbf {
|
|
|
font-family: KaTeX_Main;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
|
|
|
to match TeX idiosyncratic behavior */
|
|
|
.lcGreek.ML__mathbf {
|
|
|
font-family: KaTeX_Math;
|
|
|
font-weight: normal;
|
|
|
}
|
|
|
.ML__mathbfit {
|
|
|
font-family: KaTeX_Math;
|
|
|
font-weight: bold;
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__ams {
|
|
|
font-family: KaTeX_AMS;
|
|
|
}
|
|
|
/* Blackboard */
|
|
|
.ML__bb {
|
|
|
font-family: KaTeX_AMS;
|
|
|
}
|
|
|
.ML__cal {
|
|
|
font-family: KaTeX_Caligraphic;
|
|
|
}
|
|
|
.ML__frak {
|
|
|
font-family: KaTeX_Fraktur;
|
|
|
}
|
|
|
.ML__tt {
|
|
|
font-family: KaTeX_Typewriter;
|
|
|
}
|
|
|
.ML__script {
|
|
|
font-family: KaTeX_Script;
|
|
|
}
|
|
|
.ML__sans {
|
|
|
font-family: KaTeX_SansSerif;
|
|
|
}
|
|
|
.ML__series_ul {
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.ML__series_el {
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.ML__series_l {
|
|
|
font-weight: 200;
|
|
|
}
|
|
|
.ML__series_sl {
|
|
|
font-weight: 300;
|
|
|
}
|
|
|
.ML__series_sb {
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
.ML__bold,
|
|
|
.ML__boldsymbol {
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
.ML__series_eb {
|
|
|
font-weight: 800;
|
|
|
}
|
|
|
.ML__series_ub {
|
|
|
font-weight: 900;
|
|
|
}
|
|
|
.ML__series_uc {
|
|
|
font-stretch: ultra-condensed;
|
|
|
}
|
|
|
.ML__series_ec {
|
|
|
font-stretch: extra-condensed;
|
|
|
}
|
|
|
.ML__series_c {
|
|
|
font-stretch: condensed;
|
|
|
}
|
|
|
.ML__series_sc {
|
|
|
font-stretch: semi-condensed;
|
|
|
}
|
|
|
.ML__series_sx {
|
|
|
font-stretch: semi-expanded;
|
|
|
}
|
|
|
.ML__series_x {
|
|
|
font-stretch: expanded;
|
|
|
}
|
|
|
.ML__series_ex {
|
|
|
font-stretch: extra-expanded;
|
|
|
}
|
|
|
.ML__series_ux {
|
|
|
font-stretch: ultra-expanded;
|
|
|
}
|
|
|
.ML__it {
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.ML__shape_ol {
|
|
|
-webkit-text-stroke: 1px black;
|
|
|
text-stroke: 1px black;
|
|
|
color: transparent;
|
|
|
}
|
|
|
.ML__shape_sc {
|
|
|
font-variant: small-caps;
|
|
|
}
|
|
|
.ML__shape_sl {
|
|
|
font-style: oblique;
|
|
|
}
|
|
|
/* First level emphasis */
|
|
|
.ML__emph {
|
|
|
color: #bc2612;
|
|
|
}
|
|
|
/* Second level emphasis */
|
|
|
.ML__emph .ML__emph {
|
|
|
color: #0c7f99;
|
|
|
}
|
|
|
.ML__highlight {
|
|
|
color: #007cb2;
|
|
|
background: #edd1b0;
|
|
|
}
|
|
|
.ML__center {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__label_padding {
|
|
|
padding: 0 0.5em;
|
|
|
}
|
|
|
.ML__frac-line {
|
|
|
width: 100%;
|
|
|
min-height: 1px;
|
|
|
}
|
|
|
.ML__frac-line:after {
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: max(-1px, -0.04em);
|
|
|
min-height: max(1px, 0.04em);
|
|
|
/* Ensure the line is visible when printing even if "turn off background images" is on*/
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
/* There's a bug since Chrome 62 where
|
|
|
sub-pixel border lines don't draw at some zoom
|
|
|
levels (110%, 90%).
|
|
|
Setting the min-height used to work around it, but that workaround
|
|
|
broke in Chrome 84 or so.
|
|
|
Setting the background (and the min-height) seems to work for now.
|
|
|
*/
|
|
|
background: currentColor;
|
|
|
box-sizing: content-box;
|
|
|
/* Vuetify sets the box-sizing to inherit
|
|
|
causes the fraction line to not draw at all sizes (see #26) */
|
|
|
/* On some versions of Firefox on Windows, the line fails to
|
|
|
draw at some zoom levels, but setting the transform triggers
|
|
|
the hardware accelerated path, which works */
|
|
|
transform: translate(0, 0);
|
|
|
}
|
|
|
.ML__sqrt {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__sqrt-sign {
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__sqrt-line {
|
|
|
display: inline-block;
|
|
|
height: max(1px, 0.04em);
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__sqrt-line:before {
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: min(-1px, -0.04em);
|
|
|
min-height: max(1px, 0.04em);
|
|
|
/* Ensure the line is visible when printing even if "turn off background images" is on*/
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
background: currentColor;
|
|
|
/* On some versions of Firefox on Windows, the line fails to
|
|
|
draw at some zoom levels, but setting the transform triggers
|
|
|
the hardware accelerated path, which works */
|
|
|
transform: translate(0, 0);
|
|
|
}
|
|
|
.ML__sqrt-line:after {
|
|
|
border-bottom-width: 1px;
|
|
|
content: ' ';
|
|
|
display: block;
|
|
|
margin-top: -0.1em;
|
|
|
}
|
|
|
.ML__sqrt-index {
|
|
|
margin-left: 0.27777778em;
|
|
|
margin-right: -0.55555556em;
|
|
|
}
|
|
|
.ML__delim-size1 {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__delim-size2 {
|
|
|
font-family: KaTeX_Size2;
|
|
|
}
|
|
|
.ML__delim-size3 {
|
|
|
font-family: KaTeX_Size3;
|
|
|
}
|
|
|
.ML__delim-size4 {
|
|
|
font-family: KaTeX_Size4;
|
|
|
}
|
|
|
.ML__delim-mult .delim-size1 > span {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__delim-mult .delim-size4 > span {
|
|
|
font-family: KaTeX_Size4;
|
|
|
}
|
|
|
.ML__accent-body > span {
|
|
|
font-family: KaTeX_Main;
|
|
|
width: 0;
|
|
|
}
|
|
|
.ML__accent-vec {
|
|
|
position: relative;
|
|
|
left: 0.24em;
|
|
|
}
|
|
|
/** The markup for a LaTeX formula, either in an editable mathfield or
|
|
|
in a static display.
|
|
|
*/
|
|
|
.ML__latex {
|
|
|
display: inline-block;
|
|
|
direction: ltr;
|
|
|
text-align: left;
|
|
|
text-indent: 0;
|
|
|
text-rendering: auto;
|
|
|
font-family: KaTeX_Main, 'Times New Roman', serif;
|
|
|
font-style: normal;
|
|
|
font-size-adjust: none;
|
|
|
font-stretch: normal;
|
|
|
font-variant-caps: normal;
|
|
|
letter-spacing: normal;
|
|
|
line-height: 1.2;
|
|
|
word-wrap: normal;
|
|
|
word-spacing: normal;
|
|
|
white-space: nowrap;
|
|
|
text-shadow: none;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
width: min-content;
|
|
|
}
|
|
|
.ML__latex .style-wrap {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .mfrac {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .left-right {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .vlist-t {
|
|
|
display: inline-table;
|
|
|
table-layout: fixed;
|
|
|
border-collapse: collapse;
|
|
|
}
|
|
|
.ML__latex .vlist-r {
|
|
|
display: table-row;
|
|
|
}
|
|
|
.ML__latex .vlist {
|
|
|
display: table-cell;
|
|
|
vertical-align: bottom;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .vlist > span {
|
|
|
display: block;
|
|
|
height: 0;
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .vlist > span > span {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .vlist > span > .pstrut {
|
|
|
overflow: hidden;
|
|
|
width: 0;
|
|
|
}
|
|
|
.ML__latex .vlist-t2 {
|
|
|
margin-right: -2px;
|
|
|
}
|
|
|
.ML__latex .vlist-s {
|
|
|
display: table-cell;
|
|
|
vertical-align: bottom;
|
|
|
font-size: 1px;
|
|
|
width: 2px;
|
|
|
min-width: 2px;
|
|
|
}
|
|
|
.ML__latex .msubsup {
|
|
|
text-align: left;
|
|
|
}
|
|
|
.ML__latex .negativethinspace {
|
|
|
display: inline-block;
|
|
|
margin-left: -0.16667em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .thinspace {
|
|
|
display: inline-block;
|
|
|
width: 0.16667em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .mediumspace {
|
|
|
display: inline-block;
|
|
|
width: 0.22222em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .thickspace {
|
|
|
display: inline-block;
|
|
|
width: 0.27778em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .enspace {
|
|
|
display: inline-block;
|
|
|
width: 0.5em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .quad {
|
|
|
display: inline-block;
|
|
|
width: 1em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .qquad {
|
|
|
display: inline-block;
|
|
|
width: 2em;
|
|
|
height: 0.71em;
|
|
|
}
|
|
|
.ML__latex .llap,
|
|
|
.ML__latex .rlap {
|
|
|
width: 0;
|
|
|
position: relative;
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .llap > .inner,
|
|
|
.ML__latex .rlap > .inner {
|
|
|
position: absolute;
|
|
|
}
|
|
|
.ML__latex .llap > .fix,
|
|
|
.ML__latex .rlap > .fix {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .llap > .inner {
|
|
|
right: 0;
|
|
|
}
|
|
|
.ML__latex .rlap > .inner {
|
|
|
left: 0;
|
|
|
}
|
|
|
.ML__latex .rule {
|
|
|
display: inline-block;
|
|
|
border: solid 0;
|
|
|
position: relative;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line,
|
|
|
.ML__latex .underline .underline-line {
|
|
|
width: 100%;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line:before,
|
|
|
.ML__latex .underline .underline-line:before {
|
|
|
content: '';
|
|
|
border-bottom-style: solid;
|
|
|
border-bottom-width: max(1px, 0.04em);
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
display: block;
|
|
|
}
|
|
|
.ML__latex .overline .overline-line:after,
|
|
|
.ML__latex .underline .underline-line:after {
|
|
|
border-bottom-style: solid;
|
|
|
border-bottom-width: max(1px, 0.04em);
|
|
|
-webkit-print-color-adjust: exact;
|
|
|
print-color-adjust: exact;
|
|
|
content: '';
|
|
|
display: block;
|
|
|
margin-top: -1px;
|
|
|
}
|
|
|
.ML__latex .stretchy {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
left: 0;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .stretchy:before,
|
|
|
.ML__latex .stretchy:after {
|
|
|
content: '';
|
|
|
}
|
|
|
.ML__latex .stretchy svg {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
height: inherit;
|
|
|
fill: currentColor;
|
|
|
stroke: currentColor;
|
|
|
fill-rule: nonzero;
|
|
|
fill-opacity: 1;
|
|
|
stroke-width: 1;
|
|
|
stroke-linecap: butt;
|
|
|
stroke-linejoin: miter;
|
|
|
stroke-miterlimit: 4;
|
|
|
stroke-dasharray: none;
|
|
|
stroke-dashoffset: 0;
|
|
|
stroke-opacity: 1;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-2 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
width: 50.2%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-2-of-2 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
width: 50.2%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
width: 25.1%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-2-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
left: 25%;
|
|
|
width: 50%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-3-of-3 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
width: 25.1%;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .slice-1-of-1 {
|
|
|
display: inline-flex;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
left: 0;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
.ML__latex .nulldelimiter {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .op-group {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .op-symbol {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__latex .op-symbol.small-op {
|
|
|
font-family: KaTeX_Size1;
|
|
|
}
|
|
|
.ML__latex .op-symbol.large-op {
|
|
|
font-family: KaTeX_Size2;
|
|
|
}
|
|
|
.ML__latex .mtable .vertical-separator {
|
|
|
display: inline-block;
|
|
|
min-width: 1px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ML__latex .mtable .arraycolsep {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-m > .vlist-t {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-c > .vlist-t {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-l > .vlist-t {
|
|
|
text-align: left;
|
|
|
}
|
|
|
.ML__latex .mtable .col-align-r > .vlist-t {
|
|
|
text-align: right;
|
|
|
}
|
|
|
.ML__error {
|
|
|
display: inline-block;
|
|
|
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
|
|
|
background-color: hsla(341, 100%, 40%, 0.1);
|
|
|
background-repeat: repeat-x;
|
|
|
background-size: 3px 3px;
|
|
|
padding-bottom: 3px;
|
|
|
background-position: 0 100%;
|
|
|
}
|
|
|
.ML__error > .ML__error {
|
|
|
background: transparent;
|
|
|
padding: 0;
|
|
|
}
|
|
|
.ML__placeholder {
|
|
|
color: var(--_placeholder-color);
|
|
|
opacity: var(--_placeholder-opacity);
|
|
|
padding-left: 0.4ex;
|
|
|
padding-right: 0.4ex;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
}
|
|
|
.ML__notation {
|
|
|
position: absolute;
|
|
|
box-sizing: border-box;
|
|
|
line-height: 0;
|
|
|
}
|
|
|
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
|
|
|
For UI elements, see \`[data-ML__tooltip]\`
|
|
|
*/
|
|
|
.ML__tooltip-container {
|
|
|
position: relative;
|
|
|
transform: scale(0);
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content {
|
|
|
position: fixed;
|
|
|
display: inline-table;
|
|
|
visibility: hidden;
|
|
|
z-index: 2;
|
|
|
width: max-content;
|
|
|
max-width: 400px;
|
|
|
padding: 12px 12px;
|
|
|
border-radius: 8px;
|
|
|
background: #616161;
|
|
|
--_selection-color: #fff;
|
|
|
color: #fff;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
opacity: 0;
|
|
|
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content .ML__text {
|
|
|
white-space: normal;
|
|
|
}
|
|
|
.ML__tooltip-container .ML__tooltip-content .ML__base {
|
|
|
display: contents;
|
|
|
}
|
|
|
.ML__tooltip-container:hover .ML__tooltip-content {
|
|
|
visibility: visible;
|
|
|
opacity: 1;
|
|
|
font-size: 0.75em;
|
|
|
transform: scale(1) translate(0, 3em);
|
|
|
}
|
|
|
`,Oh=`#mathlive-environment-popover.is-visible {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
#mathlive-environment-popover {
|
|
|
--_environment-panel-height: var(--environment-panel-height, 70px);
|
|
|
--_accent-color: var(--accent-color, #aaa);
|
|
|
--_background: var(--environment-panel-background, #fff);
|
|
|
--_button-background: var(--environment-panel-button-background, white);
|
|
|
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
|
|
|
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
|
|
|
--_button-text: var(--environment-panel-button-text, #e3e4e8);
|
|
|
position: absolute;
|
|
|
width: calc(var(--_environment-panel-height) * 2);
|
|
|
height: var(--_environment-panel-height);
|
|
|
border-radius: 4px;
|
|
|
border: 1.5px solid var(--_accent-color);
|
|
|
background-color: var(--_background);
|
|
|
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
|
|
|
pointer-events: all;
|
|
|
visibility: hidden;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons {
|
|
|
height: calc(var(--_environment-panel-height) * 5/4);
|
|
|
width: calc(var(--_environment-panel-height) * 5/4);
|
|
|
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
|
|
|
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons .font {
|
|
|
fill: white;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons circle {
|
|
|
fill: #7f7f7f;
|
|
|
transition: fill 300ms;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
|
|
|
fill-opacity: 1;
|
|
|
fill: var(--_background);
|
|
|
stroke: var(--_accent-color);
|
|
|
stroke-width: 3px;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons line {
|
|
|
stroke: var(--_accent-color);
|
|
|
stroke-opacity: 0;
|
|
|
stroke-width: 40;
|
|
|
pointer-events: none;
|
|
|
transition: stroke-opacity 300ms;
|
|
|
stroke-linecap: round;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
|
|
|
fill: var(--_accent-color);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
|
|
|
stroke-opacity: 1;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
|
|
|
height: 100%;
|
|
|
width: 50%;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
|
|
|
width: var(--_environment-panel-height);
|
|
|
height: var(--_environment-panel-height);
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-around;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
|
|
|
pointer-events: all;
|
|
|
margin-top: 2px;
|
|
|
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
|
|
|
height: calc(var(--_environment-panel-height) / 3 - 2px);
|
|
|
border-radius: calc(var(--_environment-panel-height) / 25);
|
|
|
background-color: var(--_button-background);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
|
|
|
background-color: var(--_button-background-hover);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
|
|
|
stroke: var(--_button-text);
|
|
|
stroke-width: 2;
|
|
|
stroke-linecap: round;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
|
|
|
fill-opacity: 0;
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
|
|
|
pointer-events: none;
|
|
|
background-color: var(--_button-background-active);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
|
|
|
stroke: var(--_accent-color);
|
|
|
}
|
|
|
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
|
|
|
fill: var(--_accent-color);
|
|
|
}
|
|
|
`,gf=`/* The element that display info while in latex mode */
|
|
|
#mathlive-suggestion-popover {
|
|
|
background-color: rgba(97, 97, 97);
|
|
|
color: #fff;
|
|
|
text-align: center;
|
|
|
border-radius: 8px;
|
|
|
position: fixed;
|
|
|
z-index: 1;
|
|
|
display: none;
|
|
|
flex-direction: column;
|
|
|
justify-content: center;
|
|
|
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
|
|
|
}
|
|
|
#mathlive-suggestion-popover.top-tip::after {
|
|
|
content: '';
|
|
|
position: absolute;
|
|
|
top: -15px;
|
|
|
left: calc(50% - 15px);
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
border-left: 15px solid transparent;
|
|
|
border-right: 15px solid transparent;
|
|
|
border-bottom: 15px solid rgba(97, 97, 97);
|
|
|
font-size: 1rem;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.bottom-tip::after {
|
|
|
content: '';
|
|
|
position: absolute;
|
|
|
bottom: -15px;
|
|
|
left: calc(50% - 15px);
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
border-left: 15px solid transparent;
|
|
|
border-right: 15px solid transparent;
|
|
|
border-top: 15px solid rgba(97, 97, 97);
|
|
|
font-size: 1rem;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.is-animated {
|
|
|
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
|
|
|
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
|
|
|
}
|
|
|
#mathlive-suggestion-popover.is-visible {
|
|
|
display: flex;
|
|
|
}
|
|
|
@keyframes ML__fade-in {
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
}
|
|
|
/* The wrapper class for the entire content of the popover panel */
|
|
|
#mathlive-suggestion-popover ul {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
list-style: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
align-items: flex-start;
|
|
|
max-height: 400px;
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
margin: 8px;
|
|
|
padding: 8px;
|
|
|
width: calc(100% - 16px - 16px);
|
|
|
column-gap: 1em;
|
|
|
border-radius: 8px;
|
|
|
cursor: pointer;
|
|
|
/* Since the content can be clicked on, provide feedback on hover */
|
|
|
}
|
|
|
#mathlive-suggestion-popover li a {
|
|
|
color: #5ea6fd;
|
|
|
padding-top: 0.3em;
|
|
|
margin-top: 0.4em;
|
|
|
display: block;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li a:hover {
|
|
|
color: #5ea6fd;
|
|
|
text-decoration: underline;
|
|
|
}
|
|
|
#mathlive-suggestion-popover li:hover,
|
|
|
#mathlive-suggestion-popover li.is-pressed,
|
|
|
#mathlive-suggestion-popover li.is-active {
|
|
|
background: rgba(255, 255, 255, 0.1);
|
|
|
}
|
|
|
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
|
|
|
.ML__popover__command {
|
|
|
font-size: 1.6rem;
|
|
|
font-family: KaTeX_Main;
|
|
|
}
|
|
|
.ML__popover__current {
|
|
|
background: #5ea6fd;
|
|
|
color: #fff;
|
|
|
}
|
|
|
.ML__popover__latex {
|
|
|
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
|
|
|
align-self: center;
|
|
|
}
|
|
|
/* The keyboard shortcuts for a symbol as displayed in the popover */
|
|
|
.ML__popover__keybinding {
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 0.8em;
|
|
|
opacity: 0.7;
|
|
|
}
|
|
|
/* Style for the character that joins the modifiers of a keyboard shortcut
|
|
|
(usually a "+" sign)*/
|
|
|
.ML__shortcut-join {
|
|
|
opacity: 0.5;
|
|
|
}
|
|
|
`,If=`/* The element that displays the keys as the user type them */
|
|
|
#mathlive-keystroke-caption-panel {
|
|
|
visibility: hidden;
|
|
|
/*min-width: 160px;*/
|
|
|
/*background-color: rgba(97, 97, 200, .95);*/
|
|
|
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
|
|
|
border-color: var(--secondary-border, hsl(0, 0%, 91%));
|
|
|
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
|
|
|
text-align: center;
|
|
|
border-radius: 6px;
|
|
|
padding: 16px;
|
|
|
position: absolute;
|
|
|
z-index: 1;
|
|
|
display: flex;
|
|
|
flex-direction: row-reverse;
|
|
|
justify-content: center;
|
|
|
--keystroke: white;
|
|
|
--on-keystroke: #555;
|
|
|
--keystroke-border: #f7f7f7;
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
body:not([theme='light']) #mathlive-keystroke-caption-panel {
|
|
|
--keystroke: hsl(var(--_hue), 50%, 30%);
|
|
|
--on-keystroke: hsl(0, 0%, 98%);
|
|
|
--keystroke-border: hsl(var(--_hue), 50%, 25%);
|
|
|
}
|
|
|
}
|
|
|
body[theme='dark'] #mathlive-keystroke-caption-panel {
|
|
|
--keystroke: hsl(var(--_hue), 50%, 30%);
|
|
|
--on-keystroke: hsl(0, 0%, 98%);
|
|
|
--keystroke-border: hsl(var(--_hue), 50%, 25%);
|
|
|
}
|
|
|
#mathlive-keystroke-caption-panel > span {
|
|
|
min-width: 14px;
|
|
|
/*height: 8px;*/
|
|
|
margin: 0 8px 0 0;
|
|
|
padding: 4px;
|
|
|
background-color: var(--keystroke);
|
|
|
color: var(--on-keystroke);
|
|
|
fill: currentColor;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 1em;
|
|
|
border-radius: 6px;
|
|
|
border: 2px solid var(--keystroke-border);
|
|
|
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
|
|
|
}
|
|
|
`,Of=`.ML__keyboard {
|
|
|
--_keyboard-height: 0;
|
|
|
--_keyboard-zindex: var(--keyboard-zindex, 105);
|
|
|
--_accent-color: var(--keyboard-accent-color, #0c75d8);
|
|
|
--_background: var(--keyboard-background, #cacfd7);
|
|
|
--_border: var(--keyboard-border, #ddd);
|
|
|
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
|
|
|
--_padding-top: var(--keyboard-padding-top, 5px);
|
|
|
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
|
|
|
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
|
|
|
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
|
|
|
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
|
|
|
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
|
|
|
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
|
|
|
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
|
|
|
--_keycap-background: var(--keycap-background, white);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
|
|
|
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
|
|
|
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
|
|
|
--_keycap-border: var(--keycap-border, #e5e6e9);
|
|
|
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
|
|
|
--_keycap-text: var(--keycap-text, #000);
|
|
|
--_keycap-text-active: var(--keycap-text-active, #fff);
|
|
|
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
|
|
|
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
|
|
|
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
|
|
|
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
|
|
|
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
|
|
|
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
|
|
|
--_keycap-height: var(--keycap-height, 60px);
|
|
|
/* Keycap width (incl. margin) */
|
|
|
--_keycap-max-width: var(--keycap-max-width, 100px);
|
|
|
--_keycap-gap: var(--keycap-gap, 8px);
|
|
|
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
|
|
|
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
|
|
|
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
|
|
|
--_variant-panel-background: var(--variant-panel-background, #fff);
|
|
|
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
|
|
|
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 70px);
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
|
|
|
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
|
|
|
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
|
|
|
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
|
|
|
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
|
|
|
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
|
|
|
}
|
|
|
.is-math-mode .MLK__rows .if-text-mode,
|
|
|
.is-text-mode .MLK__rows .if-math-mode {
|
|
|
display: none;
|
|
|
}
|
|
|
.if-can-undo,
|
|
|
.if-can-redo,
|
|
|
.if-can-copy,
|
|
|
.if-can-cut,
|
|
|
.if-can-paste {
|
|
|
opacity: 0.4;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.can-undo .if-can-undo,
|
|
|
.can-redo .if-can-redo,
|
|
|
.can-copy .if-can-copy,
|
|
|
.can-cut .if-can-cut,
|
|
|
.can-paste .if-can-paste {
|
|
|
opacity: 1;
|
|
|
pointer-events: all;
|
|
|
}
|
|
|
body > .ML__keyboard {
|
|
|
position: fixed;
|
|
|
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
|
|
|
}
|
|
|
body > .ML__keyboard.is-visible > .MLK__backdrop {
|
|
|
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
|
|
|
border-top: 1px solid var(--_border);
|
|
|
}
|
|
|
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
|
|
|
box-shadow: none;
|
|
|
border: none;
|
|
|
}
|
|
|
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
|
|
|
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
|
|
|
transition-property: transform, opacity;
|
|
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
|
}
|
|
|
.ML__keyboard {
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
z-index: var(--_keyboard-zindex);
|
|
|
box-sizing: border-box;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
line-height: 1;
|
|
|
overflow-wrap: unset;
|
|
|
text-align: left;
|
|
|
vertical-align: baseline;
|
|
|
cursor: auto;
|
|
|
white-space: pre;
|
|
|
box-shadow: none;
|
|
|
opacity: 1;
|
|
|
transform: none;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.ML__keyboard :where(div) {
|
|
|
box-sizing: border-box;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
line-height: 1;
|
|
|
overflow-wrap: unset;
|
|
|
text-align: left;
|
|
|
vertical-align: baseline;
|
|
|
cursor: auto;
|
|
|
white-space: pre;
|
|
|
box-shadow: none;
|
|
|
transform: none;
|
|
|
}
|
|
|
.MLK__backdrop {
|
|
|
position: absolute;
|
|
|
bottom: calc(-1 * var(--_keyboard-height));
|
|
|
width: 100%;
|
|
|
height: var(--_keyboard-height);
|
|
|
box-sizing: border-box;
|
|
|
padding-top: var(--_padding-top);
|
|
|
padding-bottom: var(--_padding-bottom);
|
|
|
padding-left: var(--_padding-horizontal);
|
|
|
padding-right: var(--_padding-horizontal);
|
|
|
opacity: 0;
|
|
|
visibility: hidden;
|
|
|
transform: translate(0, 0);
|
|
|
background: var(--_background);
|
|
|
}
|
|
|
.backdrop-is-transparent .MLK__backdrop {
|
|
|
background: transparent;
|
|
|
}
|
|
|
/* If a custom layout has a custom container/backdrop
|
|
|
(backdrop-is-transparent), make sure to let pointer event go through. */
|
|
|
.backdrop-is-transparent .MLK__plate {
|
|
|
background: transparent;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
/* If a custom layout has a custom container/backdrop, make sure to
|
|
|
allow pointer events on it. */
|
|
|
.backdrop-is-transparent .MLK__layer > div > div {
|
|
|
pointer-events: all;
|
|
|
}
|
|
|
.ML__keyboard.is-visible > .MLK__backdrop {
|
|
|
transform: translate(0, calc(-1 * var(--_keyboard-height)));
|
|
|
opacity: 1;
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.caps-lock-indicator {
|
|
|
display: none;
|
|
|
width: 8px;
|
|
|
height: 8px;
|
|
|
background: #0cbc0c;
|
|
|
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
|
|
|
border-radius: 8px;
|
|
|
right: 8px;
|
|
|
top: 8px;
|
|
|
position: absolute;
|
|
|
}
|
|
|
.ML__keyboard.is-caps-lock .caps-lock-indicator {
|
|
|
display: block;
|
|
|
}
|
|
|
.ML__keyboard.is-caps-lock .shift {
|
|
|
background: var(--_keycap-background-active);
|
|
|
color: var(--_keycap-text-active);
|
|
|
}
|
|
|
.MLK__plate {
|
|
|
position: absolute;
|
|
|
top: var(--_padding-top);
|
|
|
left: var(--_padding-horizontal);
|
|
|
width: calc(100% - 2 * var(--_padding-horizontal));
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
box-sizing: border-box;
|
|
|
container-type: inline-size;
|
|
|
touch-action: none;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
pointer-events: all;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 16px;
|
|
|
/* Size of toolbar labels */
|
|
|
font-weight: 400;
|
|
|
text-shadow: none;
|
|
|
}
|
|
|
.ML__box-placeholder {
|
|
|
color: var(--_box-placeholder-color);
|
|
|
}
|
|
|
.MLK__tex {
|
|
|
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__tex-math {
|
|
|
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
font-style: italic;
|
|
|
}
|
|
|
.MLK__layer {
|
|
|
display: none;
|
|
|
outline: none;
|
|
|
}
|
|
|
.MLK__layer.is-visible {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
}
|
|
|
/* Keyboard layouts are made or rows of keys... */
|
|
|
.MLK__rows {
|
|
|
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
border-collapse: separate;
|
|
|
clear: both;
|
|
|
border: 0;
|
|
|
margin: 0;
|
|
|
margin-bottom: var(--_keycap-gap);
|
|
|
gap: var(--_keycap-gap);
|
|
|
/* If the styling include, e.g., some shadows, they will be
|
|
|
cut off by the overflow. In that case, set the padding to
|
|
|
compensate. */
|
|
|
padding-left: var(--_row-padding-left);
|
|
|
padding-right: var(--_row-padding-right);
|
|
|
overflow: visible;
|
|
|
touch-action: none;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row {
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: center;
|
|
|
width: 100%;
|
|
|
gap: var(--_keycap-gap);
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
/* For the alignment of the text on some modifiers (e.g. shift) */
|
|
|
/* Extra spacing between two adjacent keys */
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .tex {
|
|
|
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .tex-math {
|
|
|
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .big-op {
|
|
|
font-size: calc(1.25 * var(--_keycap-font-size));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .small {
|
|
|
font-size: var(--_keycap-small-font-size);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .bottom {
|
|
|
justify-content: flex-end;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .left {
|
|
|
align-items: flex-start;
|
|
|
padding-left: 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .right {
|
|
|
align-items: flex-end;
|
|
|
padding-right: 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w0 {
|
|
|
width: 0;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w5 {
|
|
|
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w15 {
|
|
|
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w20 {
|
|
|
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w40 {
|
|
|
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .w50 {
|
|
|
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .MLK__keycap.w50 {
|
|
|
font-size: 80%;
|
|
|
padding-top: 10px;
|
|
|
font-weight: 100;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .separator {
|
|
|
background: transparent;
|
|
|
border: none;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .horizontal-rule {
|
|
|
height: 6px;
|
|
|
margin-top: 3px;
|
|
|
margin-bottom: 0;
|
|
|
width: 100%;
|
|
|
border-radius: 0;
|
|
|
border-top: var(--_horizontal-rule);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .ghost {
|
|
|
background: var(--_toolbar-background);
|
|
|
border: none;
|
|
|
color: var(--_toolbar-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .ghost:hover {
|
|
|
background: var(--_toolbar-background-hover);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .bigfnbutton {
|
|
|
font-size: var(--_keycap-extra-small-font-size);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift,
|
|
|
.MLK__rows > .MLK__row .action {
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
background: var(--_keycap-secondary-background);
|
|
|
border-color: var(--_keycap-secondary-border);
|
|
|
border-bottom-color: var(--_keycap-secondary-border-bottom);
|
|
|
line-height: 0.8;
|
|
|
font-size: min(1rem, var(--_keycap-small-font-size));
|
|
|
font-weight: 600;
|
|
|
padding: 8px 12px 8px 12px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift:hover,
|
|
|
.MLK__rows > .MLK__row .action:hover {
|
|
|
background: var(--_keycap-secondary-background-hover);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .action.primary {
|
|
|
background: var(--_keycap-primary-background);
|
|
|
color: var(--_keycap-primary-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .action.primary:hover {
|
|
|
background: var(--_keycap-primary-background-hover);
|
|
|
color: var(--_keycap-primary-text);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift.selected,
|
|
|
.MLK__rows > .MLK__row .action.selected {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .shift.selected.is-pressed,
|
|
|
.MLK__rows > .MLK__row .action.selected.is-pressed,
|
|
|
.MLK__rows > .MLK__row .shift.selected.is-active,
|
|
|
.MLK__rows > .MLK__row .action.selected.is-active {
|
|
|
color: white;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .warning {
|
|
|
background: #cd0030;
|
|
|
color: white;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row .warning svg.svg-glyph {
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
min-height: 24px;
|
|
|
}
|
|
|
/** A regular keycap
|
|
|
* Use the :where() pseudo-class to give it a very low specifity,
|
|
|
* so that it can be overriden by custom style.
|
|
|
*/
|
|
|
:where(.MLK__rows > .MLK__row div) {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
justify-content: space-evenly;
|
|
|
width: calc(var(--_keycap-width) - var(--_keycap-gap));
|
|
|
height: var(--_keycap-height);
|
|
|
box-sizing: border-box;
|
|
|
padding: 0;
|
|
|
vertical-align: top;
|
|
|
text-align: center;
|
|
|
float: left;
|
|
|
color: var(--_keycap-text);
|
|
|
fill: currentColor;
|
|
|
font-size: var(--_keycap-font-size);
|
|
|
background: var(--_keycap-background);
|
|
|
border: 1px solid var(--_keycap-border);
|
|
|
border-bottom-color: var(--_keycap-border-bottom);
|
|
|
border-radius: 6px;
|
|
|
cursor: pointer;
|
|
|
touch-action: none;
|
|
|
/* Keys with a variants panel */
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
-webkit-user-select: none;
|
|
|
user-select: none;
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div):hover {
|
|
|
overflow: visible;
|
|
|
background: var(--_keycap-background-hover);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) .ML__latex {
|
|
|
pointer-events: none;
|
|
|
touch-action: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
|
|
|
margin: 8px 0;
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
min-height: 20px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
|
|
|
margin: 8px 0;
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
min-height: 24px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
|
|
|
font-size: 25px;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).is-pressed {
|
|
|
background: var(--_keycap-background-pressed);
|
|
|
color: var(--_keycap-text-pressed);
|
|
|
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed {
|
|
|
z-index: calc(var(--_keyboard-zindex) - 5);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active aside,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
|
|
|
display: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-pressed {
|
|
|
background: var(--_keycap-background-pressed);
|
|
|
color: var(--_keycap-text-pressed);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div).shift.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
|
|
|
:where(.MLK__rows > .MLK__row div).action.is-active {
|
|
|
background: var(--_keycap-background-active);
|
|
|
color: var(--_keycap-text-active);
|
|
|
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) small {
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
}
|
|
|
:where(.MLK__rows > .MLK__row div) aside {
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-size: 10px;
|
|
|
line-height: 10px;
|
|
|
color: var(--_keycap-secondary-text);
|
|
|
}
|
|
|
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
|
|
|
Note there are a different set of tooltip rules for the keyboard toggle
|
|
|
(it's in a different CSS tree) */
|
|
|
.ML__keyboard [data-tooltip] {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]::after {
|
|
|
position: absolute;
|
|
|
display: inline-table;
|
|
|
content: attr(data-tooltip);
|
|
|
top: inherit;
|
|
|
bottom: 100%;
|
|
|
width: max-content;
|
|
|
max-width: 200px;
|
|
|
padding: 8px 8px;
|
|
|
background: #616161;
|
|
|
color: #fff;
|
|
|
text-align: center;
|
|
|
z-index: 2;
|
|
|
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
|
|
|
border-radius: 2px;
|
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
|
font-weight: 400;
|
|
|
font-size: 12px;
|
|
|
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
|
|
|
opacity: 0;
|
|
|
transform: scale(0.5);
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]:hover {
|
|
|
position: relative;
|
|
|
}
|
|
|
.ML__keyboard [data-tooltip]:hover::after {
|
|
|
opacity: 1;
|
|
|
transform: scale(1);
|
|
|
}
|
|
|
.MLK__toolbar {
|
|
|
align-self: center;
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
justify-content: space-between;
|
|
|
width: 100%;
|
|
|
max-width: 996px;
|
|
|
min-height: 32px;
|
|
|
/* Icons for undo/redo, etc. */
|
|
|
}
|
|
|
.MLK__toolbar svg {
|
|
|
height: 20px;
|
|
|
width: 20px;
|
|
|
}
|
|
|
.MLK__toolbar > .left {
|
|
|
position: relative;
|
|
|
display: flex;
|
|
|
justify-content: flex-start;
|
|
|
flex-flow: row;
|
|
|
}
|
|
|
.MLK__toolbar > .right {
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
flex-flow: row;
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
/* "button" in the toolbar */
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
color: var(--_toolbar-text);
|
|
|
fill: currentColor;
|
|
|
background: var(--_toolbar-background);
|
|
|
font-size: var(--_toolbar-font-size);
|
|
|
padding: 4px 15px;
|
|
|
cursor: pointer;
|
|
|
width: max-content;
|
|
|
min-width: 42px;
|
|
|
min-height: 34px;
|
|
|
border: none;
|
|
|
padding-left: 10px;
|
|
|
padding-right: 10px;
|
|
|
padding-bottom: 8px;
|
|
|
padding-top: 8px;
|
|
|
margin-top: 0;
|
|
|
margin-bottom: 4px;
|
|
|
margin-left: 4px;
|
|
|
margin-right: 4px;
|
|
|
border-radius: 8px;
|
|
|
box-shadow: none;
|
|
|
border-bottom: 2px solid transparent;
|
|
|
}
|
|
|
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
|
|
|
background: var(--_toolbar-background-hover);
|
|
|
}
|
|
|
.MLK__toolbar > div > div.disabled svg,
|
|
|
.MLK__toolbar > div > div.disabled:hover svg,
|
|
|
.MLK__toolbar > div > div.disabled.is-pressed svg {
|
|
|
color: var(--_toolbar-text);
|
|
|
opacity: 0.2;
|
|
|
}
|
|
|
.MLK__toolbar > div > div:hover,
|
|
|
.MLK__toolbar > div > div:active,
|
|
|
.MLK__toolbar > div > div.is-pressed,
|
|
|
.MLK__toolbar > div > div.is-active {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
}
|
|
|
.MLK__toolbar > div > div.selected {
|
|
|
color: var(--_toolbar-text-active);
|
|
|
background: var(--_toolbar-background-selected);
|
|
|
border-radius: 0;
|
|
|
border-bottom-color: var(--_toolbar-text-active);
|
|
|
padding-bottom: 4px;
|
|
|
margin-bottom: 8px;
|
|
|
}
|
|
|
/* This is the element that displays variants on press+hold */
|
|
|
.MLK__variant-panel {
|
|
|
visibility: hidden;
|
|
|
position: fixed;
|
|
|
display: flex;
|
|
|
flex-flow: row wrap-reverse;
|
|
|
justify-content: center;
|
|
|
align-content: center;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
bottom: auto;
|
|
|
top: 0;
|
|
|
box-sizing: content-box;
|
|
|
transform: none;
|
|
|
z-index: calc(var(--_keyboard-zindex) + 1);
|
|
|
touch-action: none;
|
|
|
max-width: 350px;
|
|
|
background: var(--_variant-panel-background);
|
|
|
text-align: center;
|
|
|
border-radius: 6px;
|
|
|
padding: 6px;
|
|
|
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
|
|
|
transition: none;
|
|
|
}
|
|
|
.MLK__variant-panel.is-visible {
|
|
|
visibility: visible;
|
|
|
}
|
|
|
.MLK__variant-panel.compact {
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
|
|
|
}
|
|
|
.MLK__variant-panel .item {
|
|
|
display: flex;
|
|
|
flex-flow: column;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
font-size: var(--_variant-keycap-font-size);
|
|
|
height: var(--_variant-keycap-length);
|
|
|
width: var(--_variant-keycap-length);
|
|
|
margin: 0;
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 5px;
|
|
|
border: 1px solid transparent;
|
|
|
background: transparent;
|
|
|
pointer-events: all;
|
|
|
cursor: pointer;
|
|
|
color: var(--_variant-keycap-text);
|
|
|
fill: currentColor;
|
|
|
}
|
|
|
@media (max-height: 412px) {
|
|
|
.MLK__variant-panel .item {
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
}
|
|
|
}
|
|
|
.MLK__variant-panel .item .ML__latex {
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
.MLK__variant-panel .item.is-active {
|
|
|
background: var(--_variant-keycap-background-active);
|
|
|
color: var(--_variant-keycap-text-active);
|
|
|
}
|
|
|
.MLK__variant-panel .item.is-pressed {
|
|
|
background: var(--_variant-keycap-background-pressed);
|
|
|
color: var(--_variant-keycap-text-pressed);
|
|
|
}
|
|
|
.MLK__variant-panel .item.small {
|
|
|
font-size: var(--_keycap-small-font-size);
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button {
|
|
|
box-sizing: border-box;
|
|
|
background: #fbfbfb;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button > span {
|
|
|
display: inline-block;
|
|
|
margin: 6px;
|
|
|
width: calc(100% - 12px);
|
|
|
height: calc(100% - 12px);
|
|
|
border-radius: 50%;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button:hover {
|
|
|
background: #f0f0f0;
|
|
|
}
|
|
|
.MLK__variant-panel .item.swatch-button:hover > span {
|
|
|
border-radius: 2px;
|
|
|
}
|
|
|
.MLK__variant-panel .item.box > div,
|
|
|
.MLK__variant-panel .item.box > span {
|
|
|
border: 1px dashed rgba(0, 0, 0, 0.24);
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning {
|
|
|
min-height: 60px;
|
|
|
min-width: 60px;
|
|
|
background: #cd0030;
|
|
|
color: white;
|
|
|
padding: 5px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
border-radius: 5px;
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning.is-pressed,
|
|
|
.MLK__variant-panel .item .warning.is-active {
|
|
|
background: red;
|
|
|
}
|
|
|
.MLK__variant-panel .item .warning svg.svg-glyph {
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
|
}
|
|
|
.MLK__variant-panel .item aside {
|
|
|
font-size: var(--_variant-keycap-aside-font-size);
|
|
|
line-height: 12px;
|
|
|
opacity: 0.78;
|
|
|
padding-top: 2px;
|
|
|
}
|
|
|
.MLK__keycap {
|
|
|
position: relative;
|
|
|
}
|
|
|
.MLK__shift {
|
|
|
display: block;
|
|
|
position: absolute;
|
|
|
right: 4px;
|
|
|
top: 4px;
|
|
|
font-size: var(--_keycap-shift-font-size);
|
|
|
color: var(--_keycap-shift-color);
|
|
|
}
|
|
|
.hide-shift .MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
@media (max-width: 414px) {
|
|
|
.MLK__variant-panel {
|
|
|
max-width: 350px;
|
|
|
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
|
|
|
--_variant-keycap-length: var(--variant-keycap-length, 50px);
|
|
|
}
|
|
|
}
|
|
|
/* @xs breakpoint: iPhone 5 */
|
|
|
@container (max-width: 414px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
|
|
|
--_keycap-height: max(var(--_keycap-height), 42px);
|
|
|
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
font-size: 100%;
|
|
|
margin-left: 2px;
|
|
|
margin-right: 2px;
|
|
|
}
|
|
|
.MLK__rows .shift,
|
|
|
.MLK__rows .action {
|
|
|
font-size: 65%;
|
|
|
}
|
|
|
.MLK__rows .warning svg.svg-glyph {
|
|
|
width: 14px;
|
|
|
height: 14px;
|
|
|
min-height: 14px;
|
|
|
}
|
|
|
}
|
|
|
@container (max-width: 744px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
|
|
|
--_keycap-height: max(var(--keycap-height, 52px), 52px);
|
|
|
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
|
|
|
}
|
|
|
.MLK__toolbar > div > div {
|
|
|
padding-left: 0;
|
|
|
padding-right: 0;
|
|
|
}
|
|
|
.MLK__tooltip::after {
|
|
|
padding: 8px 16px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.fnbutton {
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.bigfnbutton {
|
|
|
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div.small {
|
|
|
font-size: 13px;
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > aside {
|
|
|
display: none;
|
|
|
}
|
|
|
.MLK__shift {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
/* Medium breakpoint: larger phones */
|
|
|
@container (max-width: 768px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-height: max(var(--keycap-height, 42px), 42px);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > small {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
@media (max-height: 768px) {
|
|
|
.MLK__rows {
|
|
|
--_keycap-height: max(var(--keycap-height, 42px), 42px);
|
|
|
}
|
|
|
.MLK__rows > .MLK__row > div > small {
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
}
|
|
|
@container (max-width: 1444px) {
|
|
|
.MLK__rows .if-wide {
|
|
|
display: none;
|
|
|
}
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
.ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
|
|
|
--_background: var(--keyboard-background, #151515);
|
|
|
--_border: var(--keyboard-border, transparent);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
|
|
|
--keyboard-toolbar-background-hover: #303030;
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
|
|
|
--_keycap-background: var(--keycap-background, #1f2022);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
|
|
|
--_keycap-border: var(--_keycap-border, transparent);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
|
|
|
--_keycap-text: var(--keycap-text, #e3e4e8);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
|
|
|
--keycap-secondary-border: transparent;
|
|
|
--keycap-secondary-border-bottom: transparent;
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #303030);
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
|
|
|
}
|
|
|
}
|
|
|
/* Same as the media query, but with a class */
|
|
|
[theme='dark'] .ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
|
|
|
--_background: var(--keyboard-background, #151515);
|
|
|
--_border: var(--keyboard-border, transparent);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
|
|
|
--keyboard-toolbar-background-hover: #303030;
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
|
|
|
--_keycap-background: var(--keycap-background, #1f2022);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
|
|
|
--_keycap-border: var(--_keycap-border, transparent);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
|
|
|
--_keycap-text: var(--keycap-text, #e3e4e8);
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
|
|
|
--keycap-secondary-border: transparent;
|
|
|
--keycap-secondary-border-bottom: transparent;
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #303030);
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
|
|
|
}
|
|
|
[theme='light'] .ML__keyboard {
|
|
|
--_accent-color: var(--keyboard-accent-color, #0c75d8);
|
|
|
--_background: var(--keyboard-background, #cacfd7);
|
|
|
--_border: var(--keyboard-border, #ddd);
|
|
|
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
|
|
|
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
|
|
|
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
|
|
|
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
|
|
|
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
|
|
|
--_keycap-background: var(--keycap-background, white);
|
|
|
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
|
|
|
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
|
|
|
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
|
|
|
--_keycap-border: var(--_keycap-border, #e5e6e9);
|
|
|
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
|
|
|
--_keycap-text: var(--keycap-text, #000);
|
|
|
--_keycap-text-active: var(--keycap-text-active, #fff);
|
|
|
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
|
|
|
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
|
|
|
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
|
|
|
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
|
|
|
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
|
|
|
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
|
|
|
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
|
|
|
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
|
|
|
--_variant-panel-background: var(--variant-panel-background, #fff);
|
|
|
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
|
|
|
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
|
|
|
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
|
|
|
}
|
|
|
`,yh=`:host {
|
|
|
--primary-color: #5898ff;
|
|
|
--primary-color-dimmed: #c0c0f0;
|
|
|
--primary-color-dark: var(--blue-500);
|
|
|
--primary-color-light: var(--blue-100);
|
|
|
--primary-color-reverse: #ffffff;
|
|
|
--secondary-color: #ff8a65;
|
|
|
--secondary-color-dimmed: #f0d5c5;
|
|
|
--secondary-color-dark: var(--orange-500);
|
|
|
--secondary-color-light: var(--orange-100);
|
|
|
--secondary-color-reverse: #ffffff;
|
|
|
--link-color: #5898ff;
|
|
|
--link-color-dimmed: #c5c5c5;
|
|
|
--link-color-dark: #121212;
|
|
|
--link-color-light: #e2e2e2;
|
|
|
--link-color-reverse: #ffffff;
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--neutral-100: #f5f5f5;
|
|
|
--neutral-200: #eeeeee;
|
|
|
--neutral-300: #e0e0e0;
|
|
|
--neutral-400: #bdbdbd;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #757575;
|
|
|
--neutral-700: #616161;
|
|
|
--neutral-800: #424242;
|
|
|
--neutral-900: #212121;
|
|
|
--red-25: #fff8f7;
|
|
|
--red-50: #fff1ef;
|
|
|
--red-100: #ffeae6;
|
|
|
--red-200: #ffcac1;
|
|
|
--red-300: #ffa495;
|
|
|
--red-400: #ff7865;
|
|
|
--red-500: #f21c0d;
|
|
|
--red-600: #e50018;
|
|
|
--red-700: #d30024;
|
|
|
--red-800: #bd002c;
|
|
|
--red-900: #a1002f;
|
|
|
--orange-25: #fffbf8;
|
|
|
--orange-50: #fff7f1;
|
|
|
--orange-100: #fff3ea;
|
|
|
--orange-200: #ffe1c9;
|
|
|
--orange-300: #ffcca2;
|
|
|
--orange-400: #ffb677;
|
|
|
--orange-500: #fe9310;
|
|
|
--orange-600: #f58700;
|
|
|
--orange-700: #ea7c00;
|
|
|
--orange-800: #dc6d00;
|
|
|
--orange-900: #ca5b00;
|
|
|
--brown-25: #fff8ef;
|
|
|
--brown-50: #fff1df;
|
|
|
--brown-100: #ffe9ce;
|
|
|
--brown-200: #ebcca6;
|
|
|
--brown-300: #cdaf8a;
|
|
|
--brown-400: #af936f;
|
|
|
--brown-500: #856a47;
|
|
|
--brown-600: #7f5e34;
|
|
|
--brown-700: #78511f;
|
|
|
--brown-800: #6e4200;
|
|
|
--brown-900: #593200;
|
|
|
--yellow-25: #fffdf9;
|
|
|
--yellow-50: #fffcf2;
|
|
|
--yellow-100: #fffaec;
|
|
|
--yellow-200: #fff2ce;
|
|
|
--yellow-300: #ffe8ab;
|
|
|
--yellow-400: #ffdf85;
|
|
|
--yellow-500: #ffcf33;
|
|
|
--yellow-600: #f1c000;
|
|
|
--yellow-700: #dfb200;
|
|
|
--yellow-800: #c9a000;
|
|
|
--yellow-900: #ad8a00;
|
|
|
--lime-25: #f4ffee;
|
|
|
--lime-50: #e9ffdd;
|
|
|
--lime-100: #ddffca;
|
|
|
--lime-200: #a8fb6f;
|
|
|
--lime-300: #94e659;
|
|
|
--lime-400: #80d142;
|
|
|
--lime-500: #63b215;
|
|
|
--lime-600: #45a000;
|
|
|
--lime-700: #268e00;
|
|
|
--lime-800: #007417;
|
|
|
--lime-900: #005321;
|
|
|
--green-25: #f5fff5;
|
|
|
--green-50: #ebffea;
|
|
|
--green-100: #e0ffdf;
|
|
|
--green-200: #a7ffa7;
|
|
|
--green-300: #5afa65;
|
|
|
--green-400: #45e953;
|
|
|
--green-500: #17cf36;
|
|
|
--green-600: #00b944;
|
|
|
--green-700: #00a34a;
|
|
|
--green-800: #008749;
|
|
|
--green-900: #00653e;
|
|
|
--teal-25: #f3ffff;
|
|
|
--teal-50: #e6fffe;
|
|
|
--teal-100: #d9fffe;
|
|
|
--teal-200: #8dfffe;
|
|
|
--teal-300: #57f4f4;
|
|
|
--teal-400: #43e5e5;
|
|
|
--teal-500: #17cfcf;
|
|
|
--teal-600: #00c2c0;
|
|
|
--teal-700: #00b5b1;
|
|
|
--teal-800: #00a49e;
|
|
|
--teal-900: #009087;
|
|
|
--cyan-25: #f7fcff;
|
|
|
--cyan-50: #eff8ff;
|
|
|
--cyan-100: #e7f5ff;
|
|
|
--cyan-200: #c2e6ff;
|
|
|
--cyan-300: #95d5ff;
|
|
|
--cyan-400: #61c4ff;
|
|
|
--cyan-500: #13a7ec;
|
|
|
--cyan-600: #069eda;
|
|
|
--cyan-700: #0095c9;
|
|
|
--cyan-800: #0088b2;
|
|
|
--cyan-900: #0a7897;
|
|
|
--blue-25: #f7faff;
|
|
|
--blue-50: #eef5ff;
|
|
|
--blue-100: #e5f1ff;
|
|
|
--blue-200: #bfdbff;
|
|
|
--blue-300: #92c2ff;
|
|
|
--blue-400: #63a8ff;
|
|
|
--blue-500: #0d80f2;
|
|
|
--blue-600: #0077db;
|
|
|
--blue-700: #006dc4;
|
|
|
--blue-800: #0060a7;
|
|
|
--blue-900: #005086;
|
|
|
--indigo-25: #f8f7ff;
|
|
|
--indigo-50: #f1efff;
|
|
|
--indigo-100: #eae7ff;
|
|
|
--indigo-200: #ccc3ff;
|
|
|
--indigo-300: #ac99ff;
|
|
|
--indigo-400: #916aff;
|
|
|
--indigo-500: #63c;
|
|
|
--indigo-600: #5a21b2;
|
|
|
--indigo-700: #4e0b99;
|
|
|
--indigo-800: #3b0071;
|
|
|
--indigo-900: #220040;
|
|
|
--purple-25: #fbf7ff;
|
|
|
--purple-50: #f8f0ff;
|
|
|
--purple-100: #f4e8ff;
|
|
|
--purple-200: #e4c4ff;
|
|
|
--purple-300: #d49aff;
|
|
|
--purple-400: #c36aff;
|
|
|
--purple-500: #a219e6;
|
|
|
--purple-600: #9000c4;
|
|
|
--purple-700: #7c009f;
|
|
|
--purple-800: #600073;
|
|
|
--purple-900: #3d0043;
|
|
|
--magenta-25: #fff8fb;
|
|
|
--magenta-50: #fff2f6;
|
|
|
--magenta-100: #ffebf2;
|
|
|
--magenta-200: #ffcddf;
|
|
|
--magenta-300: #ffa8cb;
|
|
|
--magenta-400: #ff7fb7;
|
|
|
--magenta-500: #eb4799;
|
|
|
--magenta-600: #da3689;
|
|
|
--magenta-700: #c82179;
|
|
|
--magenta-800: #b00065;
|
|
|
--magenta-900: #8a004c;
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--semantic-bg-blue: var(--blue-25);
|
|
|
--semantic-bg-red: var(--red-25);
|
|
|
--semantic-bg-orange: var(--orange-25);
|
|
|
--semantic-bg-green: var(--green-25);
|
|
|
--neutral-100: #121212;
|
|
|
--neutral-200: #424242;
|
|
|
--neutral-300: #616161;
|
|
|
--neutral-400: #757575;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #bdbdbd;
|
|
|
--neutral-700: #e0e0e0;
|
|
|
--neutral-800: #eeeeee;
|
|
|
--neutral-900: #f5f5f5;
|
|
|
}
|
|
|
}
|
|
|
:host([theme='dark']) {
|
|
|
--semantic-blue: var(--blue-700);
|
|
|
--semantic-red: var(--red-400);
|
|
|
--semantic-orange: var(--orange-400);
|
|
|
--semantic-green: var(--green-700);
|
|
|
--semantic-bg-blue: var(--blue-25);
|
|
|
--semantic-bg-red: var(--red-25);
|
|
|
--semantic-bg-orange: var(--orange-25);
|
|
|
--semantic-bg-green: var(--green-25);
|
|
|
--neutral-100: #121212;
|
|
|
--neutral-200: #424242;
|
|
|
--neutral-300: #616161;
|
|
|
--neutral-400: #757575;
|
|
|
--neutral-500: #9e9e9e;
|
|
|
--neutral-600: #bdbdbd;
|
|
|
--neutral-700: #e0e0e0;
|
|
|
--neutral-800: #eeeeee;
|
|
|
--neutral-900: #f5f5f5;
|
|
|
}
|
|
|
/* @media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--label-color: #fff;
|
|
|
--active-label-color: #000;
|
|
|
--menu-bg: #525252;
|
|
|
--active-bg: #5898ff;
|
|
|
--active-bg-dimmed: #5c5c5c;
|
|
|
}
|
|
|
} */
|
|
|
:host {
|
|
|
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
|
|
|
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
|
|
|
'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
|
--ui-font-size: 14px;
|
|
|
--ui-line-height: 1.5;
|
|
|
--ui-letter-spacing: 0.007em;
|
|
|
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
|
|
|
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
|
|
|
--ui-layer-1: var(--neutral-100);
|
|
|
--ui-layer-2: var(--neutral-200);
|
|
|
--ui-layer-3: var(--neutral-300);
|
|
|
--ui-layer-4: var(--neutral-400);
|
|
|
--ui-layer-5: var(--neutral-500);
|
|
|
--ui-layer-6: var(--neutral-600);
|
|
|
--ui-border-color: var(--primary-color);
|
|
|
--ui-border-radius: 4px;
|
|
|
--ui-text: var(--neutral-900);
|
|
|
--ui-text-secondary: var(--neutral-700);
|
|
|
--ui-text-placeholder: var(--neutral-500);
|
|
|
--ui-text-muted: var(--neutral-300);
|
|
|
/** A field is a UI element in which a user can type data, for
|
|
|
* example an input or textarea element.
|
|
|
*/
|
|
|
--ui-field-bg: var(--neutral-100);
|
|
|
--ui-field-bg-hover: var(--neutral-100);
|
|
|
--ui-field-bg-disabled: var(--neutral-300);
|
|
|
--ui-field-bg-invalid: var(--red-100);
|
|
|
--ui-field-bg-focus: var(--neutral-100);
|
|
|
--ui-field-border: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-hover: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-disabled: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-invalid: 0.5px solid var(--border-color);
|
|
|
--ui-field-border-focus: 0.5px solid var(--border-color);
|
|
|
--ui-menu-bg: var(--neutral-100);
|
|
|
--ui-menu-text: var(--neutral-900);
|
|
|
--ui-menu-bg-hover: var(--neutral-200);
|
|
|
--ui-menu-text-hover: var(--neutral-900);
|
|
|
/** The \`active\` state is used for the state of menu items
|
|
|
* when they are selected.
|
|
|
*/
|
|
|
--ui-menu-bg-active: var(--primary-color);
|
|
|
--ui-menu-text-active: var(--primary-color-reverse);
|
|
|
/** The \`active-muted\` set is used for the state of
|
|
|
* submenus when they are open.
|
|
|
*/
|
|
|
--ui-menu-bg-active-muted: var(--neutral-300);
|
|
|
--ui-menu-text-active-muted: var(--neutral-900);
|
|
|
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
|
|
|
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
|
|
|
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
|
|
|
--ui-menu-divider: 0.5px solid #c7c7c7;
|
|
|
/* var(--neutral-300); */
|
|
|
--ui-menu-z-index: 10000;
|
|
|
--page-bg: var(--neutral-100);
|
|
|
--content-bg: var(--neutral-200);
|
|
|
}
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
:host {
|
|
|
--ui-menu-bg: var(--neutral-200);
|
|
|
}
|
|
|
}
|
|
|
:host([theme='dark']) {
|
|
|
--ui-menu-bg: var(--neutral-200);
|
|
|
}
|
|
|
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
|
|
|
Noto is a Linux/Android font.
|
|
|
*/
|
|
|
:lang(zh-cn),
|
|
|
:lang(zh-sg),
|
|
|
:lang(zh-my),
|
|
|
:lang(zh) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
|
|
|
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
|
|
|
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
|
|
|
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
|
|
|
}
|
|
|
:lang(zh-tw),
|
|
|
:lang(zh-hk),
|
|
|
:lang(zh-mo) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
|
|
|
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
|
|
|
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
|
|
|
}
|
|
|
:lang(ja),
|
|
|
:lang(ja-jp),
|
|
|
:lang(ja-jp-mac) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
|
|
|
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
|
|
|
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
|
|
|
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
|
|
|
}
|
|
|
:lang(ko),
|
|
|
:lang(ko-kr),
|
|
|
:lang(ko-kr-std) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
|
|
|
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
|
|
|
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
|
|
|
}
|
|
|
:lang(ko-kr-apple) {
|
|
|
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
|
|
|
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
|
|
|
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
|
|
|
}
|
|
|
:lang(zh-cn),
|
|
|
:lang(zh-sg),
|
|
|
:lang(zh-my),
|
|
|
:lang(zh),
|
|
|
:lang(zh-tw),
|
|
|
:lang(zh-hk),
|
|
|
:lang(zh-mo),
|
|
|
:lang(ja),
|
|
|
:lang(ja-jp),
|
|
|
:lang(ja-jp-mac),
|
|
|
:lang(ko),
|
|
|
:lang(ko-kr),
|
|
|
:lang(ko-kr-std),
|
|
|
:lang(ko-kr-apple) {
|
|
|
--ui-font-size: 1rem;
|
|
|
--ui-line-height: 1.7;
|
|
|
--ui-letter-spacing: 0;
|
|
|
}
|
|
|
:dir(rtl) {
|
|
|
--ui-line-height: auto;
|
|
|
--ui-letter-spacing: 0;
|
|
|
}
|
|
|
`,Qc=`.ui-menu *,
|
|
|
.ui-menu ::before,
|
|
|
.ui-menu ::after {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.ui-menu {
|
|
|
display: none;
|
|
|
color-scheme: light dark;
|
|
|
-webkit-user-select: none;
|
|
|
/* Important: Safari iOS doesn't respect user-select */
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
-webkit-touch-callout: none;
|
|
|
-webkit-tap-highlight-color: rgba(0 0 0 0);
|
|
|
--active-label-color: #fff;
|
|
|
/* ui-menu-text-active */
|
|
|
--label-color: #121212;
|
|
|
/* ui-menu-text */
|
|
|
--menu-bg: #e2e2e2;
|
|
|
/* ui-menu-background */
|
|
|
--active-bg: #5898ff;
|
|
|
/* ui-menu-background-active */
|
|
|
--active-bg-dimmed: #c5c5c5;
|
|
|
/* ui-menu-background-active-muted */
|
|
|
}
|
|
|
/** Use the :where pseudo selector to make the specificity of the
|
|
|
* selector 0, so that it can be overridden by the user.
|
|
|
*/
|
|
|
:where(.ui-menu-container) {
|
|
|
position: absolute;
|
|
|
overflow: visible;
|
|
|
width: auto;
|
|
|
height: auto;
|
|
|
z-index: 10000;
|
|
|
border-radius: 8px;
|
|
|
background: var(--ui-menu-bg);
|
|
|
box-shadow: var(--ui-menu-shadow);
|
|
|
list-style: none;
|
|
|
padding: 6px 0 6px 0;
|
|
|
margin: 0;
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
color: var(--ui-menu-text);
|
|
|
font-weight: normal;
|
|
|
font-style: normal;
|
|
|
text-shadow: none;
|
|
|
text-transform: none;
|
|
|
letter-spacing: 0;
|
|
|
outline: none;
|
|
|
opacity: 1;
|
|
|
/* The [popover] elements have a 1px solid black border. Ugh. */
|
|
|
border: none;
|
|
|
width: fit-content;
|
|
|
height: fit-content;
|
|
|
}
|
|
|
:where(.ui-menu-container > li) {
|
|
|
display: flex;
|
|
|
flex-flow: row;
|
|
|
align-items: center;
|
|
|
padding: 1px 7px 1px 7px;
|
|
|
margin-top: 0;
|
|
|
margin-left: 6px;
|
|
|
margin-right: 6px;
|
|
|
border-radius: 4px;
|
|
|
white-space: nowrap;
|
|
|
position: relative;
|
|
|
outline: none;
|
|
|
fill: currentColor;
|
|
|
user-select: none;
|
|
|
cursor: default;
|
|
|
text-align: left;
|
|
|
color: inherit;
|
|
|
font-family: var(--ui-font-family);
|
|
|
font-size: var(--ui-font-size);
|
|
|
line-height: var(--ui-line-height);
|
|
|
letter-spacing: var(--ui-letter-spacing);
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label) {
|
|
|
appearance: none;
|
|
|
background: none;
|
|
|
outline: none;
|
|
|
width: 100%;
|
|
|
margin: 0;
|
|
|
padding: 1px 2px 1px 1px;
|
|
|
overflow: visible;
|
|
|
border: 1px solid transparent;
|
|
|
white-space: nowrap;
|
|
|
text-align: start;
|
|
|
}
|
|
|
:where(.ui-menu-container > li:has(.heading)) {
|
|
|
margin-top: 0.5em;
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label.heading) {
|
|
|
font-weight: bold;
|
|
|
opacity: 0.4;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.indent > .label) {
|
|
|
margin-inline-start: 12px;
|
|
|
}
|
|
|
:where(.ui-menu-container > li > .label.indent) {
|
|
|
margin-inline-start: 12px;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[role='divider']) {
|
|
|
border-bottom: 1px solid var(--ui-menu-divider);
|
|
|
border-radius: 0;
|
|
|
padding: 0;
|
|
|
margin-left: 15px;
|
|
|
margin-right: 15px;
|
|
|
padding-top: 5px;
|
|
|
margin-bottom: 5px;
|
|
|
width: calc(100% - 30px);
|
|
|
/** 100% - (margin-left + margin-right) */
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-disabled='true']) {
|
|
|
opacity: 0.5;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active) {
|
|
|
background: var(--ui-menu-bg-active);
|
|
|
background: -apple-system-control-accent;
|
|
|
color: var(--ui-menu-text-active);
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active.is-submenu-open) {
|
|
|
background: var(--ui-menu-bg-active-muted);
|
|
|
color: inherit;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
|
|
|
padding-inline-end: 0;
|
|
|
}
|
|
|
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
|
|
|
color: var(--ui-menu-text-active);
|
|
|
}
|
|
|
/** Keyboard shortcut */
|
|
|
:where(.ui-menu-container > li > kbd) {
|
|
|
font-family: var(--ui-font-family);
|
|
|
margin-inline-start: 12px;
|
|
|
opacity: 0.4;
|
|
|
}
|
|
|
:where(.ui-menu-container > li.active > kbd) {
|
|
|
opacity: 0.85;
|
|
|
}
|
|
|
.ui-trailing-chevron {
|
|
|
display: flex;
|
|
|
margin-inline-start: 24px;
|
|
|
width: 10px;
|
|
|
height: 10px;
|
|
|
margin-bottom: 4px;
|
|
|
}
|
|
|
.ui-trailing-chevron:dir(rtl) {
|
|
|
transform: scaleX(-1);
|
|
|
}
|
|
|
.ui-checkmark {
|
|
|
display: flex;
|
|
|
margin-inline-end: -11px;
|
|
|
margin-inline-start: -4px;
|
|
|
margin-top: 2px;
|
|
|
width: 16px;
|
|
|
height: 16px;
|
|
|
}
|
|
|
.ui-mixedmark {
|
|
|
display: flex;
|
|
|
margin-inline-end: -11px;
|
|
|
margin-inline-start: -4px;
|
|
|
margin-top: 2px;
|
|
|
width: 16px;
|
|
|
height: 16px;
|
|
|
}
|
|
|
`,Ka;function Zh(r){let o="";switch(r){case"mathfield-element":o=`
|
|
|
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
|
|
|
:host([hidden]) { display: none; }
|
|
|
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
|
|
|
:host(:focus), :host(:focus-within) {
|
|
|
outline: Highlight auto 1px; /* For Firefox */
|
|
|
outline: -webkit-focus-ring-color auto 1px;
|
|
|
}
|
|
|
:host([readonly]:focus), :host([readonly]:focus-within),
|
|
|
:host([read-only]:focus), :host([read-only]:focus-within) {
|
|
|
outline: none;
|
|
|
}
|
|
|
@media (hover: none) and (pointer: coarse) {
|
|
|
:host(:not(:focus)) :first-child { pointer-events: none !important; }
|
|
|
}`;break;case"core":o=Fs;break;case"mathfield":o=Ru;break;case"environment-popover":o=Oh;break;case"suggestion-popover":o=gf;break;case"keystroke-caption":o=If;break;case"virtual-keyboard":o=Of;break;case"ui":o=yh;break;case"menu":o=Qc;break;default:debugger}return o}function Ju(r){return Ka||(Ka={}),Ka[r]||(Ka[r]=new CSSStyleSheet,Ka[r].replaceSync(Zh(r))),Ka[r]}var Eu;function qu(r){var o;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${r}`))return;const u=window.document.createElement("style");u.id=`mathlive-style-${r}`,u.append(window.document.createTextNode(Zh(r))),window.document.head.appendChild(u);return}if(Eu||(Eu={}),((o=Eu[r])!=null?o:0)!==0)Eu[r]+=1;else{const u=Ju(r);document.adoptedStyleSheets=[...document.adoptedStyleSheets,u],Eu[r]=1}}function h(r){if("adoptedStyleSheets"in document&&Eu!=null&&Eu[r]&&(Eu[r]-=1,Eu[r]<=0)){const o=Ka[r];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(u=>u!==o)}}var d=class u2 extends ae{constructor(o){var u;super(F(ot({},o),{type:"accent",body:(u=o.body)!=null?u:void 0})),o.accentChar?this.accent=o.accentChar:this.svgAccent=o==null?void 0:o.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(o){return new u2(o)}toJson(){return F(ot({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(o){var u;const f=new Nn({parent:o,mathstyle:"cramp"},this.style),g=(u=ae.createBox(f,this.body))!=null?u:new Je("\u25A2",{style:this.style});let b=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(b=g.skew);let M=Math.min(g.height,Bi),N;if(this.svgAccent)N=Rn(this.svgAccent),M=f.metrics.bigOpSpacing1-M;else if(this.accent){const B=new Je(this.accent,{fontFamily:"Main-Regular"});B.italic=0;const U=this.accent===8407?" ML__accent-vec":"";N=new Je(new Je(B),{classes:"ML__accent-body"+U})}N=new Gr({shift:0,children:[{box:new Je(g)},-M,{box:N,marginLeft:g.left+2*b,classes:["ML__center"]}]});const I=new Je(N,{type:"lift"});return this.caret&&(I.caret=this.caret),this.bind(f,I.wrap(f)),this.attachSupsub(f,{base:I})}},x={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},y=Object.fromEntries(Object.entries(x).map(([r,o])=>[o,r]));function S(r){var o;return(o={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[r])!=null?o:r.codePointAt(0)}function E(r,o,u,f){var g;const M=new Je(S(r),{fontFamily:"Main-Regular",isSelected:f.isSelected,classes:"ML__small-delim "+((g=f.classes)!=null?g:"")}).wrap(o);return u&&M.setTop((1-o.scalingFactor)*ri),M}function O(r,o,u,f,g){var b,M;const N=new Nn({parent:f,mathstyle:"textstyle"},g==null?void 0:g.style),I=new Je(S(r),{fontFamily:`Size${o}-Regular`,isSelected:g.isSelected,classes:((b=g.classes)!=null?b:"")+` ML__delim-size${o}`,type:(M=g.type)!=null?M:"ignore"}).wrap(N);return u&&I.setTop((1-N.scalingFactor)*ri),I}function W(r,o,u,f,g){var b;let M,N,I,B;M=I=B=S(r),N=null;let U="Size1-Regular";r==="\\vert"||r==="\\lvert"||r==="\\rvert"||r==="\\mvert"||r==="\\mid"?I=M=B=8739:r==="\\Vert"||r==="\\lVert"||r==="\\rVert"||r==="\\mVert"||r==="\\|"?I=M=B=8741:r==="\\uparrow"?I=B=9168:r==="\\Uparrow"?I=B=8214:r==="\\downarrow"?M=I=9168:r==="\\Downarrow"?M=I=8214:r==="\\updownarrow"?(M=8593,I=9168,B=8595):r==="\\Updownarrow"?(M=8657,I=8214,B=8659):r==="["||r==="\\lbrack"?(M=9121,I=9122,B=9123,U="Size4-Regular"):r==="]"||r==="\\rbrack"?(M=9124,I=9125,B=9126,U="Size4-Regular"):r==="\\lfloor"||r==="\u230A"?(I=M=9122,B=9123,U="Size4-Regular"):r==="\\lceil"||r==="\u2308"?(M=9121,I=B=9122,U="Size4-Regular"):r==="\\rfloor"||r==="\u230B"?(I=M=9125,B=9126,U="Size4-Regular"):r==="\\rceil"||r==="\u2309"?(M=9124,I=B=9125,U="Size4-Regular"):r==="("||r==="\\lparen"?(M=9115,I=9116,B=9117,U="Size4-Regular"):r===")"||r==="\\rparen"?(M=9118,I=9119,B=9120,U="Size4-Regular"):r==="\\{"||r==="\\lbrace"?(M=9127,N=9128,B=9129,I=9130,U="Size4-Regular"):r==="\\}"||r==="\\rbrace"?(M=9131,N=9132,B=9133,I=9130,U="Size4-Regular"):r==="\\lgroup"||r==="\u27EE"?(M=9127,B=9129,I=9130,U="Size4-Regular"):r==="\\rgroup"||r==="\u27EF"?(M=9131,B=9133,I=9130,U="Size4-Regular"):r==="\\lmoustache"||r==="\u23B0"?(M=9127,B=9133,I=9130,U="Size4-Regular"):r==="\\rmoustache"||r==="\u23B1"?(M=9131,B=9129,I=9130,U="Size4-Regular"):r==="\\surd"?(M=57345,B=9143,I=57344,U="Size4-Regular"):r==="\\ulcorner"?(M=9484,I=B=32):r==="\\urcorner"?(M=9488,I=B=32):r==="\\llcorner"?(B=9492,I=M=32):r==="\\lrcorner"&&(M=9496,I=M=32);const lt=cn(M,U),Lt=lt.height+lt.depth,Bt=cn(I,U),jt=Bt.height+Bt.depth,je=cn(B,U),Zi=je.height+je.depth;let Le=0,Ci=1;if(N!==null){const fh=cn(N,U);Le=fh.height+fh.depth,Ci=2}const en=Lt+Zi+Le,Oi=Math.max(0,Math.ceil((o-en)/(Ci*jt))),hr=en+Oi*Ci*jt;let Jr=ri;u&&(Jr=Jr*f.scalingFactor);const Er=hr/2-Jr,ta=.008,wl=[];wl.push({box:new Je(B,{fontFamily:U})}),wl.push(-ta);const mn=new Je(I,{fontFamily:U});if(N===null)for(let fh=0;fh<Oi;fh++)wl.push({box:mn});else{for(let fh=0;fh<Oi;fh++)wl.push({box:mn});wl.push(-ta),wl.push({box:new Je(N,{fontFamily:U})}),wl.push(-ta);for(let fh=0;fh<Oi;fh++)wl.push({box:mn})}wl.push(-ta),wl.push({box:new Je(M,{fontFamily:U})});let bf="";U==="Size1-Regular"?bf=" delim-size1":U==="Size4-Regular"&&(bf=" delim-size4");const Sf=new Gr({bottom:Er,children:wl},{classes:bf});return new Je(Sf,F(ot({},g!=null?g:{}),{classes:((b=g==null?void 0:g.classes)!=null?b:"")+" ML__delim-mult"}))}var H=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),nt=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),Rt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),pt=[0,1.2,1.8,2.4,3];function oe(r,o,u,f){return r===void 0||r==="."?Vn(u,f.classes):(r==="<"||r==="\\lt"||r==="\u27E8"?r="\\langle":(r===">"||r==="\\gt"||r==="\u27E9")&&(r="\\rangle"),H.has(r)||Rt.has(r)?O(r,o,!1,u,f):nt.has(r)?W(r,pt[o],!1,u,f):(console.assert(!1,"Unknown delimiter '"+r+"'"),null))}var Jt=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],oi=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],mi=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function Ii(r){return r.type==="small"?"Main-Regular":r.type==="large"?"Size"+r.size+"-Regular":(console.assert(r.type==="stack"),"Size4-Regular")}function on(r,o,u,f){const g={"-4":0,"-3":1,0:2}[f.mathstyle.sizeDelta];for(let b=g;b<u.length&&u[b].type!=="stack";b++){const M=cn(r,Ii(u[b]));if(M.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let N=M.height+M.depth;if(u[b].type==="small"&&(u[b].mathstyle==="scriptscriptstyle"?N*=Math.max(Ni[Math.max(1,f.size-2)],f.minFontScale):u[b].mathstyle==="scriptstyle"&&(N*=Math.max(Ni[Math.max(1,f.size-1)],f.minFontScale))),N>o)return u[b]}return u[u.length-1]}function Bn(r,o,u,f,g,b){if(!o||o.length===0||o===".")return Vn(g);o==="<"||o==="\\lt"?o="\\langle":(o===">"||o==="\\gt")&&(o="\\rangle");let M;Rt.has(o)?M=Jt:H.has(o)?M=mi:M=oi;const N=on(S(o),u,M,g),I=new Nn({parent:g,mathstyle:N.mathstyle},b==null?void 0:b.style);return N.type==="small"?E(o,I,f,F(ot({},b),{type:r})):N.type==="large"?O(o,N.size,f,I,F(ot({},b),{type:r})):(console.assert(N.type==="stack"),W(o,u,f,I,F(ot({},b),{type:r})))}function gn(r,o,u,f,g,b){if(o===".")return Vn(g,b==null?void 0:b.classes);const M=ri*g.scalingFactor,N=901,I=5/wi,B=Math.max(u-M,f+M),U=Math.max(B/500*N,2*B-I);return Bn(r,o,U,!0,g,b)}function Vn(r,o){const u=new Je(null,{classes:" nulldelimiter "+(o!=null?o:""),type:"ignore"});return u.width=r.getRegisterAsEm("nulldelimiterspace"),u.wrap(new Nn({parent:r,mathstyle:"textstyle"}))}var Hr=class h2 extends ae{constructor(o){var u;super({type:"placeholder",command:"\\placeholder",mode:(u=o==null?void 0:o.mode)!=null?u:"math",style:o==null?void 0:o.style}),this.captureSelection=!0}static fromJson(o){return new h2(o)}toJson(){return super.toJson()}render(o){let u;return this.value=o.placeholderSymbol,typeof o.renderPlaceholder=="function"?u=o.renderPlaceholder(o):u=this.createBox(o),this.caret&&(u.classes+=" ML__placeholder-selected"),u}_serialize(o){return o.skipPlaceholders?"":"\\placeholder{}"}},bn=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],rs=["cases","dcases","rcases"],xl=["align","align*","aligned","gather","gathered","split"],Hu=["array","subequations","eqnarray"];function Ol(r){return Hu.concat(xl).concat(rs).concat(bn).includes(r)}function Rh(r){return bn.includes(r)}function xh(r){return rs.includes(r)}function Bu(r){return xl.includes(r)}function ac(r,o,u){let f=0;for(const B of u)"align"in B&&(f+=1);let g=0;const b=[];for(const B of o){let U=0;for(g=Math.max(g,Math.min(B.length,f));U<B.length;){const lt=[],Lt=Math.min(B.length,U+f);for(;U<Lt;){const Bt=B[U];Bt.length===0?lt.push([new ae({type:"first",mode:r.mode})]):Bt[0].type!=="first"?lt.push([new ae({type:"first",mode:r.mode}),...Bt]):(console.assert(!Bt.slice(1).some(jt=>jt.type==="first")),lt.push(Bt)),U+=1}b.push(lt)}}b.length>0&&b[b.length-1].length===1&&b[b.length-1][0].length===1&&b[b.length-1][0][0].type==="first"&&b.pop();const M=[];for(const B of b){if(B.length!==g)for(let U=B.length;U<g;U++)B.push([new ae({type:"first",mode:r.mode}),new Hr]);M.push(B)}let N=0,I=0;for(const B of M){I=0;for(const U of B){for(const lt of U)lt.parent=r,lt.parentBranch=[N,I];I+=1}N+=1}return r.isDirty=!0,M}var ts=class c2 extends ae{constructor(o,u,f,g={}){var b;super({type:"array"}),this.environmentName=o,this.rowGaps=f,g.mathstyleName&&(this.mathstyleName=g.mathstyleName),g.columns&&(g.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=g.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=ac(this,u,this.colFormat),g.leftDelim&&(this.leftDelim=g.leftDelim),g.rightDelim&&(this.rightDelim=g.rightDelim),g.arraycolsep!==void 0&&(this.arraycolsep=g.arraycolsep),this.colSeparationType=g.colSeparationType,g.arraystretch!==void 0&&(this.arraystretch=g.arraystretch),this.minColumns=(b=g.minColumns)!=null?b:1}static fromJson(o){return new c2(o.environmentName,o.array,o.rowGaps,o)}toJson(){const o=F(ot({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(u=>u.map(f=>f.map(g=>g.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(o.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(o.arraycolsep=this.arraycolsep),this.leftDelim&&(o.leftDelim=this.leftDelim),this.rightDelim&&(o.rightDelim=this.rightDelim),o}branch(o){var u;if(Un(o))return(u=this.array[o[0]][o[1]])!=null?u:void 0}createBranch(o){var u;return Un(o)?(this.isDirty=!0,(u=this.branch(o))!=null?u:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(o=>!!o.align).length}removeBranch(o){if(Fi(o))return super.removeBranch(o);const u=this.branch(o);return this.array[o[0]][o[1]]=void 0,u.forEach(f=>{f.parent=void 0,f.parentBranch=void 0}),console.assert(u[0].type==="first"),u.shift(),this.isDirty=!0,u}get hasChildren(){return this.children.length>0}get children(){const o=[];for(const u of this.array)for(const f of u)if(f)for(const g of f)o.push(...g.children),o.push(g);return[...o,...super.children]}render(o){var u,f,g,b,M,N;const I=new Nn({parent:o,mathstyle:this.mathstyleName},this.style),B=I.getRegisterAsEm("arrayrulewidth"),U=I.getRegisterAsEm("arraycolsep"),lt=I.getRegisterAsEm("doublerulesep"),Lt=(f=(u=this.arraystretch)!=null?u:I.getRegisterAsNumber("arraystretch"))!=null?f:1;let Bt=typeof this.arraycolsep=="number"?this.arraycolsep:U;this.colSeparationType==="small"&&(Bt=.2778*(new Nn({parent:o,mathstyle:"scriptstyle"}).scalingFactor/o.scalingFactor));const jt=Lt*Mi,je=.7*jt,Zi=.3*jt;let Le=0;const Ci=[];let en=0;const Oi=this.array.length;for(let Sa=0;Sa<Oi;++Sa){const bl=this.array[Sa];en=Math.max(en,bl.length);const Uu=new Nn({parent:I,mathstyle:this.mathstyleName},this.style);let Kf=je/Uu.scalingFactor,lf=Zi/Uu.scalingFactor;const kf={cells:[],height:0,depth:0,pos:0};for(const Ef of bl){const cm=(g=ae.createBox(Uu,Ef,{type:"ignore"}))!=null?g:new Je(null,{type:"ignore"});lf=Math.max(lf,cm.depth),Kf=Math.max(Kf,cm.height),kf.cells.push(cm)}let Hf=(b=Ta(this.rowGaps[Sa]))!=null?b:0;Hf>0&&(Hf+=Zi,lf=Math.max(lf,Hf),Hf=0),Sa<Oi-1&&!Rh(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(lf+=I.getRegisterAsEm("jot")),kf.height=Kf,kf.depth=lf,Le+=Kf,kf.pos=Le,Le+=lf+Hf,Ci.push(kf)}const hr=Le/2+ri,Jr=[];for(let Sa=0;Sa<en;Sa++){const bl=[];for(const Uu of Ci){const Kf=Uu.cells[Sa];Kf.depth=Uu.depth,Kf.height=Uu.height,bl.push({box:Kf,shift:Uu.pos-hr})}bl.length>0&&Jr.push(new Gr({individualShift:bl}))}const Er=[];let ta=!1,wl=!1,mn=0,bf=!this.leftDelim;const{colFormat:Sf}=this;for(const Sa of Sf){if("align"in Sa&&mn>=Jr.length)break;if("align"in Sa)ta?Er.push(Gs(2*Bt)):(wl||bf)&&Er.push(Gs(Bt)),Er.push(new Je(Jr[mn],{classes:"col-align-"+Sa.align})),mn++,ta=!0,wl=!1,bf=!1;else if("gap"in Sa){if(typeof Sa.gap=="number")Er.push(Gs(Sa.gap));else{const bl=Yl(o,Ci,hr,Sa.gap);bl&&Er.push(bl)}ta=!1,wl=!1,bf=!1}else if("separator"in Sa){const bl=new Je(null,{classes:"vertical-separator"});bl.height=Le,bl.setStyle("height",Le,"em"),bl.setStyle("border-right",`${B}em ${Sa.separator} currentColor`),bl.setStyle("vertical-align",-(Le-hr),"em");let Uu=0;wl?Uu=lt-B:ta&&(Uu=Bt-B),bl.left=Uu,Er.push(bl),ta=!1,wl=!0,bf=!1}}ta&&!this.rightDelim&&Er.push(Gs(Bt));const Mf=new Je(Er,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Mf.caret=this.caret),this.bind(o,Mf);const fh=Mf.height,Cf=Mf.depth,qh=this.bind(o,new Je([this.bind(o,gn("open",(M=this.leftDelim)!=null?M:".",fh,Cf,I,{isSelected:this.isSelected})),Mf,this.bind(o,gn("close",(N=this.rightDelim)!=null?N:".",fh,Cf,I,{isSelected:this.isSelected}))],{type:"ord"}));return qh?(qh.setStyle("display","inline-block"),this.caret&&(qh.caret=this.caret),this.bind(o,this.attachSupsub(o,{base:qh}))):null}_serialize(o){var u;const f=[];if(this.environmentName==="lines"?f.push("{\\displaylines"):f.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(f.push("{"),this.colFormat!==void 0)for(const g of this.colFormat)"align"in g&&typeof g.align=="string"?f.push(g.align):"separator"in g&&g.separator==="solid"?f.push("|"):"separator"in g&&g.separator==="dashed"&&f.push(":");f.push("}")}for(let g=0;g<this.array.length;g++){for(let b=0;b<this.array[g].length;b++)b>0&&f.push(" & "),f.push(ae.serialize(this.array[g][b],o));if(g<this.array.length-1){const b=this.rowGaps[g];b!=null&&b.dimension?f.push(`\\\\[${b.dimension} ${(u=b.unit)!=null?u:"pt"}] `):f.push("\\\\ ")}}return this.environmentName==="lines"?f.push("}"):f.push(`\\end{${this.environmentName}}`),Mn(f)}getCell(o,u){return this.array[o][u]}setCell(o,u,f){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[o][u]!==void 0);for(const b of this.array[o][u])b.parent=void 0,b.parentBranch=void 0;let g=f;(f.length===0||f[0].type!=="first")&&(g=[new ae({type:"first",mode:this.mode}),...f]),this.array[o][u]=g;for(const b of g)b.parent=this,b.parentBranch=[o,u];this.isDirty=!0}addRowBefore(o){console.assert(this.type==="array"&&Array.isArray(this.array));const u=[];for(let f=0;f<this.colCount;f++)u.push(su(this));this.array.splice(o,0,u);for(let f=o;f<this.rowCount;f++)for(let g=0;g<this.colCount;g++){const b=this.array[f][g];if(b)for(const M of b)M.parentBranch=[f,g]}this.isDirty=!0}addRowAfter(o){console.assert(this.type==="array"&&Array.isArray(this.array));const u=[];for(let f=0;f<this.colCount;f++)u.push(su(this));this.array.splice(o+1,0,u);for(let f=o+1;f<this.rowCount;f++)for(let g=0;g<this.colCount;g++){const b=this.array[f][g];if(b)for(const M of b)M.parentBranch=[f,g]}this.isDirty=!0}removeRow(o){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>o);const u=this.array.splice(o,1);for(const f of u)for(const g of f)if(g)for(const b of g)b.parent=void 0,b.parentBranch=void 0;for(let f=o;f<this.rowCount;f++)for(let g=0;g<this.colCount;g++){const b=this.array[f][g];if(b)for(const M of b)M.parentBranch=[f,g]}this.isDirty=!0}addColumnBefore(o){console.assert(this.type==="array"&&Array.isArray(this.array));for(const u of this.array)u.splice(o,0,su(this));for(let u=0;u<this.rowCount;u++)for(let f=o;f<this.colCount;f++){const g=this.array[u][f];if(g)for(const b of g)b.parentBranch=[u,f]}this.isDirty=!0}addColumnAfter(o){console.assert(this.type==="array"&&Array.isArray(this.array));for(const u of this.array)u.splice(o+1,0,su(this));for(let u=0;u<this.rowCount;u++)for(let f=o+1;f<this.colCount;f++){const g=this.array[u][f];if(g)for(const b of g)b.parentBranch=[u,f]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(o){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>o);for(const u of this.array){const f=u.splice(o,1);for(const g of f)if(g)for(const b of g)b.parent=void 0,b.parentBranch=void 0}for(let u=0;u<this.rowCount;u++)for(let f=o;f<this.colCount;f++){const g=this.array[u][f];if(g)for(const b of g)b.parentBranch=[u,f]}this.isDirty=!0}get cells(){const o=[];for(const u of this.array)for(const f of u)f&&o.push(f.filter(g=>g.type!=="first"));return o}};function su(r){const o=new ae({type:"first",mode:r.mode});o.parent=r;const u=new Hr;return u.parent=r,[o,u]}function Gs(r){const o=new Je(null,{classes:"arraycolsep"});return o.width=r,o}function Yl(r,o,u,f){if(!f)return null;const g=[];for(const b of o){const M=ae.createBox(r,f,{type:"ignore"});M&&(M.depth=b.depth,M.height=b.height,g.push({box:M,shift:b.pos-u}))}return new Gr({individualShift:g}).wrap(r)}var Rl=class f2 extends ae{constructor(o){super({mode:o.mode,command:o.command,style:o.style,body:o.body,type:"box"}),this.framecolor=o.framecolor,this.backgroundcolor=o.backgroundcolor,this.padding=o.padding,this.offset=o.offset,this.border=o.border}static fromJson(o){return new f2(o)}toJson(){return F(ot({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(o){var u,f,g,b;const M=ae.createBox(o,this.body,{type:"lift"});if(!M)return null;const N=o.toEm((u=this.offset)!=null?u:{dimension:0});M.depth+=N,M.setStyle("display","inline-block"),M.setStyle("position","relative"),M.setStyle("height",Math.floor(100*M.height+M.depth)/100,"em"),M.setStyle("vertical-align",-Math.floor(100*M.height)/100,"em");const I=new Nn({parent:o},this.style),B=I.toEm((f=this.padding)!=null?f:{register:"fboxsep"}),U=new Je(null,{classes:"ML__box"});U.height=M.height+B,U.depth=M.depth+B,U.setStyle("box-sizing","border-box"),U.setStyle("position","absolute"),U.setStyle("top",-B+.3,"em"),U.setStyle("left",0),U.setStyle("height",U.height+U.depth,"em"),U.setStyle("width","100%"),this.backgroundcolor&&U.setStyle("background-color",(g=I.toColor(this.backgroundcolor))!=null?g:"transparent"),this.framecolor&&U.setStyle("border",`${I.getRegisterAsEm("fboxrule",2)}em solid ${(b=I.toColor(this.framecolor))!=null?b:"black"}`),this.border&&U.setStyle("border",this.border);const lt=new Je([U,M],{type:"lift"});return lt.setStyle("display","inline-block"),lt.setStyle("position","relative"),lt.setStyle("line-height",0),lt.height=M.height+B+(N>0?N:0),lt.depth=M.depth+B+(N<0?-N:0),lt.setStyle("padding-left",B,"em"),lt.setStyle("padding-right",B,"em"),lt.setStyle("height",Math.floor(100*(M.height+M.depth+2*B+Math.abs(N)))/100,"em"),lt.setStyle("margin-top",-B,"em"),lt.setStyle("top",Math.floor(100*(M.depth-M.height+2*B-N))/100,"em"),lt.setStyle("vertical-align",Math.floor(100*(M.depth+2*B))/100,"em"),this.caret&&(lt.caret=this.caret),this.attachSupsub(o,{base:lt})}_serialize(o){return o.skipStyles?Mn([this.bodyToLatex(o),this.supsubToLatex(o)]):super._serialize(o)}},Qu=class d2 extends ae{constructor(o,u){var f;super({type:"composition",mode:(f=u==null?void 0:u.mode)!=null?f:"math",value:o})}static fromJson(o){return new d2(o.value,o)}toJson(){return super.toJson()}get computedStyle(){return{}}render(o){const u=new Je(this.value,{classes:"ML__composition",type:"composition"});return this.bind(o,u),this.caret&&(u.caret=this.caret),u}_serialize(o){return""}},wh=class p2 extends ae{constructor(o){super({type:"error",value:o,command:o,mode:"math"}),this.verbatimLatex=o}static fromJson(o){return new p2(o.command)}toJson(){return super.toJson()}render(o){const u=this.createBox(o,{classes:"ML__error"});return this.caret&&(u.caret=this.caret),u}},_l=class m2 extends ae{constructor(o,u,f){super({type:"group",mode:u,style:f}),this.body=o,this.boxType=o.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,o&&o.length===1&&o[0].command===","&&(this.captureSelection=!0)}static fromJson(o){return new m2(o.body,o.mode,o.style)}render(o){const u=ae.createBox(o,this.body,{type:this.boxType});return u?(this.caret&&(u.caret=this.caret),this.bind(o,u)):null}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=Fr(this.command,this.mode);return u!=null&&u.serialize?u.serialize(this,o):`{${this.bodyToLatex(o)}}`}},wa=class g2 extends ae{constructor(o,u,f){super({type:"leftright",style:f.style,displayContainsHighlight:!0}),this.variant=o,this.body=u,this.leftDelim=f.leftDelim,this.rightDelim=f.rightDelim}static fromJson(o){var u;return new g2((u=o.variant)!=null?u:"",o.body,o)}toJson(){const o=super.toJson();return this.variant&&(o.variant=this.variant),this.leftDelim&&(o.leftDelim=this.leftDelim),this.rightDelim&&(o.rightDelim=this.rightDelim),o}_serialize(o){var u,f;const g=this.matchingRightDelim();return this.variant==="left...right"?Mn(["\\left",(u=this.leftDelim)!=null?u:".",this.bodyToLatex(o),"\\right",g]):this.variant==="mleft...mright"?Mn(["\\mleft",(f=this.leftDelim)!=null?f:".",this.bodyToLatex(o),"\\mright",g]):Mn([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(o),g])}matchingRightDelim(){var o,u;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const f=(o=this.leftDelim)!=null?o:".";return(u=x[f])!=null?u:f}render(o){var u,f;const g=new Nn({parent:o},this.style);console.assert(this.body!==void 0);const b=new Nn({parent:o,mathstyle:"textstyle"},this.style),M=(u=ae.createBox(g,this.body,{type:"inner"}))!=null?u:new Je(null,{type:"inner"}),N=M.height/b.scalingFactor,I=M.depth/b.scalingFactor,B=[];if(this.leftDelim&&B.push(this.bind(b,gn("open",this.leftDelim,N,I,b,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),M&&(Jl(M.children,this,g,N,I),B.push(M)),this.rightDelim){let Bt=this.containsCaret?" ML__contains-caret":"",jt=this.rightDelim;jt==="?"&&(g.smartFence?(jt=this.matchingRightDelim(),Bt+=" ML__smart-fence__close"):jt="."),B.push(this.bind(b,gn("close",jt,N,I,b,{isSelected:this.isSelected,classes:Bt+" ML__close",mode:this.mode,style:this.style})))}let U=this.variant==="mleft...mright";const lt=this.leftSibling;lt&&(!U&<.isFunction&&(U=!0),!U&<.type==="subsup"&&((f=lt.leftSibling)!=null&&f.isFunction)&&(U=!0));const Lt=new Je(B,{type:U?"close":"inner",classes:"left-right"});return Lt.setStyle("margin-top",`${-M.depth}em`),Lt.setStyle("height",`${M.height+M.depth}em`),this.caret&&(Lt.caret=this.caret),this.bind(g,Lt.wrap(g))}};function Jl(r,o,u,f,g){if(r)for(let b=0;b<r.length;b++){const M=r[b];M.type==="middle"?(r[b]=o.bind(u,gn("inner",M.value,f,g,u,{isSelected:o.isSelected})),r[b].caret=M.caret,r[b].isSelected=M.isSelected,r[b].cssId=M.cssId,r[b].htmlData=M.htmlData,r[b].htmlStyle=M.htmlStyle,r[b].attributes=M.attributes,r[b].cssProperties=M.cssProperties):M.children&&Jl(M.children,o,u,f,g)}}var np=class v2 extends ae{constructor(o,u){var f;super({type:"macro",command:o,style:u.style}),this.body=u.body,u.captureSelection===void 0?u.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=u.captureSelection,this.macroArgs=u.args,this.expand=(f=u.expand)!=null?f:!1}static fromJson(o){return new v2(o.command,o)}toJson(){const o=super.toJson();return this.expand&&(o.expand=!0),this.captureSelection!==void 0&&(o.captureSelection=this.captureSelection),this.macroArgs&&(o.args=this.macroArgs),o}_serialize(o){var u;return o.expandMacro&&this.expand?this.bodyToLatex(o):this.command+((u=this.macroArgs)!=null?u:"")}render(o){const u=ae.createBox(o,this.body);return u?(this.caret&&(u.caret=this.caret),this.bind(o,u)):null}},_c=class y2 extends ae{constructor(){super({type:"macro-argument"})}static fromJson(o){return new y2}toJson(){return super.toJson()}_serialize(o){return""}render(o){return null}},Gh=class x2 extends ae{constructor(o,u,f=!1,g,b){var M;super({type:"prompt",mode:(M=b==null?void 0:b.mode)!=null?M:"math",style:b==null?void 0:b.style,command:"\\placeholder"}),this.body=g,this.correctness=u,this.placeholderId=o,this.locked=f,this.captureSelection=this.locked}static fromJson(o){return new x2(o.placeholderId,o.correctness,o.locked,o.body,o)}toJson(){const o=super.toJson();return this.placeholderId&&(o.placeholderId=this.placeholderId),this.body||delete o.body,this.body&&(o.body=this.body.filter(u=>u.type!=="first").map(u=>u.toJson())),this.correctness&&(o.correctness=this.correctness),o.locked=this.locked,o}render(o){const u=new Nn({parent:o}),f=u.getRegisterAsEm("fboxsep"),g=f,b=f,M=ae.createBox(o,this.body);if(!M)return null;M.height||(M.height=u.metrics.xHeight),M.setStyle("vertical-align",-M.height,"em"),this.correctness==="correct"?M.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&M.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const N=new Je(M,{type:"ord"});N.setStyle("display","inline-block"),N.setStyle("height",M.height+M.depth,"em"),N.setStyle("vertical-align",-b,"em");let I="ML__prompt ";this.locked?I+=" ML__lockedPromptBox ":I+=" ML__editablePromptBox ",this.correctness==="correct"?I+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(I+=" ML__incorrectPromptBox "),this.containsCaret&&(I+=" ML__focusedPromptBox ");const B=new Je(null,{classes:I,attributes:{part:"prompt"}});B.height=N.height+b,B.depth=N.depth+b,B.width=N.width+2*g,B.setStyle("box-sizing","border-box"),B.setStyle("position","absolute"),B.setStyle("height",N.height+N.depth+2*b,"em"),g===0&&B.setStyle("width","100%"),g!==0&&(B.setStyle("width",`calc(100% + ${2*g}em)`),B.setStyle("top",f,"em"),B.setStyle("left",-g,"em")),(!this.body||this.body.length===1)&&(B.width=3*g,B.setStyle("width",`calc(100% + ${3*g}em)`),B.setStyle("left",-1.5*g,"em"));let U="";this.correctness==="incorrect"&&(U+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),U&&(B.svgOverlay=U);const lt=new Je([B,N],{classes:"ML__prompt-atom"});return lt.setStyle("position","relative"),lt.setStyle("display","inline-block"),lt.setStyle("line-height",0),lt.height=N.height+b+.2,lt.depth=N.depth+b,lt.left=g,lt.right=g,lt.setStyle("height",N.height+b,"em"),lt.setStyle("top",N.depth-N.height,"em"),lt.setStyle("vertical-align",N.depth+b,"em"),lt.setStyle("margin-left",.5,"em"),lt.setStyle("margin-right",.5,"em"),this.caret&&(lt.caret=this.caret),this.bind(u,this.attachSupsub(o,{base:lt}))}_serialize(o){var u;const f=(u=this.bodyToLatex(o))!=null?u:"";if(o.skipPlaceholders)return f;let g="\\placeholder";return this.placeholderId&&(g+=`[${this.placeholderId}]`),this.correctness==="correct"?g+="[correct]":this.correctness==="incorrect"&&(g+="[incorrect]"),this.locked&&(g+="[locked]"),jn(g,f)}},lh=class w2 extends ae{constructor(o){super({type:"subsup",style:o==null?void 0:o.style}),this.subsupPlacement="auto"}static fromJson(o){const u=new w2(o);for(const f of Yr)o[f]&&u.setChildren(o[f],f);return u}render(o){var u;const f=new Nn({parent:o,isPhantom:!0}),g=this.leftSibling,b=(u=g.render(f))!=null?u:new Je(null),M=new Je(null);return M.height=b.height,M.depth=b.depth,this.attachSupsub(o,{base:M,isCharacterBox:g.isCharacterBox(),type:"ignore"})}_serialize(o){return this.supsubToLatex(o)}};function ba(r){return r?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(r):!1}var Vu=class{constructor(r,o,u){this.errors=[],this.index=0,this.endCount=0;var f,g,b,M;u!=null||(u={}),this.tokens=r,this.context=o instanceof Nn&&!(u!=null&&u.parseMode)&&!u.mathstyle?o:new Nn({from:o,mathstyle:u.mathstyle},u.style),this.args=(f=u.args)!=null?f:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(g=u.style)!=null?g:{},parseMode:(b=u.parseMode)!=null?b:"math",mathstyle:(M=u.mathstyle)!=null?M:"displaystyle",tabular:!1}}beginContext(r){var o,u,f;const g=this.parsingContext,b={parent:g,mathlist:[],style:ot({},g.style),parseMode:(o=r==null?void 0:r.mode)!=null?o:g.parseMode,mathstyle:(u=r==null?void 0:r.mathstyle)!=null?u:g.mathstyle,tabular:(f=r==null?void 0:r.tabular)!=null?f:!1};this.parsingContext=b}endContext(){this.parsingContext=this.parsingContext.parent}onError(r){this.errors.push(ot({before:ws(this.tokens.slice(this.index,this.index+10)),after:ws(this.tokens.slice(Math.max(0,this.index-10),this.index))},r))}get mathlist(){return this.parsingContext.mathlist}set mathlist(r){this.parsingContext.mathlist=r}get parseMode(){return this.parsingContext.parseMode}set parseMode(r){this.parsingContext.parseMode=r}get tabularMode(){return this.parsingContext.tabular}get style(){let r=this.parsingContext;for(;r;){if(r.style)return ot({},r.style);r=r.parent}return{}}set style(r){this.parsingContext.style=r}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(r){return this.tokens[this.index]===r?(this.index++,!0):!1}lastSubsupAtom(){let r;return this.mathlist.length>0&&(r=this.mathlist[this.mathlist.length-1],r.type==="subsup"||r.subsupPlacement!==void 0)||(r=new lh({style:this.style}),this.mathlist.push(r)),r}hasPattern(r){return r.test(this.tokens[this.index])}hasInfixCommand(){var r;const{index:o}=this;if(o<this.tokens.length&&this.tokens[o].startsWith("\\")){const u=Fr(this.tokens[o],this.parseMode);return!u||u.definitionType==="symbol"||u.ifMode&&!u.ifMode.includes(this.parseMode)?!1:(r=u.infix)!=null?r:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const r=this.peek();return r!=="\\\\"&&r!=="\\cr"&&r!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var r;const o=(r=this.args)==null?void 0:r.call(this,"?");return o?au(o,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Hr({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(r){let o=this.tokens[this.index];for(;o&&o!==r;)o=this.tokens[++this.index];o===r&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(r){const o=this.index;let u=this.end(),f="";for(;!u;){const b=this.get();ba(b)?(f+=b,u=this.end()||f.length>=r.length):u=!0}const g=r.toUpperCase()===f.toUpperCase();return g||(this.index=o),g}scanString(){let r="";for(;!this.end();){const o=this.peek();if(o==="]")return r;if(o==="<space>")r+=" ";else if(o.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),r+=o.substring(1);else if(ba(o))r+=o;else return r;this.next()}return r}scanBalancedString(){let r="",o=this.end(),u=1;for(;!o;){const f=this.get();f==="<space>"?r+=" ":f==="<{>"?(r+="{",u+=1):f==="<}>"?(u-=1,u>0?r+="}":this.index-=1):f==="<$>"?r+="$":f==="<$$>"?r+="$$":r+=f,o=u===0||this.end()}return r}scanLiteralGroup(){var r;if(!this.match("<{>"))return"";let o="",u=1;for(;u>0&&!this.end();){const f=this.get();f==="<}>"?(u-=1,u>0&&(o+="}")):f==="<{>"?(u+=1,o+="{"):(/\\[a-zA-Z]+$/.test(o)&&/^[a-zA-Z]/.test(f)&&(o+=" "),o+=(r={"<space>":" ","<$$>":"$$","<$>":"$"}[f])!=null?r:f)}return o}scanNumber(r=!0){var o,u;let f=!1,g=this.peek();for(;g==="<space>"||g==="+"||g==="-";)this.get(),g==="-"&&(f=!f),g=this.peek();r=!!r;let b=10,M=/\d/;if(this.match("'"))b=8,M=/[0-7]/,r=!0;else if(this.match('"'))b=16,M=/[\dA-F]/,r=!0;else if(this.match("x"))b=16,M=/[\dA-Fa-f]/,r=!0;else if(this.match("`"))return g=this.get(),g?g.length===2&&g.startsWith("\\")?{number:(f?-1:1)*((o=g.codePointAt(1))!=null?o:0),base:"alpha"}:{number:(f?-1:1)*((u=g.codePointAt(0))!=null?u:0),base:"alpha"}:null;let N="";for(;this.hasPattern(M);)N+=this.get();if(!r&&(this.match(".")||this.match(",")))for(N+=".";this.hasPattern(M);)N+=this.get();const I=r?Number.parseInt(N,b):Number.parseFloat(N);return Number.isNaN(I)?null:{number:f?-I:I,base:b===16?"hexadecimal":b===8?"octal":"decimal"}}scanRegister(){var r;const o=this.index,u=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return u;let f=!1;if(u===null)for(;;){const b=this.peek();if(b==="-")f=!f;else if(b!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const b=this.get();return b.startsWith("\\")?u?{register:b,global:!0,factor:(f?-1:1)*u.number}:f?{register:b,global:!0,factor:-1}:{register:b,global:!0}:(this.index=o,null)}let g=this.get();return g!=null&&g.startsWith("\\")?(g=g.substring(1),this.context.registers[g]?!f||u!==null?{register:g,factor:(f?-1:1)*((r=u==null?void 0:u.number)!=null?r:1)}:{register:g}:(this.index=o,null)):(this.index=o,null)}scanValue(){const r=this.scanRegister();if(r)return r;const o=this.index,u=this.scanGlueOrDimen();if(u&&("unit"in u||"glue"in u&&"unit"in u.glue))return u;this.index=o;const f=this.scanNumber();if(f)return f;if(this.end()||!ba(this.peek()))return null;const g=this.scanString();return g.length>0?{string:g}:null}scanDimen(){const r=this.scanNumber(!1);if(r===null)return null;const o=r.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let u;return this.matchKeyword("pt")?u="pt":this.matchKeyword("mm")?u="mm":this.matchKeyword("cm")?u="cm":this.matchKeyword("ex")?u="ex":this.matchKeyword("px")?u="px":this.matchKeyword("em")?u="em":this.matchKeyword("bp")?u="bp":this.matchKeyword("dd")?u="dd":this.matchKeyword("pc")?u="pc":this.matchKeyword("in")?u="in":this.matchKeyword("mu")&&(u="mu"),u?{dimension:o,unit:u}:{dimension:o}}scanGlueOrDimen(){const r=this.scanDimen();if(r===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return r;const o={glue:r};if(this.matchKeyword("plus")){const u=this.scanDimen();if(u)o.grow=u;else return o}if(this.skipWhitespace(),this.match("\\relax"))return o;if(this.skipWhitespace(),this.matchKeyword("minus")){const u=this.scanDimen();if(u)o.shrink=u;else return o}return!o.grow&&!o.shrink?r:o}scanColspec(){this.skipWhitespace();const r=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const o=this.get();o==="c"||o==="r"||o==="l"?r.push({align:o}):o==="|"?r.push({separator:"solid"}):o===":"?r.push({separator:"dashed"}):o==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),r.push({gap:this.scan(u=>u==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return r}scanModeSet(){let r;if(this.match("\\(")&&(r="textstyle"),!r&&this.match("\\[")&&(r="displaystyle"),!r)return null;this.beginContext({mode:"math",mathstyle:r});const o=this.scan(u=>u===(r==="displaystyle"?"\\]":"\\)"));return this.match(r==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),o}scanModeShift(){let r="";if(this.match("<$>")&&(r="<$>"),!r&&this.match("<$$>")&&(r="<$$>"),!r)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const o=this.scan(u=>u===r);return this.match(r)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),o}scanEnvironment(){if(!this.match("\\begin"))return null;const r=this.scanArgument("string");if(!r)return null;const o=Pe(r);if(!o)return this.onError({code:"unknown-environment",arg:r}),null;const u=[];if(o.params)for(const N of o.params)if(N.isOptional)u.push(this.scanOptionalArgument(N.type));else{const I=this.scanArgument(N.type);I||this.onError({code:"missing-argument",arg:r}),u.push(I)}this.beginContext({tabular:o.tabular});const f=[],g=[];let b=[],M=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:r}),M=!0),!M&&this.match("\\end")&&(this.scanArgument("string")!==r&&this.onError({code:"unbalanced-environment",arg:r}),M=!0),!M)if(this.matchColumnSeparator())b.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){b.push(this.mathlist),this.mathlist=[];let N=null;this.skipWhitespace(),this.match("[")&&(N=this.scanDimen(),this.skipWhitespace(),this.match("]")),g.push(N!=null?N:{dimension:0}),f.push(b),b=[]}else this.mathlist.push(...this.scan(N=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(N)));while(!M);return b.push(this.mathlist),b.length>0&&f.push(b),this.endContext(),o.createAtom(r,f,g,u)}scanExpression(){const r=this.mathlist;if(this.mathlist=[],this.parseExpression()){const o=this.mathlist;return this.mathlist=r,o}return this.mathlist=r,null}scan(r){this.beginContext(),r||(r=M=>M==="<}>");let o="",u=null,f=[],g=null;for(;!this.end()&&!r(this.peek());)this.hasInfixCommand()&&!o?(o=this.get(),u=Fr(o,"math"),u&&(f=this.scanArguments(u)[1]),g=this.mathlist,this.mathlist=[]):this.parseExpression();let b;return o?(console.assert(!!u),f.unshift(this.mathlist),g&&f.unshift(g),b=[u.createAtom({command:o,args:f,style:this.style,mode:this.parseMode})]):b=this.mathlist,this.endContext(),b}scanGroup(){const r=this.index;if(!this.match("<{>"))return null;const o=this.scan(f=>f==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const u=new _l(o,this.parseMode,this.style);return u.verbatimLatex=ws(this.tokens.slice(r,this.index)),u}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let r=1;for(;!this.end()&&r!==0;)this.match("(")&&(r+=1),this.match(")")&&(r-=1),r!==0&&this.parseExpression();const o=new wa("",this.mathlist,{leftDelim:"(",rightDelim:r===0?")":"?"});return this.endContext(),o}scanDelim(){this.skipWhitespace();const r=this.peek();if(!r)return this.onError({code:"unexpected-end-of-string"}),null;if(!ba(r)&&!r.startsWith("\\"))return null;this.next();const o=Fr(r,"math");return o?o.definitionType==="function"&&o.ifMode&&!o.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:r}),null):o.definitionType==="symbol"&&(o.type==="mopen"||o.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(r)?r:(this.onError({code:"unexpected-delimiter",arg:r}),null):(this.onError({code:"unknown-command",arg:r}),null)}scanLeftRight(){var r;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new wh("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new wh("\\mright");let o="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;o="\\mright"}const u=this.scanDelim();if(!u)return this.onError({code:"unexpected-delimiter"}),new wh(o==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(o);)this.parseExpression();const f=this.mathlist;this.endContext();const g=(r=this.scanDelim())!=null?r:".";return new wa(o==="\\right"?"left...right":"mleft...mright",f,{leftDelim:u,rightDelim:g,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let r=this.peek();if(r!=="^"&&r!=="_"&&r!=="'")return!1;const o=this.lastSubsupAtom();for(;r==="^"||r==="_"||r==="'";)this.match("'")?this.match("'")?o.addChild(new ae({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):o.addChild(new ae({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&o.addChildren(Ae(this.scanArgument("expression")),r==="_"?"subscript":"superscript"),r=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const r=this.match("\\limits"),o=!r&&this.match("\\nolimits"),u=!o&&!r&&this.match("\\displaylimits");if(!r&&!o&&!u)return!1;const f=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return f===null?!1:(f.explicitSubsupPlacement=!0,r&&(f.subsupPlacement="over-under"),o&&(f.subsupPlacement="adjacent"),u&&(f.subsupPlacement="auto"),!0)}scanArguments(r){if(!(r!=null&&r.params))return[void 0,[]];let o;const u=[];let f=r.infix?2:0;for(;f<r.params.length;){const g=r.params[f];g.type==="rest"?u.push(this.scan(b=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(b))):g.isOptional?u.push(this.scanOptionalArgument(g.type)):g.type.endsWith("*")?o=g.type.slice(0,-1):u.push(this.scanArgument(g.type)),f+=1}return[o,u]}scanSymbolOrLiteral(){const r=this.peek();if(!r)return null;this.next();let o;if(ba(r)){const u=Pn.createAtom(this.parseMode,r,ot({},this.style));return u?[u]:null}if(o=this.scanMacro(r),o)return[o];if(r.startsWith("\\")){const u=Fr(r,this.parseMode);if(!u)return this.onError({code:"unknown-command",arg:r}),[new wh(r)];if(u.definitionType==="symbol"){const f=ot({},this.style);u.variant&&(f.variant=u.variant),o=new ae({type:u.type,command:r,style:f,value:String.fromCodePoint(u.codepoint),mode:this.parseMode,verbatimLatex:r})}else{if(u.applyMode||u.applyStyle||u.infix)return this.onError({code:"invalid-command",arg:r}),[new wh(r)];u.createAtom&&(o=u.createAtom({command:r,args:[],style:this.style,mode:this.parseMode}))}}return o?[o]:null}scanArgument(r){var o;this.skipFiller();const u=this.parseMode;if(r==="auto"&&(r=u),!this.match("<{>")){if(r==="string")return this.scanString();if(r==="value")return this.scanValue();if(r==="delim")return(o=this.scanDelim())!=null?o:".";if(r==="expression")return this.scanExpression();if(r==="math"){r!==u&&this.beginContext({mode:"math"});const g=this.scanSymbolOrLiteral();return r!==u&&this.endContext(),g}if(r==="text"){r!==u&&this.beginContext({mode:"text"});const g=this.scanSymbolOrLiteral();return r!==u&&this.endContext(),g}return r==="balanced-string"||console.assert(!1),null}if(r==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const g=this.mathlist;return this.endContext(),{group:g}}if(r==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const g=this.mathlist;return this.endContext(),{group:g}}let f=null;if(r==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const g=this.mathlist;return this.endContext(),{group:g}}return r==="string"?f=this.scanString():r==="balanced-string"?f=this.scanBalancedString():r==="colspec"?f=this.scanColspec():r==="value"&&(f=this.scanValue()),this.skipUntilToken("<}>"),f}scanOptionalArgument(r){if(r=r==="auto"?this.parseMode:r,this.skipFiller(),!this.match("["))return null;let o=null;for(;!this.end()&&!this.match("]");)if(r==="string")o=this.scanString();else if(r==="value")o=this.scanValue();else if(r==="colspec")o=this.scanColspec();else if(r==="bbox"){const u={},f=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const g of f){const b=g.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(b)u.padding={dimension:parseInt(b[1]),unit:b[2]};else{const M=g.match(/^\s*border\s*:\s*(.*)/);M?u.border=M[1]:u.backgroundcolor={string:g}}}o=u}else r==="math"&&(this.beginContext({mode:"math"}),o=this.mathlist.concat(this.scan(u=>u==="]")),this.endContext());return o}scanSymbolOrCommand(r){var o,u,f;if(r==="\\placeholder"){const N=this.scanOptionalArgument("string"),I=this.scanOptionalArgument("math"),B=ae.serialize(I,{defaultMode:"math"});let U=[],lt;!lt&&B==="correct"?lt="correct":!lt&&B==="incorrect"?lt="incorrect":B!==""&&(U=I);const Lt=this.scanOptionalArgument("string")==="locked",Bt=this.scanArgument("auto");let jt;return Bt&&Array.isArray(Bt)&&Bt.length>0?jt=Bt:Bt&&typeof Bt=="object"&&"group"in Bt?jt=Bt.group:jt=U,N?[new Gh(N,lt,Lt,jt!=null?jt:U,{mode:this.parseMode,style:this.style})]:[new Hr({mode:this.parseMode,style:this.style})]}if(r==="\\renewcommand"||r==="\\newcommand"||r==="\\providecommand"||r==="\\def"){const N=this.index,I=this.scanLiteralGroup()||this.next();if(!I)return null;if(this.context.registers[I.substring(1)]){const B=this.scanArgument("string");B!==null&&(this.context.registers[I.substring(1)]=B);const U=Mn([r,ws(this.tokens.slice(N,this.index))]);return[new ae({type:"text",value:"",verbatimLatex:U})]}}let g=this.scanMacro(r);if(g)return[g];const b=Fr(r,this.parseMode);if(!b)return this.parseMode==="text"?(/[a-zA-Z]/.test((o=this.peek())!=null?o:"")&&(r+=" "),[...r].map(N=>new ae({type:"text",value:N,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:r}),[new wh(r)]);const M=this.index;if(b.definitionType==="symbol"){const N=ot({},this.style);b.variant&&(N.variant=b.variant),g=new ae({type:b.type,command:r,style:N,value:String.fromCodePoint(b.codepoint),mode:this.parseMode})}else{if(b.ifMode&&!b.ifMode.includes(this.parseMode))return[];const N=this.parseMode;b.applyMode&&(this.parseMode=b.applyMode);let I,B=[];if(b.parse?B=b.parse(this):[I,B]=this.scanArguments(b),this.parseMode=N,b.applyMode&&!b.applyStyle&&!b.createAtom)return Ae(B[0]);if(b.infix)return this.onError({code:"too-many-infix-commands",arg:r}),null;if(typeof b.createAtom=="function")g=b.createAtom({command:r,args:B,style:this.style,mode:this.parseMode}),I&&(g.body=Ae(this.scanArgument(I)));else if(typeof b.applyStyle=="function"){const U=ot(ot({},this.style),b.applyStyle(r,B,this.context)),lt=this.parseMode;if(b.applyMode&&(this.parseMode=b.applyMode),I){const Lt=this.style;this.style=U;const Bt=this.scanArgument(I);return this.style=Lt,this.parseMode=lt,Ae(Bt)}this.style=U}else g=new ae({type:"mord",command:(u=b.command)!=null?u:r,style:ot({},this.style),value:r,mode:(f=b.applyMode)!=null?f:this.parseMode})}if(!g)return null;if(g instanceof ae&&g.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(r)){const N=Mn([r,ws(this.tokens.slice(M,this.index))]);N&&(g.verbatimLatex=N)}if(g.verbatimLatex===null&&(g.verbatimLatex=void 0),g.isFunction&&this.smartFence){const N=this.scanSmartFence();if(N)return[g,N]}return[g]}scanSymbolCommandOrLiteral(){const r=this.get();if(!r)return null;if(ba(r)){const o=Pn.createAtom(this.parseMode,r,ot({},this.style));if(!o)return null;if(o.isFunction&&this.smartFence){const u=this.scanSmartFence();if(u)return[o,u]}return[o]}return r.startsWith("\\")?this.scanSymbolOrCommand(r):r==="<space>"?this.parseMode==="text"?[new Wl(" "," ",this.style)]:null:(r==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:r}),null)}scanMacro(r){var o;const u=this.context.getMacro(r);if(!u)return null;const f=this.index,g=u.args,b={"?":(o=this.args)==null?void 0:o.call(this,"?")};for(let M=1;M<=g;M++){let N=this.scanLiteralGroup();if(!N){const I=this.index;this.scanExpression(),N=ws(this.tokens.slice(I,this.index))}b[M]=N}return new np(r,{expand:u.expand,captureSelection:u.captureSelection,args:f===this.index?null:ws(this.tokens.slice(f,this.index)),style:this.parsingContext.style,body:au(u.def,{context:this.context,parseMode:this.parseMode,args:M=>b[M],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var r,o,u,f;let g=(f=(u=(o=(r=this.scanEnvironment())!=null?r:this.scanModeShift())!=null?o:this.scanModeSet())!=null?u:this.scanGroup())!=null?f:this.scanLeftRight();if(g===null){if(this.parseSupSub()||this.parseLimits())return!0;g=this.scanSymbolCommandOrLiteral()}return g?(Array.isArray(g)?this.mathlist.push(...g):this.mathlist.push(g),!0):!1}};function au(r,o){var u,f,g,b;const M=(u=o==null?void 0:o.args)!=null?u:void 0,N=new Vu(_o(r,M),o==null?void 0:o.context,{args:M,mathstyle:(f=o==null?void 0:o.mathstyle)!=null?f:"displaystyle",parseMode:(g=o==null?void 0:o.parseMode)!=null?g:"math",style:(b=o==null?void 0:o.style)!=null?b:{}}),I=[];for(;!N.end();)I.push(...N.scan(()=>!1));return I}function Dd(r,o){var u;const f=new Vu(_o(r,null),o==null?void 0:o.context,{mathstyle:"displaystyle",parseMode:(u=o==null?void 0:o.parseMode)!=null?u:"math"});for(;!f.end();)f.scan();return f.errors}var Fv=class b2 extends ae{constructor(o,u){super({type:"chem"},{command:o,mode:"math"});const f=Bl.go(Ei.go(u,o==="\\pu"?"pu":"ce"),!1);this.body=au(f),this._verbatimLatex=o+"{"+u+"}",this.arg=u,this.captureSelection=!0}static fromJson(o){return new b2(o.command,o.arg)}set verbatimLatex(o){}get verbatimLatex(){return this._verbatimLatex}toJson(){return F(ot({},super.toJson()),{arg:this.arg})}render(o){const u=ae.createBox(o,this.body,{type:"inner"});return this.caret&&(u.caret=this.caret),this.bind(o,u)}_serialize(o){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};Se(["ce","pu"],"{chemformula:balanced-string}",{createAtom:r=>{var o;return new Fv(r.command,(o=r.args[0])!=null?o:"")}});var Ei={go:function(r,o){if(!r)return[];o===void 0&&(o="ce");var u="0",f={};f.parenthesisLevel=0,r=r.replace(/\n/g," "),r=r.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),r=r.replace(/[\u2026]/g,"...");for(var g,b=10,M=[];;){g!==r?(b=10,g=r):b--;var N=Ei.stateMachines[o],I=N.transitions[u]||N.transitions["*"];t:for(var B=0;B<I.length;B++){var U=Ei.patterns.match_(I[B].pattern,r);if(U){for(var lt=I[B].task,Lt=0;Lt<lt.action_.length;Lt++){var Bt;if(N.actions[lt.action_[Lt].type_])Bt=N.actions[lt.action_[Lt].type_](f,U.match_,lt.action_[Lt].option);else if(Ei.actions[lt.action_[Lt].type_])Bt=Ei.actions[lt.action_[Lt].type_](f,U.match_,lt.action_[Lt].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+lt.action_[Lt].type_+")"];Ei.concatArray(M,Bt)}if(u=lt.nextState||u,r.length>0){if(lt.revisit||(r=U.remainder),!lt.toContinue)break t}else return M}}if(b<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(r,o){if(o)if(Object.prototype.toString.call(o)==="[object Array]")for(var u=0;u<o.length;u++)r.push(o[u]);else r.push(o)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(r){var o=r.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return o&&o[0]?{match_:o.slice(1),remainder:r.substr(o[0].length)}:null},"(-)(9)^(-9)":function(r){var o=r.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return o&&o[0]?{match_:o.slice(1),remainder:r.substr(o[0].length)}:null},"state of aggregation $":function(r){var o=Ei.patterns.findObserveGroups(r,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(o&&o.remainder.match(/^($|[\s,;\)\]\}])/))return o;var u=r.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return u?{match_:u[0],remainder:r.substr(u[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"^{","","","}")},"^($...$)":function(r){return Ei.patterns.findObserveGroups(r,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(r){return Ei.patterns.findObserveGroups(r,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(r){return Ei.patterns.findObserveGroups(r,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"_{","","","}")},"_($...$)":function(r){return Ei.patterns.findObserveGroups(r,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(r){return Ei.patterns.findObserveGroups(r,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(r){return Ei.patterns.findObserveGroups(r,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(r){return Ei.patterns.findObserveGroups(r,"","{","}","")},"{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"{","","","}")},"$...$":function(r){return Ei.patterns.findObserveGroups(r,"","$","$","")},"${(...)}$":function(r){return Ei.patterns.findObserveGroups(r,"${","","","}$")},"$(...)$":function(r){return Ei.patterns.findObserveGroups(r,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(r){return Ei.patterns.findObserveGroups(r,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(r){return Ei.patterns.findObserveGroups(r,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(r){return Ei.patterns.findObserveGroups(r,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(r){return Ei.patterns.findObserveGroups(r,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(r){return Ei.patterns.findObserveGroups(r,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(r){return Ei.patterns.findObserveGroups(r,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(r){return Ei.patterns.findObserveGroups(r,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(r){var o;if(o=r.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),o)return{match_:o[0],remainder:r.substr(o[0].length)};var u=Ei.patterns.findObserveGroups(r,"","$","$","");return u&&(o=u.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),o)?{match_:o[0],remainder:r.substr(o[0].length)}:null},amount2:function(r){return this.amount(r)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(r){if(r.match(/^\([a-z]+\)$/))return null;var o=r.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return o?{match_:o[0],remainder:r.substr(o[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(r,o,u,f,g,b,M,N,I,B){var U=function(Le,Ci){if(typeof Ci=="string")return Le.indexOf(Ci)!==0?null:Ci;var en=Le.match(Ci);return en?en[0]:null},lt=function(Le,Ci,en){for(var Oi=0;Ci<Le.length;){var hr=Le.charAt(Ci),Jr=U(Le.substr(Ci),en);if(Jr!==null&&Oi===0)return{endMatchBegin:Ci,endMatchEnd:Ci+Jr.length};if(hr==="{")Oi++;else if(hr==="}"){if(Oi===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];Oi--}Ci++}return Oi>0,null},Lt=U(r,o);if(Lt===null||(r=r.substr(Lt.length),Lt=U(r,u),Lt===null))return null;var Bt=lt(r,Lt.length,f||g);if(Bt===null)return null;var jt=r.substring(0,f?Bt.endMatchEnd:Bt.endMatchBegin);if(b||M){var je=this.findObserveGroups(r.substr(Bt.endMatchEnd),b,M,N,I);if(je===null)return null;var Zi=[jt,je.match_];return{match_:B?Zi.join(""):Zi,remainder:je.remainder}}else return{match_:jt,remainder:r.substr(Bt.endMatchEnd)}},match_:function(r,o){var u=Ei.patterns.patterns[r];if(u===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+r+")"];if(typeof u=="function")return Ei.patterns.patterns[r](o);var f=o.match(u);if(f){var g;return f[2]?g=[f[1],f[2]]:f[1]?g=f[1]:g=f[0],{match_:g,remainder:o.substr(f[0].length)}}return null}},actions:{"a=":function(r,o){r.a=(r.a||"")+o},"b=":function(r,o){r.b=(r.b||"")+o},"p=":function(r,o){r.p=(r.p||"")+o},"o=":function(r,o){r.o=(r.o||"")+o},"q=":function(r,o){r.q=(r.q||"")+o},"d=":function(r,o){r.d=(r.d||"")+o},"rm=":function(r,o){r.rm=(r.rm||"")+o},"text=":function(r,o){r.text_=(r.text_||"")+o},insert:function(r,o,u){return{type_:u}},"insert+p1":function(r,o,u){return{type_:u,p1:o}},"insert+p1+p2":function(r,o,u){return{type_:u,p1:o[0],p2:o[1]}},copy:function(r,o){return o},rm:function(r,o){return{type_:"rm",p1:o||""}},text:function(r,o){return Ei.go(o,"text")},"{text}":function(r,o){var u=["{"];return Ei.concatArray(u,Ei.go(o,"text")),u.push("}"),u},"tex-math":function(r,o){return Ei.go(o,"tex-math")},"tex-math tight":function(r,o){return Ei.go(o,"tex-math tight")},bond:function(r,o,u){return{type_:"bond",kind_:u||o}},"color0-output":function(r,o){return{type_:"color0",color:o[0]}},ce:function(r,o){return Ei.go(o)},"1/2":function(r,o){var u=[];o.match(/^[+\-]/)&&(u.push(o.substr(0,1)),o=o.substr(1));var f=o.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return f[1]=f[1].replace(/\$/g,""),u.push({type_:"frac",p1:f[1],p2:f[2]}),f[3]&&(f[3]=f[3].replace(/\$/g,""),u.push({type_:"tex-math",p1:f[3]})),u},"9,9":function(r,o){return Ei.go(o,"9,9")}},createTransitions:function(r){var o,u,f,g,b={};for(o in r)for(u in r[o])for(f=u.split("|"),r[o][u].stateArray=f,g=0;g<f.length;g++)b[f[g]]=[];for(o in r)for(u in r[o])for(f=r[o][u].stateArray||[],g=0;g<f.length;g++){var M=r[o][u];if(M.action_){M.action_=[].concat(M.action_);for(var N=0;N<M.action_.length;N++)typeof M.action_[N]=="string"&&(M.action_[N]={type_:M.action_[N]})}else M.action_=[];for(var I=o.split("|"),B=0;B<I.length;B++)if(f[g]==="*")for(var U in b)b[U].push({pattern:I[B],task:M});else b[f[g]].push({pattern:I[B],task:M})}return b},stateMachines:{}};Ei.stateMachines={ce:{transitions:Ei.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(r,o){var u;if((r.d||"").match(/^[0-9]+$/)){var f=r.d;r.d=void 0,u=this.output(r),r.b=f}else u=this.output(r);return Ei.actions["o="](r,o),u},"d= kv":function(r,o){r.d=o,r.dType="kv"},"charge or bond":function(r,o){if(r.beginsWithBond){var u=[];return Ei.concatArray(u,this.output(r)),Ei.concatArray(u,Ei.actions.bond(r,o,"-")),u}else r.d=o},"- after o/d":function(r,o,u){var f=Ei.patterns.match_("orbital",r.o||""),g=Ei.patterns.match_("one lowercase greek letter $",r.o||""),b=Ei.patterns.match_("one lowercase latin letter $",r.o||""),M=Ei.patterns.match_("$one lowercase latin letter$ $",r.o||""),N=o==="-"&&(f&&f.remainder===""||g||b||M);N&&!r.a&&!r.b&&!r.p&&!r.d&&!r.q&&!f&&b&&(r.o="$"+r.o+"$");var I=[];return N?(Ei.concatArray(I,this.output(r)),I.push({type_:"hyphen"})):(f=Ei.patterns.match_("digits",r.d||""),u&&f&&f.remainder===""?(Ei.concatArray(I,Ei.actions["d="](r,o)),Ei.concatArray(I,this.output(r))):(Ei.concatArray(I,this.output(r)),Ei.concatArray(I,Ei.actions.bond(r,o,"-")))),I},"a to o":function(r){r.o=r.a,r.a=void 0},"sb=true":function(r){r.sb=!0},"sb=false":function(r){r.sb=!1},"beginsWithBond=true":function(r){r.beginsWithBond=!0},"beginsWithBond=false":function(r){r.beginsWithBond=!1},"parenthesisLevel++":function(r){r.parenthesisLevel++},"parenthesisLevel--":function(r){r.parenthesisLevel--},"state of aggregation":function(r,o){return{type_:"state of aggregation",p1:Ei.go(o,"o")}},comma:function(r,o){var u=o.replace(/\s*$/,""),f=u!==o;return f&&r.parenthesisLevel===0?{type_:"comma enumeration L",p1:u}:{type_:"comma enumeration M",p1:u}},output:function(r,o,u){var f;if(!r.r)f=[],!r.a&&!r.b&&!r.p&&!r.o&&!r.q&&!r.d&&!u||(r.sb&&f.push({type_:"entitySkip"}),!r.o&&!r.q&&!r.d&&!r.b&&!r.p&&u!==2?(r.o=r.a,r.a=void 0):!r.o&&!r.q&&!r.d&&(r.b||r.p)?(r.o=r.a,r.d=r.b,r.q=r.p,r.a=r.b=r.p=void 0):r.o&&r.dType==="kv"&&Ei.patterns.match_("d-oxidation$",r.d||"")?r.dType="oxidation":r.o&&r.dType==="kv"&&!r.q&&(r.dType=void 0),f.push({type_:"chemfive",a:Ei.go(r.a,"a"),b:Ei.go(r.b,"bd"),p:Ei.go(r.p,"pq"),o:Ei.go(r.o,"o"),q:Ei.go(r.q,"pq"),d:Ei.go(r.d,r.dType==="oxidation"?"oxidation":"bd"),dType:r.dType}));else{var g;r.rdt==="M"?g=Ei.go(r.rd,"tex-math"):r.rdt==="T"?g=[{type_:"text",p1:r.rd||""}]:g=Ei.go(r.rd);var b;r.rqt==="M"?b=Ei.go(r.rq,"tex-math"):r.rqt==="T"?b=[{type_:"text",p1:r.rq||""}]:b=Ei.go(r.rq),f={type_:"arrow",r:r.r,rd:g,rq:b}}for(var M in r)M!=="parenthesisLevel"&&M!=="beginsWithBond"&&delete r[M];return f},"oxidation-output":function(r,o){var u=["{"];return Ei.concatArray(u,Ei.go(o,"oxidation")),u.push("}"),u},"frac-output":function(r,o){return{type_:"frac-ce",p1:Ei.go(o[0]),p2:Ei.go(o[1])}},"overset-output":function(r,o){return{type_:"overset",p1:Ei.go(o[0]),p2:Ei.go(o[1])}},"underset-output":function(r,o){return{type_:"underset",p1:Ei.go(o[0]),p2:Ei.go(o[1])}},"underbrace-output":function(r,o){return{type_:"underbrace",p1:Ei.go(o[0]),p2:Ei.go(o[1])}},"color-output":function(r,o){return{type_:"color",color1:o[0],color2:Ei.go(o[1])}},"r=":function(r,o){r.r=o},"rdt=":function(r,o){r.rdt=o},"rd=":function(r,o){r.rd=o},"rqt=":function(r,o){r.rqt=o},"rq=":function(r,o){r.rq=o},operator:function(r,o,u){return{type_:"operator",kind_:u||o}}}},a:{transitions:Ei.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:Ei.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:Ei.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(r){if(r.text_){var o={type_:"text",p1:r.text_};for(var u in r)delete r[u];return o}}}},pq:{transitions:Ei.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(r,o){return{type_:"state of aggregation subscript",p1:Ei.go(o,"o")}},"color-output":function(r,o){return{type_:"color",color1:o[0],color2:Ei.go(o[1],"pq")}}}},bd:{transitions:Ei.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(r,o){return{type_:"color",color1:o[0],color2:Ei.go(o[1],"bd")}}}},oxidation:{transitions:Ei.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(r,o){return{type_:"roman numeral",p1:o||""}}}},"tex-math":{transitions:Ei.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(r){if(r.o){var o={type_:"tex-math",p1:r.o};for(var u in r)delete r[u];return o}}}},"tex-math tight":{transitions:Ei.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(r,o){r.o=(r.o||"")+"{"+o+"}"},output:function(r){if(r.o){var o={type_:"tex-math",p1:r.o};for(var u in r)delete r[u];return o}}}},"9,9":{transitions:Ei.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:Ei.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(r,o){var u=[];return o[0]==="+-"||o[0]==="+/-"?u.push("\\pm "):o[0]&&u.push(o[0]),o[1]&&(Ei.concatArray(u,Ei.go(o[1],"pu-9,9")),o[2]&&(o[2].match(/[,.]/)?Ei.concatArray(u,Ei.go(o[2],"pu-9,9")):u.push(o[2])),(o[3]||o[4])&&(o[3]==="e"||o[4]==="*"?u.push({type_:"cdot"}):u.push({type_:"times"}))),o[5]&&u.push("10^{"+o[5]+"}"),u},"number^":function(r,o){var u=[];return o[0]==="+-"||o[0]==="+/-"?u.push("\\pm "):o[0]&&u.push(o[0]),Ei.concatArray(u,Ei.go(o[1],"pu-9,9")),u.push("^{"+o[2]+"}"),u},operator:function(r,o,u){return{type_:"operator",kind_:u||o}},space:function(){return{type_:"pu-space-1"}},output:function(r){var o,u=Ei.patterns.match_("{(...)}",r.d||"");u&&u.remainder===""&&(r.d=u.match_);var f=Ei.patterns.match_("{(...)}",r.q||"");if(f&&f.remainder===""&&(r.q=f.match_),r.d&&(r.d=r.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),r.d=r.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),r.q){r.q=r.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),r.q=r.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var g={d:Ei.go(r.d,"pu"),q:Ei.go(r.q,"pu")};r.o==="//"?o={type_:"pu-frac",p1:g.d,p2:g.q}:(o=g.d,g.d.length>1||g.q.length>1?o.push({type_:" / "}):o.push({type_:"/"}),Ei.concatArray(o,g.q))}else o=Ei.go(r.d,"pu-2");for(var b in r)delete r[b];return o}}},"pu-2":{transitions:Ei.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(r,o){r.rm+="^{"+o+"}"},space:function(){return{type_:"pu-space-2"}},output:function(r){var o=[];if(r.rm){var u=Ei.patterns.match_("{(...)}",r.rm||"");u&&u.remainder===""?o=Ei.go(u.match_,"pu"):o={type_:"rm",p1:r.rm}}for(var f in r)delete r[f];return o}}},"pu-9,9":{transitions:Ei.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(r){var o=[];if(r.text_=r.text_||"",r.text_.length>4){var u=r.text_.length%3;u===0&&(u=3);for(var f=r.text_.length-3;f>0;f-=3)o.push(r.text_.substr(f,3)),o.push({type_:"1000 separator"});o.push(r.text_.substr(0,u)),o.reverse()}else o.push(r.text_);for(var g in r)delete r[g];return o},"output-o":function(r){var o=[];if(r.text_=r.text_||"",r.text_.length>4){for(var u=r.text_.length-3,f=0;f<u;f+=3)o.push(r.text_.substr(f,3)),o.push({type_:"1000 separator"});o.push(r.text_.substr(f))}else o.push(r.text_);for(var g in r)delete r[g];return o}}}};var Bl={go:function(r,o){if(!r)return"";for(var u="",f=!1,g=0;g<r.length;g++){var b=r[g];typeof b=="string"?u+=b:(u+=Bl._go2(b),b.type_==="1st-level escape"&&(f=!0))}return!o&&!f&&u&&(u="{"+u+"}"),u},_goInner:function(r){return r&&Bl.go(r,!0)},_go2:function(r){var o;switch(r.type_){case"chemfive":o="";var u={a:Bl._goInner(r.a),b:Bl._goInner(r.b),p:Bl._goInner(r.p),o:Bl._goInner(r.o),q:Bl._goInner(r.q),d:Bl._goInner(r.d)};u.a&&(u.a.match(/^[+\-]/)&&(u.a="{"+u.a+"}"),o+=u.a+"\\,"),(u.b||u.p)&&(o+="{\\vphantom{X}}",o+="^{\\hphantom{"+(u.b||"")+"}}_{\\hphantom{"+(u.p||"")+"}}",o+="{\\vphantom{X}}",o+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(u.b||"")+"}}",o+="_{\\vphantom{2}\\llap{\\smash[t]{"+(u.p||"")+"}}}"),u.o&&(u.o.match(/^[+\-]/)&&(u.o="{"+u.o+"}"),o+=u.o),r.dType==="kv"?((u.d||u.q)&&(o+="{\\vphantom{X}}"),u.d&&(o+="^{"+u.d+"}"),u.q&&(o+="_{\\smash[t]{"+u.q+"}}")):r.dType==="oxidation"?(u.d&&(o+="{\\vphantom{X}}",o+="^{"+u.d+"}"),u.q&&(o+="{\\vphantom{X}}",o+="_{\\smash[t]{"+u.q+"}}")):(u.q&&(o+="{\\vphantom{X}}",o+="_{\\smash[t]{"+u.q+"}}"),u.d&&(o+="{\\vphantom{X}}",o+="^{"+u.d+"}"));break;case"rm":o="\\mathrm{"+r.p1+"}";break;case"text":r.p1.match(/[\^_]/)?(r.p1=r.p1.replace(" ","~").replace("-","\\text{-}"),o="\\mathrm{"+r.p1+"}"):o="\\text{"+r.p1+"}";break;case"roman numeral":o="\\mathrm{"+r.p1+"}";break;case"state of aggregation":o="\\mskip2mu "+Bl._goInner(r.p1);break;case"state of aggregation subscript":o="\\mskip1mu "+Bl._goInner(r.p1);break;case"bond":if(o=Bl._getBond(r.kind_),!o)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+r.kind_+")"];break;case"frac":var f="\\frac{"+r.p1+"}{"+r.p2+"}";o="\\mathchoice{\\textstyle"+f+"}{"+f+"}{"+f+"}{"+f+"}";break;case"pu-frac":var g="\\frac{"+Bl._goInner(r.p1)+"}{"+Bl._goInner(r.p2)+"}";o="\\mathchoice{\\textstyle"+g+"}{"+g+"}{"+g+"}{"+g+"}";break;case"tex-math":o=r.p1+" ";break;case"frac-ce":o="\\frac{"+Bl._goInner(r.p1)+"}{"+Bl._goInner(r.p2)+"}";break;case"overset":o="\\overset{"+Bl._goInner(r.p1)+"}{"+Bl._goInner(r.p2)+"}";break;case"underset":o="\\underset{"+Bl._goInner(r.p1)+"}{"+Bl._goInner(r.p2)+"}";break;case"underbrace":o="\\underbrace{"+Bl._goInner(r.p1)+"}_{"+Bl._goInner(r.p2)+"}";break;case"color":o="{\\color{"+r.color1+"}{"+Bl._goInner(r.color2)+"}}";break;case"color0":o="\\color{"+r.color+"}";break;case"arrow":var b={rd:Bl._goInner(r.rd),rq:Bl._goInner(r.rq)},M=Bl._getArrow(r.r);b.rd||b.rq?r.r==="<=>"||r.r==="<=>>"||r.r==="<<=>"||r.r==="<-->"?(M="\\long"+M,b.rd&&(M="\\overset{"+b.rd+"}{"+M+"}"),b.rq&&(r.r==="<-->"?M="\\underset{\\lower2mu{"+b.rq+"}}{"+M+"}":M="\\underset{\\lower6mu{"+b.rq+"}}{"+M+"}"),M=" {}\\mathrel{"+M+"}{} "):(b.rq&&(M+="[{"+b.rq+"}]"),M+="{"+b.rd+"}",M=" {}\\mathrel{\\x"+M+"}{} "):M=" {}\\mathrel{\\long"+M+"}{} ",o=M;break;case"operator":o=Bl._getOperator(r.kind_);break;case"1st-level escape":o=r.p1+" ";break;case"space":o=" ";break;case"entitySkip":o="~";break;case"pu-space-1":o="~";break;case"pu-space-2":o="\\mkern3mu ";break;case"1000 separator":o="\\mkern2mu ";break;case"commaDecimal":o="{,}";break;case"comma enumeration L":o="{"+r.p1+"}\\mkern6mu ";break;case"comma enumeration M":o="{"+r.p1+"}\\mkern3mu ";break;case"comma enumeration S":o="{"+r.p1+"}\\mkern1mu ";break;case"hyphen":o="\\text{-}";break;case"addition compound":o="\\,{\\cdot}\\,";break;case"electron dot":o="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":o="{\\times}";break;case"prime":o="\\prime ";break;case"cdot":o="\\cdot ";break;case"tight cdot":o="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":o="\\times ";break;case"circa":o="{\\sim}";break;case"^":o="uparrow";break;case"v":o="downarrow";break;case"ellipsis":o="\\ldots ";break;case"/":o="/";break;case" / ":o="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return o},_getArrow:function(r){switch(r){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(r){switch(r){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(r){switch(r){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function Id(r){}function zv(r){}var Hp=class S2 extends ae{constructor(o){super(F(ot({},o),{type:"delim"})),this.value=o.delim,this.size=o.size}static fromJson(o){return new S2(o)}toJson(){return F(ot({},super.toJson()),{delim:this.value,size:this.size})}render(o){return new Je(this.value,{type:"middle"})}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=Fr(this.command,this.mode);return u!=null&&u.serialize?u.serialize(this,o):jn(this.command,this.value)}},rp=class M2 extends ae{constructor(o){super(F(ot({},o),{type:"sizeddelim",value:o.delim})),this.delimType=o.delimType,this.size=o.size}static fromJson(o){return new M2(o)}toJson(){return F(ot({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(o){let u=oe(this.value,this.size,o,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return u?(u=this.bind(o,u),this.caret&&(u.caret=this.caret),u):null}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=Fr(this.command,this.mode);return u!=null&&u.serialize?u.serialize(this,o):jn(this.command,this.value)}},vf=class C2 extends ae{constructor(o,u,f,g){var b,M;super({type:"enclose",command:o,style:g.style}),this.body=u,this.backgroundcolor=g.backgroundcolor,f.updiagonalarrow&&(f.updiagonalstrike=!1),f.box&&(f.left=!1,f.right=!1,f.bottom=!1,f.top=!1),this.notation=f,this.shadow=(b=g.shadow)!=null?b:"none",this.strokeWidth=(M=g.strokeWidth)!=null?M:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=g.strokeStyle,this.svgStrokeStyle=g.svgStrokeStyle,this.strokeColor=g.strokeColor,this.borderStyle=g.borderStyle,this.padding=g.padding,this.captureSelection=!1}static fromJson(o){return new C2(o.command,o.body,o.notation,o)}toJson(){return F(ot({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(o){var u;if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const f=Fr(this.command,this.mode);if(f!=null&&f.serialize)return f.serialize(this,o);let g=(u=this.command)!=null?u:"";if(this.command==="\\enclose"){g+="{"+Object.keys(this.notation).join(" ")+"}";let b="",M="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(b+=M+'mathbackground="'+this.backgroundcolor+'"',M=","),this.shadow&&this.shadow!=="auto"&&(b+=M+'shadow="'+this.shadow+'"',M=","),this.strokeWidth||this.strokeStyle!=="solid"?(b+=M+this.borderStyle,M=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(b+=M+'mathcolor="'+this.strokeColor+'"',M=","),b&&(g+=`[${b}]`)}return jn(g,this.bodyToLatex(o))}render(o){const u=new Nn({parent:o},this.style),f=ae.createBox(u,this.body);if(!f)return null;const g=sp(this.borderStyle),b=u.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});f.setStyle("position","relative"),f.setStyle("display","inline-block"),f.setStyle("top",b,"em"),f.setStyle("height",f.height+f.depth,"em"),f.setStyle("width",f.width,"em");const M=new Je(null,{classes:"ML__notation"});let N=f.height+f.depth+2*b;const I=f.width+2*b;let B="";if(this.notation.horizontalstrike&&(B+=this.line(3,50,97,50)),this.notation.verticalstrike&&(B+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(B+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(B+=this.line(3,3,97,97)),this.notation.updiagonalarrow){B+=this.line(b.toString(),(b+f.depth+f.height).toString(),(b+f.width).toString(),b.toString());const jt=.03*Math.sqrt(I*I+N*N)*1,je=f.width*jt,Zi=(f.depth+f.height)*jt,Le=b+f.width;let Ci=b;Ci+Zi-.4*je<0&&(Ci=.4*je-Zi),B+='<polygon points="',B+=`${Le},${Ci} ${Le-je-.4*Zi},${Ci+Zi-.4*je} `,B+=`${Le-.7*je},${Ci+.7*Zi} ${Le-je+.4*Zi},${Ci+Zi+.4*je} `,B+=`${Le},${Ci}`,B+=`" stroke='none' fill="${this.strokeColor}"`,B+="/>"}let U=0;if(this.notation.phasorangle){const Lt=tf(u),Bt=(f.height+f.depth+2*Lt+b).toString(),jt=(f.height+f.depth)/2;B+=this.line(b.toString(),Bt,(b+jt+f.width).toString(),Bt),B+=this.line(b.toString(),Bt,(b+jt).toString(),(b-Lt).toString()),N+=Lt,U=jt,f.left+=N/2-b}if(this.notation.longdiv){const Lt=tf(u);N+=Lt,B+=this.line(b.toString(),b.toString(),(b+f.width).toString(),b.toString());const Bt=.3;U=Bt+Lt,f.left+=Bt+Lt,f.setTop(b+Lt),B+='<path d="',B+=`M ${b} ${b} a${Bt} ${(f.depth+f.height+2*Lt)/2}, 0, 1, 1, 0 ${f.depth+f.height+2*Lt} "`,B+=` stroke-width="${Vp(u)}" stroke="${this.strokeColor}" fill="none"`,B+="/>"}if(M.width=f.width+2*b+U,M.height=f.height+b,M.depth=f.depth+b,M.setStyle("box-sizing","border-box"),M.setStyle("left",`calc(-${g} / 2 )`),M.setStyle("height",`${Math.floor(100*N)/100}em`),M.setStyle("top",`calc(${g} / 2 )`),this.backgroundcolor&&M.setStyle("background-color",this.backgroundcolor),this.notation.box&&M.setStyle("border","1px solid red"),this.notation.actuarial&&(M.setStyle("border-top",this.borderStyle),M.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(M.setStyle("border-bottom",this.borderStyle),M.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(M.setStyle("border-radius","8px"),M.setStyle("border",this.borderStyle)),this.notation.circle&&(M.setStyle("border-radius","50%"),M.setStyle("border",this.borderStyle)),this.notation.top&&M.setStyle("border-top",this.borderStyle),this.notation.left&&M.setStyle("border-left",this.borderStyle),this.notation.right&&M.setStyle("border-right",this.borderStyle),this.notation.bottom&&M.setStyle("border-bottom",this.borderStyle),B){let Lt="";this.shadow==="auto"&&(Lt+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(Lt+=`filter: drop-shadow(${this.shadow})`),Lt+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,Lt+=' stroke-linecap="round"',this.svgStrokeStyle&&(Lt+=` stroke-dasharray="${this.svgStrokeStyle}"`),M.svgStyle=Lt,M.svgOverlay=B}const lt=new Je([M,f]);return lt.setStyle("position","relative"),lt.setStyle("vertical-align",b,"em"),lt.setStyle("height",`${Math.floor(100*(f.height+f.depth+2*b))/100}em`),lt.setStyle("display","inline-block"),lt.height=M.height,lt.depth=M.depth,lt.width=M.width-2*b,lt.left=b,lt.right=b,this.caret&&(lt.caret=this.caret),lt.wrap(u)}line(o,u,f,g){return`<line x1="${op(o)}" y1="${op(u)}" x2="${op(f)}" y2="${op(g)}" vector-effect="non-scaling-stroke"></line>`}};function op(r){return typeof r=="number"?`${Math.floor(100*r)/100}%`:r}function sp(r){if(!r)return"1px";const o=r.match(/([0-9][a-zA-Z\%]+)/);return o===null?"1px":o[1]}function Vp(r){return(Math.floor(100*r.metrics.sqrtRuleThickness/r.scalingFactor)/100/10).toString()+"em"}function tf(r){const o=r.isDisplayStyle?Bi:r.metrics.defaultRuleThickness;return r.metrics.defaultRuleThickness+r.scalingFactor*o/4}var Fu=class k2 extends ae{constructor(o,u,f){var g,b;super(F(ot({},f),{type:"genfrac",displayContainsHighlight:!0})),this.above=o,this.below=u,this.hasBarLine=(g=f==null?void 0:f.hasBarLine)!=null?g:!0,this.continuousFraction=(b=f==null?void 0:f.continuousFraction)!=null?b:!1,this.numerPrefix=f==null?void 0:f.numerPrefix,this.denomPrefix=f==null?void 0:f.denomPrefix,this.mathstyleName=f==null?void 0:f.mathstyleName,this.leftDelim=f==null?void 0:f.leftDelim,this.rightDelim=f==null?void 0:f.rightDelim,this.fractionNavigationOrder=f==null?void 0:f.fractionNavigationOrder}static fromJson(o){return new k2(o.above,o.below,o)}toJson(){const o={};return this.continuousFraction&&(o.continuousFraction=!0),this.numerPrefix&&(o.numerPrefix=this.numerPrefix),this.denomPrefix&&(o.denomPrefix=this.denomPrefix),this.leftDelim&&(o.leftDelim=this.leftDelim),this.rightDelim&&(o.rightDelim=this.rightDelim),this.hasBarLine||(o.hasBarLine=!1),this.mathstyleName&&(o.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(o.fractionNavigationOrder=this.fractionNavigationOrder),ot(ot({},super.toJson()),o)}get children(){if(this._children)return this._children;const o=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const u of this.below)o.push(...u.children),o.push(u);for(const u of this.above)o.push(...u.children),o.push(u)}else{for(const u of this.above)o.push(...u.children),o.push(u);for(const u of this.below)o.push(...u.children),o.push(u)}return this._children=o,o}render(o){var u,f;const g=new Nn({parent:o,mathstyle:this.mathstyleName},this.style),b=g.metrics,M=new Nn({parent:g,mathstyle:this.continuousFraction?"":"numerator"},this.style),N=this.numerPrefix?new Je([new Je(this.numerPrefix),ae.createBox(M,this.above)],{isTight:M.isTight,type:"ignore"}):(u=ae.createBox(M,this.above,{type:"ignore"}))!=null?u:new Je(null,{type:"ignore"}),I=new Nn({parent:g,mathstyle:this.continuousFraction?"":"denominator"},this.style),B=this.denomPrefix?new Je([new Je(this.denomPrefix),ae.createBox(I,this.below,{type:"ignore"})]):(f=ae.createBox(I,this.below,{type:"ignore"}))!=null?f:new Je(null,{type:"ignore"}),U=this.hasBarLine?b.defaultRuleThickness:0;let lt,Lt=0,Bt;g.isDisplayStyle?(lt=M.metrics.num1,Lt=U>0?3*U:7*U,Bt=I.metrics.denom1):(U>0?(lt=M.metrics.num2,Lt=U):(lt=M.metrics.num3,Lt=3*b.defaultRuleThickness),Bt=I.metrics.denom2);const jt=[];this.isSelected&&jt.push("ML__selected");const je=N.depth,Zi=B.height;let Le;if(U<=0){const Er=lt-je-(Zi-Bt);Er<Lt&&(lt+=(Lt-Er)/2,Bt+=(Lt-Er)/2),Le=new Gr({individualShift:[{box:N,shift:-lt,classes:[...jt,"ML__center"]},{box:B,shift:Bt,classes:[...jt,"ML__center"]}]}).wrap(g)}else{const Er=new Je(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Er.softWidth=Math.max(N.width,B.width),Er.height=U/2,Er.depth=U/2;const ta=ri+U/2;lt<Lt+je+ta&&(lt=Lt+je+ta);const wl=ri-U/2;Bt<Lt+Zi-wl&&(Bt=Lt+Zi-wl),Le=new Gr({individualShift:[{box:B,shift:Bt,classes:[...jt,"ML__center"]},{box:Er,shift:-wl,classes:jt},{box:N,shift:-lt,classes:[...jt,"ML__center"]}]}).wrap(g)}const Ci=g.isDisplayStyle?b.delim1:b.delim2,en=this.leftDelim?this.bind(o,Bn("open",this.leftDelim,Ci,!0,o,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Vn(g,"open");let Oi=null;this.continuousFraction?Oi=new Je(null,{type:"close"}):this.rightDelim?Oi=this.bind(o,Bn("close",this.rightDelim,Ci,!0,o,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Oi=Vn(g,"close");const hr=new Je([en,Le,Oi],{isTight:g.isTight,type:"inner",classes:"mfrac"}),Jr=this.bind(o,hr);return this.caret&&(Jr.caret=this.caret),this.attachSupsub(o,{base:Jr})}},bh=class E2 extends ae{constructor(o,u){var f;super({type:"latex",value:o,mode:"latex"}),this.isSuggestion=(f=u==null?void 0:u.isSuggestion)!=null?f:!1,this.isError=!1}static fromJson(o){const u=new E2(o.value);return o.isSuggestion&&(u.isSuggestion=!0),o.isError&&(u.isError=!0),u}toJson(){const o={};return this.isSuggestion&&(o.isSuggestion=!0),this.isError&&(o.isError=!0),ot({type:"latex",value:this.value},o)}get computedStyle(){return{}}render(o){const u=new Je(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return u?(this.caret&&(u.caret=this.caret),this.bind(o,u)):null}},T0=class L2 extends ae{constructor(o){super({type:"latexgroup",mode:"latex"}),this.body=[...o].map(u=>new bh(u)),this.skipBoundary=!1}static fromJson(o){return new L2("")}toJson(){return super.toJson()}render(o){const u=ae.createBox(o,this.body);return u?(this.caret&&(u.caret=this.caret),this.bind(o,u)):null}_serialize(o){var u,f;return(f=(u=this.body)==null?void 0:u.map(g=>g.value).join(""))!=null?f:""}},Sg=class T2 extends ae{constructor(o,u){super(F(ot({},u),{type:"extensible-symbol",isFunction:u==null?void 0:u.isFunction})),this.value=o,this.variant=u==null?void 0:u.variant,this.subsupPlacement=u==null?void 0:u.limits}static fromJson(o){return new T2(o.symbol,o)}toJson(){const o=super.toJson();return this.variant&&(o.variant=this.variant),this.subsupPlacement&&(o.limits=this.subsupPlacement),this.isExtensibleSymbol&&(o.isExtensibleSymbol=!0),this.value&&(o.symbol=this.value),o}render(o){var u;const f=o.isDisplayStyle&&this.value!=="\\smallint",g=new Je(this.value,{fontFamily:f?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(f?"large-op":"small-op"),type:"op",maxFontSize:o.scalingFactor,isSelected:this.isSelected});if(!g)return null;g.right=g.italic;const b=(g.height-g.depth)/2-ri*o.scalingFactor,M=g.italic;g.setTop(b);let N=g;if(this.superscript||this.subscript){const I=(u=this.subsupPlacement)!=null?u:"auto";N=I==="over-under"||I==="auto"&&o.isDisplayStyle?this.attachLimits(o,{base:g,baseShift:b,slant:M}):this.attachSupsub(o,{base:g})}return new Je(this.bind(o,N),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(o)}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=Fr(this.command,this.mode);if(u!=null&&u.serialize)return u.serialize(this,o);const f=[];return f.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&f.push("\\limits"),this.subsupPlacement==="adjacent"&&f.push("\\nolimits"),this.subsupPlacement==="auto"&&f.push("\\displaylimits")),f.push(this.supsubToLatex(o)),Mn(f)}},Rf=class _2 extends ae{constructor(o){const u=o.body;super(F(ot({},o),{type:"overlap",body:typeof u=="string"?[new ae({value:u})]:u,style:o==null?void 0:o.style})),this.skipBoundary=!0,this.align=o==null?void 0:o.align,this.boxType=o==null?void 0:o.boxType}static fromJson(o){return new _2(o)}toJson(){const o={};return this.align&&(o.align=this.align),this.boxType&&(o.boxType=this.boxType),ot(ot({},super.toJson()),o)}render(o){const u=ae.createBox(o,this.body,{classes:"inner"});return u?(this.caret&&(u.caret=this.caret),this.bind(o,new Je([u,new Je(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},ef=class P2 extends ae{constructor(o){var u,f,g,b;super({type:"overunder",command:o.command,style:o.style,mode:o.mode,body:o.body,skipBoundary:(u=o.skipBoundary)!=null?u:!0}),this.subsupPlacement=o.supsubPlacement,this.svgAbove=o.svgAbove,this.svgBelow=o.svgBelow,this.svgBody=o.svgBody,this.above=o.above,this.below=o.below,this.boxType=(f=o.boxType)!=null?f:"ord",this.paddedBody=(g=o.paddedBody)!=null?g:!1,this.paddedLabels=(b=o.paddedLabels)!=null?b:!1}static fromJson(o){return new P2(o)}toJson(){const o=super.toJson();return this.skipBoundary||(o.skipBoundary=!1),this.subsupPlacement&&(o.subsupPlacement=this.subsupPlacement),this.svgAbove&&(o.svgAbove=this.svgAbove),this.svgBelow&&(o.svgBelow=this.svgBelow),this.svgBody&&(o.svgBody=this.svgBody),this.boxType!=="ord"&&(o.boxType=this.boxType),this.paddedBody&&(o.paddedBody=!0),this.paddedLabels&&(o.paddedLabels=!0),o}render(o){let u=this.svgBody?Rn(this.svgBody):ae.createBox(o,this.body,{type:"ignore"});const f=new Nn({parent:o,mathstyle:"scriptstyle"},this.style);let g=null;this.svgAbove?g=Rn(this.svgAbove):this.above&&(g=ae.createBox(f,this.above,{type:"ignore"}));let b=null;this.svgBelow?b=Rn(this.svgBelow):this.below&&(b=ae.createBox(f,this.below,{type:"ignore"})),this.paddedBody&&(u=new Je([Vn(o,"open"),u,Vn(o,"close")],{type:"ignore"}));let M=Xy(o,{base:u,above:g,below:b,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return M?(this.subsupPlacement==="over-under"?M=this.attachLimits(o,{base:M,type:M.type}):M=this.attachSupsub(o,{base:M}),this.caret&&(M.caret=this.caret),this.bind(o,M)):null}};function Xy(r,o){if(!o.base)return null;if(!o.above&&!o.below){const N=new Je(o.base,{type:o.type});return N.setStyle("position","relative"),N}let u=0;o.above&&(u=r.metrics.bigOpSpacing5);let f=null;const g=o.base,b=0,M=["ML__center"];if(o.paddedAboveBelow&&M.push("ML__label_padding"),o.below&&o.above){const N=r.metrics.bigOpSpacing5+o.below.height+o.below.depth+g.depth+b;f=new Gr({bottom:N,children:[r.metrics.bigOpSpacing5,{box:o.below,classes:M},{box:g,classes:["ML__center"]},u,{box:o.above,classes:M},r.metrics.bigOpSpacing5]})}else o.below?f=new Gr({top:g.height-b,children:[r.metrics.bigOpSpacing5,{box:o.below,classes:M},{box:g,classes:["ML__center"]}]}):o.above&&(f=new Gr({bottom:g.depth+b,children:[{box:g,classes:["ML__center"]},u,{box:o.above,classes:M},r.metrics.bigOpSpacing5]}));return new Je(f,{type:o.type})}var _0=class N2 extends ae{constructor(o){var u,f,g,b;super(F(ot({},o),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(u=o.isInvisible)!=null?u:!1,this.smashDepth=(f=o.smashDepth)!=null?f:!1,this.smashHeight=(g=o.smashHeight)!=null?g:!1,this.smashWidth=(b=o.smashWidth)!=null?b:!1}static fromJson(o){return new N2(o)}toJson(){const o={};return this.isInvisible&&(o.isInvisible=!0),this.smashDepth&&(o.smashDepth=!0),this.smashHeight&&(o.smashHeight=!0),this.smashWidth&&(o.smashWidth=!0),ot(ot({},super.toJson()),o)}render(o){const u=new Nn({parent:o,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),ae.createBox(u,this.body,{classes:"inner"});const f=ae.createBox(this.isInvisible?u:o,this.body);if(!f)return null;if(this.smashWidth){const g=new Je(null,{classes:"fix"});return new Je([f,g],{classes:"rlap"}).wrap(o)}if(!this.smashHeight&&!this.smashDepth)return f;if(this.smashHeight&&(f.height=0),this.smashDepth&&(f.depth=0),f.children)for(const g of f.children)this.smashHeight&&(g.height=0),this.smashDepth&&(g.depth=0);return new Gr({firstBaseline:[{box:f}]},{type:f.type}).wrap(o)}},Wp=class A2 extends ae{constructor(o){var u;super(ot({type:"spacing"},o)),this.width=o==null?void 0:o.width,this._braced=(u=o==null?void 0:o.braced)!=null?u:!1}static fromJson(o){return new A2(o)}toJson(){const o=super.toJson();return this.width!==void 0&&(o.width=this.width),this._braced&&(o.braced=!0),o}render(o){var u;if(this.command==="space")return new Je(this.mode==="math"?null:" ");let f;if(this.width!==void 0)f=new Je(null,{classes:"mspace"}),f.left=o.toEm(this.width);else{const g=(u={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?u:"mediumspace";f=new Je(null,{classes:g})}return f=this.bind(o,f),this.caret&&(f.caret=this.caret),f}_serialize(o){var u;if(!o.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const f=Fr(this.command,this.mode);if(f!=null&&f.serialize)return f.serialize(this,o);const g=(u=this.command)!=null?u:"";return this.width===void 0?g:this._braced&&!("register"in this.width)?`${g}{${Ts(this.width)}}`:`${g}${Ts(this.width)}`}},P0=class D2 extends ae{constructor(o){var u;super(F(ot({},o),{type:"surd",mode:(u=o.mode)!=null?u:"math",style:o.style,displayContainsHighlight:!0,body:o.body})),this.above=o.index}static fromJson(o){return new D2(F(ot({},o),{index:o.above}))}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=Fr(this.command,this.mode);if(u!=null&&u.serialize)return u.serialize(this,o);const f=this.command,g=this.bodyToLatex(o);return this.above&&!this.hasEmptyBranch("above")?jn(`${f}[${this.aboveToLatex(o)}]`,g):/^[0-9]$/.test(g)?`${f}${g}`:jn(f,g)}get children(){if(this._children)return this._children;const o=[];if(this.above)for(const u of this.above)o.push(...u.children),o.push(u);if(this.body)for(const u of this.body)o.push(...u.children),o.push(u);return this._children=o,o}render(o){var u;const f=new Nn({parent:o,mathstyle:"cramp"},this.style),g=(u=ae.createBox(f,this.body,{type:"inner"}))!=null?u:new Je(null),b=f.scalingFactor,M=f.metrics.defaultRuleThickness/b,N=o.isDisplayStyle?Bi:M,I=new Je(null,{classes:"ML__sqrt-line",style:this.style});I.height=M,I.softWidth=g.width;let B=b*(M+N/4);const lt=Math.max(b*2*N,g.height+g.depth)+B+M,Lt=new Nn({parent:o},this.style),Bt=this.bind(Lt,new Je(Bn("inner","\\surd",lt,!1,Lt,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!Bt)return null;const jt=Bt.height+Bt.depth-M;jt>g.height+g.depth+B&&(B=(B+jt-(g.height+g.depth))/2),Bt.setTop(Bt.height-g.height-B);const je=this.bind(o,new Gr({firstBaseline:[{box:new Je(g)},B-2*M,{box:I},M]})),Zi=ae.createBox(new Nn({parent:o,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!Zi){const en=new Je([Bt,je],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return en.setStyle("display","inline-block"),en.setStyle("height",en.height+en.depth,"em"),this.caret&&(en.caret=this.caret),this.bind(o,en)}const Le=new Gr({shift:-.6*(Math.max(Bt.height,je.height)-Math.max(Bt.depth,je.depth)),children:[{box:Zi}]}),Ci=new Je([new Je(Le,{classes:"ML__sqrt-index",type:"ignore"}),Bt,je],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return Ci.height=Bt.height,Ci.depth=Bt.depth,this.caret&&(Ci.caret=this.caret),this.bind(o,Ci)}},Mg=class extends Je{constructor(r){super(null,{type:"skip"}),this._width=r}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function Fc(r,o){if(!r.parent)return;const u=r.parent.children,f=u.indexOf(r);let g=f-1;for(;g>=0&&u[g].type==="ignore";)g-=1;if(g<0&&r.parent.parent&&r.parent.type==="lift"){Fc(r.parent,o);return}f>0&&u[f-1].type==="skip"?u[f-1].width+=o:u.splice(f,0,new Mg(o))}var qf={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},Cg={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function Pc(r){bm(r,(o,u)=>{u.type==="bin"&&(!o||/^(middle|bin|op|rel|open|punct)$/.test(o.type))&&(u.type="ord"),(o==null?void 0:o.type)==="bin"&&/^(rel|close|punct)$/.test(u.type)&&(o.type="ord"),u.type!=="ignore"&&(o=u)})}function Bf(r,o){if(!r.children)return r;const u=r.children;Pc(u);const f=o.getRegisterAsEm("thinmuskip"),g=o.getRegisterAsEm("medmuskip"),b=o.getRegisterAsEm("thickmuskip");return bm(u,(M,N)=>{var I,B,U;if(!M)return;const lt=M.type,Lt=N.isTight?(I=Cg[lt])!=null?I:null:(B=qf[lt])!=null?B:null,Bt=(U=Lt==null?void 0:Lt[N.type])!=null?U:null;Bt===3&&Fc(N,f),Bt===4&&Fc(N,g),Bt===5&&Fc(N,b)}),r}function bm(r,o,u=void 0){if(!r)return u;r=[...r];for(const f of r)f.type==="lift"?u=bm(f.children,o,u):f.type==="ignore"?bm(f.children,o):(o(u,f),bm(f.children,o),u=f);return u}var Up=class I2 extends ae{constructor(o){super({type:"tooltip",command:o.command,mode:o.mode,style:o.style,body:o.body,displayContainsHighlight:!0}),this.tooltip=new ae({type:"root",mode:o.content,body:o.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(o){return new I2(F(ot({},o),{tooltip:Od(o.tooltip)}))}toJson(){var o;const u=(o=this.tooltip.body)==null?void 0:o.filter(f=>f.type!=="first").map(f=>f.toJson());return F(ot({},super.toJson()),{tooltip:u})}render(o){const u=ae.createBox(new Nn,this.body);if(!u)return null;const f=new Nn({parent:o,mathstyle:"displaystyle"},{fontSize:Hi}),g=wn(Bf(new Je(this.tooltip.render(f),{classes:"ML__tooltip-content"}),f)),b=new Je([g,u],{classes:"ML__tooltip-container"});return this.caret&&(b.caret=this.caret),this.bind(o,b)}},Br=class O2 extends ae{constructor(o,u){super(F(ot({},u),{type:"operator",isFunction:u==null?void 0:u.isFunction})),this.value=o,this.variant=u==null?void 0:u.variant,this.variantStyle=u==null?void 0:u.variantStyle,this.subsupPlacement=u==null?void 0:u.limits}static fromJson(o){return new O2(o.symbol,o)}toJson(){const o=super.toJson();return this.variant&&(o.variant=this.variant),this.variantStyle&&(o.variantStyle=this.variantStyle),this.subsupPlacement&&(o.limits=this.subsupPlacement),this.value&&(o.symbol=this.value),o}render(o){var u;const f=new Je(this.value,{type:"op",mode:"math",maxFontSize:o.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:o.letterShapeStyle});let g=f;if(this.superscript||this.subscript){const b=(u=this.subsupPlacement)!=null?u:"auto";g=b==="over-under"||b==="auto"&&o.isDisplayStyle?this.attachLimits(o,{base:f}):this.attachSupsub(o,{base:f})}return new Je(this.bind(o,g),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(o)}_serialize(o){if(!(o.expandMacro||o.skipStyles||o.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const u=Fr(this.command,this.mode);if(u!=null&&u.serialize)return u.serialize(this,o);const f=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&f.push("\\limits"),this.subsupPlacement==="adjacent"&&f.push("\\nolimits"),this.subsupPlacement==="auto"&&f.push("\\displaylimits")),f.push(this.supsubToLatex(o)),Mn(f)}};function Od(r){if(ne(r))return r.map(f=>Od(f));if(typeof r=="string")return ae.fromJson(r);r=ot({},r);for(const f of Yr)r[f]&&(r[f]=Od(r[f]));r.args&&(r.args=Yy(r.args)),r.array&&(r.array=Od(r.array));const o=r.type;let u;o==="accent"&&(u=d.fromJson(r)),o==="array"&&(u=ts.fromJson(r)),o==="box"&&(u=Rl.fromJson(r)),o==="chem"&&(u=Fv.fromJson(r)),o==="composition"&&(u=Qu.fromJson(r)),o==="delim"&&(u=Hp.fromJson(r)),o==="enclose"&&(u=vf.fromJson(r)),o==="error"&&(u=wh.fromJson(r)),o==="extensible-symbol"&&(u=Sg.fromJson(r)),o==="genfrac"&&(u=Fu.fromJson(r)),o==="group"&&(u=_l.fromJson(r)),o==="latex"&&(u=bh.fromJson(r)),o==="latexgroup"&&(u=T0.fromJson(r)),o==="leftright"&&(u=wa.fromJson(r)),o==="macro"&&(u=np.fromJson(r)),o==="macro-argument"&&(u=_c.fromJson(r)),o==="operator"&&(u=Br.fromJson(r)),o==="overlap"&&(u=Rf.fromJson(r)),o==="overunder"&&(u=ef.fromJson(r)),o==="placeholder"&&(u=Hr.fromJson(r)),o==="prompt"&&(u=Gh.fromJson(r)),o==="phantom"&&(u=_0.fromJson(r)),o==="sizeddelim"&&(u=rp.fromJson(r)),o==="spacing"&&(u=Wp.fromJson(r)),o==="subsup"&&(u=lh.fromJson(r)),o==="surd"&&(u=P0.fromJson(r)),o==="text"&&(u=Wl.fromJson(r)),o==="tooltip"&&(u=Up.fromJson(r)),u||(console.assert(!o||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(o),`MathLive 0.98.5: an unexpected atom type "${o}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),u=ae.fromJson(r));for(const f of Yr)r[f]&&u.setChildren(r[f],f);return r.verbatimLatex!==void 0&&(u.verbatimLatex=r.verbatimLatex),r.subsupPlacement&&(u.subsupPlacement=r.subsupPlacement),r.explicitSubsupPlacement&&(u.explicitSubsupPlacement=!0),r.isFunction&&(u.isFunction=!0),r.isExtensibleSymbol&&(u.isExtensibleSymbol=!0),r.skipBoundary&&(u.skipBoundary=!0),r.captureSelection&&(u.captureSelection=!0),u}function Yy(r){if(r&&Array.isArray(r))return r.map(o=>o==="<null>"?null:typeof o=="object"&&"group"in o?{group:o.group.map(u=>Od(u))}:typeof o=="object"&&"atoms"in o?o.atoms.map(u=>Od(u)):o)}var kg={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},ap={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^’‘]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},Zp=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,Qf=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,$v=[/^[a-z]$/,/^[A-Z]$/,Zp,Qf],jv={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},Kv=class extends Pn{constructor(){super("math")}createAtom(r,o,u){var f,g,b,M;if(o===null)return new ae({type:"mord",mode:"math",command:r,value:r,style:u});const N=window.MathfieldElement.isFunction((f=o.command)!=null?f:r);if(o.definitionType==="symbol"){const B=new ae({type:(g=o.type)!=null?g:"mord",mode:"math",command:(b=o.command)!=null?b:r,value:String.fromCodePoint(o.codepoint),style:u});return N&&(B.isFunction=!0),r.startsWith("\\")&&(B.verbatimLatex=r),B}const I=new ae({type:"mord",mode:"math",command:(M=o.command)!=null?M:r,value:r,style:u});return N&&(I.isFunction=!0),r.startsWith("\\")&&(I.verbatimLatex=r),I}serialize(r,o){const u=Hv(r,F(ot({},o),{defaultMode:"math"}));return u.length===0||o.defaultMode!=="text"?u:["$ ",...u," $"]}getFont(r,o){console.assert(o.variant!==void 0);let{variant:u}=o,{variantStyle:f}=o;u==="normal"&&!f&&/[\u00A3\u0131\u0237]/.test(r.value)&&(u="main",f="italic"),u==="normal"&&!f&&r.value.length===1&&$v.forEach((N,I)=>{var B;N.test(r.value)&&jv[(B=o.letterShapeStyle)!=null?B:"tex"][I]==="it"&&(f="italic")}),f==="up"&&(f=void 0);const g=f?u+"-"+f:u;console.assert(kg[g]!==void 0);const[b,M]=kg[g];return ap[u]&&!ap[u].test(r.value)?(r.value=hi(r.value,u,f),null):(Zp.test(r.value)&&(r.classes+=" lcGreek"),M&&(r.classes+=" "+M),b)}};function Hv(r,o){const{parent:u}=r[0],f=Vv(u);return tn(r,"variant").map(g=>{const b=Vv(g[0]);let M="";b&&b!==f&&(M={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[b],console.assert(M!==void 0));const N=Mn(g.map(I=>I._serialize(o)));return M?jn(M,N):N})}function Vv(r){if(!r)return"";const{style:o}=r;if(o.variant===void 0)return"";let u=o.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(o.variant)&&o.variantStyle&&o.variantStyle!=="up"&&(u+="-"+o.variantStyle),u}new Kv;function Gp(r,o){return r.map(u=>u._serialize(o))}function Wv(r,o){return tn(r,"fontShape").map(u=>{const f=Gp(u,o),{fontShape:g}=u[0].style;let b="";return g==="it"&&(b="\\textit"),g==="sl"&&(b="\\textsl"),g==="sc"&&(b="\\textsc"),g==="n"&&(b="\\textup"),!b&&g?`{${jn("\\fontshape",g)}${Mn(f)}}`:b?jn(b,Mn(f)):Mn(f)})}function Uv(r,o){return tn(r,"fontSeries").map(u=>{const f=Wv(u,o),{fontSeries:g}=u[0].style;let b="";return g==="b"&&(b="\\textbf"),g==="l"&&(b="\\textlf"),g==="m"&&(b="\\textmd"),g&&!b?`{${jn("\\fontseries",g)}${Mn(f)}}`:b?jn(b,Mn(f)):Mn(f)})}function Eg(r,o){return tn(r,"fontSize").map(u=>{var f,g;const b=Uv(u,o),M=(g=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(f=u[0].style.fontSize)!=null?f:""])!=null?g:"";return M?`${M} ${Mn(b)}`:Mn(b)})}function N0(r,o,u){return tn(r,"fontFamily").map(f=>{var g,b;const M=Eg(f,o),N=(b={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(g=f[0].style.fontFamily)!=null?g:""])!=null?b:"";return N?`\\${N}{${Mn(M)}}`:f[0].style.fontFamily?`{\\fontfamily{${f[0].style.fontFamily}} ${Mn(M)}}`:u?`\\text{${Mn(M)}}`:Mn(M)})}var Lg={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},es=class extends Pn{constructor(){super("text")}createAtom(r,o,u){return o&&o.definitionType==="symbol"?new Wl(r,String.fromCodePoint(o.codepoint),u!=null?u:{}):null}serialize(r,o){return N0(r,F(ot({},o),{defaultMode:"text"}),o.defaultMode!=="text")}getFont(r,o){var u,f,g,b,M;const{fontFamily:N}=o;if(Lg[N]?r.classes+=" "+Lg[N]:N&&r.setStyle("font-family",N),o.fontShape&&(r.classes+=" ",r.classes+=(u={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[o.fontShape])!=null?u:""),o.fontSeries){const I=o.fontSeries.match(/(.?[lbm])?(.?[cx])?/);I&&(r.classes+=" ",r.classes+=(g={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(f=I[1])!=null?f:""])!=null?g:"",r.classes+=" ",r.classes+=(M={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(b=I[2])!=null?b:""])!=null?M:"")}return"Main-Regular"}};new es;var Xh=class extends Pn{constructor(){super("latex")}createAtom(r){return new bh(r)}serialize(r,o){return r.filter(u=>u instanceof bh&&!u.isSuggestion).map(u=>u.value)}getFont(){return null}};new Xh;var th={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},nf={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},Xp={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},td={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},ed={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},lc={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},A0={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},D0={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Jy={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},fl={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Tg={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},_g={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Pg={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function Sm(r){const o=r.split("+"),u={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:o.pop()};return o.includes("shift")&&(u.shift=!0),o.includes("alt")&&(u.alt=!0),o.includes("ctrl")&&(u.ctrl=!0),o.includes("cmd")&&(u.cmd=!0),o.includes("win")&&(u.win=!0),o.includes("meta")&&(u.meta=!0),u}function lp(r){let o="";return r.shift&&(o+="shift+"),r.alt&&(o+="alt+"),r.ctrl&&(o+="ctrl+"),r.cmd&&(o+="cmd+"),r.win&&(o+="win+"),r.meta&&(o+="meta+"),o+r.key}var Ng={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},up=[],hp;function I0(){switch(Q()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Nc(r){(!r.platform||r.platform===I0())&&up.push(r)}function Mm(r,o){var u;const f={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!r)return f;for(const[g,b]of Object.entries(o.mapping)){if(b[0]===r)return f.key=`[${g}]`,f;if(b[1]===r)return f.shift=!0,f.key=`[${g}]`,f;if(b[2]===r)return f.alt=!0,f.key=`[${g}]`,f;if(b[3]===r)return f.shift=!0,f.alt=!0,f.key=`[${g}]`,f}return f.key=(u=Ng[r])!=null?u:"",f}function Ag(r){if(r.code)return r;const o=Object.entries(Rd().mapping);let u=!1,f=!1,g="";for(let b=0;b<4;b++){for(const[M,N]of o)if(N[b]===r.key){g=M,b===3?(u=!0,f=!0):b===2?u=!0:b===1&&(f=!0);break}if(g)break}return new KeyboardEvent(r.type,F(ot({},r),{altKey:u,shiftKey:f,code:g}))}function Dg(r){var o,u;if(!r||r.key==="Unidentified"||r.key==="Dead")return;const f=r.shiftKey&&r.altKey?3:r.altKey?2:r.shiftKey?1:0;for(const g of up)((o=g.mapping[r.code])==null?void 0:o[f])===r.key?g.score+=1:(u=g.mapping[r.code])!=null&&u[f]&&(g.score=0);up.sort((g,b)=>b.score-g.score)}function qy(r){hp=up.find(o=>r.startsWith(o.locale))}function Rd(){return hp!=null?hp:up[0]}function ce(){switch(I0()){case"apple":return nf;case"windows":return Xp;case"linux":return td}return nf}switch(I0()){case"apple":Nc(nf),Nc(ed),Nc(Tg),Nc(D0);break;case"windows":Nc(Xp),Nc(lc),Nc(_g),Nc(Jy);break;case"linux":Nc(td),Nc(A0),Nc(Pg),Nc(fl);break}Nc(th);function Cm(r){var o;const u=/macos|ios/.test(Q()),f=r.split("+");let g="";for(const b of f)g&&(g+=u?"\u2009":'<span class="ML__shortcut-join">+</span>'),b.startsWith("[Key")?g+=b.slice(4,5):b.startsWith("Key")?g+=b.slice(3,4):b.startsWith("[Digit")?g+=b.slice(6,7):b.startsWith("Digit")?g+=b.slice(5,6):g+=(o={cmd:"\u2318",meta:u?"\u2318":"Ctrl",shift:u?"\u21E7":"Shift",alt:u?"\u2325":"Alt",ctrl:u?"\u2303":"Ctrl","\n":u?"\u23CE":"Return","[return]":u?"\u23CE":"Return","[enter]":u?"\u2324":"Enter","[tab]":u?"\u21E5":"Tab","[escape]":"Esc","[backspace]":u?"\u232B":"Backspace","[delete]":u?"\u2326":"Del","[pageup]":u?"\u21DE":"Page Up","[pagedown]":u?"\u21DF":"Page Down","[home]":u?"\u2912":"Home","[end]":u?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[b.toLowerCase()])!=null?o:b.toUpperCase();return g}function km(r){if(r instanceof MouseEvent||r instanceof PointerEvent)return{x:r.clientX,y:r.clientY};if(r instanceof TouchEvent){const o=[...r.touches].reduce((f,g)=>({x:f.x+g.clientX,y:f.y+g.clientY}),{x:0,y:0}),u=r.touches.length;return{x:o.x/u,y:o.y/u}}}function pd(r){const o={alt:!1,control:!1,shift:!1,meta:!1};return(r instanceof MouseEvent||r instanceof PointerEvent||r instanceof TouchEvent||r instanceof KeyboardEvent)&&(r.altKey&&(o.alt=!0),r.ctrlKey&&(o.control=!0),r.metaKey&&(o.meta=!0),r.shiftKey&&(o.shift=!0)),o}function Qy(r,o){return!r&&o||r&&!o?!1:!r||!o?!0:r.alt===o.alt&&r.control===o.control&&r.shift===o.shift&&r.meta===o.meta}var Zv=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function rf(r){return r.ctrlKey||r.metaKey||["Dead","Process"].includes(r.key)?!1:r.code===""?!0:Zv.has(r.code)}function id(){var r;let o=document.activeElement;for(;(r=o==null?void 0:o.shadowRoot)!=null&&r.activeElement;)o=o.shadowRoot.activeElement;return o}var nd=class L0{static get scrim(){return L0._scrim||(L0._scrim=new L0),L0._scrim}static open(o){L0.scrim.open(o)}static close(){L0.scrim.close()}static get state(){return L0.scrim.state}static get element(){return L0.scrim.element}constructor(o){var u,f;this.lightDismiss=(u=o==null?void 0:o.lightDismiss)!=null?u:!0,this.translucent=(f=o==null?void 0:o.translucent)!=null?f:!1,this.state="closed"}get element(){if(this._element)return this._element;const o=document.createElement("div");return o.setAttribute("role","presentation"),o.style.position="fixed",o.style.contain="content",o.style.top="0",o.style.left="0",o.style.right="0",o.style.bottom="0",o.style.zIndex="var(--scrim-zindex, 10099)",o.style.outline="none",this.translucent?(o.style.background="rgba(255, 255, 255, .2)",o.style.backdropFilter="contrast(40%)"):o.style.background="transparent",this._element=o,o}open(o){var u;if(this.state!=="closed")return;this.state="opening",this.onDismiss=o==null?void 0:o.onDismiss,this.savedActiveElement=id();const{element:f}=this;((u=o==null?void 0:o.root)!=null?u:document.body).appendChild(f),f.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const g=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const b=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${b+g}px`,o!=null&&o.child&&f.append(o.child),this.state="open"}close(){var o,u,f,g;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:b}=this;b.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),b.remove(),document.body.style.overflow=(o=this.savedOverflow)!=null?o:"",document.body.style.marginRight=(u=this.savedMarginRight)!=null?u:"",id()!==this.savedActiveElement&&((g=(f=this.savedActiveElement)==null?void 0:f.focus)==null||g.call(f)),b.innerHTML="",this.state="closed"}handleEvent(o){this.lightDismiss&&(o.target===this._element&&o.type==="click"?(this.close(),o.preventDefault(),o.stopPropagation()):o.target===document&&(o.type==="touchmove"||o.type==="scroll")&&(this.close(),o.preventDefault(),o.stopPropagation()))}};function cx(r,o,u){let f=null,g=null,b=!1,M=!1,N=!1;const I=new AbortController,B=I.signal;return r.addEventListener("keydown",U=>{if(b||U.key==="Process"||U.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(U.code)){f=null;return}f=U,g=null,u.onKeystroke(U)?r.textContent="":f=null},{capture:!0,signal:B}),r.addEventListener("keypress",U=>{b||(f&&g&&u.onKeystroke(f),g=U)},{capture:!0,signal:B}),r.addEventListener("compositionstart",U=>{r.textContent="",b=!0,u.onCompositionStart(U.data)},{capture:!0,signal:B}),r.addEventListener("compositionupdate",U=>{b&&u.onCompositionUpdate(U.data)},{capture:!0,signal:B}),r.addEventListener("compositionend",U=>{r.textContent="",b&&(b=!1,u.onCompositionEnd(U.data))},{capture:!0,signal:B}),r.addEventListener("beforeinput",U=>U.stopImmediatePropagation(),{signal:B}),r.addEventListener("input",U=>{var lt;if(!b&&(r.textContent="",U.inputType!=="insertCompositionText")){if(U.inputType==="insertFromPaste"){U.preventDefault(),U.stopPropagation();return}u.onInput((lt=U.data)!=null?lt:""),U.preventDefault(),U.stopPropagation()}},{signal:B}),r.addEventListener("paste",U=>{r.focus({preventScroll:!0}),r.textContent="",u.onPaste(U)||U.preventDefault(),U.stopImmediatePropagation()},{signal:B}),r.addEventListener("cut",U=>u.onCut(U),{capture:!0,signal:B}),r.addEventListener("copy",U=>u.onCopy(U),{capture:!0,signal:B}),r.addEventListener("blur",U=>{var lt,Lt;if(((Lt=(lt=U.relatedTarget)==null?void 0:lt._mathfield)==null?void 0:Lt.element)===o){r.focus({preventScroll:!0}),U.preventDefault(),U.stopPropagation();return}const Bt=nd.state;if(Bt==="open"||Bt==="opening"){U.preventDefault(),U.stopPropagation();return}if(U.relatedTarget===U.target.getRootNode().host){U.preventDefault(),U.stopPropagation();return}N||M||(N=!0,f=null,g=null,u.onBlur(),N=!1)},{capture:!0,signal:B}),r.addEventListener("focus",U=>{N||M||(M=!0,u.onFocus(),M=!1)},{capture:!0,signal:B}),{dispose:()=>I.abort(),cancelComposition:()=>{b&&(r.blur(),requestAnimationFrame(()=>r.focus({preventScroll:!0})))},blur:()=>{typeof r.blur=="function"&&r.blur()},focus:()=>{!M&&typeof r.focus=="function"&&r.focus({preventScroll:!0})},hasFocus:()=>id()===r,setAriaLabel:U=>r.setAttribute("aria-label",U),setValue:U=>{var lt;r.textContent=U,r.style.left="-1000px",(lt=window.getSelection())==null||lt.selectAllChildren(r)},moveTo:(U,lt)=>{r.style.top=`${lt}px`,r.style.left=`${U}px`}}}function Yp(r){var o;if(!r||!rf(r))return"";let u;return r.key==="Unidentified"&&r.target&&(u=r.target.value),u=(o=u!=null?u:r.key)!=null?o:r.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(u)&&(u=""),u}function Gv(r){r=Ag(r);const o=[];return r.ctrlKey&&o.push("ctrl"),r.metaKey&&o.push("meta"),r.altKey&&o.push("alt"),r.shiftKey&&o.push("shift"),o.length===0?`[${r.code}]`:(o.push(`[${r.code}]`),o.join("+"))}function t1(r){if(le()){const o=Q(),u=r.startsWith("!"),f=r.endsWith(o);if(u&&!f||!u&&f)return!0}return r==="!other"?!1:r==="other"}function md(r,o,u){if(r.length===0)return"";const f=lp(Sm(Gv(u))),g=lp({key:u.key,shift:u.shiftKey,alt:u.altKey,ctrl:u.ctrlKey,meta:u.metaKey||u.ctrlKey&&/macos|ios/.test(Q()),cmd:!1,win:!1});for(let b=r.length-1;b>=0;b--)if((r[b].key===f||r[b].key===g)&&(!r[b].ifMode||r[b].ifMode===o))return r[b].command;return""}function Ig(r){let o=r;return ne(o)&&(o=o.length>0?o[0]+"("+o.slice(1).join("")+")":""),o}function Xv(r,o){let u=[];if(typeof o=="string"){const b=vh[o];ne(b)?u=b.slice():b&&u.push(b)}const f=Ig(o),g=new RegExp("^"+f.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const b of r)g.test(Ig(b.command))&&u.push(b.key);return u.map(Cm)}function Yv(r,o){if(r.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(r.ifPlatform))throw new Error(`Unexpected platform "${r.ifPlatform}" for keybinding ${r.key}`);if(r.ifLayout!==void 0&&(o.score===0||!r.ifLayout.includes(o.id)))return;const u=Sm(r.key);let f=r.ifPlatform;if(u.cmd){if(f&&f!=="macos"&&f!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+f+`"
|
|
|
"cmd" modifier can only be used with macOS or iOS platform.`);f||(f=Q()==="ios"?"ios":"macos"),u.win=!1,u.cmd=!1,u.meta=!0}if(u.win){if(f&&f!=="windows")throw new Error('Unexpected "win" modifier with platform "'+f+`"
|
|
|
"win" modifier can only be used with Windows platform.`);f="windows",u.win=!1,u.cmd=!1,u.meta=!0}if(f&&!t1(f))return;if(/^\[.+\]$/.test(u.key))return F(ot({},r),{key:lp(u)});const g=Mm(u.key,o);if(!g)return F(ot({},r),{key:lp(u)});if(g.shift&&u.shift||g.alt&&u.alt)throw new Error(`The keybinding ${r.key} (${Em(r.command)}) is conflicting with the key combination ${lp(g)} using the ${o.displayName} keyboard layout`);return g.shift=g.shift||u.shift,g.alt=g.alt||u.alt,g.meta=u.meta,g.ctrl=u.ctrl,F(ot({},r),{key:lp(g)})}function Em(r){if(Array.isArray(r)){const o=[...r];return o.shift()+"("+o.map(u=>typeof u=="string"?`"${u}"`:u.toString()).join(", ")+")"}return r}function e1(r,o){const u=[],f=[];for(const g of r)try{const b=Yv(g,o);if(!b)continue;const M=f.find(N=>N.key===b.key&&N.ifMode===b.ifMode);if(M)throw new Error(`Ambiguous key binding ${g.key} (${Em(g.command)}) matches ${M.key} (${Em(M.command)}) with the ${o.displayName} keyboard layout`);f.push(b)}catch(b){b instanceof Error&&u.push(b.message)}return[f,u]}var i1=class extends ur{constructor(){super("latex")}createAtom(r){return new bh(r)}onPaste(r,o){if(!o)return!1;const u=typeof o=="string"?o:o.getData("application/x-latex")||o.getData("text/plain");return u&&r.model.contentWillChange({inputType:"insertFromPaste",data:u})?(r.stopCoalescingUndo(),r.stopRecording(),this.insert(r.model,u)&&(r.startRecording(),r.snapshot("paste"),r.model.contentDidChange({inputType:"insertFromPaste"}),ql(r)),r.startRecording(),!0):!1}insert(r,o,u){if(!r.contentWillChange({data:o,inputType:"insertText"}))return!1;u||(u={}),u.insertionMode||(u.insertionMode="replaceSelection"),u.selectionMode||(u.selectionMode="placeholder");const{silenceNotifications:f}=r;u.silenceNotifications&&(r.silenceNotifications=!0);const g=r.silenceNotifications;r.silenceNotifications=!0,u.insertionMode==="replaceSelection"&&!r.selectionIsCollapsed?r.deleteAtoms(Ds(r.selection)):u.insertionMode==="replaceAll"?(r.root.setChildren([],"body"),r.position=0):u.insertionMode==="insertBefore"?r.collapseSelection("backward"):u.insertionMode==="insertAfter"&&r.collapseSelection("forward");const b=[];for(const I of o)_.test(I)&&b.push(new bh(I));let M=r.at(r.position);if(M instanceof T0&&(M=M.lastChild),!(M.parent instanceof T0)){const I=new T0("");M.parent.addChildAfter(I,M),M=I.firstChild}const N=M.parent.addChildrenAfter(b,M);return r.silenceNotifications=g,u.selectionMode==="before"||(u.selectionMode==="item"?r.setSelection(r.anchor,r.offsetOf(N)):N&&(r.position=r.offsetOf(N))),r.contentDidChange({data:o,inputType:"insertText"}),r.silenceNotifications=f,!0}};function n1(r){return r.atoms.find(o=>o.type==="latexgroup")}function Sh(r){var o,u;const f=r.atoms.find(g=>g.type==="latexgroup");return f?(u=(o=f.body)==null?void 0:o.filter(g=>g.type==="latex"))!=null?u:[]:[]}function r1(r,o){var u;let f=0,g=!1;const b=Number.isFinite(o==null?void 0:o.before)?(u=o==null?void 0:o.before)!=null?u:0:r.lastOffset;for(;f<=b&&!g;){const I=r.at(f);g=I instanceof bh&&I.isSuggestion,g||f++}if(!g)return[void 0,void 0];let M=f,N=!1;for(;M<=b&&!N;){const I=r.at(M);N=!(I instanceof bh&&I.isSuggestion),N||M++}return[f-1,M-1]}new i1;function cp(r){const o=Sh(r.model).filter(u=>u.isSuggestion);if(o.length!==0){r.model.position=r.model.offsetOf(o[0].leftSibling);for(const u of o)u.parent.removeChild(u)}}function O0(r,o){var u;const{model:f}=r;cp(r);for(const U of Sh(f))U.isError=!1;if(!f.selectionIsCollapsed||r.options.popoverPolicy==="off"){Mh(r);return}const g=[];let b=f.at(f.position);for(;b&&b instanceof bh&&/^[a-zA-Z\*]$/.test(b.value);)b=b.leftSibling;if(b&&b instanceof bh&&b.value==="\\")for(g.push(b),b=b.rightSibling;b&&b instanceof bh&&/^[a-zA-Z\*]$/.test(b.value);)g.push(b),b=b.rightSibling;const M=g.map(U=>U.value).join(""),N=He(r,M);if(N.length===0){if(/^\\[a-zA-Z\*]+$/.test(M))for(const U of g)U.isError=!0;Mh(r);return}const I=(u=o==null?void 0:o.atIndex)!=null?u:0;r.suggestionIndex=I<0?N.length-1:I%N.length;const B=N[r.suggestionIndex];if(B!==M){const U=g[g.length-1];U.parent.addChildrenAfter([...B.slice(M.length-B.length)].map(lt=>new bh(lt,{isSuggestion:!0})),U),pp(r,{interactive:!0})}yf(r,N)}function Lm(r){const[o,u]=r1(r,{before:r.position});if(o===void 0||u===void 0)return!1;let f=!1;return r.getAtoms([o,u]).forEach(g=>{g.isSuggestion&&(g.isSuggestion=!1,f=!0)}),f}function fp(r,o="accept",u){var f,g;Mh(r);const b=n1(r.model);if(!b)return!1;if(o==="accept-suggestion"||o==="accept-all"){const B=Sh(r.model).filter(U=>U.isSuggestion);if(B.length!==0){for(const U of B)U.isSuggestion=!1;r.model.position=r.model.offsetOf(B[B.length-1])}if(o==="accept-suggestion")return B.length!==0}const N=Sh(r.model).filter(B=>!B.isSuggestion).map(B=>B.value).join(""),I=b.leftSibling;return b.parent.removeChild(b),r.model.position=r.model.offsetOf(I),r.switchMode((f=u==null?void 0:u.mode)!=null?f:"math"),o==="reject"||(ur.insert(r.model,N,{selectionMode:(g=u==null?void 0:u.selectItem)!=null&&g?"item":"placeholder",format:"latex",mode:"math"}),r.snapshot(),r.model.announce("replacement"),r.switchMode("math")),!0}function R0(r){var o;let u=document.getElementById(r);return u?u.dataset.refcount=Number(Number.parseInt((o=u.dataset.refcount)!=null?o:"0")+1).toString():(u=document.createElement("div"),u.setAttribute("aria-hidden","true"),u.dataset.refcount="1",u.id=r,document.body.append(u)),u}function Tm(r){var o;const u=document.getElementById(r);if(!u)return;const f=Number.parseInt((o=u.getAttribute("data-refcount"))!=null?o:"0");f<=1?u.remove():u.dataset.refcount=Number(f-1).toString()}function Og(r,o){const u=new Nn({from:r.context}),f=new ae({mode:"math",type:"root",body:au(o,{context:u})}),g=wn(Bf(new Je(f.render(u),{classes:"ML__base"}),u));return lr(g,{classes:"ML__latex"}).toMarkup()}function yf(r,o){var u;if(o.length===0){Mh(r);return}let f="";for(const[b,M]of o.entries()){const N=M,I=Og(r,M),B=Xv(r.keybindings,N).join("<br>");f+=`<li role="button" data-command="${N}" ${b===r.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${N}</span><span class="ML__popover__command">${I}</span>`,B&&(f+=`<span class="ML__popover__keybinding">${B}</span>`),f+="</li>"}const g=rd(r,`<ul>${f}</ul>`);Rg()&&((u=g.querySelector(".ML__popover__current"))==null||u.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var b;g&&!Rg()&&(g.classList.add("is-visible"),_m(r),(b=g.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function Rg(){const r=document.getElementById("mathlive-suggestion-popover");return r?r.classList.contains("is-visible"):!1}function _m(r,o){var u;if(!r.element||r.element.mathfield!==r||!Rg())return;if(((u=r.model.at(r.model.position))==null?void 0:u.type)!=="latex"){Mh(r);return}if(o!=null&&o.deferred){setTimeout(()=>_m(r),32);return}const f=Iu(r.field);if(!f)return;const g=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,M=window.innerWidth-document.documentElement.clientWidth,N=window.innerHeight-document.documentElement.clientHeight,I=window.mathVirtualKeyboard.boundingRect.height,B=document.getElementById("mathlive-suggestion-popover");f.x+B.offsetWidth/2>b-M?B.style.left=`${b-B.offsetWidth-M}px`:f.x-B.offsetWidth/2<0?B.style.left="0":B.style.left=`${f.x-B.offsetWidth/2}px`;const U=f.y-f.height;g-N-I-f.y<U?(B.classList.add("ML__popover--reverse-direction"),B.classList.remove("top-tip"),B.classList.add("bottom-tip"),B.style.top=`${f.y-f.height-B.offsetHeight-15}px`):(B.classList.remove("ML__popover--reverse-direction"),B.classList.add("top-tip"),B.classList.remove("bottom-tip"),B.style.top=`${f.y+15}px`)}function Mh(r){r.suggestionIndex=0;const o=document.getElementById("mathlive-suggestion-popover");o&&(o.classList.remove("is-visible"),o.innerHTML="")}function rd(r,o){let u=document.getElementById("mathlive-suggestion-popover");return u||(u=R0("mathlive-suggestion-popover"),qu("suggestion-popover"),qu("core"),u.addEventListener("pointerdown",f=>f.preventDefault()),u.addEventListener("click",f=>{let g=f.target;for(;g&&!g.dataset.command;)g=g.parentElement;g&&(fp(r,"reject"),ur.insert(r.model,g.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),r.dirty=!0,r.focus())})),u.innerHTML=window.MathfieldElement.createHTML(o),u}function uc(){document.getElementById("mathlive-suggestion-popover")&&(Tm("mathlive-suggestion-popover"),h("suggestion-popover"),h("core"))}function tl(){const r=String(new Error().stack).replace(/^Error.*\n/,"").split(`
|
|
|
`);if(r.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let o=r[1],u=o.match(/http.*\.ts[\?:]/);return u&&(o=r[2]),u=o.match(/(https?:.*):[0-9]+:[0-9]+/),u||(u=o.match(/at (.*(\.ts))[\?:]/),u||(u=o.match(/at (.*(\.mjs|\.js))[\?:]/))),u?u[1]:(console.error(r),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${o}").`),"")}var Jp=null,Pm,Bg,qp=((Bg=(Pm=globalThis==null?void 0:globalThis.document)==null?void 0:Pm.currentScript)==null?void 0:Bg.src)||tl();function Nm(r){return wm(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(r))return new URL(r).href;if(Jp===null)try{const o=yield fetch(qp,{method:"HEAD"});o.status===200&&(Jp=o.url)}catch(o){console.error(`Invalid URL "${r}" (relative to "${qp}")`)}return new URL(r,Jp!=null?Jp:qp).href})}function pn(r,o,u={}){return new FontFace(r,`url(${o}.woff2) format('woff2')`,u)}var Ch="not-loaded";function B0(){return wm(this,null,function*(){return Ch="not-loaded",F0()})}function F0(){return wm(this,null,function*(){var r;if(Ch!=="not-loaded")return;if(Ch="loading",(r=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?r:!1){Ch="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const u=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],f=Array.from(document.fonts).map(M=>M.family);if(u.every(M=>f.includes(M))){Ch="ready";return}if(!window.MathfieldElement.fontsDirectory){Ch="not-loaded";return}const g=yield Nm(window.MathfieldElement.fontsDirectory);if(!g){document.body.classList.add("ML__fonts-did-not-load"),Ch="error";return}const b=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(M=>pn(M[0].replace(/-[a-zA-Z]+$/,""),`${g}/${M[0]}`,M[1]));try{(yield Promise.all(b.map(N=>{try{return N.load()}catch(I){}}))).forEach(N=>document.fonts.add(N)),Ch="ready";return}catch(M){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${g}"`,{cause:M}),document.body.classList.add("ML__fonts-did-not-load")}Ch="error"}})}function Fg(r){let o=0;for(let u=0;u<r.length;u++)o=o*31+r.charCodeAt(u),o=o|0;return Math.abs(o)}function ql(r,o){r&&(r.dirty||(r.dirty=!0,requestAnimationFrame(()=>{xa(r)&&r.dirty&&(r.atomBoundsCache=new Map,pp(r,o),r.atomBoundsCache=void 0)})))}function dp(r,o){var u;o=o!=null?o:{};const f=new Nn({from:F(ot({},r.context),{atomIdsSettings:{seed:o.forHighlighting?Fg(ae.serialize([r.model.root],{expandMacro:!1,defaultMode:r.options.defaultMode})):"random",groupNumbers:(u=o.forHighlighting)!=null?u:!1},letterShapeStyle:r.options.letterShapeStyle}),mathstyle:r.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),g=r.model.root.render(f);return lr(Bf(g,f),{classes:r.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function Jv(r,o){const{model:u}=r;u.root.caret=void 0,u.root.isSelected=!1,u.root.containsCaret=!0;for(const g of u.atoms)g.caret=void 0,g.isSelected=!1,g.containsCaret=!1;if(u.selectionIsCollapsed){const g=u.at(u.position);g.caret=r.model.mode;let b=g.parent;for(;b;)b.containsCaret=!0,b=b.parent}else{const g=u.getAtoms(u.selection,{includeChildren:!0});for(const b of g)b.isSelected=!0}return dp(r,o).toMarkup()}function pp(r,o){if(!xa(r))return;o!=null||(o={});const u=r.element.querySelector("[part=virtual-keyboard-toggle]");u&&(u.style.display=r.hasEditableContent?"":"none");const f=r.field;if(!f)return;const g=r.isSelectionEditable&&r.hasFocus(),b=f.classList.contains("ML__focused");b&&!g?f.classList.remove("ML__focused"):!b&&g&&f.classList.add("ML__focused");let M=Jv(r,o);const N=r.element.querySelector("[part=menu-toggle]");if(N&&(r.model.atoms.length<=1||r.disabled||r.readOnly&&!r.hasEditableContent||r.userSelect==="none"?N.style.display="none":N.style.display=""),r.model.atoms.length<=1){const I=r.options.contentPlaceholder;I&&(M+=`<span part=placeholder class="ML__content-placeholder">${tu(I)}</span>`)}f.innerHTML=window.MathfieldElement.createHTML(M),zc(r,o.interactive),r.dirty=!1}function zc(r,o){const u=r.field;if(!u)return;for(const N of u.querySelectorAll(".ML__selection, .ML__contains-highlight"))N.remove();!(o!=null&&o)&&Ch!=="error"&&Ch!=="ready"&&setTimeout(()=>{Ch==="ready"?zc(r):setTimeout(()=>zc(r),128)},32);const f=r.model,g=u.offsetWidth,b=u.getBoundingClientRect().width;let M=Math.floor(b)/g;if(M=isNaN(M)?1:M,f.selectionIsCollapsed){_m(r,{deferred:!0});let N=f.at(f.position);for(;N&&N.type!=="prompt"&&!(N.containsCaret&&N.displayContainsHighlight);)N=N.parent;if(N!=null&&N.containsCaret&&N.displayContainsHighlight){const I=ns(r,Gl(r,N),M);if(I){I.left/=M,I.right/=M,I.top/=M,I.bottom/=M;const B=document.createElement("div");B.classList.add("ML__contains-highlight"),B.style.position="absolute",B.style.left=`${I.left+1}px`,B.style.top=`${Math.ceil(I.top)}px`,B.style.width=`${Math.ceil(I.right-I.left)}px`,B.style.height=`${Math.ceil(I.bottom-I.top)}px`,u.insertBefore(B,u.childNodes[0])}}return}for(const N of qv(Ou(r,{excludeAtomsWithBackground:!0}))){N.left/=M,N.right/=M,N.top/=M,N.bottom/=M;const I=document.createElement("div");I.classList.add("ML__selection"),I.style.position="absolute",I.style.left=`${N.left}px`,I.style.top=`${N.top}px`,I.style.width=`${Math.ceil(N.right-N.left)}px`,I.style.height=`${Math.ceil(N.bottom-N.top-1)}px`,u.insertBefore(I,u.childNodes[0])}}function qv(r){let o=[];for(const u of r){let f=!1;for(const g of o)if(u.left===g.left&&u.right===g.right&&u.top===g.top&&u.bottom===g.bottom){f=!0;break}f||o.push(u)}r=o,o=[];for(const u of r){let f=0;for(const g of r)if(u.left>=g.left&&u.right<=g.right&&u.top>=g.top&&u.bottom<=g.bottom&&(f+=1,f>1))break;f===1&&o.push(u)}return o}var zg=3,ao;function vu(r,o){o=ot({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},o!=null?o:{}),ao||(ao={});for(const u of Object.keys(r))console.assert(!ao[u],"Selector already defined: ",u),ao[u]=F(ot({},o),{fn:r[u]})}function $g(r){let o;if(Array.isArray(r)){if(r[0]==="performWithFeedback")return $g(r[1]);o=r[0]}else o=r;return o=o.replace(/-\w/g,u=>u[1].toUpperCase()),ao[o]}function gd(r){var o;return(o=$g(r))==null?void 0:o.target}function Qv(r,o){var u;if(!o)return!1;let f,g=[],b=!1,M=!1;ne(o)?(f=o[0],g=o.slice(1)):f=o,f=f.replace(/-\w/g,B=>B[1].toUpperCase());const N=ao[f],I=N==null?void 0:N.target;if(I==="model"){if(!r.isSelectionEditable&&(N!=null&&N.changeContent))return r.model.announce("plonk"),!1;/^(delete|add)/.test(f)&&(f!=="deleteBackward"&&r.flushInlineShortcutBuffer(),r.snapshot(f)),/^complete/.test(f)||cp(r),ao[f].fn(r.model,...g),O0(r),M=!0,b=!0}else if(I==="virtual-keyboard")M=(u=window.mathVirtualKeyboard.executeCommand(o))!=null?u:!1,b=!0;else if(ao[f]){if(!r.isSelectionEditable&&(N!=null&&N.changeContent))return r.model.announce("plonk"),!1;/^(undo|redo)/.test(f)&&r.flushInlineShortcutBuffer(),M=ao[f].fn(r,...g),b=!0}else throw new Error(`Unknown command "${f}"`);return I!=="virtual-keyboard"&&(!r.model.selectionIsCollapsed||N!=null&&N.changeSelection&&o!=="deleteBackward")&&(r.flushInlineShortcutBuffer(),N!=null&&N.changeContent||r.stopCoalescingUndo(),r.defaultStyle={}),M&&ql(r),b}function z0(r,o){var u;if(!r)return!1;r.focus(),hm.keypressVibration&&zt()&&navigator.vibrate(zg);const f=$g(o);window.MathfieldElement.playSound((u=f==null?void 0:f.audioFeedback)!=null?u:"keypress");const g=r.executeCommand(o);return r.scrollIntoView(),g}vu({performWithFeedback:(r,o)=>z0(r,o)});function $c(r){return O0(r,{atIndex:r.suggestionIndex+1}),!1}function Am(r){return O0(r,{atIndex:r.suggestionIndex-1}),!1}vu({complete:fp},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),vu({nextSuggestion:$c,previousSuggestion:Am},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Dm="mathlive#virtual-keyboard-message";function jg(r){var o;return r.type!=="message"?!1:((o=r.data)==null?void 0:o.type)===Dm}var Kg=class R2{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new R2),this._singleton}set alphabeticLayout(o){this.sendMessage("update-setting",{alphabeticLayout:o})}set layouts(o){this.sendMessage("update-setting",{layouts:o})}get normalizedLayouts(){return[]}set editToolbar(o){this.sendMessage("update-setting",{editToolbar:o})}set actionKeycap(o){this.sendMessage("update-setting",{actionKeycap:o})}set shiftKeycap(o){this.sendMessage("update-setting",{shiftKeycap:o})}set backspaceKeycap(o){this.sendMessage("update-setting",{backspaceKeycap:o})}set tabKeycap(o){this.sendMessage("update-setting",{tabKeycap:o})}set container(o){throw new Error("Container inside an iframe cannot be changed")}show(o){this.sendMessage("show",o)}hide(o){this.sendMessage("hide",o)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(o){o?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(o){return this.sendMessage("execute-command",{command:o}),!0}updateToolbar(o){this.sendMessage("update-toolbar",o)}update(o){this.sendMessage("update-setting",o)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(o,u,f){this.listeners[o]||(this.listeners[o]=new Set),this.listeners[o].has(u)||this.listeners[o].add(u)}dispatchEvent(o){return!this.listeners[o.type]||this.listeners[o.type].size===0?!0:(this.listeners[o.type].forEach(u=>{typeof u=="function"?u(o):u==null||u.handleEvent(o)}),!o.defaultPrevented)}removeEventListener(o,u,f){this.listeners[o]&&this.listeners[o].delete(u)}handleEvent(o){if(jg(o)){if(!Xl(o.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${o.origin}) cannot be handled`,"SecurityError");this.handleMessage(o.data)}}handleMessage(o){const{action:u}=o;if(u==="execute-command"){const{command:f}=o;gd(f)==="virtual-keyboard"&&this.executeCommand(f);return}if(u==="synchronize-proxy"){this._boundingRect=o.boundingRect,this._isShifted=o.isShifted;return}if(u==="geometry-changed"){this._boundingRect=o.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(o,u={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(ot({type:Dm,action:o},u),this.targetOrigin)}},Im={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"αβγ",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>φ</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>ς</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>ϵ</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>ρ</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>τ</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>υ</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>θ</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>ι</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>ο</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>π</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>α</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>σ</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>δ</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>γ</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>η</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>ξ</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>κ</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>λ</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>ζ</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>χ</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>ψ</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>ω</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>β</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>ν</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>μ</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>ε</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>ϑ</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>ϰ</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>ϖ</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>ϱ</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"∞\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
|
|
|
.minimalist-backdrop {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
}
|
|
|
.minimalist-container {
|
|
|
--keycap-height: 40px;
|
|
|
--keycap-max-width: 53px;
|
|
|
--keycap-small-font-size: 12px;
|
|
|
background: var(--keyboard-background);
|
|
|
padding: 20px;
|
|
|
border-top-left-radius: 8px;
|
|
|
border-top-right-radius: 8px;
|
|
|
border: 1px solid var(--keyboard-border);
|
|
|
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
|
|
|
}
|
|
|
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},$0={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},j0;function Hg(r,o){var u,f,g;const b=gp.singleton;if(!b)return;const M=jc(r),N=(f=(u=b.getKeycap(M==null?void 0:M.id))==null?void 0:u.variants)!=null?f:"";if(typeof N=="string"&&!Om(N)||Array.isArray(N)&&N.length===0){o==null||o();return}const I={};let B="";for(const je of Rm(N)){const Zi=iy(je),Le=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);I[Le]=Zi;const[Ci,en]=t0(Zi);B+=`<div id=${Le} class="item ${en}">${Ci}</div>`}const U=document.createElement("div");U.setAttribute("aria-hidden","true"),U.className="MLK__variant-panel",U.style.height="auto";const lt=Object.keys(I).length;let Lt=5;lt===1?Lt=1:lt===2||lt===4?Lt=2:lt===3||lt===5||lt===6?Lt=3:lt>=7&<<14&&(Lt=4),U.style.width=`calc(var(--variant-keycap-length) * ${Lt} + 12px)`,U.innerHTML=hm.createHTML(B),nd.open({root:(g=b==null?void 0:b.container)==null?void 0:g.querySelector(".ML__keyboard"),child:U}),j0=new AbortController;const{signal:Bt}=j0,jt=r==null?void 0:r.getBoundingClientRect();if(jt){jt.top-U.clientHeight<0&&(U.style.width="auto",lt<=6?U.style.height="56px":lt<=12?U.style.height="108px":lt<=18?U.style.height="205px":U.classList.add("compact"));const je=Math.max(0,Math.min(window.innerWidth-U.offsetWidth,(jt.left+jt.right-U.offsetWidth)/2)),Zi=jt.top-U.clientHeight+5;U.style.transform=`translate(${je}px, ${Zi}px)`,U.classList.add("is-visible"),requestAnimationFrame(()=>{U.addEventListener("pointerup",Le=>{const Ci=jc(Le.target);!(Ci!=null&&Ci.id)||!I[Ci.id]||(mp(I[Ci.id]),K0(),o==null||o(),Le.preventDefault())},{capture:!0,passive:!1,signal:Bt}),U.addEventListener("pointerenter",Le=>{const Ci=jc(Le.target);!(Ci!=null&&Ci.id)||!I[Ci.id]||Ci.classList.add("is-active")},{capture:!0,signal:Bt}),U.addEventListener("pointerleave",Le=>{const Ci=jc(Le.target);!(Ci!=null&&Ci.id)||!I[Ci.id]||Ci.classList.remove("is-active")},{capture:!0,signal:Bt}),window.addEventListener("pointercancel",()=>{K0(),o==null||o()},{signal:Bt}),window.addEventListener("pointerup",()=>{K0(),o==null||o()},{signal:Bt})})}}function K0(){j0==null||j0.abort(),j0=null,nd.state==="open"&&nd.close()}function ty(r){if(r==="foreground-color"){const o=[];for(const u of Object.keys(qt))o.push({class:"swatch-button",label:'<span style="border: 3px solid '+qt[u]+'"></span>',command:["applyStyle",{color:u}]});return o}if(r==="background-color"){const o=[];for(const u of Object.keys(Ot))o.push({class:"swatch-button",label:'<span style="background:'+Ot[u]+'"></span>',command:["applyStyle",{backgroundColor:u}]});return o}}function Om(r){return $0[r]!==void 0}function Rm(r){var o;return typeof r!="string"?r:($0[r]||($0[r]=(o=ty(r))!=null?o:[]),$0[r])}function o1(r){return typeof r=="string"?r:Object.entries(r).map(([o,u])=>`${o}:${u} !important`).join(";")}function fx(r){return Object.keys(r).map(o=>`${o} {${o1(r[o])}}`).join("")}function Qp(r){if(!r)return"";const o=new Nn,u=new ae({mode:"math",type:"root",body:au(r,{context:o,args:g=>g==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),f=wn(Bf(new Je(u.render(o),{classes:"ML__base"}),o));return lr(f,{classes:"ML__latex"}).toMarkup()}function H0(r){var o;if(Array.isArray(r))return r.map(f=>H0(f)).flat();const u=typeof r=="string"?{markup:r}:r;return"rows"in u&&Array.isArray(u.rows)&&(u.rows=u.rows.map(f=>f.map(g=>iy(g)))),(o=u.id)!=null||(u.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[u]}function Vg(){var r,o;let f=window.mathVirtualKeyboard.alphabeticLayout;if(f==="auto"){const N=Rd();N&&(f=N.virtualLayout),(!f||f==="auto")&&(f=(r={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[Vt.locale.slice(0,2)])!=null?r:"qwerty")}const g={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},b=(o=g[f])!=null?o:g.qwerty,M=f==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const N of b){const I=[];for(const B of N)/[a-z]/.test(B)?I.push({label:B,class:"hide-shift",shift:{label:B.toUpperCase()},variants:Om(B)?B:void 0}):B==="~"?f!=="dvorak"?I.push("[backspace]"):I.push({label:"[backspace]",width:1}):B==="^"?I.push("[shift]"):B===" "&&I.push("[separator-5]");M.push(I)}return M.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:H0({rows:M})}}function Wg(r){if(r==="alphabetic")return Vg();if(typeof r=="string")return console.assert(Im[r]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${r}"`),Wg(Im[r]);let o;if("rows"in r&&Array.isArray(r.rows)){console.assert(!("layers"in r||"markup"in r),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const g=r,{rows:b}=g,M=ee(g,["rows"]);o=F(ot({},M),{layers:H0({rows:r.rows})})}else if("markup"in r&&typeof r.markup=="string"){const g=r,{markup:b}=g,M=ee(g,["markup"]);o=F(ot({},M),{layers:H0(r.markup)})}else o=ot({},r),"layers"in r?o.layers=H0(r.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let u=!1,f=!1;for(const g of o.layers)if(g.rows)for(const b of g.rows.flat()){Fd(b)&&(u=!0);const M=b.command;typeof M=="string"&&["undo","redo","cut","copy","paste"].includes(M)&&(f=!0)}return(!("displayShiftedKeycaps"in r)||r.displayShiftedKeycaps===void 0)&&(o.displayShiftedKeycaps=u),(!("displayEditToolbar"in r)||r.displayEditToolbar===void 0)&&(o.displayEditToolbar=!f),o}function Bm(r,o){var u,f;let g='<div class="left">';if(r.normalizedLayouts.length>1)for(const[b,M]of r.normalizedLayouts.entries()){const N=M,I=[b===o?"selected":"layer-switch"];N.tooltip&&I.push("MLK__tooltip"),N.labelClass&&I.push(...N.labelClass.split(" ")),g+=`<div class="${I.join(" ")}"`,N.tooltip&&(g+=" data-tooltip='"+((u=Wt(N.tooltip))!=null?u:N.tooltip)+"' "),b!==o&&(g+=`data-layer="${N.layers[0].id}"`),g+=`>${(f=N.label)!=null?f:"untitled"}</div>`}return g+="</div>",g}function s1(r,o){let u="";if(r.editToolbar==="none")return"";const g=[];o.selectionIsCollapsed?g.push("undo","redo","pasteFromClipboard"):g.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const b={undo:`<div class='action ${o.canUndo===!1?"disabled":""}'
|
|
|
data-command='"undo"'
|
|
|
data-tooltip='${Wt("tooltip.undo")}'>
|
|
|
<svg><use xlink:href='#svg-undo' /></svg>
|
|
|
</div>`,redo:`<div class='action ${o.canRedo===!1?"disabled":""}'
|
|
|
data-command='"redo"'
|
|
|
data-tooltip='${Wt("tooltip.redo")}'>
|
|
|
<svg><use xlink:href='#svg-redo' /></svg>
|
|
|
</div>`,cutToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"cutToClipboard"'
|
|
|
data-tooltip='${Wt("tooltip.cut to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-cut' /></svg>
|
|
|
</div>
|
|
|
`,copyToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"copyToClipboard"'
|
|
|
data-tooltip='${Wt("tooltip.copy to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-copy' /></svg>
|
|
|
</div>
|
|
|
`,pasteFromClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"pasteFromClipboard"'
|
|
|
data-tooltip='${Wt("tooltip.paste from clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-paste' /></svg>
|
|
|
</div>
|
|
|
`};return u+=g.map(M=>b[M]).join(""),u}function uh(r){for(const o of r)Ug(o)}function Ug(r){const o=gp.singleton;if(!o)return;const u={};if(!r.id){if(r.hasAttribute("data-label")&&(u.label=r.dataset.label),r.hasAttribute("data-latex")&&(u.latex=r.dataset.latex),r.hasAttribute("data-key")&&(u.key=r.dataset.key),r.hasAttribute("data-insert")&&(u.insert=r.dataset.insert),r.hasAttribute("data-variants")&&(u.variants=r.dataset.variants),r.hasAttribute("data-aside")&&(u.aside=r.dataset.aside),r.className&&(u.class=r.className),!u.label&&!u.latex&&!u.key&&!u.insert&&(u.latex=r.innerText,u.label=r.innerHTML),r.hasAttribute("data-command"))try{u.command=JSON.parse(r.dataset.command)}catch(f){}r.id=o.registerKeycap(u)}if(!r.innerHTML){const[f,g]=t0(u);r.innerHTML=window.MathfieldElement.createHTML(f)}}function ey(){qu("virtual-keyboard"),qu("core"),F0()}function Ff(){h("core"),h("virtual-keyboard")}var hh=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
|
|
|
|
|
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
|
|
|
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-shift" viewBox="0 0 384 512">
|
|
|
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-commit" viewBox="0 0 512 512">
|
|
|
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
|
|
|
</symbol>
|
|
|
|
|
|
|
|
|
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
|
|
|
|
|
|
<symbol id="svg-command" viewBox="0 0 640 512">
|
|
|
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
|
|
|
</symbol>
|
|
|
|
|
|
<symbol id="svg-undo" viewBox="0 0 512 512">
|
|
|
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-redo" viewBox="0 0 512 512">
|
|
|
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
|
|
|
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
|
|
|
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-tab" viewBox="0 0 448 512">
|
|
|
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
|
|
|
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
|
|
|
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-trash" viewBox="0 0 448 512">
|
|
|
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
|
|
|
</symbol>
|
|
|
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
|
|
|
</svg>`;function V0(r){r.resetKeycapRegistry(),ey();const o=document.createElement("div");o.className="ML__keyboard";const u=document.createElement("div");u.className="MLK__plate",u.innerHTML=window.MathfieldElement.createHTML(hh+r.normalizedLayouts.map((M,N)=>W0(r,M,N)).join(""));const f=document.createElement("div");f.className="MLK__backdrop",f.appendChild(u),o.appendChild(f),o.addEventListener("pointerdown",l1,{passive:!1});const g=o.querySelectorAll(".ML__edit-toolbar");if(g)for(const M of g)M.addEventListener("click",N=>{var I,B;let U=N.target,lt="";for(;U&&!lt;)lt=(I=U==null?void 0:U.getAttribute("data-command"))!=null?I:"",U=(B=U==null?void 0:U.parentElement)!=null?B:null;lt&&r.executeCommand(JSON.parse(lt))});uh(o.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const b=o.querySelectorAll(".MLK__layer");console.assert(b.length>0,"No virtual keyboards available");for(const M of b)M.addEventListener("pointerdown",N=>N.preventDefault());return r.currentLayer=r.latentLayer,o}function W0(r,o,u){const f=[];if(!("layers"in o))return"";for(const g of o.layers)f.push(`<div tabindex="-1" class="MLK__layer" id="${g.id}">`),(r.normalizedLayouts.length>1||o.displayEditToolbar)&&(f.push("<div class='MLK__toolbar' role='toolbar'>"),f.push(Bm(r,u)),o.displayEditToolbar&&f.push('<div class="ML__edit-toolbar right"></div>'),f.push("</div>")),f.push(a1(r,g)),f.push("</div>");return f.join("")}function a1(r,o){if(typeof o=="string")return o;let u="";if(typeof o.style=="string"?u+=`<style>${o.style}</style>`:typeof o.style=="object"&&(u+=`<style>${fx(o.style)}</style>`),o.backdrop&&(u+=`<div class='${o.backdrop}'>`),o.container&&(u+=`<div class='${o.container}'>`),o.rows){u+="<div class=MLK__rows>";for(const f of o.rows){u+="<div dir='ltr' class=MLK__row>";for(const g of f)if(g){const b=r.registerKeycap(g),[M,N]=t0(g);/(^|\s)separator/.test(N)?u+=`<div class="${N}"`:u+=`<div tabindex="-1" id="${b}" class="${N}"`,g.tooltip&&(u+=` data-tooltip="${g.tooltip}"`),u+=`>${M}</div>`}u+="</div>"}u+="</div>"}else o.markup&&(u+=o.markup);return o.container&&(u+="</div>"),o.backdrop&&(u+="</div>"),u}function t0(r,o={shifted:!1}){var u,f,g,b,M,N,I;let B="",U=(u=r.class)!=null?u:"";if(o.shifted&&Fd(r)&&(U+=" is-active"),o.shifted&&"shift"in r)typeof r.shift=="string"?B=Qp(r.shift):typeof r.shift=="object"&&(B=r.shift.label?r.shift.label:(f=Qp(r.shift.latex||r.shift.insert||"")||r.shift.key)!=null?f:""),typeof r.shift=="object"&&(U=(b=(g=r.shift.class)!=null?g:r.class)!=null?b:"");else{if(B=r.label?r.label:(M=Qp(r.latex||r.insert||"")||r.key)!=null?M:"",r.shift){let lt;typeof r.shift=="string"?lt=Qp(r.shift):r.shift.label?lt=r.shift.label:lt=(N=Qp(r.shift.latex||r.shift.insert||"")||r.shift.key)!=null?N:"",B+=`<span class="MLK__shift">${lt}</span>`}r.aside&&(B+=`<aside>${r.aside}</aside>`)}return r.layer&&!/layer-switch/.test(U)&&(U+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(U)||(U+=" MLK__keycap"),!/\bw[0-9]+\b/.test(U)&&r.width&&(U+=(I={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[r.width])!=null?I:""),[B,U||"MLK__keycap"]}var e0={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"−",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"÷"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"×",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function iy(r){var o;if(typeof r=="string"){if(r==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(r="[,]"),!e0[r])return{latex:r};r={label:r}}let u;return"label"in r&&r.label&&e0[r.label]&&(u=F(ot(ot({},e0[r.label]),r),{label:e0[r.label].label})),"key"in r&&r.key&&e0[r.key]&&(u=F(ot(ot({},e0[r.key]),r),{key:e0[r.key].key})),u?(u.command==="insertDecimalSeparator"&&(u.label=(o=window.MathfieldElement.decimalSeparator)!=null?o:"."),r.label==="[action]"&&(u=ot(ot({},u),window.mathVirtualKeyboard.actionKeycap)),r.label==="[shift]"&&(u=ot(ot({},u),window.mathVirtualKeyboard.shiftKeycap)),r.label==="[backspace]"&&(u=ot(ot({},u),window.mathVirtualKeyboard.backspaceKeycap)),r.label==="[tab]"&&(u=ot(ot({},u),window.mathVirtualKeyboard.tabKeycap)),u):r}var U0;function l1(r){var o;if(r.button!==0)return;const u=gp.singleton;if(!u)return;let f=r.target;for(;f&&!f.getAttribute("data-layer");)f=f.parentElement;if(f){u.currentLayer=(o=f.getAttribute("data-layer"))!=null?o:"",r.preventDefault();return}const g=jc(r.target);if(!(g!=null&&g.id))return;const b=u.getKeycap(g.id);if(!b)return;console.assert(r.type==="pointerdown");const M=new AbortController,N=M.signal;g.classList.add("is-pressed"),g.addEventListener("pointerenter",Bd(M),{capture:!0,signal:N}),g.addEventListener("pointerleave",Bd(M),{capture:!0,signal:N}),g.addEventListener("pointercancel",Bd(M),{signal:N}),g.addEventListener("pointerup",Bd(M),{signal:N}),Fd(b)&&(g.classList.add("is-active"),u.shiftPressCount++),b.variants&&(U0&&clearTimeout(U0),U0=setTimeout(()=>{g.classList.contains("is-pressed")&&(g.classList.remove("is-pressed"),g.classList.add("is-active"),r.target&&"releasePointerCapture"in r.target&&r.target.releasePointerCapture(r.pointerId),Hg(g,()=>{M.abort(),g==null||g.classList.remove("is-active")}))},300)),r.preventDefault()}function Bd(r){return o=>{const u=jc(o.target);if(!(u!=null&&u.id))return;const f=gp.singleton;if(!f)return;const g=f.getKeycap(u.id);if(g){if(o.type==="pointerenter"&&o.target===u&&o.isPrimary&&u.classList.add("is-pressed"),o.type==="pointercancel"){u.classList.remove("is-pressed"),Fd(g)&&(f.shiftPressCount--,u.classList.toggle("is-active",f.isShifted)),r.abort();return}if(o.type==="pointerleave"&&o.target===u){u.classList.remove("is-pressed"),Fd(g)&&(f.shiftPressCount--,u.classList.toggle("is-active",f.isShifted));return}if(o.type==="pointerup"){U0&&clearTimeout(U0),Fd(g)?u.classList.toggle("is-active",f.isShifted):u.classList.contains("is-pressed")&&(u.classList.remove("is-pressed"),f.isShifted&&g.shift?typeof g.shift=="string"?f.executeCommand(["insert",g.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):mp(g.shift):mp(g),f.shiftPressCount===1&&!o.shiftKey&&(f.shiftPressCount=0)),r.abort(),o.preventDefault();return}}}}function mp(r){var o;let u=r.command;!u&&r.insert&&(u=["insert",r.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!u&&r.key&&(u=["typedText",r.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!u&&r.latex&&(u=["insert",r.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),u||(u=["typedText",r.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(o=gp.singleton)==null||o.executeCommand(u)}function dx(r){if(r.nodeType!==1)return!1;const o=r.classList;return o.contains("MLK__keycap")||o.contains("shift")||o.contains("action")||o.contains("fnbutton")||o.contains("bigfnbutton")}function jc(r){if(!r)return;let o=r;for(;o&&!dx(o);)o=o.parentElement;return o!=null?o:void 0}function Fd(r){return!!r.class&&/(^|\s)shift($|\s)/.test(r.class)}var gp=class B2{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var o,u,f;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(u=(o=window.document)==null?void 0:o.body)!=null?u:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(g=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(f=window.top)==null||f.addEventListener("message",this)}catch(g){window.addEventListener("message",this)}document.body.addEventListener("focusin",g=>{const b=g.target;b!=null&&b.isConnected&&setTimeout(()=>{const M=ny();M&&!M.readOnly&&M.mathVirtualKeyboardPolicy==="auto"&&Zt()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",g=>{g.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{ny()||this.hide()},300)})}get currentLayer(){var o,u,f;return(f=(u=(o=this._element)==null?void 0:o.querySelector(".MLK__layer.is-visible"))==null?void 0:u.id)!=null?f:""}set currentLayer(o){var u;if(!this._element){this.latentLayer=o;return}let f=o?this._element.querySelector(`#${o}.MLK__layer`):null;f||(f=this._element.querySelector(".MLK__layer")),f&&((u=this._element.querySelector(".MLK__layer.is-visible"))==null||u.classList.remove("is-visible"),f.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(o){var u;this._shiftPressCount=o>2||o<0?0:o,(u=this._element)==null||u.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(o){const u="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[u]=o,u}getKeycap(o){return o?this.keycapRegistry[o]:void 0}getLayer(o){const u=this.normalizedLayouts;for(const f of u)for(const g of f.layers)if(g.id===o)return g}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(o){this._alphabeticLayout=o,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(o){this._actionKeycap=typeof o=="string"?{label:o}:o}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(o){this._shiftKeycap=typeof o=="string"?{label:o}:o}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(o){this._backspaceKeycap=typeof o=="string"?{label:o}:o}get tabKeycap(){return this._tabKeycap}set tabKeycap(o){this._tabKeycap=typeof o=="string"?{label:o}:o}get layouts(){return this._layouts}set layouts(o){this.updateNormalizedLayouts(o),this.rebuild()}updateNormalizedLayouts(o){const u=Array.isArray(o)?[...o]:[o],f=u.findIndex(g=>g==="default");f>=0&&u.splice(f,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(u),this._normalizedLayouts=u.map(g=>Wg(g))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(o){this._editToolbar=o,this.rebuild()}get container(){return this._container}set container(o){this._container=o,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new B2}catch(o){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(o,u,f){this.listeners[o]||(this.listeners[o]=new Set),this.listeners[o].has(u)||this.listeners[o].add(u)}dispatchEvent(o){return!this.listeners[o.type]||this.listeners[o.type].size===0?!0:(this.listeners[o.type].forEach(u=>{typeof u=="function"?u(o):u==null||u.handleEvent(o)}),!o.defaultPrevented)}removeEventListener(o,u,f){this.listeners[o]&&this.listeners[o].delete(u)}get element(){return this._element}set element(o){var u;this._element!==o&&((u=this._element)==null||u.remove(),this._element=o)}get visible(){return this._visible}set visible(o){o?this.show():this.hide()}get boundingRect(){var o;if(!this._visible)return new DOMRect;const u=(o=this._element)==null?void 0:o.getElementsByClassName("MLK__plate")[0];return u?u.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var o,u;const f=this.boundingRect.height;if(this.container===document.body){(o=this._element)==null||o.style.setProperty("--_keyboard-height",`calc(${f}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const g=f-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${g}px)`:`${g}px`}else(u=this._element)==null||u.style.setProperty("--_keyboard-height",`${f}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const o=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=o,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const o=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(o&&(o.backdrop||o.container)));const u=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(u)for(const f of u){const g=this.getKeycap(f.id);if(g){const[b,M]=t0(g,{shifted:this.isShifted});f.innerHTML=window.MathfieldElement.createHTML(b),f.className=M}}}show(o){var u;if(this._visible)return;const f=this.container;if(f&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const g=this._element.getElementsByClassName("MLK__plate")[0];if(g&&this.observer.observe(g),f===window.document.body){const b=f.style.paddingBottom;this.originalContainerBottomPadding=b;const M=g.offsetHeight-1;f.style.paddingBottom=b?`calc(${b} + ${M}px)`:`${M}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(u=this._element)==null||u.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,o!=null&&o.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var g;return(g=this._element)==null?void 0:g.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(o){var u;const f=this.container;if(f&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const g=this._element.getElementsByClassName("MLK__plate")[0];g&&this.observer.unobserve(g),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),K0(),Ff(),(u=this._element)==null||u.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(f.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var o,u;return(u=(o=this.element)==null?void 0:o.offsetHeight)!=null?u:0}buildAndAttachElement(){var o;console.assert(!this.element),this.element=V0(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",u=>{u.shiftKey||((u.ctrlKey||u.button===2)&&Hg(u.target),u.preventDefault(),u.stopPropagation())},{capture:!0}),(o=this.container)==null||o.appendChild(this.element)}handleEvent(o){if(jg(o)){if(!Xl(o.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${o.origin}) cannot be handled`,"SecurityError");o.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:o.data.action!=="update-setting"&&o.data.action!=="proxy-created"&&o.data.action!=="execute-command"&&(console.assert(o.source!==void 0),this.connectedMathfieldWindow=o.source),this.handleMessage(o.data,o.source)}if(this._element)switch(o.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":o.button!==2&&o.preventDefault();break;case"keydown":{o.key==="Shift"&&!o.repeat&&(this.shiftPressCount=1);break}case"keyup":{(o.key==="Shift"||!o.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(o,u){const{action:f}=o;if(f==="execute-command"){const{command:g}=o,b=gd(g);if(window.top!==void 0&&b!=="virtual-keyboard")return;this.executeCommand(g);return}if((f==="connect"||f==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},u),f!=="disconnect"&&window===window.top){if(f==="show"){typeof o.animate!="undefined"?this.show({animate:o.animate}):this.show();return}if(f==="hide"){typeof o.animate!="undefined"?this.hide({animate:o.animate}):this.hide();return}if(f==="update-setting"){o.alphabeticLayout&&(this.alphabeticLayout=o.alphabeticLayout),o.layouts&&(this.layouts=o.layouts),o.editToolbar&&(this.editToolbar=o.editToolbar);return}if(f==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},u);return}}}sendMessage(o,u,f){if(f||(f=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||f===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:ot({type:Dm,action:o},u)}));return}if(f)f.postMessage(ot({type:Dm,action:o},u),{targetOrigin:this.targetOrigin});else if(u.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:u.command})),o==="execute-command"&&Array.isArray(u.command)&&u.command[0]==="insert"){const g=u.command[1].split("");for(const b of g)this.dispatchEvent(new KeyboardEvent("keydown",{key:b,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:b,bubbles:!0}))}}stateWillChange(o){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:o},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(o){const u=this._element;if(!u)return;u.classList.toggle("is-math-mode",o.mode==="math"),u.classList.toggle("is-text-mode",o.mode==="text"),u.classList.toggle("can-undo",o.canUndo),u.classList.toggle("can-redo",o.canRedo),u.classList.toggle("can-copy",!o.selectionIsCollapsed),u.classList.toggle("can-copy",!o.selectionIsCollapsed),u.classList.toggle("can-paste",!0);const f=u.querySelectorAll(".ML__edit-toolbar");if(f)for(const g of f)g.innerHTML=s1(this,o)}update(o){this._style=o.style,this.updateToolbar(o)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(o){let u,f=[],g=gd(o);return ne(o)?(u=o[0],u==="performWithFeedback"&&(o=o.slice(1),g=gd(o)),f=o.slice(1)):u=o,u=u.replace(/-\w/g,b=>b[1].toUpperCase()),g==="virtual-keyboard"?ao[u].fn(void 0,...f):(this.sendMessage("execute-command",{command:o}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function ny(){var r,o;let u=id(),f=null;for(;u;){if("host"in u&&((o=(r=u.host)==null?void 0:r.tagName)==null?void 0:o.toLowerCase())==="math-field"){f=u.host;break}u=u.parentNode}return f}if(le()&&!("mathVirtualKeyboard"in window))if(window===window.top){const r=gp.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>r})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>Kg.singleton,configurable:!0});function i0(r){const o={};for(const u of Object.keys(r))switch(u){case"scriptDepth":const f=r.scriptDepth;if(ne(f))o.scriptDepth=[f[0],f[1]];else if(typeof f=="number")o.scriptDepth=[f,f];else if(typeof f=="string"){const[b,M]=f.split(",").map(N=>parseInt(N.trim()));o.scriptDepth=[b,M]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let g=r.mathVirtualKeyboardPolicy.toLowerCase();if(g==="sandboxed"){if(window!==window.top){const b=gp.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>b})}g="manual"}o.mathVirtualKeyboardPolicy=g;break;case"letterShapeStyle":r.letterShapeStyle==="auto"?Vt.locale.startsWith("fr")?o.letterShapeStyle="french":o.letterShapeStyle="tex":o.letterShapeStyle=r.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(r.defaultMode)?o.defaultMode=r.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),o.defaultMode="math");break;case"macros":o.macros=yo(r.macros);break;default:ne(r[u])?o[u]=[...r[u]]:typeof r[u]=="object"&&!(r[u]instanceof Element)&&u!=="computeEngine"?o[u]=ot({},r[u]):o[u]=r[u]}return o}function Pl(r,o){let u;typeof o=="string"?u=[o]:o===void 0?u=Object.keys(r):u=o;const f={};for(const g of u)r[g]===null?f[g]=null:ne(r[g])?f[g]=[...r[g]]:typeof r[g]=="object"&&!(r[g]instanceof Element)&&g!=="computeEngine"?f[g]=ot({},r[g]):f[g]=r[g];return typeof o=="string"?f[o]:f}function Z0(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:fi,backgroundColorMap:Ht,letterShapeStyle:Vt.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:r=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(r),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:Ih,inlineShortcuts:gu,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:Tc,value:""}}function bi(r){return r.defaultMode==="inline-math"?"math":r.defaultMode}function Ql(r,o){!r||!o||(ne(r)?r.forEach(u=>Ql(u,o)):typeof r=="object"&&!r.style.color&&!r.style.backgroundColor&&!r.style.fontFamily&&!r.style.fontShape&&!r.style.fontSeries&&!r.style.fontSize&&!r.style.variant&&!r.style.variantStyle&&(r.applyStyle(o),Ql(r.body,o),Ql(r.above,o),Ql(r.below,o),Ql(r.subscript,o),Ql(r.superscript,o)))}function Fm(r,o,u,f){function g(M,N){for(const I of b)if(I.style[M]!==N)return!1;return!0}if(o=r.normalizeRange(o),o[0]===o[1])return!1;const b=r.getAtoms(o,{includeChildren:!0});f.operation==="toggle"&&(u.color&&g("color",u.color)&&(u.color="none",delete u.verbatimColor),u.backgroundColor&&g("backgroundColor",u.backgroundColor)&&(u.backgroundColor="none",delete u.verbatimBackgroundColor),u.fontFamily&&g("fontFamily",u.fontFamily)&&(u.fontFamily="none"),u.fontSeries&&g("fontSeries",u.fontSeries)&&(u.fontSeries="auto"),u.fontShape&&g("fontShape",u.fontShape)&&(u.fontShape="auto"),u.fontSize&&g("fontSize",u.fontSize)&&(u.fontSize=Hi),u.variant&&g("variant",u.variant)&&(u.variant="normal"),u.variantStyle&&g("variantStyle",u.variantStyle)&&(u.variantStyle=""));for(const M of b)M.applyStyle(u);return!0}function px(r,o){const u=r.at(r.position);if(u.type==="composition")u.value=o;else{const{caret:f}=u;u.caret=void 0;const g=new Qu(o,{mode:u.mode});g.caret=f,u.parent.addChildAfter(g,u),r.position+=1}}function Zg(r){const o=r.at(r.position);o.type==="composition"&&(o.parent.removeChild(o),r.position-=1)}er(["math","displaymath"],xf),er("center",xf),Se("displaylines","",{parse:r=>{const o=[];let u=[];r.beginContext({tabular:!0});do{if(r.end()||r.match("<}>"))break;r.matchColumnSeparator()||r.matchRowSeparator()?(o.push([u]),u=[]):u.push(...r.scan(f=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(f)))}while(!0);return r.endContext(),o.push([u]),o},createAtom:r=>new ts("lines",r.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),rr("array","{columns:colspec}",(r,o,u,f)=>new ts(r,zf(o),u,{columns:f[0],mathstyleName:"textstyle"})),rr(["equation","equation*","subequations"],"",(r,o,u)=>new ts(r,zf(o),u,{columns:[{align:"c"}]})),rr(["multline","multline*"],"",xf),rr(["align","align*","aligned","eqnarray"],"",xf),rr("split","",xf),rr(["gather","gathered"],"",xf),rr(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",xf),rr(["smallmatrix","smallmatrix*"],"[columns:colspec]",xf),rr(["cases","dcases","rcases"],"",xf);function u1(r){for(const o of r)for(const u of o)if(u.length>0)return!1;return!0}function zf(r,o=1){return u1(r)?Array(o).fill([[new ae({type:"first"}),new Hr]]):r.map(u=>u.length===0?[[new ae({type:"first"})]]:u.map(f=>f.length===0?[new ae({type:"first"})]:(f[0].type!=="first"&&f.unshift(new ae({type:"first"})),f)))}function xf(r,o=[[[]]],u=[],f=[]){switch(o=zf(o,["split","align","align*","aligned","eqnarray"].includes(r)?2:1),r){case"math":return new ts(r,o,u,{mathstyleName:"textstyle"});case"displaymath":return new ts(r,o,u,{mathstyleName:"textstyle"});case"center":return new ts(r,o,u,{columns:[{align:"c"}]});case"multline":case"multline*":return new ts(r,o,u,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new ts(r,o,u,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new ts(r,o,u,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new ts(r,o,u,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:of(f[0])});case"bmatrix":case"bmatrix*":return new ts(r,o,u,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:of(f[0])});case"Bmatrix":case"Bmatrix*":return new ts(r,o,u,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:of(f[0])});case"vmatrix":case"vmatrix*":return new ts(r,o,u,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:of(f[0])});case"Vmatrix":case"Vmatrix*":return new ts(r,o,u,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:of(f[0])});case"matrix":case"matrix*":return new ts(r,o,u,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:of(f==null?void 0:f[0])});case"smallmatrix":case"smallmatrix*":return new ts(r,o,u,{mathstyleName:"scriptstyle",columns:of(f==null?void 0:f[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new ts(r,o,u,{mathstyleName:r==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new ts(r,o,u,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new ts(r,o,u,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let g=0;for(const N of o)g=Math.max(g,N.length);const b=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let M=2;for(;M<g;)b.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),M+=2;return b.push({gap:0}),new ts(r,o,u,{arraycolsep:0,columns:b,minColumns:2})}}return new ts(r,o,u,{mathstyleName:"textstyle"})}function of(r){return r!=null?r:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function h1(r,o){let u=r.at(r.position);for(;u&&!(u.parent instanceof ts);)u=u.parent;if(u&&u.type==="array"&&u.environmentName,!u||!(u.parent instanceof ts)){const f=r.at(r.position);if(u=f,!u.parent.parent){let g=r.extractAtoms([r.position,r.lastOffset]),b=r.extractAtoms([0,r.position]);b.length===0&&(b=jm()),g.length===0&&(g=jm());let M;return o.endsWith("column")?(M=xf("split",[[b,g]]),r.root=M,vp(M,0,0)?yp(r,M,0,0):vp(M,0,1)?yp(r,M,0,1):r.position=r.offsetOf(f)):(M=xf("lines",[[b],[g]]),r.root=M,vp(M,0,0)?yp(r,M,0,0):vp(M,1,0)?yp(r,M,1,0):r.position=r.offsetOf(f)),[void 0,[0,0]]}if(u.parent instanceof wa){const g=u.parent;let b=r.extractAtoms([r.position,r.offsetOf(g.lastChild)]),M=r.extractAtoms([r.offsetOf(g.firstChild),r.position]);M.length===0&&(M=jm()),b.length===0&&(b=jm());let N="pmatrix";const I=g.leftDelim,B=g.rightDelim;I==="("&&(B===")"||B==="?")?N="pmatrix":(I==="["||I==="\\lbrack")&&(B==="]"||B==="\\rbrack"||B==="?")?N="bmatrix":I==="\\vert"&&B==="\\vert"?N="vmatrix":I==="\\Vert"&&B==="\\Vert"?N="Vmatrix":(I==="{"||I==="\\lbrace")&&(B==="."||B==="?")&&(N="cases");const U=xf(N,o.endsWith("column")?[[M,b]]:[[M],[b]]);return g.parent.addChildBefore(U,g),g.parent.removeChild(g),vp(U,0,0)?yp(r,U,0,0):o.endsWith("column")?vp(U,0,1)?yp(r,U,0,1):r.position=r.offsetOf(u):vp(U,1,0)?yp(r,U,1,0):r.position=r.offsetOf(u),[void 0,[0,0]]}}return u&&u.parent instanceof ts?[u.parent,u.parentBranch]:[void 0,[0,0]]}function vp(r,o,u){const f=r.getCell(o,u);return!f||f.length!==2?!1:f[1].type==="placeholder"}function c1(r,o,u,f){const g=o.getCell(u,f);return g?[r.offsetOf(g[0]),r.offsetOf(g[g.length-1])]:-1}function yp(r,o,u,f){const g=c1(r,o,u,f);typeof g!="number"&&r.setSelection(g)}function zm(r,o,u,f,g){const b=o.getCell(u,f);b&&r.setPositionHandlingPlaceholder(r.offsetOf(b[g==="start"?0:b.length-1]))}function G0(r,o){const[u,[f,g]]=h1(r,o);if(u)switch(o){case"after row":u.addRowAfter(f),zm(r,u,f+1,0,"end");break;case"after column":if(u.maxColumns<=u.colCount){r.announce("plonk");return}u.addColumnAfter(g),zm(r,u,f,g+1,"end");break;case"before row":u.addRowBefore(f),zm(r,u,f,0,"start");break;case"before column":if(u.maxColumns<=u.colCount){r.announce("plonk");return}u.addColumnBefore(g),zm(r,u,f,g,"start");break}}function vd(r){return r.contentWillChange({inputType:"insertText"})?(G0(r,"after row"),r.contentDidChange({inputType:"insertText"}),!0):!1}function ry(r){return r.contentWillChange({inputType:"insertText"})?(G0(r,"before row"),r.contentDidChange({inputType:"insertText"}),!0):!1}function Gg(r){return r.contentWillChange({inputType:"insertText"})?(G0(r,"after column"),r.contentDidChange({inputType:"insertText"}),!0):!1}function zd(r){return r.contentWillChange({inputType:"insertText"})?(G0(r,"before column"),r.contentDidChange({inputType:"insertText"}),!0):!1}function $m(r,o){if(!r.contentWillChange({}))return!1;r.mathfield.snapshot();let u=".",f=".";switch(o){case"pmatrix":case"pmatrix*":u="(",f=")";break;case"bmatrix":case"bmatrix*":u="[",f="]";break;case"Bmatrix":case"Bmatrix*":u="\\lbrace",f="\\rbrace";break;case"vmatrix":case"vmatrix*":u="\\vert",f="\\vert";break;case"Vmatrix":case"Vmatrix*":u="\\Vert",f="\\Vert";break;case"matrix":case"matrix*":u=".",f=".";break;case"cases":case"dcases":u="\\lbrace";break;case"rcases":f="\\rbrace";break}const g=r.at(r.position),b=g.type==="array"?g:r.parentEnvironment;return b.environmentName=o,b.leftDelim=u,b.rightDelim=f,r.contentDidChange({}),!0}function Xg(r,o){let u=r.at(r.position);for(;u&&!(Array.isArray(u.parentBranch)&&u.parent instanceof ts);)u=u.parent;if(Array.isArray(u==null?void 0:u.parentBranch)&&(u==null?void 0:u.parent)instanceof ts){const f=u.parent,g=u.parentBranch;let b;switch(o){case"row":if(f.rowCount>1){f.removeRow(g[0]);const M=f.getCell(Math.max(0,g[0]-1),g[1]);b=r.offsetOf(M[M.length-1])}break;case"column":if(f.colCount>f.minColumns){f.removeColumn(g[1]);const M=f.getCell(g[0],Math.max(0,g[1]-1));b=r.offsetOf(M[M.length-1])}break}b&&r.setPositionHandlingPlaceholder(b)}}function f1(r){return r.contentWillChange({inputType:"deleteContent"})?(Xg(r,"row"),r.contentDidChange({inputType:"deleteContent"}),!0):!1}function oy(r){return r.contentWillChange({inputType:"deleteContent"})?(Xg(r,"column"),r.contentDidChange({inputType:"deleteContent"}),!0):!1}vu({addRowAfter:vd,addColumnAfter:Gg,addRowBefore:ry,addColumnBefore:zd,removeRow:f1,removeColumn:oy,setEnvironment:$m},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function jm(){return[new Hr]}var yd=class F2{constructor(o){this.recording=!1,this.model=o,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(o){o&&this.index>=0&&(this.stack[this.index].selection=o),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(o){return this.recording?(o&&o===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>F2.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=o!=null?o:"",!0):!1}};yd.maximumDepth=1e3;var d1=yd;function pr(r,o,u){if(r.at(o).mode!=="text")return o;const f=u==="backward"?-1:1;let g;if(z.test(r.at(o).value)){let b=o,M;do M=r.at(b).mode==="text"&&z.test(r.at(b).value),b+=f;while(r.at(b)&&M);g=r.at(b)?b-2*f:b-f}else if(/\s/.test(r.at(o).value)){let b=o;for(;r.at(b)&&r.at(b).mode==="text"&&/\s/.test(r.at(b).value);)b+=f;if(!r.at(b))g=b-f;else{let M=!0;do M=r.at(b).mode==="text"&&!/\s/.test(r.at(b).value),b+=f;while(r.at(b)&&M);g=r.at(b)?b-2*f:b-f}}else{let b=o;for(;r.at(b)&&r.at(b).mode==="text"&&!/\s/.test(r.at(b).value);)b+=f;g=r.at(b)?b:b-f;let M=!0;for(;r.at(b)&&M;)M=r.at(b).mode==="text"&&/\s/.test(r.at(b).value),M&&(g=b),b+=f;g=r.at(b)?b-2*f:b-f}return g-(f>0?0:1)}function xp(r,o,u){var f,g,b,M,N,I,B;const U=r.position;(f=u==null?void 0:u.extend)!=null&&f||r.collapseSelection(o);let lt=r.at(r.position);if(o==="forward"&&(lt.type==="subsup"?(lt=lt.rightSibling,lt||(lt=r.at(r.position+1))):lt=r.at(r.position+1)),!lt)return r.announce("plonk"),!1;let Lt=r.offsetOf(lt);if(lt instanceof Wl)Lt=pr(r,Lt,o);else if(lt instanceof bh)if(lt.isSuggestion)for(console.assert(o==="forward");lt&< instanceof bh;)lt.isSuggestion=!1,Lt=r.offsetOf(lt),lt=lt.rightSibling;else if(o==="forward"){if(lt=lt.rightSibling,!lt||!(lt instanceof bh))return r.announce("plonk"),!1;for(;lt&< instanceof bh&&/[a-zA-Z\*]/.test(lt.value);)Lt=r.offsetOf(lt),lt=lt.rightSibling}else{if(lt=lt.leftSibling,!lt||!(lt instanceof bh))return r.announce("plonk"),!1;for(;lt&< instanceof bh&&/[a-zA-Z\*]/.test(lt.value);)Lt=r.offsetOf(lt),lt=lt.leftSibling}else if(o==="forward"&<.type==="mopen"){let Bt=0;do lt.type==="mopen"?Bt+=1:lt.type==="mclose"&&(Bt-=1),lt=lt.rightSibling;while(!lt.isLastSibling&&Bt!==0);Lt=r.offsetOf(lt.leftSibling)}else if(o==="backward"&<.type==="mclose"){let Bt=0;do lt.type==="mopen"?Bt+=1:lt.type==="mclose"&&(Bt-=1),lt=lt.leftSibling;while(!lt.isFirstSibling&&Bt!==0);Lt=r.offsetOf(lt)}else if(o==="backward")if(lt.type==="first")for(;Lt>0&<.type==="first";)Lt-=1,lt=r.at(Lt);else{const Bt=lt.type;lt.type==="subsup"&&(Lt=r.offsetOf(r.at(Lt).leftSibling)),Lt-=1;let jt=(g=r.at(Lt))==null?void 0:g.type;for(;Lt>=0&&jt===Bt;)((b=r.at(Lt))==null?void 0:b.type)==="subsup"?Lt=r.offsetOf(r.at(Lt).leftSibling):Lt-=1,jt=r.at(Lt).type}else{const{type:Bt}=lt;let jt=(M=r.at(Lt))==null?void 0:M.type;const{lastOffset:je}=r;for(;Lt<=je&&(jt===Bt||jt==="subsup");){for(;((N=r.at(Lt).rightSibling)==null?void 0:N.type)==="subsup";)Lt=r.offsetOf(r.at(Lt).rightSibling);Lt+=1,jt=(I=r.at(Lt))==null?void 0:I.type}Lt-=1}if((B=u==null?void 0:u.extend)!=null&&B){if(!r.setSelection(r.anchor,Lt))return r.announce("plonk"),!1}else{if(Lt===r.position)return r.announce("plonk"),!1;r.position=Lt}return r.announce("move",U),r.mathfield.stopCoalescingUndo(),!0}function Ee(r,o,u){var f,g;if(u=u!=null?u:{extend:!1},r.mathfield.adoptStyle=o==="backward"?"right":"left",o!=="forward"){const[N,I]=r1(r);N!==void 0&&I!==void 0&&r.deleteAtoms([N,I])}if(o==="upward")return Bh(r,u);if(o==="downward")return m1(r,u);if(u.extend){let N=wf(r,r.position,o);N<0&&(N=0),N>r.lastOffset&&(N=r.lastOffset);const I=r.setSelection(r.anchor,N);return r.mathfield.stopCoalescingUndo(),I}if(r.selectionIsPlaceholder){r.collapseSelection(o);const N=Ee(r,o);return r.mathfield.stopCoalescingUndo(),N}let b=r.position;const M=b;if(r.collapseSelection(o)?(b=r.position,sy(r,b)||(b=wf(r,b,o))):b=wf(r,b,o),b<0||b>r.lastOffset){let N=!0;return r.silenceNotifications||(N=(g=(f=r.mathfield.host)==null?void 0:f.dispatchEvent(new CustomEvent("move-out",{detail:{direction:o},cancelable:!0,bubbles:!0,composed:!0})))!=null?g:!0),N&&r.announce("plonk"),N}return r.setPositionHandlingPlaceholder(b),r.mathfield.stopCoalescingUndo(),r.announce("move",M),!0}function wf(r,o,u){return o=o+(u==="forward"?1:-1),o<0||o>r.lastOffset||sy(r,o)?o:wf(r,o,u)}function sy(r,o){var u;const f=r.at(o);let g=f.parent;for(;g&&!g.inCaptureSelection;)g=g.parent;return!(g!=null&&g.inCaptureSelection||(u=f.parent)!=null&&u.skipBoundary&&(!f.isFirstSibling&&f.isLastSibling||f.type==="first")||r.mathfield.hasEditablePrompts&&!f.parentPrompt)}function p1(r,o,u){let f=1/0,g=0;for(;g<o.length;g++){const b=Uh(r.getHTMLElement(o[g])).right,M=Math.abs(u-b);if(M<=f)f=M;else break}return o[g-1]}function Km(r,o,u,f,g){const b=r.mathfield.hasEditablePrompts,M=b?u.filter(B=>B.type==="prompt"&&!B.captureSelection):u,N=Uh(r.mathfield.getHTMLElement(o)).right,I=r.offsetOf(p1(r.mathfield,M,N))-(b?1:0);if(f){const[B,U]=r.selection.ranges[0];let lt;I<(g==="up"?B:U)?lt={ranges:[[I,U]],direction:"backward"}:lt={ranges:[[B,I]],direction:"forward"},r.setSelection(lt)}else r.setPositionHandlingPlaceholder(I);r.announce(`move ${g}`)}function Bh(r,o){var u,f;const g=(u=o==null?void 0:o.extend)!=null?u:!1;g||r.collapseSelection("backward");const b=()=>{var I,B;let U=!0;return r.silenceNotifications||(U=(B=(I=r.mathfield.host)==null?void 0:I.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?B:!0),r.announce(U?"plonk":"line"),U},M=r.at(r.position);let N=M;for(;N&&N.parentBranch!=="below"&&!(Array.isArray(N.parentBranch)&&N.parent instanceof ts);)N=N.parent;if(Array.isArray(N==null?void 0:N.parentBranch)&&N.parent instanceof ts){const I=N.parent;if(N.parentBranch[0]<1)return b();const B=N.parentBranch[0]-1,U=I.array[B][N.parentBranch[1]];if(!U.some(Lt=>Lt.type==="prompt"&&!Lt.captureSelection)&&r.mathfield.hasEditablePrompts)return b();Km(r,M,U,g,"up")}else if(N){const I=(f=N.parent.branch("above"))!=null?f:N.parent.createBranch("above");if(!I.some(U=>U.type==="prompt"&&U.placeholderId)&&r.mathfield.hasEditablePrompts)return b();Km(r,M,I,g,"up")}else return b();return r.mathfield.stopCoalescingUndo(),!0}function m1(r,o){var u,f;const g=(u=o==null?void 0:o.extend)!=null?u:!1;g||r.collapseSelection("forward");const b=()=>{var I,B;let U=!0;return r.silenceNotifications||(U=(B=(I=r.mathfield.host)==null?void 0:I.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?B:!0),r.announce(U?"plonk":"line"),U},M=r.at(r.position);let N=M;for(;N&&N.parentBranch!=="above"&&!(Array.isArray(N.parentBranch)&&N.parent instanceof ts);)N=N.parent;if(Array.isArray(N==null?void 0:N.parentBranch)&&N.parent instanceof ts){const I=N.parent;if(N.parentBranch[0]+1>I.array.length-1)return b();const B=N.parentBranch[0]+1,U=I.array[B][N.parentBranch[1]];if(!U.some(Lt=>Lt.type==="prompt"&&!Lt.captureSelection)&&r.mathfield.hasEditablePrompts)return b();Km(r,M,U,g,"down")}else if(N){const I=(f=N.parent.branch("below"))!=null?f:N.parent.createBranch("below");if(!I.some(U=>U.type==="prompt")&&r.mathfield.hasEditablePrompts)return b();Km(r,M,I,g,"down")}else return b();return!0}function Hm(r){const o=r.position,u=r.at(o).parent;return u!=null&&u.parent?(r.position=r.offsetOf(u),r.mathfield.stopCoalescingUndo(),r.announce("move",o),!0):(r.announce("plonk"),!1)}function Yg(r){let o=0,u=r.at(r.position),f=!1;for(;u;)(!u.hasEmptyBranch("superscript")||!u.hasEmptyBranch("subscript"))&&(o+=1),u.hasEmptyBranch("superscript")?u.hasEmptyBranch("subscript")||(f=!1):f=!0,u=u.parent;return f?o:0}function Vm(r){let o=0,u=r.at(r.position),f=!1;for(;u;)(!u.hasEmptyBranch("superscript")||!u.hasEmptyBranch("subscript"))&&(o+=1),u.hasEmptyBranch("superscript")?u.hasEmptyBranch("subscript")||(f=!0):f=!1,u=u.parent;return f?o:0}function ay(r){var o;if(r.collapseSelection(),Yg(r)>=r.mathfield.options.scriptDepth[1])return r.announce("plonk"),!1;let u=r.at(r.position);return u.subsupPlacement===void 0&&(((o=u.rightSibling)==null?void 0:o.type)!=="subsup"&&u.parent.addChildAfter(new lh({style:u.computedStyle}),u),u=u.rightSibling),u.createBranch("superscript"),r.setSelection(r.getSiblingsRange(r.offsetOf(u.superscript[0]))),!0}function ly(r){var o;if(r.collapseSelection(),Vm(r)>=r.mathfield.options.scriptDepth[0])return r.announce("plonk"),!1;let u=r.at(r.position);return u.subsupPlacement===void 0&&(((o=r.at(r.position+1))==null?void 0:o.type)!=="subsup"&&u.parent.addChildAfter(new lh({style:r.at(r.position).computedStyle}),u),u=r.at(r.position+1)),u.createBranch("subscript"),r.setSelection(r.getSiblingsRange(r.offsetOf(u.subscript[0]))),!0}function uy(){function r(I){const B=[],U=[];return[...I.querySelectorAll(`input, select, textarea, a[href], button,
|
|
|
[tabindex], audio[controls], video[controls],
|
|
|
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(o).forEach((Lt,Bt)=>{const jt=f(Lt);jt===0?B.push(Lt):U.push({documentOrder:Bt,tabIndex:jt,node:Lt})}),U.sort((Lt,Bt)=>Lt.tabIndex===Bt.tabIndex?Lt.documentOrder-Bt.documentOrder:Lt.tabIndex-Bt.tabIndex).map(Lt=>Lt.node).concat(B)}function o(I){return!(!u(I)||g(I)||f(I)<0)}function u(I){return!(I.disabled||I.type==="hidden"&&I.tagName.toUpperCase()==="INPUT"||N(I))}function f(I){var B;const U=Number.parseInt((B=I.getAttribute("tabindex"))!=null?B:"NaN",10);return Number.isNaN(U)?I.contentEditable==="true"||(I.nodeName==="AUDIO"||I.nodeName==="VIDEO")&&I.getAttribute("tabindex")===null?0:I.tabIndex:U}function g(I){return I.tagName.toUpperCase()==="INPUT"&&I.type==="radio"&&!M(I)}function b(I,B){for(const U of I)if(U.checked&&U.form===B)return U;return null}function M(I){var B;if(!I.name)return!0;const lt=((B=I.form)!=null?B:I.ownerDocument).querySelectorAll('input[type="radio"][name="'+I.name+'"]'),Lt=b(lt,I.form);return!Lt||Lt===I}function N(I){if(!le()||I===document.activeElement||I.contains(document.activeElement))return!1;if(getComputedStyle(I).visibility==="hidden")return!0;const B=I.getBoundingClientRect();if(B.width===0||B.height===0)return!0;for(;I;){if(getComputedStyle(I).display==="none")return!0;I=I.parentElement}return!1}return le()?r(document.body):[]}function hc(r,o,u="forward"){const f=r.position;if(Array.isArray(o)){const g=r.offsetOf(o[0]),b=r.offsetOf(o[o.length-1]);return u==="forward"?r.setSelection(g,b):r.setSelection(b,g),r.announce("move",f),r.mathfield.stopCoalescingUndo(),!0}return u==="forward"?hc(r,[o.leftSibling,o]):hc(r,[o,o.leftSibling])}function $f(r,o){const u=r.position;if(typeof o=="number"&&(o=r.at(o)),o.type==="prompt")r.setSelection(r.offsetOf(o.firstChild),r.offsetOf(o.lastChild));else{const f=r.offsetOf(o);o.type==="placeholder"?r.setSelection(f-1,f):r.position=f}return r.announce("move",u),r.mathfield.stopCoalescingUndo(),!0}function Wm(r,o,u=!0){var f,g;const b=o==="forward"?1:-1;r.at(r.anchor).type==="placeholder"&&Ee(r,o);let M;const N=r.at(r.anchor).parentPrompt;N?o==="forward"?M=r.offsetOf(N)+1:M=r.offsetOf(N.leftSibling):M=Math.max(r.position+b,0);const I=Jg(r,M,o);if(!I||o==="forward"&&r.offsetOf(I)<M||o==="backward"&&r.offsetOf(I)>M){if(!u||!((g=(f=r.mathfield.host)==null?void 0:f.dispatchEvent(new CustomEvent("move-out",{detail:{direction:o},cancelable:!0,bubbles:!0,composed:!0})))==null||g))return r.announce("plonk"),!1;const U=uy();if(!document.activeElement||U.length<=1)return r.announce("plonk"),!1;let lt=U.indexOf(document.activeElement)+b;return lt<0&&(lt=U.length-1),lt>=U.length&&(lt=0),U[lt].focus(),r.mathfield.stopCoalescingUndo(),!0}return $f(r,I),!0}function Jg(r,o=0,u="forward"){return r.findAtom(f=>f.type==="placeholder"||f.type==="prompt"||!r.mathfield.readOnly&&f.treeDepth>2&&f.isFirstSibling&&f.isLastSibling,o,u)}vu({moveToOpposite:r=>{const o={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},u=r.at(r.position),{parent:f}=u;if(!f)return r.announce("plonk"),!1;const g=u.parentBranch;let b;if(typeof g=="string"&&(b=o[g]),!b){const N=u.subsupPlacement?ly(r):ay(r);return r.mathfield.stopCoalescingUndo(),N}f.branch(b)||f.createBranch(b);const M=r.setSelection(r.getBranchRange(r.offsetOf(f),b));return r.mathfield.stopCoalescingUndo(),M},moveBeforeParent:r=>{const{parent:o}=r.at(r.position);return o?(r.position=r.offsetOf(o),r.mathfield.stopCoalescingUndo(),!0):(r.announce("plonk"),!1)},moveAfterParent:r=>Hm(r),moveToNextChar:r=>Ee(r,"forward"),moveToPreviousChar:r=>Ee(r,"backward"),moveUp:r=>Ee(r,"upward"),moveDown:r=>Ee(r,"downward"),moveToNextWord:r=>xp(r,"forward"),moveToPreviousWord:r=>xp(r,"backward"),moveToGroupStart:r=>{const o=r.offsetOf(r.at(r.position).firstSibling);return o===r.position?(r.announce("plonk"),!1):(r.position=o,r.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:r=>{const o=r.offsetOf(r.at(r.position).lastSibling);return o===r.position?(r.announce("plonk"),!1):(r.position=o,r.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:r=>{var o,u,f,g;if(r.position===r.lastOffset&&r.anchor===r.lastOffset)return Wm(r,"forward");const b=r.at(r.position);if(b.mode==="text"){if(r.selectionIsCollapsed){let Lt=b;for(;Lt&&Lt.mode==="text";)Lt=Lt.leftSibling;let Bt=b;for(;((o=Bt.rightSibling)==null?void 0:o.mode)==="text";)Bt=Bt.rightSibling;if(Lt&&Bt)return hc(r,[Lt,Bt])}if(b.rightSibling.mode==="text"){let Lt=b;for(;Lt&&Lt.mode==="text";)Lt=Lt.rightSibling;return Lt?($f(r,(u=Lt.leftSibling)!=null?u:Lt),r.mathfield.switchMode("math"),!0):$f(r,r.lastOffset)}}const N=r.at(r.anchor).parentPrompt,I=N?r.offsetOf(N)+1:Math.max(r.position+1,0),B=Jg(r,I,"forward");if(B)return $f(r,B);const U=g1(r,b,Lt=>Lt.type==="leftright"||Lt.type==="text","forward");if(U){if(U.mode==="text"){let Lt=U;for(;Lt&&Lt.mode==="text";)Lt=Lt.rightSibling;return hc(r,[(f=U.leftSibling)!=null?f:U,(g=Lt.leftSibling)!=null?g:Lt])}return hc(r,U)}const lt=b.parent;if(lt){if(lt.type==="leftright"||lt.type==="surd")return hc(r,lt);if(b.parentBranch==="superscript"&<.subscript)return hc(r,lt.subscript);if(b.parentBranch==="above"&<.below)return hc(r,lt.below);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return $f(r,lt);if(b.parentBranch==="above"||b.parentBranch==="below")return hc(r,lt)}return $f(r,r.lastOffset)},moveToPreviousGroup:r=>{var o;if(r.position===0&&r.anchor===0)return Wm(r,"backward");let u=r.at(r.position);const f=u.mode;if(f==="text"){if(r.selectionIsCollapsed){let N=u;for(;N&&N.mode==="text";)N=N.leftSibling;let I=u;for(;((o=I.rightSibling)==null?void 0:o.mode)==="text";)I=I.rightSibling;if(N&&I)return hc(r,[N,I])}for(;u&&u.mode==="text";)u=u.leftSibling;return u?$f(r,u):$f(r,0)}const g=r.at(r.anchor).parentPrompt,b=g?r.offsetOf(g.leftSibling):Math.max(r.position-1,0),M=Jg(r,b,"backward");if(M)return $f(r,M);if(f==="math"){const N=g1(r,u,B=>B.type==="leftright"||B.type==="text","backward");if(N){if(N.mode==="text"){let B=N;for(;B&&B.mode==="text";)B=B.leftSibling;return hc(r,[N,B])}return hc(r,N)}const I=u.parent;if(I){if(I.type==="leftright"||I.type==="surd")return hc(r,I);if(u.parentBranch==="subscript"&&I.superscript)return hc(r,I.superscript);if(u.parentBranch==="below"&&I.above)return hc(r,I.above);if(u.parentBranch==="superscript"||u.parentBranch==="subscript")return $f(r,I);if(u.parentBranch==="above"||u.parentBranch==="below")return hc(r,I)}return $f(r,0)}return!1},moveToMathfieldStart:r=>r.selectionIsCollapsed&&r.position===0?(r.announce("plonk"),!1):(r.position=0,r.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:r=>r.selectionIsCollapsed&&r.position===r.lastOffset?(r.announce("plonk"),!1):(r.position=r.lastOffset,r.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:ay,moveToSubscript:ly},{target:"model",changeSelection:!0}),vu({moveToNextPlaceholder:r=>Wm(r,"forward"),moveToPreviousPlaceholder:r=>Wm(r,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function g1(r,o,u,f){if(f==="forward"){let b=o.rightSibling;for(;b&&!u(b);)b=b.rightSibling;return b}let g=o.leftSibling;for(;g&&!u(g);)g=g.leftSibling;return g}function n0(r,o,u){typeof o=="function"&&(u=o,o=1/0),o===void 0&&(o=1/0);let f=r.position,g=!1,b="";for(;!g;){const M=r.at(f);g=o===0||M===void 0||M.type==="first"||M.mode!=="math"||!(M.type&&/mord|mpunct|operator/.test(M.type)||M.type==="mop"&&/[a-zA-Z ]+/.test(M.value))||!M.hasEmptyBranch("superscript")||!M.hasEmptyBranch("subscript")||typeof u=="function"&&!u(M),g||(M.mode="text",M.command=M.value,M.verbatimLatex=void 0,b+=M.value),f-=1,o-=1}r.contentDidChange({data:b,inputType:"insertText"})}function $d(r,o,u){typeof o=="function"&&(u=o,o=1/0),o===void 0&&(o=1/0);let f=r.position,g=!1;const b=[];for(;!g;){const M=r.at(f);g=o===0||!M||M.type==="first"||M.isFirstSibling||M.mode!=="text"||M.value===" "||typeof u=="function"&&!u(M),g||(b.push(ae.serialize([M],{defaultMode:"math"})),M.mode="math"),f-=1,o-=1}Yi(r),r.contentDidChange({data:Mn(b),inputType:"insertText"})}function Yi(r){var o;let u=r.position-1;for(;u>=0&&((o=r.at(u))==null?void 0:o.mode)==="math";)u-=1;if(!(u<0)&&r.at(u).mode==="text"&&r.at(u).value===" "&&r.at(u-1).mode==="math"){r.at(u-1).parent.removeChild(r.at(u-1));const f=r.silenceNotifications;r.silenceNotifications=!0,r.position-=1,r.silenceNotifications=f,r.contentDidChange({inputType:"deleteContent"})}}function hy(r){let o="",u=r.position,f=!1;for(;!f;){const g=r.at(u);f=!(g&&(g.mode==="text"||g.mode==="math"&&g.type&&/mord|mpunct/.test(g.type))),f||(o=g.value+o),u-=1}return o}function cy(r,o,u){const{model:f}=r;if(f.mode==="latex"||!f.at(f.position).isLastSibling||!u||!rf(u))return!1;const g=Yp(u);if(!f.selectionIsCollapsed)return!!(r.model.mode==="text"&&/[/_^]/.test(g));const b=hy(f)+g;if(r.model.mode==="text"){if(o==="Esc"||/[/\\]/.test(g))return!0;if(/[\^_]/.test(g))return/(^|\s)[a-zA-Z][^_]$/.test(b)&&$d(f,1),!0;const M={")":"(","}":"{","]":"["}[g],{parent:N}=f.at(f.position);if(M&&N instanceof wa&&N.leftDelim===M)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(b))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(g))return!0;if(/(^|[^a-zA-Z'’])[a-zA-Z] $/.test(b))return $d(f,1),!1;if(/\D\.[^\d\s]$/.test(b)){$d(f,1);const I=f.at(f.position);return I.value="\u22C5",I.style.variant="normal",I.command="\\cdot",I.verbatimLatex=void 0,f.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(b)||/\.\d$/.test(b)||/\([\d+\-.]$/.test(b))return $d(f,1),!0;if(/\([a-z][,;]$/.test(b))return $d(f,2),!0;if(/[\d+\-=><*|]$/.test(g))return Yi(f),!0}else{if(o==="[Space]")return n0(f,void 0,M=>/[a-z][:,;.]$/.test(M.value)),!0;if(/[a-zA-Z]{3,}$/.test(b)&&!/(dxd|abc|xyz|uvw)$/.test(b))return n0(f,void 0,M=>/[a-zA-Z]/.test(M.value)),!0;if(/(^|\W)(if)$/i.test(b))return n0(f,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(b)&&!/(αβγ)$/.test(b))return n0(f,void 0,M=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(M.value)),!0;if(g==="?"||g==="."&&!/[\d-+]\.$/.test(b))return!0}return!1}function v1(r,o){if(!r.isSelectionEditable||!r.keystrokeCaptionVisible)return;const u=Wu(),f=r.element.getBoundingClientRect();u.style.left=`${f.left}px`,u.style.top=`${f.top-64}px`,u.innerHTML=window.MathfieldElement.createHTML("<span>"+(Cm(o)||o)+"</span>"+u.innerHTML),u.style.visibility="visible",setTimeout(()=>{u.childNodes.length>0&&u.childNodes[u.childNodes.length-1].remove(),u.childNodes.length===0&&(u.style.visibility="hidden")},3e3)}function y1(r){if(r.keystrokeCaptionVisible=!r.keystrokeCaptionVisible,r.keystrokeCaptionVisible){const o=Wu();o.innerHTML=""}else{const o=R0("mathlive-keystroke-caption-panel");o.style.visibility="hidden"}return!1}function Wu(){const r=document.getElementById("mathlive-keystroke-caption-panel");return r||(qu("keystroke-caption"),qu("core"),R0("mathlive-keystroke-caption-panel"))}function ge(){document.getElementById("mathlive-keystroke-caption-panel")&&(Tm("mathlive-keystroke-caption-panel"),h("core"),h("keystroke-caption"))}function r0(r,o){var u,f,g;const{model:b}=r,M=Gv(o);if(o.isTrusted){Dg(o);const Bt=Rd();r.keyboardLayout!==Bt.id&&(r.keyboardLayout=Bt.id,r._keybindings=void 0)}if(clearTimeout(r.inlineShortcutBufferFlushTimer),r.inlineShortcutBufferFlushTimer=0,v1(r,M),o.isTrusted&&o.defaultPrevented)return r.flushInlineShortcutBuffer(),!1;let N,I="",B;const U=r.inlineShortcutBuffer;if(r.isSelectionEditable){if(b.mode==="math")if(M==="[Backspace]")U.pop();else if(!rf(o))r.flushInlineShortcutBuffer();else{const Bt=Yp(o),jt=[...(f=(u=U[U.length-1])==null?void 0:u.keystrokes)!=null?f:[],Bt];U.push({state:b.getState(),keystrokes:jt,leftSiblings:xd(r)});let je=0,Zi="";for(;!N&&je<jt.length;)B=U.length-(jt.length-je),Zi=jt.slice(je).join(""),N=Nf(U[B].leftSiblings,Zi,r.options.inlineShortcuts),!N&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(Zi)&&(N=r.options.onInlineShortcut(r,Zi)),je+=1;r.flushInlineShortcutBuffer({defer:!0})}r.options.smartMode&&(N?r.switchMode("math"):cy(r,M,o)&&(r.switchMode({math:"text",text:"math"}[b.mode]),I=""))}if(!N){if(I||(I=md(r.keybindings,b.mode,o)),!I&&(M==="[Enter]"||M==="[Return]")){let Bt=!1;return b.contentWillChange({inputType:"insertLineBreak"})&&(r.host&&(Bt=!r.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),Bt||o.preventDefault&&(o.preventDefault(),o.stopPropagation()),b.contentDidChange({inputType:"insertLineBreak"})),Bt}if((!I||M==="[Space]")&&b.mode==="math"){if(M==="[Space]"){if(r.adoptStyle="none",r.flushInlineShortcutBuffer(),r.options.mathModeSpace)return ur.insert(b,r.options.mathModeSpace,{format:"latex",mode:"math"}),r.snapshot("insert-space"),I="",r.dirty=!0,r.scrollIntoView(),o.preventDefault&&(o.preventDefault(),o.stopPropagation()),!1;const Bt=b.at(b.position+1),jt=b.at(b.position-1);if((Bt==null?void 0:Bt.mode)==="text"||(jt==null?void 0:jt.mode)==="text")return ur.insert(b," ",{mode:"text"}),r.snapshot("insert-space"),r.dirty=!0,r.scrollIntoView(),!1}(g=b.at(b.position))!=null&&g.isDigit()&&window.MathfieldElement.decimalSeparator===","&&Yp(o)===","&&(I="insertDecimalSeparator")}}if(!N&&!I){if(b.mathfield.smartFence){if(X0(b,Yp(o),r.effectiveStyle))return r.dirty=!0,r.scrollIntoView(),o.preventDefault&&o.preventDefault(),!1}else{const{parent:Bt}=b.at(b.position);if(Bt instanceof wa&&Bt.rightDelim==="?"&&b.at(b.position).isLastSibling&&/^[)}\]|]$/.test(M))return r.snapshot(),Bt.isDirty=!0,Bt.rightDelim=M,b.position+=1,b.selectionDidChange(),b.contentDidChange({data:Yp(o),inputType:"insertText"}),r.snapshot("insert-fence"),r.dirty=!0,r.scrollIntoView(),o.preventDefault&&o.preventDefault(),!1;if(!b.selectionIsCollapsed){const jt=Yp(o);if(jt==="("||jt==="{"||jt==="["){const je={"(":"(","{":"\\lbrace","[":"\\lbrack"}[jt],Zi={"(":")","{":"\\rbrace","[":"\\rbrack"}[jt],[Le,Ci]=Ds(b.selection);return r.snapshot(),b.position=Ci,ur.insert(b,Zi,{format:"latex"}),b.position=Le,ur.insert(b,je,{format:"latex"}),b.setSelection(Le+1,Ci+1),b.contentDidChange({data:jt,inputType:"insertText"}),r.snapshot("insert-fence"),r.dirty=!0,r.scrollIntoView(),o.preventDefault&&o.preventDefault(),!1}}}return!0}const lt=b.at(Math.max(b.position,b.anchor)),{parent:Lt}=lt;if(I==="moveAfterParent"&&(Lt==null?void 0:Lt.type)==="leftright"&<.isLastSibling&&r.options.smartFence&&X0(b,".",r.defaultStyle)&&(I="",ql(r)),r.keyboardDelegate.cancelComposition(),I)r.executeCommand(I);else if(N){const Bt=r.effectiveStyle;b.setState(U[B].state);const jt=U[U.length-1].keystrokes;for(const je of jt)ur.insert(b,je,{silenceNotifications:!0,style:Bt});r.snapshot("insert-shortcut"),b.setState(U[B].state),b.deferNotifications({content:!0,selection:!0,data:N,type:"insertText"},()=>(ur.insert(b,N,{format:"latex",style:Bt}),Yi(r.model),N.endsWith(" ")&&(r.switchMode("text"),ur.insert(b," ",{style:Bt,mode:"text"})),r.snapshot(),b.selectionIsCollapsed||r.flushInlineShortcutBuffer(),!0)),r.dirty=!0,b.announce("replacement")}return r.scrollIntoView(),o.preventDefault&&o.preventDefault(),!1}function qg(r,o,u){const{model:f}=r;if(!r.isSelectionEditable){f.announce("plonk");return}u!=null||(u={}),u.focus&&r.focus(),u.feedback&&window.MathfieldElement.playSound("keypress"),typeof u.mode=="string"&&(r.switchMode(u.mode),r.snapshot());let g=tr(o);const b=window.mathVirtualKeyboard;if(b!=null&&b.isShifted&&(g=typeof g=="string"?g.toUpperCase():g.map(I=>I.toUpperCase())),u.simulateKeystroke){let I=!0;for(const B of g)r0(r,new KeyboardEvent("keypress",{key:B}))&&(I=!1);if(I)return}const M=f.at(f.position),N=ot(ot({},M.computedStyle),r.defaultStyle);if(f.selectionIsCollapsed||(f.deleteAtoms(Ds(f.selection)),r.snapshot("delete")),f.mode==="latex")f.deferNotifications({content:!0,selection:!0,data:o,type:"insertText"},()=>{cp(r);for(const I of g)ur.insert(f,I);r.snapshot("insert-latex"),O0(r)});else if(f.mode==="text"){for(const I of g)ur.insert(f,I,{style:N});r.snapshot("insert-text")}else if(f.mode==="math")for(const I of g)Qg(r,I,N,M);r.dirty=!0,r.scrollIntoView()}function xd(r){const o=r.model,u=[];let f=o.at(Math.min(o.position,o.anchor));for(;f.type!=="first";)u.push(f),f=f.leftSibling;return u}function Qg(r,o,u,f){const g=r.model;let b={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[o];if(o===" "&&r.options.mathModeSpace&&(b=["insert",r.options.mathModeSpace]),b){r.executeCommand(b);return}if(/\d/.test(o)&&r.options.smartSuperscript&&f.parentBranch==="superscript"&&f.parent.type!=="mop"&&f.parent.type!=="operator"&&f.parent.type!=="extensible-symbol"&&f.hasNoSiblings){fy(g),ur.insert(g,o,{style:u}),r.snapshot(),Hm(g),r.snapshot();return}if(/[a-zA-Z0-9]/.test(o)&&r.adoptStyle!=="none"){const M=r.adoptStyle==="left"?f:f.parent?f.rightSibling:null;(M==null?void 0:M.type)==="mord"&&/[a-zA-Z0-9]/.test(M.value)&&(u=ot({},u),M.style.variant&&(u.variant=M.style.variant),M.style.variantStyle&&(u.variantStyle=M.style.variantStyle))}ur.insert(g,o,{style:u}),r.snapshot(`insert-${g.at(g.position).type}`)}function fy(r){r.selectionIsCollapsed||(r.deleteAtoms(Ds(r.selection)),r.mathfield.snapshot("delete"))}function X0(r,o,u){if(!o||r.mode!=="math")return!1;const f=r.at(r.position),{parent:g}=f,b={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[o];if(!b)return!1;const M=y[b],N=x[b];if(!r.selectionIsCollapsed){r.mathfield.snapshot();const[I,B]=Ds(r.selection),U=r.extractAtoms([I,B]),lt=g.addChildrenAfter([new wa("left...right",U,{leftDelim:b,rightDelim:N})],r.at(I));return r.setSelection(r.offsetOf(lt.firstChild),r.offsetOf(lt.lastChild)),r.mathfield.snapshot("insert-fence"),r.contentDidChange({data:b,inputType:"insertText"}),!0}if(b==="|"){const I=g instanceof wa?g.leftDelim+g.rightDelim:"";if(I==="\\lbrace\\rbrace"||I==="\\{\\}"||I==="\\lbrace?")return r.mathfield.snapshot(),ur.insert(r,"\\,\\middle\\vert\\,",{format:"latex",style:u}),r.mathfield.snapshot("insert-fence"),r.contentDidChange({data:b,inputType:"insertText"}),!0}if(N){if(g instanceof wa&&g.firstChild===f&&(g.leftDelim==="?"||g.leftDelim==="."))return g.leftDelim=b,g.isDirty=!0,r.mathfield.snapshot(),r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0;if(!(g instanceof wa)){let lt=f;for(;lt&&!(lt.type==="mclose"&<.value===N);)lt=lt.rightSibling;if(lt){r.mathfield.snapshot();const Lt=r.extractAtoms([r.offsetOf(f),r.offsetOf(lt)]);return Lt.pop(),g.addChildrenAfter([new wa("left...right",Lt,{leftDelim:b,rightDelim:N})],f),r.position=r.offsetOf(g.firstChild)+1,r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0}}const I=r.offsetOf(f.lastSibling);let B;for(B=r.position;B<=I;B++){const lt=r.at(B);if(lt instanceof wa&&(lt.leftDelim==="?"||lt.leftDelim===".")&&Um(b,lt.rightDelim))break}const U=r.at(B);if(B<=I&&U instanceof wa){U.leftDelim=b,r.mathfield.snapshot();let lt=r.extractAtoms([r.position,B-1]);return lt=lt.filter(Lt=>Lt.type!=="first"),U.addChildren(lt,U.parentBranch),r.position+=1,r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0}if(g instanceof wa&&(g.leftDelim==="?"||g.leftDelim===".")&&Um(b,g.rightDelim)){g.isDirty=!0,g.leftDelim=b,r.mathfield.snapshot();const lt=r.extractAtoms([r.offsetOf(f.firstSibling),r.position]);for(const Lt of lt)g.parent.addChildBefore(Lt,g);return r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0}if(!(g instanceof wa&&g.leftDelim==="|")){if(r.mathfield.snapshot(),ur.insert(r,`\\left${b}\\right?`,{format:"latex",style:u}),f.lastSibling.type!=="first"){const lt=r.offsetOf(f.lastSibling),Lt=r.extractAtoms([r.position,lt]);r.at(r.position).body=Lt,r.position-=1}return r.mathfield.snapshot("insert-fence"),!0}}if(M){let I=f;for(;I;){if(I.type==="mopen"&&I.value===M){r.mathfield.snapshot();const Bt=I.leftSibling,jt=r.extractAtoms([r.offsetOf(I.leftSibling),r.offsetOf(f)]);jt.shift();const je=new wa("left...right",jt,{leftDelim:M,rightDelim:b});return g.addChildrenAfter([je],Bt),r.position=r.offsetOf(je),r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0}I=I.leftSibling}if(g instanceof wa&&f.isLastSibling&&wp(g.leftDelim,b))return r.mathfield.snapshot(),g.isDirty=!0,g.rightDelim=b,r.position+=1,r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0;const B=r.offsetOf(f.firstSibling);let U;for(U=r.position;U>=B;U--){const Bt=r.at(U);if(Bt instanceof wa&&(Bt.rightDelim==="?"||Bt.rightDelim===".")&&wp(Bt.leftDelim,b))break}const lt=r.at(U);if(U>=B&< instanceof wa)return r.mathfield.snapshot(),lt.rightDelim=b,lt.addChildren(r.extractAtoms([U,r.position]),lt.parentBranch),r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0;if(g instanceof wa&&(g.rightDelim==="?"||g.rightDelim===".")&&wp(g.leftDelim,b))return r.mathfield.snapshot(),g.isDirty=!0,g.rightDelim=b,g.parent.addChildren(r.extractAtoms([r.position,r.offsetOf(f.lastSibling)]),g.parentBranch),r.position=r.offsetOf(g),r.contentDidChange({data:b,inputType:"insertText"}),r.mathfield.snapshot("insert-fence"),!0;const Lt=g.parent;return Lt instanceof wa&&(Lt.rightDelim==="?"||Lt.rightDelim===".")&&r.at(r.position).isLastSibling?(r.position=r.offsetOf(Lt),X0(r,b,u)):!1}return!1}function wp(r,o){return r?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(r)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(o):x[r]===o:!0}function Um(r,o){return o?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(o)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(r):y[o]===r:!0}vu({undo:r=>(r.undo(),!0),redo:r=>(r.redo(),!0),scrollIntoView:r=>(r.scrollIntoView(),!0),scrollToStart:r=>(r.field.scroll(0,0),!0),scrollToEnd:r=>{const o=r.field.getBoundingClientRect();return r.field.scroll(o.left-window.scrollX,0),!0},toggleKeystrokeCaption:y1,toggleContextMenu:r=>{const o=r.toggleContextMenu();return o||r.model.announce("plonk"),o},plonk:r=>(r.model.announce("plonk"),!0),switchMode:(r,o,u,f)=>(r.switchMode(o,u,f),!0),insert:(r,o,u)=>r.insert(o,u),typedText:(r,o,u)=>(qg(r,o,u),!0),insertDecimalSeparator:r=>{const o=r.model;return o.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&o.at(Math.max(o.position,o.anchor)).isDigit()?(r.insert("{,}",{format:"latex"}),r.snapshot("insert-mord"),!0):(r.insert("."),!0)},commit:r=>{var o;return r.model.contentWillChange({inputType:"insertLineBreak"})&&((o=r.host)==null||o.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),r.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(r,o,u)=>{const f=r.getPrompts();let g="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),b=0;for(;f.includes(g)&&b<100;){if(b===99)return console.error("could not find a unique ID after 100 tries"),!1;g="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),b++}return r.insert(`\\placeholder[${o!=null?o:g}]{}`,u),!0}}),vu({copyToClipboard:r=>(r.focus(),r.model.selectionIsCollapsed&&r.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):r.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),vu({cutToClipboard:r=>(r.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):r.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:r=>(r.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(o=>{o&&r.model.contentWillChange({inputType:"insertFromPaste",data:o})?(r.stopCoalescingUndo(),r.stopRecording(),r.insert(o,{mode:r.model.mode})&&(O0(r),r.startRecording(),r.snapshot("paste"),r.model.contentDidChange({inputType:"insertFromPaste"}),ql(r))):r.model.announce("plonk"),r.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function dy(r,o){r.flushInlineShortcutBuffer(),r.stopCoalescingUndo();const u=Zm(r,o),{model:f}=r;return f.selectionIsCollapsed?(r.defaultStyle.fontSeries&&u.fontSeries===r.defaultStyle.fontSeries&&(u.fontSeries="auto"),u.fontShape&&u.fontShape===r.defaultStyle.fontShape&&(u.fontShape="auto"),u.color&&u.color===r.defaultStyle.color&&(u.color="none"),u.backgroundColor&&u.backgroundColor===r.defaultStyle.backgroundColor&&(u.backgroundColor="none"),u.fontSize&&u.fontSize===r.defaultStyle.fontSize&&(u.fontSize="auto"),r.defaultStyle=ot(ot({},r.defaultStyle),u)):r.model.deferNotifications({content:!0,type:"insertText"},()=>{f.selection.ranges.forEach(g=>Fm(f,g,u,{operation:"toggle"})),r.snapshot("style-change")}),!0}vu({applyStyle:dy},{target:"mathfield",canUndo:!0,changeContent:!0});function Zm(r,o){var u,f,g,b,M,N,I,B,U,lt;const Lt={};if(typeof o.color=="string"){const jt=(f=r.colorMap((u=o.color)!=null?u:o.verbatimColor))!=null?f:"none";jt!==o.color&&(Lt.verbatimColor=(g=o.verbatimColor)!=null?g:o.color),Lt.color=jt}if(typeof o.backgroundColor=="string"){const jt=(M=r.backgroundColorMap((b=o.backgroundColor)!=null?b:o.verbatimBackgroundColor))!=null?M:"none";jt!==o.backgroundColor&&(Lt.verbatimBackgroundColor=(N=o.verbatimBackgroundColor)!=null?N:o.backgroundColor),Lt.backgroundColor=jt}typeof o.fontFamily=="string"&&(Lt.fontFamily=o.fontFamily),typeof o.series=="string"&&(Lt.fontSeries=o.series),typeof o.fontSeries=="string"&&(Lt.fontSeries=o.fontSeries.toLowerCase()),Lt.fontSeries&&(Lt.fontSeries=(I={bold:"b",medium:"m",normal:"m"}[Lt.fontSeries])!=null?I:Lt.fontSeries),typeof o.shape=="string"&&(Lt.fontShape=o.shape),typeof o.fontShape=="string"&&(Lt.fontShape=o.fontShape.toLowerCase()),Lt.fontShape&&(Lt.fontShape=(B={italic:"it",up:"n",upright:"n",normal:"n"}[Lt.fontShape])!=null?B:Lt.fontShape),o.variant&&(Lt.variant=o.variant.toLowerCase()),o.variantStyle&&(Lt.variantStyle=o.variantStyle.toLowerCase());const Bt=(U=o.size)!=null?U:o.fontSize;return typeof Bt=="number"?Lt.fontSize=Math.max(1,Math.min(10,Bt)):typeof Bt=="string"&&(Lt.fontSize=(lt={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[Bt.toLowerCase()])!=null?lt:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[Bt]),Lt}function Y0(r){let[o,u]=Ds(r.selection);if(o=bp(r,o,"backward"),u=bp(r,u,"forward"),o===u){const f=r.at(o);if(f.type==="leftright")return r.setSelection(r.offsetOf(f.firstChild)-1,u);if(f.type==="first"&&(f.parent.type==="leftright"||f.parent.type==="surd"))return r.setSelection(o-1,r.offsetOf(f.parent.lastChild)+1);r.setSelection(o-1,u)}else r.setSelection(o,u);return!0}function bp(r,o,u){var f,g,b;let M=r.at(o);if(!M)return o;const N=u==="forward"?1:-1;if(M.mode==="text"){for(;M&&!(M.mode!=="text"||!z.test(M.value));)o+=N,M=r.at(o);return u==="backward"?o-1:o}if(M.mode==="latex"){if(/[a-zA-Z\*]/.test(M.value))if(u==="backward")for(;M&&M.mode==="latex"&&M.value!=="\\"&&/[a-zA-Z]/.test(M.value);)o+=N,M=r.at(o);else for(;M&&M.mode==="latex"&&/[a-zA-Z\*]/.test(M.value);)o+=N,M=r.at(o);else if(M.value==="{"){if(u==="forward"){for(;M&&M.mode==="latex"&&M.value!=="}";)o+=N,M=r.at(o);return o}return o-1}else if(M.value==="}"){if(u==="backward"){for(;M&&M.mode==="latex"&&M.value!=="{";)o+=N,M=r.at(o);return o-1}return o}return o-1}if(M.mode==="math"){if(M.isDigit()){for(;(f=r.at(o+N))!=null&&f.isDigit();)o+=N;return u==="backward"?o-1:o}if(M.style.variant||M.style.variantStyle){let I=(g=r.at(o))==null?void 0:g.style;for(;I&&I.variant===M.style.variant&&I.variantStyle===M.style.variantStyle;)I=(b=r.at(o+N))==null?void 0:b.style,o+=N;return u==="backward"?o-1:o}return o}return o}vu({selectGroup:r=>{const o=Y0(r);return o||r.announce("plonk"),o},selectAll:r=>r.setSelection(0,r.lastOffset),extendSelectionForward:r=>Ee(r,"forward",{extend:!0}),extendSelectionBackward:r=>Ee(r,"backward",{extend:!0}),extendToNextWord:r=>xp(r,"forward",{extend:!0}),extendToPreviousWord:r=>xp(r,"backward",{extend:!0}),extendSelectionUpward:r=>Ee(r,"upward",{extend:!0}),extendSelectionDownward:r=>Ee(r,"downward",{extend:!0}),extendToNextBoundary:r=>xp(r,"forward",{extend:!0}),extendToPreviousBoundary:r=>xp(r,"backward",{extend:!0}),extendToGroupStart:r=>{const o=r.setSelection(r.anchor,r.offsetOf(r.at(r.position).firstSibling));return o||r.announce("plonk"),o},extendToGroupEnd:r=>{const o=r.setSelection(r.anchor,r.offsetOf(r.at(r.position).lastSibling));return o||r.announce("plonk"),o},extendToMathFieldStart:r=>{const o=r.setSelection(r.anchor,0);return o||r.announce("plonk"),o},extendToMathFieldEnd:r=>{const o=r.setSelection(r.anchor,r.lastOffset);return o||r.announce("plonk"),o}},{target:"model",changeSelection:!0});var jd=null,od=0,tv=class Nd{static start(o,u,f,g){var b;Nd.element=o,(b=Nd.controller)==null||b.abort(),Nd.controller=new AbortController;const M={signal:Nd.controller.signal};"PointerEvent"in window?(o.addEventListener("pointermove",f,M),o.addEventListener("pointerup",g,M),o.addEventListener("pointercancel",g,M),py(u)&&(Nd.pointerId=u.pointerId,o.setPointerCapture(u.pointerId))):(window.addEventListener("mousemove",f,M),window.addEventListener("blur",g,M),window.addEventListener("mouseup",g,M))}static stop(){var o;(o=Nd.controller)==null||o.abort(),Nd.controller=void 0,typeof Nd.pointerId=="number"&&(Nd.element.releasePointerCapture(Nd.pointerId),Nd.pointerId=void 0)}};function py(r){return r!==null&&globalThis.PointerEvent!==void 0&&r instanceof PointerEvent}function Kd(r,o){var u;if(o.buttons>1)return;r.atomBoundsCache=new Map;const f=r;let g,b=!1,M=!1,N="none",I=!1,B=!1;const U=o.clientX,lt=o.clientY,Lt=Date.now(),Bt=f.field,jt=setInterval(()=>{I?Bt.scroll({top:0,left:Bt.scrollLeft-16}):B&&Bt.scroll({top:0,left:Bt.scrollLeft+16})},32);function je(){tv.stop(),b=!1,clearInterval(jt),r.element.classList.remove("tracking"),o&&o.preventDefault()}function Zi(Ci){if(!f.hasFocus()){je();return}const en=Ci.clientX,Oi=Ci.clientY,hr=py(Ci)&&Ci.pointerType==="touch"?20:5;if(Date.now()<Lt+500&&Math.abs(U-en)<hr&&Math.abs(lt-Oi)<hr){Ci.preventDefault(),Ci.stopPropagation();return}const Jr=Bt.getBoundingClientRect();B=en>Jr.right,I=en<Jr.left;let Er=g;py(Ci)&&(Ci.isPrimary||(Er=Hd(f,Ci.clientX,Ci.clientY,{bias:0})));const ta=Hd(f,en,Oi,{bias:en<=U?en===U?0:-1:1});Er>=0&&ta>=0&&(f.model.extendSelectionTo(Er,ta),ql(r)),M&&Y0(f.model)}jd&&Math.abs(jd.x-U)<5&&Math.abs(jd.y-lt)<5&&Date.now()<jd.time+500?(od+=1,jd.time=Lt):(jd={x:U,y:lt,time:Lt},od=1);const Le=Bt.getBoundingClientRect();if(U>=Le.left&&U<=Le.right&<>=Le.top&<<=Le.bottom){if(r.flushInlineShortcutBuffer(),r.adoptStyle="left",g=Hd(r,U,lt,{bias:0}),g>=0){if(r.element.classList.add("tracking"),o.shiftKey){const Ci=r.model.selectionIsCollapsed;r.model.extendSelectionTo(r.model.anchor,g),Lm(r.model)||Ci?N="all":N="selection"}else r.model.at(g).type==="placeholder"?(r.model.setSelection(g-1,g),N="selection"):((u=r.model.at(g).rightSibling)==null?void 0:u.type)==="placeholder"?(r.model.setSelection(g,g+1),N="selection"):(r.model.position=g,Lm(r.model)?N="all":N="selection");r.defaultStyle={},o.detail===3||od>2?(je(),(o.detail===3||od===3)&&(r.model.selection={ranges:[[0,r.model.lastOffset]]},N="all")):b||(b=!0,tv.start(Bt,o,Zi,je),(o.detail===2||od===2)&&(M=!0,Y0(r.model),N="all"))}r.hasFocus()||(N="none",r.focus({preventScroll:!0}))}else jd=null;r.stopCoalescingUndo(),N!=="none"&&(r.model.selectionIsCollapsed&&(N="all"),ql(r)),o.preventDefault()}function ev(r,o,u){if(r>=u.left&&r<=u.right&&o>=u.top&&o<=u.bottom)return 0;const f=r-(u.left+u.right)/2,g=o-(u.top+u.bottom)/2;return f*f+g*g}function my(r,o,u,f,g){if(!u.id)return[1/0,null];if(o.has(u.id))return o.get(u.id);const b=Gl(r,u);if(!b)return[1/0,null];let M=[1/0,null];if(u.hasChildren&&!u.captureSelection&&f>=b.left&&f<=b.right)for(const N of u.children){const I=my(r,o,N,f,g);I[0]<=M[0]&&(M=I)}return M[1]||(M=[ev(f,g,b),u]),o.set(u.id,M),M}function Gm(r,o,u){const[,f]=my(r,new Map,r.model.root,o,u);return f}function Hd(r,o,u,f){var g;const b=r.field.querySelector(".ML__latex").getBoundingClientRect();if(!b)return 0;if(o>b.right||u>b.bottom+8)return r.model.lastOffset;if(o<b.left||u<b.top-8)return 0;f=f!=null?f:{},f.bias=(g=f.bias)!=null?g:0;let M=Gm(r,o,u);const N=[];let I=M;for(;I;)N.unshift(I),I=I.parent;for(const U of N)if(U.captureSelection){M=U;break}let B=r.model.offsetOf(M);if(B<0)return-1;if(M.leftSibling)if(f.bias===0&&M.type!=="placeholder"){const U=Gl(r,M);U&&o<(U.left+U.right)/2&&(B=r.model.offsetOf(M.leftSibling))}else f.bias<0&&(B=r.model.offsetOf(M.leftSibling));return B}var o0=class extends ur{constructor(){super("math")}onPaste(r,o){if(!o||!r.model.contentWillChange({data:typeof o=="string"?o:null,dataTransfer:typeof o=="string"?null:o,inputType:"insertFromPaste"}))return!1;let u="",f="auto",g=typeof o!="string"?o.getData("application/json+mathlive"):"";if(g)try{const b=JSON.parse(g);if(b&&Array.isArray(b)){r.snapshot();const M=Od(b),{model:N}=r;N.selectionIsCollapsed||N.deleteAtoms(Ds(N.selection));const I=N.at(N.position);if(I.parent instanceof ts){console.assert(I.parentBranch!==void 0);const B=[];let U=[];M[0].type==="first"&&M.shift(),M[M.length-1].type==="first"&&M.pop();for(const jt of M)jt.type==="first"&&U.length>0?(B.push(U),U=[jt]):U.push(jt);U.length>0&&B.push(U);let lt=Number(I.parentBranch[0]),Lt=Number(I.parentBranch[1]);const Bt=I.parent.maxColumns;for(;I.parent.colCount-Lt<B.length&&I.parent.colCount<Bt;)I.parent.addColumn();I.parent.addChildrenAfter(B[0],I);for(let jt=1;jt<B.length;jt++)Lt++,Lt>=Bt&&(Lt=0,I.parent.addRowAfter(lt),lt++),I.parent.setCell(lt,Lt,B[jt])}else I.parent.addChildrenAfter(M.filter(B=>B.type!=="first"),I);return N.position=N.offsetOf(M[M.length-1]),N.contentDidChange({inputType:"insertFromPaste"}),ql(r),!0}}catch(b){}if(g=typeof o!="string"?o.getData("application/json"):"",g&&window.MathfieldElement.computeEngine)try{const b=JSON.parse(g);if(typeof b=="object"&&"latex"in b&&b.latex&&(u=b.latex),!u){const M=window.MathfieldElement.computeEngine.box(b);M&&!M.has("Error")&&(u=M.latex)}u||(f="latex")}catch(b){}if(!u&&typeof o!="string"&&(u=o.getData("application/x-latex"),u&&(f="latex")),u||(u=typeof o=="string"?o:o.getData("text/plain")),u){let b;return[b,u]=Ku(u),f==="auto"&&b&&(f="latex"),r.stopCoalescingUndo(),r.stopRecording(),this.insert(r.model,u,{format:f})&&(r.startRecording(),r.snapshot("paste"),ql(r)),r.startRecording(),!0}return!1}insert(r,o,u){var f,g;const b=typeof o=="string"?o:(g=(f=window.MathfieldElement.computeEngine)==null?void 0:f.box(o).latex)!=null?g:"";if(!u.silenceNotifications&&!r.contentWillChange({data:b,inputType:"insertText"}))return!1;u.insertionMode||(u.insertionMode="replaceSelection"),u.selectionMode||(u.selectionMode="placeholder"),u.format||(u.format="auto");const{silenceNotifications:M}=r;u.silenceNotifications&&(r.silenceNotifications=!0);const N=r.silenceNotifications;r.silenceNotifications=!0;const I={"?":"\\placeholder{}","@":"\\placeholder{}"};I[0]=u.insertionMode==="replaceAll"?"":r.getValue(r.selection,"latex-unstyled"),u.insertionMode==="replaceSelection"&&!r.selectionIsCollapsed?r.deleteAtoms(Ds(r.selection)):u.insertionMode==="replaceAll"?(r.root.setChildren([],"body"),r.position=0):u.insertionMode==="insertBefore"?r.collapseSelection("backward"):u.insertionMode==="insertAfter"&&r.collapseSelection("forward"),!r.at(r.position).isLastSibling&&r.at(r.position+1).type==="placeholder"?r.deleteAtoms([r.position,r.position+1]):r.at(r.position).type==="placeholder"&&r.deleteAtoms([r.position-1,r.position]);let B=-1;I[0]?I["@"]=I[0]:typeof o=="string"&&/(^|[^\\])#@/.test(o)&&(B=mx(r),B>=0&&(I["@"]=r.getValue(B,r.position,"latex"))),I[0]||(I[0]=I["?"]);let U=!1;const lt=en=>(U=!0,I[en]);let[Lt,Bt]=Sp(r,o,lt,u);if(!Bt)return!1;const jt=Bt.length===1&&Bt[0].type==="genfrac";jt&&B>=0&&typeof r.mathfield.options.isImplicitFunction=="function"&&r.mathfield.options.isImplicitFunction(r.at(r.position).command)?(I["@"]=I["?"],U=!1,[Lt,Bt]=Sp(r,o,lt,u)):B>=0&&r.deleteAtoms([B,r.position]);const{parent:je}=r.at(r.position),Zi=je.hasEmptyBranch("body");if(jt&&Lt!=="latex"&&r.mathfield.options.removeExtraneousParentheses&&je instanceof wa&&je.leftDelim==="("&&Zi){const en=je.parent,Oi=je.parentBranch;en.removeChild(je),en.setChildren(Bt,Oi)}const Le=r.at(r.position);Le.parent.addChildrenAfter(Bt,Le),Lt==="latex"&&typeof o=="string"&&(je==null?void 0:je.type)==="root"&&Zi&&!U&&(je.verbatimLatex=o),r.silenceNotifications=N;const Ci=Bt[Bt.length-1];if(u.selectionMode==="placeholder"){const en=Bt.flatMap(Oi=>[Oi,...Oi.children]).find(Oi=>Oi.type==="placeholder");if(en){const Oi=r.offsetOf(en);r.setSelection(Oi-1,Oi),r.announce("move")}else Ci&&(r.position=r.offsetOf(Ci))}else u.selectionMode==="before"||(u.selectionMode==="after"?Ci&&(r.position=r.offsetOf(Ci)):u.selectionMode==="item"&&r.setSelection(r.anchor,r.offsetOf(Ci)));return r.contentDidChange({data:b,inputType:"insertText"}),r.silenceNotifications=M,!0}};function Sp(r,o,u,f){var g;let b,M=[];if(typeof o!="string"||f.format==="math-json"){const N=window.MathfieldElement.computeEngine;if(!N)return["math-json",[]];[b,o]=["latex",N.box(o).latex],M=au(o,{context:r.mathfield.context})}else typeof o=="string"&&f.format==="ascii-math"?([b,o]=Dh(o,{format:"ascii-math",inlineShortcuts:r.mathfield.options.inlineShortcuts}),M=au(o,{context:r.mathfield.context}),b!=="latex"&&r.mathfield.options.removeExtraneousParentheses&&iv(M)):(f.format==="auto"||(g=f.format)!=null&&g.startsWith("latex"))&&(f.format==="auto"&&([b,o]=Dh(o,{format:"auto",inlineShortcuts:r.mathfield.options.inlineShortcuts})),f.format==="latex"&&([,o]=Ku(o)),M=au(o,{context:r.mathfield.context,args:u}),f.format!=="latex"&&r.mathfield.options.removeExtraneousParentheses&&iv(M));return Ql(M,f.style),[b!=null?b:"latex",M]}function gy(r){if(!r||(console.assert(r[0].type==="first"),r.length>1))return null;const o=r[0];return o instanceof wa&&o.leftDelim==="("&&o.rightDelim===")"?o.removeBranch("body"):null}function iv(r){if(r){for(let o=0;r[o];o++){const u=r[o];if(u instanceof wa&&u.leftDelim==="("){let f=0,g=0,b=0;for(let M=0;u.body[M];M++)u.body[M].type==="genfrac"&&(f++,g=M),b++;b===0&&f===1&&(r[o]=u.body[g])}}for(const o of r){for(const u of o.branches)if(!o.hasEmptyBranch(u)){iv(o.branch(u));const f=gy(o.branch(u));f&&o.setChildren(f,u)}if(o instanceof ts)for(const u of o.cells)iv(u)}}}function mx(r){let o=r.at(r.position);if(o.mode==="text"){for(;!o.isFirstSibling&&o.mode==="text";)o=o.leftSibling;return r.offsetOf(o)}const u=o;let f=!1;if(o.type==="mclose"){const g=y[o.value];for(;!o.isFirstSibling&&!(o.type==="mopen"&&o.value===g);)o=o.leftSibling;o.isFirstSibling||(o=o.leftSibling),f=!0}else o.type==="leftright"&&(o=o.leftSibling,f=!0);if(f)for(;!o.isFirstSibling&&(o.isFunction||vy(o));)o=o.leftSibling;else{const g=[];for(;!o.isFirstSibling&&(vy(o)||g.length>0);)o.type==="mclose"&&g.unshift(o.value),o.type==="mopen"&&g.length>0&&o.value===y[g[0]]&&g.shift(),o=o.leftSibling}return u===o?-1:r.offsetOf(o)}function vy(r){return r.isDigit()?!0:r.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(r.type)?!r.isExtensibleSymbol:!1}new o0;var eh=class extends ur{constructor(){super("text")}onPaste(r,o){if(!o)return!1;const u=typeof o=="string"?o:o.getData("text/plain");return u&&r.model.contentWillChange({inputType:"insertFromPaste",data:u})?(r.stopCoalescingUndo(),r.stopRecording(),this.insert(r.model,u)&&(r.model.contentDidChange({inputType:"insertFromPaste"}),r.startRecording(),r.snapshot("paste"),ql(r)),r.startRecording(),!0):!1}insert(r,o,u={}){if(!r.contentWillChange({data:o,inputType:"insertText"}))return!1;u.insertionMode||(u.insertionMode="replaceSelection"),u.selectionMode||(u.selectionMode="placeholder"),u.format||(u.format="auto");const{silenceNotifications:f}=r;u.silenceNotifications&&(r.silenceNotifications=!0);const g=r.silenceNotifications;r.silenceNotifications=!0,u.insertionMode==="replaceSelection"&&!r.selectionIsCollapsed?r.deleteAtoms(Ds(r.selection)):u.insertionMode==="replaceAll"?(r.root.setChildren([],"body"),r.position=0):u.insertionMode==="insertBefore"?r.collapseSelection("backward"):u.insertionMode==="insertAfter"&&r.collapseSelection("forward");const b=Yh(o,r.mathfield.context);if(Ql(b,u.style),!b)return!1;const M=r.at(r.position),N=M.parent.addChildrenAfter(b,M);return r.silenceNotifications=g,u.selectionMode==="before"||(u.selectionMode==="item"?r.setSelection(r.anchor,r.offsetOf(N)):N&&(r.position=r.offsetOf(N))),r.contentDidChange({data:o,inputType:"insertText"}),r.silenceNotifications=f,!0}};function Yh(r,o){return r=r.replace(/\\/g,"\\textbackslash "),r=r.replace(/#/g,"\\#"),r=r.replace(/\$/g,"\\$"),r=r.replace(/%/g,"\\%"),r=r.replace(/&/g,"\\&"),r=r.replace(/_/g,"\\_"),r=r.replace(/{/g,"\\textbraceleft "),r=r.replace(/}/g,"\\textbraceright "),r=r.replace(/lbrace/g,"\\textbraceleft "),r=r.replace(/rbrace/g,"\\textbraceright "),r=r.replace(/\^/g,"\\textasciicircum "),r=r.replace(/~/g,"\\textasciitilde "),r=r.replace(/£/g,"\\textsterling "),au(r,{context:o,parseMode:"text"})}new eh;function Fh(r){return{value:r.model.getValue(),selectionIsCollapsed:r.model.selectionIsCollapsed,canUndo:r.canUndo(),canRedo:r.canRedo(),style:r.selectionStyle,mode:r.model.mode}}var el=4,zh=20,Lu=2*(zh+el),s0=(r,o)=>`
|
|
|
<line x1="${r+zh}" y1="${o+zh}"
|
|
|
x2="${r>o?r+zh:7*zh+10*el}"
|
|
|
y2="${r<o?o+zh:7*zh+10*el}"/>
|
|
|
<svg id="plus" viewBox="0 0 40 40" x="${r}" y="${o}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
|
|
|
</svg>`,J0=(r,o)=>`
|
|
|
<line x1="${r+zh}" y1="${o+zh}"
|
|
|
x2="${r>o?r+zh:7*zh+10*el}"
|
|
|
y2="${r<o?o+zh:7*zh+10*el}"/>
|
|
|
<svg id="minus" viewBox="0 0 40 40" x="${r}" y="${o}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
|
|
|
</svg>`,Mp=(r,o,u)=>`
|
|
|
<svg id="arrow" viewBox="0 0 40 40" x="${r}" y="${o}" width="40" height="40">
|
|
|
<circle class="cls-2" cx="20" cy="20" r="20"/>
|
|
|
<g transform="rotate(${u})" transform-origin="20 20">
|
|
|
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
|
|
|
</g>
|
|
|
</svg>`,Xm=`
|
|
|
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
viewBox=
|
|
|
"-2 -2 ${8*zh+10*el+5} ${8*zh+10*el+5}">
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background rows"
|
|
|
x="0"
|
|
|
y="${Lu+el}"
|
|
|
height="${3*Lu}"
|
|
|
width="${Lu}"
|
|
|
rx="${Lu/2}"/>
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background columns"
|
|
|
x="${Lu+el}"
|
|
|
y="0"
|
|
|
height="${Lu}"
|
|
|
width="${3*Lu}"
|
|
|
rx="${Lu/2}"/>
|
|
|
<g data-command='"moveDown"'>
|
|
|
${Mp(2*(el+Lu),2*el+3*Lu,0)}
|
|
|
</g>
|
|
|
<g data-command='"moveUp"'>
|
|
|
${Mp(2*(el+Lu),2*el+Lu,180)}
|
|
|
</g>
|
|
|
<g data-command='"moveToNextWord"'>
|
|
|
${Mp(2*el+3*Lu,2*(el+Lu),-90)}
|
|
|
</g>
|
|
|
<g data-command='"moveToPreviousWord"'>
|
|
|
${Mp(2*el+Lu,2*(el+Lu),90)}
|
|
|
</g>
|
|
|
<g>
|
|
|
|
|
|
<g data-command='"addColumnBefore"'>
|
|
|
${s0(2*el+Lu,el)}
|
|
|
</g>
|
|
|
<g data-command='"removeColumn"'>
|
|
|
${J0(2*el+2*Lu,el)}
|
|
|
</g>
|
|
|
<g data-command='"addColumnAfter"'>
|
|
|
${s0(2*el+3*Lu,el)}
|
|
|
</g>
|
|
|
<g data-command='"addRowBefore"'>
|
|
|
${s0(el,2*el+Lu)}
|
|
|
</g>
|
|
|
<g data-command='"removeRow"'>
|
|
|
${J0(el,2*el+2*Lu)}
|
|
|
</g>
|
|
|
<g data-command='"addRowAfter"'>
|
|
|
${s0(el,2*el+3*Lu)}
|
|
|
</g>
|
|
|
</svg>`,yy=r=>`
|
|
|
<svg id="matrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","matrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/></svg>`,nv=r=>`
|
|
|
<svg id="pmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","pmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
|
|
|
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/></svg>`,q0=r=>`
|
|
|
<svg id="Bmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","Bmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
|
|
|
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
</svg>`,Ym=r=>`
|
|
|
<svg id="bmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","bmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m6,4h-3v16h3"/>
|
|
|
<path class="cls-2" d="m22,4h3v16h-3"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
</svg>`,rv=r=>`
|
|
|
<svg id="vmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","vmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
|
|
|
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
|
|
|
</svg>`,x1=r=>`
|
|
|
<svg id="Vmatrix" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
|
|
|
data-command='["setEnvironment","Vmatrix"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<circle cx="10" cy="8" r="1"/>
|
|
|
<circle cx="14" cy="12" r="1"/>
|
|
|
<circle cx="18" cy="16" r="1"/>
|
|
|
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
|
|
|
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
|
|
|
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
|
|
|
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
|
|
|
</svg>`,w1=r=>`
|
|
|
<svg id="cases" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","cases"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
|
|
|
<circle cx="13" cy="8" r="1"/>
|
|
|
<circle cx="13" cy="16" r="1"/>
|
|
|
<circle cx="21" cy="8" r="1"/>
|
|
|
<circle cx="21" cy="16" r="1"/>
|
|
|
</svg>`,Jm=r=>`
|
|
|
<svg id="rcases" class="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
|
|
|
data-command='["setEnvironment","rcases"]'>
|
|
|
<rect class="cls-1" width="28" height="24"/>
|
|
|
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
|
|
|
<circle cx="15" cy="8" r="1"/>
|
|
|
<circle cx="15" cy="16" r="1"/>
|
|
|
<circle cx="7" cy="8" r="1"/>
|
|
|
<circle cx="7" cy="16" r="1"/>
|
|
|
</svg>`,Q0={matrix:yy,pmatrix:nv,bmatrix:Ym,Bmatrix:q0,vmatrix:rv,Vmatrix:x1},a0={cases:w1,rcases:Jm,Bmatrix:q0};function tm(r){var o,u;const f=(o=r.model.parentEnvironment)==null?void 0:o.array;if(!f)return;let g=0;f.forEach(jt=>{(!g||jt.length>g)&&(g=jt.length)});let b=document.getElementById("mathlive-environment-popover");b||(b=R0("mathlive-environment-popover"),qu("environment-popover"),qu("core"),b.setAttribute("aria-hidden","true"));let M;const N=b.querySelector(".MLEP__environment-controls");N?M=N:(M=document.createElement("div"),b.innerHTML="",b.appendChild(M)),M.className="MLEP__environment-controls",M.style.display="flex",M.style.width="100%",M.style.height="100%",M.style.boxSizing="border-box",M.innerHTML=Xm;let I=[],B="";const U=r.model.parentEnvironment.environmentName;if(Rh(U)){const jt=ov(U);B=Q0[jt]("active");const je=Q0,{[jt]:Zi}=je,Le=ee(je,[Y(jt)]);I=Object.values(Le).map(Ci=>Ci("inactive"))}else if(xh(U)){const jt=sv(U);B=a0[jt]("active");const je=a0,{[jt]:Zi}=je,Le=ee(je,[Y(jt)]);I=Object.values(Le).map(Ci=>Ci("inactive"))}else Bu(U)&&(B=Q0.matrix("active"),I=Object.values(a0).map(jt=>jt("inactive")));const lt=document.createElement("div");lt.className="MLEP__environment-delimiter-controls",lt.style.display="flex",lt.style.flexDirection="column",lt.innerHTML=`
|
|
|
<div class='MLEP__array-delimiter-options'>
|
|
|
${B}
|
|
|
${I.join("")}
|
|
|
</div>`,B&&M.appendChild(lt),M.querySelectorAll("[data-command]").forEach(jt=>{const je=jt.dataset.command;let Zi=je;try{Zi=JSON.parse(je)}catch(Le){}jt.addEventListener("mousedown",Le=>Le.preventDefault()),Zi&&jt.addEventListener("click",()=>r.executeCommand(Zi))});const Bt=(u=r.field)==null?void 0:u.getBoundingClientRect();Bt&&(b.style.top=`${window.scrollY+(Bt.top-b.clientHeight-15)}px`,b.style.left=`${Bt.left+20}px`,b.classList.add("is-visible"))}function sf(){const r=document.getElementById("mathlive-environment-popover");r==null||r.classList.remove("is-visible")}function b1(){document.getElementById("mathlive-environment-popover")&&(Tm("mathlive-environment-popover"),h("environment-popover"),h("core"))}function Kc(r){if(!r.hasFocus())return;let o=!1;if(r.model.mode==="math"){const u=r.model.parentEnvironment;if(u!=null&&u.array&&Ol(u.environmentName)){const f=r.options.environmentPopoverPolicy;o=f==="auto"||f==="on"}}o?tm(r):sf()}function ov(r){return r.replace("*","")}function sv(r){return r==="dcases"?"cases":r}function xy(r){const o=getComputedStyle(r).direction;return o==="ltr"||o==="rtl"?o:"ltr"}function wy(r,o,u){return o==="left"||o==="leading"&&u==="ltr"||o==="trailing"&&u==="rtl"?r.left:r.right}function jf(r,o,u,f){return u==="middle"?r-o/2:u==="start"&&f==="rtl"||u==="end"&&f==="ltr"||u==="top"||u==="right"?Math.max(0,r-o):r}function Cp(r,o,u,f){return u==="middle"?r-o/2:u==="start"&&f==="ltr"||u==="end"&&f==="rtl"||u==="top"||u==="right"?r:r-o}function em(r,o){var u,f,g;const b=(u=xy(r))!=null?u:"ltr";r.style.position="fixed",r.style.left="",r.style.top="",r.style.right="",r.style.bottom="",r.style.height="",r.style.width="";const M=r.getBoundingClientRect(),N=Number.isFinite(o.maxHeight)?Math.min(o.maxHeight,window.innerHeight):window.innerHeight;let I=Math.min(N,(f=o.height)!=null?f:M.height),B=jf(o.location.y,I,o.verticalPos,b);B+I>window.innerHeight-8&&(o.alternateLocation?(B=jf(o.alternateLocation.y,I,o.verticalPos,b),B+I>window.innerHeight-8&&(B=void 0)):B=void 0),Number.isFinite(B)||(B=Math.max(8,window.innerHeight-8-I),8+I>window.innerHeight-8&&(r.style.bottom="8px")),I=Math.min(B+I,window.innerHeight-8)-B;const U=Number.isFinite(o.maxWidth)?Math.min(o.maxWidth,window.innerWidth):window.innerWidth;let lt=Math.min(U,(g=o.width)!=null?g:M.width),Lt=jf(o.location.x,lt,o.horizontalPos,b);Lt+lt>window.innerWidth-8&&(o.alternateLocation?(Lt=Cp(o.alternateLocation.x,lt,o.verticalPos,b),Lt+lt>window.innerWidth-8&&(Lt=void 0)):Lt=void 0),Number.isFinite(Lt)||(Lt=Math.max(8,window.innerWidth-8-lt),8+lt>window.innerWidth-8&&(r.style.right="8px")),lt=Math.min(Lt+lt,window.innerWidth-8)-Lt,b==="rtl"?r.style.right=`${Math.ceil(window.innerWidth-Lt-lt).toString()}px`:r.style.left=`${Math.ceil(Lt).toString()}px`,r.style.top=`${Math.ceil(B).toString()}px`,I!==M.height&&(r.style.height=`${Math.ceil(I).toString()}px`),lt!==M.width&&(r.style.width=`${Math.ceil(lt).toString()}px`)}function by(r,o){return Math.hypot(o.x-r.x,o.y-r.y)}function kp(r){return"submenu"in r}function Ac(r){return"type"in r&&r.type==="command"||"onMenuSelect"in r||"id"in r}function Sy(r){return"type"in r&&r.type==="divider"}function av(r){return"type"in r&&r.type==="heading"}var lv={};function hs(r){let o=lv[r];if(!o){let u;switch(r){case"checkmark":u=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
|
|
|
</span>`;break;case"trailing-chevron":u='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":u='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(u){const f=document.createElement("template");f.innerHTML=u,lv[r]=f,o=f}}if(o){if("content"in o)return o.content.cloneNode(!0);const u=document.createElement("svg");return u.innerHTML=o.innerHTML,u}}var wd=80,im=class{constructor(r,o){this._element=null;var u;this.parentMenu=o,this._declaration=r,kp(r)?(this.type="submenu",this.submenu=new uv(r.submenu,{parentMenu:o,submenuClass:r.submenuClass,columnCount:r.columnCount})):this.type=(u=r.type)!=null?u:"command",this.hasCheck=Ac(r)&&r.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var r,o;(r=this._abortController)==null||r.abort(),this._abortController=void 0,(o=this._element)==null||o.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var r;return(r=this._label)!=null?r:""}set label(r){r===void 0&&(r=""),r!==this._label&&(this._label=r,this.dirty=!0)}get visible(){return this._visible}set visible(r){r!==this._visible&&(this._visible=r,this.dirty=!0)}get enabled(){return this._enabled}set enabled(r){this._enabled=r,this.element&&(r?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(r){this._checked=r,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(r){r!==this._tooltip&&(this._tooltip=r,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(r){r!==this._ariaLabel&&(this._ariaLabel=r,this.dirty=!0)}get active(){var r,o;return(o=(r=this.element)==null?void 0:r.classList.contains("active"))!=null?o:!1}set active(r){this.element&&this.element.classList.toggle("active",r)}updateState(r){var o,u,f;const g=this._declaration;if(Sy(g)){this.enabled=!1,this.checked=!1;return}av(g)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Ac(g)&&(this.checked=Ac(g)&&((o=l0(g.checked,r))!=null?o:!1)),(Ac(g)||kp(g))&&(this.enabled=(u=l0(g.enabled,r))!=null?u:!0,this.visible=(f=l0(g.visible,r))!=null?f:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(r),this.submenu.visible||(this.visible=!1))),(Ac(g)||av(g)||kp(g))&&(this.label=l0(g.label,r),this.tooltip=l0(g.tooltip,r),this.ariaLabel=l0(g.ariaLabel,r)),this._element&&this.updateElement()}set dirty(r){console.assert(r===!0),r&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const r=this.element;r.textContent="",this.enabled?r.removeAttribute("aria-disabled"):r.setAttribute("aria-disabled","true"),this.checked===!0?(r.setAttribute("aria-checked","true"),r.append(hs("checkmark"))):this.checked==="mixed"?(r.setAttribute("aria-checked","mixed"),r.append(hs("mixedmark"))):r.removeAttribute("aria-checked"),this.ariaLabel&&r.setAttribute("aria-label",this.ariaLabel);const o=document.createElement("span");if(o.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&o.classList.add("heading"),o.innerHTML=this.label,r.append(o),this._tooltip&&r.setAttribute("data-tooltip",this._tooltip),Ac(this._declaration)&&this._declaration.keyboardShortcut){const u=document.createElement("kbd");u.innerHTML=Cm(this._declaration.keyboardShortcut),r.append(u)}this.type==="submenu"&&r.append(hs("trailing-chevron"))}get element(){if(this._element)return this._element;if(Sy(this._declaration)){const u=document.createElement("li");return u.setAttribute("part","menu-divider"),u.setAttribute("role","divider"),this._element=u,u}const r=document.createElement("li");this._element=r,(Ac(this._declaration)||av(this._declaration)||kp(this._declaration))&&this._declaration.class&&(r.className=this._declaration.class),r.setAttribute("part","menu-item"),r.setAttribute("tabindex","-1"),this.hasCheck?r.setAttribute("role","menuitemcheckbox"):r.setAttribute("role","menuitem"),this.type==="submenu"&&(r.setAttribute("aria-haspopup","true"),r.setAttribute("aria-expanded","false"));const o=this.abortController.signal;return r.addEventListener("pointerenter",this,{signal:o}),r.addEventListener("pointerleave",this,{signal:o}),r.addEventListener("pointerup",this,{signal:o}),r.addEventListener("click",this,{signal:o}),this._element}dispatchSelect(){if(!Ac(this._declaration))return;const r=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(r)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(r){var o;if(!(!this.visible||!this.enabled)){if(r.type==="click"){this.rootMenu.state==="modal"&&this.select(),r.stopPropagation(),r.preventDefault();return}if(r.type==="pointerenter"){const u=r;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((o=this.parentMenu.activeMenuItem)!=null&&o.movingTowardSubmenu(u))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(r.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(r.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),r.stopPropagation(),r.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},wd)},wd)}openSubmenu(r){var o;if(this.type!=="submenu"||!this.element)return;if((o=r==null?void 0:r.withDelay)!=null&&o){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const u=this.element.getBoundingClientRect(),f=xy(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:wy(u,"trailing",f),y:u.top-4},alternateLocation:{x:wy(u,"leading",f),y:u.top-4}})}movingTowardSubmenu(r){if(!this.element||this.type!=="submenu")return!1;const o=this.rootMenu.lastMoveEvent;if(!o)return!1;const u=r.timeStamp-o.timeStamp;if(u>500)return!1;const f=r.clientX-o.clientX;if(Zo(f,o.clientY-r.clientY,u)<=.2)return!1;let b="right";if(this.submenu.element){const M=this.submenu.element.getBoundingClientRect(),N=this.element.getBoundingClientRect();M.left<N.left+N.width/2&&(b="left")}return b==="right"?f>0:f<0}};function Zo(r,o,u){return Math.hypot(r,o)/u}function l0(r,o){return r===void 0||typeof r!="function"?r:(o!=null||(o={alt:!1,control:!1,shift:!1,meta:!1}),r(o))}var uv=class Bv{constructor(o,u){this._element=null,this._activeMenuItem=null,this._dirty=!0;var f,g;this.parentMenu=(f=u==null?void 0:u.parentMenu)!=null?f:null,this._submenuClass=u==null?void 0:u.submenuClass,this.columnCount=(g=u==null?void 0:u.columnCount)!=null?g:1,this.isSubmenuOpen=!1,this.menuItems=o}get children(){return this._menuItems}set menuItems(o){const u=this.parentMenu;this.dispose(),this.parentMenu=u,o=[...o],this._menuItems=o.map(f=>f.onCreate?f.onCreate(f,this):new im(f,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var o;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(o=this._menuItems)==null||o.forEach(u=>u.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(o){if(o.type==="wheel"&&this._element){const u=o;this._element.scrollBy(0,u.deltaY),o.stopPropagation()}}dispatchEvent(o){return this.rootMenu.dispatchEvent(o)}get rootMenu(){return this.parentMenu.rootMenu}updateState(o){var u,f,g;this._menuItems.forEach(B=>B.updateState(o));const b=this.hasCheck;this.hasCheck=this._menuItems.some(B=>B.visible&&B.hasCheck),this.hasCheck!==b&&this._menuItems.forEach(B=>B.updateState(o));let M,N=0;for(const B of this._menuItems)B.type==="heading"?(M&&N===0&&(M.visible=!1),M=B,N=0):B.type==="divider"&&M?(M.visible=N>0,M=void 0,N=0):M&&B.visible&&(N+=1);M&&(M.visible=N>0);let I=!0;for(const B of this._menuItems)B.type==="divider"?(B.visible=!I,I=!0):B.visible&&(I=!1);(u=this.activeMenuItem)!=null&&u.visible||(this.activeMenuItem=null),!((f=this.activeMenuItem)!=null&&f.enabled)&&((g=this.activeMenuItem)==null?void 0:g.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(o=>o.type!=="divider"&&o.visible&&o.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(o=>o.type!=="divider"&&o.visible)}set dirty(o){console.assert(o===!0),this._dirty!==o&&o&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var o;if(this._element){this._element.textContent="";for(const{element:u,visible:f}of this._menuItems)u&&f&&this._element.append(u);(o=this._element.querySelector("li:first-of-type"))==null||o.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const o=document.createElement("menu");o.setAttribute("role","menu"),o.setAttribute("tabindex","-1"),o.setAttribute("aria-orientation","vertical"),o.setAttribute("part","ui-menu-container"),this._submenuClass&&o.classList.add(this._submenuClass),o.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const u=this._abortController.signal;return o.addEventListener("focus",this,{signal:u}),o.addEventListener("wheel",this,{passive:!0,signal:u}),this._element=o,this.updateElement(),o}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(o){var u,f,g,b;if(this.rootMenu.cancelDelayedOperation(),o!==this._activeMenuItem){if(this.activeMenuItem){const M=this.activeMenuItem;M.active=!1,(u=M.submenu)==null||u.hide()}if(!((f=o==null?void 0:o.visible)==null||f)){this._activeMenuItem=null;return}this._activeMenuItem=o,o&&(o.active=!0)}o?(g=o.element)==null||g.focus({preventScroll:!0}):(b=this._element)==null||b.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let o=0,u=!1;const f=this._menuItems;for(;!u&&o<=f.length-1;){const g=f[o];u=g.type!=="divider"&&g.visible&&g.enabled,o+=1}return u?f[o-1]:null}get lastMenuItem(){this.updateIfDirty();const o=this._menuItems;let u=o.length-1,f=!1;for(;!f&&u>=0;){const g=o[u];f=g.type!=="divider"&&g.visible&&g.enabled,u-=1}return f?o[u+1]:null}nextMenuItem(o){if(o===0)return this._activeMenuItem;if(!this._activeMenuItem)return o>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const u=this._menuItems.indexOf(this.firstMenuItem),f=this._menuItems.indexOf(this.lastMenuItem);let g=this._menuItems.indexOf(this._activeMenuItem),b=1;for(;g>=u&&g<=f;){g+=o>0?1:-1;const M=this._menuItems[g];if(!M)break;if(M.visible&&M.enabled){if(b===Math.abs(o))return this._menuItems[g];b+=1}}return o>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(o){this.updateIfDirty();const f=this._menuItems.filter(g=>g.visible&&g.enabled).indexOf(o);return f<0?-1:f%this.columnCount}static get collator(){return Bv._collator||(Bv._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Bv._collator}findMenuItem(o){var u;this.updateIfDirty();const f=this._menuItems.filter(N=>N.type!=="divider"&&N.visible&&N.enabled);if(f.length===0)return null;const g=Math.max(...f.map(N=>N.label.length))-o.length;if(g<0)return null;let b=null,M=0;for(;M<g&&!b;)b=(u=f.find(N=>Bv.collator.compare(o,N.label.substring(M,o.length))===0))!=null?u:null,M++;return b}show(o){return!this.visible||!o.container?!1:(this.updateElement(),o.container.appendChild(this.element),$e()&&(this.element.popover="manual",this.element.showPopover()),o.location&&em(this.element,{location:o.location,alternateLocation:o.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var o,u,f,g,b;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),$e()&&((o=this._element)!=null&&o.popover)&&this.element.hidePopover(),(f=(u=this.parentMenu)==null?void 0:u.element)==null||f.focus(),(b=(g=this._element)==null?void 0:g.parentNode)==null||b.removeChild(this._element)}set openSubmenu(o){var u,f,g,b;const M=o!==null;((u=this.activeMenuItem)==null?void 0:u.type)==="submenu"&&((f=this.activeMenuItem.element)==null||f.setAttribute("aria-expanded",M.toString())),(b=(g=this.activeMenuItem)==null?void 0:g.element)==null||b.classList.toggle("is-submenu-open",M),this.isSubmenuOpen=M}},hv=class z2 extends uv{constructor(o,u){var f;super(o),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(f=u==null?void 0:u.host)!=null?f:null,this.isDynamic=o.some(cv),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(o){Qy(this._modifiers,o)||(this._modifiers=o,this.dirty=!0)}get activeSubmenu(){let o=this;for(;o.isSubmenuOpen;)o=o.activeMenuItem.submenu;return o}set dirty(o){this._updating||(console.assert(o===!0),this._dirty!==o&&(this._dirty=!0,o&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(o){this._updating=!0,this.modifiers=o!=null?o:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(o){this.isDynamic&&(this.modifiers=pd(o)),o.stopImmediatePropagation()}handleKeydownEvent(o){var u,f,g;if(o.key==="Tab"||o.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=pd(o));let b=!0;const M=this.activeSubmenu,N=M.activeMenuItem;switch(o.key){case" ":case"Space":case"Return":case"Enter":N==null||N.select(pd(o));break;case"ArrowRight":if((N==null?void 0:N.type)==="submenu")N.select(pd(o)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!N)M.activeMenuItem=M.firstMenuItem;else{const I=(u=M.getMenuItemColumn(N))!=null?u:-1;if(I>=0&&I<((f=M.columnCount)!=null?f:1)-1){const B=M.nextMenuItem(1);B&&(M.activeMenuItem=B)}}break;case"ArrowLeft":if(M===this.rootMenu)N||(M.activeMenuItem=M.firstMenuItem);else if((N&&(g=M.getMenuItemColumn(N))!=null?g:-1)<=0||!N){M.hide();const B=M.parentMenu.activeMenuItem;if(B){const{element:U}=B;U==null||U.focus(),U==null||U.classList.remove("is-submenu-open")}}else{const B=M.nextMenuItem(-1);B&&(M.activeMenuItem=B)}break;case"ArrowDown":M.activeMenuItem=M.nextMenuItem(M.columnCount);break;case"ArrowUp":M.activeMenuItem=M.nextMenuItem(-M.columnCount);break;case"Home":case"PageUp":M.activeMenuItem=M.firstMenuItem;break;case"End":case"PageDown":M.activeMenuItem=M.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const I=M.findMenuItem(this.typingBuffer);I&&(M.activeMenuItem=I),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(rf(o)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=o.key;const I=M.findMenuItem(this.typingBuffer);I&&(M.activeMenuItem=I),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else b=!1}b&&(o.preventDefault(),o.stopPropagation())}handleEvent(o){if(o.type==="keydown")this.handleKeydownEvent(o);else if(o.type==="keyup")this.handleKeyupEvent(o);else if(o.type==="pointermove")this.lastMoveEvent=o;else if(o.type==="pointerup"&&o.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(o.type==="contextmenu"){o.preventDefault(),o.stopPropagation();return}super.handleEvent(o)}dispatchEvent(o){return this._host?this._host.dispatchEvent(o):!0}get scrim(){return nd.element}connectScrim(o){const u=this.scrim;u.addEventListener("pointerup",this),u.addEventListener("contextmenu",this),u.addEventListener("keydown",this),u.addEventListener("keyup",this),u.addEventListener("pointermove",this),nd.open({root:o,onDismiss:()=>this.hide()})}disconnectScrim(){const o=this.scrim;o.removeEventListener("pointerup",this),o.removeEventListener("contextmenu",this),o.removeEventListener("keydown",this),o.removeEventListener("keyup",this),o.removeEventListener("pointermove",this),nd.state==="open"&&nd.scrim.close()}get rootMenu(){return this}show(o){return this._onDismiss=o==null?void 0:o.onDismiss,o!=null&&o.modifiers&&(this.modifiers=o.modifiers),this.updateState(),this.connectScrim(o==null?void 0:o.target),super.show(F(ot({},o),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,nd.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(o){this.cancelDelayedOperation();const u=z2.SUBMENU_DELAY;if(u<=0){o();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,o()},u)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};hv.SUBMENU_DELAY=120;var gx=hv;function cv(r){return Sy(r)?!1:typeof r.label=="function"||typeof r.ariaLabel=="function"||typeof r.tooltip=="function"||(Ac(r)||kp(r))&&(typeof r.enabled=="function"||typeof r.visible=="function")||Ac(r)&&typeof r.checked=="function"?!0:kp(r)?r.submenu.some(cv):!1}var Ha=class{};Ha.DELAY=300,Ha.MAX_DISTANCE=10;function My(r){return new Promise((o,u)=>{const f=km(r);f||o(!1);let g=f;const b=setTimeout(()=>{M.abort(),o(by(g,f)<Ha.MAX_DISTANCE)},Ha.DELAY),M=new AbortController,N=M.signal;for(const I of["pointermove","pointerup","pointercancel"])window.addEventListener(I,B=>{if(B.type==="pointerup"||B.type==="pointercancel")clearTimeout(b),M.abort(),o(!1);else if(B.type==="pointermove"){const U=km(B);U&&(g=U)}},{passive:!0,signal:N})})}function kh(r,o,u){return wm(this,null,function*(){if(r.type==="contextmenu"){const f=r;if(u.show({target:o,location:km(f),modifiers:pd(f)}))return r.preventDefault(),r.stopPropagation(),!0}if(r.type==="keydown"){const f=r;if(f.code==="ContextMenu"||f.code==="F10"&&f.shiftKey){const g=o==null?void 0:o.getBoundingClientRect();if(g&&u.show({target:o,location:{x:Math.ceil(g.left+g.width/2),y:Math.ceil(g.top+g.height/2)},modifiers:pd(f)}))return r.preventDefault(),r.stopPropagation(),!0}}if(r.type==="pointerdown"&&r.pointerType!=="mouse"&&r.button===0){let f=r.target;for(;f&&o!==f;)f=f.parentNode;if(!f||!u.visible)return!1;const g=km(r);if(yield My(r))return u.state!=="closed"?!1:(u.show({target:o,location:g}),!0)}return!1})}var Fl={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};Se(Object.keys(Fl),"{body:auto}",{createAtom:r=>new d(F(ot({},r),{body:Ae(r.args[0]),accentChar:Fl[r.command.slice(1)]}))}),Se(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:r=>{const o=Gi(Ae(r.args[0]));return new d(F(ot({},r),{body:Ae(r.args[0]),svgAccent:r.command.slice(1)+(o.length>5?"4":["1","1","2","2","3","3"][o.length])}))}}),Se(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:r=>new d(F(ot({},r),{body:Ae(r.args[0]),svgAccent:"overarc"}))}),Se(["underarc","underparen"],"{body:auto}",{createAtom:r=>new ef(F(ot({},r),{body:Ae(r.args[0]),svgBelow:"underarc"}))}),Se("utilde","{body:auto}",{createAtom:r=>{const o=Ae(r.args[0]),u=Gi(o),f="widetilde"+(u.length>5?"4":["1","1","2","2","3","3"][u.length]);return new ef(F(ot({},r),{body:o,svgBelow:f,boxType:Mo(o)}))}}),Se("^","{:string}",{createAtom:r=>{var o;return new ae(F(ot({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[r.args[0]])!=null?o:"^"}))}}),Se("`","{:string}",{createAtom:r=>{var o;return new ae(F(ot({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[r.args[0]])!=null?o:"`"}))}}),Se("'","{:string}",{createAtom:r=>{var o;return new ae(F(ot({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[r.args[0]])!=null?o:"'"}))}}),Se('"',"{:string}",{createAtom:r=>{var o,u;return new ae(F(ot({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:(o=r.args)!=null&&o[0]?(u={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[r.args[0]])!=null?u:'"'+r.args[0]:'"'}))}}),Se(".","{:string}",{createAtom:r=>{var o,u;return new ae(F(ot({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:(o=r.args)!=null&&o[0]?(u={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[r.args[0]])!=null?u:"."+r.args[0]:"."}))}}),Se("=","{:string}",{createAtom:r=>{var o,u;return new ae(F(ot({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:(o=r.args)!=null&&o[0]?(u={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[r.args[0]])!=null?u:"="+r.args[0]:"="}))}}),Se("~","{:string}",{createAtom:r=>{var o;return new ae(F(ot({type:"mord"},r),{isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[r.args[0]])!=null?o:"\xB4"}))}}),Se("c","{:string}",{createAtom:r=>{var o;return new ae(F(ot({},r),{type:"mord",isFunction:!1,limits:"adjacent",value:r.args[0]&&(o={c:"\xE7",C:"\xC7"}[r.args[0]])!=null?o:""}))}}),Se("enclose","{notation:string}[style:string]{body:auto}",{createAtom:r=>{var o,u;const f=r.args,g={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(o=r.style)!=null?o:{}};if(f[1]){const M=f[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const N of M){const I=N.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(I)g.strokeWidth=I[1],g.strokeStyle=I[2],g.strokeColor=I[3];else{const B=N.match(/\s*([a-z]*)\s*=\s*"(.*)"/);B&&(B[1]==="mathbackground"?g.backgroundcolor=B[2]:B[1]==="mathcolor"?g.strokeColor=B[2]:B[1]==="padding"?g.padding=B[2]:B[1]==="shadow"&&(g.shadow=B[2]))}}g.strokeStyle==="dashed"?g.svgStrokeStyle="5,5":g.strokeStyle==="dotted"&&(g.svgStrokeStyle="1,5")}g.borderStyle=`${g.strokeWidth} ${g.strokeStyle} ${g.strokeColor}`;const b={};return((u=f[0])!=null?u:"").split(/[, ]/).filter(M=>M.length>0).forEach(M=>{b[M.toLowerCase()]=!0}),new vf(r.command,Ae(f[2]),b,g)}}),Se("cancel","{body:auto}",{createAtom:r=>{var o;return new vf(r.command,Ae(r.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(o=r.style)!=null?o:{}})}}),Se("bcancel","{body:auto}",{createAtom:r=>{var o;return new vf(r.command,Ae(r.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(o=r.style)!=null?o:{}})}}),Se("xcancel","{body:auto}",{createAtom:r=>{var o;return new vf(r.command,Ae(r.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(o=r.style)!=null?o:{}})}}),Se(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:r=>{var o;return new ef(F(ot({},r),{body:Ae((o=r.args)==null?void 0:o[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:r.command.slice(1)}))}}),Se("overbrace","{:auto}",{createAtom:r=>new ef(F(ot({},r),{body:Ae(r.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:r.command.slice(1)}))}),Se(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:r=>new ef(F(ot({},r),{body:Ae(r.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:r.command.slice(1)}))}),Se(["underbrace"],"{:auto}",{createAtom:r=>new ef(F(ot({},r),{body:Ae(r.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:r.command.slice(1)}))}),Se(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:r=>{var o,u,f,g,b;return new ef(F(ot({},r),{svgBody:r.command.slice(1),above:((u=Ae((o=r.args)==null?void 0:o[1]))==null?void 0:u.length)===0?void 0:Ae((f=r.args)==null?void 0:f[1]),below:(b=Ae((g=r.args)==null?void 0:g[0]))!=null?b:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(r,o)=>r.command+(r.hasEmptyBranch("below")?"":`[${r.belowToLatex(o)}]`)+`{${r.aboveToLatex(o)}}${r.supsubToLatex(o)}`}),Se(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:r=>new Br(r.command.slice(1),F(ot({},r),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Se(["liminf","limsup"],"",{ifMode:"math",createAtom:r=>new Br({"\\liminf":"lim inf","\\limsup":"lim sup"}[r.command],F(ot({},r),{limits:"over-under",variant:"main"}))}),Se(["lim","mod"],"",{ifMode:"math",createAtom:r=>new Br(r.command.slice(1),F(ot({},r),{limits:"over-under",variant:"main"}))}),Se(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:r=>new Br(r.command.slice(1),F(ot({},r),{limits:"over-under",isFunction:!0,variant:"main"}))}),Se(["ang"],"{:math}",{ifMode:"math",createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>`\\ang{${r.bodyToLatex(o)}}`,render:(r,o)=>{const u=r.createBox(o),f=u.caret;u.caret=void 0;const g=new Je("\xB0",{style:F(ot({},r.style),{variant:"normal",variantStyle:"up"})});return new Je([u,g],{type:"inner",isSelected:r.isSelected,caret:f})}}),Se("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:r=>new P0(F(ot({},r),{body:Ae(r.args[1]),index:r.args[0]?Ae(r.args[0]):void 0}))}),Se(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:r=>{const o=ot({},r),u=r.command,f=r.args;switch(u){case"\\dfrac":case"\\frac":case"\\tfrac":o.hasBarLine=!0;break;case"\\atopfrac":o.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o.hasBarLine=!1,o.leftDelim="(",o.rightDelim=")";break;case"\\cfrac":o.hasBarLine=!0,o.continuousFraction=!0;break;default:}switch(u){case"\\dfrac":case"\\dbinom":o.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":o.mathstyleName="textstyle";break;default:}return new Fu(f[0]?Ae(f[0]):[new Hr],f[1]?Ae(f[1]):[new Hr],o)},serialize:(r,o)=>{const u=r.aboveToLatex(o),f=r.belowToLatex(o);return/^[0-9]$/.test(u)&&/^[0-9]$/.test(f)?`${r.command}${u}${f}`:jn(r.command,u,f)}}),Se(["brace","brack"],"",{infix:!0,createAtom:r=>new Fu(Ae(r.args[0]),Ae(r.args[1]),F(ot({},r),{hasBarLine:!1,leftDelim:r.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:r.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(r,o)=>Mn([r.aboveToLatex(o),r.command,r.belowToLatex(o)])}),Se(["over","atop","choose"],"",{infix:!0,createAtom:r=>{let o,u;const f=r.args;return r.command==="\\choose"&&(o="(",u=")"),new Fu(Ae(f[0]),Ae(f[1]),F(ot({},r),{hasBarLine:r.command==="\\over",leftDelim:o,rightDelim:u}))},serialize:(r,o)=>Mn([r.aboveToLatex(o),r.command,r.belowToLatex(o)])}),Se(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:r=>{var o,u;const f=r.args;return new Fu(Ae(f[0]),Ae(f[1]),F(ot({},r),{leftDelim:(o=f[2])!=null?o:".",rightDelim:(u=f[3])!=null?u:".",hasBarLine:!1}))},serialize:(r,o)=>`${r.aboveToLatex(o)} ${r.command}${r.leftDelim}${r.rightDelim}${r.belowToLatex(o)}`}),Se("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:r=>new Fu(Ae(r.args[0]),Ae(r.args[1]),F(ot({},r),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Se(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:r=>new Sg({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[r.command.slice(1)],F(ot({},r),{limits:"auto",variant:"main"}))}),Se("smallint","",{ifMode:"math",createAtom:r=>new Br("\u222B",F(ot({},r),{limits:"adjacent",variant:"main"}))});var Cy={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};Se(Object.keys(Cy),"",{ifMode:"math",createAtom:r=>{const o=r.command,u=Cy[o.slice(1)];return new Sg(u,F(ot({},r),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[u]}))}}),Se(["Re","Im"],"",{ifMode:"math",createAtom:r=>new Br({"\\Re":"\u211C","\\Im":"\u2111"}[r.command],F(ot({},r),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Se("middle","{:delim}",{ifMode:"math",createAtom:r=>{var o;return new Hp(F(ot({},r),{delim:(o=r.args[0])!=null?o:"|",size:1}))}}),Se("the","{:value}",{createAtom:r=>new ae(F(ot({},r),{captureSelection:!0,verbatimLatex:null})),render:(r,o)=>{var u;const f=new Nn({parent:o},r.style);let g="";r.isSelected&&(g+=" ML__selected");const b=f.evaluate(r.args[0]);return new Je(((u=Ts(b))!=null?u:"").split("").map(M=>new Je(M,{type:"ord",classes:g,mode:r.mode,isSelected:r.isSelected,style:ot({variant:"main"},r.style)})),{type:"lift",style:r.style,caret:r.caret,isSelected:r.isSelected,classes:g}).wrap(f)},serialize:r=>{var o;return`\\the${(o=Ts(r.args[0]))!=null?o:"\\relax"}`}}),Se("mathtip","{:auto}{:math}",{createAtom:r=>new Up(F(ot({},r),{body:Ae(r.args[0]),tooltip:Ae(r.args[1]),content:"math"})),serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`\\texttip{${r.bodyToLatex(o)}}{${ae.serialize([r.tooltip],F(ot({},o),{defaultMode:"math"}))}}`}),Se("texttip","{:auto}{:text}",{createAtom:r=>new Up(F(ot({},r),{body:Ae(r.args[0]),tooltip:Ae(r.args[1]),content:"text"})),serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`\\texttip{${r.bodyToLatex(o)}}{${ae.serialize([r.tooltip],F(ot({},o),{defaultMode:"text"}))}}`}),Se("error","{:math}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>`\\error{${r.bodyToLatex(o)}}`,render:(r,o)=>r.createBox(o,{classes:"ML__error"})}),Se("ensuremath","{:math}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>`${r.command}{${r.bodyToLatex(F(ot({},o),{defaultMode:"math"}))}}`}),Se("color","{:value}",{applyStyle:(r,o,u)=>{var f,g;return{verbatimColor:(f=Ts(o[0]))!=null?f:void 0,color:u.toColor((g=o[0])!=null?g:{string:"red"})}}}),Se("textcolor","{:value}{content:auto*}",{applyStyle:(r,o,u)=>{var f,g;return{verbatimColor:(f=Ts(o[0]))!=null?f:void 0,color:u.toColor((g=o[0])!=null?g:{string:"red"})}}}),Se("boxed","{content:math}",{createAtom:r=>new Rl(F(ot({},r),{body:Ae(r.args[0]),framecolor:{string:"black"}}))}),Se("colorbox","{:value}{:text*}",{applyStyle:(r,o,u)=>{var f,g;return{verbatimBackgroundColor:(f=Ts(o[0]))!=null?f:void 0,backgroundColor:u.toBackgroundColor((g=o[0])!=null?g:{string:"yellow"})}}}),Se("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:r=>{var o,u;return new Rl(F(ot({},r),{body:Ae(r.args[2]),framecolor:(o=r.args[0])!=null?o:{string:"blue"},backgroundcolor:(u=r.args[1])!=null?u:{string:"yellow"}}))},serialize:(r,o)=>{var u,f;return o.skipStyles?r.bodyToLatex(F(ot({},o),{defaultMode:"text"})):jn(r.command,(u=Ts(r.framecolor))!=null?u:"",(f=Ts(r.backgroundcolor))!=null?f:"",r.bodyToLatex(F(ot({},o),{defaultMode:"text"})))}}),Se("bbox","[:bbox]{body:auto}",{createAtom:r=>{var o;const u=r.args[0],f=Ae(r.args[1]);return u?new Rl(F(ot({},r),{body:f,padding:u.padding,border:u.border,backgroundcolor:(o=u.backgroundcolor)!=null?o:void 0})):new Rl(F(ot({},r),{body:f}))},serialize:(r,o)=>{var u,f;if(o.skipStyles)return r.bodyToLatex(o);let g=r.command;if(Number.isFinite(r.padding)||r.border!==void 0||r.backgroundcolor!==void 0){const b=[];r.padding&&b.push((u=Ts(r.padding))!=null?u:""),r.border&&b.push(`border: ${r.border}`),r.backgroundcolor&&b.push((f=Ts(r.backgroundcolor))!=null?f:""),g+=`[${b.join(",")}]`}return jn(g,r.bodyToLatex(o))}}),Se(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[0])})),render:(r,o)=>{const u=new Nn({parent:o,mathstyle:r.command.slice(1)},r.style),f=ae.createBox(u,r.body,{type:"lift"});return r.caret&&(f.caret=r.caret),r.bind(o,f)},serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`{${Mn([r.command,r.bodyToLatex(o)])}}`}),Se(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:r=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[r]})}),Se("fontseries","{:string}",{ifMode:"text",applyStyle:(r,o)=>{var u;return{fontSeries:(u=o[0])!=null?u:"auto"}}}),Se("fontshape","{:string}",{ifMode:"text",applyStyle:(r,o)=>{var u;return{fontShape:(u=o[0])!=null?u:"auto"}}}),Se("fontfamily","{:string}",{ifMode:"text",applyStyle:(r,o)=>{var u;return{fontFamily:(u=o[0])!=null?u:"roman"}}}),Se("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Se("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Se(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>`${r.command}{${r.bodyToLatex(o)}}`,render:(r,o)=>r.createBox(o,{classes:"ML__boldsymbol"})}),Se("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Se("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Se("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Se("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Se("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Se("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Se("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Se("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Se("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Se("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Se("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Se("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Se("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Se("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Se("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Se("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Se("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Se("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Se("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Se("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Se("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Se("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Se("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Se("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Se("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Se("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Se("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Se(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Se(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Se("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Se("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Se("mbox","{:text}",{ifMode:"math",createAtom:r=>new ae(F(ot({},r),{type:"mord",body:Ae(r.args[0]),mode:"math"})),serialize:(r,o)=>jn("\\mbox",r.bodyToLatex(F(ot({},o),{defaultMode:"text"})))}),Se("text","{:text}",{ifMode:"math",applyMode:"text"}),Se(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>!r.args[0]||o.skipStyles?r.bodyToLatex(o):`${r.command}{${r.args[0]}}{${r.bodyToLatex(o)}}`,render:(r,o)=>{var u;return r.createBox(o,{classes:(u=r.args[0])!=null?u:""})}}),Se(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>{var u;return!((u=r.args)!=null&&u[0])||o.skipStyles?r.bodyToLatex(o):`${r.command}{${r.args[0]}}{${r.bodyToLatex(o)}}`},render:(r,o)=>{var u;const f=r.createBox(o);return f.cssId=(u=r.args[0])!=null?u:"",f}}),Se("htmlData","{data:string}{content:auto}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>{var u;return!((u=r.args)!=null&&u[0])||o.skipStyles?r.bodyToLatex(o):`\\htmlData{${r.args[0]}}{${r.bodyToLatex(o)}}`},render:(r,o)=>{var u;const f=r.createBox(o);return f.htmlData=(u=r.args[0])!=null?u:"",f}}),Se(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>{var u;return!((u=r.args)!=null&&u[0])||o.skipStyles?r.bodyToLatex(o):`${r.command}{${r.args[0]}}{${r.bodyToLatex(o)}}`},render:(r,o)=>{var u;const f=r.createBox(o);return f.htmlStyle=(u=r.args[0])!=null?u:"",f}}),Se("em","{:rest}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[0])})),serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`{\\em ${r.bodyToLatex(o)}}`,render:(r,o)=>r.createBox(o,{classes:"ML__emph",boxType:"lift"})}),Se("emph","{:auto}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[1])})),serialize:(r,o)=>o.skipStyles?r.bodyToLatex(o):`\\emph{${r.bodyToLatex(o)}}`,render:(r,o)=>r.createBox(o,{classes:"ML__emph",boxType:"lift"})});var qm={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};Se(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:r=>{var o;return new rp(F(ot({},r),{delim:(o=r.args[0])!=null?o:".",size:qm[r.command].size,delimType:qm[r.command].mclass}))}}),Se(["hspace","hspace*"],"{width:value}",{createAtom:r=>{var o;return new Wp(F(ot({},r),{width:(o=r.args[0])!=null?o:{dimension:0}}))}}),Se(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:r=>{var o;return new Wp(F(ot({},r),{width:(o=r.args[0])!=null?o:{dimension:0}}))}}),Se("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:r=>new ae(r),render:(r,o)=>{let u=0;const f=o.mathstyle.id;(f===ua||f===Ho)&&(u=1),(f===La||f===Eo)&&(u=2),(f===Rs||f===Us)&&(u=3);const g=Ae(r.args[u]);return ae.createBox(o,g)},serialize:(r,o)=>`\\mathchoice{${ae.serialize(r.args[0],o)}}{${ae.serialize(r.args[1],o)}}{${ae.serialize(r.args[2],o)}}{${ae.serialize(r.args[3],o)}}`}),Se("mathop","{:auto}",{createAtom:r=>new ae(F(ot({},r),{type:"mop",body:Ae(r.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(r,o)=>{var u;let f=ae.createBox(o,r.body);if(r.superscript||r.subscript){const g=(u=r.subsupPlacement)!=null?u:"auto";f=g==="over-under"||g==="auto"&&o.isDisplayStyle?r.attachLimits(o,{base:f}):r.attachSupsub(o,{base:f})}return new Je(r.bind(o,f),{type:"op",isSelected:r.isSelected,classes:"op-group"})},serialize:(r,o)=>{const u=[jn(r.command,r.bodyToLatex(o))];return r.explicitSubsupPlacement&&(r.subsupPlacement==="over-under"&&u.push("\\limits"),r.subsupPlacement==="adjacent"&&u.push("\\nolimits"),r.subsupPlacement==="auto"&&u.push("\\displaylimits")),u.push(r.supsubToLatex(o)),Mn(u)}}),Se(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:r=>new ae(F(ot({},r),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[r.command],body:Ae(r.args[0])}))}),Se(["operatorname","operatorname*"],"{operator:math}",{createAtom:r=>{const o=Ae(r.args[0]).map(u=>{var f;return u.type!=="first"&&(u.type="mord",u.value=(f={"\u2217":"*","\u2212":"-"}[u.value])!=null?f:u.value,u.isFunction=!1,!u.style.variant&&!u.style.variantStyle&&(u.style.variant="main",u.style.variantStyle="up")),u});return new ae(F(ot({},r),{type:"mop",body:o,isFunction:!0,limits:r.command==="\\operatorname"?"adjacent":"over-under"}))},render:(r,o)=>{var u;let f=ae.createBox(o,r.body);if(r.superscript||r.subscript){const g=(u=r.subsupPlacement)!=null?u:"auto";f=g==="over-under"||g==="auto"&&o.isDisplayStyle?r.attachLimits(o,{base:f}):r.attachSupsub(o,{base:f})}return r.caret&&(f.caret=r.caret),new Je(r.bind(o,f),{type:"op",isSelected:r.isSelected,classes:"op-group"})},serialize:(r,o)=>{const u=[jn(r.command,r.bodyToLatex(o))];return r.explicitSubsupPlacement&&(r.subsupPlacement==="over-under"&&u.push("\\limits"),r.subsupPlacement==="adjacent"&&u.push("\\nolimits"),r.subsupPlacement==="auto"&&u.push("\\displaylimits")),u.push(r.supsubToLatex(o)),Mn(u)}}),Se(["char","unicode"],"{charcode:value}",{createAtom:r=>new ae(F(ot({},r),{type:r.mode==="text"?"text":"mord"})),serialize:r=>{var o;return`${r.command}${Ts((o=r.args[0])!=null?o:{number:10067,base:"hexadecimal"})}`},render:(r,o)=>{let u=o.evaluate(r.args[0]);return(!u||!("number"in u))&&(u={number:10067,base:"hexadecimal"}),r.value=String.fromCodePoint(u.number),r.createBox(o)}}),Se("rule","[raise:value]{width:value}{thickness:value}",{createAtom:r=>new ae(r),render:(r,o)=>{var u,f,g;const b=new Nn({parent:o,mathstyle:"textstyle"},r.style),M=b.toEm((u=r.args[0])!=null?u:{dimension:0}),N=b.toEm((f=r.args[1])!=null?f:{dimension:10}),I=b.toEm((g=r.args[2])!=null?g:{dimension:10}),B=new Je(null,{classes:"rule",type:"ord"});return B.width=N,B.height=I+M,B.depth=-M,B.setStyle("border-right-width",N,"em"),B.setStyle("border-top-width",I,"em"),B.setStyle("border-color",r.style.color),B.setStyle("vertical-align",M,"em"),r.isSelected&&B.setStyle("opacity","50%"),r.bind(b,B),r.caret&&(B.caret=r.caret),B.wrap(o)},serialize:r=>`\\rule${r.args[0]?`[${Ts(r.args[0])}]`:""}{${Ts(r.args[1])}}{${Ts(r.args[2])}}`}),Se(["overline","underline"],"{:auto}",{createAtom:r=>new ae(F(ot({},r),{body:Ae(r.args[0])})),render:(r,o)=>{const u=r.command.substring(1),f=new Nn({parent:o,mathstyle:"cramp"},r.style),g=ae.createBox(f,r.body);if(!g)return null;const b=f.metrics.defaultRuleThickness/f.scalingFactor,M=new Je(null,{classes:u+"-line"});M.height=b,M.maxFontSize=b*1.125*f.scalingFactor;let N;return u==="overline"?N=new Gr({shift:0,children:[{box:g},3*b,{box:M},b]}):N=new Gr({top:g.height,children:[b,{box:M},3*b,{box:g}]}),r.caret&&(N.caret=r.caret),new Je(N,{classes:u,type:"ignore"})}}),Se("overset","{:auto}{base:auto}",{createAtom:r=>{const o=Ae(r.args[1]);return new ef(F(ot({},r),{above:Ae(r.args[0]),body:o,skipBoundary:!1,boxType:Mo(o)}))},serialize:(r,o)=>jn(r.command,r.aboveToLatex(o),r.bodyToLatex(o))}),Se("underset","{:auto}{base:auto}",{createAtom:r=>{const o=Ae(r.args[1]);return new ef(F(ot({},r),{below:Ae(r.args[0]),body:o,skipBoundary:!1,boxType:Mo(o)}))},serialize:(r,o)=>jn(r.command,r.belowToLatex(o),r.bodyToLatex(o))}),Se("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:r=>{const o=Ae(r.args[2]);return new ef(F(ot({},r),{above:Ae(r.args[0]),below:Ae(r.args[1]),body:o,skipBoundary:!1,boxType:Mo(o)}))},serialize:(r,o)=>jn(r.command,r.belowToLatex(o),r.bodyToLatex(o))}),Se(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:r=>new ef(F(ot({},r),{body:Ae(r.args[2]),above:Ae(r.args[1]),below:Ae(r.args[0]),skipBoundary:!1,boxType:r.command==="\\stackrel"?"rel":"bin"})),serialize:(r,o)=>jn(r.command,r.aboveToLatex(o),r.bodyToLatex(o))}),Se("smash","[:string]{:auto}",{createAtom:r=>{var o,u,f,g;return new _0(F(ot({},r),{body:Ae(r.args[1]),smashHeight:(u=(o=r.args[0])==null?void 0:o.includes("t"))!=null?u:!0,smashDepth:(g=(f=r.args[0])==null?void 0:f.includes("b"))!=null?g:!0}))}}),Se(["vphantom"],"{:auto}",{createAtom:r=>new _0(F(ot({},r),{body:Ae(r.args[0]),isInvisible:!0,smashWidth:!0}))}),Se(["hphantom"],"{:auto}",{createAtom:r=>new _0(F(ot({},r),{body:Ae(r.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Se(["phantom"],"{:auto}",{createAtom:r=>new _0(F(ot({},r),{body:Ae(r.args[0]),isInvisible:!0}))}),Se("not","{:math}",{createAtom:r=>{const o=Ae(r.args[0]);return o.length===0?new ae(F(ot({},r),{type:"mrel",value:"\uE020"})):new ae(F(ot({},r),{body:[new Rf(F(ot({},r),{body:"\uE020",align:"right"})),...o],captureSelection:!0}))},serialize:(r,o)=>{const u=r.args[0],f=u&&typeof u=="object"&&"group"in u;return r.value!=="\uE020"?f?`\\not{${ae.serialize(u.group,o)}}`:`\\not${ae.serialize(u,o)}`:f?"\\not{}":"\\not"},render:(r,o)=>{if(r.value)return r.createBox(o);const f=r.args[0]&&typeof r.args[0]=="object"&&"group"in r.args[0]?"ord":Mo(Ae(r.args[0])),g=ae.createBox(o,r.body,{type:f});return r.caret&&(g.caret=r.caret),r.bind(o,g)}}),Se(["ne","neq"],"",{createAtom:r=>new ae(F(ot({},r),{type:"mrel",body:[new Rf(F(ot({},r),{body:"\uE020",align:"right",boxType:"rel"})),new ae(F(ot({},r),{value:"="}))],captureSelection:!0})),serialize:r=>r.command}),Se("rlap","{:auto}",{createAtom:r=>new Rf(F(ot({},r),{body:Ae(r.args[0]),align:"right"}))}),Se("llap","{:auto}",{createAtom:r=>new Rf(F(ot({},r),{body:Ae(r.args[0]),align:"left"}))}),Se("mathrlap","{:math}",{createAtom:r=>new Rf(F(ot({},r),{body:Ae(r.args[0]),align:"left"}))}),Se("mathllap","{:math}",{createAtom:r=>new Rf(F(ot({},r),{body:Ae(r.args[0]),align:"left"}))}),Se("raisebox","{:value}{:text}",{createAtom:r=>{var o;return new Rl(F(ot({},r),{body:Ae(r.args[1]),padding:{dimension:0},offset:(o=r.args[0])!=null?o:{dimension:0}}))},serialize:(r,o)=>{var u;return jn("\\raisebox",(u=Ts(r.offset))!=null?u:"0pt",r.bodyToLatex(o))}}),Se("raise","{:value}{:auto}",{createAtom:r=>{var o;return new Rl(F(ot({},r),{body:Ae(r.args[1]),padding:{dimension:0},offset:(o=r.args[0])!=null?o:{dimension:0}}))},serialize:(r,o)=>{var u;return jn("\\raise",(u=Ts(r.offset))!=null?u:"0pt",r.bodyToLatex(o))}}),Se("lower","{:value}{:auto}",{createAtom:r=>{var o;return new Rl(F(ot({},r),{body:Ae(r.args[1]),padding:{dimension:0},offset:(o=Cn(r.args[0],-1))!=null?o:{dimension:0}}))},serialize:(r,o)=>{var u,f;return jn("\\lower",(f=Ts(Cn((u=r.offset)!=null?u:{dimension:0},-1)))!=null?f:"0pt",r.bodyToLatex(o))}}),bt("0123456789/@.?!"),Gt(65,90),Gt(97,122),bt([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),bt([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),bt([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),bt([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),bt([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),bt([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),bt([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),bt([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),bt([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),bt([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),bt([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),bt([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),bt([["\\wp",8472],["\\aleph",8501]]),bt([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),bt([["\\ ",160],["~",160]],"space"),Se(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:r=>new Wp(r)}),Se("space","",{createAtom:r=>new Wp(r)}),bt([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),bt([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),bt([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var nm="<mo>⁡</mo>",u0="<mo>⁢</mo>";function cc(r){return r.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function dl(r,o){return!r||!o.generateID?"":` extid="${r}"`}function fv(r,o,u){var f,g,b,M,N,I,B,U,lt,Lt,Bt;let jt=!1;o=o!=null?o:r.atoms.length;let je="",Zi="",Le=r.atoms[r.index];const Ci=(g=(f=Le.style)==null?void 0:f.variant)!=null?g:"",en=(M=(b=Le.style)==null?void 0:b.variantStyle)!=null?M:"";let Oi="";if(Ci||en){const Jr=hi(Le.value,(N=Le.style)==null?void 0:N.variant,(I=Le.style)==null?void 0:I.variantStyle);if(Jr!==Le.value)return r.index+=1,je=`<mi${dl(Le.id,u)}>${Jr}</mi>`,Dr(je,r,u)||(r.mathML+=je,r.lastType="mi"),!0;Oi=(B={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[en+Ci])!=null?B:"",Oi=` mathvariant="${Oi}"`}const hr={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(Le.command==="!")return r.index+=1,je="<mo>!</mo>",Dr(je,r,u)||(r.mathML+=je,r.lastType="mo"),!0;if(hr[Le.command]){r.index+=1;let Jr=`<mi${dl(Le.id,u)}${Oi}>${hr[Le.command]}</mi>`;return(r.lastType==="mi"||r.lastType==="mn"||r.lastType==="mtext"||r.lastType==="fence")&&(Jr=u0+Jr),Dr(Jr,r,u)||(r.mathML+=Jr,r.lastType="mi"),!0}if(Le.command==="\\operatorname")Zi=Wd(Le.body),r.index+=1;else if(Ci||en)for(;r.index<o&&(Le.type==="mord"||Le.type==="macro")&&!Le.isDigit()&&Ci===((lt=(U=Le.style)==null?void 0:U.variant)!=null?lt:"")&&en===((Bt=(Lt=Le.style)==null?void 0:Lt.variantStyle)!=null?Bt:"");)Zi+=Wd([Le]),r.index+=1,Le=r.atoms[r.index];else(Le.type==="mord"||Le.type==="macro")&&!Le.isDigit()&&(Zi+=Wd([Le]),r.index+=1);if(Zi.length>0){jt=!0,je=`<mi${Oi}>${Zi}</mi>`;const Jr=r.lastType;je.endsWith(">f</mi>")||je.endsWith(">g</mi>")?(je+=nm,r.lastType="applyfunction"):r.lastType=/^<mo>(.*)<\/mo>$/.test(je)?"mo":"mi",Dr(je,r,u)||((Jr==="mi"||Jr==="mn"||Jr==="mtext"||Jr==="fence")&&(je=u0+je),r.mathML+=je)}return jt}function Qm(r){return r.index<r.atoms.length&&r.atoms[r.index].superscript&&r.atoms[r.index].type==="subsup"}function dv(r){let o=-1,u=r.index,f=!1,g=!1;for(;u<r.atoms.length&&!f&&!g;){const b=r.atoms[u];f=!b.isDigit(),g=!f&&b.superscript!==void 0,u++}return g&&(o=u-1),o}function Dr(r,o,u){var f;let g=o.atoms[o.index-1];if(!g)return!1;if(!g.superscript&&!g.subscript)if(((f=o.atoms[o.index])==null?void 0:f.type)==="subsup")g=o.atoms[o.index],o.index+=1;else return!1;const b=o.lastType;o.lastType="";const M=Pa(g.superscript,u);o.lastType="";const N=Pa(g.subscript,u);if(o.lastType=b,!M&&!N)return!1;let I="";return M&&N?I=`<msubsup>${r}${N}${M}</msubsup>`:M?I=`<msup>${r}${M}</msup>`:N&&(I=`<msub>${r}${N}</msub>`),o.mathML+=I,o.lastType="",!0}function S1(r,o,u){o=o!=null?o:r.atoms.length;const f=r.index;let g="";for(;r.index<o&&r.atoms[r.index].mode==="text";)g+=r.atoms[r.index].value?r.atoms[r.index].value:" ",r.index+=1;return g.length>0?(r.mathML+=`<mtext ${dl(r.atoms[f].id,u)}>${g}</mtext>`,r.lastType="mtext",!0):!1}function M1(r,o,u){o=o!=null?o:r.atoms.length;const f=r.index;let g="",b=dv(r);for(b>=0&&b<o&&(o=b);r.index<o&&r.atoms[r.index].isDigit();)g+=r.atoms[r.index].asDigit(),r.index+=1;return g.length<=0?!1:(g="<mn"+dl(r.atoms[f].id,u)+">"+g+"</mn>",b<0&&Qm(r)&&(b=r.index,r.index+=1),Dr(g,r,u)||(r.mathML+=g,r.lastType="mn"),!0)}function ky(r,o,u){let f=!1;o=o!=null?o:r.atoms.length;let g="",b="";if(r.index<o&&r.atoms[r.index].type==="mopen"){let M=!1,N=0;const I=r.index;let B=-1,U=I+1;for(;U<o&&!M;)r.atoms[U].type==="mopen"?N+=1:r.atoms[U].type==="mclose"&&(N-=1),N===-1&&(M=!0,B=U),U+=1;M&&(g="<mrow>",g+=Vd(r.atoms[I],u),g+=Pa(r.atoms,u,I+1,B),g+=Vd(r.atoms[B],u),g+="</mrow>",r.index=B+1,(r.lastType==="mi"||r.lastType==="mn"||r.lastType==="mfrac"||r.lastType==="fence")&&(r.mathML+=u0),Dr(g,r,u)&&(f=!0,r.lastType="",g=""),b="fence")}return g.length>0&&(f=!0,r.mathML+=g,r.lastType=b),f}function C1(r,o,u){let f=!1;o=o!=null?o:r.atoms.length;let g="",b="";const M=r.atoms[r.index];if(!M)return!1;const N={"\\ne":"≠","\\neq":"&neq;","\\pm":"±","\\times":"×","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(N[M.command]){r.index+=1;const I=`<mo${dl(M.id,u)}>${N[M.command]}</mo>`;return Dr(I,r,u)||(r.mathML+=I,r.lastType="mo"),!0}if(r.index<o&&(M.type==="mbin"||M.type==="mrel"))g+=pv(r.atoms[r.index],u),r.index+=1,b="mo";else if(r.index<o&&(M.type==="mop"||M.type==="operator"||M.type==="extensible-symbol")){if(M.subsupPlacement==="over-under"&&(M.superscript||M.subscript)){const I=Vd(M,u);return M.superscript&&M.subscript?(g+="<munderover>"+I,g+=Pa(M.subscript,u),g+=Pa(M.superscript,u),g+="</munderover>"):M.superscript?(g+="<mover>"+I,g+=Pa(M.superscript,u),g+="</mover>"):M.subscript&&(g+="<munder>"+I,g+=Pa(M.subscript,u),g+="</munder>"),r.mathML+=g,r.lastType="mo",r.index+=1,!0}{const I=r.atoms[r.index],B=I.value==="\\operatorname",U=B?'<mi class="MathML-Unit"'+dl(I.id,u)+">"+Wd(I.value)+"</mi>":Vd(I,u);g+=U,!B&&!/^<mo>(.*)<\/mo>$/.test(U)?(g+=nm,b="applyfunction"):b=B?"mi":"mo"}(r.lastType==="mi"||r.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(g)&&(g=u0+g),r.index+=1}return g.length>0&&(f=!0,Dr(g,r,u)||(r.mathML+=g,r.lastType=b)),f}function Pa(r,o,u,f){o!=null||(o={});const g={atoms:[],index:u!=null?u:0,mathML:"",lastType:""};if(typeof r=="number"||typeof r=="boolean")g.mathML=r.toString();else if(typeof r=="string")g.mathML=r;else if(r instanceof ae)g.mathML=pv(r,o);else if(Array.isArray(r)){g.atoms=r;let b=0;for(f=f||(r?r.length:0);g.index<f;)if(S1(g,f,o)||M1(g,f,o)||fv(g,f,o)||C1(g,f,o)||ky(g,f,o))b+=1;else if(g.index<f){let M=pv(g.atoms[g.index],o);g.lastType==="mn"&&M.length>0&&g.atoms[g.index].type==="genfrac"&&(M="<mo>⁤</mo>"+M),g.atoms[g.index].type==="genfrac"?g.lastType="mfrac":g.lastType="",g.index+=1,Dr(M,g,o)?b+=1:M.length>0&&(g.mathML+=M,b+=1)}b>1&&(g.mathML="<mrow>"+g.mathML+"</mrow>")}return g.mathML}function Vd(r,o){let u="";const f=Wd(r.value);return f&&(u="<mo"+dl(r.id,o)+">"+f+"</mo>"),u}function Wd(r){if(!r)return"";if(typeof r=="string")return cc(r);if(!Array.isArray(r)&&typeof r.body=="string")return cc(r.body);let o="";for(const u of r)typeof u.value=="string"&&(o+=u.value);return cc(o)}function pv(r,o){var u,f,g,b,M,N,I,B,U,lt,Lt,Bt,jt,je,Zi,Le,Ci,en,Oi,hr,Jr,Er;if(r.mode==="text")return`<mi${dl(r.id,o)}>${r.value}</mi>`;const ta={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},wl={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let mn="",bf="",Sf,Mf,fh,Cf,qh,Sa;const{command:bl}=r;if(r.command==="\\error")return`<merror${dl(r.id,o)}>${Pa(r.body,o)}</merror>`;const Uu={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Kf={"\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};switch(r.type){case"first":break;case"group":case"root":mn=Pa(r.body,o);break;case"array":if((r.leftDelim&&r.leftDelim!=="."||r.rightDelim&&r.rightDelim!==".")&&(mn+="<mrow>",r.leftDelim&&r.leftDelim!=="."&&(mn+="<mo>"+(Uu[r.leftDelim]||r.leftDelim)+"</mo>")),mn+="<mtable",r.colFormat){for(mn+=' columnalign="',fh=0;fh<r.colFormat.length;fh++)r.colFormat[fh].align&&(mn+={l:"left",c:"center",r:"right"}[r.colFormat[fh].align]+" ");mn+='"'}for(mn+=">",Mf=0;Mf<r.array.length;Mf++){for(mn+="<mtr>",Sf=0;Sf<r.array[Mf].length;Sf++)mn+="<mtd>"+Pa(r.array[Mf][Sf],o)+"</mtd>";mn+="</mtr>"}mn+="</mtable>",(r.leftDelim&&r.leftDelim!=="."||r.rightDelim&&r.rightDelim!==".")&&(r.rightDelim&&r.rightDelim!=="."&&(mn+="<mo>"+(Uu[r.leftDelim]||r.rightDelim)+"</mo>"),mn+="</mrow>");break;case"genfrac":(r.leftDelim||r.rightDelim)&&(mn+="<mrow>"),r.leftDelim&&r.leftDelim!=="."&&(mn+="<mo"+dl(r.id,o)+">"+(Uu[r.leftDelim]||r.leftDelim)+"</mo>"),r.hasBarLine?(mn+="<mfrac>",mn+=Pa(r.above,o)||"<mi> </mi>",mn+=Pa(r.below,o)||"<mi> </mi>",mn+="</mfrac>"):(mn+="<mtable"+dl(r.id,o)+">",mn+="<mtr>"+Pa(r.above,o)+"</mtr>",mn+="<mtr>"+Pa(r.below,o)+"</mtr>",mn+="</mtable>"),r.rightDelim&&r.rightDelim!=="."&&(mn+="<mo"+dl(r.id,o)+">"+(Uu[r.rightDelim]||r.rightDelim)+"</mo>"),(r.leftDelim||r.rightDelim)&&(mn+="</mrow>");break;case"surd":r.hasEmptyBranch("above")?(mn+="<msqrt"+dl(r.id,o)+">",mn+=Pa(r.body,o),mn+="</msqrt>"):(mn+="<mroot"+dl(r.id,o)+">",mn+=Pa(r.body,o),mn+=Pa(r.above,o),mn+="</mroot>");break;case"leftright":const lf=r,kf=lf.leftDelim;mn="<mrow>",kf&&kf!=="."&&(mn+=`<mo${dl(r.id,o)}>${(u=Uu[kf])!=null?u:kf}</mo>`),r.body&&(mn+=Pa(r.body,o));const Hf=lf.matchingRightDelim();Hf&&Hf!=="."&&(mn+=`<mo${dl(r.id,o)}>${(f=Uu[Hf])!=null?f:Hf}</mo>`),mn+="</mrow>";break;case"sizeddelim":case"delim":mn+=`<mo${dl(r.id,o)}>${Uu[r.value]||r.value}</mo>`;break;case"accent":mn+='<mover accent="true"'+dl(r.id,o)+">",mn+=Pa(r.body,o),mn+="<mo>"+(Kf[bl]||r.accent)+"</mo>",mn+="</mover>";break;case"line":case"overlap":break;case"overunder":qh=r.above,Cf=r.below,(r.svgAbove||qh)&&(r.svgBelow||Cf)?Sa=r.body:qh&&qh.length>0?(Sa=r.body,(b=(g=r.body)==null?void 0:g[0])!=null&&b.below?(Cf=r.body[0].below,Sa=r.body[0].body):((N=(M=r.body)==null?void 0:M[0])==null?void 0:N.type)==="first"&&((B=(I=r.body)==null?void 0:I[1])!=null&&B.below)&&(Cf=r.body[1].below,Sa=r.body[1].body)):Cf&&Cf.length>0&&(Sa=r.body,(lt=(U=r.body)==null?void 0:U[0])!=null&<.above?(qh=r.body[0].above,Sa=r.body[0].body):((Bt=(Lt=r.body)==null?void 0:Lt[0])==null?void 0:Bt.type)==="first"&&((je=(jt=r.body)==null?void 0:jt[1])!=null&&je.above)&&(qh=r.body[1].overscript,Sa=r.body[1].body)),(r.svgAbove||qh)&&(r.svgBelow||Cf)?(mn+=`<munderover ${dl(r.id,o)}>`,mn+=(Zi=ta[r.svgBody])!=null?Zi:Pa(Sa,o),mn+=(Le=ta[r.svgBelow])!=null?Le:Pa(Cf,o),mn+=(Ci=ta[r.svgAbove])!=null?Ci:Pa(qh,o),mn+="</munderover>"):r.svgAbove||qh?(mn+=`<mover ${dl(r.id,o)}>`+((en=ta[r.svgBody])!=null?en:Pa(Sa,o)),mn+=(Oi=ta[r.svgAbove])!=null?Oi:Pa(qh,o),mn+="</mover>"):(r.svgBelow||Cf)&&(mn+=`<munder ${dl(r.id,o)}>`+((hr=ta[r.svgBody])!=null?hr:Pa(Sa,o)),mn+=(Jr=ta[r.svgBelow])!=null?Jr:Pa(Cf,o),mn+="</munder>");break;case"placeholder":mn+="?";break;case"mord":{mn=typeof r.value=="string"?r.value:bl,bl==="\\char"?mn="&#x"+("000000"+r.args[0].number.toString(16)).slice(-4)+";":mn.length>0&&mn.startsWith("\\")&&(typeof r.value=="string"&&r.value.charCodeAt(0)>255?mn="&#x"+("000000"+r.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof r.value=="string"?mn=r.value.charAt(0):(console.error("Did not expect this"),mn=""));const Ef=/\d/.test(mn)?"mn":"mi";mn=`<${Ef}${dl(r.id,o)}>${cc(mn)}</${Ef}>`;break}case"mbin":case"mrel":case"minner":mn=Vd(r,o);break;case"mpunct":mn='<mo separator="true"'+dl(r.id,o)+">"+bl+"</mo>";break;case"mop":case"operator":case"extensible-symbol":r.body!=="\u200B"&&(mn="<mo"+dl(r.id,o)+">",mn+=bl==="\\operatorname"?r.body:bl||r.body,mn+="</mo>");break;case"box":mn='<menclose notation="box"',r.backgroundcolor&&(mn+=' mathbackground="'+r.backgroundcolor+'"'),mn+=dl(r.id,o)+">"+Pa(r.body,o)+"</menclose>";break;case"spacing":mn+='<mspace width="'+((Er=wl[bl])!=null?Er:0)+'em"/>';break;case"enclose":mn='<menclose notation="';for(const Ef in r.notation)Object.prototype.hasOwnProperty.call(r.notation,Ef)&&r.notation[Ef]&&(mn+=bf+Ef,bf=" ");mn+=dl(r.id,o)+'">'+Pa(r.body,o)+"</menclose>";break;case"prompt":mn='<menclose notation="roundexbox""">'+Pa(r.body,o)+"</menclose>";break;case"space":mn+=" ";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":mn+=Vd(r,o);break;case"mclose":mn+=Vd(r,o);break;case"macro":{const Ef=r.command+Wd(r.macroArgs);Ef&&(mn+=`<mo ${dl(r.id,o)}>${Ef}</mo>`)}break;case"latexgroup":mn+=Pa(r.body,o);break;case"latex":mn+="<mtext"+dl(r.id,o)+">"+r.value+"</mtext>";break;case"tooltip":mn+=Pa(r.body,o);break;case"text":mn+=`<mtext ${dl(r.id,o)}x>${r.value}</mtext>`;break;default:if(r.command==="\\displaystyle")return`<mrow ${dl(r.id,o)} displaystyle="true">${Pa(r.body,o)}</mrow>`;if(r.command==="\\textstyle")return`<mrow ${dl(r.id,o)} displaystyle="false">${Pa(r.body,o)}</mrow>`;console.info("Unexpected element in conversion to MathML:",r)}return mn}var h0={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},mv={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function Nl(r){let o="";return r.startsWith("\\")&&(o=" "+r.replace("\\","")+" "),o}function rm(r){let o=0;if(ne(r))for(const u of r)u.type!=="first"&&(o+=1);return o===1}function k1(r){if(ne(r)){for(const o of r)if(o.type!=="first"&&o.id)return o.id.toString()}return""}function Ey(r){let o="";if(ne(r))for(const u of r)u.type!=="first"&&typeof u.value=="string"&&(o+=u.value);return o}function fc(r){return r?r.map(o=>o.value).join(""):""}function Is(r,o){var u,f,g,b,M;function N(U){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(U)?` <say-as interpret-as="character">${U}</say-as>`:/[A-Z]/.test(U)?`capital <say-as interpret-as="character">${U.toLowerCase()}</say-as>`:U:/[a-z]/.test(U)?" '"+U.toUpperCase()+"'":/[A-Z]/.test(U)?" 'capital "+U.toUpperCase()+"'":U}function I(U){return"<emphasis>"+U+"</emphasis>"}if(!o)return"";let B="";if(ne(o)){let U=!1,lt=!1;for(let Lt=0;Lt<o.length;Lt++)o[Lt].type!=="first"&&(o[Lt].mode!=="text"&&(lt=!1),Lt<o.length-2&&o[Lt].type==="mopen"&&o[Lt+2].type==="mclose"&&o[Lt+1].type==="mord"?(B+=" of ",B+=I(Is(r,o[Lt+1])),Lt+=2):o[Lt].mode==="text"?lt?B+=(u=o[Lt].value)!=null?u:" ":(lt=!0,B+=Is("text",o[Lt])):o[Lt].isDigit()?U?B+=o[Lt].asDigit():(U=!0,B+=Is(r,o[Lt])):(U=!1,B+=Is(r,o[Lt])))}else if(o.mode==="text")o.id&&r==="math"&&(B+='<mark name="'+o.id.toString()+'"/>'),B+=o.value;else{o.id&&r==="math"&&(B+='<mark name="'+o.id.toString()+'"/>');let U="",lt="",Lt="",Bt=!1;const{command:jt}=o;switch(jt){case"\\vec":return"vector "+Is(r,o.body);case"\\acute":return Is(r,o.body)+" acute";case"\\grave":return Is(r,o.body)+" grave";case"\\dot":return"dot over"+Is(r,o.body);case"\\ddot":return"double dot over"+Is(r,o.body);case"\\mathring":return"ring over"+Is(r,o.body);case"\\tilde":case"\\widetilde":return"tilde over"+Is(r,o.body);case"\\bar":return Is(r,o.body)+" bar";case"\\breve":return Is(r,o.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Is(r,o.body);case"\\hat":case"\\widehat":return"hat over"+Is(r,o.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Is(r,o.body);case"\\underarc":case"\\underparen":return"arc under "+Is(r,o.body)}switch(o.type){case"prompt":const je=o.body.length>1?'start input . <break time="500ms"/> '+Is(r,o.body)+'. <break time="500ms"/> end input':"blank";B+=' <break time="300ms"/> '+je+'. <break time="700ms"/>'+((f=o.correctness)!=null?f:"")+' . <break time="700ms"/> ';break;case"array":const Zi=o.array,Le=o.environmentName;if(Object.keys(mv).includes(Le)){B+=` begin ${mv[Le]} `;for(let Oi=0;Oi<Zi.length;Oi++){Oi>0&&(B+=","),B+=` row ${Oi+1} `;for(let hr=0;hr<Zi[Oi].length;hr++)hr>0&&(B+=","),B+=` column ${hr+1}: `,B+=Is("math",Zi[Oi][hr])}B+=` end ${mv[Le]} `}break;case"group":jt==="\\ne"?B+=" not equal ":(jt==="\\not"&&(B+=" not "),B+=Is("math",o.body));break;case"root":B+=Is("math",o.body);break;case"genfrac":if(U=Is("math",o.above),lt=Is("math",o.below),rm(o.above)&&rm(o.below)){const hr={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[Ey(o.above)+"/"+Ey(o.below)];hr?B=hr:B+=U+" over "+lt}else B+=' the fraction <break time="150ms"/>'+U+' over <break time="150ms"/>'+lt+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(Lt=Is("math",o.body),o.hasEmptyBranch("above"))B+=rm(o.body)?" the square root of "+Lt+" , ":' the square root of <break time="200ms"/>'+Lt+'. <break time="200ms"/> End square root';else{let Oi=Is("math",o.above);Oi=Oi.trim();const hr=Oi.replace(/<mark([^/]*)\/>/g,"");hr==="3"?B+=' the cube root of <break time="200ms"/>'+Lt+'. <break time="200ms"/> End cube root':hr==="n"?B+=' the nth root of <break time="200ms"/>'+Lt+'. <break time="200ms"/> End root':B+=' the root with index: <break time="200ms"/>'+Oi+', of <break time="200ms"/>'+Lt+'. <break time="200ms"/> End root'}break;case"leftright":{const Oi=o;B+=(g=Oi.leftDelim?h0[Oi.leftDelim]:void 0)!=null?g:Oi.leftDelim,B+=Is("math",o.body),B+=(b=Oi.rightDelim?h0[Oi.rightDelim]:void 0)!=null?b:Oi.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const Ci=jt.replace(/^\\/g,""),en=Go()[Ci];en&&(en!=null&&en.expand?B+=Is("math",o.body):B+=`${Ci} `);break;case"placeholder":B+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(jt==="\\mathbin"||jt==="\\mathrel"||jt==="\\mathopen"||jt==="\\mathclose"||jt==="\\mathpunct"||jt==="\\mathord"||jt==="\\mathinner"){B=Is(r,o.body);break}let Oi=o.isDigit()?o.asDigit():o.value,hr=o.command;if((o.type==="delim"||o.type==="sizeddelim")&&(hr=o.value,Oi=hr),r==="text")B+=Oi;else{if(o.type==="mbin"&&(B+='<break time="150ms"/>'),Oi){const Jr=h0[Oi]||(hr?h0[hr.trim()]:"");if(Jr)B+=" "+Jr;else{const Er=hr?Nl(hr.trim()):"";B+=Er||N(Oi)}}else B+=Is("math",o.body);o.type==="mbin"&&(B+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(o.value!=="\u200B"){const Oi=o.command;if(Oi==="\\sum")if(!o.hasEmptyBranch("superscript")&&!o.hasEmptyBranch("subscript")){let hr=Is("math",o.superscript);hr=hr.trim();let Jr=Is("math",o.subscript);Jr=Jr.trim(),B+=' the summation from <break time="200ms"/>'+Jr+'<break time="200ms"/> to <break time="200ms"/>'+hr+'<break time="200ms"/> of <break time="150ms"/>',Bt=!0}else if(o.hasEmptyBranch("subscript"))B+=" the summation of";else{let hr=Is("math",o.subscript);hr=hr.trim(),B+=' the summation from <break time="200ms"/>'+hr+'<break time="200ms"/> of <break time="150ms"/>',Bt=!0}else if(Oi==="\\prod")if(!o.hasEmptyBranch("superscript")&&!o.hasEmptyBranch("subscript")){let hr=Is("math",o.superscript);hr=hr.trim();let Jr=Is("math",o.subscript);Jr=Jr.trim(),B+=' the product from <break time="200ms"/>'+Jr+'<break time="200ms"/> to <break time="200ms"/>'+hr+'<break time="200ms"/> of <break time="150ms"/>',Bt=!0}else if(o.hasEmptyBranch("subscript"))B+=" the product of ";else{let hr=Is("math",o.subscript);hr=hr.trim(),B+=' the product from <break time="200ms"/>'+hr+'<break time="200ms"/> of <break time="150ms"/>',Bt=!0}else if(Oi==="\\int")if(!o.hasEmptyBranch("superscript")&&!o.hasEmptyBranch("subscript")){let hr=Is("math",o.superscript);hr=hr.trim();let Jr=Is("math",o.subscript);Jr=Jr.trim(),B+=' the integral from <break time="200ms"/>'+I(Jr)+'<break time="200ms"/> to <break time="200ms"/>'+I(hr)+' <break time="200ms"/> of ',Bt=!0}else B+=' the integral of <break time="200ms"/> ';else if(typeof o.value=="string"){const hr=(M=h0[o.value])!=null?M:o.command?h0[o.command]:void 0;B+=hr||" "+o.value}else o.command&&(o.command==="\\mathop"?B+=Is("math",o.body):o.command==="\\operatorname"?B+=fc(o.body):B+=o.command.startsWith("\\")?" "+o.command.slice(1):" "+o.command)}break;case"enclose":Lt=Is("math",o.body),B+=" crossed out "+Lt+". End crossed out.";break;case"space":case"spacing":break}if(!Bt&&!o.hasEmptyBranch("superscript")){let je=Is(r,o.superscript);je=je.trim();const Zi=je.replace(/<[^>]*>/g,"");if(rm(o.superscript)){if(r==="math"){const Le=k1(o.superscript);Le&&(B+='<mark name="'+Le+'"/>')}Zi==="\u2032"?B+=" prime ":Zi==="2"?B+=" squared ":Zi==="3"?B+=" cubed ":Number.isNaN(Number.parseInt(Zi))?B+=" to the "+je+"; ":B+=' to the <say-as interpret-as="ordinal">'+Zi+"</say-as> power; "}else Number.isNaN(Number.parseInt(Zi))?B+=" raised to the "+je+"; ":B+=' raised to the <say-as interpret-as="ordinal">'+Zi+"</say-as> power; "}if(!Bt&&!o.hasEmptyBranch("subscript")){let je=Is("math",o.subscript);je=je.trim(),B+=rm(o.subscript)?" sub "+je:" subscript "+je+". End subscript. "}}return B}function ii(r){var o,u;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const g=Pa(r);if(g){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(o=window.MathfieldElement.textToSpeechRulesOptions)!=null?o:{},window.MathfieldElement.textToSpeechRulesOptions=F(ot({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=F(ot({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=F(ot({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const b=(u=window.SRE)!=null?u:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&b.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let M="";try{M=b.toSpeech(g)}catch(N){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",N)}return M}return""}let f=Is("math",r);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let g="";window.MathfieldElement.speechEngineRate&&(g='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),f='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+g+"<p><s>"+f+"</s></p>"+(g?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&Q()==="macos"?f=f.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):f=f.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return f}var bd={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},om={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function E1(r){let o="";for(const u of r){const f=o[o.length-1];f!==void 0&&/\d/.test(f)&&/^\d/.test(u)&&(o+=" "),o+=u}return o}function Tu(r){var o,u,f,g,b,M,N,I,B,U,lt,Lt,Bt;if(!r)return"";if(ne(r)){if(r.length===0)return"";if(r[0].mode==="latex")return r.map(Tu).join("");if(r[0].mode==="text"){let en=0,Oi="";for(;((o=r[en])==null?void 0:o.mode)==="text";)Oi+=r[en].body?Tu(r[en].body):r[en].value,en++;return`"${Oi}" ${Tu(r.slice(en))}`}let Le=0;const Ci=[];for(;r[Le]&&r[Le].mode==="math";){let en="";for(;r[Le]&&r[Le].type==="mord"&&/\d/.test(r[Le].value);)en+=r[Le++].value;en?Ci.push(en):Ci.push(Tu(r[Le++]))}return Ci.push(Tu(r.slice(Le))),E1(Ci)}if(r.mode==="text")return`"${r.value}"`;let jt="";const{command:je}=r;let Zi;if(je==="\\placeholder")return`(${Tu(r.body)})`;switch(r.type){case"accent":const Le={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[je];jt=`${Le!=null?Le:""} ${Tu(r.body)} `;break;case"first":return"";case"latexgroup":return r.body.map(Er=>Er.value).join("");case"group":case"root":jt=(u=bd[je])!=null?u:Tu(r.body);break;case"genfrac":{const Er=r;(Er.leftDelim||Er.rightDelim)&&(jt=Er.leftDelim==="."||!Er.leftDelim?"{:":Er.leftDelim),Er.hasBarLine?(jt+="(",jt+=Tu(Er.above),jt+=")/(",jt+=Tu(Er.below),jt+=")"):(jt+="("+Tu(Er.above)+"),",jt+="("+Tu(Er.below)+")"),(Er.leftDelim||Er.rightDelim)&&(jt+=Er.rightDelim==="."||!Er.rightDelim?"{:":Er.rightDelim)}break;case"surd":jt+=r.hasEmptyBranch("above")?"sqrt("+Tu(r.body)+")":"root("+Tu(r.above)+")("+Tu(r.body)+")";break;case"latex":jt=r.value;break;case"leftright":{const Er=r,ta=Er.leftDelim;jt+=ta==="."||!ta?"{:":ta,jt+=Tu(Er.body);const wl=Er.matchingRightDelim();jt+=wl==="."||!wl?":}":wl}break;case"sizeddelim":case"delim":jt=r.value;break;case"overlap":break;case"overunder":break;case"mord":jt=(g=(f=bd[je])!=null?f:je)!=null?g:typeof r.value=="string"?r.value:"",jt.startsWith("\\")&&(jt+=" "),Zi=je?je.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,Zi?jt=String.fromCodePoint(Number.parseInt("0x"+Zi[1])):jt.length>0&&jt.startsWith("\\")&&(jt=typeof r.value=="string"?r.value.charAt(0):r.command),jt=gv(jt,r.style);break;case"mbin":case"mrel":case"minner":jt=(M=(b=bd[je])!=null?b:om[je])!=null?M:r.value;break;case"mopen":case"mclose":jt=r.value;break;case"mpunct":jt=(N=om[je])!=null?N:je;break;case"mop":case"operator":case"extensible-symbol":r.value!=="\u200B"&&(om[je]?jt=om[je]:jt=je==="\\operatorname"?Tu(r.body):(I=r.value)!=null?I:je,jt+=" ");break;case"array":const Ci=r.array,en=r.environmentName,Oi=(B={bmatrix:["[","]"],"bmatrix*":["[","]"]}[en])!=null?B:["(",")"],hr=[];for(const Er of Ci){const ta=[];for(const wl of Er)ta.push(Oi[0]+Tu(wl)+Oi[1]);hr.push(ta.join(","))}const Jr=(U={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[en])!=null?U:["(",")"];jt=Jr[0]+hr.join(",")+Jr[1];break;case"box":break;case"spacing":jt=(lt=bd[je])!=null?lt:" ";break;case"enclose":jt="("+Tu(r.body)+")";break;case"space":jt=" ";break;case"subsup":jt="";break;case"macro":jt=(Bt=(Lt=bd[je])!=null?Lt:om[je])!=null?Bt:Tu(r.body);break}if(!r.hasEmptyBranch("subscript")){jt+="_";const Le=Tu(r.subscript);jt+=Le.length!==1?`(${Le})`:Le}if(!r.hasEmptyBranch("superscript")){jt+="^";const Le=Tu(r.superscript);jt+=Le.length!==1?`(${Le})`:Le}return jt}function gv(r,o){if(!o)return r;let u=r;return o.variant==="double-struck"&&(u=`bbb "${u}"`),o.variant==="script"&&(u=`cc "${u}"`),o.variant==="fraktur"&&(u=`fr "${u}"`),o.variant==="sans-serif"&&(u=`sf "${u}"`),o.variant==="monospace"&&(u=`tt "${u}"`),o.variantStyle==="bold"&&(u=`bb "${u}"`),o.color?`color({${o.color}})(${u})`:u}function tu(r,o){var u,f;o!=null||(o={}),o.mathstyle=(u=o.mathstyle)!=null?u:"displaystyle";const g=new Nn({from:F(ot({},Ss()),{renderPlaceholder:()=>new Je(160,{maxFontSize:1}),letterShapeStyle:(f=o==null?void 0:o.letterShapeStyle)!=null?f:"tex"}),mathstyle:o.mathstyle}),M=new ae({mode:"math",type:"root",body:au(r,{context:g,parseMode:"math",mathstyle:o.mathstyle})}).render(g);return M?(wn(Bf(M,g)),lr(M,{classes:"ML__latex"}).toMarkup()):""}function vx(r){return Dd(r,{context:Ss()})}function ih(r,o={}){return Pa(au(r,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),o)}function Ly(r){const o=au(r,{parseMode:"math",mathstyle:"displaystyle"});return ii(o)}var _u;function yx(r){var o,u;if(!_u){const f=(o=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:o.ComputeEngine;f?_u=new f:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(u=_u==null?void 0:_u.box(r).latex)!=null?u:""}function pl(r,o="math"){return Tu(new ae({type:"root",body:au(r,{parseMode:o})}))}function Ep(r){return Dh(r,{format:"ascii-math"})[1]}function vv(r){if(typeof r=="string"){const o=af(r);if(!o)throw new Error(`Invalid color: ${r}`);return o}return"C"in r?Ra(r):"a"in r?yv(r):r}function c0(r){return r<0?0:r>255?255:Math.round(r)}function af(r){if(!r||r[0]!=="#")return;r=r.slice(1);let o;return r.length<=4?(o={r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16)},r.length===4&&(o.a=parseInt(r[3]+r[3],16)/255)):(o={r:parseInt(r[0]+r[1],16),g:parseInt(r[2]+r[3],16),b:parseInt(r[4]+r[5],16)},r.length===8&&(o.a=parseInt(r[6]+r[7],16)/255)),o&&typeof o.a=="undefined"&&(o.a=1),o}function Dc(r){const[o,u,f]=[r.L,r.C,r.H],g=f*Math.PI/180,b={L:o,a:u*Math.cos(g),b:u*Math.sin(g)};return r.alpha!==void 0&&(b.alpha=r.alpha),b}function tg(r){const[o,u,f]=[r.L,r.a,r.b],g=Math.sqrt(u*u+f*f),M=Math.atan2(f,u)*180/Math.PI,N={L:o,C:g,H:M};return r.alpha!==void 0&&(N.alpha=r.alpha),N}function sm(r){const[o,u,f]=[r.L,r.a,r.b],g=Math.pow(.9999999984505198*o+.39633779217376786*u+.2158037580607588*f,3),b=Math.pow(1.00000000888176*o-.10556134232365635*u-.0638541747717059*f,3),M=Math.pow(o*1.000000054672411-.0894841820949657*u-1.2914855378640917*f,3),N=4.076741661347994*g-3.307711590408193*b+.230969928729428*M,I=-1.2684380040921763*g+2.6097574006633715*b-.3413193963102197*M,B=-.004196086541837188*g-.7034186144594493*b+1.7076147009309444*M,U=lt=>{const Lt=Math.abs(lt);return Lt<=.0031308?lt*12.92:(Math.sign(lt)||1)*(1.055*Math.pow(Lt,1/2.4)-.055)};return[U(N),U(I),U(B)]}function eg(r){const[o,u,f]=r;return o>=0&&o<=1&&u>=0&&u<=1&&f>=0&&f<=1}function f0(r,o){let[u,f,g]=r;return u=c0(u*255),f=c0(f*255),g=c0(g*255),o!==void 0?{r:u,g:f,b:g,alpha:o}:{r:u,g:f,b:g}}function yv(r){let[o,u,f]=sm(r);if(eg([o,u,f]))return f0([o,u,f],r.alpha);const g=tg(r);if(g.C=0,[o,u,f]=sm(Dc(g)),!eg([o,u,f]))return f0([o,u,f],r.alpha);let b=0,M=r.L,N=(b+M)/2;g.C=N;const I=.36/Math.pow(2,12);for(;M-b>I;)N=(b+M)/2,g.C=N,[o,u,f]=sm(Dc(g)),eg([o,u,f])?b=N:M=N;return f0([o,u,f],r.alpha)}function Ra(r){return yv(Dc(r))}function cs(r,o){const u=vv(r),f=vv(o),g=.56,b=.57,M=.62,N=.65,I=.022,B=1.414,U=.1,lt=5e-4,Lt=1.14,Bt=.027,jt=1.14,je=.027;function Zi(Er){return Er>=I?Er:Er+Kp(I-Er,B)}function Le(Er){return(Er<0?-1:1)*Math.pow(Math.abs(Er),2.4)}const Ci=Zi(Le(f.r/255)*.2126729+Le(f.g/255)*.7151522+Le(f.b/255)*.072175),en=Zi(Le(u.r/255)*.2126729+Le(u.g/255)*.7151522+Le(u.b/255)*.072175);let Oi,hr,Jr;return Math.abs(en-Ci)<lt?hr=0:en>Ci?(Oi=Kp(en,g)-Kp(Ci,b),hr=Oi*Lt):(Oi=Kp(en,N)-Kp(Ci,M),hr=Oi*jt),Math.abs(hr)<U?Jr=0:hr>0?Jr=hr-je:Jr=hr+Bt,Jr*100}function Ty(r,o,u){u!=null||(u="#fff"),o!=null||(o="#000");const f=cs(r,u),g=cs(r,o);return Math.abs(f)>Math.abs(g)?u:o}function Hc(r){const o=vv(r);let u=((1<<24)+(c0(o.r)<<16)+(c0(o.g)<<8)+c0(o.b)).toString(16).slice(1);return o.alpha!==void 0&&o.alpha<1&&(u+=("00"+Math.round(o.alpha*255).toString(16)).slice(-2)),u[0]===u[1]&&u[2]===u[3]&&u[4]===u[5]&&u[6]===u[7]&&(u=u[0]+u[2]+u[4]+(o.alpha!==void 0&&o.alpha<1?u[6]:"")),"#"+u}function lo(r){const o=_y(r);let u="";for(const f of o){if(typeof f.value!="string")return"";u+=f.value}return u}function _y(r){const u=r.model.selection.ranges;return u.length!==1?[]:r.model.getAtoms(u[0])}function xx(r,o){const u=_y(r);if(u.length!==1)return!1;const f=ap[o];return f?!!f.test(u[0].value):!1}function L1(r,o){return lo(r).length>0}function ig(r){return[Os(r,"double-struck","mathbb","tooltip.blackboard"),Os(r,"fraktur","mathfrak","tooltip.fraktur"),Os(r,"calligraphic","mathcal","tooltip.caligraphic"),d0(r,"up","mathrm","tooltip.roman-upright"),d0(r,"bold","mathbf","tooltip.bold"),d0(r,"italic","mathit","tooltip.italic")]}function nr(r){return[{label:()=>tu(`\\vec{${lo(r)}}`),visible:()=>lo(r).length===1,onMenuSelect:()=>r.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>tu(`\\overrightarrow{${lo(r)}}`),visible:()=>lo(r).length>0,onMenuSelect:()=>r.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>tu(`\\overleftarrow{${lo(r)}}`),visible:()=>lo(r).length>0,onMenuSelect:()=>r.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>tu(`\\dot{${lo(r)}}`),visible:()=>lo(r).length===1,onMenuSelect:()=>r.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>tu(`\\ddot{${lo(r)}}`),visible:()=>lo(r).length===1,onMenuSelect:()=>r.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>tu(`\\bar{${lo(r)}}`),visible:()=>lo(r).length===1,onMenuSelect:()=>r.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>tu(`\\overline{${lo(r)}}`),visible:()=>lo(r).length>0,onMenuSelect:()=>r.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>tu(`\\overgroup{${lo(r)}}`),visible:()=>lo(r).length>0,onMenuSelect:()=>r.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>tu(`\\overbrace{${lo(r)}}`),visible:()=>lo(r).length>0,onMenuSelect:()=>r.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>tu(`\\underline{${lo(r)}}`),visible:()=>lo(r).length>0,onMenuSelect:()=>r.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>tu(`\\undergroup{${lo(r)}}`),visible:()=>lo(r).length>0,onMenuSelect:()=>r.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>tu(`\\underbrace{${lo(r)}}`),visible:()=>lo(r).length>0,onMenuSelect:()=>r.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function T1(r){return[{label:()=>tu(`\\boxed{${r.getValue(r.model.selection)}}}`),onMenuSelect:()=>r.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>tu(`\\bbox[5px, border: 2px solid red]{${r.getValue(r.model.selection)}}`),onMenuSelect:()=>r.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>tu(`\\bbox[5px, border: 2px dashed black]{${r.getValue(r.model.selection)}}`),onMenuSelect:()=>r.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Jh(r){const o=[];for(const u of Object.keys(Ot))o.push({class:(Hc(Ty(Ot[u]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ot[u]} "></span>`,ariaLabel:()=>{var f;return(f=Wt(u))!=null?f:u},checked:()=>{var f;return{some:"mixed",all:!0}[(f=r.queryStyle({backgroundColor:u}))!=null?f:!1]},onMenuSelect:()=>{r.applyStyle({backgroundColor:u},{operation:"toggle"}),r.adoptStyle="none"}});return o}function am(r){const o=[];for(const u of Object.keys(qt))o.push({class:(Ty(qt[u])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${qt[u]} "></span>`,ariaLabel:()=>{var f;return(f=Wt(u))!=null?f:u},checked:()=>{var f;return{some:"mixed",all:!0}[(f=r.queryStyle({color:u}))!=null?f:!1]},onMenuSelect:()=>{r.applyStyle({color:u},{operation:"toggle"}),r.adoptStyle="none"}});return o}var xv=class extends im{constructor(r,o,u,f){super(r,o),this.row=u,this.col=f}set active(r){const o=this.parentMenu.children;if(r)for(const u of o)u.element.classList.toggle("active",u.row<=this.row&&u.col<=this.col);else for(const u of o)u.element.classList.remove("active")}};function lm(r){const o=[];for(let u=1;u<=5;u++)for(let f=1;f<=5;f++)o.push({onCreate:(g,b)=>new xv(g,b,u,f),label:"\u2610",tooltip:()=>Wt("tooltip.row-by-col",u,f),data:{row:u,col:f},onMenuSelect:()=>{r.insert(`\\begin{pmatrix}${Array(u).fill(Array(f).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return o}function _1(r){return[{label:()=>Wt("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>r.executeCommand("addRowBefore"),visible:()=>Lp(r)},{label:()=>Wt("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>r.executeCommand("addRowAfter"),visible:()=>Lp(r)},{label:()=>Wt("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>r.executeCommand("addColumnBefore"),visible:()=>Lp(r),enabled:()=>{const o=r.model.parentEnvironment;if(!o)return!1;const[u,f]=P1(r);return u<o.maxColumns}},{label:()=>Wt("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>r.executeCommand("addColumnAfter"),visible:()=>Lp(r)},{type:"divider"},{label:()=>Wt("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>r.executeCommand("removeRow"),visible:()=>Lp(r)},{label:()=>Wt("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>r.executeCommand("removeColumn"),visible:()=>Lp(r)},{type:"divider"},{label:()=>Wt("menu.borders"),visible:()=>(Py(r)||Lp(r))&&r.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Tp(r,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Tp(r,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Tp(r,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Tp(r,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Tp(r,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>Wt("menu.insert matrix"),id:"insert-matrix",visible:()=>r.isSelectionEditable,submenu:lm(r),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>Wt("menu.mode"),id:"mode",visible:()=>r.isSelectionEditable&&r.model.selectionIsCollapsed,submenu:[{label:()=>Wt("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{fp(r,"accept-all"),r.executeCommand(["switchMode","math"])},checked:()=>r.model.mode==="math"},{label:()=>Wt("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{fp(r,"accept-all"),r.executeCommand(["switchMode","text"])},checked:()=>r.model.mode==="text"},{label:()=>Wt("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>r.executeCommand(["switchMode","latex"]),checked:()=>r.model.mode==="latex"}]},{type:"divider"},{label:()=>Wt("menu.font-style"),id:"variant",visible:()=>r.isSelectionEditable,submenu:ig(r),submenuClass:"variant-submenu"},{label:()=>Wt("menu.color"),id:"color",visible:()=>r.isSelectionEditable,submenu:am(r),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>Wt("menu.background-color"),id:"background-color",visible:()=>r.isSelectionEditable,submenu:Jh(r),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>Wt("menu.accent"),id:"accent",visible:()=>r.isSelectionEditable,submenu:nr(r),submenuClass:"variant-submenu"},{label:()=>Wt("menu.decoration"),id:"decoration",visible:()=>r.isSelectionEditable&&lo(r).length>0,submenu:T1(r),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>Wt("menu.evaluate"),id:"ce-evaluate",visible:()=>r.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const o=nh(r);if(!o){r.model.announce("plonk");return}r.model.selectionIsCollapsed?(r.model.position=r.model.lastOffset,r.insert(`=${o}`,{insertionMode:"insertAfter",selectionMode:"item"})):r.insert(o,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>Wt("menu.simplify"),id:"ce-simplify",visible:()=>r.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var o,u;if(r.model.selectionIsCollapsed){const f=(o=r.expression)==null?void 0:o.simplify();if(r.model.position=r.model.lastOffset,!f){r.model.announce("plonk");return}r.insert(`=${f.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const f=(u=window.MathfieldElement.computeEngine)==null?void 0:u.parse(r.getValue(r.model.selection)).simplify();if(!f){r.model.announce("plonk");return}r.insert(f.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var o;if(window.MathfieldElement.computeEngine===null)return"";const u=(o=r.expression)==null?void 0:o.unknowns[0];return u?Wt("menu.solve-for",tu(u)):Wt("menu.solve")},id:"ce-solve",visible:()=>{var o;return r.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((o=r.expression)==null?void 0:o.unknowns.length)===1&&r.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var o;const u=r.expression,f=u==null?void 0:u.unknowns[0],g=(o=u.solve(f))==null?void 0:o.map(b=>{var M;return(M=b.simplify().latex)!=null?M:""});if(!g){r.model.announce("plonk");return}r.insert(`${f}=${g.length===1?g[0]:"\\left\\lbrace"+(g==null?void 0:g.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>Wt("menu.cut"),onMenuSelect:()=>r.executeCommand("cutToClipboard"),visible:()=>!r.options.readOnly&&r.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>Wt("menu.copy"),id:"copy",submenu:[{label:()=>Wt("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>ur.copyToClipboard(r,"latex"),keyboardShortcut:"meta+C"},{label:()=>Wt("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>ur.copyToClipboard(r,"ascii-math")},{label:()=>Wt("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>ur.copyToClipboard(r,"math-ml")}]},{label:()=>Wt("menu.paste"),id:"paste",onMenuSelect:()=>r.executeCommand("pasteFromClipboard"),visible:()=>r.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>Wt("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>r.executeCommand("selectAll")}]}function Lp(r){var o;return!!((o=r.model.parentEnvironment)!=null&&o.array)}function Py(r){return r.model.at(r.model.position).type==="array"}function P1(r){var o;const u=(o=r.model.parentEnvironment)==null?void 0:o.array;return u?[u.length,u.reduce((f,g)=>Math.max(f,g.length),0)]:[0,0]}function Tp(r,o){cp(r),r.flushInlineShortcutBuffer(),$m(r.model,o),ql(r)}function nh(r){var o,u;let f;if(r.model.selectionIsCollapsed?f=(o=window.MathfieldElement.computeEngine)==null?void 0:o.parse(r.getValue(),{canonical:!1}):f=(u=window.MathfieldElement.computeEngine)==null?void 0:u.parse(r.getValue(r.model.selection),{canonical:!1}),!f)return"";let g=f.evaluate();return g.isSame(f)&&(g=f.N()),g.latex}function Os(r,o,u,f){return{label:()=>tu(`\\${u}{${lo(r)}}`),tooltip:()=>{var g;return(g=Wt(f))!=null?g:f},visible:()=>xx(r,o),checked:()=>{var g;return{some:"mixed",all:!0}[(g=r.queryStyle({variant:o}))!=null?g:!1]},onMenuSelect:()=>{r.applyStyle({variant:o},{operation:"toggle"}),r.adoptStyle="none"}}}function d0(r,o,u,f){return{label:()=>tu(`\\${u}{${lo(r)}}`),tooltip:()=>{var g;return(g=Wt(f))!=null?g:f},visible:()=>L1(r,o),checked:()=>{var g;return{some:"mixed",all:!0}[(g=r.queryStyle({variantStyle:o}))!=null?g:!1]},onMenuSelect:()=>{r.applyStyle({variantStyle:o},{operation:"toggle"}),r.adoptStyle="none"}}}function Sd(r,o){return r+ii(o)}vu({speak:(r,o,u)=>ng(r,o,u)},{target:"mathfield"});function ng(r,o,u){var f,g;u=u!=null?u:{withHighlighting:!1};const{model:b}=r;function M(U){let lt=null;switch(U){case"all":lt=b.root;break;case"selection":lt=b.getAtoms(b.selection);break;case"left":{lt=b.getAtoms(b.offsetOf(b.at(b.position).leftSibling),b.position);break}case"right":{lt=b.getAtoms(b.position,b.offsetOf(b.at(b.position).rightSibling));break}case"group":lt=b.getAtoms(b.getSiblingsRange(b.position));break;case"parent":{const{parent:Lt}=b.at(b.position);Lt!=null&&Lt.parent?lt=Lt:lt=b.root;break}default:lt=b.root}return lt}function N(U){let lt="";switch(U){case"all":console.log("Internal failure: speak all failed");break;case"selection":lt="no selection";break;case"left":lt="at start";break;case"right":lt="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":lt="no parent";break;default:console.log('unknown speak_ param value: "'+U+'"');break}return lt}const I=M(o);if(I===null)return(g=(f=window.MathfieldElement).speakHook)==null||g.call(f,N(o)),!1;(u.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const B=ii(I);return le()&&u.withHighlighting?(ld().readAloudMathfield=r,pp(r,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(r.field,B)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(B),!1}function N1(r){var o,u;if(!le()){console.log("Speak:",r);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const f=new SpeechSynthesisUtterance(r);window.speechSynthesis.speak(f)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const f=new window.AWS.Polly({apiVersion:"2016-06-10"}),g={OutputFormat:"mp3",VoiceId:(o=window.MathfieldElement.speechEngineVoice)!=null?o:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((u=window.MathfieldElement.speechEngineVoice)!=null?u:"Joanna")?"neural":"standard",Text:r,TextType:"ssml"};f.synthesizeSpeech(g,(b,M)=>{if(b)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${b}`);else if(M!=null&&M.AudioStream){const N=new Uint8Array(M.AudioStream),I=new Blob([N.buffer],{type:"audio/mpeg"}),B=URL.createObjectURL(I);new Audio(B).play().catch(lt=>console.log(lt))}else console.log("polly.synthesizeSpeech():",M)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function Ny(r){var o;let u;if(r.parent.type==="prompt")r.parentBranch==="body"&&(u="prompt");else if(r.parentBranch==="body")u=r.type&&(o={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[r.type])!=null?o:"parent";else if(r.parent.type==="genfrac"){if(r.parentBranch==="above")return"numerator";if(r.parentBranch==="below")return"denominator"}else r.parent.type==="surd"?r.parentBranch==="above"&&(u="index"):r.parentBranch==="superscript"?u="superscript":r.parentBranch==="subscript"&&(u="subscript");return u||console.log("unknown relationship"),u!=null?u:"parent"}function A1(r,o,u,f){let g="";if(o==="plonk")window.MathfieldElement.playSound("plonk"),r.flushInlineShortcutBuffer();else if(o==="delete")g=Sd("deleted: ",f);else if(o==="focus"||o.includes("move"))g=D1(r.model,u)+(r.model.selectionIsCollapsed?"":"selected: ")+I1(r.model);else if(o==="replacement")g=Sd("",r.model.at(r.model.position));else if(o==="line"){const b=Sd("",r.model.root);r.keyboardDelegate.setAriaLabel(b)}else g=f?Sd(o+" ",f):o;if(g){const b=r.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";r.ariaLiveText.textContent=g+b}}function D1(r,o){if(Number.isNaN(o))return"";const u=r.at(o);if(!u||u.treeDepth<=r.at(r.position).treeDepth)return"";let f="",g=u.parent;const b=r.at(r.position).parent;for(;g!==r.root&&g!==b;)f+=`out of ${Ny(g)};`,g=g.parent;return f}function I1(r){if(!r.selectionIsCollapsed)return Sd("",r.getAtoms(r.selection));let o="";const u=r.at(r.position),f=Ny(u);return u.isFirstSibling&&(o=(f?"start of "+f:"unknown")+": "),u.isLastSibling?u.isFirstSibling||(o+=f?"end of "+f:"unknown"):o+=Sd("",u),o}var Ay=class{constructor(r,o,u){this.mathfield=r,this.mode=o,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=u}dispose(){this.mathfield=void 0}getState(){const r={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(r.direction=this.selection.direction),{content:this.root.toJson(),selection:r,mode:this.mode}}setState(r,o){var u;const f=this.silenceNotifications;this.silenceNotifications=(u=o==null?void 0:o.silenceNotifications)!=null?u:!0;let g={};if((o==null?void 0:o.type)==="undo"&&(g={inputType:"historyUndo"}),(o==null?void 0:o.type)==="redo"&&(g={inputType:"historyRedo"}),this.contentWillChange(g)){const b=this.silenceNotifications;this.silenceNotifications=!0,this.mode=r.mode,this.root=Od(r.content),this.selection=r.selection,this.silenceNotifications=b,this.contentDidChange(g)}this.silenceNotifications=f}get atoms(){return this.root.children}get selection(){return this._selection}set selection(r){this.setSelection(r)}setSelection(r,o){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var u,f,g;const b=this.normalizeSelection(r,o);if(b===void 0)throw new TypeError("Invalid selection");if(b.ranges.length===1&&b.ranges[0][0]===b.ranges[0][1]){const U=b.ranges[0][0];if(!this.mathfield.dirty&&!((u=this.at(U))!=null&&u.parentPrompt)&&this.mathfield.hasEditablePrompts){if((f=this.at(U-1))!=null&&f.parentPrompt){this._anchor=this.normalizeOffset(U-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((g=this.at(U+1))!=null&&g.parentPrompt){this._anchor=this.normalizeOffset(U+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=U,this._position=U,this._selection=b;return}const M=Ds(b);b.direction==="backward"?[this._position,this._anchor]=M:[this._anchor,this._position]=M;const N=this.at(M[0]+1),I=this.at(M[1]),B=ae.commonAncestor(N,I);(B==null?void 0:B.type)==="array"&&N.parent===B&&I.parent===B?this._selection={ranges:[M],direction:b.direction}:this._selection={ranges:[M],direction:b.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(r){var o;const u=this.at(r);(u==null?void 0:u.type)==="placeholder"?this.setSelection(r-1,r):((o=u==null?void 0:u.rightSibling)==null?void 0:o.type)==="placeholder"?this.setSelection(r,r+1):this.position=r,u instanceof bh&&u.isSuggestion&&(u.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(r){this.setSelection(r,r)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(r="forward"){return this._anchor===this._position?!1:(r==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(r){return this.atoms[r]}offsetOf(r){return this.atoms.indexOf(r)}getSiblingsRange(r){const o=this.at(r),{parent:u}=o;if(!u)return[0,this.lastOffset];const f=o.parent.branch(o.parentBranch);return[this.offsetOf(f[0]),this.offsetOf(f[f.length-1])]}getBranchRange(r,o){const u=this.at(r).branch(o);return[this.offsetOf(u[0]),this.offsetOf(u[u.length-1])]}getAtoms(r,o,u){let f=u!=null?u:{};if(Lc(r)){if(f=o!=null?o:{},r.ranges.length>1)return r.ranges.reduce((B,U)=>[...B,...this.getAtoms(U,f)],[]);r=r.ranges[0]}let g,b;if(ku(r)){if(g=r,!ku(o))return[];b=o}else[g,b]=r,f=o!=null?o:{};if(!Number.isFinite(g))return[];f.includeChildren===void 0&&(f.includeChildren=!1),g<0&&(g=this.lastOffset-g+1),b<0&&(b=this.lastOffset-b+1);const M=Math.min(g,b)+1,N=Math.max(g,b);if(!f.includeChildren&&M===1&&N===this.lastOffset)return[this.root];let I=[];for(let B=M;B<=N;B++){const U=this.atoms[B];rg(this,U,M,N)&&I.push(U)}return f.includeChildren||(I=I.filter(B=>{let U=!1,{parent:lt}=B;for(;lt&&!U;)U=rg(this,lt,M,N),lt=lt.parent;return!U})),I}getAllAtoms(r=0){const o=[],u=this.lastOffset;for(let f=r;f<=u;f++)o.push(this.atoms[f]);for(let f=0;f<r;f++)o.push(this.atoms[f]);return o}findAtom(r,o=0,u="forward"){let f;const g=this.lastOffset;if(u==="forward"){for(let b=o;b<=g;b++)if(f=this.atoms[b],r(f))return f;for(let b=0;b<o;b++)if(f=this.atoms[b],r(f))return f;return}for(let b=o;b>=0;b--)if(f=this.atoms[b],r(f))return f;for(let b=g;b>o;b--)if(f=this.atoms[b],r(f))return f}extractAtoms(r){let o=this.getAtoms(r);if(o.length===1&&!o[0].parent)if(o[0].type==="root")o=[...o[0].body],o.shift();else return o=this.root.cells.flat(),this.root=new ae({type:"root",body:[]}),o;for(const u of o)u.parent.removeChild(u);return o}deleteAtoms(r){this.extractAtoms(r),this.position=r[0]}atomToString(r,o){const u=o!=null?o:"latex";if(u.startsWith("latex"))return ae.serialize([r],{expandMacro:u==="latex-expanded",skipStyles:u==="latex-unstyled",skipPlaceholders:u==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(u==="math-ml")return Pa(r);if(u==="spoken")return ii(r);if(u==="spoken-text"){const f=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const g=ii(r);return window.MathfieldElement.textToSpeechMarkup=f,g}if(u==="spoken-ssml"||u==="spoken-ssml-with-highlighting"){const f=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const g=ii(r);return window.MathfieldElement.textToSpeechMarkup=f,g}return u==="ascii-math"?Tu(r):(console.error(`MathLive 0.98.5: Unexpected format "${u}`),"")}getValue(r,o,u){if(r===void 0)return this.atomToString(this.root,"latex");if(typeof r=="string"&&r!=="math-json")return this.atomToString(this.root,r);let f,g;if(ku(r)&&ku(o)?(f=[this.normalizeRange([r,o])],g=u):ah(r)?(f=[this.normalizeRange(r)],g=o):Lc(r)?(f=r.ranges,g=o):(f=[this.normalizeRange([0,-1])],g=r),g!=null||(g="latex"),g==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
|
|
|
Load the library, for example with:
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const b=this.getValue({ranges:f},"latex-unstyled");try{const M=window.MathfieldElement.computeEngine.parse(b);return JSON.stringify(M.json)}catch(M){return JSON.stringify(["Error",`'${M.toString()}'`])}}if(g.startsWith("latex")){const b={expandMacro:g==="latex-expanded",skipStyles:g==="latex-unstyled",skipPlaceholders:g==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return Mn(f.map(M=>ae.serialize(this.getAtoms(M),b)))}return f.map(b=>this.getAtoms(b).map(M=>this.atomToString(M,g)).join("")).join("")}extendSelectionTo(r,o){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const u=this.normalizeRange([r,o]);let[f,g]=u,{parent:b}=this.at(g);if(b&&(b.type==="genfrac"||b.type==="subsup"))for(;b!==this.root&&um(this,b,[f,g]);)g=this.offsetOf(b),b=b.parent;for(b=this.at(f).parent;b!==this.root&&um(this,b,[f,g]);)f=this.offsetOf(b.leftSibling),b=b.parent;if(b=this.at(g).parent,(b==null?void 0:b.type)==="genfrac")for(;b!==this.root&&um(this,b,[f,g]);)g=this.offsetOf(b),console.assert(g>=0),b=b.parent;this._position=this.normalizeOffset(o),this._selection={ranges:[[f,g]],direction:"none"}})}announce(r,o,u=[]){var f,g;((g=(f=this.mathfield.host)==null?void 0:f.dispatchEvent(new CustomEvent("announce",{detail:{command:r,previousPosition:o,atoms:u},cancelable:!0,bubbles:!0,composed:!0})))!=null?g:!0)&&A1(this.mathfield,r,o,u)}deferNotifications(r,o){const u=this._selection,f=this._anchor,g=this._position,b=this.silenceNotifications;this.silenceNotifications=!0;const M=this.root.changeCounter;o();const N=this.root.changeCounter!==M,I=f!==this._anchor||g!==this._position||Du(this._selection,u)==="different";return this.silenceNotifications=b,r.content&&N&&this.contentDidChange({inputType:r.type}),r.selection&&I&&this.selectionDidChange(),N||I}normalizeOffset(r){return r>0?r=Math.min(r,this.lastOffset):r<0&&(r=this.lastOffset+r+1),r}normalizeRange(r){let[o,u]=r;return o=this.normalizeOffset(o),u=this.normalizeOffset(u),o<u?[o,u]:[u,o]}normalizeSelection(r,o){var u;let f;if(ku(r)){const g=this.normalizeOffset(r);if(ku(o)){const b=this.normalizeOffset(o);f=g<=b?{ranges:[[g,b]],direction:"none"}:{ranges:[[b,g]],direction:"backward"}}else f={ranges:[[g,g]],direction:"none"}}else if(ah(r)){const g=this.normalizeOffset(r[0]),b=this.normalizeOffset(r[1]);f=g<=b?{ranges:[[g,b]],direction:"none"}:{ranges:[[b,g]],direction:"backward"}}else Lc(r)&&(f={ranges:r.ranges.map(g=>this.normalizeRange(g)),direction:(u=r.direction)!=null?u:"none"});return console.assert(f!==void 0),f}get parentEnvironment(){let r=this.at(this.position).parent;if(r){for(;r.parent&&r.type!=="array";)r=r.parent;if(r.type==="array")return r}}get cell(){var r;let o=this.at(this.position);if(o){for(;o&&((r=o.parent)==null?void 0:r.type)!=="array";)o=o.parent;if(!(!(o!=null&&o.parent)||o.parent.type!=="array"))return o.parentBranch}}contentWillChange(r={}){if(this.silenceNotifications||!this.mathfield)return!0;const o=this.silenceNotifications;this.silenceNotifications=!0;const u=this.mathfield.onContentWillChange(r);return this.silenceNotifications=o,u}contentDidChange(r){var o;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Fh(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const u=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",F(ot({},r),{data:r.data?r.data:(o=r.inputType)!=null?o:"",bubbles:!0,composed:!0}))),this.silenceNotifications=u}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Fh(this.mathfield)),this.silenceNotifications))return;const r=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=r}};function rg(r,o,u,f){const g=r.offsetOf(o);if(g<u||g>f)return!1;if(!o.hasChildren)return!0;const b=r.offsetOf(o.firstChild);if(b>=u&&b<=f){const M=r.offsetOf(o.lastChild);if(M>=u&&M<=f)return!0}return!1}function um(r,o,u){if(!(o!=null&&o.hasChildren))return!1;const[f,g]=u,b=r.offsetOf(o.firstChild),M=r.offsetOf(o.lastChild);return b>=f&&b<=g&&M>=b&&M<=g}function og(r,o,u,f){var g,b,M,N,I,B;const U=u.parent;if(U&&u instanceof wa){const lt=!f&&o==="forward"||f==="body"&&o==="backward";let Lt=lt?r.offsetOf(u.firstChild):r.offsetOf(u.lastChild);return lt?u.rightDelim!=="?"&&u.rightDelim!=="."?(u.leftDelim=".",u.isDirty=!0):(U.addChildrenAfter(u.removeBranch("body"),u),U.removeChild(u),Lt--):u.leftDelim!=="?"&&u.leftDelim!=="."?(u.rightDelim=".",u.isDirty=!0):(U.addChildrenAfter(u.removeBranch("body"),u),U.removeChild(u),Lt--),r.position=Lt,!0}if(U&&u.type==="surd"){if(o==="forward"&&!f||o==="backward"&&f==="body"){const lt=u.leftSibling;u.hasChildren&&U.addChildrenAfter(u.removeBranch("body"),u),U.removeChild(u),r.position=r.offsetOf(lt)}else o==="forward"&&f==="body"?r.position=r.offsetOf(u):!f&&o==="backward"?u.hasChildren?r.position=r.offsetOf(u.lastChild):(r.position=Math.max(0,r.offsetOf(u)-1),U.removeChild(u)):f==="above"&&(u.hasEmptyBranch("above")&&u.removeBranch("above"),o==="backward"?r.position=r.offsetOf(u.leftSibling):r.position=r.offsetOf(u.body[0]));return!0}if(U&&(u.type==="box"||u.type==="enclose")){const lt=f&&o==="backward"||!f&&o==="forward"?u.leftSibling:u.lastChild;return U.addChildrenAfter(u.removeBranch("body"),u),U.removeChild(u),r.position=r.offsetOf(lt),!0}if(u.type==="genfrac"||u.type==="overunder"){if(!f)return u.type==="overunder"&&u.hasEmptyBranch("body")||u.type==="genfrac"&&u.hasEmptyBranch("below")&&u.hasEmptyBranch("above")?!1:(r.position=r.offsetOf(o==="forward"?u.firstChild:u.lastChild),!0);const lt=Pp.fractionNavigationOrder==="numerator-denominator"?"above":"below",Lt=lt==="above"?"below":"above";if(U&&(o==="forward"&&f===lt||o==="backward"&&f===Lt)){const Bt=u.removeBranch(lt),jt=u.removeBranch(Lt);return U.addChildrenAfter([...Bt,...jt],u),U.removeChild(u),r.position=r.offsetOf(Bt.length>0?Bt[Bt.length-1]:jt[0]),!0}return o==="backward"?r.position=r.offsetOf(u.leftSibling):r.position=r.offsetOf(u),!0}if(u.isExtensibleSymbol||u.type==="subsup"){if(!f&&o==="forward")return!1;if(!f){if(u.subscript||u.superscript){const lt=o==="forward"?(M=(g=u.superscript)==null?void 0:g[0])!=null?M:(b=u.subscript)==null?void 0:b[0]:(B=(N=u.subscript)==null?void 0:N[0].lastSibling)!=null?B:(I=u.superscript)==null?void 0:I[0].lastSibling;return lt&&(r.position=r.offsetOf(lt)),!0}return!1}if(!u.hasChildren&&u.type==="subsup"){const lt=o==="forward"?r.offsetOf(u):Math.max(0,r.offsetOf(u)-1);return u.parent.removeChild(u),r.position=lt,!0}if(f==="superscript")if(o==="backward"){const lt=r.offsetOf(u.firstChild)-1;console.assert(lt>=0),r.position=lt}else u.subscript?r.position=r.offsetOf(u.subscript[0]):r.position=r.offsetOf(u);else f==="subscript"&&(o==="backward"&&u.superscript?r.position=r.offsetOf(u.superscript[0].lastSibling):o==="backward"?r.position=r.offsetOf(u.firstChild)-1:r.position=r.offsetOf(u));if(f&&u.hasEmptyBranch(f)&&(u.removeBranch(f),u.type==="subsup"&&!u.subscript&&!u.superscript)){const lt=o==="forward"?r.offsetOf(u):Math.max(0,r.offsetOf(u)-1);u.parent.removeChild(u),r.position=lt}return!0}if((U==null?void 0:U.type)==="genfrac"&&!f&&u.type!=="first"){let lt=r.offsetOf(u.leftSibling);return U.removeChild(u),U.hasEmptyBranch("above")&&U.hasEmptyBranch("below")?(lt=r.offsetOf(U.leftSibling),U.parent.removeChild(U),r.announce("delete",void 0,[U]),r.position=lt,!0):(r.announce("delete",void 0,[u]),r.position=lt,!0)}if(o==="backward"&&((U==null?void 0:U.command)==="\\ln"||(U==null?void 0:U.command)==="\\log")&&u.parentBranch!=="body"){const lt=r.offsetOf(U.leftSibling);return U.parent.removeChild(U),r.announce("delete",void 0,[U]),r.position=lt,!0}return!1}function Vc(r){return!r.mathfield.isSelectionEditable||!r.contentWillChange({inputType:"deleteContentBackward"})?!1:r.selectionIsCollapsed?r.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let o=r.at(r.position);if(!(o&&og(r,"backward",o))){if(o!=null&&o.isFirstSibling){if(og(r,"backward",o.parent,o.parentBranch))return;o=null}if(!o){r.announce("plonk");return}r.position=r.offsetOf(o.leftSibling),o.parent.removeChild(o),r.announce("delete",void 0,[o])}}):$h(r,Ds(r.selection),"deleteContentBackward")}function Ud(r){return!r.mathfield.isSelectionEditable||!r.contentWillChange({inputType:"deleteContentForward"})?!1:r.selectionIsCollapsed?r.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var o,u;let f=r.at(r.position).rightSibling;if(f&&og(r,"forward",f))return;if(f){if(r.at(r.position).isLastSibling&&og(r,"forward",f.parent,f.parentBranch))return}else{if(f=r.at(r.position),f.isLastSibling&&og(r,"forward",f.parent,f.parentBranch))return;f=void 0}if(r.position===r.lastOffset||!f){r.announce("plonk");return}f.parent.removeChild(f);let g=(o=r.at(r.position))==null?void 0:o.rightSibling;for(;(g==null?void 0:g.type)==="subsup";)g.parent.removeChild(g),g=(u=r.at(r.position))==null?void 0:u.rightSibling;r.announce("delete",void 0,[f])}):$h(r,Ds(r.selection),"deleteContentForward")}function $h(r,o,u){const f=r.getAtoms(o);if(f.length>0&&f[0].parent){let g=f[0].parent.firstChild;g.type==="first"&&(g=g.rightSibling);const b=f[f.length-1].parent.lastChild;let M=f[0];M.type==="first"&&(M=M.rightSibling);const N=f[f.length-1];if(M===g&&N===b){const I=f[0].parent;I.parent&&I.type!=="prompt"&&(o=[r.offsetOf(I.leftSibling),r.offsetOf(I)])}if(f.length===1&&f[0].type==="placeholder"&&f[0].parent.type==="genfrac"){const I=f[0].parent,B=f[0].parentBranch==="below"?"above":"below",U=r.offsetOf(I.leftSibling);return r.deferNotifications({content:!0,selection:!0,type:u},()=>{var lt,Lt;const Bt=I.removeBranch(B);if(Bt.length===1&&Bt[0].type==="placeholder")(Lt=I.parent)==null||Lt.removeChild(I),r.position=Math.max(0,U);else{const jt=I.parent.addChildrenAfter(Bt,I);(lt=I.parent)==null||lt.removeChild(I),r.position=r.offsetOf(jt)}})}}return r.deferNotifications({content:!0,selection:!0,type:u},()=>r.deleteAtoms(o))}vu({deleteAll:r=>r.contentWillChange({inputType:"deleteContent"})&&$h(r,[0,-1],"deleteContent"),deleteForward:r=>Ud(r),deleteBackward:r=>Vc(r),deleteNextWord:r=>r.contentWillChange({inputType:"deleteWordForward"})&&$h(r,[r.anchor,pr(r,r.position,"forward")],"deleteWordForward"),deletePreviousWord:r=>r.contentWillChange({inputType:"deleteWordBackward"})&&$h(r,[r.anchor,pr(r,r.position,"backward")],"deleteWordBackward"),deleteToGroupStart:r=>r.contentWillChange({inputType:"deleteSoftLineBackward"})&&$h(r,[r.anchor,r.offsetOf(r.at(r.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:r=>r.contentWillChange({inputType:"deleteSoftLineForward"})&&$h(r,[r.anchor,r.offsetOf(r.at(r.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:r=>r.contentWillChange({inputType:"deleteHardLineBackward"})&&$h(r,[r.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:r=>r.contentWillChange({inputType:"deleteHardLineForward"})&&$h(r,[r.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var Wc=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${Wt("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,rh=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${Wt("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,Zd=class{constructor(r,o){this.focusBlurInProgress=!1;var u,f,g;this.options=ot(F(ot({},Z0()),{macros:Go(),registers:Pr()}),i0(o)),this.eventController=new AbortController;const b=this.eventController.signal;o.eventSink&&(this.host=o.eventSink),this.element=r,r.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let M=(f=(u=o.value)!=null?u:this.element.textContent)!=null?f:"";M=M.trim();const N=bi(this.options),I=new ae({type:"root",mode:N,body:au(M,{context:this.context})});this.model=new Ay(this,N,I),this.undoManager=new d1(this.model);const B=[];if(B.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),B.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),B.push("<span part=content class=ML__content>"),B.push(Jv(this)),B.push("</span>"),window.mathVirtualKeyboard&&(B.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),B.push(Wc),B.push("</div>")),B.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),B.push(rh),B.push("</div>"),B.push("</span>"),B.push("<span class=ML__sr-only>"),B.push("<span role=status aria-live=assertive aria-atomic=true></span>"),B.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(B.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=Vt.subscribe(()=>Vt.update(this.element)),Vt.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",lt=>lt.stopImmediatePropagation(),{capture:!1,signal:b}),this.field.addEventListener("wheel",this,{passive:!1,signal:b}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:b}):this.field.addEventListener("mousedown",this,{signal:b}),(g=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||g.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Fh(this)))},{signal:b}),this._menu=new gx(_1(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:b});const U=this.element.querySelector("[part=menu-toggle]");U==null||U.addEventListener("pointerdown",lt=>{if(lt.currentTarget!==U||this._menu.state!=="closed")return;this.element.classList.add("tracking");const Lt=U.getBoundingClientRect();this._menu.modifiers=pd(lt),this._menu.show({target:U,location:{x:Lt.left,y:Lt.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),lt.preventDefault(),lt.stopPropagation()},{signal:b}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(U.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=cx(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:b}),document.addEventListener("scroll",this,{signal:b}),this.resizeObserver=new ResizeObserver(()=>ql(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:b}),hp&&!Vt.locale.startsWith(hp.locale)&&qy(Vt.locale),Ch!=="ready"&&document.fonts.ready.then(()=>zc(this)),r.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(r){this._defaultStyle=r}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const r=this.model.at(this.model.position),o=this.adoptStyle==="right"?r.rightSibling:r;if(!o)return this.defaultStyle;if(o.type==="group"){const u=o.branch("body");return!u||u.length<2?{}:this.adoptStyle==="right"?u[1].computedStyle:u[u.length-1].computedStyle}return o.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Fh(this)),Kc(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,sf())}showMenu(r){var o,u;const f=(u=(o=r==null?void 0:r.location)!=null?o:Iu(this.field))!=null?u:void 0,g=r==null?void 0:r.modifiers,b=this.element.querySelector("[part=container]");return this._menu.show({target:b,location:f,modifiers:g})}get colorMap(){return r=>{var o,u,f;return(f=(u=(o=this.options).colorMap)==null?void 0:u.call(o,r))!=null?f:fi(r)}}get backgroundColorMap(){return r=>{var o,u,f,g,b,M;return(M=(b=(u=(o=this.options).backgroundColorMap)==null?void 0:u.call(o,r))!=null?b:(g=(f=this.options).colorMap)==null?void 0:g.call(f,r))!=null?M:Ht(r)}}get smartFence(){var r;return(r=this.options.smartFence)!=null?r:!1}get readOnly(){var r;return(r=this.options.readOnly)!=null?r:!1}get disabled(){var r,o;return(o=(r=this.host)==null?void 0:r.disabled)!=null?o:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const r=getComputedStyle(this.host);return r.getPropertyValue("user-select")||r.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(r=>r.type==="prompt"&&!r.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const r=this.model.at(this.model.anchor),o=this.model.at(this.model.position),u=ae.commonAncestor(r,o);return!!((u==null?void 0:u.type)==="prompt"||u!=null&&u.parentPrompt)}get letterShapeStyle(){var r;return(r=this.options.letterShapeStyle)!=null?r:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const r=this.model.getAtoms(this.model.selection);if(r.length===0)return{};const o=ot({},r[0].style);for(const u of r)for(const[f,g]of Object.entries(u.style))o[f]!==g&&delete o[f];return o}queryStyle(r){const o=Zm(this,r);"verbatimColor"in o&&delete o.verbatimColor,"verbatimBackgroundColor"in o&&delete o.verbatimBackgroundColor;const u=Object.keys(o).length;if(u===0)return"all";if(u>1){for(const I of Object.keys(o)){const B=this.queryStyle({[I]:o[I]});if(B==="none")return"none";if(B==="some")return"some"}return"all"}const f=Object.keys(o)[0],g=o[f];if(this.model.selectionIsCollapsed)return this.effectiveStyle[f]===g?"all":"none";const b=this.model.getAtoms(this.model.selection,{includeChildren:!0});let M=b.length;if(M===0)return"none";let N=0;for(const I of b){if(I.type==="first"){M-=1;continue}I.style[f]===g&&(N+=1)}return N===0?"none":N===M?"all":"some"}get keybindings(){var r,o;if(this._keybindings)return this._keybindings;const[u,f]=e1(this.options.keybindings,(r=Rd())!=null?r:ce());return((o=Rd())==null?void 0:o.score)>0&&(this._keybindings=u,f.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",f)),u}get menu(){return this._menu}setOptions(r){var o;this.options=ot(ot({},this.options),i0(r)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let u=this.options.defaultMode;u==="inline-math"&&(u="math"),((o=this.model.root.firstChild)==null?void 0:o.mode)!==u&&(this.model.root.firstChild.mode=u),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const f=ae.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in r||this.model.getValue()!==f)&&ur.insert(this.model,f,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in r||"macros"in r||"registers"in r||"colorMap"in r||"backgroundColorMap"in r||"letterShapeStyle"in r||"minFontScale"in r||"readOnly"in r||"placeholderSymbol"in r)&&ql(this)}getOptions(r){return Pl(this.options,r)}getOption(r){return Pl(this.options,r)}handleEvent(r){return wm(this,null,function*(){var o;if(xa(this)){if(jg(r)){if(!Xl(r.origin,(o=this.options.originValidator)!=null?o:"none"))throw new DOMException(`Message from unknown origin (${r.origin}) cannot be handled`,"SecurityError");const{action:u}=r.data;if(u==="execute-command"){const f=r.data.command;if(gd(f)==="virtual-keyboard")return;this.executeCommand(f)}else u==="update-state"||(u==="focus"?this.focus({preventScroll:!0}):u==="blur"&&this.blur());return}switch(r.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&Kd(this,r);break;case"pointerdown":this.userSelect!=="none"&&(Kd(this,r),r.shiftKey===!1&&(yield kh(r,this.element.querySelector("[part=container]"),this._menu))&&tv.stop());break;case"contextmenu":this.userSelect!=="none"&&r.shiftKey===!1&&(yield kh(r,this.element.querySelector("[part=container]"),this._menu))&&tv.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Kc(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>xa(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>xa(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(r);break;default:console.warn("Unexpected event type",r.type)}}})}dispose(){if(!xa(this))return;Vt.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const r=this.element;delete r.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,ge(),uc(),b1()}flushInlineShortcutBuffer(r){if(r!=null||(r={defer:!1}),!r.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(r){return gd(r)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(r),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Fh(this))),!1):Qv(this,r)}get errors(){return Dd(this.model.getValue(),{context:this.context})}getValue(r,o,u){return this.model.getValue(r,o,u)}setValue(r,o){var u;o=o!=null?o:{mode:"math"},o.insertionMode===void 0&&(o.insertionMode="replaceAll"),(o.format===void 0||o.format==="auto")&&(o.format="latex"),(o.mode===void 0||o.mode==="auto")&&(o.mode=(u=Vh(this.model,this.model.position))!=null?u:"math");const f=this.undoManager.canUndo();ur.insert(this.model,r,o)&&(ql(this),f||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const r=window.MathfieldElement.computeEngine;return r?r.box(r.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var r;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const f=window.mathVirtualKeyboard.boundingRect,g=this.host.getBoundingClientRect();g.bottom>f.top&&((r=window.document.scrollingElement)==null||r.scrollBy(0,g.bottom-f.top+8))}}this.dirty&&pp(this,{interactive:!0});const o=this.field.getBoundingClientRect();let u=null;if(this.model.selectionIsCollapsed)u=Iu(this.field);else{const f=Ou(this);if(f.length>0){let g=-1/0,b=-1/0;for(const M of f)M.right>g&&(g=M.right),M.top<b&&(b=M.top);u={x:g+o.left-this.field.scrollLeft,y:b+o.top-this.field.scrollTop,height:0}}}if(this.host&&u){const f=this.host.getBoundingClientRect(),g=u.y;let b=this.host.scrollTop;g<f.top?b=g-f.top+this.host.scrollTop:g>f.bottom&&(b=g-f.bottom+this.host.scrollTop+u.height),this.host.scroll({top:b,left:0})}if(u){const f=u.x-window.scrollX;let g=this.field.scrollLeft;f<o.left?g=f-o.left+this.field.scrollLeft-20:f>o.right&&(g=f-o.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:g})}}insert(r,o){return typeof r!="string"||r.length===0&&((o==null?void 0:o.insertionMode)==="insertBefore"||(o==null?void 0:o.insertionMode)==="insertAfter")||r.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),o=o!=null?o:{mode:"math"},o.focus&&this.focus(),o.feedback&&(window.MathfieldElement.keypressVibration&&zt()&&navigator.vibrate(zg),window.MathfieldElement.playSound("keypress")),r==="\\\\"?vd(this.model):r==="&"?Gg(this.model):this.model.selectionIsCollapsed?ur.insert(this.model,r,ot({style:this.model.at(this.model.position).computedStyle},o)):ur.insert(this.model,r,o),this.snapshot(`insert-${this.model.at(this.model.position).type}`),ql(this),o.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(r,o="",u=""){var f;if(this.model.mode===r||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const g=this.model.mode;if(this.model.mode=r,!((f=this.host)!=null&&f.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=g;return}const b=this.model.mode,{model:M}=this;M.deferNotifications({content:!!u||!!o,selection:!0,type:"insertText"},()=>{let N=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),o&&r!=="latex"){const I=au(o,{context:this.context,parseMode:r});M.collapseSelection("forward");const B=M.at(M.position);M.position=M.offsetOf(B.parent.addChildrenAfter(I,B)),N=!0}if(this.model.mode=r,r==="latex"){let I=M.selectionIsCollapsed;fp(this,"accept");let B,U=M.at(M.position);if(I)B="\\";else{const Lt=Ds(M.selection);B=this.model.getValue(Lt,"latex");const Bt=this.model.extractAtoms(Lt);Bt.length===1&&Bt[0].type==="placeholder"&&(B=o,I=!0),U=M.at(Lt[0])}const lt=new T0(B);U.parent.addChildAfter(lt,U),I?M.position=M.offsetOf(lt.lastChild):M.setSelection(M.offsetOf(lt.firstChild),M.offsetOf(lt.lastChild))}else Sh(M).forEach(I=>{I.isError=!1});if(u){const I=au(u,{context:this.context,parseMode:b});M.collapseSelection("forward");const B=M.at(M.position);M.position=M.offsetOf(B.parent.addChildrenAfter(I,B)),N=!0}return ql(this),this.undoManager.snapshot(r==="latex"?"insert-latex":"insert"),N}),this.model.mode=r,window.mathVirtualKeyboard.update(Fh(this))}hasFocus(){return!this.blurred}focus(r){var o;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(o=r==null?void 0:r.preventScroll)!=null&&o||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(r,o={}){var u,f;const g={operation:"set",silenceNotifications:!1};ah(o)?g.range=o:(o.operation==="toggle"&&(g.operation="toggle"),g.range=o.range,g.silenceNotifications=(u=o.silenceNotifications)!=null?u:!1);const b=Zm(this,r),M=(f=g.operation)!=null?f:"set";if(g.range===void 0&&this.model.selectionIsCollapsed){if(M==="set"){this.defaultStyle=ot(ot({},this.defaultStyle),b);return}const N=ot({},this.defaultStyle);for(const I of Object.keys(b))N[I]===b[I]?(I==="color"&&delete N.verbatimColor,I==="backgroundColor"&&delete N.verbatimBackgroundColor,delete N[I]):N[I]=b[I];this.defaultStyle=N;return}this.model.deferNotifications({content:!g.silenceNotifications,type:"insertText"},()=>{if(g.range===void 0)for(const N of this.model.selection.ranges)Fm(this.model,N,b,{operation:M});else Fm(this.model,g.range,b,{operation:M})}),ql(this)}toggleContextMenu(){var r;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(r=this.getCaretPoint())!=null?r:void 0,onDismiss:()=>{var o;return(o=this.element)==null?void 0:o.focus()}}),!0):!1}getCaretPoint(){const r=Iu(this.field);return r?{x:r.x,y:r.y}:null}setCaretPoint(r,o){const u=Hd(this,r,o,{bias:0});if(u<0)return!1;const f=this.model.position;return this.model.position=u,this.model.announce("move",f),ql(this),!0}getPrompt(r){const o=this.model.findAtom(u=>u.type==="prompt"&&u.placeholderId===r);return console.assert(o!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),o}getPromptValue(r,o){const u=this.getPrompt(r);if(!u)return"";const f=this.model.offsetOf(u.firstChild),g=this.model.offsetOf(u.lastChild);return this.model.getValue(f,g,o)}getPrompts(r){return this.model.getAllAtoms().filter(o=>o.type!=="prompt"?!1:r?!(r.id&&o.placeholderId!==r.id||r.locked&&o.locked!==r.locked||r.correctness==="undefined"&&o.correctness||r.correctness&&o.correctness!==r.correctness):!0).map(o=>o.placeholderId)}setPromptValue(r,o,u){if(o!==void 0){const f=this.getPrompt(r);if(!f){console.error(`MathLive 0.98.5: unknown prompt ${r}`);return}const g=this.model.getBranchRange(this.model.offsetOf(f),"body");this.model.setSelection(g),this.insert(o,F(ot({},u),{insertionMode:"replaceSelection"}))}u!=null&&u.silenceNotifications&&(this.valueOnFocus=this.getValue()),ql(this)}setPromptState(r,o,u){const f=this.getPrompt(r);if(!f){console.error(`MathLive 0.98.5: unknown prompt ${r}`);return}o==="undefined"?f.correctness=void 0:typeof o=="string"&&(f.correctness=o),typeof u=="boolean"&&(f.locked=u,f.captureSelection=u),ql(this)}getPromptState(r){const o=this.getPrompt(r);return o?[o.correctness,o.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${r}`),[void 0,!0])}getPromptRange(r){const o=this.getPrompt(r);return o?this.model.getBranchRange(this.model.offsetOf(o),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${r}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(r){var o;this.undoManager.snapshot(r)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Fh(this)),(o=this.host)==null||o.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var r;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Fh(this)),(r=this.host)==null||r.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var r;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Fh(this)),(r=this.host)==null||r.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var r;(r=this.undoManager)==null||r.reset()}onSelectionDidChange(){var r,o;const u=this.model;this.keyboardDelegate.setValue(u.getValue(this.model.selection,"latex-expanded"));{const f=u.at(u.position),g=(r=f.mode)!=null?r:bi(this.options);this.model.mode!==g&&(this.model.mode==="latex"?(fp(this,"accept",{mode:g}),u.position=u.offsetOf(f)):this.switchMode(g))}(o=this.host)==null||o.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Fh(this)),Kc(this)}onContentWillChange(r){var o,u,f;return(f=(u=this.host)==null?void 0:u.dispatchEvent(new InputEvent("beforeinput",F(ot({},r),{data:r.data?r.data:(o=r.inputType)!=null?o:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?f:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),pp(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var r,o,u;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",Mh(this),this.model.getValue()!==this.valueOnFocus&&((r=this.host)==null||r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(o=this.host)==null||o.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(u=this.host)==null||u.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),ql(this),this.focusBlurInProgress=!1,sf();const f=new AbortController,g=f.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{xa(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:g})},{once:!0,signal:g}),setTimeout(()=>f.abort(),100)}onInput(r){qg(this,r)}onKeystroke(r){return r0(this,r)}onCompositionStart(r){this.model.deleteAtoms(Ds(this.model.selection));const o=Iu(this.field);o&&requestAnimationFrame(()=>{pp(this),this.keyboardDelegate.moveTo(o.x,o.y-o.height)})}onCompositionUpdate(r){px(this.model,r),ql(this)}onCompositionEnd(r){Zg(this.model),qg(this,r,{simulateKeystroke:!0})}onCut(r){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),ur.onCopy(this,r),$h(this.model,Ds(this.model.selection),"deleteByCut"),this.snapshot("cut"),ql(this))}onCopy(r){ur.onCopy(this,r)}onPaste(r){let o=this.isSelectionEditable;return o&&(o=ur.onPaste(this.model.at(this.model.position).mode,this,r.clipboardData)),o||this.model.announce("plonk"),r.preventDefault(),r.stopPropagation(),o}onGeometryChange(){this._menu.hide(),_m(this),Kc(this)}onWheel(r){const o=5*r.deltaX;if(!Number.isFinite(o)||o===0)return;const u=this.field;o<0&&u.scrollLeft===0||o>0&&u.offsetWidth+u.scrollLeft>=u.scrollWidth||(u.scrollBy({top:0,left:o}),r.preventDefault(),r.stopPropagation())}getHTMLElement(r){let o=r;for(;!o.id&&o.hasChildren;)o=r.children[0];return this.field.querySelector(`[data-atom-id="${o.id}"]`)}get context(){var r,o;return{registers:(r=this.options.registers)!=null?r:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(o=this.options.placeholderSymbol)!=null?o:"\u25A2",colorMap:u=>this.colorMap(u),backgroundColorMap:u=>this.backgroundColorMap(u),getMacro:u=>Ro(u,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function Gd(r){if(r&&(r.classList.remove("ML__highlight"),r.children))for(const o of r.children)Gd(o)}function _p(r,o){var u;r&&(!o||((u=r.dataset)==null?void 0:u.atomId)===o?(r.classList.add("ML__highlight"),r.children&&r.children.length>0&&[...r.children].forEach(f=>{f instanceof HTMLElement&&_p(f)})):(r.classList.remove("ML__highlight"),r.children&&r.children.length>0&&[...r.children].forEach(f=>{f instanceof HTMLElement&&_p(f,o)})))}function wv(r,o){var u;if(!le())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(o);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const f=new window.AWS.Polly({apiVersion:"2016-06-10"}),g={OutputFormat:"json",VoiceId:(u=window.MathfieldElement.speechEngineVoice)!=null?u:"Joanna",Engine:"standard",Text:o,TextType:"ssml",SpeechMarkTypes:["ssml"]};ld().readAloudElement=r,f.synthesizeSpeech(g,(b,M)=>{if(b){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${b}`);return}if(!(M!=null&&M.AudioStream)){console.log("polly.synthesizeSpeech():",M);return}const N=new TextDecoder("utf-8").decode(new Uint8Array(M.AudioStream));ld().readAloudMarks=N.split(`
|
|
|
`).map(I=>I?JSON.parse(I):{}),ld().readAloudTokens=[];for(const I of ld().readAloudMarks)I.value&&ld().readAloudTokens.push(I.value);ld().readAloudCurrentMark="",g.OutputFormat="mp3",g.SpeechMarkTypes=[],f.synthesizeSpeech(g,(I,B)=>{if(I){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${o}") error:${I}`);return}if(!(B!=null&&B.AudioStream))return;const U=new Uint8Array(B.AudioStream),lt=new Blob([U.buffer],{type:"audio/mpeg"}),Lt=URL.createObjectURL(lt),Bt=ld();Bt.readAloudAudio?Bt.readAloudAudio.pause():(Bt.readAloudAudio=new Audio,Bt.readAloudAudio.addEventListener("ended",()=>{const jt=Bt.readAloudMathfield;Bt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),jt?(pp(jt),Bt.readAloudElement=null,Bt.readAloudMathfield=null,Bt.readAloudTokens=[],Bt.readAloudMarks=[],Bt.readAloudCurrentMark=""):Gd(Bt.readAloudElement)}),Bt.readAloudAudio.addEventListener("timeupdate",()=>{let jt="";const je=Bt.readAloudAudio.currentTime*1e3+100;for(const Zi of Bt.readAloudMarks)Zi.time<je&&(jt=Zi.value);Bt.readAloudCurrentMark!==jt&&(Bt.readAloudCurrentToken=jt,jt&&jt===Bt.readAloudFinalToken?Bt.readAloudAudio.pause():(Bt.readAloudCurrentMark=jt,_p(Bt.readAloudElement,Bt.readAloudCurrentMark)))})),Bt.readAloudAudio.src=Lt,Bt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),Bt.readAloudAudio.play()})})}le()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var ca=new WeakMap,bv=.5,sd={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},zu=class bg extends HTMLElement{static get formAssociated(){return ad()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(o){o!==this._fontsDirectory&&(this._fontsDirectory=o,B0())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(o){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(o){this._soundsDirectory=o,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(o){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(o){var u,f,g;this.audioBuffers={},o===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof o=="string"?this._keypressSound={spacebar:o,return:o,delete:o,default:o}:typeof o=="object"&&"default"in o&&(this._keypressSound={spacebar:(u=o.spacebar)!=null?u:o.default,return:(f=o.return)!=null?f:o.default,delete:(g=o.delete)!=null?g:o.default,default:o.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(o){this.audioBuffers={},this._plonkSound=o}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(o){this._speechEngine=o}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(o){this._speechEngineRate=o}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(o){this._speechEngineVoice=o}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(o){this._textToSpeechMarkup=o}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(o){this._textToSpeechRules=o}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(o){this._textToSpeechRulesOptions=o}static get locale(){return Vt.locale}static set locale(o){o==="auto"&&(o=navigator.language.slice(0,5)),Vt.locale=o}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(o){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return Vt.strings}static set strings(o){Vt.merge(o)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(o){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(o){this._decimalSeparator=o,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(o){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var o,u;if(this._computeEngine===void 0){const f=(o=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:o.ComputeEngine;if(!f)return null;this._computeEngine=new f,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(u=this._computeEngine)!=null?u:null}static set computeEngine(o){this._computeEngine=o}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(o){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(o){this._isFunction=o}static loadSound(o){return wm(this,null,function*(){delete this.audioBuffers[o];let u="";switch(o){case"keypress":u=this._keypressSound.default;break;case"return":u=this._keypressSound.return;break;case"spacebar":u=this._keypressSound.spacebar;break;case"delete":u=this._keypressSound.delete;break;case"plonk":u=this.plonkSound;break}if(typeof u!="string")return;u=u.trim();const f=this.soundsDirectory;if(!(f==null||f==="null"||u==="none"||u==="null"))try{const b=yield(yield fetch(yield Nm(`${f}/${u}`))).arrayBuffer(),M=yield this.audioContext.decodeAudioData(b);this.audioBuffers[o]=M}catch(g){}})}static playSound(o){return wm(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[o]||(yield this.loadSound(o)),!this.audioBuffers[o])return;const u=this.audioContext.createBufferSource();u.buffer=this.audioBuffers[o];const f=this.audioContext.createGain();f.gain.value=bv,u.connect(f).connect(this.audioContext.destination),u.start()})}constructor(o){if(super(),o){const u=[];for(const f of Object.keys(o))if(sd[f])if(sd[f].startsWith("mf."))if(sd[f].startsWith(`mf.${f}`))u.push(`Option \`${f}\` cannot be used as a constructor option. Use ${sd[f]}`);else{const g=sd[f].match(/([a-zA-Z]+) =/);u.push(`Option \`${f}\` has been renamed \`${g[1]}\``)}else u.push(`Option \`${f}\` cannot be used as a constructor option. Use ${sd[f]}`);if(u.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const f of u)console.warn(f);console.groupEnd()}}if(ad()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[Ju("core"),Ju("mathfield"),Ju("mathfield-element"),Ju("ui"),Ju("menu")],this.shadowRoot.appendChild(document.createElement("span"));const u=document.createElement("slot");u.style.display="none",this.shadowRoot.appendChild(u)}else this.shadowRoot.innerHTML="<style>"+Zh("core")+Zh("mathfield")+Zh("mathfield-element")+Zh("ui")+Zh("menu")+'</style><span></span><slot style="display:none"></slot>';o&&this._setOptions(o),this.shadowRoot.addEventListener("slotchange",()=>{var u;const f=this.shadowRoot.querySelector("slot:not([name])");this.value=(u=f==null?void 0:f.assignedNodes().map(g=>g.nodeType===3?g.textContent:"").join("").trim())!=null?u:""})}showMenu(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.showMenu(o))!=null?f:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",o=>{var u;o.target===this&&!((u=this._mathfield)!=null&&u.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:o.altKey,button:o.button,buttons:o.buttons,clientX:o.clientX,clientY:o.clientY,ctrlKey:o.ctrlKey,metaKey:o.metaKey,movementX:o.movementX,movementY:o.movementY,relatedTarget:o.relatedTarget,screenX:o.screenX,screenY:o.screenY,shiftKey:o.shiftKey}))},{once:!0})}getPromptValue(o,u){var f,g;return(g=(f=this._mathfield)==null?void 0:f.getPromptValue(o,u))!=null?g:""}setPromptValue(o,u,f){var g;(g=this._mathfield)==null||g.setPromptValue(o,u,f)}getPromptRange(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.getPromptRange(o))!=null?f:null}getPrompts(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.getPrompts(o))!=null?f:[]}get form(){var o;return(o=this._internals)==null?void 0:o.form}get name(){var o;return(o=this.getAttribute("name"))!=null?o:""}get type(){return this.localName}get mode(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.model.mode)!=null?u:this.defaultMode==="text"?"text":"math"}set mode(o){var u;(u=this._mathfield)==null||u.switchMode(o)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(o){var u,f;if(!this._mathfield)return;const g=(f=(u=bg.computeEngine)==null?void 0:u.box(o).latex)!=null?f:null;g!==null&&this._mathfield.setValue(g),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
|
|
|
|
|
|
Load the library, for example with:
|
|
|
|
|
|
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.errors)!=null?u:[]}_getOptions(o){return this._mathfield?Pl(this._mathfield.options,o):ca.has(this)?ot({},Pl(ot(ot({},Z0()),i0(ca.get(this).options)),o)):null}getOptions(o){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?Pl(this._mathfield.options,o):ca.has(this)?Pl(ot(ot({},Z0()),i0(ca.get(this).options)),o):null}reflectAttributes(){const o=Z0(),u=this._getOptions();Object.keys(bg.optionsAttributes).forEach(f=>{const g=Uc(f);bg.optionsAttributes[f]==="on/off"?o[g]!==u[g]?this.setAttribute(f,u[g]?"on":"off"):this.removeAttribute(f):o[g]!==u[g]&&(bg.optionsAttributes[f]==="boolean"?u[g]?this.setAttribute(f,""):this.removeAttribute(f):(typeof u[g]=="string"||typeof u[g]=="number")&&this.setAttribute(f,u[g].toString()))})}getOption(o){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([o])[o]}_getOption(o){return this._getOptions([o])[o]}_setOptions(o){if(this._mathfield)this._mathfield.setOptions(o);else if(ca.has(this)){const u=ot(ot({},ca.get(this).options),o);ca.set(this,F(ot({},ca.get(this)),{selection:{ranges:u.readOnly?[[0,0]]:[[0,-1]]},options:u}))}else ca.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:o,menuItems:void 0});this.reflectAttributes()}setOptions(o){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const u of Object.keys(o))sd[u]&&console.warn(`\`mf.setOptions({${u}:...})\` -> ${sd[u]}`);console.groupEnd(),this._setOptions(o)}executeCommand(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.executeCommand(o))!=null?f:!1}getValue(o,u,f){var g,b;if(this._mathfield)return this._mathfield.model.getValue(o,u,f);if(ca.has(this)){let M,N,I;if(Lc(o)?([M,N]=o.ranges[0],I=u):ah(o)?([M,N]=o,I=u):ku(o)&&ku(u)?(M=o,N=u,I=f):(M=0,N=-1,I=o),(I===void 0||I==="latex")&&M===0&&N===-1)return(b=(g=ca.get(this).value)!=null?g:this.textContent)!=null?b:""}return""}setValue(o,u){if(this._mathfield&&o!==void 0){u!=null||(u={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(o,u);return}if(ca.has(this)){const g=ca.get(this).options;ca.set(this,{value:o,selection:{ranges:[[-1,-1]],direction:"forward"},options:g,menuItems:void 0});return}const f=Xd(this);ca.set(this,{value:o,selection:{ranges:[[-1,-1]],direction:"forward"},options:f,menuItems:void 0})}hasFocus(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.hasFocus())!=null?u:!1}focus(){var o;(o=this._mathfield)==null||o.focus()}blur(){var o;(o=this._mathfield)==null||o.blur()}select(){var o;(o=this._mathfield)==null||o.select()}insert(o,u){var f,g;return(g=(f=this._mathfield)==null?void 0:f.insert(o,u))!=null?g:!1}applyStyle(o,u){var f;return(f=this._mathfield)==null?void 0:f.applyStyle(o,u)}queryStyle(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.queryStyle(o))!=null?f:"none"}get caretPoint(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.getCaretPoint())!=null?u:null}set caretPoint(o){var u;o&&((u=this._mathfield)==null||u.setCaretPoint(o.x,o.y))}setCaretPoint(o,u){var f,g;return(g=(f=this._mathfield)==null?void 0:f.setCaretPoint(o,u))!=null?g:!1}offsetFromPoint(o,u,f){return this._mathfield?Hd(this._mathfield,o,u,f):-1}hitboxFromOffset(o){if(!this._mathfield)return null;const u=this._mathfield.model.at(o);if(!u)return null;const f=Gl(this._mathfield,u);return f?new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top):null}resetUndo(){var o;(o=this._mathfield)==null||o.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(o){var u,f,g,b;nd.state==="closed"&&((f=(u=this._mathfield)==null?void 0:u.menu)==null?void 0:f.state)==="closed"&&(o.type==="pointerdown"&&this.onPointerDown(),o.type==="focus"&&((g=this._mathfield)==null||g.focus()),o.type==="blur"&&((b=this._mathfield)==null||b.blur()))}connectedCallback(){var o,u,f,g;const b=window.getComputedStyle(this),M=this.shadowRoot,N=b.userSelect!=="none";if(N)M.host.addEventListener("pointerdown",this,!0);else{const U=M.querySelector("span");U.style.pointerEvents="none"}M.host.addEventListener("focus",this,!0),M.host.addEventListener("blur",this,!0),ad()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),N&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const I=M.querySelector("slot:not([name])");if(I)try{this._style=I.assignedElements().filter(U=>U.tagName.toLowerCase()==="style").map(U=>U.textContent).join("")}catch(U){console.error(U)}if(this._style){const U=document.createElement("style");U.textContent=this._style,M.appendChild(U)}let B="";if(this.hasAttribute("value")?B=this.getAttribute("value"):B=(o=I==null?void 0:I.assignedNodes().map(U=>U.nodeType===3?U.textContent:"").join("").trim())!=null?o:"",this._mathfield=new Zd(M.querySelector(":host > span"),F(ot({},(f=(u=ca.get(this))==null?void 0:u.options)!=null?f:Xd(this)),{eventSink:this,value:B})),!ca.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const U of Object.keys(bg.optionsAttributes))this.upgradeProperty(Uc(U))}if(!((g=this._mathfield)!=null&&g.model)){this._mathfield=null;return}if(ca.has(this)){const U=this._mathfield,lt=ca.get(this),Lt=lt.menuItems;U.model.deferNotifications({content:!1,selection:!1},()=>{const Bt=lt.value;Bt!==void 0&&U.setValue(Bt),U.model.selection=lt.selection,ca.delete(this)}),Lt&&(this.menuItems=Lt)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),F0()}disconnectedCallback(){var o,u;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const f=Pl(this._mathfield.options,Object.keys(bg.optionsAttributes).map(g=>Uc(g)));ca.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(u=(o=this._mathfield.menu)==null?void 0:o.menuItems)!=null?u:void 0,options:f}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(o){if(this.hasOwnProperty(o)){const u=this[o];delete this[o],(o==="readonly"||o==="read-only")&&(o="readOnly"),this[o]=u}}attributeChangedCallback(o,u,f){if(u===f)return;const g=f!==null;switch(o){case"contenteditable":ql(this._mathfield);break;case"disabled":this.disabled=g;break;case"read-only":case"readonly":this.readOnly=g;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(o){const u=!!o;u?(this.setAttribute("readonly",""),ad()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(ad()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:u})}get disabled(){return this.hasAttribute("disabled")}set disabled(o){var u;const f=!!o;f?this.setAttribute("disabled",""):this.removeAttribute("disabled"),ad()?this._internals.ariaDisabled=f?"true":"false":this.setAttribute("aria-disabled",f?"true":"false"),f&&((u=this._mathfield)!=null&&u.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(o){this.setValue(o)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(o){this._setOptions({defaultMode:o})}get macros(){return this._getOption("macros")}set macros(o){this._setOptions({macros:o})}get registers(){const o=this;return new Proxy({},{get:(u,f)=>{if(typeof f=="string")return o._getOption("registers")[f]},set(u,f,g){return typeof f!="string"?!1:(o._setOptions({registers:F(ot({},o._getOption("registers")),{[f]:g})}),!0)}})}set registers(o){this._setOptions({registers:o})}get colorMap(){return this._getOption("colorMap")}set colorMap(o){this._setOptions({colorMap:o})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(o){this._setOptions({backgroundColorMap:o})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(o){this._setOptions({letterShapeStyle:o})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(o){this._setOptions({minFontScale:o})}get smartMode(){return this._getOption("smartMode")}set smartMode(o){this._setOptions({smartMode:o})}get smartFence(){return this._getOption("smartFence")}set smartFence(o){this._setOptions({smartFence:o})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(o){this._setOptions({smartSuperscript:o})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(o){this._setOptions({scriptDepth:o})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(o){this._setOptions({removeExtraneousParentheses:o})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(o){this._setOptions({mathModeSpace:o})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(o){this._setOptions({placeholderSymbol:o})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(o){this._setOptions({popoverPolicy:o})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(o){this._setOptions({environmentPopoverPolicy:o})}get menuItems(){var o,u,f;return this._mathfield?(o=this._mathfield.menu._menuItems.map(g=>g.menuItem))!=null?o:[]:(f=(u=ca.get(this))==null?void 0:u.menuItems)!=null?f:[]}set menuItems(o){var u;if(this._mathfield){const f=(u=this._mathfield.element)==null?void 0:u.querySelector("[part=menu-toggle]");f&&(f.style.display=o.length===0?"none":""),this._mathfield.menu.menuItems=o}ca.has(this)?ca.set(this,F(ot({},ca.get(this)),{menuItems:o})):ca.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Xd(this),menuItems:o})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(o){this._setOptions({mathVirtualKeyboardPolicy:o})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(o){this._setOptions({inlineShortcuts:o})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(o){this._setOptions({inlineShortcutTimeout:o})}get keybindings(){return this._getOption("keybindings")}set keybindings(o){this._setOptions({keybindings:o})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(o){this._setOptions({onInlineShortcut:o})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(o){this._setOptions({onScrollIntoView:o})}get onExport(){return this._getOption("onExport")}set onExport(o){this._setOptions({onExport:o})}get readOnly(){return this._getOption("readOnly")}set readOnly(o){this._setOptions({readOnly:o})}get isSelectionEditable(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.isSelectionEditable)!=null?u:!1}setPromptState(o,u,f){var g;(g=this._mathfield)==null||g.setPromptState(o,u,f)}getPromptState(o){var u,f;return(f=(u=this._mathfield)==null?void 0:u.getPromptState(o))!=null?f:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(o){this._setOptions({virtualKeyboardTargetOrigin:o})}get selection(){return this._mathfield?this._mathfield.model.selection:ca.has(this)?ca.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(o){if(typeof o=="number"&&(o={ranges:[[o,o]]}),this._mathfield){this._mathfield.model.selection=o,ql(this._mathfield);return}if(ca.has(this)){ca.set(this,F(ot({},ca.get(this)),{selection:o}));return}ca.set(this,{value:void 0,selection:o,options:Xd(this),menuItems:void 0})}get selectionIsCollapsed(){const o=this.selection;return o.ranges.length===1&&o.ranges[0][0]===o.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:ca.has(this)?ca.get(this).selection.ranges[0][0]:0}set position(o){if(this._mathfield&&(this._mathfield.model.position=o,ql(this._mathfield)),ca.has(this)){ca.set(this,F(ot({},ca.get(this)),{selection:{ranges:[[o,o]]}}));return}ca.set(this,{value:void 0,selection:{ranges:[[o,o]]},options:Xd(this),menuItems:void 0})}getOffsetDepth(o){var u,f;return this._mathfield?((f=(u=this._mathfield.model.at(o))==null?void 0:u.treeDepth)!=null?f:2)-2:0}get lastOffset(){var o,u;return(u=(o=this._mathfield)==null?void 0:o.model.lastOffset)!=null?u:-1}};zu.version="0.98.5",zu._fontsDirectory="./fonts",zu._soundsDirectory="./sounds",zu.keypressVibration=!0,zu._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},zu._plonkSound="plonk.wav",zu.audioBuffers={},zu.createHTML=r=>r,zu._speechEngineRate="100%",zu._speechEngineVoice="Joanna",zu._textToSpeechMarkup="",zu._textToSpeechRules="mathlive",zu._textToSpeechRulesOptions={},zu.speakHook=N1,zu.readAloudHook=wv,zu._decimalSeparator=".",zu.fractionNavigationOrder="numerator-denominator",zu._isFunction=r=>{var o,u;const f=window.MathfieldElement.computeEngine;return(u=(o=f==null?void 0:f.parse(r).domain)==null?void 0:o.isFunction)!=null?u:!1};var Pp=zu;function Uc(r){return r.replace(/[^a-zA-Z\d]+(.)/g,(o,u)=>u.toUpperCase())}function Xd(r){const o={readOnly:!1},u=Pp.optionsAttributes;return Object.keys(u).forEach(f=>{if(r.hasAttribute(f)){const g=r.getAttribute(f);f==="placeholder"?o.contentPlaceholder=g!=null?g:"":u[f]==="boolean"?o[Uc(f)]=!0:u[f]==="on/off"?g==="on"?o[Uc(f)]=!0:g==="off"?o[Uc(f)]=!1:o[Uc(f)]=void 0:u[f]==="number"?o[Uc(f)]=Number.parseFloat(g!=null?g:"0"):o[Uc(f)]=g}}),o}function ad(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var hm=Pp,Md,sg,lu,Dy;if(le()&&!((Md=window.customElements)!=null&&Md.get("math-field"))){(lu=window[sg=Symbol.for("io.cortexjs.mathlive")])!=null||(window[sg]={});const r=window[Symbol.for("io.cortexjs.mathlive")];r.version="0.98.5",window.MathfieldElement=Pp,(Dy=window.customElements)==null||Dy.define("math-field",Pp)}function wx(r,o,u){let f=u,g=0;const b=r.length;for(;f<o.length;){const M=o[f];if(g<=0&&o.slice(f,f+b)===r)return f;M==="\\"?f++:M==="{"?g++:M==="}"&&g--,f++}return-1}function Sv(r,o,u,f,g="latex"){const b=[];for(const M of r)if(M.type==="text"){const N=M.data;let I=!0,B=0,U;U=N.indexOf(o),U!==-1&&(B=U,B>0&&b.push({type:"text",data:N.slice(0,B)}),I=!1);let lt=!1;for(;!lt;){if(I){if(U=N.indexOf(o,B),U===-1){lt=!0;break}B!==U&&b.push({type:"text",data:N.slice(B,U)}),B=U}else{if(U=wx(u,N,B+o.length),U===-1){lt=!0;break}let Lt=N.slice(B+o.length,U);g==="ascii-math"&&([,Lt]=Dh(Lt,{format:"ascii-math"})),b.push({type:"math",data:Lt,rawData:N.slice(B,U+u.length),mathstyle:f}),B=U+u.length}I=!I}B<N.length&&b.push({type:"text",data:N.slice(B)})}else b.push(M);return b}function O1(r,o,u){let f=[{type:"text",data:r}];return o!=null&&o.inline&&o.inline.forEach(([g,b])=>{f=Sv(f,g,b,"textstyle")}),o!=null&&o.display&&o.display.forEach(([g,b])=>{f=Sv(f,g,b,"displaystyle")}),u!=null&&u.inline&&u.inline.forEach(([g,b])=>{f=Sv(f,g,b,"textstyle","ascii-math")}),u!=null&&u.display&&u.display.forEach(([g,b])=>{f=Sv(f,g,b,"displaystyle","ascii-math")}),f}function bx(r,o){const u=document.createElement("span");u.setAttribute("translate","no");try{const f="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+o.renderToMathML(r)+"</math>";u.innerHTML=window.MathfieldElement.createHTML(f)}catch(f){console.error(`MathLive 0.98.5: Could not convert "${r}"' to MathML with ${f}`),u.textContent=r}return u.className="ML__sr-only",u}function R1(r,o,u,f){try{const g=o.renderToMarkup(r,{mathstyle:u,format:"html"}),b=document.createElement("span");return b.dataset.latex=r,b.style.display=u==="displaystyle"?"flex":"inline-flex",b.setAttribute("aria-hidden","true"),b.setAttribute("translate","no"),b.innerHTML=window.MathfieldElement.createHTML(g),b}catch(g){if(console.error("Could not parse'"+r+"' with ",g),f)return document.createTextNode(r)}return null}function p0(r,o,u,f){var g;const b=R1(r,u,o||"textstyle",f),M=(g=u.renderAccessibleContent)!=null?g:"";if(b&&/\b(mathml|speakable-text)\b/i.test(M)){const N=document.createElement("span");if(/\bmathml\b/i.test(M)&&u.renderToMathML&&N.append(bx(r,u)),/\bspeakable-text\b/i.test(M)&&u.renderToSpeakableText){const I=document.createElement("span");I.setAttribute("translate","no");const B=u.renderToSpeakableText(r);I.innerHTML=window.MathfieldElement.createHTML(B),I.className="ML__sr-only",N.append(I)}return N.append(b),N}return b}function B1(r,o){var u,f,g;let b=null;if((u=o.TeX)!=null&&u.processEnvironments&&/^\s*\\begin/.test(r)){b=document.createDocumentFragment();const M=p0(r,"",o,!0);M&&b.appendChild(M)}else{if(!r.trim())return null;const M=O1(r,(f=o.TeX)==null?void 0:f.delimiters,(g=o.asciiMath)==null?void 0:g.delimiters);if(M.length===1&&M[0].type==="text")return null;b=document.createDocumentFragment();for(const N of M)if(N.type==="text")b.appendChild(document.createTextNode(N.data));else{const I=p0(N.data,N.mathstyle==="textstyle"?"textstyle":"displaystyle",o,!0);I&&b.appendChild(I)}}return b}function F1(r,o){var u,f,g,b,M,N,I,B,U,lt,Lt,Bt,jt,je,Zi,Le;if(r.childNodes.length===1&&r.childNodes[0].nodeType===3){const Ci=(u=r.childNodes[0].textContent)!=null?u:"";if((f=o.TeX)!=null&&f.processEnvironments&&/^\s*\\begin/.test(Ci)){r.textContent="";const Oi=p0(Ci,"",o,!0);Oi&&r.append(Oi);return}const en=O1(Ci,(g=o.TeX)==null?void 0:g.delimiters,(b=o.asciiMath)==null?void 0:b.delimiters);if(en.length===1&&en[0].type==="math"){r.textContent="";const Oi=p0(en[0].data,en[0].mathstyle==="textstyle"?"textstyle":"displaystyle",o,!0);Oi&&r.append(Oi);return}if(en.length===1&&en[0].type==="text")return}for(let Ci=r.childNodes.length-1;Ci>=0;Ci--){const en=r.childNodes[Ci];if(en.nodeType===3){const Oi=B1((M=en.textContent)!=null?M:"",o);Oi&&(Ci+=Oi.childNodes.length-1,en.replaceWith(Oi))}else if(en.nodeType===1){const Oi=en,hr=en.nodeName.toLowerCase();if(hr==="script"){const Jr=en;let Er;if((N=o.processScriptTypePattern)!=null&&N.test(Jr.type))Er=(I=Jr.textContent)!=null?I:"";else if((B=o.processMathJSONScriptTypePattern)!=null&&B.test(Jr.type))try{Er=(lt=o.serializeToLatex)==null?void 0:lt.call(o,JSON.parse((U=Jr.textContent)!=null?U:""))}catch(ta){console.error(ta)}if(Er){let ta="textstyle";for(const mn of Jr.type.split(";")){const[bf,Sf]=mn.toLowerCase().split("=");bf.trim()==="mode"&&(ta=Sf.trim()==="display"?"displaystyle":"textstyle")}const wl=p0(Er,ta,o,!0);wl&&Jr.parentNode.replaceChild(wl,Jr)}}else if(((Bt=(Lt=o.processClassPattern)==null?void 0:Lt.test(Oi.className))!=null?Bt:!1)||!((je=(jt=o.skipTags)==null?void 0:jt.includes(hr))!=null&&je||(Le=(Zi=o.ignoreClassPattern)==null?void 0:Zi.test(Oi.className))!=null&&Le))if(r.childNodes.length===1&&r.childNodes[0].nodeType===3){const Er=r.textContent;r.textContent="";const ta=p0(Er!=null?Er:"","displaystyle",o,!0);ta&&r.append(ta)}else F1(Oi,o)}}}var z1={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function m0(r,o){var u,f,g,b;try{const M=ot(ot({},z1),o);M.ignoreClassPattern=new RegExp((u=M.ignoreClass)!=null?u:""),M.processClassPattern=new RegExp((f=M.processClass)!=null?f:""),M.processScriptTypePattern=new RegExp((g=M.processScriptType)!=null?g:""),M.processMathJSONScriptTypePattern=new RegExp((b=M.processMathJSONScriptType)!=null?b:""),F0(),qu("core"),F1(r,M)}catch(M){M instanceof Error?console.error("renderMathInElement(): "+M.message):console.error("renderMathInElement(): Could not render math for element",r)}}function ag(r,o){const u=gp.singleton;return u?(u.show(),K0(),u.currentLayer=o,u.render(),u.focus(),!0):!1}function lg(){const r=window.mathVirtualKeyboard;return r.visible?r.hide({animate:!0}):r.show({animate:!0}),!1}vu({switchKeyboardLayer:ag,toggleVirtualKeyboard:lg,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function ld(){var r,o;return(o=globalThis[r=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[r]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function co(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function $1(r){dc(document.body,r)}function ch(r){if(typeof r=="string"){const o=document.getElementById(r);if(o===null)throw new Error(`The element with ID "${r}" could not be found.`);return o}return typeof r=="string"?null:r}function dc(r,o){var u,f,g,b;const M=ch(r);if(!M)return;const N=o!=null?o:{};(u=N.renderToMarkup)!=null||(N.renderToMarkup=tu),(f=N.renderToMathML)!=null||(N.renderToMathML=ih),(g=N.renderToSpeakableText)!=null||(N.renderToSpeakableText=Ly),(b=N.serializeToLatex)!=null||(N.serializeToLatex=yx),m0(M,N)}var Sx={mathlive:"0.98.5"}},17423:function(Wr,Ti,j){"use strict";j.d(Ti,{Z:function(){return ot}});const Nt=F=>typeof F=="object"&&F!=null&&F.nodeType===1,At=(F,Y)=>(!Y||F!=="hidden")&&F!=="visible"&&F!=="clip",vt=(F,Y)=>{if(F.clientHeight<F.scrollHeight||F.clientWidth<F.scrollWidth){const ee=getComputedStyle(F,null);return At(ee.overflowY,Y)||At(ee.overflowX,Y)||(ne=>{const Fe=(le=>{if(!le.ownerDocument||!le.ownerDocument.defaultView)return null;try{return le.ownerDocument.defaultView.frameElement}catch(Zt){return null}})(ne);return!!Fe&&(Fe.clientHeight<ne.scrollHeight||Fe.clientWidth<ne.scrollWidth)})(F)}return!1},Et=(F,Y,ee,ne,Fe,le,Zt,zt)=>le<F&&Zt>Y||le>F&&Zt<Y?0:le<=F&&zt<=ee||Zt>=Y&&zt>=ee?le-F-ne:Zt>Y&&zt<ee||le<F&&zt>ee?Zt-Y+Fe:0,gt=F=>{const Y=F.parentElement;return Y==null?F.getRootNode().host||null:Y},ft=(F,Y)=>{var ee,ne,Fe,le;if(typeof document=="undefined")return[];const{scrollMode:Zt,block:zt,inline:Q,boundary:se,skipOverflowHiddenElements:$e}=Y,Vt=typeof se=="function"?se:Ze=>Ze!==se;if(!Nt(F))throw new TypeError("Invalid target");const Wt=document.scrollingElement||document.documentElement,kt=[];let it=F;for(;Nt(it)&&Vt(it);){if(it=gt(it),it===Wt){kt.push(it);break}it!=null&&it===document.body&&vt(it)&&!vt(document.documentElement)||it!=null&&vt(it,$e)&&kt.push(it)}const Ot=(ne=(ee=window.visualViewport)==null?void 0:ee.width)!=null?ne:innerWidth,qt=(le=(Fe=window.visualViewport)==null?void 0:Fe.height)!=null?le:innerHeight,{scrollX:Te,scrollY:_e}=window,{height:fi,width:Ht,top:pe,right:Ke,bottom:ki,left:pi}=F.getBoundingClientRect(),{top:Sn,right:Sr,bottom:Ki,left:It}=(Ze=>{const Ye=window.getComputedStyle(Ze);return{top:parseFloat(Ye.scrollMarginTop)||0,right:parseFloat(Ye.scrollMarginRight)||0,bottom:parseFloat(Ye.scrollMarginBottom)||0,left:parseFloat(Ye.scrollMarginLeft)||0}})(F);let tt=zt==="start"||zt==="nearest"?pe-Sn:zt==="end"?ki+Ki:pe+fi/2-Sn+Ki,de=Q==="center"?pi+Ht/2-It+Sr:Q==="end"?Ke+Sr:pi-It;const hi=[];for(let Ze=0;Ze<kt.length;Ze++){const Ye=kt[Ze],{height:Ae,width:Wi,top:En,right:an,bottom:vi,left:ai}=Ye.getBoundingClientRect();if(Zt==="if-needed"&&pe>=0&&pi>=0&&ki<=qt&&Ke<=Ot&&pe>=En&&ki<=vi&&pi>=ai&&Ke<=an)return hi;const zi=getComputedStyle(Ye),$i=parseInt(zi.borderLeftWidth,10),q=parseInt(zi.borderTopWidth,10),D=parseInt(zi.borderRightWidth,10),_=parseInt(zi.borderBottomWidth,10);let K=0,z=0;const P="offsetWidth"in Ye?Ye.offsetWidth-Ye.clientWidth-$i-D:0,bt="offsetHeight"in Ye?Ye.offsetHeight-Ye.clientHeight-q-_:0,Gt="offsetWidth"in Ye?Ye.offsetWidth===0?0:Wi/Ye.offsetWidth:0,Pe="offsetHeight"in Ye?Ye.offsetHeight===0?0:Ae/Ye.offsetHeight:0;if(Wt===Ye)K=zt==="start"?tt:zt==="end"?tt-qt:zt==="nearest"?Et(_e,_e+qt,qt,q,_,_e+tt,_e+tt+fi,fi):tt-qt/2,z=Q==="start"?de:Q==="center"?de-Ot/2:Q==="end"?de-Ot:Et(Te,Te+Ot,Ot,$i,D,Te+de,Te+de+Ht,Ht),K=Math.max(0,K+_e),z=Math.max(0,z+Te);else{K=zt==="start"?tt-En-q:zt==="end"?tt-vi+_+bt:zt==="nearest"?Et(En,vi,Ae,q,_+bt,tt,tt+fi,fi):tt-(En+Ae/2)+bt/2,z=Q==="start"?de-ai-$i:Q==="center"?de-(ai+Wi/2)+P/2:Q==="end"?de-an+D+P:Et(ai,an,Wi,$i,D+P,de,de+Ht,Ht);const{scrollLeft:He,scrollTop:ei}=Ye;K=Pe===0?0:Math.max(0,Math.min(ei+K/Pe,Ye.scrollHeight-Ae/Pe+bt)),z=Gt===0?0:Math.max(0,Math.min(He+z/Gt,Ye.scrollWidth-Wi/Gt+P)),tt+=ei-K,de+=He-z}hi.push({el:Ye,top:K,left:z})}return hi},ct=F=>F===!1?{block:"end",inline:"nearest"}:(Y=>Y===Object(Y)&&Object.keys(Y).length!==0)(F)?F:{block:"start",inline:"nearest"};function ot(F,Y){if(!F.isConnected||!(Fe=>{let le=Fe;for(;le&&le.parentNode;){if(le.parentNode===document)return!0;le=le.parentNode instanceof ShadowRoot?le.parentNode.host:le.parentNode}return!1})(F))return;const ee=(Fe=>{const le=window.getComputedStyle(Fe);return{top:parseFloat(le.scrollMarginTop)||0,right:parseFloat(le.scrollMarginRight)||0,bottom:parseFloat(le.scrollMarginBottom)||0,left:parseFloat(le.scrollMarginLeft)||0}})(F);if((Fe=>typeof Fe=="object"&&typeof Fe.behavior=="function")(Y))return Y.behavior(ft(F,Y));const ne=typeof Y=="boolean"||Y==null?void 0:Y.behavior;for(const{el:Fe,top:le,left:Zt}of ft(F,ct(Y))){const zt=le-ee.top+ee.bottom,Q=Zt-ee.left+ee.right;Fe.scroll({top:zt,left:Q,behavior:ne})}}}}]);
|
|
|
}()); |