openlearn-next 0.2.3 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -136
- package/dist/assets/AdminDirectoryView-Cai0cQqi.js +1 -0
- package/dist/assets/BatchPickerModal-CKQyeY6R.js +1 -0
- package/dist/assets/ClassesView-Cxgfcrx1.js +19 -0
- package/dist/assets/CloudDriveModal-DgDurUBT.js +1 -0
- package/dist/assets/ComputerLabView-CUCO2VIV.js +1 -0
- package/dist/assets/CourseManagement-DSCOjuIC.js +1 -0
- package/dist/assets/CourseWizardModal-B3QnFxvj.js +3 -0
- package/dist/assets/CoursewareHubPanel-CAaf22Qm.js +1 -0
- package/dist/assets/Dashboard-Xly67TyD.js +8 -0
- package/dist/assets/ExportWeightModal-BlS2auLs.js +1 -0
- package/dist/assets/HelpTour-ZgEkRnin.js +1 -0
- package/dist/assets/HelpView-DgFLEuso.js +204 -0
- package/dist/assets/ImportLessonsModal-BZZRDBRU.js +1 -0
- package/dist/assets/ImportModal-mkWuDoAN.js +1 -0
- package/dist/assets/InteractiveCoursewareViewer-EIRNulEo.js +1 -0
- package/dist/assets/InteractiveWhiteboard-DDOKVrHd.js +102 -0
- package/dist/assets/LazyCourseware-qE4CY67E.js +1 -0
- package/dist/assets/LazyWhiteboard-C9fzRtzL.js +2 -0
- package/dist/assets/LessonEditorView-D1nhlQon.js +1 -0
- package/dist/assets/LiveClassroomView-C1lI4lFd.js +1 -0
- package/dist/assets/NotificationDetailModal-dndFrE7p.js +1 -0
- package/dist/assets/PluginView-5TYIP1ze.js +65 -0
- package/dist/assets/ProcessLogsModal-8mVp07ic.js +1 -0
- package/dist/assets/QuizGeneratorModal-DpTFYbVJ.js +1 -0
- package/dist/assets/StudentAssignmentView-CCGWFVqD.js +1 -0
- package/dist/assets/StudentLessonView-yhRHP8e8.js +1 -0
- package/dist/assets/StudentPreviewModal-UpNg1yl0.js +1 -0
- package/dist/assets/StudentView-C1cc6RuC.js +1 -0
- package/dist/assets/SystemResourceLibraryModal-Dnh7F5Vm.js +1 -0
- package/dist/assets/TeacherView-CWjbV0x-.js +2 -0
- package/dist/assets/TimetableView-zce3okQn.js +6 -0
- package/dist/assets/index-B9cwmoaG.js +129 -0
- package/dist/assets/index-BrEBeWAQ.js +14 -0
- package/dist/assets/index-CATki2cp.css +1 -0
- package/dist/assets/index-Cq_aKTfc.js +1 -0
- package/dist/assets/{index.es-CF5dm42F.js → index.es-DZ6UeYE-.js} +2 -2
- package/dist/assets/vendor-charts-B7ViBL9w.js +71 -0
- package/dist/assets/vendor-icons-BvCtGbt1.js +8221 -0
- package/dist/assets/vendor-konva-CzxOmTv9.js +49 -0
- package/dist/assets/vendor-motion-Dz5URUo4.js +9 -0
- package/dist/assets/vendor-pdf-CVyNPGVr.js +191 -0
- package/dist/assets/{vendor-pptx-CJ3I-KT0.js → vendor-pptx-B0hlo0eh.js} +1 -1
- package/dist/assets/vendor-react-0Lg0vA-4.js +49 -0
- package/dist/assets/vendor-utils-4FcTwKPj.js +1 -0
- package/dist/index.html +2 -3
- package/dist/server.cjs +185 -73
- package/package.json +1 -1
- package/dist/assets/courseware-Cc-Yy0Ha.js +0 -1
- package/dist/assets/index-CsN5CIqI.css +0 -1
- package/dist/assets/index-D_zAVH7u.js +0 -682
- package/dist/assets/vendor-html2canvas-B0tyYwQk.js +0 -22
- package/dist/assets/vendor-konva-GivUq6dt.js +0 -89
- package/dist/assets/whiteboard-jgQrAUm7.js +0 -8343
- /package/dist/assets/{purify.es-V6uLfjnH.js → vendor-content-V6uLfjnH.js} +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import{a as kc,e as id,g as ld,R as _t,s as qr,r as Ne,f as sd,b as rd}from"./vendor-react-0Lg0vA-4.js";const ud=Math.PI/180;function od(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const $a=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},V={_global:$a,version:"10.3.0",isBrowser:od(),isUnminified:/param/.test(function(u){}.toString()),dblClickWindow:400,getAngle(u){return V.angleDeg?u*ud:u},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return V.DD.isDragging},isTransforming(){var u,e;return(e=(u=V.Transformer)===null||u===void 0?void 0:u.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!V.DD.node},releaseCanvasOnDestroy:!0,document:$a.document,_injectGlobal(u){typeof $a.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),$a.Konva=u}},Bt=u=>{V[u.prototype.getClassName()]=u};V._injectGlobal(V);const hd=`Konva.js unsupported environment.
|
|
2
|
+
|
|
3
|
+
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
|
|
4
|
+
|
|
5
|
+
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
|
|
6
|
+
|
|
7
|
+
bash: npm install canvas
|
|
8
|
+
js: import "konva/canvas-backend";
|
|
9
|
+
|
|
10
|
+
or
|
|
11
|
+
|
|
12
|
+
bash: npm install skia-canvas
|
|
13
|
+
js: import "konva/skia-backend";
|
|
14
|
+
`,vc=()=>{if(typeof document>"u")throw new Error(hd)};class _e{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new _e(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){const n=this.m;return{x:n[0]*e.x+n[2]*e.y+n[4],y:n[1]*e.x+n[3]*e.y+n[5]}}translate(e,n){return this.m[4]+=this.m[0]*e+this.m[2]*n,this.m[5]+=this.m[1]*e+this.m[3]*n,this}scale(e,n){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=n,this.m[3]*=n,this}rotate(e){const n=Math.cos(e),l=Math.sin(e),r=this.m[0]*n+this.m[2]*l,o=this.m[1]*n+this.m[3]*l,h=this.m[0]*-l+this.m[2]*n,f=this.m[1]*-l+this.m[3]*n;return this.m[0]=r,this.m[1]=o,this.m[2]=h,this.m[3]=f,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,n){const l=this.m[0]+this.m[2]*n,r=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*e,h=this.m[3]+this.m[1]*e;return this.m[0]=l,this.m[1]=r,this.m[2]=o,this.m[3]=h,this}multiply(e){const n=this.m[0]*e.m[0]+this.m[2]*e.m[1],l=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],h=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],f=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=n,this.m[1]=l,this.m[2]=r,this.m[3]=o,this.m[4]=h,this.m[5]=f,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*e,l=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,h=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),f=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=l,this.m[2]=r,this.m[3]=o,this.m[4]=h,this.m[5]=f,this}getMatrix(){return this.m}decompose(){const e=this.m[0],n=this.m[1],l=this.m[2],r=this.m[3],o=this.m[4],h=this.m[5],f=e*r-n*l,g={x:o,y:h,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||n!=0){const m=Math.sqrt(e*e+n*n);g.rotation=n>0?Math.acos(e/m):-Math.acos(e/m),g.scaleX=m,g.scaleY=f/m,g.skewX=(e*l+n*r)/f,g.skewY=0}else if(l!=0||r!=0){const m=Math.sqrt(l*l+r*r);g.rotation=Math.PI/2-(r>0?Math.acos(-l/m):-Math.acos(l/m)),g.scaleX=f/m,g.scaleY=m,g.skewX=0,g.skewY=(e*l+n*r)/f}return g.rotation=T._getRotation(g.rotation),g}}const cd="[object Array]",fd="[object Number]",dd="[object String]",gd="[object Boolean]",md=Math.PI/180,pd=180/Math.PI,vi="#",vd="",yd="0",Sd="Konva warning: ",yc="Konva error: ",_d="rgb(",jr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},Cd=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let Ll=[],yi=null;const Ed=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(u){setTimeout(u,16)},T={_isElement(u){return!!(u&&u.nodeType==1)},_isFunction(u){return!!(u&&u.constructor&&u.call&&u.apply)},_isPlainObject(u){return!!u&&u.constructor===Object},_isArray(u){return Object.prototype.toString.call(u)===cd},_isNumber(u){return Object.prototype.toString.call(u)===fd&&!isNaN(u)&&isFinite(u)},_isString(u){return Object.prototype.toString.call(u)===dd},_isBoolean(u){return Object.prototype.toString.call(u)===gd},isObject(u){return u instanceof Object},isValidSelector(u){if(typeof u!="string")return!1;const e=u[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(u){return u===0||u>0?1:-1},requestAnimFrame(u){Ll.push(u),Ll.length===1&&Ed(function(){const e=Ll;Ll=[],e.forEach(function(n){n()})})},createCanvasElement(){vc();const u=document.createElement("canvas");try{u.style=u.style||{}}catch{}return u},createImageElement(){return vc(),document.createElement("img")},_isInDocument(u){for(;u=u.parentNode;)if(u==document)return!0;return!1},_urlToImage(u,e){const n=T.createImageElement();n.onload=function(){e(n)},n.src=u},_rgbToHex(u,e,n){return((1<<24)+(u<<16)+(e<<8)+n).toString(16).slice(1)},_hexToRgb(u){u=u.replace(vi,vd);const e=parseInt(u,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let u=(Math.random()*16777215<<0).toString(16);for(;u.length<6;)u=yd+u;return vi+u},isCanvasFarblingActive(){if(yi!==null)return yi;if(typeof document>"u")return yi=!1,!1;const u=this.createCanvasElement();u.width=10,u.height=10;const e=u.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,10,10),e.fillStyle="#282828",e.fillRect(0,0,10,10);const n=e.getImageData(0,0,10,10).data;let l=!1;for(let r=0;r<100;r++)if(n[r*4]!==40||n[r*4+1]!==40||n[r*4+2]!==40||n[r*4+3]!==255){l=!0;break}return yi=l,this.releaseCanvas(u),yi},getHitColor(){const u=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(u):u},getHitColorKey(u,e,n){return this.isCanvasFarblingActive()&&(u=Math.round(u/5)*5,e=Math.round(e/5)*5,n=Math.round(n/5)*5),vi+this._rgbToHex(u,e,n)},getSnappedHexColor(u){const e=this._hexToRgb(u);return vi+this._rgbToHex(Math.round(e.r/5)*5,Math.round(e.g/5)*5,Math.round(e.b/5)*5)},getRGB(u){let e;return u in jr?(e=jr[u],{r:e[0],g:e[1],b:e[2]}):u[0]===vi?this._hexToRgb(u.substring(1)):u.substr(0,4)===_d?(e=Cd.exec(u.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(u){return u=u||"black",T._namedColorToRBA(u)||T._hex3ColorToRGBA(u)||T._hex4ColorToRGBA(u)||T._hex6ColorToRGBA(u)||T._hex8ColorToRGBA(u)||T._rgbColorToRGBA(u)||T._rgbaColorToRGBA(u)||T._hslColorToRGBA(u)},_namedColorToRBA(u){const e=jr[u.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(u){if(u.indexOf("rgb(")===0){u=u.match(/rgb\(([^)]+)\)/)[1];const e=u.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(u){if(u.indexOf("rgba(")===0){u=u.match(/rgba\(([^)]+)\)/)[1];const e=u.split(/ *, */).map((n,l)=>n.slice(-1)==="%"?l===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(u){if(u[0]==="#"&&u.length===9)return{r:parseInt(u.slice(1,3),16),g:parseInt(u.slice(3,5),16),b:parseInt(u.slice(5,7),16),a:parseInt(u.slice(7,9),16)/255}},_hex6ColorToRGBA(u){if(u[0]==="#"&&u.length===7)return{r:parseInt(u.slice(1,3),16),g:parseInt(u.slice(3,5),16),b:parseInt(u.slice(5,7),16),a:1}},_hex4ColorToRGBA(u){if(u[0]==="#"&&u.length===5)return{r:parseInt(u[1]+u[1],16),g:parseInt(u[2]+u[2],16),b:parseInt(u[3]+u[3],16),a:parseInt(u[4]+u[4],16)/255}},_hex3ColorToRGBA(u){if(u[0]==="#"&&u.length===4)return{r:parseInt(u[1]+u[1],16),g:parseInt(u[2]+u[2],16),b:parseInt(u[3]+u[3],16),a:1}},_hslColorToRGBA(u){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(u)){const[e,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(u),l=Number(n[0])/360,r=Number(n[1])/100,o=Number(n[2])/100;let h,f,g;if(r===0)return g=o*255,{r:Math.round(g),g:Math.round(g),b:Math.round(g),a:1};o<.5?h=o*(1+r):h=o+r-o*r;const m=2*o-h,v=[0,0,0];for(let S=0;S<3;S++)f=l+1/3*-(S-1),f<0&&f++,f>1&&f--,6*f<1?g=m+(h-m)*6*f:2*f<1?g=h:3*f<2?g=m+(h-m)*(2/3-f)*6:g=m,v[S]=g*255;return{r:Math.round(v[0]),g:Math.round(v[1]),b:Math.round(v[2]),a:1}}},haveIntersection(u,e){return!(e.x>u.x+u.width||e.x+e.width<u.x||e.y>u.y+u.height||e.y+e.height<u.y)},cloneObject(u){const e={};for(const n in u)this._isPlainObject(u[n])?e[n]=this.cloneObject(u[n]):this._isArray(u[n])?e[n]=this.cloneArray(u[n]):e[n]=u[n];return e},cloneArray(u){return u.slice(0)},degToRad(u){return u*md},radToDeg(u){return u*pd},_degToRad(u){return T.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),T.degToRad(u)},_radToDeg(u){return T.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),T.radToDeg(u)},_getRotation(u){return V.angleDeg?T.radToDeg(u):u},_capitalize(u){return u.charAt(0).toUpperCase()+u.slice(1)},throw(u){throw new Error(yc+u)},error(u){console.error(yc+u)},warn(u){V.showWarnings&&console.warn(Sd+u)},each(u,e){for(const n in u)e(n,u[n])},_inRange(u,e,n){return e<=u&&u<n},_getProjectionToSegment(u,e,n,l,r,o){let h,f,g;const m=(u-n)*(u-n)+(e-l)*(e-l);if(m==0)h=u,f=e,g=(r-n)*(r-n)+(o-l)*(o-l);else{const v=((r-u)*(n-u)+(o-e)*(l-e))/m;v<0?(h=u,f=e,g=(u-r)*(u-r)+(e-o)*(e-o)):v>1?(h=n,f=l,g=(n-r)*(n-r)+(l-o)*(l-o)):(h=u+v*(n-u),f=e+v*(l-e),g=(h-r)*(h-r)+(f-o)*(f-o))}return[h,f,g]},_getProjectionToLine(u,e,n){const l=T.cloneObject(u);let r=Number.MAX_VALUE;return e.forEach(function(o,h){if(!n&&h===e.length-1)return;const f=e[(h+1)%e.length],g=T._getProjectionToSegment(o.x,o.y,f.x,f.y,u.x,u.y),m=g[0],v=g[1],S=g[2];S<r&&(l.x=m,l.y=v,r=S)}),l},_prepareArrayForTween(u,e,n){const l=[],r=[];if(u.length>e.length){const h=e;e=u,u=h}for(let h=0;h<u.length;h+=2)l.push({x:u[h],y:u[h+1]});for(let h=0;h<e.length;h+=2)r.push({x:e[h],y:e[h+1]});const o=[];return r.forEach(function(h){const f=T._getProjectionToLine(h,l,n);o.push(f.x),o.push(f.y)}),o},_prepareToStringify(u){let e;u.visitedByCircularReferenceRemoval=!0;for(const n in u)if(u.hasOwnProperty(n)&&u[n]&&typeof u[n]=="object"){if(e=Object.getOwnPropertyDescriptor(u,n),u[n].visitedByCircularReferenceRemoval||T._isElement(u[n]))if(e.configurable)delete u[n];else return null;else if(T._prepareToStringify(u[n])===null)if(e.configurable)delete u[n];else return null}return delete u.visitedByCircularReferenceRemoval,u},_assign(u,e){for(const n in e)u[n]=e[n];return u},_getFirstPointerId(u){return u.touches?u.changedTouches[0].identifier:u.pointerId||999},releaseCanvas(...u){V.releaseCanvasOnDestroy&&u.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(u,e,n,l){let r=e<0?e:0,o=n<0?n:0;e=Math.abs(e),n=Math.abs(n);let h=0,f=0,g=0,m=0;typeof l=="number"?h=f=g=m=Math.min(l,e/2,n/2):(h=Math.min(l[0]||0,e/2,n/2),f=Math.min(l[1]||0,e/2,n/2),m=Math.min(l[2]||0,e/2,n/2),g=Math.min(l[3]||0,e/2,n/2)),u.moveTo(r+h,o),u.lineTo(r+e-f,o),u.arc(r+e-f,o+f,f,Math.PI*3/2,0,!1),u.lineTo(r+e,o+n-m),u.arc(r+e-m,o+n-m,m,0,Math.PI/2,!1),u.lineTo(r+g,o+n),u.arc(r+g,o+n-g,g,Math.PI/2,Math.PI,!1),u.lineTo(r,o+h),u.arc(r+h,o+h,h,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(u,e,n,l,r){l=Math.abs(l);for(let o=0;o<n;o++){const h=e[(o-1+n)%n],f=e[o],g=e[(o+1)%n],m={x:f.x-h.x,y:f.y-h.y},v={x:g.x-f.x,y:g.y-f.y},S=Math.hypot(m.x,m.y),y=Math.hypot(v.x,v.y);let E;typeof r=="number"?E=r:E=o<r.length?r[o]:0,E=l*Math.cos(Math.PI/n)*Math.min(1,E/l*2);const N={x:m.x/S,y:m.y/S},A={x:v.x/y,y:v.y/y},O={x:f.x-N.x*E,y:f.y-N.y*E},M={x:f.x+A.x*E,y:f.y+A.y*E};o===0?u.moveTo(O.x,O.y):u.lineTo(O.x,O.y),u.arcTo(f.x,f.y,M.x,M.y,E)}}};function bd(u){const e=[],n=u.length,l=T;for(let r=0;r<n;r++){let o=u[r];l._isNumber(o)?o=Math.round(o*1e3)/1e3:l._isString(o)||(o=o+""),e.push(o)}return e}const Sc=",",Td="(",xd=")",Ad="([",Md="])",Rd=";",Nd="()",Od="=",_c=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],zd=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],Dd=100;let Yl=null;function Cc(){if(Yl!==null)return Yl;try{const e=T.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(Yl=!1,!1)}catch{return Yl=!1,!1}}class Wl{constructor(e){this.canvas=e,V.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let l=this.traceArr,r=l.length,o="",h,f,g,m;for(h=0;h<r;h++)f=l[h],g=f.method,g?(m=f.args,o+=g,e?o+=Nd:T._isArray(m[0])?o+=Ad+m.join(Sc)+Md:(n&&(m=m.map(v=>typeof v=="number"?Math.floor(v):v)),o+=Td+m.join(Sc)+xd)):(o+=f.property,e||(o+=Od+f.val)),o+=Rd;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,l;n.push(e),l=n.length,l>=Dd&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}_applyMiterLimit(e){const n=e.attrs.miterLimit;n!=null&&this.setAttr("miterLimit",n)}setAttr(e,n){this._context[e]=n}arc(e,n,l,r,o,h){this._context.arc(e,n,l,r,o,h)}arcTo(e,n,l,r,o){this._context.arcTo(e,n,l,r,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,l,r,o,h){this._context.bezierCurveTo(e,n,l,r,o,h)}clearRect(e,n,l,r){this._context.clearRect(e,n,l,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const l=arguments;if(l.length===2)return this._context.createImageData(e,n);if(l.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,l,r){return this._context.createLinearGradient(e,n,l,r)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,l,r,o,h){return this._context.createRadialGradient(e,n,l,r,o,h)}drawImage(e,n,l,r,o,h,f,g,m){const v=arguments,S=this._context;v.length===3?S.drawImage(e,n,l):v.length===5?S.drawImage(e,n,l,r,o):v.length===9&&S.drawImage(e,n,l,r,o,h,f,g,m)}ellipse(e,n,l,r,o,h,f,g){this._context.ellipse(e,n,l,r,o,h,f,g)}isPointInPath(e,n,l,r){return l?this._context.isPointInPath(l,e,n,r):this._context.isPointInPath(e,n,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,l,r){this._context.fillRect(e,n,l,r)}strokeRect(e,n,l,r){this._context.strokeRect(e,n,l,r)}fillText(e,n,l,r){r?this._context.fillText(e,n,l,r):this._context.fillText(e,n,l)}measureText(e){return this._context.measureText(e)}getImageData(e,n,l,r){return this._context.getImageData(e,n,l,r)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,l,r){this._context.rect(e,n,l,r)}roundRect(e,n,l,r,o){this._context.roundRect(e,n,l,r,o)}putImageData(e,n,l){this._context.putImageData(e,n,l)}quadraticCurveTo(e,n,l,r){this._context.quadraticCurveTo(e,n,l,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,l,r,o,h){this._context.setTransform(e,n,l,r,o,h)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,l,r){this._context.strokeText(e,n,l,r)}transform(e,n,l,r,o,h){this._context.transform(e,n,l,r,o,h)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=_c.length,l=this.setAttr,r,o;const h=function(f){let g=e[f],m;e[f]=function(){return o=bd(Array.prototype.slice.call(arguments,0)),m=g.apply(e,arguments),e._trace({method:f,args:o}),m}};for(r=0;r<n;r++)h(_c[r]);e.setAttr=function(){l.apply(e,arguments);const f=arguments[0];let g=arguments[1];(f==="shadowOffsetX"||f==="shadowOffsetY"||f==="shadowBlur")&&(g=g/this.canvas.getPixelRatio()),e._trace({property:f,val:g})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}zd.forEach(function(u){Object.defineProperty(Wl.prototype,u,{get(){return this._context[u]},set(e){this._context[u]=e}})});class Gd extends Wl{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),l=e.getFillPriority();if(n&&l==="color"){this._fillColor(e);return}const r=e.getFillPatternImage();if(r&&l==="pattern"){this._fillPattern(e);return}const o=e.getFillLinearGradientColorStops();if(o&&l==="linear-gradient"){this._fillLinearGradient(e);return}const h=e.getFillRadialGradientColorStops();if(h&&l==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):r?this._fillPattern(e):o?this._fillLinearGradient(e):h&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),l=e.getStrokeLinearGradientEndPoint(),r=e.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,l.x,l.y);if(r){for(let h=0;h<r.length;h+=2)o.addColorStop(r[h],r[h+1]);this.setAttr("strokeStyle",o)}}_stroke(e){const n=e.dash(),l=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!l){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),l||this.restore()}}_applyShadow(e){var n,l,r;const o=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",h=(l=e.getShadowBlur())!==null&&l!==void 0?l:5,f=(r=e.getShadowOffset())!==null&&r!==void 0?r:{x:0,y:0},g=e.getAbsoluteScale(),m=this.canvas.getPixelRatio(),v=g.x*m,S=g.y*m;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",h*Math.min(Math.abs(v),Math.abs(S))),this.setAttr("shadowOffsetX",f.x*v),this.setAttr("shadowOffsetY",f.y*S)}}class Hd extends Wl{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e);const l=e.hitStrokeWidth(),r=l==="auto"?e.strokeWidth():l;this.setAttr("lineWidth",r),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}let Xl;function Bd(){if(Xl)return Xl;const u=T.createCanvasElement(),e=u.getContext("2d");return Xl=(function(){const n=V._global.devicePixelRatio||1,l=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/l})(),T.releaseCanvas(u),Xl}class cu{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const l=(e||{}).pixelRatio||V.pixelRatio||Bd();this.pixelRatio=l,this._canvas=T.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(r){return T.error("Unable to get data URL. "+r.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class Ma extends cu{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new Gd(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}class fu extends cu{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new Hd(this),this.setSize(e.width,e.height)}}const mt={get isDragging(){let u=!1;return mt._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(u=!0)}),u},justDragged:!1,get node(){let u;return mt._dragElements.forEach(e=>{u=e.node}),u},_dragElements:new Map,_drag(u){const e=[];mt._dragElements.forEach((n,l)=>{const{node:r}=n,o=r.getStage();o.setPointersPositions(u),n.pointerId===void 0&&(n.pointerId=T._getFirstPointerId(u));const h=o._changedPointerPositions.find(f=>f.id===n.pointerId);if(h){if(n.dragStatus!=="dragging"){const f=r.dragDistance();if(Math.max(Math.abs(h.x-n.startPointerPos.x),Math.abs(h.y-n.startPointerPos.y))<f||(r.startDrag({evt:u}),!r.isDragging()))return}r._setDragPosition(u,n),e.push(r)}}),e.forEach(n=>{n.getStage()&&n.fire("dragmove",{type:"dragmove",target:n,evt:u},!0)})},_endDragBefore(u){const e=[];mt._dragElements.forEach(n=>{const{node:l}=n,r=l.getStage();if(u&&r.setPointersPositions(u),!r._changedPointerPositions.find(f=>f.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(mt.justDragged=!0,V._mouseListenClick=!1,V._touchListenClick=!1,V._pointerListenClick=!1,n.dragStatus="stopped");const h=n.node.getLayer()||n.node instanceof V.Stage&&n.node;h&&e.indexOf(h)===-1&&e.push(h)}),e.forEach(n=>{n.draw()})},_endDragAfter(u){mt._dragElements.forEach((e,n)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:u},!0),e.dragStatus!=="dragging"&&mt._dragElements.delete(n)})}};V.isBrowser&&(window.addEventListener("mouseup",mt._endDragBefore,!0),window.addEventListener("touchend",mt._endDragBefore,!0),window.addEventListener("touchcancel",mt._endDragBefore,!0),window.addEventListener("mousemove",mt._drag),window.addEventListener("touchmove",mt._drag),window.addEventListener("mouseup",mt._endDragAfter,!1),window.addEventListener("touchend",mt._endDragAfter,!1),window.addEventListener("touchcancel",mt._endDragAfter,!1));function Ra(u){return T._isString(u)?'"'+u+'"':Object.prototype.toString.call(u)==="[object Number]"||T._isBoolean(u)?u:Object.prototype.toString.call(u)}function Ic(u){return u>255?255:u<0?0:Math.round(u)}function q(){if(V.isUnminified)return function(u,e){return T._isNumber(u)||T.warn(Ra(u)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),u}}function kl(u){if(V.isUnminified)return function(e,n){let l=T._isNumber(e),r=T._isArray(e)&&e.length==u;return!l&&!r&&T.warn(Ra(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+u+")"),e}}function du(){if(V.isUnminified)return function(u,e){return T._isNumber(u)||u==="auto"||T.warn(Ra(u)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),u}}function tn(){if(V.isUnminified)return function(u,e){return T._isString(u)||T.warn(Ra(u)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),u}}function $c(){if(V.isUnminified)return function(u,e){const n=T._isString(u),l=Object.prototype.toString.call(u)==="[object CanvasGradient]"||u&&u.addColorStop;return n||l||T.warn(Ra(u)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),u}}function Ud(){if(V.isUnminified)return function(u,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&u instanceof n||(T._isArray(u)?u.forEach(function(l){T._isNumber(l)||T.warn('"'+e+'" attribute has non numeric element '+l+". Make sure that all elements are numbers.")}):T.warn(Ra(u)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),u}}function Be(){if(V.isUnminified)return function(u,e){return u===!0||u===!1||T.warn(Ra(u)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),u}}function Ld(u){if(V.isUnminified)return function(e,n){return e==null||T.isObject(e)||T.warn(Ra(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+u),e}}const Si="get",_i="set",C={addGetterSetter(u,e,n,l,r){C.addGetter(u,e,n),C.addSetter(u,e,l,r),C.addOverloadedGetterSetter(u,e)},addGetter(u,e,n){const l=Si+T._capitalize(e);u.prototype[l]=u.prototype[l]||function(){const r=this.attrs[e];return r===void 0?n:r}},addSetter(u,e,n,l){const r=_i+T._capitalize(e);u.prototype[r]||C.overWriteSetter(u,e,n,l)},overWriteSetter(u,e,n,l){const r=_i+T._capitalize(e);u.prototype[r]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,e)),this._setAttr(e,o),l&&l.call(this),this}},addComponentsGetterSetter(u,e,n,l,r){const o=n.length,h=T._capitalize,f=Si+h(e),g=_i+h(e);u.prototype[f]=function(){const v={};for(let S=0;S<o;S++){const y=n[S];v[y]=this.getAttr(e+h(y))}return v};const m=Ld(n);u.prototype[g]=function(v){const S=this.attrs[e];l&&(v=l.call(this,v,e)),m&&m.call(this,v,e);for(const y in v)v.hasOwnProperty(y)&&this._setAttr(e+h(y),v[y]);return v||n.forEach(y=>{this._setAttr(e+h(y),void 0)}),this._fireChangeEvent(e,S,v),r&&r.call(this),this},C.addOverloadedGetterSetter(u,e)},addOverloadedGetterSetter(u,e){const n=T._capitalize(e),l=_i+n,r=Si+n;u.prototype[e]=function(){return arguments.length?(this[l](arguments[0]),this):this[r]()}},addDeprecatedGetterSetter(u,e,n,l){T.error("Adding deprecated "+e);const r=Si+T._capitalize(e),o=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";u.prototype[r]=function(){T.error(o);const h=this.attrs[e];return h===void 0?n:h},C.addSetter(u,e,l,function(){T.error(o)}),C.addOverloadedGetterSetter(u,e)},backCompat(u,e){T.each(e,function(n,l){const r=u.prototype[l],o=Si+T._capitalize(n),h=_i+T._capitalize(n);function f(){r.apply(this,arguments),T.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}u.prototype[n]=f,u.prototype[o]=f,u.prototype[h]=f})},afterSetFilter(){this._filterUpToDate=!1}};function Yd(u){const e=/(\w+)\(([^)]+)\)/g;let n;for(;(n=e.exec(u))!==null;){const[,l,r]=n;switch(l){case"blur":{const o=parseFloat(r.replace("px",""));return function(h){this.blurRadius(o*.5);const f=V.Filters;f&&f.Blur&&f.Blur.call(this,h)}}case"brightness":{const o=r.includes("%")?parseFloat(r)/100:parseFloat(r);return function(h){this.brightness(o);const f=V.Filters;f&&f.Brightness&&f.Brightness.call(this,h)}}case"contrast":{const o=parseFloat(r);return function(h){const f=100*(Math.sqrt(o)-1);this.contrast(f);const g=V.Filters;g&&g.Contrast&&g.Contrast.call(this,h)}}case"grayscale":return function(o){const h=V.Filters;h&&h.Grayscale&&h.Grayscale.call(this,o)};case"sepia":return function(o){const h=V.Filters;h&&h.Sepia&&h.Sepia.call(this,o)};case"invert":return function(o){const h=V.Filters;h&&h.Invert&&h.Invert.call(this,o)};default:T.warn(`CSS filter "${l}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const Jl="absoluteOpacity",Ec="allEventListeners",na="absoluteTransform",bc="absoluteScale",ka="canvas",Xd="Change",qd="children",jd="konva",tu="listening",Vd="mouseenter",Kd="mouseleave",Qd="pointerenter",wd="pointerleave",Zd="touchenter",Jd="touchleave",Tc="set",xc="Shape",Pl=" ",Ac="stage",xa="transform",Pd="Stage",eu="visible",Fd=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Pl);let Wd=1;class j{constructor(e){this._id=Wd++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===xa||e===na)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let l=this._cache.get(e);return(l===void 0||(e===xa||e===na)&&l.dirty===!0)&&(l=n.call(this),this._cache.set(e,l)),l}_calculate(e,n,l){if(!this._attachedDepsListeners.get(e)){const r=n.map(o=>o+"Change.konva").join(Pl);this.on(r,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,l)}_getCanvasCache(){return this._cache.get(ka)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===na&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ka)){const{scene:e,filter:n,hit:l}=this._cache.get(ka);T.releaseCanvas(e._canvas,n._canvas,l._canvas),this._cache.delete(ka)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let l={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(l=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let r=Math.ceil(n.width||l.width),o=Math.ceil(n.height||l.height),h=n.pixelRatio,f=n.x===void 0?Math.floor(l.x):n.x,g=n.y===void 0?Math.floor(l.y):n.y,m=n.offset||0,v=n.drawBorder||!1,S=n.hitCanvasPixelRatio||1;if(!r||!o){T.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const y=Math.abs(Math.round(l.x)-f)>.5?1:0,E=Math.abs(Math.round(l.y)-g)>.5?1:0;r+=m*2+y,o+=m*2+E,f-=m,g-=m;const _=new Ma({pixelRatio:h,width:r,height:o}),N=new Ma({pixelRatio:h,width:0,height:0,willReadFrequently:!0}),A=new fu({pixelRatio:S,width:r,height:o}),O=_.getContext(),M=A.getContext(),H=new Ma({width:_.width/_.pixelRatio+Math.abs(f),height:_.height/_.pixelRatio+Math.abs(g),pixelRatio:_.pixelRatio}),G=H.getContext();return A.isCache=!0,_.isCache=!0,this._cache.delete(ka),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(_.getContext()._context.imageSmoothingEnabled=!1,N.getContext()._context.imageSmoothingEnabled=!1),O.save(),M.save(),G.save(),O.translate(-f,-g),M.translate(-f,-g),G.translate(-f,-g),H.x=f,H.y=g,this._isUnderCache=!0,this._clearSelfAndDescendantCache(Jl),this._clearSelfAndDescendantCache(bc),this.drawScene(_,this,H),this.drawHit(A,this),this._isUnderCache=!1,O.restore(),M.restore(),v&&(O.save(),O.beginPath(),O.rect(0,0,r,o),O.closePath(),O.setAttr("strokeStyle","red"),O.setAttr("lineWidth",5),O.stroke(),O.restore()),T.releaseCanvas(H._canvas),this._cache.set(ka,{scene:_,filter:N,hit:A,x:f,y:g}),this._requestDraw(),this}isCached(){return this._cache.has(ka)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const l=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let r=1/0,o=1/0,h=-1/0,f=-1/0;const g=this.getAbsoluteTransform(n);return l.forEach(function(m){const v=g.point(m);r===void 0&&(r=h=v.x,o=f=v.y),r=Math.min(r,v.x),o=Math.min(o,v.y),h=Math.max(h,v.x),f=Math.max(f,v.y)}),{x:r,y:o,width:h-r,height:f-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const l=this._getCachedSceneCanvas(),r=l.pixelRatio;e.drawImage(l._canvas,0,0,l.width/r,l.height/r),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),l=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(l._canvas,0,0,l.width/l.pixelRatio,l.height/l.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),l=n.scene,r=n.filter,o=r.getContext(),h,f,g,m;if(!e||e.length===0)return l;if(this._filterUpToDate)return r;let v=!0;for(let y=0;y<e.length;y++)if(typeof e[y]=="string"&&Cc(),typeof e[y]!="string"||!Cc()){v=!1;break}const S=l.pixelRatio;if(r.setSize(l.width/l.pixelRatio,l.height/l.pixelRatio),v){const y=e.join(" ");return o.save(),o.setAttr("filter",y),o.drawImage(l._canvas,0,0,l.getWidth()/S,l.getHeight()/S),o.restore(),this._filterUpToDate=!0,r}try{for(h=e.length,o.clear(),o.drawImage(l._canvas,0,0,l.getWidth()/S,l.getHeight()/S),f=o.getImageData(0,0,r.getWidth(),r.getHeight()),g=0;g<h;g++)m=e[g],typeof m=="string"&&(m=Yd(m)),m.call(this,f),o.putImageData(f,0,0)}catch(y){T.error("Unable to apply filter. "+y.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,r}on(...e){const n=e[0],l=e[1];if(e[2],this._cache&&this._cache.delete(Ec),e.length===3)return this._delegate.apply(this,e);const r=n.split(Pl);for(let o=0;o<r.length;o++){const f=r[o].split("."),g=f[0],m=f[1]||"";this.eventListeners[g]||(this.eventListeners[g]=[]),this.eventListeners[g].push({name:m,handler:l})}return this}off(e,n){let l=(e||"").split(Pl),r=l.length,o,h,f,g,m,v;if(this._cache&&this._cache.delete(Ec),!e)for(h in this.eventListeners)this._off(h);for(o=0;o<r;o++)if(f=l[o],g=f.split("."),m=g[0],v=g[1],m)this.eventListeners[m]&&this._off(m,v,n);else for(h in this.eventListeners)this._off(h,v,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(l){n.call(this,l.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,l){const r=this;return this.on(e,function(o){const h=o.target.findAncestors(n,!0,r);for(let f=0;f<h.length;f++)o=T.cloneObject(o),o.currentTarget=h[f],l.call(h[f],o)}),this}remove(){return this.isDragging()&&this.stopDrag(),mt._dragElements.delete(this._id),mt._dragElements.forEach((e,n)=>{this.isAncestorOf(e.node)&&mt._dragElements.delete(n)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(na),this._clearSelfAndDescendantCache(Jl),this._clearSelfAndDescendantCache(bc),this._clearSelfAndDescendantCache(Ac),this._clearSelfAndDescendantCache(eu),this._clearSelfAndDescendantCache(tu)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+T._capitalize(e);return T._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,l;if(!e)return this;for(n in e)n!==qd&&(l=Tc+T._capitalize(n),T._isFunction(this[l])?this[l](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(tu,this._isListening)}_isListening(e){if(!this.listening())return!1;const l=this.getParent();return l&&l!==e&&this!==e?l._isListening(e):!0}isVisible(){return this._getCache(eu,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const l=this.getParent();return l&&l!==e&&this!==e?l._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const l=this.getLayer();let r=!1;mt._dragElements.forEach(h=>{h.dragStatus==="dragging"&&(h.node.nodeType==="Stage"||h.node.getLayer()===l)&&(r=!0)});const o=!n&&!V.hitOnDragEnabled&&(r||V.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,l=0,r,o,h,f;function g(v){for(r=[],o=v.length,h=0;h<o;h++)f=v[h],l++,f.nodeType!==xc&&(r=r.concat(f.getChildren().slice())),f._id===n._id&&(h=o);r.length>0&&r[0].getDepth()<=e&&g(r)}const m=this.getStage();return n.nodeType!==Pd&&m&&g(m.getChildren()),l}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(xa),this._clearSelfAndDescendantCache(na)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const l=this.getAbsoluteTransform().copy();return l.invert(),l.point(n)}getAbsolutePosition(e){let n=!1,l=this.parent;for(;l;){if(l.isCached()){n=!0;break}l=l.parent}n&&!e&&(e=!0);const r=this.getAbsoluteTransform(e).getMatrix(),o=new _e,h=this.offset();return o.m=r.slice(),o.translate(h.x,h.y),o.getTranslation()}setAbsolutePosition(e){const{x:n,y:l,...r}=this._clearTransform();this.attrs.x=n,this.attrs.y=l,this._clearCache(xa);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(r),this.setPosition({x:e.x,y:e.y}),this._clearCache(xa),this._clearSelfAndDescendantCache(na),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let n=e.x,l=e.y,r=this.x(),o=this.y();return n!==void 0&&(r+=n),l!==void 0&&(o+=l),this.setPosition({x:r,y:o}),this}_eachAncestorReverse(e,n){let l=[],r=this.getParent(),o,h;if(!(n&&n._id===this._id)){for(l.unshift(this);r&&(!n||r._id!==n._id);)l.unshift(r),r=r.parent;for(o=l.length,h=0;h<o;h++)e(l[h])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return T.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return T.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return T.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return T.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return T.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&T.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Jl,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,l,r,o,h;const f={attrs:{},className:this.getClassName()};for(n in e)l=e[n],h=T.isObject(l)&&!T._isPlainObject(l)&&!T._isArray(l),!h&&(r=typeof this[n]=="function"&&this[n],delete e[n],o=r?r.call(this):null,e[n]=l,o!==l&&(f.attrs[n]=l));return T._prepareToStringify(f)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,l){const r=[];n&&this._isMatch(e)&&r.push(this);let o=this.parent;for(;o;){if(o===l)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}isAncestorOf(e){return!1}findAncestor(e,n,l){return this.findAncestors(e,n,l)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),l=n.length,r,o;for(r=0;r<l;r++)if(o=n[r],T.isValidSelector(o)||(T.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),T.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),T.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(Ac,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},l){return n.target=n.target||this,l?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(na,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new _e,this._eachAncestorReverse(function(l){const r=l.transformsEnabled();r==="all"?n.multiply(l.getTransform()):r==="position"&&n.translate(l.x()-l.offsetX(),l.y()-l.offsetY())},e),n;{n=this._cache.get(na)||new _e,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const l=this.transformsEnabled();if(l==="all")n.multiply(this.getTransform());else if(l==="position"){const r=this.attrs.x||0,o=this.attrs.y||0,h=this.attrs.offsetX||0,f=this.attrs.offsetY||0;n.translate(r-h,o-f)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const r=this.getAbsoluteTransform(e).decompose();return{x:r.scaleX,y:r.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(xa,this._getTransform)}_getTransform(){var e,n;const l=this._cache.get(xa)||new _e;l.reset();const r=this.x(),o=this.y(),h=V.getAngle(this.rotation()),f=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,g=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,m=this.attrs.skewX||0,v=this.attrs.skewY||0,S=this.attrs.offsetX||0,y=this.attrs.offsetY||0;return(r!==0||o!==0)&&l.translate(r,o),h!==0&&l.rotate(h),(m!==0||v!==0)&&l.skew(m,v),(f!==1||g!==1)&&l.scale(f,g),(S!==0||y!==0)&&l.translate(-1*S,-1*y),l.dirty=!1,l}clone(e){let n=T.cloneObject(this.attrs),l,r,o,h,f;for(l in e)n[l]=e[l];const g=new this.constructor(n);for(l in this.eventListeners)for(r=this.eventListeners[l],o=r.length,h=0;h<o;h++)f=r[h],f.name.indexOf(jd)<0&&(g.eventListeners[l]||(g.eventListeners[l]=[]),g.eventListeners[l].push(f));return g}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),l=this.getStage(),r=e.x!==void 0?e.x:Math.floor(n.x),o=e.y!==void 0?e.y:Math.floor(n.y),h=e.pixelRatio||1,f=new Ma({width:e.width||Math.ceil(n.width)||(l?l.width():0),height:e.height||Math.ceil(n.height)||(l?l.height():0),pixelRatio:h}),g=f.getContext(),m=new Ma({width:f.width/f.pixelRatio+Math.abs(r),height:f.height/f.pixelRatio+Math.abs(o),pixelRatio:f.pixelRatio});return e.imageSmoothingEnabled===!1&&(g._context.imageSmoothingEnabled=!1),g.save(),(r||o)&&g.translate(-1*r,-1*o),this.drawScene(f,void 0,m),g.restore(),f}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,l=e.quality||null,r=this._toKonvaCanvas(e).toDataURL(n,l);return e.callback&&e.callback(r),r}toImage(e){return new Promise((n,l)=>{try{const r=e?.callback;r&&delete e.callback,T._urlToImage(this.toDataURL(e),function(o){n(o),r?.(o)})}catch(r){l(r)}})}toBlob(e){return new Promise((n,l)=>{try{const r=e?.callback;r&&delete e.callback,this.toCanvas(e).toBlob(o=>{n(o),r?.(o)},e?.mimeType,e?.quality)}catch(r){l(r)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():V.dragDistance}_off(e,n,l){let r=this.eventListeners[e],o,h,f;for(o=0;o<r.length;o++)if(h=r[o].name,f=r[o].handler,(h!=="konva"||n==="konva")&&(!n||h===n)&&(!l||l===f)){if(r.splice(o,1),r.length===0){delete this.eventListeners[e];break}o--}}_fireChangeEvent(e,n,l){this._fire(e+Xd,{oldVal:n,newVal:l})}addName(e){if(!this.hasName(e)){const n=this.name(),l=n?n+" "+e:e;this.name(l)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),l=n.indexOf(e);return l!==-1&&(n.splice(l,1),this.name(n.join(" "))),this}setAttr(e,n){const l=this[Tc+T._capitalize(e)];return T._isFunction(l)?l.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(V.autoDrawEnabled){const e=this.getLayer()||this.getStage();e?.batchDraw()}}_setAttr(e,n){const l=this.attrs[e];l===n&&!T.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,l,n),this._requestDraw())}_setComponentAttr(e,n,l){let r;l!==void 0&&(r=this.attrs[e],r||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=l,this._fireChangeEvent(e,r,l))}_fireAndBubble(e,n,l){n&&this.nodeType===xc&&(n.target=this);const r=[Vd,Kd,Qd,wd,Zd,Jd];if(!(r.indexOf(e)!==-1&&(l&&(this===l||this.isAncestorOf&&this.isAncestorOf(l))||this.nodeType==="Stage"&&!l))){this._fire(e,n);const h=r.indexOf(e)!==-1&&l&&l.isAncestorOf&&l.isAncestorOf(this)&&!l.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!h&&(l&&l.parent?this._fireAndBubble.call(this.parent,e,n,l):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,l;const{nodeType:r}=this,o=j.protoListenerMap.get(r)||{};let h=o?.[e];if(h===void 0){h=[];let f=Object.getPrototypeOf(this);for(;f;){const g=(l=(n=f.eventListeners)===null||n===void 0?void 0:n[e])!==null&&l!==void 0?l:[];h.push(...g),f=Object.getPrototypeOf(f)}o[e]=h,j.protoListenerMap.set(r,o)}return h}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const l=this._getProtoListeners(e);if(l){const o=l.slice();for(let h=0;h<o.length;h++)o[h].handler.call(this,n)}const r=this.eventListeners[e];if(r){const o=r.slice(),h=o.length;for(let g=0;g<o.length;g++)o[g].handler.call(this,n);const f=this.eventListeners[e];if(f)for(let g=h;g<f.length;g++)f[g].handler.call(this,n)}}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,l=this.getStage(),r=this.getAbsolutePosition();if(!l)return;const o=l._getPointerById(n)||l._changedPointerPositions[0]||r;mt._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-r.x,y:o.y-r.y},dragStatus:"ready",pointerId:n,startEvent:e})}startDrag(e,n=!0){mt._dragElements.has(this._id)||this._createDragElement(e);const l=mt._dragElements.get(this._id);l.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:l.startEvent&&l.startEvent.evt||e&&e.evt},n)}_setDragPosition(e,n){const l=this.getStage()._getPointerById(n.pointerId);if(!l)return;let r={x:l.x-n.offset.x,y:l.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const h=o.call(this,r,e);h?r=h:T.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==r.x||this._lastPos.y!==r.y)&&(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}stopDrag(e){const n=mt._dragElements.get(this._id);n&&(n.dragStatus="stopped"),mt._endDragBefore(e),mt._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=mt._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||V.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let r=!1;mt._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(r=!0)}),r||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=mt._dragElements.get(this._id),l=n&&n.dragStatus==="dragging",r=n&&n.dragStatus==="ready";l?this.stopDrag():r&&mt._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const l={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return T.haveIntersection(l,this.getClientRect())}static create(e,n){return T._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let l=j.prototype.getClassName.call(e),r=e.children,o,h,f;n&&(e.attrs.container=n),V[l]||(T.warn('Can not find a node with class name "'+l+'". Fallback to "Shape".'),l="Shape");const g=V[l];if(o=new g(e.attrs),r)for(h=r.length,f=0;f<h;f++)o.add(j._createNode(r[f]));return o}}j.protoListenerMap=new Map;j.prototype.nodeType="Node";j.prototype._attrsAffectingSize=[];j.prototype.eventListeners={};j.prototype.on(Fd,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(xa),this._clearSelfAndDescendantCache(na)});j.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(eu)});j.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(tu)});j.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(Jl)});const At=C.addGetterSetter;At(j,"zIndex");At(j,"absolutePosition");At(j,"position");At(j,"x",0,q());At(j,"y",0,q());At(j,"globalCompositeOperation","source-over",tn());At(j,"opacity",1,q());At(j,"name","",tn());At(j,"id","",tn());At(j,"rotation",0,q());C.addComponentsGetterSetter(j,"scale",["x","y"]);At(j,"scaleX",1,q());At(j,"scaleY",1,q());C.addComponentsGetterSetter(j,"skew",["x","y"]);At(j,"skewX",0,q());At(j,"skewY",0,q());C.addComponentsGetterSetter(j,"offset",["x","y"]);At(j,"offsetX",0,q());At(j,"offsetY",0,q());At(j,"dragDistance",void 0,q());At(j,"width",0,q());At(j,"height",0,q());At(j,"listening",!0,Be());At(j,"preventDefault",!0,Be());At(j,"filters",void 0,function(u){return this._filterUpToDate=!1,u});At(j,"visible",!0,Be());At(j,"transformsEnabled","all",tn());At(j,"size");At(j,"dragBoundFunc");At(j,"draggable",!1,Be());C.backCompat(j,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class Ce extends j{constructor(){super(...arguments),this.children=[]}getChildren(e){const n=this.children||[];return e?n.filter(e):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let l=0;l<e.length;l++)this.add(e[l]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const l=[];return this._descendants(r=>{const o=r._isMatch(e);return o&&l.push(r),!!(o&&n)}),l}_descendants(e){let n=!1;const l=this.getChildren();for(const r of l){if(n=e(r),n)return!0;if(r.hasChildren()&&(n=r._descendants(e),n))return!0}return!1}toObject(){const e=j.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=j.prototype.clone.call(this,e);return this.getChildren().forEach(function(l){n.add(l.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(l=>{l.isVisible()&&l.intersects(e)&&n.push(l)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(l){l._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,l){n.index=l}),this._requestDraw()}drawScene(e,n,l){const r=this.getLayer(),o=e||r&&r.getCanvas(),h=o&&o.getContext(),f=this._getCanvasCache(),g=f&&f.scene,m=o&&o.isCache;if(!this.isVisible()&&!m)return this;if(g){h.save();const v=this.getAbsoluteTransform(n).getMatrix();h.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedSceneCanvas(h),h.restore()}else this._drawChildren("drawScene",o,n,l);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const l=this.getLayer(),r=e||l&&l.hitCanvas,o=r&&r.getContext(),h=this._getCanvasCache();if(h&&h.hit){o.save();const g=this.getAbsoluteTransform(n).getMatrix();o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,n);return this}_drawChildren(e,n,l,r){var o;const h=n&&n.getContext(),f=this.clipWidth(),g=this.clipHeight(),m=this.clipFunc(),v=typeof f=="number"&&typeof g=="number"||m,S=l===this;if(v){h.save();const E=this.getAbsoluteTransform(l);let _=E.getMatrix();h.transform(_[0],_[1],_[2],_[3],_[4],_[5]),h.beginPath();let N;if(m)N=m.call(this,h,this);else{const A=this.clipX(),O=this.clipY();h.rect(A||0,O||0,f,g)}h.clip.apply(h,N),_=E.copy().invert().getMatrix(),h.transform(_[0],_[1],_[2],_[3],_[4],_[5])}const y=!S&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";y&&(h.save(),h._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(E){E[e](n,l,r)}),y&&h.restore(),v&&h.restore()}getClientRect(e={}){var n;const l=e.skipTransform,r=e.relativeTo;let o,h,f,g,m={x:1/0,y:1/0,width:0,height:0};const v=this;(n=this.children)===null||n===void 0||n.forEach(function(E){if(!E.visible())return;const _=E.getClientRect({relativeTo:v,skipShadow:e.skipShadow,skipStroke:e.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,h=_.y,f=_.x+_.width,g=_.y+_.height):(o=Math.min(o,_.x),h=Math.min(h,_.y),f=Math.max(f,_.x+_.width),g=Math.max(g,_.y+_.height)))});const S=this.find("Shape");let y=!1;for(let E=0;E<S.length;E++)if(S[E]._isVisible(this)){y=!0;break}return y&&o!==void 0?m={x:o,y:h,width:f-o,height:g-h}:m={x:0,y:0,width:0,height:0},l?m:this._transformedRect(m,r)}}C.addComponentsGetterSetter(Ce,"clip",["x","y","width","height"]);C.addGetterSetter(Ce,"clipX",void 0,q());C.addGetterSetter(Ce,"clipY",void 0,q());C.addGetterSetter(Ce,"clipWidth",void 0,q());C.addGetterSetter(Ce,"clipHeight",void 0,q());C.addGetterSetter(Ce,"clipFunc");const Hi=new Map,t0=V._global.PointerEvent!==void 0;function Vr(u){return Hi.get(u)}function gu(u){return{evt:u,pointerId:u.pointerId}}function e0(u,e){return Hi.get(u)===e}function a0(u,e){Ni(u),e.getStage()&&(Hi.set(u,e),t0&&e._fire("gotpointercapture",gu(new PointerEvent("gotpointercapture"))))}function Ni(u,e){const n=Hi.get(u);if(!n)return;const l=n.getStage();l&&l.content,Hi.delete(u),t0&&n._fire("lostpointercapture",gu(new PointerEvent("lostpointercapture")))}const kd="Stage",Id="string",Mc="px",$d="mouseout",n0="mouseleave",i0="mouseover",l0="mouseenter",s0="mousemove",r0="mousedown",u0="mouseup",Ti="pointermove",xi="pointerdown",Ln="pointerup",Ai="pointercancel",t2="lostpointercapture",ql="pointerout",Mi="pointerleave",jl="pointerover",Vl="pointerenter",au="contextmenu",o0="touchstart",h0="touchend",c0="touchmove",f0="touchcancel",nu="wheel",e2=5,a2=[[l0,"_pointerenter"],[r0,"_pointerdown"],[s0,"_pointermove"],[u0,"_pointerup"],[n0,"_pointerleave"],[o0,"_pointerdown"],[c0,"_pointermove"],[h0,"_pointerup"],[f0,"_pointercancel"],[i0,"_pointerover"],[nu,"_wheel"],[au,"_contextmenu"],[xi,"_pointerdown"],[Ti,"_pointermove"],[Ln,"_pointerup"],[Ai,"_pointercancel"],[Mi,"_pointerleave"],[t2,"_lostpointercapture"]],Kr={mouse:{[ql]:$d,[Mi]:n0,[jl]:i0,[Vl]:l0,[Ti]:s0,[xi]:r0,[Ln]:u0,[Ai]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[ql]:"touchout",[Mi]:"touchleave",[jl]:"touchover",[Vl]:"touchenter",[Ti]:c0,[xi]:o0,[Ln]:h0,[Ai]:f0,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[ql]:ql,[Mi]:Mi,[jl]:jl,[Vl]:Vl,[Ti]:Ti,[xi]:xi,[Ln]:Ln,[Ai]:Ai,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Ri=u=>u.indexOf("pointer")>=0?"pointer":u.indexOf("touch")>=0?"touch":"mouse",Bn=u=>{const e=Ri(u);if(e==="pointer")return V.pointerEventsEnabled&&Kr.pointer;if(e==="touch")return Kr.touch;if(e==="mouse")return Kr.mouse};function Rc(u={}){return(u.clipFunc||u.clipWidth||u.clipHeight)&&T.warn("Stage does not support clipping. Please use clip for Layers or Groups."),u}const n2="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",Oi=[];let Il=class extends Ce{constructor(e){super(Rc(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Oi.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Rc(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",l=e.getType()==="FastLayer";n||l||T.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===Id){let n;if(e.charAt(0)==="."){const l=e.slice(1);e=document.getElementsByClassName(l)[0]}else e.charAt(0)!=="#"?n=e:n=e.slice(1),e=document.getElementById(n);if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,n=e.length;for(let l=0;l<n;l++)e[l].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),Ce.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&T._isInDocument(e)&&this.container().removeChild(e);const n=Oi.indexOf(this);return n>-1&&Oi.splice(n,1),T.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(T.warn(n2),null)}_getPointerById(e){return this._pointerPositions.find(n=>n.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const n=new Ma({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),l=n.getContext()._context,r=this.children;return(e.x||e.y)&&l.translate(-1*e.x,-1*e.y),r.forEach(function(o){if(!o.isVisible())return;const h=o._toKonvaCanvas(e);l.drawImage(h._canvas,e.x,e.y,h.getWidth()/h.getPixelRatio(),h.getHeight()/h.getPixelRatio())}),n}getIntersection(e){if(!e)return null;const n=this.children,l=n.length,r=l-1;for(let o=r;o>=0;o--){const h=n[o].getIntersection(e);if(h)return h}return null}_resizeDOM(){const e=this.width(),n=this.height();this.content&&(this.content.style.width=e+Mc,this.content.style.height=n+Mc),this.bufferCanvas.setSize(e,n),this.bufferHitCanvas.setSize(e,n),this.children.forEach(l=>{l.setSize({width:e,height:n}),l.draw()})}add(e,...n){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.add(arguments[r]);return this}super.add(e);const l=this.children.length;return l>e2&&T.warn("The stage has "+l+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),V.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return e0(e,this)}setPointerCapture(e){a0(e,this)}releaseCapture(e){Ni(e)}getLayers(){return this.children}_bindContentEvents(){V.isBrowser&&a2.forEach(([e,n])=>{this.content.addEventListener(e,l=>{this[n](l)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=Bn(e.type);n&&this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=Bn(e.type);n&&this._fire(n.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let n=this[e+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(e){const n=Bn(e.type),l=Ri(e.type);if(!n)return;this.setPointersPositions(e);const r=this._getTargetShape(l),o=!(V.isDragging()||V.isTransforming())||V.hitOnDragEnabled;r&&o?(r._fireAndBubble(n.pointerout,{evt:e}),r._fireAndBubble(n.pointerleave,{evt:e}),this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this[l+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const n=Bn(e.type),l=Ri(e.type);if(!n)return;this.setPointersPositions(e);let r=!1;this._changedPointerPositions.forEach(o=>{const h=this.getIntersection(o);if(mt.justDragged=!1,V["_"+l+"ListenClick"]=!0,!h||!h.isListening()){this[l+"ClickStartShape"]=void 0;return}V.capturePointerEventsEnabled&&h.setPointerCapture(o.id),this[l+"ClickStartShape"]=h,h._fireAndBubble(n.pointerdown,{evt:e,pointerId:o.id}),r=!0;const f=e.type.indexOf("touch")>=0;h.preventDefault()&&e.cancelable&&f&&e.preventDefault()}),r||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const n=Bn(e.type),l=Ri(e.type);if(!n)return;const r=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(V.isDragging()&&mt.node.preventDefault()&&e.cancelable&&r&&e.preventDefault(),this.setPointersPositions(e),!(!(V.isDragging()||V.isTransforming())||V.hitOnDragEnabled))return;const h={};let f=!1;const g=this._getTargetShape(l);this._changedPointerPositions.forEach(m=>{const v=Vr(m.id)||this.getIntersection(m),S=m.id,y={evt:e,pointerId:S},E=g!==v;if(E&&g&&(g._fireAndBubble(n.pointerout,{...y},v),g._fireAndBubble(n.pointerleave,{...y},v)),v){if(h[v._id])return;h[v._id]=!0}v&&v.isListening()?(f=!0,E&&(v._fireAndBubble(n.pointerover,{...y},g),v._fireAndBubble(n.pointerenter,{...y},g),this[l+"targetShape"]=v),v._fireAndBubble(n.pointermove,{...y})):g&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:S}),this[l+"targetShape"]=null)}),f||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=Bn(e.type),l=Ri(e.type);if(!n)return;this.setPointersPositions(e);const r=this[l+"ClickStartShape"],o=this[l+"ClickEndShape"],h={};let f=!1;this._changedPointerPositions.forEach(g=>{const m=Vr(g.id)||this.getIntersection(g);if(m){if(m.releaseCapture(g.id),h[m._id])return;h[m._id]=!0}const v=g.id,S={evt:e,pointerId:v};let y=!1;V["_"+l+"InDblClickWindow"]?(y=!0,clearTimeout(this[l+"DblTimeout"])):mt.justDragged||(V["_"+l+"InDblClickWindow"]=!0,clearTimeout(this[l+"DblTimeout"])),this[l+"DblTimeout"]=setTimeout(function(){V["_"+l+"InDblClickWindow"]=!1},V.dblClickWindow),m&&m.isListening()?(f=!0,this[l+"ClickEndShape"]=m,m._fireAndBubble(n.pointerup,{...S}),V["_"+l+"ListenClick"]&&r&&r===m&&(m._fireAndBubble(n.pointerclick,{...S}),y&&o&&o===m&&m._fireAndBubble(n.pointerdblclick,{...S}))):(this[l+"ClickEndShape"]=null,f||(this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),f=!0),V["_"+l+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:v}),y&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:v}))}),f||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),V["_"+l+"ListenClick"]=!1,e.cancelable&&l!=="touch"&&l!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(au,{evt:e}):this._fire(au,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(nu,{evt:e}):this._fire(nu,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=Vr(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(Ln,gu(e)),Ni(e.pointerId)}_lostpointercapture(e){Ni(e.pointerId)}setPointersPositions(e){const n=this._getContentPosition();let l=null,r=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(l=(e.clientX-n.left)/n.scaleX,r=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:l,y:r},this._pointerPositions=[{x:l,y:r,id:T._getFirstPointerId(e)}],this._changedPointerPositions=[{x:l,y:r,id:T._getFirstPointerId(e)}])}_setPointerPosition(e){T.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Ma({width:this.width(),height:this.height()}),this.bufferHitCanvas=new fu({pixelRatio:1,width:this.width(),height:this.height()}),!V.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}cache(){return T.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};Il.prototype.nodeType=kd;Bt(Il);C.addGetterSetter(Il,"container");V.isBrowser&&document.addEventListener("visibilitychange",()=>{Oi.forEach(u=>{u.batchDraw()})});const d0="hasShadow",g0="shadowRGBA",m0="patternImage",p0="linearGradient",v0="radialGradient";let Kl;function Qr(){return Kl||(Kl=T.createCanvasElement().getContext("2d"),Kl)}const zi={};function i2(u){const e=this.attrs.fillRule;e?u.fill(e):u.fill()}function l2(u){u.stroke()}function s2(u){const e=this.attrs.fillRule;e?u.fill(e):u.fill()}function r2(u){u.stroke()}function u2(){this._clearCache(d0)}function o2(){this._clearCache(g0)}function h2(){this._clearCache(m0)}function c2(){this._clearCache(p0)}function f2(){this._clearCache(v0)}class U extends j{constructor(e){super(e);let n,l=0;for(;n=T.getHitColor(),!(n&&!(n in zi));)if(l++,l>=1e4){T.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),n=T.getRandomColor();break}this.colorKey=n,zi[n]=this}getContext(){return T.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return T.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(d0,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(m0,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Qr().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const l=new _e;l.translate(this.fillPatternX(),this.fillPatternY()),l.rotate(V.getAngle(this.fillPatternRotation())),l.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),l.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const r=l.getMatrix(),o=typeof DOMMatrix>"u"?{a:r[0],b:r[1],c:r[2],d:r[3],e:r[4],f:r[5]}:new DOMMatrix(r);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(p0,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const n=Qr(),l=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(l.x,l.y,r.x,r.y);for(let h=0;h<e.length;h+=2)o.addColorStop(e[h],e[h+1]);return o}}_getRadialGradient(){return this._getCache(v0,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const n=Qr(),l=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),o=n.createRadialGradient(l.x,l.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius());for(let h=0;h<e.length;h+=2)o.addColorStop(e[h],e[h+1]);return o}}getShadowRGBA(){return this._getCache(g0,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=T.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const n=this.getStage();if(!n)return!1;const l=n.bufferHitCanvas;return l.getContext().clear(),this.drawHit(l,void 0,!0),l.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return j.prototype.destroy.call(this),delete zi[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var n;if(!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const r=e||this.hasFill(),o=this.hasStroke(),h=this.getAbsoluteOpacity()!==1;if(r&&o&&h)return!0;const f=this.hasShadow(),g=this.shadowForStrokeEnabled();return!!(r&&o&&f&&g)}setStrokeHitEnabled(e){T.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let n=!1,l=this.getParent();for(;l;){if(l.isCached()){n=!0;break}l=l.getParent()}const r=e.skipTransform,o=e.relativeTo||n&&this.getStage()||void 0,h=this.getSelfRect(),g=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,m=h.width+g,v=h.height+g,S=!e.skipShadow&&this.hasShadow(),y=S?this.shadowOffsetX():0,E=S?this.shadowOffsetY():0,_=m+Math.abs(y),N=v+Math.abs(E),A=S&&this.shadowBlur()||0,O=_+A*2,M=N+A*2,H={width:O,height:M,x:-(g/2+A)+Math.min(y,0)+h.x,y:-(g/2+A)+Math.min(E,0)+h.y};return r?H:this._transformedRect(H,o)}drawScene(e,n,l){const r=this.getLayer(),o=e||r.getCanvas(),h=o.getContext(),f=this._getCanvasCache(),g=this.getSceneFunc(),m=this.hasShadow();let v;const S=n===this;if(!this.isVisible()&&!S)return this;if(f){h.save();const y=this.getAbsoluteTransform(n).getMatrix();return h.transform(y[0],y[1],y[2],y[3],y[4],y[5]),this._drawCachedSceneCanvas(h),h.restore(),this}if(!g)return this;if(h.save(),this._useBufferCanvas()){v=this.getStage();const y=l||v.bufferCanvas,E=y.getContext();l?(E.save(),E.setTransform(1,0,0,1,0,0),E.clearRect(0,0,y.width,y.height),E.restore()):E.clear(),E.save(),E._applyLineJoin(this),E._applyMiterLimit(this);const _=this.getAbsoluteTransform(n).getMatrix();E.transform(_[0],_[1],_[2],_[3],_[4],_[5]),g.call(this,E,this),E.restore();const N=y.pixelRatio;m&&h._applyShadow(this),S||(h._applyOpacity(this),h._applyGlobalCompositeOperation(this)),h.drawImage(y._canvas,y.x||0,y.y||0,y.width/N,y.height/N)}else{if(h._applyLineJoin(this),h._applyMiterLimit(this),!S){const y=this.getAbsoluteTransform(n).getMatrix();h.transform(y[0],y[1],y[2],y[3],y[4],y[5]),h._applyOpacity(this),h._applyGlobalCompositeOperation(this)}m&&h._applyShadow(this),g.call(this,h,this)}return h.restore(),this}drawHit(e,n,l=!1){if(!this.shouldDrawHit(n,l))return this;const r=this.getLayer(),o=e||r.hitCanvas,h=o&&o.getContext(),f=this.hitFunc()||this.sceneFunc(),g=this._getCanvasCache(),m=g&&g.hit;if(this.colorKey||T.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),m){h.save();const S=this.getAbsoluteTransform(n).getMatrix();return h.transform(S[0],S[1],S[2],S[3],S[4],S[5]),this._drawCachedHitCanvas(h),h.restore(),this}if(!f)return this;if(h.save(),h._applyLineJoin(this),h._applyMiterLimit(this),!(this===n)){const S=this.getAbsoluteTransform(n).getMatrix();h.transform(S[0],S[1],S[2],S[3],S[4],S[5])}return f.call(this,h,this),h.restore(),this}drawHitFromCache(e=0){const n=this._getCanvasCache(),l=this._getCachedSceneCanvas(),r=n.hit,o=r.getContext(),h=r.getWidth(),f=r.getHeight();o.clear(),o.drawImage(l._canvas,0,0,h,f);try{const g=o.getImageData(0,0,h,f),m=g.data,v=m.length,S=T._hexToRgb(this.colorKey);for(let y=0;y<v;y+=4)m[y+3]>e?(m[y]=S.r,m[y+1]=S.g,m[y+2]=S.b,m[y+3]=255):m[y+3]=0;o.putImageData(g,0,0)}catch(g){T.error("Unable to draw hit graph from cached scene canvas. "+g.message)}return this}hasPointerCapture(e){return e0(e,this)}setPointerCapture(e){a0(e,this)}releaseCapture(e){Ni(e)}}U.prototype._fillFunc=i2;U.prototype._strokeFunc=l2;U.prototype._fillFuncHit=s2;U.prototype._strokeFuncHit=r2;U.prototype._centroid=!1;U.prototype.nodeType="Shape";Bt(U);U.prototype.eventListeners={};U.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",u2);U.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",o2);U.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",h2);U.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",c2);U.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",f2);C.addGetterSetter(U,"stroke",void 0,$c());C.addGetterSetter(U,"strokeWidth",2,q());C.addGetterSetter(U,"fillAfterStrokeEnabled",!1);C.addGetterSetter(U,"hitStrokeWidth","auto",du());C.addGetterSetter(U,"strokeHitEnabled",!0,Be());C.addGetterSetter(U,"perfectDrawEnabled",!0,Be());C.addGetterSetter(U,"shadowForStrokeEnabled",!0,Be());C.addGetterSetter(U,"lineJoin");C.addGetterSetter(U,"lineCap");C.addGetterSetter(U,"miterLimit");C.addGetterSetter(U,"sceneFunc");C.addGetterSetter(U,"hitFunc");C.addGetterSetter(U,"dash");C.addGetterSetter(U,"dashOffset",0,q());C.addGetterSetter(U,"shadowColor",void 0,tn());C.addGetterSetter(U,"shadowBlur",0,q());C.addGetterSetter(U,"shadowOpacity",1,q());C.addComponentsGetterSetter(U,"shadowOffset",["x","y"]);C.addGetterSetter(U,"shadowOffsetX",0,q());C.addGetterSetter(U,"shadowOffsetY",0,q());C.addGetterSetter(U,"fillPatternImage");C.addGetterSetter(U,"fill",void 0,$c());C.addGetterSetter(U,"fillPatternX",0,q());C.addGetterSetter(U,"fillPatternY",0,q());C.addGetterSetter(U,"fillLinearGradientColorStops");C.addGetterSetter(U,"strokeLinearGradientColorStops");C.addGetterSetter(U,"fillRadialGradientStartRadius",0);C.addGetterSetter(U,"fillRadialGradientEndRadius",0);C.addGetterSetter(U,"fillRadialGradientColorStops");C.addGetterSetter(U,"fillPatternRepeat","repeat");C.addGetterSetter(U,"fillEnabled",!0);C.addGetterSetter(U,"strokeEnabled",!0);C.addGetterSetter(U,"shadowEnabled",!0);C.addGetterSetter(U,"dashEnabled",!0);C.addGetterSetter(U,"strokeScaleEnabled",!0);C.addGetterSetter(U,"fillPriority","color");C.addComponentsGetterSetter(U,"fillPatternOffset",["x","y"]);C.addGetterSetter(U,"fillPatternOffsetX",0,q());C.addGetterSetter(U,"fillPatternOffsetY",0,q());C.addComponentsGetterSetter(U,"fillPatternScale",["x","y"]);C.addGetterSetter(U,"fillPatternScaleX",1,q());C.addGetterSetter(U,"fillPatternScaleY",1,q());C.addComponentsGetterSetter(U,"fillLinearGradientStartPoint",["x","y"]);C.addComponentsGetterSetter(U,"strokeLinearGradientStartPoint",["x","y"]);C.addGetterSetter(U,"fillLinearGradientStartPointX",0);C.addGetterSetter(U,"strokeLinearGradientStartPointX",0);C.addGetterSetter(U,"fillLinearGradientStartPointY",0);C.addGetterSetter(U,"strokeLinearGradientStartPointY",0);C.addComponentsGetterSetter(U,"fillLinearGradientEndPoint",["x","y"]);C.addComponentsGetterSetter(U,"strokeLinearGradientEndPoint",["x","y"]);C.addGetterSetter(U,"fillLinearGradientEndPointX",0);C.addGetterSetter(U,"strokeLinearGradientEndPointX",0);C.addGetterSetter(U,"fillLinearGradientEndPointY",0);C.addGetterSetter(U,"strokeLinearGradientEndPointY",0);C.addComponentsGetterSetter(U,"fillRadialGradientStartPoint",["x","y"]);C.addGetterSetter(U,"fillRadialGradientStartPointX",0);C.addGetterSetter(U,"fillRadialGradientStartPointY",0);C.addComponentsGetterSetter(U,"fillRadialGradientEndPoint",["x","y"]);C.addGetterSetter(U,"fillRadialGradientEndPointX",0);C.addGetterSetter(U,"fillRadialGradientEndPointY",0);C.addGetterSetter(U,"fillPatternRotation",0);C.addGetterSetter(U,"fillRule",void 0,tn());C.backCompat(U,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const d2="beforeDraw",g2="draw",y0=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],m2=y0.length;let en=class extends Ce{constructor(e){super(e),this.canvas=new Ma,this.hitCanvas=new fu({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){j.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!j.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(j.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(j.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return j.prototype.remove.call(this),e&&e.parentNode&&T._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&T.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),j.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){T.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){T.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,T.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,l=!1;for(;;){for(let r=0;r<m2;r++){const o=y0[r],h=this._getIntersection({x:e.x+o.x*n,y:e.y+o.y*n}),f=h.shape;if(f)return f;if(l=!!h.antialiased,!h.antialiased)break}if(l)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,l=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,r=l[3];if(r===255){const o=T.getHitColorKey(l[0],l[1],l[2]),h=zi[o];return h?{shape:h}:{antialiased:!0}}else if(r>0)return{antialiased:!0};return{}}drawScene(e,n,l){const r=this.getLayer(),o=e||r&&r.getCanvas();return this._fire(d2,{node:this}),this.clearBeforeDraw()&&o.getContext().clear(),Ce.prototype.drawScene.call(this,o,n,l),this._fire(g2,{node:this}),this}drawHit(e,n){const l=this.getLayer(),r=e||l&&l.hitCanvas;return l&&l.clearBeforeDraw()&&l.getHitCanvas().getContext().clear(),Ce.prototype.drawHit.call(this,r,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){T.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return T.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return T.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};en.prototype.nodeType="Layer";Bt(en);C.addGetterSetter(en,"imageSmoothingEnabled",!0);C.addGetterSetter(en,"clearBeforeDraw",!0);C.addGetterSetter(en,"hitGraphEnabled",!0,Be());class mu extends en{constructor(e){super(e),this.listening(!1),T.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}mu.prototype.nodeType="FastLayer";Bt(mu);let Yn=class extends Ce{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&T.throw("You may only add groups and shapes to groups.")}};Yn.prototype.nodeType="Group";Bt(Yn);const wr=(function(){return $a.performance&&$a.performance.now?function(){return $a.performance.now()}:function(){return new Date().getTime()}})();class Re{constructor(e,n){this.id=Re.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:wr(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,l=n.length;for(let r=0;r<l;r++)if(n[r]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=Re.animations,l=n.length;for(let r=0;r<l;r++)if(n[r].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=wr(),Re._addAnimation(this),this}stop(){return Re._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,l=this.animations,r=l.length;for(let o=0;o<r;o++)if(l[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const e={},n=this.animations;for(let l=0;l<n.length;l++){const r=n[l],o=r.layers,h=r.func;r._updateFrameObject(wr());const f=o.length;let g;if(h?g=h.call(r,r.frame)!==!1:g=!0,!!g)for(let m=0;m<f;m++){const v=o[m];v._id!==void 0&&(e[v._id]=v)}}for(const l in e)e.hasOwnProperty(l)&&e[l].batchDraw()}static _animationLoop(){const e=Re;e.animations.length?(e._runFrames(),T.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,T.requestAnimFrame(this._animationLoop))}}Re.animations=[];Re.animIdCounter=0;Re.animRunning=!1;const p2={node:1,duration:1,easing:1,onFinish:1,yoyo:1},v2=1,Nc=2,Oc=3,zc=["fill","stroke","shadowColor"];let y2=0;class S2{constructor(e,n,l,r,o,h,f){this.prop=e,this.propFunc=n,this.begin=r,this._pos=r,this.duration=h,this._change=0,this.prevPos=0,this.yoyo=f,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=l,this._change=o-this.begin,this.pause()}fire(e){const n=this[e];n&&n()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=Nc,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=Oc,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const e=this.getTimer()-this._startTime;this.state===Nc?this.setTime(e):this.state===Oc&&this.setTime(this.duration-e)}pause(){this.state=v2,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Mt{constructor(e){const n=this,l=e.node,r=l._id,o=e.easing||Di.Linear,h=!!e.yoyo;let f,g;typeof e.duration>"u"?f=.3:e.duration===0?f=.001:f=e.duration,this.node=l,this._id=y2++;const m=l.getLayer()||(l instanceof V.Stage?l.getLayers():null);m||T.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Re(function(){n.tween.onEnterFrame()},m),this.tween=new S2(g,function(v){n._tweenFunc(v)},o,0,1,f*1e3,h),this._addListeners(),Mt.attrs[r]||(Mt.attrs[r]={}),Mt.attrs[r][this._id]||(Mt.attrs[r][this._id]={}),Mt.tweens[r]||(Mt.tweens[r]={});for(g in e)p2[g]===void 0&&this._addAttr(g,e[g]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,n){const l=this.node,r=l._id;let o,h,f,g,m;const v=Mt.tweens[r][e];v&&delete Mt.attrs[r][v][e];let S=l.getAttr(e);if(T._isArray(n))if(o=[],h=Math.max(n.length,S.length),e==="points"&&n.length!==S.length&&(n.length>S.length?(g=S,S=T._prepareArrayForTween(S,n,l.closed())):(f=n,n=T._prepareArrayForTween(n,S,l.closed()))),e.indexOf("fill")===0)for(let y=0;y<h;y++)if(y%2===0)o.push(n[y]-S[y]);else{const E=T.colorToRGBA(S[y]);m=T.colorToRGBA(n[y]),S[y]=E,o.push({r:m.r-E.r,g:m.g-E.g,b:m.b-E.b,a:m.a-E.a})}else for(let y=0;y<h;y++)o.push(n[y]-S[y]);else zc.indexOf(e)!==-1?(S=T.colorToRGBA(S),m=T.colorToRGBA(n),o={r:m.r-S.r,g:m.g-S.g,b:m.b-S.b,a:m.a-S.a}):o=n-S;Mt.attrs[r][this._id][e]={start:S,diff:o,end:n,trueEnd:f,trueStart:g},Mt.tweens[r][e]=this._id}_tweenFunc(e){const n=this.node,l=Mt.attrs[n._id][this._id];let r,o,h,f,g,m,v,S;for(r in l){if(o=l[r],h=o.start,f=o.diff,S=o.end,T._isArray(h))if(g=[],v=Math.max(h.length,S.length),r.indexOf("fill")===0)for(m=0;m<v;m++)m%2===0?g.push((h[m]||0)+f[m]*e):g.push("rgba("+Math.round(h[m].r+f[m].r*e)+","+Math.round(h[m].g+f[m].g*e)+","+Math.round(h[m].b+f[m].b*e)+","+(h[m].a+f[m].a*e)+")");else for(m=0;m<v;m++)g.push((h[m]||0)+f[m]*e);else zc.indexOf(r)!==-1?g="rgba("+Math.round(h.r+f.r*e)+","+Math.round(h.g+f.g*e)+","+Math.round(h.b+f.b*e)+","+(h.a+f.a*e)+")":g=h+f*e;n.setAttr(r,g)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,n=Mt.attrs[e._id][this._id];n.points&&n.points.trueEnd&&e.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,n=Mt.attrs[e._id][this._id];n.points&&n.points.trueStart&&e.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,n=this._id,l=Mt.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const r in l)delete Mt.tweens[e][r];delete Mt.attrs[e][n],Mt.tweens[e]&&(Object.keys(Mt.tweens[e]).length===0&&delete Mt.tweens[e],Object.keys(Mt.attrs[e]).length===0&&delete Mt.attrs[e])}}Mt.attrs={};Mt.tweens={};j.prototype.to=function(u){const e=u.onFinish;u.node=this,u.onFinish=function(){this.destroy(),e&&e()},new Mt(u).play()};const Di={BackEaseIn(u,e,n,l){return n*(u/=l)*u*((1.70158+1)*u-1.70158)+e},BackEaseOut(u,e,n,l){return n*((u=u/l-1)*u*((1.70158+1)*u+1.70158)+1)+e},BackEaseInOut(u,e,n,l){let r=1.70158;return(u/=l/2)<1?n/2*(u*u*(((r*=1.525)+1)*u-r))+e:n/2*((u-=2)*u*(((r*=1.525)+1)*u+r)+2)+e},ElasticEaseIn(u,e,n,l,r,o){let h=0;return u===0?e:(u/=l)===1?e+n:(o||(o=l*.3),!r||r<Math.abs(n)?(r=n,h=o/4):h=o/(2*Math.PI)*Math.asin(n/r),-(r*Math.pow(2,10*(u-=1))*Math.sin((u*l-h)*(2*Math.PI)/o))+e)},ElasticEaseOut(u,e,n,l,r,o){let h=0;return u===0?e:(u/=l)===1?e+n:(o||(o=l*.3),!r||r<Math.abs(n)?(r=n,h=o/4):h=o/(2*Math.PI)*Math.asin(n/r),r*Math.pow(2,-10*u)*Math.sin((u*l-h)*(2*Math.PI)/o)+n+e)},ElasticEaseInOut(u,e,n,l,r,o){let h=0;return u===0?e:(u/=l/2)===2?e+n:(o||(o=l*(.3*1.5)),!r||r<Math.abs(n)?(r=n,h=o/4):h=o/(2*Math.PI)*Math.asin(n/r),u<1?-.5*(r*Math.pow(2,10*(u-=1))*Math.sin((u*l-h)*(2*Math.PI)/o))+e:r*Math.pow(2,-10*(u-=1))*Math.sin((u*l-h)*(2*Math.PI)/o)*.5+n+e)},BounceEaseOut(u,e,n,l){return(u/=l)<1/2.75?n*(7.5625*u*u)+e:u<2/2.75?n*(7.5625*(u-=1.5/2.75)*u+.75)+e:u<2.5/2.75?n*(7.5625*(u-=2.25/2.75)*u+.9375)+e:n*(7.5625*(u-=2.625/2.75)*u+.984375)+e},BounceEaseIn(u,e,n,l){return n-Di.BounceEaseOut(l-u,0,n,l)+e},BounceEaseInOut(u,e,n,l){return u<l/2?Di.BounceEaseIn(u*2,0,n,l)*.5+e:Di.BounceEaseOut(u*2-l,0,n,l)*.5+n*.5+e},EaseIn(u,e,n,l){return n*(u/=l)*u+e},EaseOut(u,e,n,l){return-n*(u/=l)*(u-2)+e},EaseInOut(u,e,n,l){return(u/=l/2)<1?n/2*u*u+e:-n/2*(--u*(u-2)-1)+e},StrongEaseIn(u,e,n,l){return n*(u/=l)*u*u*u*u+e},StrongEaseOut(u,e,n,l){return n*((u=u/l-1)*u*u*u*u+1)+e},StrongEaseInOut(u,e,n,l){return(u/=l/2)<1?n/2*u*u*u*u*u+e:n/2*((u-=2)*u*u*u*u+2)+e},Linear(u,e,n,l){return n*u/l+e}},Xn=T._assign(V,{Util:T,Transform:_e,Node:j,Container:Ce,Stage:Il,stages:Oi,Layer:en,FastLayer:mu,Group:Yn,DD:mt,Shape:U,shapes:zi,Animation:Re,Tween:Mt,Easings:Di,Context:Wl,Canvas:cu});class ia extends U{_sceneFunc(e){const n=V.getAngle(this.angle()),l=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,l),e.arc(0,0,this.innerRadius(),n,0,!l),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),l=this.clockwise(),r=V.getAngle(l?360-this.angle():this.angle()),o=Math.cos(Math.min(r,Math.PI)),h=1,f=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),g=Math.sin(Math.min(r,Math.PI/2)),m=o*(o>0?e:n),v=h*n,S=f*(f>0?e:n),y=g*(g>0?n:e);return{x:m,y:l?-1*y:S,width:v-m,height:y-S}}}ia.prototype._centroid=!0;ia.prototype.className="Arc";ia.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];Bt(ia);C.addGetterSetter(ia,"innerRadius",0,q());C.addGetterSetter(ia,"outerRadius",0,q());C.addGetterSetter(ia,"angle",0,q());C.addGetterSetter(ia,"clockwise",!1,Be());function iu(u,e,n,l,r,o,h){const f=Math.sqrt(Math.pow(n-u,2)+Math.pow(l-e,2)),g=Math.sqrt(Math.pow(r-n,2)+Math.pow(o-l,2)),m=h*f/(f+g),v=h*g/(f+g),S=n-m*(r-u),y=l-m*(o-e),E=n+v*(r-u),_=l+v*(o-e);return[S,y,E,_]}function Dc(u,e){const n=u.length,l=[];for(let r=2;r<n-2;r+=2){const o=iu(u[r-2],u[r-1],u[r],u[r+1],u[r+2],u[r+3],e);isNaN(o[0])||(l.push(o[0]),l.push(o[1]),l.push(u[r]),l.push(u[r+1]),l.push(o[2]),l.push(o[3]))}return l}function _2(u){const e=[[u[0],u[2],u[4],u[6]],[u[1],u[3],u[5],u[7]]],n=[];for(const l of e){const r=-3*l[0]+9*l[1]-9*l[2]+3*l[3];if(r!==0){const o=6*l[0]-12*l[1]+6*l[2],h=-3*l[0]+3*l[1],f=o*o-4*r*h;if(f>=0){const g=Math.sqrt(f);n.push((-o+g)/(2*r)),n.push((-o-g)/(2*r))}}}return n.filter(l=>l>0&&l<1).flatMap(l=>e.map(r=>{const o=1-l;return o*o*o*r[0]+3*o*o*l*r[1]+3*o*l*l*r[2]+l*l*l*r[3]}))}let la=class extends U{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const n=this.points(),l=n.length,r=this.tension(),o=this.closed(),h=this.bezier();if(!l)return;let f=0;if(e.beginPath(),e.moveTo(n[0],n[1]),r!==0&&l>4){const g=this.getTensionPoints(),m=g.length;for(f=o?0:4,o||e.quadraticCurveTo(g[0],g[1],g[2],g[3]);f<m-2;)e.bezierCurveTo(g[f++],g[f++],g[f++],g[f++],g[f++],g[f++]);o||e.quadraticCurveTo(g[m-2],g[m-1],n[l-2],n[l-1])}else if(h)for(f=2;f<l;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<l;f+=2)e.lineTo(n[f],n[f+1]);o?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Dc(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,l=this.tension(),r=iu(e[n-2],e[n-1],e[0],e[1],e[2],e[3],l),o=iu(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],l),h=Dc(e,l);return[r[2],r[3]].concat(h).concat([o[0],o[1],e[n-2],e[n-1],o[2],o[3],r[0],r[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:this.bezier()?e=[e[0],e[1],..._2(this.points()),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],l=e[0],r=e[1],o=e[1],h,f;for(let g=0;g<e.length/2;g++)h=e[g*2],f=e[g*2+1],n=Math.min(n,h),l=Math.max(l,h),r=Math.min(r,f),o=Math.max(o,f);return{x:n,y:r,width:l-n,height:o-r}}};la.prototype.className="Line";la.prototype._attrsAffectingSize=["points","bezier","tension"];Bt(la);C.addGetterSetter(la,"closed",!1);C.addGetterSetter(la,"bezier",!1);C.addGetterSetter(la,"tension",0,q());C.addGetterSetter(la,"points",[],Ud());const C2=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],E2=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],b2=[[1],[1,1],[1,2,1],[1,3,3,1]],Gc=(u,e,n)=>{let l,r;const h=n/2;l=0;for(let f=0;f<20;f++)r=h*C2[20][f]+h,l+=E2[20][f]*T2(u,e,r);return h*l},Hc=(u,e,n)=>{n===void 0&&(n=1);const l=u[0]-2*u[1]+u[2],r=e[0]-2*e[1]+e[2],o=2*u[1]-2*u[0],h=2*e[1]-2*e[0],f=4*(l*l+r*r),g=4*(l*o+r*h),m=o*o+h*h;if(f===0)return n*Math.sqrt(Math.pow(u[2]-u[0],2)+Math.pow(e[2]-e[0],2));const v=g/(2*f),S=m/f,y=n+v,E=S-v*v,_=y*y+E>0?Math.sqrt(y*y+E):0,N=v*v+E>0?Math.sqrt(v*v+E):0,A=v+Math.sqrt(v*v+E)!==0?E*Math.log(Math.abs((y+_)/(v+N))):0;return Math.sqrt(f)/2*(y*_-v*N+A)};function T2(u,e,n){const l=lu(1,n,u),r=lu(1,n,e),o=l*l+r*r;return Math.sqrt(o)}const lu=(u,e,n)=>{const l=n.length-1;let r,o;if(l===0)return 0;if(u===0){o=0;for(let h=0;h<=l;h++)o+=b2[l][h]*Math.pow(1-e,l-h)*Math.pow(e,h)*n[h];return o}else{r=new Array(l);for(let h=0;h<l;h++)r[h]=l*(n[h+1]-n[h]);return lu(u-1,e,r)}},Bc=(u,e,n)=>{let l=1,r=u/e,o=(u-n(r))/e,h=0;for(;l>.001;){const f=n(r+o),g=Math.abs(u-f)/e;if(g<l)l=g,r+=o;else{const m=n(r-o),v=Math.abs(u-m)/e;v<l?(l=v,r-=o):o/=2}if(h++,h>500)break}return r};class Rt extends U{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Rt.parsePathData(this.data()),this.pathLength=Rt.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let l=!1;for(let r=0;r<n.length;r++){const o=n[r].command,h=n[r].points;switch(o){case"L":e.lineTo(h[0],h[1]);break;case"M":e.moveTo(h[0],h[1]);break;case"C":e.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]);break;case"Q":e.quadraticCurveTo(h[0],h[1],h[2],h[3]);break;case"A":const f=h[0],g=h[1],m=h[2],v=h[3],S=h[4],y=h[5],E=h[6],_=h[7],N=m>v?m:v,A=m>v?1:m/v,O=m>v?v/m:1;e.translate(f,g),e.rotate(E),e.scale(A,O),e.arc(0,0,N,S,S+y,1-_),e.scale(1/A,1/O),e.rotate(-E),e.translate(-f,-g);break;case"z":l=!0,e.closePath();break}}!l&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(g){if(g.command==="A"){const m=g.points[4],v=g.points[5],S=g.points[4]+v;let y=Math.PI/180;if(Math.abs(m-S)<y&&(y=Math.abs(m-S)),v<0)for(let E=m-y;E>S;E-=y){const _=Rt.getPointOnEllipticalArc(g.points[0],g.points[1],g.points[2],g.points[3],E,0);e.push(_.x,_.y)}else for(let E=m+y;E<S;E+=y){const _=Rt.getPointOnEllipticalArc(g.points[0],g.points[1],g.points[2],g.points[3],E,0);e.push(_.x,_.y)}}else if(g.command==="C")for(let m=0;m<=1;m+=.01){const v=Rt.getPointOnCubicBezier(m,g.start.x,g.start.y,g.points[0],g.points[1],g.points[2],g.points[3],g.points[4],g.points[5]);e.push(v.x,v.y)}else e=e.concat(g.points)});let n=e[0],l=e[0],r=e[1],o=e[1],h,f;for(let g=0;g<e.length/2;g++)h=e[g*2],f=e[g*2+1],isNaN(h)||(n=Math.min(n,h),l=Math.max(l,h)),isNaN(f)||(r=Math.min(r,f),o=Math.max(o,f));return{x:n,y:r,width:l-n,height:o-r}}getLength(){return this.pathLength}getPointAtLength(e){return Rt.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,l,r){return Math.sqrt((l-e)*(l-e)+(r-n)*(r-n))}static getPathLength(e){let n=0;for(let l=0;l<e.length;++l)n+=e[l].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let l,r=0,o=n.length;if(!o)return null;for(;r<o&&e>n[r].pathLength;)e-=n[r].pathLength,++r;if(r===o)return l=n[r-1].points.slice(-2),{x:l[0],y:l[1]};if(e<.01)return n[r].command==="M"?(l=n[r].points.slice(0,2),{x:l[0],y:l[1]}):{x:n[r].start.x,y:n[r].start.y};const h=n[r],f=h.points;switch(h.command){case"L":return Rt.getPointOnLine(e,h.start.x,h.start.y,f[0],f[1]);case"C":return Rt.getPointOnCubicBezier(Bc(e,Rt.getPathLength(n),N=>Gc([h.start.x,f[0],f[2],f[4]],[h.start.y,f[1],f[3],f[5]],N)),h.start.x,h.start.y,f[0],f[1],f[2],f[3],f[4],f[5]);case"Q":return Rt.getPointOnQuadraticBezier(Bc(e,Rt.getPathLength(n),N=>Hc([h.start.x,f[0],f[2]],[h.start.y,f[1],f[3]],N)),h.start.x,h.start.y,f[0],f[1],f[2],f[3]);case"A":const g=f[0],m=f[1],v=f[2],S=f[3],y=f[5],E=f[6];let _=f[4];return _+=y*e/h.pathLength,Rt.getPointOnEllipticalArc(g,m,v,S,_,E)}return null}static getPointOnLine(e,n,l,r,o,h,f){h=h??n,f=f??l;const g=this.getLineLength(n,l,r,o);if(g<1e-10)return{x:n,y:l};if(r===n)return{x:h,y:f+(o>l?e:-e)};const m=(o-l)/(r-n),v=Math.sqrt(e*e/(1+m*m))*(r<n?-1:1),S=m*v;if(Math.abs(f-l-m*(h-n))<1e-10)return{x:h+v,y:f+S};const y=((h-n)*(r-n)+(f-l)*(o-l))/(g*g),E=n+y*(r-n),_=l+y*(o-l),N=this.getLineLength(h,f,E,_),A=Math.sqrt(e*e-N*N),O=Math.sqrt(A*A/(1+m*m))*(r<n?-1:1),M=m*O;return{x:E+O,y:_+M}}static getPointOnCubicBezier(e,n,l,r,o,h,f,g,m){function v(A){return A*A*A}function S(A){return 3*A*A*(1-A)}function y(A){return 3*A*(1-A)*(1-A)}function E(A){return(1-A)*(1-A)*(1-A)}const _=g*v(e)+h*S(e)+r*y(e)+n*E(e),N=m*v(e)+f*S(e)+o*y(e)+l*E(e);return{x:_,y:N}}static getPointOnQuadraticBezier(e,n,l,r,o,h,f){function g(E){return E*E}function m(E){return 2*E*(1-E)}function v(E){return(1-E)*(1-E)}const S=h*g(e)+r*m(e)+n*v(e),y=f*g(e)+o*m(e)+l*v(e);return{x:S,y}}static getPointOnEllipticalArc(e,n,l,r,o,h){const f=Math.cos(h),g=Math.sin(h),m={x:l*Math.cos(o),y:r*Math.sin(o)};return{x:e+(m.x*f-m.y*g),y:n+(m.x*g+m.y*f)}}static parsePathData(e){if(!e)return[];let n=e;const l=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let S=0;S<l.length;S++)n=n.replace(new RegExp(l[S],"g"),"|"+l[S]);const r=n.split("|"),o=[],h=[];let f=0,g=0;const m=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let v;for(let S=1;S<r.length;S++){let y=r[S],E=y.charAt(0);for(y=y.slice(1),h.length=0;v=m.exec(y);)h.push(v[0]);let _=[],N=E==="A"||E==="a"?0:-1;for(let A=0,O=h.length;A<O;A++){const M=h[A];if(M==="00"){_.push(0,0),N>=0&&(N+=2,N>=7&&(N-=7));continue}if(N>=0){if(N===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(M)){_.push(parseInt(M[0],10)),_.push(parseInt(M[1],10)),_.push(parseFloat(M.slice(2))),N+=3,N>=7&&(N-=7);continue}if(M==="11"||M==="10"||M==="01"){_.push(parseInt(M[0],10)),_.push(parseInt(M[1],10)),N+=2,N>=7&&(N-=7);continue}if(M==="0"||M==="1"){_.push(parseInt(M,10)),N+=1,N>=7&&(N-=7);continue}}else if(N===4){if(/^[01]\d+(?:\.\d+)?$/.test(M)){_.push(parseInt(M[0],10)),_.push(parseFloat(M.slice(1))),N+=2,N>=7&&(N-=7);continue}if(M==="0"||M==="1"){_.push(parseInt(M,10)),N+=1,N>=7&&(N-=7);continue}}const H=parseFloat(M);isNaN(H)?_.push(0):_.push(H),N+=1,N>=7&&(N-=7)}else{const H=parseFloat(M);isNaN(H)?_.push(0):_.push(H)}}for(;_.length>0&&!isNaN(_[0]);){let A="",O=[];const M=f,H=g;let G,Q,L,P,w,W,et,ct,k,lt;switch(E){case"l":f+=_.shift(),g+=_.shift(),A="L",O.push(f,g);break;case"L":f=_.shift(),g=_.shift(),O.push(f,g);break;case"m":const rt=_.shift(),F=_.shift();if(f+=rt,g+=F,A="M",o.length>2&&o[o.length-1].command==="z"){for(let Z=o.length-2;Z>=0;Z--)if(o[Z].command==="M"){f=o[Z].points[0]+rt,g=o[Z].points[1]+F;break}}O.push(f,g),E="l";break;case"M":f=_.shift(),g=_.shift(),A="M",O.push(f,g),E="L";break;case"h":f+=_.shift(),A="L",O.push(f,g);break;case"H":f=_.shift(),A="L",O.push(f,g);break;case"v":g+=_.shift(),A="L",O.push(f,g);break;case"V":g=_.shift(),A="L",O.push(f,g);break;case"C":O.push(_.shift(),_.shift(),_.shift(),_.shift()),f=_.shift(),g=_.shift(),O.push(f,g);break;case"c":O.push(f+_.shift(),g+_.shift(),f+_.shift(),g+_.shift()),f+=_.shift(),g+=_.shift(),A="C",O.push(f,g);break;case"S":Q=f,L=g,G=o[o.length-1],G.command==="C"&&(Q=f+(f-G.points[2]),L=g+(g-G.points[3])),O.push(Q,L,_.shift(),_.shift()),f=_.shift(),g=_.shift(),A="C",O.push(f,g);break;case"s":Q=f,L=g,G=o[o.length-1],G.command==="C"&&(Q=f+(f-G.points[2]),L=g+(g-G.points[3])),O.push(Q,L,f+_.shift(),g+_.shift()),f+=_.shift(),g+=_.shift(),A="C",O.push(f,g);break;case"Q":O.push(_.shift(),_.shift()),f=_.shift(),g=_.shift(),O.push(f,g);break;case"q":O.push(f+_.shift(),g+_.shift()),f+=_.shift(),g+=_.shift(),A="Q",O.push(f,g);break;case"T":Q=f,L=g,G=o[o.length-1],G.command==="Q"&&(Q=f+(f-G.points[0]),L=g+(g-G.points[1])),f=_.shift(),g=_.shift(),A="Q",O.push(Q,L,f,g);break;case"t":Q=f,L=g,G=o[o.length-1],G.command==="Q"&&(Q=f+(f-G.points[0]),L=g+(g-G.points[1])),f+=_.shift(),g+=_.shift(),A="Q",O.push(Q,L,f,g);break;case"A":P=_.shift(),w=_.shift(),W=_.shift(),et=_.shift(),ct=_.shift(),k=f,lt=g,f=_.shift(),g=_.shift(),A="A",O=this.convertEndpointToCenterParameterization(k,lt,f,g,et,ct,P,w,W);break;case"a":P=_.shift(),w=_.shift(),W=_.shift(),et=_.shift(),ct=_.shift(),k=f,lt=g,f+=_.shift(),g+=_.shift(),A="A",O=this.convertEndpointToCenterParameterization(k,lt,f,g,et,ct,P,w,W);break}o.push({command:A||E,points:O,start:{x:M,y:H},pathLength:this.calcLength(M,H,A||E,O)})}(E==="z"||E==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,n,l,r){let o,h,f,g;const m=Rt;switch(l){case"L":return m.getLineLength(e,n,r[0],r[1]);case"C":return Gc([e,r[0],r[2],r[4]],[n,r[1],r[3],r[5]],1);case"Q":return Hc([e,r[0],r[2]],[n,r[1],r[3]],1);case"A":o=0;const v=r[4],S=r[5],y=r[4]+S;let E=Math.PI/180;if(Math.abs(v-y)<E&&(E=Math.abs(v-y)),h=m.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],v,0),S<0)for(g=v-E;g>y;g-=E)f=m.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],g,0),o+=m.getLineLength(h.x,h.y,f.x,f.y),h=f;else for(g=v+E;g<y;g+=E)f=m.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],g,0),o+=m.getLineLength(h.x,h.y,f.x,f.y),h=f;return f=m.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],y,0),o+=m.getLineLength(h.x,h.y,f.x,f.y),o}return 0}static convertEndpointToCenterParameterization(e,n,l,r,o,h,f,g,m){const v=m*(Math.PI/180),S=Math.cos(v)*(e-l)/2+Math.sin(v)*(n-r)/2,y=-1*Math.sin(v)*(e-l)/2+Math.cos(v)*(n-r)/2,E=S*S/(f*f)+y*y/(g*g);E>1&&(f*=Math.sqrt(E),g*=Math.sqrt(E));let _=Math.sqrt((f*f*(g*g)-f*f*(y*y)-g*g*(S*S))/(f*f*(y*y)+g*g*(S*S)));o===h&&(_*=-1),isNaN(_)&&(_=0);const N=_*f*y/g,A=_*-g*S/f,O=(e+l)/2+Math.cos(v)*N-Math.sin(v)*A,M=(n+r)/2+Math.sin(v)*N+Math.cos(v)*A,H=function(et){return Math.sqrt(et[0]*et[0]+et[1]*et[1])},G=function(et,ct){return(et[0]*ct[0]+et[1]*ct[1])/(H(et)*H(ct))},Q=function(et,ct){return(et[0]*ct[1]<et[1]*ct[0]?-1:1)*Math.acos(G(et,ct))},L=Q([1,0],[(S-N)/f,(y-A)/g]),P=[(S-N)/f,(y-A)/g],w=[(-1*S-N)/f,(-1*y-A)/g];let W=Q(P,w);return G(P,w)<=-1&&(W=Math.PI),G(P,w)>=1&&(W=0),h===0&&W>0&&(W=W-2*Math.PI),h===1&&W<0&&(W=W+2*Math.PI),[O,M,f,g,L,W,v,h]}}Rt.prototype.className="Path";Rt.prototype._attrsAffectingSize=["data"];Bt(Rt);C.addGetterSetter(Rt,"data");class an extends la{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,l=this.points();let r=l;const o=this.tension()!==0&&l.length>4;o&&(r=this.getTensionPoints());const h=this.pointerLength(),f=l.length;let g,m;if(o){const y=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],l[f-2],l[f-1]],E=Rt.calcLength(r[r.length-4],r[r.length-3],"C",y),_=Rt.getPointOnQuadraticBezier(Math.min(1,1-h/E),y[0],y[1],y[2],y[3],y[4],y[5]);g=l[f-2]-_.x,m=l[f-1]-_.y}else g=l[f-2]-l[f-4],m=l[f-1]-l[f-3];const v=(Math.atan2(m,g)+n)%n,S=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(l[f-2],l[f-1]),e.rotate(v),e.moveTo(0,0),e.lineTo(-h,S/2),e.lineTo(-h,-S/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(l[0],l[1]),o?(g=(r[0]+r[2])/2-l[0],m=(r[1]+r[3])/2-l[1]):(g=l[2]-l[0],m=l[3]-l[1]),e.rotate((Math.atan2(-m,-g)+n)%n),e.moveTo(0,0),e.lineTo(-h,S/2),e.lineTo(-h,-S/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x,y:e.y-n,width:e.width,height:e.height+n*2}}}an.prototype.className="Arrow";Bt(an);C.addGetterSetter(an,"pointerLength",10,q());C.addGetterSetter(an,"pointerWidth",10,q());C.addGetterSetter(an,"pointerAtBeginning",!1);C.addGetterSetter(an,"pointerAtEnding",!0);let qn=class extends U{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};qn.prototype._centroid=!0;qn.prototype.className="Circle";qn.prototype._attrsAffectingSize=["radius"];Bt(qn);C.addGetterSetter(qn,"radius",0,q());class Na extends U{_sceneFunc(e){const n=this.radiusX(),l=this.radiusY();e.beginPath(),e.save(),n!==l&&e.scale(1,l/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Na.prototype.className="Ellipse";Na.prototype._centroid=!0;Na.prototype._attrsAffectingSize=["radiusX","radiusY"];Bt(Na);C.addComponentsGetterSetter(Na,"radius",["x","y"]);C.addGetterSetter(Na,"radiusX",0,q());C.addGetterSetter(Na,"radiusY",0,q());class Ee extends U{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),l=this.getHeight(),r=this.cornerRadius(),o=this.attrs.image;let h;if(o){const f=this.attrs.cropWidth,g=this.attrs.cropHeight;f&&g?h=[o,this.cropX(),this.cropY(),f,g,0,0,n,l]:h=[o,0,0,n,l]}(this.hasFill()||this.hasStroke()||r)&&(e.beginPath(),r?T.drawRoundedRectPath(e,n,l,r):e.rect(0,0,n,l),e.closePath(),e.fillStrokeShape(this)),o&&(r&&e.clip(),e.drawImage.apply(e,h))}_hitFunc(e){const n=this.width(),l=this.height(),r=this.cornerRadius();e.beginPath(),r?T.drawRoundedRectPath(e,n,l,r):e.rect(0,0,n,l),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n,l;return(l=(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width)!==null&&l!==void 0?l:0}getHeight(){var e,n,l;return(l=(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height)!==null&&l!==void 0?l:0}static fromURL(e,n,l=null){const r=T.createImageElement();r.onload=function(){const o=new Ee({image:r});n(o)},r.onerror=l,r.crossOrigin="Anonymous",r.src=e}}Ee.prototype.className="Image";Ee.prototype._attrsAffectingSize=["image"];Bt(Ee);C.addGetterSetter(Ee,"cornerRadius",0,kl(4));C.addGetterSetter(Ee,"image");C.addComponentsGetterSetter(Ee,"crop",["x","y","width","height"]);C.addGetterSetter(Ee,"cropX",0,q());C.addGetterSetter(Ee,"cropY",0,q());C.addGetterSetter(Ee,"cropWidth",0,q());C.addGetterSetter(Ee,"cropHeight",0,q());const S0=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],x2="Change.konva",A2="none",su="up",ru="right",uu="down",ou="left",M2=S0.length;class pu extends Yn{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,l;const r=function(){n._sync()};for(l=0;l<M2;l++)e.on(S0[l]+x2,r)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),l,r,o,h,f,g,m;if(e&&n){switch(l=e.width(),r=e.height(),o=n.pointerDirection(),h=n.pointerWidth(),m=n.pointerHeight(),f=0,g=0,o){case su:f=l/2,g=-1*m;break;case ru:f=l+h,g=r/2;break;case uu:f=l/2,g=r+m;break;case ou:f=-1*h,g=r/2;break}n.setAttrs({x:-1*f,y:-1*g,width:l,height:r}),e.setAttrs({x:-1*f,y:-1*g})}}}pu.prototype.className="Label";Bt(pu);class nn extends U{_sceneFunc(e){const n=this.width(),l=this.height(),r=this.pointerDirection(),o=this.pointerWidth(),h=this.pointerHeight(),f=this.cornerRadius();let g=0,m=0,v=0,S=0;typeof f=="number"?g=m=v=S=Math.min(f,n/2,l/2):(g=Math.min(f[0]||0,n/2,l/2),m=Math.min(f[1]||0,n/2,l/2),S=Math.min(f[2]||0,n/2,l/2),v=Math.min(f[3]||0,n/2,l/2)),e.beginPath(),e.moveTo(g,0),r===su&&(e.lineTo((n-o)/2,0),e.lineTo(n/2,-1*h),e.lineTo((n+o)/2,0)),e.lineTo(n-m,0),e.arc(n-m,m,m,Math.PI*3/2,0,!1),r===ru&&(e.lineTo(n,(l-h)/2),e.lineTo(n+o,l/2),e.lineTo(n,(l+h)/2)),e.lineTo(n,l-S),e.arc(n-S,l-S,S,0,Math.PI/2,!1),r===uu&&(e.lineTo((n+o)/2,l),e.lineTo(n/2,l+h),e.lineTo((n-o)/2,l)),e.lineTo(v,l),e.arc(v,l-v,v,Math.PI/2,Math.PI,!1),r===ou&&(e.lineTo(0,(l+h)/2),e.lineTo(-1*o,l/2),e.lineTo(0,(l-h)/2)),e.lineTo(0,g),e.arc(g,g,g,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,l=this.pointerWidth(),r=this.pointerHeight(),o=this.pointerDirection(),h=this.width(),f=this.height();return o===su?(n-=r,f+=r):o===uu?f+=r:o===ou?(e-=l*1.5,h+=l):o===ru&&(h+=l*1.5),{x:e,y:n,width:h,height:f}}}nn.prototype.className="Tag";Bt(nn);C.addGetterSetter(nn,"pointerDirection",A2);C.addGetterSetter(nn,"pointerWidth",0,q());C.addGetterSetter(nn,"pointerHeight",0,q());C.addGetterSetter(nn,"cornerRadius",0,kl(4));let Bi=class extends U{_sceneFunc(e){const n=this.cornerRadius(),l=this.width(),r=this.height();e.beginPath(),n?T.drawRoundedRectPath(e,l,r,n):e.rect(0,0,l,r),e.closePath(),e.fillStrokeShape(this)}};Bi.prototype.className="Rect";Bt(Bi);C.addGetterSetter(Bi,"cornerRadius",0,kl(4));class Oa extends U{_sceneFunc(e){const n=this._getPoints(),l=this.radius(),r=this.sides(),o=this.cornerRadius();if(e.beginPath(),o)T.drawRoundedPolygonPath(e,n,r,l,o);else{e.moveTo(n[0].x,n[0].y);for(let h=1;h<n.length;h++)e.lineTo(n[h].x,n[h].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,l=[];for(let r=0;r<e;r++)l.push({x:n*Math.sin(r*2*Math.PI/e),y:-1*n*Math.cos(r*2*Math.PI/e)});return l}getSelfRect(){const e=this._getPoints();let n=e[0].x,l=e[0].x,r=e[0].y,o=e[0].y;return e.forEach(h=>{n=Math.min(n,h.x),l=Math.max(l,h.x),r=Math.min(r,h.y),o=Math.max(o,h.y)}),{x:n,y:r,width:l-n,height:o-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Oa.prototype.className="RegularPolygon";Oa.prototype._centroid=!0;Oa.prototype._attrsAffectingSize=["radius"];Bt(Oa);C.addGetterSetter(Oa,"radius",0,q());C.addGetterSetter(Oa,"sides",0,q());C.addGetterSetter(Oa,"cornerRadius",0,kl(4));const Uc=Math.PI*2;class ln extends U{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,Uc,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),Uc,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}ln.prototype.className="Ring";ln.prototype._centroid=!0;ln.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Bt(ln);C.addGetterSetter(ln,"innerRadius",0,q());C.addGetterSetter(ln,"outerRadius",0,q());class je extends U{constructor(e){super(e),this._updated=!0,this.anim=new Re(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),l=this.frameIndex(),r=l*4,o=this.animations()[n],h=this.frameOffsets(),f=o[r+0],g=o[r+1],m=o[r+2],v=o[r+3],S=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,m,v),e.closePath(),e.fillStrokeShape(this)),S)if(h){const y=h[n],E=l*2;e.drawImage(S,f,g,m,v,y[E+0],y[E+1],m,v)}else e.drawImage(S,f,g,m,v,0,0,m,v)}_hitFunc(e){const n=this.animation(),l=this.frameIndex(),r=l*4,o=this.animations()[n],h=this.frameOffsets(),f=o[r+2],g=o[r+3];if(e.beginPath(),h){const m=h[n],v=l*2;e.rect(m[v+0],m[v+1],f,g)}else e.rect(0,0,f,g);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),l=this.animations(),r=l[n],o=r.length/4;e<o-1?this.frameIndex(e+1):this.frameIndex(0)}}je.prototype.className="Sprite";Bt(je);C.addGetterSetter(je,"animation");C.addGetterSetter(je,"animations");C.addGetterSetter(je,"frameOffsets");C.addGetterSetter(je,"image");C.addGetterSetter(je,"frameIndex",0,q());C.addGetterSetter(je,"frameRate",17,q());C.backCompat(je,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class za extends U{_sceneFunc(e){const n=this.innerRadius(),l=this.outerRadius(),r=this.numPoints();e.beginPath(),e.moveTo(0,0-l);for(let o=1;o<r*2;o++){const h=o%2===0?l:n,f=h*Math.sin(o*Math.PI/r),g=-1*h*Math.cos(o*Math.PI/r);e.lineTo(f,g)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}za.prototype.className="Star";za.prototype._centroid=!0;za.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Bt(za);C.addGetterSetter(za,"numPoints",5,q());C.addGetterSetter(za,"innerRadius",0,q());C.addGetterSetter(za,"outerRadius",0,q());function Aa(u){return[...u].reduce((e,n,l,r)=>{if(/\p{Emoji}/u.test(n)){const o=r[l+1];o&&/\p{Emoji_Modifier}|\u200D/u.test(o)?(e.push(n+o),r[l+1]=""):e.push(n)}else/\p{Regional_Indicator}{2}/u.test(n+(r[l+1]||""))?e.push(n+r[l+1]):l>0&&/\p{Mn}|\p{Me}|\p{Mc}/u.test(n)?e[e.length-1]+=n:n&&e.push(n);return e},[])}const Un="auto",R2="center",_0="inherit",Ci="justify",N2="Change.konva",C0="2d",Lc="-",E0="left",O2="text",z2="Text",D2="top",G2="bottom",Yc="middle",b0="normal",H2="px ",Ql=" ",B2="right",Xc="rtl",U2="word",L2="char",qc="none",Zr="…",T0=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Y2=T0.length;let Ei=null;function X2(){if(Ei!==null)return Ei;Ei=!1;try{const u=document.createElement("canvas");u.width=10,u.height=10;const e=u.getContext(C0);if(e){e.globalAlpha=0,e.shadowColor="black",e.shadowBlur=5,e.shadowOffsetX=5,e.shadowOffsetY=5,e.fillStyle="black",e.font="10px Arial",e.fillText("X",0,10);const n=e.getImageData(0,0,10,10).data;for(let l=3;l<n.length;l+=4)if(n[l]>0){Ei=!0;break}}}catch{}return Ei}function q2(u){return u.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,l=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!l&&(e=`"${e}"`),e}).join(", ")}let wl;function Jr(){return wl||(wl=T.createCanvasElement().getContext(C0),wl)}function j2(u){u.fillText(this._partialText,this._partialTextX,this._partialTextY)}function V2(u){u.setAttr("miterLimit",2),u.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function K2(u){return u=u||{},!u.fillLinearGradientColorStops&&!u.fillRadialGradientColorStops&&!u.fillPatternImage&&(u.fill=u.fill||"black"),u}let Nt=class extends U{constructor(e){super(K2(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<Y2;n++)this.on(T0[n]+N2,this._setTextData);this._setTextData()}_sceneFunc(e){var n,l;const r=this.textArr,o=r.length;if(!this.text())return;let h=this.padding(),f=this.fontSize(),g=this.lineHeight()*f,m=this.verticalAlign(),v=this.direction(),S=0,y=this.align(),E=this.getWidth(),_=this.letterSpacing(),N=this.charRenderFunc(),A=this.fill(),O=this.textDecoration(),M=this.underlineOffset(),H=O.indexOf("underline")!==-1,G=O.indexOf("line-through")!==-1,Q;v=v===_0?e.direction:v;let L=g/2,P=Yc;if(!V.legacyTextRendering){const w=this.measureSize("M");P="alphabetic";const W=(n=w.fontBoundingBoxAscent)!==null&&n!==void 0?n:w.actualBoundingBoxAscent,et=(l=w.fontBoundingBoxDescent)!==null&&l!==void 0?l:w.actualBoundingBoxDescent;L=(W-et)/2+g/2}for(v===Xc&&e.setAttr("direction",v),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",P),e.setAttr("textAlign",E0),m===Yc?S=(this.getHeight()-o*g-h*2)/2:m===G2&&(S=this.getHeight()-o*g-h*2),e.translate(h,S+h),Q=0;Q<o;Q++){let w=0,W=0;const et=r[Q],ct=et.text,k=et.width,lt=et.lastInParagraph;if(e.save(),y===B2?w+=E-k-h*2:y===R2&&(w+=(E-k-h*2)/2),H){e.save(),e.beginPath();const F=M??(V.legacyTextRendering?Math.round(f/2):Math.round(f/4)),Z=w,bt=L+W+F;e.moveTo(Z,bt);const I=y===Ci&&!lt?E-h*2:k;e.lineTo(Z+Math.round(I),bt),e.lineWidth=f/15;const st=this._getLinearGradient();e.strokeStyle=st||A,e.stroke(),e.restore()}const rt=w;if(v!==Xc&&(_!==0||y===Ci||N)){const F=ct.split(" ").length-1,Z=Aa(ct);for(let bt=0;bt<Z.length;bt++){const I=Z[bt];if(I===" "&&!lt&&y===Ci&&(w+=(E-h*2-k)/F),this._partialTextX=w,this._partialTextY=L+W,this._partialText=I,N){e.save();const Ct=r.slice(0,Q).reduce((Ot,Wt)=>Ot+Aa(Wt.text).length,0),pt=bt+Ct;N({char:I,index:pt,x:w,y:L+W,lineIndex:Q,column:bt,isLastInLine:lt,width:this.measureSize(I).width,context:e})}e.fillStrokeShape(this),N&&e.restore(),w+=this.measureSize(I).width+_}}else _!==0&&e.setAttr("letterSpacing",`${_}px`),this._partialTextX=w,this._partialTextY=L+W,this._partialText=ct,e.fillStrokeShape(this);if(G){e.save(),e.beginPath();const F=V.legacyTextRendering?0:-Math.round(f/4),Z=rt;e.moveTo(Z,L+W+F);const bt=y===Ci&&!lt?E-h*2:k;e.lineTo(Z+Math.round(bt),L+W+F),e.lineWidth=f/15;const I=this._getLinearGradient();e.strokeStyle=I||A,e.stroke(),e.restore()}e.restore(),o>1&&(L+=g)}}_hitFunc(e){const n=this.getWidth(),l=this.getHeight();e.beginPath(),e.rect(0,0,n,l),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=T._isString(e)?e:e==null?"":e+"";return this._setAttr(O2,n),this}getWidth(){return this.attrs.width===Un||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Un||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return T.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,l,r,o,h,f,g,m,v,S,y;let E=Jr(),_=this.fontSize(),N;E.save(),E.font=this._getContextFont(),N=E.measureText(e),E.restore();const A=_/100;return{actualBoundingBoxAscent:(n=N.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*A,actualBoundingBoxDescent:(l=N.actualBoundingBoxDescent)!==null&&l!==void 0?l:0,actualBoundingBoxLeft:(r=N.actualBoundingBoxLeft)!==null&&r!==void 0?r:-7.421875*A,actualBoundingBoxRight:(o=N.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*A,alphabeticBaseline:(h=N.alphabeticBaseline)!==null&&h!==void 0?h:0,emHeightAscent:(f=N.emHeightAscent)!==null&&f!==void 0?f:100*A,emHeightDescent:(g=N.emHeightDescent)!==null&&g!==void 0?g:-20*A,fontBoundingBoxAscent:(m=N.fontBoundingBoxAscent)!==null&&m!==void 0?m:91*A,fontBoundingBoxDescent:(v=N.fontBoundingBoxDescent)!==null&&v!==void 0?v:21*A,hangingBaseline:(S=N.hangingBaseline)!==null&&S!==void 0?S:72.80000305175781*A,ideographicBaseline:(y=N.ideographicBaseline)!==null&&y!==void 0?y:-21*A,width:N.width,height:_}}_getContextFont(){return this.fontStyle()+Ql+this.fontVariant()+Ql+(this.fontSize()+H2)+q2(this.fontFamily())}_addTextLine(e){this.align()===Ci&&(e=e.trim());const l=this._getTextWidth(e);return this.textArr.push({text:e,width:l,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),l=e.length;return Jr().measureText(e).width+n*l}_setTextData(){let e=this.text().split(`
|
|
15
|
+
`),n=+this.fontSize(),l=0,r=this.lineHeight()*n,o=this.attrs.width,h=this.attrs.height,f=o!==Un&&o!==void 0,g=h!==Un&&h!==void 0,m=this.padding(),v=o-m*2,S=h-m*2,y=0,E=this.wrap(),_=E!==qc,N=E!==L2&&_,A=this.ellipsis();this.textArr=[],Jr().font=this._getContextFont();const O=A?this._getTextWidth(Zr):0;for(let M=0,H=e.length;M<H;++M){let G=e[M],Q=this._getTextWidth(G);if(f&&Q>v)for(;G.length>0;){let L=0,P=Aa(G).length,w="",W=0;for(;L<P;){const et=L+P>>>1,ct=Aa(G),k=ct.slice(0,et+1).join(""),lt=this._getTextWidth(k);(A&&g&&y+r>S?lt+O:lt)<=v?(L=et+1,w=k,W=lt):P=et}if(w){if(N){const k=Aa(G),lt=Aa(w),rt=k[lt.length],F=rt===Ql||rt===Lc;let Z;if(F&&W<=v)Z=lt.length;else{const bt=lt.lastIndexOf(Ql),I=lt.lastIndexOf(Lc);Z=Math.max(bt,I)+1}Z>0&&(L=Z,w=k.slice(0,L).join(""),W=this._getTextWidth(w))}if(w=w.trimRight(),this._addTextLine(w),l=Math.max(l,W),y+=r,this._shouldHandleEllipsis(y)){this._tryToAddEllipsisToLastLine();break}if(G=Aa(G).slice(L).join("").trimLeft(),G.length>0&&(Q=this._getTextWidth(G),Q<=v)){this._addTextLine(G),y+=r,l=Math.max(l,Q);break}}else break}else this._addTextLine(G),y+=r,l=Math.max(l,Q),this._shouldHandleEllipsis(y)&&M<H-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),g&&y+r>S)break}this.textHeight=n,this.textWidth=l}_shouldHandleEllipsis(e){const n=+this.fontSize(),l=this.lineHeight()*n,r=this.attrs.height,o=r!==Un&&r!==void 0,h=this.padding(),f=r-h*2;return!(this.wrap()!==qc)||o&&e+l>f}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==Un&&e!==void 0,l=this.padding(),r=e-l*2,o=this.ellipsis(),h=this.textArr[this.textArr.length-1];!h||!o||(n&&(this._getTextWidth(h.text+Zr)<r||(h.text=h.text.slice(0,h.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(h.text+Zr))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n||n&&this.getAbsoluteOpacity()!==1&&X2()?!0:super._useBufferCanvas()}};Nt.prototype._fillFunc=j2;Nt.prototype._strokeFunc=V2;Nt.prototype.className=z2;Nt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Bt(Nt);C.overWriteSetter(Nt,"width",du());C.overWriteSetter(Nt,"height",du());C.addGetterSetter(Nt,"direction",_0);C.addGetterSetter(Nt,"fontFamily","Arial");C.addGetterSetter(Nt,"fontSize",12,q());C.addGetterSetter(Nt,"fontStyle",b0);C.addGetterSetter(Nt,"fontVariant",b0);C.addGetterSetter(Nt,"padding",0,q());C.addGetterSetter(Nt,"align",E0);C.addGetterSetter(Nt,"verticalAlign",D2);C.addGetterSetter(Nt,"lineHeight",1,q());C.addGetterSetter(Nt,"wrap",U2);C.addGetterSetter(Nt,"ellipsis",!1,Be());C.addGetterSetter(Nt,"letterSpacing",0,q());C.addGetterSetter(Nt,"text","",tn());C.addGetterSetter(Nt,"textDecoration","");C.addGetterSetter(Nt,"underlineOffset",void 0,q());C.addGetterSetter(Nt,"charRenderFunc",void 0);const Q2="",x0="normal";function A0(u){u.fillText(this.partialText,0,0)}function M0(u){u.strokeText(this.partialText,0,0)}class Qt extends U{constructor(e){super(e),this.dummyCanvas=T.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva directionChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Rt.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e>n?null:Rt.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Rt.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),l=this.fill(),r=this.fontSize(),o=this.glyphInfo,h=n.indexOf("underline")!==-1,f=n.indexOf("line-through")!==-1;h&&e.beginPath();for(let g=0;g<o.length;g++){e.save();const m=o[g].p0;e.translate(m.x,m.y),e.rotate(o[g].rotation),this.partialText=o[g].text,e.fillStrokeShape(this),h&&(g===0&&e.moveTo(0,r/2+1),e.lineTo(o[g].width,r/2+1)),e.restore()}if(h&&(e.strokeStyle=l,e.lineWidth=r/20,e.stroke()),f){e.beginPath();for(let g=0;g<o.length;g++){e.save();const m=o[g].p0;e.translate(m.x,m.y),e.rotate(o[g].rotation),g===0&&e.moveTo(0,0),e.lineTo(o[g].width,0),e.restore()}e.strokeStyle=l,e.lineWidth=r/20,e.stroke()}e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const l=n[0].p0;e.moveTo(l.x,l.y)}for(let l=0;l<n.length;l++){const r=n[l].p1;e.lineTo(r.x,r.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return T.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return Nt.prototype.setText.call(this,e)}_getContextFont(){return Nt.prototype._getContextFont.call(this)}_getTextSize(e){const l=this.dummyCanvas.getContext("2d");l.save(),l.font=this._getContextFont();const r=l.measureText(e);return l.restore(),{width:r.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=Aa(this.text());this.direction()==="rtl"&&e.reverse();const n=[];let l=0;for(let E=0;E<e.length;E++)n.push({char:e[E],width:this._getTextSize(e[E]).width}),l+=n[E].width;const{width:r,height:o}=this._getTextSize(this.attrs.text);if(this.textWidth=l,this.textHeight=o,this.glyphInfo=[],!this.attrs.data)return null;const h=this.letterSpacing(),f=this.align(),g=this.kerningFunc(),m=Math.max(0,l-r),v=Math.max(this.textWidth+((this.attrs.text||"").length-1)*h,0);let S=0;f==="center"&&(S=Math.max(0,this.pathLength/2-v/2)),f==="right"&&(S=Math.max(0,this.pathLength-v));let y=S;for(let E=0;E<n.length;E++){const _=this._getPointAtLength(y);if(!_)return;const N=n[E].char;let A=n[E].width+h;if(N===" "&&f==="justify"){const P=this.text().split(" ").length-1;A+=(this.pathLength-v)/P}const O=y+A,M=this._getPointAtLength(O>this.pathLength&&O-this.pathLength<=m?this.pathLength:O);if(!M)return;const H=Rt.getLineLength(_.x,_.y,M.x,M.y);let G=0;if(g)try{G=g(n[E-1].char,N)*this.fontSize()}catch{G=0}_.x+=G,M.x+=G,this.textWidth+=G;const Q=Rt.getPointOnLine(G+H/2,_.x,_.y,M.x,M.y),L=Math.atan2(M.y-_.y,M.x-_.x);this.glyphInfo.push({transposeX:Q.x,transposeY:Q.y,text:e[E],rotation:L,p0:_,p1:M,width:H}),y+=A}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(m){e.push(m.p0.x),e.push(m.p0.y),e.push(m.p1.x),e.push(m.p1.y)});let n=e[0]||0,l=e[0]||0,r=e[1]||0,o=e[1]||0,h,f;for(let m=0;m<e.length/2;m++)h=e[m*2],f=e[m*2+1],n=Math.min(n,h),l=Math.max(l,h),r=Math.min(r,f),o=Math.max(o,f);const g=this.fontSize();return{x:n-g/2,y:r-g/2,width:l-n+g,height:o-r+g}}destroy(){return T.releaseCanvas(this.dummyCanvas),super.destroy()}}Qt.prototype._fillFunc=A0;Qt.prototype._strokeFunc=M0;Qt.prototype._fillFuncHit=A0;Qt.prototype._strokeFuncHit=M0;Qt.prototype.className="TextPath";Qt.prototype._attrsAffectingSize=["text","fontSize","data"];Bt(Qt);C.addGetterSetter(Qt,"data");C.addGetterSetter(Qt,"fontFamily","Arial");C.addGetterSetter(Qt,"fontSize",12,q());C.addGetterSetter(Qt,"fontStyle",x0);C.addGetterSetter(Qt,"align","left");C.addGetterSetter(Qt,"letterSpacing",0,q());C.addGetterSetter(Qt,"textBaseline","middle");C.addGetterSetter(Qt,"fontVariant",x0);C.addGetterSetter(Qt,"text",Q2);C.addGetterSetter(Qt,"textDecoration","");C.addGetterSetter(Qt,"kerningFunc",void 0);C.addGetterSetter(Qt,"direction","inherit");const R0="tr-konva",w2=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(u=>u+`.${R0}`).join(" "),jc="nodesRect",Z2=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],J2={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},P2="ontouchstart"in V._global;function F2(u,e,n){if(u==="rotater")return n;e+=T.degToRad(J2[u]||0);const l=(T.radToDeg(e)%360+360)%360;return T._inRange(l,315+22.5,360)||T._inRange(l,0,22.5)?"ns-resize":T._inRange(l,45-22.5,45+22.5)?"nesw-resize":T._inRange(l,90-22.5,90+22.5)?"ew-resize":T._inRange(l,135-22.5,135+22.5)?"nwse-resize":T._inRange(l,180-22.5,180+22.5)?"ns-resize":T._inRange(l,225-22.5,225+22.5)?"nesw-resize":T._inRange(l,270-22.5,270+22.5)?"ew-resize":T._inRange(l,315-22.5,315+22.5)?"nwse-resize":(T.error("Transformer has unknown angle for cursor detection: "+l),"pointer")}const Fl=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function W2(u){return{x:u.x+u.width/2*Math.cos(u.rotation)+u.height/2*Math.sin(-u.rotation),y:u.y+u.height/2*Math.cos(u.rotation)+u.width/2*Math.sin(u.rotation)}}function N0(u,e,n){const l=n.x+(u.x-n.x)*Math.cos(e)-(u.y-n.y)*Math.sin(e),r=n.y+(u.x-n.x)*Math.sin(e)+(u.y-n.y)*Math.cos(e);return{...u,rotation:u.rotation+e,x:l,y:r}}function k2(u,e){const n=W2(u);return N0(u,e,n)}function I2(u,e,n){let l=e;for(let r=0;r<u.length;r++){const o=V.getAngle(u[r]),h=Math.abs(o-e)%(Math.PI*2);Math.min(h,Math.PI*2-h)<n&&(l=o)}return l}let hu=0;class dt extends Yn{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(w2,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return T.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return R0+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(r=>r.isAncestorOf(this)?(T.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(r._attrsAffectingSize.length){const h=r._attrsAffectingSize.map(f=>f+"Change."+this._getEventNamespace()).join(" ");r.on(h,o)}r.on(Z2.map(h=>h+`.${this._getEventNamespace()}`).join(" "),o),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(r)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,l=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(l,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,l=>{if(!n)return;const r=e.getAbsolutePosition(),o=r.x-n.x,h=r.y-n.y;this.nodes().forEach(f=>{if(f===e||f.isDragging())return;const g=f.getAbsolutePosition();f.setAbsolutePosition({x:g.x+o,y:g.y+h}),f.startDrag(l)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(jc),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(jc,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),l){const r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(l),h=e.getAbsolutePosition(l),f=r.x*o.x-e.offsetX()*o.x,g=r.y*o.y-e.offsetY()*o.y,m=(V.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={x:h.x+f*Math.cos(m)+g*Math.sin(-m),y:h.y+g*Math.cos(m)+f*Math.sin(m),width:r.width*o.x,height:r.height*o.y,rotation:m};return N0(v,-V.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(m=>{const v=m.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),S=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],y=m.getAbsoluteTransform();S.forEach(function(E){const _=y.point(E);n.push(_)})});const l=new _e;l.rotate(-V.getAngle(this.rotation()));let r=1/0,o=1/0,h=-1/0,f=-1/0;n.forEach(function(m){const v=l.point(m);r===void 0&&(r=h=v.x,o=f=v.y),r=Math.min(r,v.x),o=Math.min(o,v.y),h=Math.max(h,v.x),f=Math.max(f,v.y)}),l.invert();const g=l.point({x:r,y:o});return{x:g.x,y:g.y,width:h-r,height:f-o,rotation:V.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),Fl.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(e){const n=new Bi({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:P2?10:"auto"}),l=this;n.on("mousedown touchstart",function(r){l._handleMouseDown(r)}),n.on("dragstart",r=>{n.stopDrag(),r.cancelBubble=!0}),n.on("dragend",r=>{r.cancelBubble=!0}),n.on("mouseenter",()=>{const r=V.getAngle(this.rotation()),o=this.rotateAnchorCursor(),h=F2(e,r,o);n.getStage().content&&(n.getStage().content.style.cursor=h),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new U({name:"back",width:0,height:0,sceneFunc(n,l){const r=l.getParent(),o=r.padding(),h=l.width(),f=l.height();if(n.beginPath(),n.rect(-o,-o,h+o*2,f+o*2),r.rotateEnabled()&&r.rotateLineVisible()){const g=r.rotateAnchorAngle(),m=r.rotateAnchorOffset(),v=T.degToRad(g),S=Math.sin(v),y=-Math.cos(v),E=h/2,_=f/2;let N=1/0;y<0?N=Math.min(N,-_/y):y>0&&(N=Math.min(N,(f-_)/y)),S<0?N=Math.min(N,-E/S):S>0&&(N=Math.min(N,(h-E)/S));const A=E+S*N,O=_+y*N,M=T._sign(f),H=A+S*m*M,G=O+y*m*M;n.moveTo(A,O),n.lineTo(H,G)}n.fillStrokeShape(l)},hitFunc:(n,l)=>{if(!this.shouldOverdrawWholeArea())return;const r=this.padding();n.beginPath(),n.rect(-r,-r,l.width()+r*2,l.height()+r*2),n.fillStrokeShape(l)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),l=n.width,r=n.height,o=Math.sqrt(Math.pow(l,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(l/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const h=e.target.getAbsolutePosition(),f=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:f.x-h.x,y:f.y-h.y},hu++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(g=>{g._fire("transformstart",{evt:e.evt,target:g})})}_handleMouseMove(e){let n,l,r;const o=this.findOne("."+this._movingAnchorName),h=o.getStage();h.setPointersPositions(e);const f=h.getPointerPosition();let g={x:f.x-this._anchorDragOffset.x,y:f.y-this._anchorDragOffset.y};const m=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(g=this.anchorDragBoundFunc()(m,g,e)),o.setAbsolutePosition(g);const v=o.getAbsolutePosition();if(m.x===v.x&&m.y===v.y)return;if(this._movingAnchorName==="rotater"){const M=this._getNodeRect();n=o.x()-M.width/2,l=-o.y()+M.height/2;const H=V.getAngle(this.rotateAnchorAngle());let G=Math.atan2(-l,n)+Math.PI/2-H;M.height<0&&(G-=Math.PI);const L=V.getAngle(this.rotation())+G,P=V.getAngle(this.rotationSnapTolerance()),W=I2(this.rotationSnaps(),L,P)-M.rotation,et=k2(M,W);this._fitNodesInto(et,e);return}const S=this.shiftBehavior();let y;S==="inverted"?y=this.keepRatio()&&!e.shiftKey:S==="none"?y=this.keepRatio():y=this.keepRatio()||e.shiftKey;let E=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(y){const M=E?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(M.x-o.x(),2)+Math.pow(M.y-o.y(),2));const H=this.findOne(".top-left").x()>M.x?-1:1,G=this.findOne(".top-left").y()>M.y?-1:1;n=r*this.cos*H,l=r*this.sin*G,this.findOne(".top-left").x(M.x-n),this.findOne(".top-left").y(M.y-l)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(y){const M=E?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-M.x,2)+Math.pow(M.y-o.y(),2));const H=this.findOne(".top-right").x()<M.x?-1:1,G=this.findOne(".top-right").y()>M.y?-1:1;n=r*this.cos*H,l=r*this.sin*G,this.findOne(".top-right").x(M.x+n),this.findOne(".top-right").y(M.y-l)}var _=o.position();this.findOne(".top-left").y(_.y),this.findOne(".bottom-right").x(_.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(y){const M=E?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(M.x-o.x(),2)+Math.pow(o.y()-M.y,2));const H=M.x<o.x()?-1:1,G=o.y()<M.y?-1:1;n=r*this.cos*H,l=r*this.sin*G,o.x(M.x-n),o.y(M.y+l)}_=o.position(),this.findOne(".top-left").x(_.x),this.findOne(".bottom-right").y(_.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(y){const M=E?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};r=Math.sqrt(Math.pow(o.x()-M.x,2)+Math.pow(o.y()-M.y,2));const H=this.findOne(".bottom-right").x()<M.x?-1:1,G=this.findOne(".bottom-right").y()<M.y?-1:1;n=r*this.cos*H,l=r*this.sin*G,this.findOne(".bottom-right").x(M.x+n),this.findOne(".bottom-right").y(M.y+l)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(E=this.centeredScaling()||e.altKey,E){const M=this.findOne(".top-left"),H=this.findOne(".bottom-right"),G=M.x(),Q=M.y(),L=this.getWidth()-H.x(),P=this.getHeight()-H.y();H.move({x:-G,y:-Q}),M.move({x:L,y:P})}const N=this.findOne(".top-left").getAbsolutePosition();n=N.x,l=N.y;const A=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),O=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:l,width:A,height:O,rotation:V.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const l=this.getNode();hu--,this._fire("transformend",{evt:e,target:l}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),l&&this._nodes.forEach(r=>{var o;r._fire("transformend",{evt:e,target:r}),(o=r.getLayer())===null||o===void 0||o.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const l=this._getNodeRect(),r=1;if(T._inRange(e.width,-this.padding()*2-r,r)){this.update();return}if(T._inRange(e.height,-this.padding()*2-r,r)){this.update();return}const o=new _e;if(o.rotate(V.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const y=o.point({x:-this.padding()*2,y:0});e.x+=y.x,e.y+=y.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=y.x,this._anchorDragOffset.y-=y.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const y=o.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=y.x,this._anchorDragOffset.y-=y.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const y=o.point({x:0,y:-this.padding()*2});e.x+=y.x,e.y+=y.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=y.x,this._anchorDragOffset.y-=y.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const y=o.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=y.x,this._anchorDragOffset.y-=y.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const y=this.boundBoxFunc()(l,e);y?e=y:T.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const h=1e7,f=new _e;f.translate(l.x,l.y),f.rotate(l.rotation),f.scale(l.width/h,l.height/h);const g=new _e,m=e.width/h,v=e.height/h;this.flipEnabled()===!1?(g.translate(e.x,e.y),g.rotate(e.rotation),g.translate(e.width<0?e.width:0,e.height<0?e.height:0),g.scale(Math.abs(m),Math.abs(v))):(g.translate(e.x,e.y),g.rotate(e.rotation),g.scale(m,v));const S=g.multiply(f.invert());this._nodes.forEach(y=>{var E;if(!y.getStage())return;const _=y.getParent().getAbsoluteTransform(),N=y.getTransform().copy();N.translate(y.offsetX(),y.offsetY());const A=new _e;A.multiply(_.copy().invert()).multiply(S).multiply(_).multiply(N);const O=A.decompose();y.setAttrs(O),(E=y.getLayer())===null||E===void 0||E.batchDraw()}),this.rotation(T._getRotation(e.rotation)),this._nodes.forEach(y=>{this._fire("transform",{evt:n,target:y}),y._fire("transform",{evt:n,target:y})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(T._getRotation(n.rotation));const l=n.width,r=n.height,o=this.enabledAnchors(),h=this.resizeEnabled(),f=this.padding(),g=this.anchorSize(),m=this.find("._anchor");m.forEach(L=>{L.setAttrs({width:g,height:g,offsetX:g/2,offsetY:g/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:g/2+f,offsetY:g/2+f,visible:h&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:l/2,y:0,offsetY:g/2+f,visible:h&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:l,y:0,offsetX:g/2-f,offsetY:g/2+f,visible:h&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:g/2+f,visible:h&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:l,y:r/2,offsetX:g/2-f,visible:h&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:g/2+f,offsetY:g/2-f,visible:h&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:l/2,y:r,offsetY:g/2-f,visible:h&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:l,y:r,offsetX:g/2-f,offsetY:g/2-f,visible:h&&o.indexOf("bottom-right")>=0});const v=this.rotateAnchorAngle(),S=this.rotateAnchorOffset(),y=T.degToRad(v),E=Math.sin(y),_=-Math.cos(y),N=l/2,A=r/2;let O=1/0;_<0?O=Math.min(O,-A/_):_>0&&(O=Math.min(O,(r-A)/_)),E<0?O=Math.min(O,-N/E):E>0&&(O=Math.min(O,(l-N)/E));const M=N+E*O,H=A+_*O,G=T._sign(r);this._batchChangeChild(".rotater",{x:M+E*S*G,y:H+_*S*G-f*_,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:l,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(L=>L.draggable()),x:0,y:0});const Q=this.anchorStyleFunc();Q&&m.forEach(L=>{Q(L)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Yn.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(T.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...e)}toObject(){return j.prototype.toObject.call(this)}clone(e){return j.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}dt.isTransforming=()=>hu>0;function $2(u){return u instanceof Array||T.warn("enabledAnchors value should be an array"),u instanceof Array&&u.forEach(function(e){Fl.indexOf(e)===-1&&T.warn("Unknown anchor name: "+e+". Available names are: "+Fl.join(", "))}),u||[]}dt.prototype.className="Transformer";Bt(dt);C.addGetterSetter(dt,"enabledAnchors",Fl,$2);C.addGetterSetter(dt,"flipEnabled",!0,Be());C.addGetterSetter(dt,"resizeEnabled",!0);C.addGetterSetter(dt,"anchorSize",10,q());C.addGetterSetter(dt,"rotateEnabled",!0);C.addGetterSetter(dt,"rotateLineVisible",!0);C.addGetterSetter(dt,"rotationSnaps",[]);C.addGetterSetter(dt,"rotateAnchorOffset",50,q());C.addGetterSetter(dt,"rotateAnchorAngle",0,q());C.addGetterSetter(dt,"rotateAnchorCursor","crosshair");C.addGetterSetter(dt,"rotationSnapTolerance",5,q());C.addGetterSetter(dt,"borderEnabled",!0);C.addGetterSetter(dt,"anchorStroke","rgb(0, 161, 255)");C.addGetterSetter(dt,"anchorStrokeWidth",1,q());C.addGetterSetter(dt,"anchorFill","white");C.addGetterSetter(dt,"anchorCornerRadius",0,q());C.addGetterSetter(dt,"borderStroke","rgb(0, 161, 255)");C.addGetterSetter(dt,"borderStrokeWidth",1,q());C.addGetterSetter(dt,"borderDash");C.addGetterSetter(dt,"keepRatio",!0);C.addGetterSetter(dt,"shiftBehavior","default");C.addGetterSetter(dt,"centeredScaling",!1);C.addGetterSetter(dt,"ignoreStroke",!1);C.addGetterSetter(dt,"padding",0,q());C.addGetterSetter(dt,"nodes");C.addGetterSetter(dt,"node");C.addGetterSetter(dt,"boundBoxFunc");C.addGetterSetter(dt,"anchorDragBoundFunc");C.addGetterSetter(dt,"anchorStyleFunc");C.addGetterSetter(dt,"shouldOverdrawWholeArea",!1);C.addGetterSetter(dt,"useSingleNodeRotation",!0);C.backCompat(dt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class sa extends U{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,V.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}sa.prototype.className="Wedge";sa.prototype._centroid=!0;sa.prototype._attrsAffectingSize=["radius"];Bt(sa);C.addGetterSetter(sa,"radius",0,q());C.addGetterSetter(sa,"angle",0,q());C.addGetterSetter(sa,"clockwise",!1);C.backCompat(sa,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function Vc(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const t3=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],e3=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function a3(u,e){const n=u.data,l=u.width,r=u.height;let o,h,f,g,m,v,S,y,E,_,N,A,O,M,H,G,Q,L,P,w;const W=e+e+1,et=l-1,ct=r-1,k=e+1,lt=k*(k+1)/2,rt=new Vc,F=t3[e],Z=e3[e];let bt=null,I=rt,st=null,Ct=null;for(let pt=1;pt<W;pt++)I=I.next=new Vc,pt===k&&(bt=I);I.next=rt,f=h=0;for(let pt=0;pt<r;pt++){A=O=M=H=g=m=v=S=0,y=k*(G=n[h]),E=k*(Q=n[h+1]),_=k*(L=n[h+2]),N=k*(P=n[h+3]),g+=lt*G,m+=lt*Q,v+=lt*L,S+=lt*P,I=rt;for(let Ot=0;Ot<k;Ot++)I.r=G,I.g=Q,I.b=L,I.a=P,I=I.next;for(let Ot=1;Ot<k;Ot++)o=h+((et<Ot?et:Ot)<<2),g+=(I.r=G=n[o])*(w=k-Ot),m+=(I.g=Q=n[o+1])*w,v+=(I.b=L=n[o+2])*w,S+=(I.a=P=n[o+3])*w,A+=G,O+=Q,M+=L,H+=P,I=I.next;st=rt,Ct=bt;for(let Ot=0;Ot<l;Ot++)n[h+3]=P=S*F>>Z,P!==0?(P=255/P,n[h]=(g*F>>Z)*P,n[h+1]=(m*F>>Z)*P,n[h+2]=(v*F>>Z)*P):n[h]=n[h+1]=n[h+2]=0,g-=y,m-=E,v-=_,S-=N,y-=st.r,E-=st.g,_-=st.b,N-=st.a,o=f+((o=Ot+e+1)<et?o:et)<<2,A+=st.r=n[o],O+=st.g=n[o+1],M+=st.b=n[o+2],H+=st.a=n[o+3],g+=A,m+=O,v+=M,S+=H,st=st.next,y+=G=Ct.r,E+=Q=Ct.g,_+=L=Ct.b,N+=P=Ct.a,A-=G,O-=Q,M-=L,H-=P,Ct=Ct.next,h+=4;f+=l}for(let pt=0;pt<l;pt++){O=M=H=A=m=v=S=g=0,h=pt<<2,y=k*(G=n[h]),E=k*(Q=n[h+1]),_=k*(L=n[h+2]),N=k*(P=n[h+3]),g+=lt*G,m+=lt*Q,v+=lt*L,S+=lt*P,I=rt;for(let Wt=0;Wt<k;Wt++)I.r=G,I.g=Q,I.b=L,I.a=P,I=I.next;let Ot=l;for(let Wt=1;Wt<=e;Wt++)h=Ot+pt<<2,g+=(I.r=G=n[h])*(w=k-Wt),m+=(I.g=Q=n[h+1])*w,v+=(I.b=L=n[h+2])*w,S+=(I.a=P=n[h+3])*w,A+=G,O+=Q,M+=L,H+=P,I=I.next,Wt<ct&&(Ot+=l);h=pt,st=rt,Ct=bt;for(let Wt=0;Wt<r;Wt++)o=h<<2,n[o+3]=P=S*F>>Z,P>0?(P=255/P,n[o]=(g*F>>Z)*P,n[o+1]=(m*F>>Z)*P,n[o+2]=(v*F>>Z)*P):n[o]=n[o+1]=n[o+2]=0,g-=y,m-=E,v-=_,S-=N,y-=st.r,E-=st.g,_-=st.b,N-=st.a,o=pt+((o=Wt+k)<ct?o:ct)*l<<2,g+=A+=st.r=n[o],m+=O+=st.g=n[o+1],v+=M+=st.b=n[o+2],S+=H+=st.a=n[o+3],st=st.next,y+=G=Ct.r,E+=Q=Ct.g,_+=L=Ct.b,N+=P=Ct.a,A-=G,O-=Q,M-=L,H-=P,Ct=Ct.next,h+=l}}const n3=function(e){const n=Math.round(this.blurRadius());n>0&&a3(e,n)};C.addGetterSetter(j,"blurRadius",0,q(),C.afterSetFilter);const i3=function(u){const e=this.brightness()*255,n=u.data,l=n.length;for(let r=0;r<l;r+=4)n[r]+=e,n[r+1]+=e,n[r+2]+=e};C.addGetterSetter(j,"brightness",0,q(),C.afterSetFilter);const l3=function(u){const e=this.brightness(),n=u.data,l=n.length;for(let r=0;r<l;r+=4)n[r]=Math.min(255,n[r]*e),n[r+1]=Math.min(255,n[r+1]*e),n[r+2]=Math.min(255,n[r+2]*e)},s3=function(u){const e=Math.pow((this.contrast()+100)/100,2),n=u.data,l=n.length;let r=150,o=150,h=150;for(let f=0;f<l;f+=4)r=n[f],o=n[f+1],h=n[f+2],r/=255,r-=.5,r*=e,r+=.5,r*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,h/=255,h-=.5,h*=e,h+=.5,h*=255,r=r<0?0:r>255?255:r,o=o<0?0:o>255?255:o,h=h<0?0:h>255?255:h,n[f]=r,n[f+1]=o,n[f+2]=h};C.addGetterSetter(j,"contrast",0,q(),C.afterSetFilter);const r3=function(u){var e,n,l,r,o,h,f,g,m;const v=u.data,S=u.width,y=u.height,E=Math.min(1,Math.max(0,(n=(e=this.embossStrength)===null||e===void 0?void 0:e.call(this))!==null&&n!==void 0?n:.5)),_=Math.min(1,Math.max(0,(r=(l=this.embossWhiteLevel)===null||l===void 0?void 0:l.call(this))!==null&&r!==void 0?r:.5)),A=(f={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(h=(o=this.embossDirection)===null||o===void 0?void 0:o.call(this))!==null&&h!==void 0?h:"top-left"])!==null&&f!==void 0?f:315,O=!!((m=(g=this.embossBlend)===null||g===void 0?void 0:g.call(this))!==null&&m!==void 0&&m),M=E*10,H=_*255,G=A*Math.PI/180,Q=Math.cos(G),L=Math.sin(G),P=128/1020*M,w=new Uint8ClampedArray(v),W=new Float32Array(S*y);for(let rt=0,F=0;F<v.length;F+=4,rt++)W[rt]=.2126*w[F]+.7152*w[F+1]+.0722*w[F+2];const et=[-1,0,1,-2,0,2,-1,0,1],ct=[-1,-2,-1,0,0,0,1,2,1],k=[-S-1,-S,-S+1,-1,0,1,S-1,S,S+1],lt=rt=>rt<0?0:rt>255?255:rt;for(let rt=1;rt<y-1;rt++)for(let F=1;F<S-1;F++){const Z=rt*S+F;let bt=0,I=0;bt+=W[Z+k[0]]*et[0],I+=W[Z+k[0]]*ct[0],bt+=W[Z+k[1]]*et[1],I+=W[Z+k[1]]*ct[1],bt+=W[Z+k[2]]*et[2],I+=W[Z+k[2]]*ct[2],bt+=W[Z+k[3]]*et[3],I+=W[Z+k[3]]*ct[3],bt+=W[Z+k[5]]*et[5],I+=W[Z+k[5]]*ct[5],bt+=W[Z+k[6]]*et[6],I+=W[Z+k[6]]*ct[6],bt+=W[Z+k[7]]*et[7],I+=W[Z+k[7]]*ct[7],bt+=W[Z+k[8]]*et[8],I+=W[Z+k[8]]*ct[8];const st=Q*bt+L*I,Ct=lt(H+st*P),pt=Z*4;if(O){const Ot=Ct-H;v[pt]=lt(w[pt]+Ot),v[pt+1]=lt(w[pt+1]+Ot),v[pt+2]=lt(w[pt+2]+Ot),v[pt+3]=w[pt+3]}else v[pt]=v[pt+1]=v[pt+2]=Ct,v[pt+3]=w[pt+3]}for(let rt=0;rt<S;rt++){let F=rt*4,Z=((y-1)*S+rt)*4;v[F]=w[F],v[F+1]=w[F+1],v[F+2]=w[F+2],v[F+3]=w[F+3],v[Z]=w[Z],v[Z+1]=w[Z+1],v[Z+2]=w[Z+2],v[Z+3]=w[Z+3]}for(let rt=1;rt<y-1;rt++){let F=rt*S*4,Z=(rt*S+(S-1))*4;v[F]=w[F],v[F+1]=w[F+1],v[F+2]=w[F+2],v[F+3]=w[F+3],v[Z]=w[Z],v[Z+1]=w[Z+1],v[Z+2]=w[Z+2],v[Z+3]=w[Z+3]}return u};C.addGetterSetter(j,"embossStrength",.5,q(),C.afterSetFilter);C.addGetterSetter(j,"embossWhiteLevel",.5,q(),C.afterSetFilter);C.addGetterSetter(j,"embossDirection","top-left",void 0,C.afterSetFilter);C.addGetterSetter(j,"embossBlend",!1,void 0,C.afterSetFilter);function Pr(u,e,n,l,r){const o=n-e,h=r-l;if(o===0)return l+h/2;if(h===0)return l;let f=(u-e)/o;return f=h*f+l,f}const u3=function(u){const e=u.data,n=e.length;let l=e[0],r=l,o,h=e[1],f=h,g,m=e[2],v=m,S;const y=this.enhance();if(y===0)return;for(let H=0;H<n;H+=4)o=e[H+0],o<l?l=o:o>r&&(r=o),g=e[H+1],g<h?h=g:g>f&&(f=g),S=e[H+2],S<m?m=S:S>v&&(v=S);r===l&&(r=255,l=0),f===h&&(f=255,h=0),v===m&&(v=255,m=0);let E,_,N,A,O,M;if(y>0)E=r+y*(255-r),_=l-y*(l-0),N=f+y*(255-f),A=h-y*(h-0),O=v+y*(255-v),M=m-y*(m-0);else{const H=(r+l)*.5;E=r+y*(r-H),_=l+y*(l-H);const G=(f+h)*.5;N=f+y*(f-G),A=h+y*(h-G);const Q=(v+m)*.5;O=v+y*(v-Q),M=m+y*(m-Q)}for(let H=0;H<n;H+=4)e[H+0]=Pr(e[H+0],l,r,_,E),e[H+1]=Pr(e[H+1],h,f,A,N),e[H+2]=Pr(e[H+2],m,v,M,O)};C.addGetterSetter(j,"enhance",0,q(),C.afterSetFilter);const o3=function(u){const e=u.data,n=e.length;for(let l=0;l<n;l+=4){const r=.34*e[l]+.5*e[l+1]+.16*e[l+2];e[l]=r,e[l+1]=r,e[l+2]=r}};C.addGetterSetter(j,"hue",0,q(),C.afterSetFilter);C.addGetterSetter(j,"saturation",0,q(),C.afterSetFilter);C.addGetterSetter(j,"luminance",0,q(),C.afterSetFilter);const h3=function(u){const e=u.data,n=e.length,l=1,r=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,h=this.luminance()*127,f=l*r*Math.cos(o*Math.PI/180),g=l*r*Math.sin(o*Math.PI/180),m=.299*l+.701*f+.167*g,v=.587*l-.587*f+.33*g,S=.114*l-.114*f-.497*g,y=.299*l-.299*f-.328*g,E=.587*l+.413*f+.035*g,_=.114*l-.114*f+.293*g,N=.299*l-.3*f+1.25*g,A=.587*l-.586*f-1.05*g,O=.114*l+.886*f-.2*g;let M,H,G,Q;for(let L=0;L<n;L+=4)M=e[L+0],H=e[L+1],G=e[L+2],Q=e[L+3],e[L+0]=m*M+v*H+S*G+h,e[L+1]=y*M+E*H+_*G+h,e[L+2]=N*M+A*H+O*G+h,e[L+3]=Q},c3=function(u){const e=u.data,n=e.length,l=Math.pow(2,this.value()),r=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,h=l*r*Math.cos(o*Math.PI/180),f=l*r*Math.sin(o*Math.PI/180),g=.299*l+.701*h+.167*f,m=.587*l-.587*h+.33*f,v=.114*l-.114*h-.497*f,S=.299*l-.299*h-.328*f,y=.587*l+.413*h+.035*f,E=.114*l-.114*h+.293*f,_=.299*l-.3*h+1.25*f,N=.587*l-.586*h-1.05*f,A=.114*l+.886*h-.2*f;for(let O=0;O<n;O+=4){const M=e[O+0],H=e[O+1],G=e[O+2],Q=e[O+3];e[O+0]=g*M+m*H+v*G,e[O+1]=S*M+y*H+E*G,e[O+2]=_*M+N*H+A*G,e[O+3]=Q}};C.addGetterSetter(j,"hue",0,q(),C.afterSetFilter);C.addGetterSetter(j,"saturation",0,q(),C.afterSetFilter);C.addGetterSetter(j,"value",0,q(),C.afterSetFilter);const f3=function(u){const e=u.data,n=e.length;for(let l=0;l<n;l+=4)e[l]=255-e[l],e[l+1]=255-e[l+1],e[l+2]=255-e[l+2]},d3=function(u,e,n){const l=u.data,r=e.data,o=u.width,h=u.height,f=n.polarCenterX||o/2,g=n.polarCenterY||h/2;let m=Math.sqrt(f*f+g*g),v=o-f,S=h-g;const y=Math.sqrt(v*v+S*S);m=y>m?y:m;const E=h,_=o,N=360/_*Math.PI/180;for(let A=0;A<_;A+=1){const O=Math.sin(A*N),M=Math.cos(A*N);for(let H=0;H<E;H+=1){v=Math.floor(f+m*H/E*M),S=Math.floor(g+m*H/E*O);let G=(S*o+v)*4;const Q=l[G+0],L=l[G+1],P=l[G+2],w=l[G+3];G=(A+H*o)*4,r[G+0]=Q,r[G+1]=L,r[G+2]=P,r[G+3]=w}}},g3=function(u,e,n){const l=u.data,r=e.data,o=u.width,h=u.height,f=n.polarCenterX||o/2,g=n.polarCenterY||h/2;let m=Math.sqrt(f*f+g*g),v=o-f,S=h-g;const y=Math.sqrt(v*v+S*S);m=y>m?y:m;const E=h,_=o,N=0;let A,O;for(v=0;v<o;v+=1)for(S=0;S<h;S+=1){const M=v-f,H=S-g,G=Math.sqrt(M*M+H*H)*E/m;let Q=(Math.atan2(H,M)*180/Math.PI+360+N)%360;Q=Q*_/360,A=Math.floor(Q),O=Math.floor(G);let L=(O*o+A)*4;const P=l[L+0],w=l[L+1],W=l[L+2],et=l[L+3];L=(S*o+v)*4,r[L+0]=P,r[L+1]=w,r[L+2]=W,r[L+3]=et}},m3=function(u){const e=u.width,n=u.height;let l,r,o,h,f,g,m,v,S,y,E=Math.round(this.kaleidoscopePower());const _=Math.round(this.kaleidoscopeAngle()),N=Math.floor(e*(_%360)/360);if(E<1)return;const A=T.createCanvasElement();A.width=e,A.height=n;const O=A.getContext("2d").getImageData(0,0,e,n);T.releaseCanvas(A),d3(u,O,{polarCenterX:e/2,polarCenterY:n/2});let M=e/Math.pow(2,E);for(;M<=8;)M=M*2,E-=1;M=Math.ceil(M);let H=M,G=0,Q=H,L=1;for(N+M>e&&(G=H,Q=0,L=-1),r=0;r<n;r+=1)for(l=G;l!==Q;l+=L)o=Math.round(l+N)%e,S=(e*r+o)*4,f=O.data[S+0],g=O.data[S+1],m=O.data[S+2],v=O.data[S+3],y=(e*r+l)*4,O.data[y+0]=f,O.data[y+1]=g,O.data[y+2]=m,O.data[y+3]=v;for(r=0;r<n;r+=1)for(H=Math.floor(M),h=0;h<E;h+=1){for(l=0;l<H+1;l+=1)S=(e*r+l)*4,f=O.data[S+0],g=O.data[S+1],m=O.data[S+2],v=O.data[S+3],y=(e*r+H*2-l-1)*4,O.data[y+0]=f,O.data[y+1]=g,O.data[y+2]=m,O.data[y+3]=v;H*=2}g3(O,u,{})};C.addGetterSetter(j,"kaleidoscopePower",2,q(),C.afterSetFilter);C.addGetterSetter(j,"kaleidoscopeAngle",0,q(),C.afterSetFilter);function Zl(u,e,n){let l=(n*u.width+e)*4;const r=[];return r.push(u.data[l++],u.data[l++],u.data[l++],u.data[l++]),r}function bi(u,e){return Math.sqrt(Math.pow(u[0]-e[0],2)+Math.pow(u[1]-e[1],2)+Math.pow(u[2]-e[2],2))}function p3(u){const e=[0,0,0];for(let n=0;n<u.length;n++)e[0]+=u[n][0],e[1]+=u[n][1],e[2]+=u[n][2];return e[0]/=u.length,e[1]/=u.length,e[2]/=u.length,e}function v3(u,e){const n=Zl(u,0,0),l=Zl(u,u.width-1,0),r=Zl(u,0,u.height-1),o=Zl(u,u.width-1,u.height-1),h=e||10;if(bi(n,l)<h&&bi(l,o)<h&&bi(o,r)<h&&bi(r,n)<h){const f=p3([l,n,o,r]),g=[];for(let m=0;m<u.width*u.height;m++){const v=bi(f,[u.data[m*4],u.data[m*4+1],u.data[m*4+2]]);g[m]=v<h?0:255}return g}}function y3(u,e){for(let n=0;n<u.width*u.height;n++)u.data[4*n+3]=e[n]}function S3(u,e,n){const l=[1,1,1,1,0,1,1,1,1],r=Math.round(Math.sqrt(l.length)),o=Math.floor(r/2),h=[];for(let f=0;f<n;f++)for(let g=0;g<e;g++){const m=f*e+g;let v=0;for(let S=0;S<r;S++)for(let y=0;y<r;y++){const E=f+S-o,_=g+y-o;if(E>=0&&E<n&&_>=0&&_<e){const N=E*e+_,A=l[S*r+y];v+=u[N]*A}}h[m]=v===2040?255:0}return h}function _3(u,e,n){const l=[1,1,1,1,1,1,1,1,1],r=Math.round(Math.sqrt(l.length)),o=Math.floor(r/2),h=[];for(let f=0;f<n;f++)for(let g=0;g<e;g++){const m=f*e+g;let v=0;for(let S=0;S<r;S++)for(let y=0;y<r;y++){const E=f+S-o,_=g+y-o;if(E>=0&&E<n&&_>=0&&_<e){const N=E*e+_,A=l[S*r+y];v+=u[N]*A}}h[m]=v>=1020?255:0}return h}function C3(u,e,n){const l=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],r=Math.round(Math.sqrt(l.length)),o=Math.floor(r/2),h=[];for(let f=0;f<n;f++)for(let g=0;g<e;g++){const m=f*e+g;let v=0;for(let S=0;S<r;S++)for(let y=0;y<r;y++){const E=f+S-o,_=g+y-o;if(E>=0&&E<n&&_>=0&&_<e){const N=E*e+_,A=l[S*r+y];v+=u[N]*A}}h[m]=v}return h}const E3=function(u){const e=this.threshold();let n=v3(u,e);return n&&(n=S3(n,u.width,u.height),n=_3(n,u.width,u.height),n=C3(n,u.width,u.height),y3(u,n)),u};C.addGetterSetter(j,"threshold",0,q(),C.afterSetFilter);const b3=function(u){const e=this.noise()*255,n=u.data,l=n.length,r=e/2;for(let o=0;o<l;o+=4)n[o+0]+=r-2*r*Math.random(),n[o+1]+=r-2*r*Math.random(),n[o+2]+=r-2*r*Math.random()};C.addGetterSetter(j,"noise",.2,q(),C.afterSetFilter);const T3=function(u){let e=Math.ceil(this.pixelSize()),n=u.width,l=u.height,r=Math.ceil(n/e),o=Math.ceil(l/e),h=u.data;if(e<=0){T.error("pixelSize value can not be <= 0");return}for(let f=0;f<r;f+=1)for(let g=0;g<o;g+=1){let m=0,v=0,S=0,y=0;const E=f*e,_=E+e,N=g*e,A=N+e;let O=0;for(let M=E;M<_;M+=1)if(!(M>=n))for(let H=N;H<A;H+=1){if(H>=l)continue;const G=(n*H+M)*4;m+=h[G+0],v+=h[G+1],S+=h[G+2],y+=h[G+3],O+=1}m=m/O,v=v/O,S=S/O,y=y/O;for(let M=E;M<_;M+=1)if(!(M>=n))for(let H=N;H<A;H+=1){if(H>=l)continue;const G=(n*H+M)*4;h[G+0]=m,h[G+1]=v,h[G+2]=S,h[G+3]=y}}};C.addGetterSetter(j,"pixelSize",8,q(),C.afterSetFilter);const x3=function(u){const e=Math.round(this.levels()*254)+1,n=u.data,l=n.length,r=255/e;for(let o=0;o<l;o+=1)n[o]=Math.floor(n[o]/r)*r};C.addGetterSetter(j,"levels",.5,q(),C.afterSetFilter);const A3=function(u){const e=u.data,n=e.length,l=this.red(),r=this.green(),o=this.blue();for(let h=0;h<n;h+=4){const f=(.34*e[h]+.5*e[h+1]+.16*e[h+2])/255;e[h]=f*l,e[h+1]=f*r,e[h+2]=f*o,e[h+3]=e[h+3]}};C.addGetterSetter(j,"red",0,function(u){return this._filterUpToDate=!1,u>255?255:u<0?0:Math.round(u)});C.addGetterSetter(j,"green",0,function(u){return this._filterUpToDate=!1,u>255?255:u<0?0:Math.round(u)});C.addGetterSetter(j,"blue",0,Ic,C.afterSetFilter);const M3=function(u){const e=u.data,n=e.length,l=this.red(),r=this.green(),o=this.blue(),h=this.alpha();for(let f=0;f<n;f+=4){const g=1-h;e[f]=l*h+e[f]*g,e[f+1]=r*h+e[f+1]*g,e[f+2]=o*h+e[f+2]*g}};C.addGetterSetter(j,"red",0,function(u){return this._filterUpToDate=!1,u>255?255:u<0?0:Math.round(u)});C.addGetterSetter(j,"green",0,function(u){return this._filterUpToDate=!1,u>255?255:u<0?0:Math.round(u)});C.addGetterSetter(j,"blue",0,Ic,C.afterSetFilter);C.addGetterSetter(j,"alpha",1,function(u){return this._filterUpToDate=!1,u>1?1:u<0?0:u});const R3=function(u){const e=u.data,n=e.length;for(let l=0;l<n;l+=4){const r=e[l+0],o=e[l+1],h=e[l+2];e[l+0]=Math.min(255,r*.393+o*.769+h*.189),e[l+1]=Math.min(255,r*.349+o*.686+h*.168),e[l+2]=Math.min(255,r*.272+o*.534+h*.131)}},N3=function(u){const n=u.data;for(let l=0;l<n.length;l+=4){const r=n[l],o=n[l+1],h=n[l+2];.2126*r+.7152*o+.0722*h>=128&&(n[l]=255-r,n[l+1]=255-o,n[l+2]=255-h)}return u},O3=function(u){const e=this.threshold()*255,n=u.data,l=n.length;for(let r=0;r<l;r+=1)n[r]=n[r]<e?0:255};C.addGetterSetter(j,"threshold",.5,q(),C.afterSetFilter);Xn.Util._assign(Xn,{Arc:ia,Arrow:an,Circle:qn,Ellipse:Na,Image:Ee,Label:pu,Tag:nn,Line:la,Path:Rt,Rect:Bi,RegularPolygon:Oa,Ring:ln,Sprite:je,Star:za,Text:Nt,TextPath:Qt,Transformer:dt,Wedge:sa,Filters:{Blur:n3,Brightness:l3,Brighten:i3,Contrast:s3,Emboss:r3,Enhance:u3,Grayscale:o3,HSL:h3,HSV:c3,Invert:f3,Kaleidoscope:m3,Mask:E3,Noise:b3,Pixelate:T3,Posterize:x3,RGB:A3,RGBA:M3,Sepia:R3,Solarize:N3,Threshold:O3}});var Fr={exports:{}},Wr={exports:{}};/**
|
|
16
|
+
* @license React
|
|
17
|
+
* react-reconciler.production.js
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the MIT license found in the
|
|
22
|
+
* LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/var Kc;function z3(){return Kc||(Kc=1,(function(u){u.exports=function(e){function n(t,a,i,s){return new of(t,a,i,s)}function l(){}function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){var a=t,i=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(i=a.return),t=a.return;while(t)}return a.tag===3?i:null}function h(t){if(o(t)!==t)throw Error(r(188))}function f(t){var a=t.alternate;if(!a){if(a=o(t),a===null)throw Error(r(188));return a!==t?null:t}for(var i=t,s=a;;){var c=i.return;if(c===null)break;var d=c.alternate;if(d===null){if(s=c.return,s!==null){i=s;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===i)return h(c),t;if(d===s)return h(c),a;d=d.sibling}throw Error(r(188))}if(i.return!==s.return)i=c,s=d;else{for(var p=!1,b=c.child;b;){if(b===i){p=!0,i=c,s=d;break}if(b===s){p=!0,s=c,i=d;break}b=b.sibling}if(!p){for(b=d.child;b;){if(b===i){p=!0,i=d,s=c;break}if(b===s){p=!0,s=d,i=c;break}b=b.sibling}if(!p)throw Error(r(189))}}if(i.alternate!==s)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?t:a}function g(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=g(t),a!==null)return a;t=t.sibling}return null}function m(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(t.tag!==4&&(a=m(t),a!==null))return a;t=t.sibling}return null}function v(t){return t===null||typeof t!="object"?null:(t=Uh&&t[Uh]||t["@@iterator"],typeof t=="function"?t:null)}function S(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===gf?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case mn:return"Fragment";case sr:return"Profiler";case Hh:return"StrictMode";case ur:return"Suspense";case or:return"SuspenseList";case cr:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case gn:return"Portal";case ga:return t.displayName||"Context";case Bh:return(t._context.displayName||"Context")+".Consumer";case rr:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case hr:return a=t.displayName||null,a!==null?a:S(t.type)||"Memo";case ma:a=t._payload,t=t._init;try{return S(t(a))}catch{}}return null}function y(t){return{current:t}}function E(t){0>yn||(t.current=vr[yn],vr[yn]=null,yn--)}function _(t,a){yn++,vr[yn]=t.current,t.current=a}function N(t){return t>>>=0,t===0?32:31-(V1(t)/K1|0)|0}function A(t){var a=t&42;if(a!==0)return a;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function O(t,a,i){var s=t.pendingLanes;if(s===0)return 0;var c=0,d=t.suspendedLanes,p=t.pingedLanes;t=t.warmLanes;var b=s&134217727;return b!==0?(s=b&~d,s!==0?c=A(s):(p&=b,p!==0?c=A(p):i||(i=b&~t,i!==0&&(c=A(i))))):(b=s&~d,b!==0?c=A(b):p!==0?c=A(p):i||(i=s&~t,i!==0&&(c=A(i)))),c===0?0:a!==0&&a!==c&&(a&d)===0&&(d=c&-c,i=a&-a,d>=i||d===32&&(i&4194048)!==0)?a:c}function M(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function H(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function G(){var t=yl;return yl<<=1,(yl&62914560)===0&&(yl=4194304),t}function Q(t){for(var a=[],i=0;31>i;i++)a.push(t);return a}function L(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function P(t,a,i,s,c,d){var p=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var b=t.entanglements,D=t.expirationTimes,B=t.hiddenUpdates;for(i=p&~i;0<i;){var K=31-ge(i),Y=1<<K;b[K]=0,D[K]=-1;var J=B[K];if(J!==null)for(B[K]=null,K=0;K<J.length;K++){var nt=J[K];nt!==null&&(nt.lane&=-536870913)}i&=~Y}s!==0&&w(t,s,0),d!==0&&c===0&&t.tag!==0&&(t.suspendedLanes|=d&~(p&~a))}function w(t,a,i){t.pendingLanes|=a,t.suspendedLanes&=~a;var s=31-ge(a);t.entangledLanes|=a,t.entanglements[s]=t.entanglements[s]|1073741824|i&261930}function W(t,a){var i=t.entangledLanes|=a;for(t=t.entanglements;i;){var s=31-ge(i),c=1<<s;c&a|t[s]&a&&(t[s]|=a),i&=~c}}function et(t,a){var i=a&-a;return i=(i&42)!==0?1:ct(i),(i&(t.suspendedLanes|a))!==0?0:i}function ct(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function k(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function lt(t){if(typeof P1=="function"&&F1(t),me&&typeof me.setStrictMode=="function")try{me.setStrictMode(li,t)}catch{}}function rt(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}function F(t){if(_r===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);_r=a&&a[1]||"",uc=-1<i.stack.indexOf(`
|
|
24
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
25
|
+
`+_r+t+uc}function Z(t,a){if(!t||Cr)return"";Cr=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(a){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(nt){var J=nt}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(nt){J=nt}t.call(Y.prototype)}}else{try{throw Error()}catch(nt){J=nt}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(nt){if(nt&&J&&typeof nt.stack=="string")return[nt.stack,J.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=s.DetermineComponentFrameRoot(),p=d[0],b=d[1];if(p&&b){var D=p.split(`
|
|
26
|
+
`),B=b.split(`
|
|
27
|
+
`);for(c=s=0;s<D.length&&!D[s].includes("DetermineComponentFrameRoot");)s++;for(;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;if(s===D.length||c===B.length)for(s=D.length-1,c=B.length-1;1<=s&&0<=c&&D[s]!==B[c];)c--;for(;1<=s&&0<=c;s--,c--)if(D[s]!==B[c]){if(s!==1||c!==1)do if(s--,c--,0>c||D[s]!==B[c]){var K=`
|
|
28
|
+
`+D[s].replace(" at new "," at ");return t.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",t.displayName)),K}while(1<=s&&0<=c);break}}}finally{Cr=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?F(i):""}function bt(t,a){switch(t.tag){case 26:case 27:case 5:return F(t.type);case 16:return F("Lazy");case 13:return t.child!==a&&a!==null?F("Suspense Fallback"):F("Suspense");case 19:return F("SuspenseList");case 0:case 15:return Z(t.type,!1);case 11:return Z(t.type.render,!1);case 1:return Z(t.type,!0);case 31:return F("Activity");default:return""}}function I(t){try{var a="",i=null;do a+=bt(t,i),i=t,t=t.return;while(t);return a}catch(s){return`
|
|
29
|
+
Error generating stack: `+s.message+`
|
|
30
|
+
`+s.stack}}function st(t,a){if(typeof t=="object"&&t!==null){var i=oc.get(t);return i!==void 0?i:(a={value:t,source:a,stack:I(a)},oc.set(t,a),a)}return{value:t,source:a,stack:I(a)}}function Ct(t,a){_n[Cn++]=si,_n[Cn++]=_l,_l=t,si=a}function pt(t,a,i){be[Te++]=Xe,be[Te++]=qe,be[Te++]=pa,pa=t;var s=Xe;t=qe;var c=32-ge(s)-1;s&=~(1<<c),i+=1;var d=32-ge(a)+c;if(30<d){var p=c-c%5;d=(s&(1<<p)-1).toString(32),s>>=p,c-=p,Xe=1<<32-ge(a)+c|i<<c|s,qe=d+t}else Xe=1<<d|i<<c|s,qe=t}function Ot(t){t.return!==null&&(Ct(t,1),pt(t,1,0))}function Wt(t){for(;t===_l;)_l=_n[--Cn],_n[Cn]=null,si=_n[--Cn],_n[Cn]=null;for(;t===pa;)pa=be[--Te],be[Te]=null,qe=be[--Te],be[Te]=null,Xe=be[--Te],be[Te]=null}function yu(t,a){be[Te++]=Xe,be[Te++]=qe,be[Te++]=pa,Xe=a.id,qe=a.overflow,pa=t}function Ui(t,a){_(va,a),_(ri,t),_($t,null),t=vf(a),E($t),_($t,t)}function sn(){E($t),E(ri),E(va)}function es(t){t.memoizedState!==null&&_(Cl,t);var a=$t.current,i=yf(a,t.type);a!==i&&(_(ri,t),_($t,i))}function Li(t){ri.current===t&&(E($t),E(ri)),Cl.current===t&&(E(Cl),Fe?Va._currentValue=pn:Va._currentValue2=pn)}function Ve(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw jn(st(a,t)),Er}function Su(t,a){if(!ie)throw Error(r(175));y1(t.stateNode,t.type,t.memoizedProps,a,t)||Ve(t,!0)}function _u(t){for(te=t.return;te;)switch(te.tag){case 5:case 31:case 13:xe=!1;return;case 27:case 3:xe=!0;return;default:te=te.return}}function rn(t){if(!ie||t!==te)return!1;if(!gt)return _u(t),gt=!0,!1;var a=t.tag;if(wt?a!==3&&a!==27&&(a!==5||Fh(t.type)&&!ml(t.type,t.memoizedProps))&&Dt&&Ve(t):a!==3&&(a!==5||Fh(t.type)&&!ml(t.type,t.memoizedProps))&&Dt&&Ve(t),_u(t),a===13){if(!ie)throw Error(r(316));if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Dt=b1(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));Dt=E1(t)}else Dt=wt&&a===27?u1(t.type,Dt):te?Ph(t.stateNode):null;return!0}function Ga(){ie&&(Dt=te=null,gt=!1)}function as(){var t=ya;return t!==null&&(he===null?he=t:he.push.apply(he,t),ya=null),t}function jn(t){ya===null?ya=[t]:ya.push(t)}function ra(t,a,i){Fe?(_(El,a._currentValue),a._currentValue=i):(_(El,a._currentValue2),a._currentValue2=i)}function Ke(t){var a=El.current;Fe?t._currentValue=a:t._currentValue2=a,E(El)}function ns(t,a,i){for(;t!==null;){var s=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,s!==null&&(s.childLanes|=a)):s!==null&&(s.childLanes&a)!==a&&(s.childLanes|=a),t===i)break;t=t.return}}function is(t,a,i,s){var c=t.child;for(c!==null&&(c.return=t);c!==null;){var d=c.dependencies;if(d!==null){var p=c.child;d=d.firstContext;t:for(;d!==null;){var b=d;d=c;for(var D=0;D<a.length;D++)if(b.context===a[D]){d.lanes|=i,b=d.alternate,b!==null&&(b.lanes|=i),ns(d.return,i,t),s||(p=null);break t}d=b.next}}else if(c.tag===18){if(p=c.return,p===null)throw Error(r(341));p.lanes|=i,d=p.alternate,d!==null&&(d.lanes|=i),ns(p,i,t),p=null}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}}function un(t,a,i,s){t=null;for(var c=a,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var p=c.alternate;if(p===null)throw Error(r(387));if(p=p.memoizedProps,p!==null){var b=c.type;pe(c.pendingProps.value,p.value)||(t!==null?t.push(b):t=[b])}}else if(c===Cl.current){if(p=c.alternate,p===null)throw Error(r(387));p.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(t!==null?t.push(Va):t=[Va])}c=c.return}t!==null&&is(a,t,i,s),a.flags|=262144}function Yi(t){for(t=t.firstContext;t!==null;){var a=t.context;if(!pe(Fe?a._currentValue:a._currentValue2,t.memoizedValue))return!0;t=t.next}return!1}function Ha(t){Ka=t,ke=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function kt(t){return Cu(Ka,t)}function Xi(t,a){return Ka===null&&Ha(t),Cu(t,a)}function Cu(t,a){var i=Fe?a._currentValue:a._currentValue2;if(a={context:a,memoizedValue:i,next:null},ke===null){if(t===null)throw Error(r(308));ke=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else ke=ke.next=a;return i}function ls(){return{controller:new k1,data:new Map,refCount:0}}function Vn(t){t.refCount--,t.refCount===0&&I1($1,function(){t.controller.abort()})}function qi(){}function Ue(t){t!==En&&t.next===null&&(En===null?bl=En=t:En=En.next=t),Tl=!0,br||(br=!0,Y0())}function on(t,a){if(!Tr&&Tl){Tr=!0;do for(var i=!1,s=bl;s!==null;){if(t!==0){var c=s.pendingLanes;if(c===0)var d=0;else{var p=s.suspendedLanes,b=s.pingedLanes;d=(1<<31-ge(42|t)+1)-1,d&=c&~(p&~b),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(i=!0,Au(s,d))}else d=ft,d=O(s,s===xt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==ja),(d&3)===0||M(s,d)||(i=!0,Au(s,d));s=s.next}while(i);Tr=!1}}function Eu(){bu()}function bu(){Tl=br=!1;var t=0;Qa!==0&&Mf()&&(t=Qa);for(var a=ue(),i=null,s=bl;s!==null;){var c=s.next,d=Tu(s,a);d===0?(s.next=null,i===null?bl=c:i.next=c,c===null&&(En=i)):(i=s,(t!==0||(d&3)!==0)&&(Tl=!0)),s=c}Zt!==0&&Zt!==5||on(t),Qa!==0&&(Qa=0)}function Tu(t,a){for(var i=t.suspendedLanes,s=t.pingedLanes,c=t.expirationTimes,d=t.pendingLanes&-62914561;0<d;){var p=31-ge(d),b=1<<p,D=c[p];D===-1?((b&i)===0||(b&s)!==0)&&(c[p]=H(b,a)):D<=a&&(t.expiredLanes|=b),d&=~b}if(a=xt,i=ft,i=O(t,t===a?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==ja),s=t.callbackNode,i===0||t===a&&(Et===2||Et===9)||t.cancelPendingCommit!==null)return s!==null&&s!==null&&yr(s),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||M(t,i)){if(a=i&-i,a===t.callbackPriority)return a;switch(s!==null&&yr(s),k(i)){case 2:case 8:i=Z1;break;case 32:i=Sr;break;case 268435456:i=J1;break;default:i=Sr}return s=xu.bind(null,t),i=Sl(i,s),t.callbackPriority=a,t.callbackNode=i,a}return s!==null&&s!==null&&yr(s),t.callbackPriority=2,t.callbackNode=null,2}function xu(t,a){if(Zt!==0&&Zt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(ei()&&t.callbackNode!==i)return null;var s=ft;return s=O(t,t===xt?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==ja),s===0?null:(oh(t,s,a),Tu(t,ue()),t.callbackNode!=null&&t.callbackNode===i?xu.bind(null,t):null)}function Au(t,a){if(ei())return null;oh(t,a,!0)}function Y0(){Hf?Bf(function(){(ot&6)!==0?Sl(sc,Eu):bu()}):Sl(sc,Eu)}function ss(){if(Qa===0){var t=bn;t===0&&(t=pl,pl<<=1,(pl&261888)===0&&(pl=256)),Qa=t}return Qa}function X0(t,a){if(ui===null){var i=ui=[];xr=0,bn=ss(),Tn={status:"pending",value:void 0,then:function(s){i.push(s)}}}return xr++,a.then(Mu,Mu),a}function Mu(){if(--xr===0&&ui!==null){Tn!==null&&(Tn.status="fulfilled");var t=ui;ui=null,bn=0,Tn=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function q0(t,a){var i=[],s={status:"pending",value:null,reason:null,then:function(c){i.push(c)}};return t.then(function(){s.status="fulfilled",s.value=a;for(var c=0;c<i.length;c++)(0,i[c])(a)},function(c){for(s.status="rejected",s.reason=c,c=0;c<i.length;c++)(0,i[c])(void 0)}),s}function rs(){var t=wa.current;return t!==null?t:xt.pooledCache}function ji(t,a){a===null?_(wa,wa.current):_(wa,a.pool)}function Ru(){var t=rs();return t===null?null:{parent:Fe?Gt._currentValue:Gt._currentValue2,pool:t}}function Vi(t,a){if(pe(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var i=Object.keys(t),s=Object.keys(a);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var c=i[s];if(!W1.call(a,c)||!pe(t[c],a[c]))return!1}return!0}function Nu(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ou(t,a,i){switch(i=t[i],i===void 0?t.push(a):i!==a&&(a.then(qi,qi),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Du(t),t;default:if(typeof a.status=="string")a.then(qi,qi);else{if(t=xt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(s){if(a.status==="pending"){var c=a;c.status="fulfilled",c.value=s}},function(s){if(a.status==="pending"){var c=a;c.status="rejected",c.reason=s}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Du(t),t}throw Za=a,xn}}function Ba(t){try{var a=t._init;return a(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Za=i,xn):i}}function zu(){if(Za===null)throw Error(r(459));var t=Za;return Za=null,t}function Du(t){if(t===xn||t===xl)throw Error(r(483))}function Ki(t){var a=oi;return oi+=1,An===null&&(An=[]),Ou(An,t,a)}function Kn(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Qi(t,a){throw a.$$typeof===ff?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Gu(t){function a(R,x){if(t){var z=R.deletions;z===null?(R.deletions=[x],R.flags|=16):z.push(x)}}function i(R,x){if(!t)return null;for(;x!==null;)a(R,x),x=x.sibling;return null}function s(R){for(var x=new Map;R!==null;)R.key!==null?x.set(R.key,R):x.set(R.index,R),R=R.sibling;return x}function c(R,x){return R=Pe(R,x),R.index=0,R.sibling=null,R}function d(R,x,z){return R.index=z,t?(z=R.alternate,z!==null?(z=z.index,z<x?(R.flags|=67108866,x):z):(R.flags|=67108866,x)):(R.flags|=1048576,x)}function p(R){return t&&R.alternate===null&&(R.flags|=67108866),R}function b(R,x,z,X){return x===null||x.tag!==6?(x=ar(z,R.mode,X),x.return=R,x):(x=c(x,z),x.return=R,x)}function D(R,x,z,X){var tt=z.type;return tt===mn?K(R,x,z.props.children,X,z.key):x!==null&&(x.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===ma&&Ba(tt)===x.type)?(x=c(x,z.props),Kn(x,z),x.return=R,x):(x=fl(z.type,z.key,z.props,null,R.mode,X),Kn(x,z),x.return=R,x)}function B(R,x,z,X){return x===null||x.tag!==4||x.stateNode.containerInfo!==z.containerInfo||x.stateNode.implementation!==z.implementation?(x=nr(z,R.mode,X),x.return=R,x):(x=c(x,z.children||[]),x.return=R,x)}function K(R,x,z,X,tt){return x===null||x.tag!==7?(x=qa(z,R.mode,X,tt),x.return=R,x):(x=c(x,z),x.return=R,x)}function Y(R,x,z){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return x=ar(""+x,R.mode,z),x.return=R,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case dl:return z=fl(x.type,x.key,x.props,null,R.mode,z),Kn(z,x),z.return=R,z;case gn:return x=nr(x,R.mode,z),x.return=R,x;case ma:return x=Ba(x),Y(R,x,z)}if(gl(x)||v(x))return x=qa(x,R.mode,z,null),x.return=R,x;if(typeof x.then=="function")return Y(R,Ki(x),z);if(x.$$typeof===ga)return Y(R,Xi(R,x),z);Qi(R,x)}return null}function J(R,x,z,X){var tt=x!==null?x.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return tt!==null?null:b(R,x,""+z,X);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case dl:return z.key===tt?D(R,x,z,X):null;case gn:return z.key===tt?B(R,x,z,X):null;case ma:return z=Ba(z),J(R,x,z,X)}if(gl(z)||v(z))return tt!==null?null:K(R,x,z,X,null);if(typeof z.then=="function")return J(R,x,Ki(z),X);if(z.$$typeof===ga)return J(R,x,Xi(R,z),X);Qi(R,z)}return null}function nt(R,x,z,X,tt){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return R=R.get(z)||null,b(x,R,""+X,tt);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case dl:return R=R.get(X.key===null?z:X.key)||null,D(x,R,X,tt);case gn:return R=R.get(X.key===null?z:X.key)||null,B(x,R,X,tt);case ma:return X=Ba(X),nt(R,x,z,X,tt)}if(gl(X)||v(X))return R=R.get(z)||null,K(x,R,X,tt,null);if(typeof X.then=="function")return nt(R,x,z,Ki(X),tt);if(X.$$typeof===ga)return nt(R,x,z,Xi(x,X),tt);Qi(x,X)}return null}function ee(R,x,z,X){for(var tt=null,Ht=null,at=x,yt=x=0,Ft=null;at!==null&&yt<z.length;yt++){at.index>yt?(Ft=at,at=null):Ft=at.sibling;var St=J(R,at,z[yt],X);if(St===null){at===null&&(at=Ft);break}t&&at&&St.alternate===null&&a(R,at),x=d(St,x,yt),Ht===null?tt=St:Ht.sibling=St,Ht=St,at=Ft}if(yt===z.length)return i(R,at),gt&&Ct(R,yt),tt;if(at===null){for(;yt<z.length;yt++)at=Y(R,z[yt],X),at!==null&&(x=d(at,x,yt),Ht===null?tt=at:Ht.sibling=at,Ht=at);return gt&&Ct(R,yt),tt}for(at=s(at);yt<z.length;yt++)Ft=nt(at,R,yt,z[yt],X),Ft!==null&&(t&&Ft.alternate!==null&&at.delete(Ft.key===null?yt:Ft.key),x=d(Ft,x,yt),Ht===null?tt=Ft:Ht.sibling=Ft,Ht=Ft);return t&&at.forEach(function(Ta){return a(R,Ta)}),gt&&Ct(R,yt),tt}function pi(R,x,z,X){if(z==null)throw Error(r(151));for(var tt=null,Ht=null,at=x,yt=x=0,Ft=null,St=z.next();at!==null&&!St.done;yt++,St=z.next()){at.index>yt?(Ft=at,at=null):Ft=at.sibling;var Ta=J(R,at,St.value,X);if(Ta===null){at===null&&(at=Ft);break}t&&at&&Ta.alternate===null&&a(R,at),x=d(Ta,x,yt),Ht===null?tt=Ta:Ht.sibling=Ta,Ht=Ta,at=Ft}if(St.done)return i(R,at),gt&&Ct(R,yt),tt;if(at===null){for(;!St.done;yt++,St=z.next())St=Y(R,St.value,X),St!==null&&(x=d(St,x,yt),Ht===null?tt=St:Ht.sibling=St,Ht=St);return gt&&Ct(R,yt),tt}for(at=s(at);!St.done;yt++,St=z.next())St=nt(at,R,yt,St.value,X),St!==null&&(t&&St.alternate!==null&&at.delete(St.key===null?yt:St.key),x=d(St,x,yt),Ht===null?tt=St:Ht.sibling=St,Ht=St);return t&&at.forEach(function(nd){return a(R,nd)}),gt&&Ct(R,yt),tt}function Wa(R,x,z,X){if(typeof z=="object"&&z!==null&&z.type===mn&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case dl:t:{for(var tt=z.key;x!==null;){if(x.key===tt){if(tt=z.type,tt===mn){if(x.tag===7){i(R,x.sibling),X=c(x,z.props.children),X.return=R,R=X;break t}}else if(x.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===ma&&Ba(tt)===x.type){i(R,x.sibling),X=c(x,z.props),Kn(X,z),X.return=R,R=X;break t}i(R,x);break}else a(R,x);x=x.sibling}z.type===mn?(X=qa(z.props.children,R.mode,X,z.key),X.return=R,R=X):(X=fl(z.type,z.key,z.props,null,R.mode,X),Kn(X,z),X.return=R,R=X)}return p(R);case gn:t:{for(tt=z.key;x!==null;){if(x.key===tt)if(x.tag===4&&x.stateNode.containerInfo===z.containerInfo&&x.stateNode.implementation===z.implementation){i(R,x.sibling),X=c(x,z.children||[]),X.return=R,R=X;break t}else{i(R,x);break}else a(R,x);x=x.sibling}X=nr(z,R.mode,X),X.return=R,R=X}return p(R);case ma:return z=Ba(z),Wa(R,x,z,X)}if(gl(z))return ee(R,x,z,X);if(v(z)){if(tt=v(z),typeof tt!="function")throw Error(r(150));return z=tt.call(z),pi(R,x,z,X)}if(typeof z.then=="function")return Wa(R,x,Ki(z),X);if(z.$$typeof===ga)return Wa(R,x,Xi(R,z),X);Qi(R,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,x!==null&&x.tag===6?(i(R,x.sibling),X=c(x,z),X.return=R,R=X):(i(R,x),X=ar(z,R.mode,X),X.return=R,R=X),p(R)):i(R,x)}return function(R,x,z,X){try{oi=0;var tt=Wa(R,x,z,X);return An=null,tt}catch(at){if(at===xn||at===xl)throw at;var Ht=n(29,at,null,R.mode);return Ht.lanes=X,Ht.return=R,Ht}finally{}}}function wi(){for(var t=Mn,a=Mr=Mn=0;a<t;){var i=Ae[a];Ae[a++]=null;var s=Ae[a];Ae[a++]=null;var c=Ae[a];Ae[a++]=null;var d=Ae[a];if(Ae[a++]=null,s!==null&&c!==null){var p=s.pending;p===null?c.next=c:(c.next=p.next,p.next=c),s.pending=c}d!==0&&Hu(i,c,d)}}function Zi(t,a,i,s){Ae[Mn++]=t,Ae[Mn++]=a,Ae[Mn++]=i,Ae[Mn++]=s,Mr|=s,t.lanes|=s,t=t.alternate,t!==null&&(t.lanes|=s)}function us(t,a,i,s){return Zi(t,a,i,s),Ji(t)}function Ua(t,a){return Zi(t,null,null,a),Ji(t)}function Hu(t,a,i){t.lanes|=i;var s=t.alternate;s!==null&&(s.lanes|=i);for(var c=!1,d=t.return;d!==null;)d.childLanes|=i,s=d.alternate,s!==null&&(s.childLanes|=i),d.tag===22&&(t=d.stateNode,t===null||t._visibility&1||(c=!0)),t=d,d=d.return;return t.tag===3?(d=t.stateNode,c&&a!==null&&(c=31-ge(i),t=d.hiddenUpdates,s=t[c],s===null?t[c]=[a]:s.push(a),a.lane=i|536870912),d):null}function Ji(t){if(50<mi)throw mi=0,Xr=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}function os(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hs(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ua(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function oa(t,a,i){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(ot&2)!==0){var c=s.pending;return c===null?a.next=a:(a.next=c.next,c.next=a),s.pending=a,a=Ji(t),Hu(t,null,i),a}return Zi(t,s,a,i),Ji(t)}function Qn(t,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var s=a.lanes;s&=t.pendingLanes,i|=s,a.lanes=i,W(t,i)}}function cs(t,a){var i=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var c=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var p={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};d===null?c=d=p:d=d.next=p,i=i.next}while(i!==null);d===null?c=d=a:d=d.next=a}else c=d=a;i={baseState:s.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=a:t.next=a,i.lastBaseUpdate=a}function wn(){if(Rr){var t=Tn;if(t!==null)throw t}}function Zn(t,a,i,s){Rr=!1;var c=t.updateQueue;Sa=!1;var d=c.firstBaseUpdate,p=c.lastBaseUpdate,b=c.shared.pending;if(b!==null){c.shared.pending=null;var D=b,B=D.next;D.next=null,p===null?d=B:p.next=B,p=D;var K=t.alternate;K!==null&&(K=K.updateQueue,b=K.lastBaseUpdate,b!==p&&(b===null?K.firstBaseUpdate=B:b.next=B,K.lastBaseUpdate=D))}if(d!==null){var Y=c.baseState;p=0,K=B=D=null,b=d;do{var J=b.lane&-536870913,nt=J!==b.lane;if(nt?(ft&J)===J:(s&J)===J){J!==0&&J===bn&&(Rr=!0),K!==null&&(K=K.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});t:{var ee=t,pi=b;J=a;var Wa=i;switch(pi.tag){case 1:if(ee=pi.payload,typeof ee=="function"){Y=ee.call(Wa,Y,J);break t}Y=ee;break t;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=pi.payload,J=typeof ee=="function"?ee.call(Wa,Y,J):ee,J==null)break t;Y=lr({},Y,J);break t;case 2:Sa=!0}}J=b.callback,J!==null&&(t.flags|=64,nt&&(t.flags|=8192),nt=c.callbacks,nt===null?c.callbacks=[J]:nt.push(J))}else nt={lane:J,tag:b.tag,payload:b.payload,callback:b.callback,next:null},K===null?(B=K=nt,D=Y):K=K.next=nt,p|=J;if(b=b.next,b===null){if(b=c.shared.pending,b===null)break;nt=b,b=nt.next,nt.next=null,c.lastBaseUpdate=nt,c.shared.pending=null}}while(!0);K===null&&(D=Y),c.baseState=D,c.firstBaseUpdate=B,c.lastBaseUpdate=K,d===null&&(c.shared.lanes=0),Ca|=p,t.lanes=p,t.memoizedState=Y}}function Bu(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function Uu(t,a){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)Bu(i[t],a)}function Lu(t,a){t=ta,_(Ml,t),_(Rn,a),ta=t|a.baseLanes}function fs(){_(Ml,ta),_(Rn,Rn.current)}function ds(){ta=Ml.current,E(Rn),E(Ml)}function ha(t){var a=t.alternate;_(Xt,Xt.current&1),_(ve,t),Me===null&&(a===null||Rn.current!==null||a.memoizedState!==null)&&(Me=t)}function gs(t){_(Xt,Xt.current),_(ve,t),Me===null&&(Me=t)}function Yu(t){t.tag===22?(_(Xt,Xt.current),_(ve,t),Me===null&&(Me=t)):ca()}function ca(){_(Xt,Xt.current),_(ve,ve.current)}function ce(t){E(ve),Me===t&&(Me=null),E(Xt)}function Pi(t){for(var a=t;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||gr(i)||mr(i)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function Ut(){throw Error(r(321))}function ms(t,a){if(a===null)return!1;for(var i=0;i<a.length&&i<t.length;i++)if(!pe(t[i],a[i]))return!1;return!0}function ps(t,a,i,s,c,d){return Ie=d,it=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,$.H=t===null||t.memoizedState===null?fc:Nr,Pa=!1,d=i(s,c),Pa=!1,Nn&&(d=qu(a,i,s,c)),Xu(t),d}function Xu(t){$.H=ci;var a=Tt!==null&&Tt.next!==null;if(Ie=0,qt=Tt=it=null,Rl=!1,hi=0,On=null,a)throw Error(r(300));t===null||jt||(t=t.dependencies,t!==null&&Yi(t)&&(jt=!0))}function qu(t,a,i,s){it=t;var c=0;do{if(Nn&&(On=null),hi=0,Nn=!1,25<=c)throw Error(r(301));if(c+=1,qt=Tt=null,t.updateQueue!=null){var d=t.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}$.H=dc,d=a(i,s)}while(Nn);return d}function j0(){var t=$.H,a=t.useState()[0];return a=typeof a.then=="function"?Jn(a):a,t=t.useState()[0],(Tt!==null?Tt.memoizedState:null)!==t&&(it.flags|=1024),a}function vs(){var t=Nl!==0;return Nl=0,t}function ys(t,a,i){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~i}function Ss(t){if(Rl){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Rl=!1}Ie=0,qt=Tt=it=null,Nn=!1,hi=Nl=0,On=null}function le(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?it.memoizedState=qt=t:qt=qt.next=t,qt}function Yt(){if(Tt===null){var t=it.alternate;t=t!==null?t.memoizedState:null}else t=Tt.next;var a=qt===null?it.memoizedState:qt.next;if(a!==null)qt=a,Tt=t;else{if(t===null)throw it.alternate===null?Error(r(467)):Error(r(310));Tt=t,t={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},qt===null?it.memoizedState=qt=t:qt=qt.next=t}return qt}function Fi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jn(t){var a=hi;return hi+=1,On===null&&(On=[]),t=Ou(On,t,a),a=it,(qt===null?a.memoizedState:qt.next)===null&&(a=a.alternate,$.H=a===null||a.memoizedState===null?fc:Nr),t}function Wi(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Jn(t);if(t.$$typeof===ga)return kt(t)}throw Error(r(438,String(t)))}function _s(t){var a=null,i=it.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var s=it.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(a={data:s.data.map(function(c){return c.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=Fi(),it.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(t),s=0;s<t;s++)i[s]=df;return a.index++,i}function Qe(t,a){return typeof a=="function"?a(t):a}function ki(t){var a=Yt();return Cs(a,Tt,t)}function Cs(t,a,i){var s=t.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=i;var c=t.baseQueue,d=s.pending;if(d!==null){if(c!==null){var p=c.next;c.next=d.next,d.next=p}a.baseQueue=c=d,s.pending=null}if(d=t.baseState,c===null)t.memoizedState=d;else{a=c.next;var b=p=null,D=null,B=a,K=!1;do{var Y=B.lane&-536870913;if(Y!==B.lane?(ft&Y)===Y:(Ie&Y)===Y){var J=B.revertLane;if(J===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),Y===bn&&(K=!0);else if((Ie&J)===J){B=B.next,J===bn&&(K=!0);continue}else Y={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},D===null?(b=D=Y,p=d):D=D.next=Y,it.lanes|=J,Ca|=J;Y=B.action,Pa&&i(d,Y),d=B.hasEagerState?B.eagerState:i(d,Y)}else J={lane:Y,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},D===null?(b=D=J,p=d):D=D.next=J,it.lanes|=Y,Ca|=Y;B=B.next}while(B!==null&&B!==a);if(D===null?p=d:D.next=b,!pe(d,t.memoizedState)&&(jt=!0,K&&(i=Tn,i!==null)))throw i;t.memoizedState=d,t.baseState=p,t.baseQueue=D,s.lastRenderedState=d}return c===null&&(s.lanes=0),[t.memoizedState,s.dispatch]}function Es(t){var a=Yt(),i=a.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=t;var s=i.dispatch,c=i.pending,d=a.memoizedState;if(c!==null){i.pending=null;var p=c=c.next;do d=t(d,p.action),p=p.next;while(p!==c);pe(d,a.memoizedState)||(jt=!0),a.memoizedState=d,a.baseQueue===null&&(a.baseState=d),i.lastRenderedState=d}return[d,s]}function ju(t,a,i){var s=it,c=Yt(),d=gt;if(d){if(i===void 0)throw Error(r(407));i=i()}else i=a();var p=!pe((Tt||c).memoizedState,i);if(p&&(c.memoizedState=i,jt=!0),c=c.queue,xs(Qu.bind(null,s,c,t),[t]),c.getSnapshot!==a||p||qt!==null&&qt.memoizedState.tag&1){if(s.flags|=2048,hn(9,{destroy:void 0},Ku.bind(null,s,c,i,a),null),xt===null)throw Error(r(349));d||(Ie&127)!==0||Vu(s,a,i)}return i}function Vu(t,a,i){t.flags|=16384,t={getSnapshot:a,value:i},a=it.updateQueue,a===null?(a=Fi(),it.updateQueue=a,a.stores=[t]):(i=a.stores,i===null?a.stores=[t]:i.push(t))}function Ku(t,a,i,s){a.value=i,a.getSnapshot=s,wu(a)&&Zu(t)}function Qu(t,a,i){return i(function(){wu(a)&&Zu(t)})}function wu(t){var a=t.getSnapshot;t=t.value;try{var i=a();return!pe(t,i)}catch{return!0}}function Zu(t){var a=Ua(t,2);a!==null&&re(a,t,2)}function bs(t){var a=le();if(typeof t=="function"){var i=t;if(t=i(),Pa){lt(!0);try{i()}finally{lt(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qe,lastRenderedState:t},a}function Ju(t,a,i,s){return t.baseState=i,Cs(t,Tt,typeof s=="function"?s:Qe)}function V0(t,a,i,s,c){if(tl(t))throw Error(r(485));if(t=a.action,t!==null){var d={payload:c,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){d.listeners.push(p)}};$.T!==null?i(!0):d.isTransition=!1,s(d),i=a.pending,i===null?(d.next=a.pending=d,Pu(a,d)):(d.next=i.next,a.pending=i.next=d)}}function Pu(t,a){var i=a.action,s=a.payload,c=t.state;if(a.isTransition){var d=$.T,p={};$.T=p;try{var b=i(c,s),D=$.S;D!==null&&D(p,b),Fu(t,a,b)}catch(B){Ts(t,a,B)}finally{d!==null&&p.types!==null&&(d.types=p.types),$.T=d}}else try{d=i(c,s),Fu(t,a,d)}catch(B){Ts(t,a,B)}}function Fu(t,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Wu(t,a,s)},function(s){return Ts(t,a,s)}):Wu(t,a,i)}function Wu(t,a,i){a.status="fulfilled",a.value=i,ku(a),t.state=i,a=t.pending,a!==null&&(i=a.next,i===a?t.pending=null:(i=i.next,a.next=i,Pu(t,i)))}function Ts(t,a,i){var s=t.pending;if(t.pending=null,s!==null){s=s.next;do a.status="rejected",a.reason=i,ku(a),a=a.next;while(a!==s)}t.action=null}function ku(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function Iu(t,a){return a}function $u(t,a){if(gt){var i=xt.formState;if(i!==null){t:{var s=it;if(gt){if(Dt){var c=s1(Dt,xe);if(c){Dt=Ph(c),s=r1(c);break t}}Ve(s)}s=!1}s&&(a=i[0])}}i=le(),i.memoizedState=i.baseState=a,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Iu,lastRenderedState:a},i.queue=s,i=yo.bind(null,it,s),s.dispatch=i,s=bs(!1);var d=Ns.bind(null,it,!1,s.queue);return s=le(),c={state:a,dispatch:null,action:t,pending:null},s.queue=c,i=V0.bind(null,it,c,d,i),c.dispatch=i,s.memoizedState=t,[a,i,!1]}function to(t){var a=Yt();return eo(a,Tt,t)}function eo(t,a,i){if(a=Cs(t,a,Iu)[0],t=ki(Qe)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var s=Jn(a)}catch(p){throw p===xn?xl:p}else s=a;a=Yt();var c=a.queue,d=c.dispatch;return i!==a.memoizedState&&(it.flags|=2048,hn(9,{destroy:void 0},K0.bind(null,c,i),null)),[s,d,t]}function K0(t,a){t.action=a}function ao(t){var a=Yt(),i=Tt;if(i!==null)return eo(a,i,t);Yt(),a=a.memoizedState,i=Yt();var s=i.queue.dispatch;return i.memoizedState=t,[a,s,!1]}function hn(t,a,i,s){return t={tag:t,create:i,deps:s,inst:a,next:null},a=it.updateQueue,a===null&&(a=Fi(),it.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=t.next=t:(s=i.next,i.next=t,t.next=s,a.lastEffect=t),t}function no(){return Yt().memoizedState}function Ii(t,a,i,s){var c=le();it.flags|=t,c.memoizedState=hn(1|a,{destroy:void 0},i,s===void 0?null:s)}function $i(t,a,i,s){var c=Yt();s=s===void 0?null:s;var d=c.memoizedState.inst;Tt!==null&&s!==null&&ms(s,Tt.memoizedState.deps)?c.memoizedState=hn(a,d,i,s):(it.flags|=t,c.memoizedState=hn(1|a,d,i,s))}function io(t,a){Ii(8390656,8,t,a)}function xs(t,a){$i(2048,8,t,a)}function Q0(t){it.flags|=4;var a=it.updateQueue;if(a===null)a=Fi(),it.updateQueue=a,a.events=[t];else{var i=a.events;i===null?a.events=[t]:i.push(t)}}function lo(t){var a=Yt().memoizedState;return Q0({ref:a,nextImpl:t}),function(){if((ot&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function so(t,a){return $i(4,2,t,a)}function ro(t,a){return $i(4,4,t,a)}function uo(t,a){if(typeof a=="function"){t=t();var i=a(t);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function oo(t,a,i){i=i!=null?i.concat([t]):null,$i(4,4,uo.bind(null,a,t),i)}function As(){}function ho(t,a){var i=Yt();a=a===void 0?null:a;var s=i.memoizedState;return a!==null&&ms(a,s[1])?s[0]:(i.memoizedState=[t,a],t)}function co(t,a){var i=Yt();a=a===void 0?null:a;var s=i.memoizedState;if(a!==null&&ms(a,s[1]))return s[0];if(s=t(),Pa){lt(!0);try{t()}finally{lt(!1)}}return i.memoizedState=[s,a],s}function Ms(t,a,i){return i===void 0||(Ie&1073741824)!==0&&(ft&261930)===0?t.memoizedState=a:(t.memoizedState=i,t=uh(),it.lanes|=t,Ca|=t,i)}function fo(t,a,i,s){return pe(i,a)?i:Rn.current!==null?(t=Ms(t,i,s),pe(t,a)||(jt=!0),t):(Ie&42)===0||(Ie&1073741824)!==0&&(ft&261930)===0?(jt=!0,t.memoizedState=i):(t=uh(),it.lanes|=t,Ca|=t,a)}function go(t,a,i,s,c){var d=We();Jt(d!==0&&8>d?d:8);var p=$.T,b={};$.T=b,Ns(t,!1,a,i);try{var D=c(),B=$.S;if(B!==null&&B(b,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var K=q0(D,s);Pn(t,a,K,fe(t))}else Pn(t,a,s,fe(t))}catch(Y){Pn(t,a,{then:function(){},status:"rejected",reason:Y},fe())}finally{Jt(d),p!==null&&b.types!==null&&(p.types=b.types),$.T=p}}function mo(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:pn,baseState:pn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qe,lastRenderedState:pn},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qe,lastRenderedState:i},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Rs(){return kt(Va)}function po(){return Yt().memoizedState}function vo(){return Yt().memoizedState}function w0(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var i=fe();t=ua(i);var s=oa(a,t,i);s!==null&&(re(s,a,i),Qn(s,a,i)),a={cache:ls()},t.payload=a;return}a=a.return}}function Z0(t,a,i){var s=fe();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},tl(t)?So(a,i):(i=us(t,a,i,s),i!==null&&(re(i,t,s),_o(i,a,s)))}function yo(t,a,i){var s=fe();Pn(t,a,i,s)}function Pn(t,a,i,s){var c={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(tl(t))So(a,c);else{var d=t.alternate;if(t.lanes===0&&(d===null||d.lanes===0)&&(d=a.lastRenderedReducer,d!==null))try{var p=a.lastRenderedState,b=d(p,i);if(c.hasEagerState=!0,c.eagerState=b,pe(b,p))return Zi(t,a,c,0),xt===null&&wi(),!1}catch{}finally{}if(i=us(t,a,c,s),i!==null)return re(i,t,s),_o(i,a,s),!0}return!1}function Ns(t,a,i,s){if(s={lane:2,revertLane:ss(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},tl(t)){if(a)throw Error(r(479))}else a=us(t,i,s,2),a!==null&&re(a,t,2)}function tl(t){var a=t.alternate;return t===it||a!==null&&a===it}function So(t,a){Nn=Rl=!0;var i=t.pending;i===null?a.next=a:(a.next=i.next,i.next=a),t.pending=a}function _o(t,a,i){if((i&4194048)!==0){var s=a.lanes;s&=t.pendingLanes,i|=s,a.lanes=i,W(t,i)}}function Os(t,a,i,s){a=t.memoizedState,i=i(s,a),i=i==null?a:lr({},a,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}function Co(t,a,i,s,c,d,p){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,d,p):a.prototype&&a.prototype.isPureReactComponent?!Vi(i,s)||!Vi(c,d):!0}function Eo(t,a,i,s){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,s),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,s),a.state!==t&&Or.enqueueReplaceState(a,a.state,null)}function La(t,a){var i=a;if("ref"in a){i={};for(var s in a)s!=="ref"&&(i[s]=a[s])}if(t=t.defaultProps){i===a&&(i=lr({},i));for(var c in t)i[c]===void 0&&(i[c]=t[c])}return i}function el(t,a){try{var i=t.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(s){setTimeout(function(){throw s})}}function bo(t,a,i){try{var s=t.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function zs(t,a,i){return i=ua(i),i.tag=3,i.payload={element:null},i.callback=function(){el(t,a)},i}function To(t){return t=ua(t),t.tag=3,t}function xo(t,a,i,s){var c=i.type.getDerivedStateFromError;if(typeof c=="function"){var d=s.value;t.payload=function(){return c(d)},t.callback=function(){bo(a,i,s)}}var p=i.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(t.callback=function(){bo(a,i,s),typeof c!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var b=s.stack;this.componentDidCatch(s.value,{componentStack:b!==null?b:""})})}function J0(t,a,i,s,c){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(a=i.alternate,a!==null&&un(a,i,c,!0),i=ve.current,i!==null){switch(i.tag){case 31:case 13:return Me===null?hl():i.alternate===null&&Lt===0&&(Lt=3),i.flags&=-257,i.flags|=65536,i.lanes=c,s===Al?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([s]):a.add(s),tr(t,s,c)),!1;case 22:return i.flags|=65536,s===Al?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([s]):i.add(s)),tr(t,s,c)),!1}throw Error(r(435,i.tag))}return tr(t,s,c),hl(),!1}if(gt)return a=ve.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=c,s!==Er&&(t=Error(r(422),{cause:s}),jn(st(t,i)))):(s!==Er&&(a=Error(r(423),{cause:s}),jn(st(a,i))),t=t.current.alternate,t.flags|=65536,c&=-c,t.lanes|=c,s=st(s,i),c=zs(t.stateNode,s,c),cs(t,c),Lt!==4&&(Lt=2)),!1;var d=Error(r(520),{cause:s});if(d=st(d,i),di===null?di=[d]:di.push(d),Lt!==4&&(Lt=2),a===null)return!0;s=st(s,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,t=c&-c,i.lanes|=t,t=zs(i.stateNode,s,t),cs(i,t),!1;case 1:if(a=i.type,d=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ea===null||!Ea.has(d))))return i.flags|=65536,c&=-c,i.lanes|=c,c=To(c),xo(c,t,i,s),cs(i,c),!1}i=i.return}while(i!==null);return!1}function It(t,a,i,s){a.child=t===null?cc(a,null,i,s):Ja(a,t.child,i,s)}function Ao(t,a,i,s,c){i=i.render;var d=a.ref;if("ref"in s){var p={};for(var b in s)b!=="ref"&&(p[b]=s[b])}else p=s;return Ha(a),s=ps(t,a,i,p,d,c),b=vs(),t!==null&&!jt?(ys(t,a,c),we(t,a,c)):(gt&&b&&Ot(a),a.flags|=1,It(t,a,s,c),a.child)}function Mo(t,a,i,s,c){if(t===null){var d=i.type;return typeof d=="function"&&!er(d)&&d.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=d,Ro(t,a,d,s,c)):(t=fl(i.type,null,s,a,a.mode,c),t.ref=a.ref,t.return=a,a.child=t)}if(d=t.child,!Ys(t,c)){var p=d.memoizedProps;if(i=i.compare,i=i!==null?i:Vi,i(p,s)&&t.ref===a.ref)return we(t,a,c)}return a.flags|=1,t=Pe(d,s),t.ref=a.ref,t.return=a,a.child=t}function Ro(t,a,i,s,c){if(t!==null){var d=t.memoizedProps;if(Vi(d,s)&&t.ref===a.ref)if(jt=!1,a.pendingProps=s=d,Ys(t,c))(t.flags&131072)!==0&&(jt=!0);else return a.lanes=t.lanes,we(t,a,c)}return Ds(t,a,i,s,c)}function No(t,a,i,s){var c=s.children,d=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((a.flags&128)!==0){if(d=d!==null?d.baseLanes|i:i,t!==null){for(s=a.child=t.child,c=0;s!==null;)c=c|s.lanes|s.childLanes,s=s.sibling;s=c&~d}else s=0,a.child=null;return Oo(t,a,d,i,s)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&ji(a,d!==null?d.cachePool:null),d!==null?Lu(a,d):fs(),Yu(a);else return s=a.lanes=536870912,Oo(t,a,d!==null?d.baseLanes|i:i,i,s)}else d!==null?(ji(a,d.cachePool),Lu(a,d),ca(),a.memoizedState=null):(t!==null&&ji(a,null),fs(),ca());return It(t,a,c,i),a.child}function Fn(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Oo(t,a,i,s,c){var d=rs();return d=d===null?null:{parent:Fe?Gt._currentValue:Gt._currentValue2,pool:d},a.memoizedState={baseLanes:i,cachePool:d},t!==null&&ji(a,null),fs(),Yu(a),t!==null&&un(t,a,s,!0),a.childLanes=c,null}function al(t,a){return a=il({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function zo(t,a,i){return Ja(a,t.child,null,i),t=al(a,a.pendingProps),t.flags|=2,ce(a),a.memoizedState=null,t}function P0(t,a,i){var s=a.pendingProps,c=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(gt){if(s.mode==="hidden")return t=al(a,s),a.lanes=536870912,Fn(null,t);if(gs(a),(t=Dt)?(t=p1(t,xe),t!==null&&(a.memoizedState={dehydrated:t,treeContext:pa!==null?{id:Xe,overflow:qe}:null,retryLane:536870912,hydrationErrors:null},i=Rh(t),i.return=a,a.child=i,te=a,Dt=null)):t=null,t===null)throw Ve(a);return a.lanes=536870912,null}return al(a,s)}var d=t.memoizedState;if(d!==null){var p=d.dehydrated;if(gs(a),c)if(a.flags&256)a.flags&=-257,a=zo(t,a,i);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(jt||un(t,a,i,!1),c=(i&t.childLanes)!==0,jt||c){if(s=xt,s!==null&&(p=et(s,i),p!==0&&p!==d.retryLane))throw d.retryLane=p,Ua(t,p),re(s,t,p),zr;hl(),a=zo(t,a,i)}else t=d.treeContext,ie&&(Dt=c1(p),te=a,gt=!0,ya=null,xe=!1,t!==null&&yu(a,t)),a=al(a,s),a.flags|=4096;return a}return t=Pe(t.child,{mode:s.mode,children:s.children}),t.ref=a.ref,a.child=t,t.return=a,t}function nl(t,a){var i=a.ref;if(i===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(r(284));(t===null||t.ref!==i)&&(a.flags|=4194816)}}function Ds(t,a,i,s,c){return Ha(a),i=ps(t,a,i,s,void 0,c),s=vs(),t!==null&&!jt?(ys(t,a,c),we(t,a,c)):(gt&&s&&Ot(a),a.flags|=1,It(t,a,i,c),a.child)}function Do(t,a,i,s,c,d){return Ha(a),a.updateQueue=null,i=qu(a,s,i,c),Xu(t),s=vs(),t!==null&&!jt?(ys(t,a,d),we(t,a,d)):(gt&&s&&Ot(a),a.flags|=1,It(t,a,i,d),a.child)}function Go(t,a,i,s,c){if(Ha(a),a.stateNode===null){var d=Sn,p=i.contextType;typeof p=="object"&&p!==null&&(d=kt(p)),d=new i(s,d),a.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Or,a.stateNode=d,d._reactInternals=a,d=a.stateNode,d.props=s,d.state=a.memoizedState,d.refs={},os(a),p=i.contextType,d.context=typeof p=="object"&&p!==null?kt(p):Sn,d.state=a.memoizedState,p=i.getDerivedStateFromProps,typeof p=="function"&&(Os(a,i,p,s),d.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(p=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),p!==d.state&&Or.enqueueReplaceState(d,d.state,null),Zn(a,s,d,c),wn(),d.state=a.memoizedState),typeof d.componentDidMount=="function"&&(a.flags|=4194308),s=!0}else if(t===null){d=a.stateNode;var b=a.memoizedProps,D=La(i,b);d.props=D;var B=d.context,K=i.contextType;p=Sn,typeof K=="object"&&K!==null&&(p=kt(K));var Y=i.getDerivedStateFromProps;K=typeof Y=="function"||typeof d.getSnapshotBeforeUpdate=="function",b=a.pendingProps!==b,K||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b||B!==p)&&Eo(a,d,s,p),Sa=!1;var J=a.memoizedState;d.state=J,Zn(a,s,d,c),wn(),B=a.memoizedState,b||J!==B||Sa?(typeof Y=="function"&&(Os(a,i,Y,s),B=a.memoizedState),(D=Sa||Co(a,i,D,s,J,B,p))?(K||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(a.flags|=4194308)):(typeof d.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=s,a.memoizedState=B),d.props=s,d.state=B,d.context=p,s=D):(typeof d.componentDidMount=="function"&&(a.flags|=4194308),s=!1)}else{d=a.stateNode,hs(t,a),p=a.memoizedProps,K=La(i,p),d.props=K,Y=a.pendingProps,J=d.context,B=i.contextType,D=Sn,typeof B=="object"&&B!==null&&(D=kt(B)),b=i.getDerivedStateFromProps,(B=typeof b=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(p!==Y||J!==D)&&Eo(a,d,s,D),Sa=!1,J=a.memoizedState,d.state=J,Zn(a,s,d,c),wn();var nt=a.memoizedState;p!==Y||J!==nt||Sa||t!==null&&t.dependencies!==null&&Yi(t.dependencies)?(typeof b=="function"&&(Os(a,i,b,s),nt=a.memoizedState),(K=Sa||Co(a,i,K,s,J,nt,D)||t!==null&&t.dependencies!==null&&Yi(t.dependencies))?(B||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(s,nt,D),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(s,nt,D)),typeof d.componentDidUpdate=="function"&&(a.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof d.componentDidUpdate!="function"||p===t.memoizedProps&&J===t.memoizedState||(a.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||p===t.memoizedProps&&J===t.memoizedState||(a.flags|=1024),a.memoizedProps=s,a.memoizedState=nt),d.props=s,d.state=nt,d.context=D,s=K):(typeof d.componentDidUpdate!="function"||p===t.memoizedProps&&J===t.memoizedState||(a.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||p===t.memoizedProps&&J===t.memoizedState||(a.flags|=1024),s=!1)}return d=s,nl(t,a),s=(a.flags&128)!==0,d||s?(d=a.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:d.render(),a.flags|=1,t!==null&&s?(a.child=Ja(a,t.child,null,c),a.child=Ja(a,null,i,c)):It(t,a,i,c),a.memoizedState=d.state,t=a.child):t=we(t,a,c),t}function Ho(t,a,i,s){return Ga(),a.flags|=256,It(t,a,i,s),a.child}function Gs(t){return{baseLanes:t,cachePool:Ru()}}function Hs(t,a,i){return t=t!==null?t.childLanes&~i:0,a&&(t|=Se),t}function Bo(t,a,i){var s=a.pendingProps,c=!1,d=(a.flags&128)!==0,p;if((p=d)||(p=t!==null&&t.memoizedState===null?!1:(Xt.current&2)!==0),p&&(c=!0,a.flags&=-129),p=(a.flags&32)!==0,a.flags&=-33,t===null){if(gt){if(c?ha(a):ca(),(t=Dt)?(t=v1(t,xe),t!==null&&(a.memoizedState={dehydrated:t,treeContext:pa!==null?{id:Xe,overflow:qe}:null,retryLane:536870912,hydrationErrors:null},i=Rh(t),i.return=a,a.child=i,te=a,Dt=null)):t=null,t===null)throw Ve(a);return mr(t)?a.lanes=32:a.lanes=536870912,null}var b=s.children;return s=s.fallback,c?(ca(),c=a.mode,b=il({mode:"hidden",children:b},c),s=qa(s,c,i,null),b.return=a,s.return=a,b.sibling=s,a.child=b,s=a.child,s.memoizedState=Gs(i),s.childLanes=Hs(t,p,i),a.memoizedState=Dr,Fn(null,s)):(ha(a),Bs(a,b))}var D=t.memoizedState;if(D!==null&&(b=D.dehydrated,b!==null)){if(d)a.flags&256?(ha(a),a.flags&=-257,a=Us(t,a,i)):a.memoizedState!==null?(ca(),a.child=t.child,a.flags|=128,a=null):(ca(),b=s.fallback,c=a.mode,s=il({mode:"visible",children:s.children},c),b=qa(b,c,i,null),b.flags|=2,s.return=a,b.return=a,s.sibling=b,a.child=s,Ja(a,t.child,null,i),s=a.child,s.memoizedState=Gs(i),s.childLanes=Hs(t,p,i),a.memoizedState=Dr,a=Fn(null,s));else if(ha(a),mr(b))p=i1(b).digest,s=Error(r(419)),s.stack="",s.digest=p,jn({value:s,source:null,stack:null}),a=Us(t,a,i);else if(jt||un(t,a,i,!1),p=(i&t.childLanes)!==0,jt||p){if(p=xt,p!==null&&(s=et(p,i),s!==0&&s!==D.retryLane))throw D.retryLane=s,Ua(t,s),re(p,t,s),zr;gr(b)||hl(),a=Us(t,a,i)}else gr(b)?(a.flags|=192,a.child=t.child,a=null):(t=D.treeContext,ie&&(Dt=f1(b),te=a,gt=!0,ya=null,xe=!1,t!==null&&yu(a,t)),a=Bs(a,s.children),a.flags|=4096);return a}return c?(ca(),b=s.fallback,c=a.mode,D=t.child,d=D.sibling,s=Pe(D,{mode:"hidden",children:s.children}),s.subtreeFlags=D.subtreeFlags&65011712,d!==null?b=Pe(d,b):(b=qa(b,c,i,null),b.flags|=2),b.return=a,s.return=a,s.sibling=b,a.child=s,Fn(null,s),s=a.child,b=t.child.memoizedState,b===null?b=Gs(i):(c=b.cachePool,c!==null?(D=Fe?Gt._currentValue:Gt._currentValue2,c=c.parent!==D?{parent:D,pool:D}:c):c=Ru(),b={baseLanes:b.baseLanes|i,cachePool:c}),s.memoizedState=b,s.childLanes=Hs(t,p,i),a.memoizedState=Dr,Fn(t.child,s)):(ha(a),i=t.child,t=i.sibling,i=Pe(i,{mode:"visible",children:s.children}),i.return=a,i.sibling=null,t!==null&&(p=a.deletions,p===null?(a.deletions=[t],a.flags|=16):p.push(t)),a.child=i,a.memoizedState=null,i)}function Bs(t,a){return a=il({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function il(t,a){return t=n(22,t,null,a),t.lanes=0,t}function Us(t,a,i){return Ja(a,t.child,null,i),t=Bs(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Uo(t,a,i){t.lanes|=a;var s=t.alternate;s!==null&&(s.lanes|=a),ns(t.return,a,i)}function Ls(t,a,i,s,c,d){var p=t.memoizedState;p===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:c,treeForkCount:d}:(p.isBackwards=a,p.rendering=null,p.renderingStartTime=0,p.last=s,p.tail=i,p.tailMode=c,p.treeForkCount=d)}function Lo(t,a,i){var s=a.pendingProps,c=s.revealOrder,d=s.tail;s=s.children;var p=Xt.current,b=(p&2)!==0;if(b?(p=p&1|2,a.flags|=128):p&=1,_(Xt,p),It(t,a,s,i),s=gt?si:0,!b&&t!==null&&(t.flags&128)!==0)t:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Uo(t,i,a);else if(t.tag===19)Uo(t,i,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break t;for(;t.sibling===null;){if(t.return===null||t.return===a)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(c){case"forwards":for(i=a.child,c=null;i!==null;)t=i.alternate,t!==null&&Pi(t)===null&&(c=i),i=i.sibling;i=c,i===null?(c=a.child,a.child=null):(c=i.sibling,i.sibling=null),Ls(a,!1,c,i,d,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,c=a.child,a.child=null;c!==null;){if(t=c.alternate,t!==null&&Pi(t)===null){a.child=c;break}t=c.sibling,c.sibling=i,i=c,c=t}Ls(a,!0,i,null,d,s);break;case"together":Ls(a,!1,null,null,void 0,s);break;default:a.memoizedState=null}return a.child}function we(t,a,i){if(t!==null&&(a.dependencies=t.dependencies),Ca|=a.lanes,(i&a.childLanes)===0)if(t!==null){if(un(t,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,i=Pe(t,t.pendingProps),a.child=i,i.return=a;t.sibling!==null;)t=t.sibling,i=i.sibling=Pe(t,t.pendingProps),i.return=a;i.sibling=null}return a.child}function Ys(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Yi(t)))}function F0(t,a,i){switch(a.tag){case 3:Ui(a,a.stateNode.containerInfo),ra(a,Gt,t.memoizedState.cache),Ga();break;case 27:case 5:es(a);break;case 4:Ui(a,a.stateNode.containerInfo);break;case 10:ra(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,gs(a),null;break;case 13:var s=a.memoizedState;if(s!==null)return s.dehydrated!==null?(ha(a),a.flags|=128,null):(i&a.child.childLanes)!==0?Bo(t,a,i):(ha(a),t=we(t,a,i),t!==null?t.sibling:null);ha(a);break;case 19:var c=(t.flags&128)!==0;if(s=(i&a.childLanes)!==0,s||(un(t,a,i,!1),s=(i&a.childLanes)!==0),c){if(s)return Lo(t,a,i);a.flags|=128}if(c=a.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),_(Xt,Xt.current),s)break;return null;case 22:return a.lanes=0,No(t,a,i,a.pendingProps);case 24:ra(a,Gt,t.memoizedState.cache)}return we(t,a,i)}function Yo(t,a,i){if(t!==null)if(t.memoizedProps!==a.pendingProps)jt=!0;else{if(!Ys(t,i)&&(a.flags&128)===0)return jt=!1,F0(t,a,i);jt=(t.flags&131072)!==0}else jt=!1,gt&&(a.flags&1048576)!==0&&pt(a,si,a.index);switch(a.lanes=0,a.tag){case 16:t:{var s=a.pendingProps;if(t=Ba(a.elementType),a.type=t,typeof t=="function")er(t)?(s=La(t,s),a.tag=1,a=Go(null,a,t,s,i)):(a.tag=0,a=Ds(null,a,t,s,i));else{if(t!=null){var c=t.$$typeof;if(c===rr){a.tag=11,a=Ao(null,a,t,s,i);break t}else if(c===hr){a.tag=14,a=Mo(null,a,t,s,i);break t}}throw a=S(t)||t,Error(r(306,a,""))}}return a;case 0:return Ds(t,a,a.type,a.pendingProps,i);case 1:return s=a.type,c=La(s,a.pendingProps),Go(t,a,s,c,i);case 3:t:{if(Ui(a,a.stateNode.containerInfo),t===null)throw Error(r(387));var d=a.pendingProps;c=a.memoizedState,s=c.element,hs(t,a),Zn(a,d,null,i);var p=a.memoizedState;if(d=p.cache,ra(a,Gt,d),d!==c.cache&&is(a,[Gt],i,!0),wn(),d=p.element,ie&&c.isDehydrated)if(c={element:d,isDehydrated:!1,cache:p.cache},a.updateQueue.baseState=c,a.memoizedState=c,a.flags&256){a=Ho(t,a,d,i);break t}else if(d!==s){s=st(Error(r(424)),a),jn(s),a=Ho(t,a,d,i);break t}else for(ie&&(Dt=h1(a.stateNode.containerInfo),te=a,gt=!0,ya=null,xe=!0),i=cc(a,null,d,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ga(),d===s){a=we(t,a,i);break t}It(t,a,d,i)}a=a.child}return a;case 26:if(Ge)return nl(t,a),t===null?(i=kh(a.type,null,a.pendingProps,null))?a.memoizedState=i:gt||(a.stateNode=L1(a.type,a.pendingProps,va.current,a)):a.memoizedState=kh(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:if(wt)return es(a),t===null&&wt&>&&(s=a.stateNode=nc(a.type,a.pendingProps,va.current,$t.current,!1),te=a,xe=!0,Dt=d1(a.type,s,Dt)),It(t,a,a.pendingProps.children,i),nl(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&>&&(H1(a.type,a.pendingProps,$t.current),(c=s=Dt)&&(s=g1(s,a.type,a.pendingProps,xe),s!==null?(a.stateNode=s,te=a,Dt=o1(s),xe=!1,c=!0):c=!1),c||Ve(a)),es(a),c=a.type,d=a.pendingProps,p=t!==null?t.memoizedProps:null,s=d.children,ml(c,d)?s=null:p!==null&&ml(c,p)&&(a.flags|=32),a.memoizedState!==null&&(c=ps(t,a,j0,null,null,i),Fe?Va._currentValue=c:Va._currentValue2=c),nl(t,a),It(t,a,s,i),a.child;case 6:return t===null&>&&(B1(a.pendingProps,$t.current),(t=i=Dt)&&(i=m1(i,a.pendingProps,xe),i!==null?(a.stateNode=i,te=a,Dt=null,t=!0):t=!1),t||Ve(a)),null;case 13:return Bo(t,a,i);case 4:return Ui(a,a.stateNode.containerInfo),s=a.pendingProps,t===null?a.child=Ja(a,null,s,i):It(t,a,s,i),a.child;case 11:return Ao(t,a,a.type,a.pendingProps,i);case 7:return It(t,a,a.pendingProps,i),a.child;case 8:return It(t,a,a.pendingProps.children,i),a.child;case 12:return It(t,a,a.pendingProps.children,i),a.child;case 10:return s=a.pendingProps,ra(a,a.type,s.value),It(t,a,s.children,i),a.child;case 9:return c=a.type._context,s=a.pendingProps.children,Ha(a),c=kt(c),s=s(c),a.flags|=1,It(t,a,s,i),a.child;case 14:return Mo(t,a,a.type,a.pendingProps,i);case 15:return Ro(t,a,a.type,a.pendingProps,i);case 19:return Lo(t,a,i);case 31:return P0(t,a,i);case 22:return No(t,a,i,a.pendingProps);case 24:return Ha(a),s=kt(Gt),t===null?(c=rs(),c===null&&(c=xt,d=ls(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=i),c=d),a.memoizedState={parent:s,cache:c},os(a),ra(a,Gt,c)):((t.lanes&i)!==0&&(hs(t,a),Zn(a,null,null,i),wn()),c=t.memoizedState,d=a.memoizedState,c.parent!==s?(c={parent:s,cache:s},a.memoizedState=c,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=c),ra(a,Gt,s)):(s=d.cache,ra(a,Gt,s),s!==c.cache&&is(a,[Gt],i,!0))),It(t,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Oe(t){t.flags|=4}function ll(t){Ye&&(t.flags|=8)}function Xo(t,a){if(t!==null&&t.child===a.child)return!1;if((a.flags&16)!==0)return!0;for(t=a.child;t!==null;){if((t.flags&8218)!==0||(t.subtreeFlags&8218)!==0)return!0;t=t.sibling}return!1}function Xs(t,a,i,s){if(ne)for(i=a.child;i!==null;){if(i.tag===5||i.tag===6)fr(t,i.stateNode);else if(!(i.tag===4||wt&&i.tag===27)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return;i=i.return}i.sibling.return=i.return,i=i.sibling}else if(Ye)for(var c=a.child;c!==null;){if(c.tag===5){var d=c.stateNode;i&&s&&(d=Zh(d,c.type,c.memoizedProps)),fr(t,d)}else if(c.tag===6)d=c.stateNode,i&&s&&(d=Jh(d,c.memoizedProps)),fr(t,d);else if(c.tag!==4){if(c.tag===22&&c.memoizedState!==null)d=c.child,d!==null&&(d.return=c),Xs(t,c,!0,!0);else if(c.child!==null){c.child.return=c,c=c.child;continue}}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return;c=c.return}c.sibling.return=c.return,c=c.sibling}}function qo(t,a,i,s){var c=!1;if(Ye)for(var d=a.child;d!==null;){if(d.tag===5){var p=d.stateNode;i&&s&&(p=Zh(p,d.type,d.memoizedProps)),Qh(t,p)}else if(d.tag===6)p=d.stateNode,i&&s&&(p=Jh(p,d.memoizedProps)),Qh(t,p);else if(d.tag!==4){if(d.tag===22&&d.memoizedState!==null)c=d.child,c!==null&&(c.return=d),qo(t,d,!0,!0),c=!0;else if(d.child!==null){d.child.return=d,d=d.child;continue}}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return c;d=d.return}d.sibling.return=d.return,d=d.sibling}return c}function jo(t,a){if(Ye&&Xo(t,a)){t=a.stateNode;var i=t.containerInfo,s=Kh();qo(s,a,!1,!1),t.pendingChildren=s,Oe(a),n1(i,s)}}function qs(t,a,i,s){if(ne)t.memoizedProps!==s&&Oe(a);else if(Ye){var c=t.stateNode,d=t.memoizedProps;if((t=Xo(t,a))||d!==s){var p=$t.current;d=a1(c,i,d,s,!t,null),d===c?a.stateNode=c:(ll(a),Yh(d,i,s,p)&&Oe(a),a.stateNode=d,t&&Xs(d,a,!1,!1))}else a.stateNode=c}}function js(t,a,i,s,c){if((t.mode&32)!==0&&(i===null?Nf(a,s):Of(a,i,s))){if(t.flags|=16777216,(c&335544128)===c||dr(a,s))if(qh(t.stateNode,a,s))t.flags|=8192;else if(dh())t.flags|=8192;else throw Za=Al,Ar}else t.flags&=-16777217}function Vo(t,a){if(X1(a)){if(t.flags|=16777216,!ac(a))if(dh())t.flags|=8192;else throw Za=Al,Ar}else t.flags&=-16777217}function sl(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?G():536870912,t.lanes|=a,Gn|=a)}function Wn(t,a){if(!gt)switch(t.tailMode){case"hidden":a=t.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t.tail=null:i.sibling=null;break;case"collapsed":i=t.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function zt(t){var a=t.alternate!==null&&t.alternate.child===t.child,i=0,s=0;if(a)for(var c=t.child;c!==null;)i|=c.lanes|c.childLanes,s|=c.subtreeFlags&65011712,s|=c.flags&65011712,c.return=t,c=c.sibling;else for(c=t.child;c!==null;)i|=c.lanes|c.childLanes,s|=c.subtreeFlags,s|=c.flags,c.return=t,c=c.sibling;return t.subtreeFlags|=s,t.childLanes=i,a}function W0(t,a,i){var s=a.pendingProps;switch(Wt(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(a),null;case 1:return zt(a),null;case 3:return i=a.stateNode,s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Ke(Gt),sn(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(rn(a)?Oe(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,as())),jo(t,a),zt(a),null;case 26:if(Ge){var c=a.type,d=a.memoizedState;return t===null?(Oe(a),d!==null?(zt(a),Vo(a,d)):(zt(a),js(a,c,null,s,i))):d?d!==t.memoizedState?(Oe(a),zt(a),Vo(a,d)):(zt(a),a.flags&=-16777217):(d=t.memoizedProps,ne?d!==s&&Oe(a):qs(t,a,c,s),zt(a),js(a,c,d,s,i)),null}case 27:if(wt){if(Li(a),i=va.current,c=a.type,t!==null&&a.stateNode!=null)ne?t.memoizedProps!==s&&Oe(a):qs(t,a,c,s);else{if(!s){if(a.stateNode===null)throw Error(r(166));return zt(a),null}t=$t.current,rn(a)?Su(a,t):(t=nc(c,s,i,t,!0),a.stateNode=t,Oe(a))}return zt(a),null}case 5:if(Li(a),c=a.type,t!==null&&a.stateNode!=null)qs(t,a,c,s);else{if(!s){if(a.stateNode===null)throw Error(r(166));return zt(a),null}if(d=$t.current,rn(a))Su(a,d),R1(a.stateNode,c,s,d)&&(a.flags|=64);else{var p=Cf(c,s,va.current,d,a);ll(a),Xs(p,a,!1,!1),a.stateNode=p,Yh(p,c,s,d)&&Oe(a)}}return zt(a),js(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,i),null;case 6:if(t&&a.stateNode!=null)i=t.memoizedProps,ne?i!==s&&Oe(a):Ye&&(i!==s?(t=va.current,i=$t.current,ll(a),a.stateNode=Xh(s,t,i,a)):a.stateNode=t.stateNode);else{if(typeof s!="string"&&a.stateNode===null)throw Error(r(166));if(t=va.current,i=$t.current,rn(a)){if(!ie)throw Error(r(176));if(t=a.stateNode,i=a.memoizedProps,s=null,c=te,c!==null)switch(c.tag){case 27:case 5:s=c.memoizedProps}S1(t,i,a,s)||Ve(a,!0)}else ll(a),a.stateNode=Xh(s,t,i,a)}return zt(a),null;case 31:if(i=a.memoizedState,t===null||t.memoizedState!==null){if(s=rn(a),i!==null){if(t===null){if(!s)throw Error(r(318));if(!ie)throw Error(r(556));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));_1(t,a)}else Ga(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;zt(a),t=!1}else i=as(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return a.flags&256?(ce(a),a):(ce(a),null);if((a.flags&128)!==0)throw Error(r(558))}return zt(a),null;case 13:if(s=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(c=rn(a),s!==null&&s.dehydrated!==null){if(t===null){if(!c)throw Error(r(318));if(!ie)throw Error(r(344));if(c=a.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));C1(c,a)}else Ga(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;zt(a),c=!1}else c=as(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),c=!0;if(!c)return a.flags&256?(ce(a),a):(ce(a),null)}return ce(a),(a.flags&128)!==0?(a.lanes=i,a):(i=s!==null,t=t!==null&&t.memoizedState!==null,i&&(s=a.child,c=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(c=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==c&&(s.flags|=2048)),i!==t&&i&&(a.child.flags|=8192),sl(a,a.updateQueue),zt(a),null);case 4:return sn(),jo(t,a),t===null&&xf(a.stateNode.containerInfo),zt(a),null;case 10:return Ke(a.type),zt(a),null;case 19:if(E(Xt),s=a.memoizedState,s===null)return zt(a),null;if(c=(a.flags&128)!==0,d=s.rendering,d===null)if(c)Wn(s,!1);else{if(Lt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(d=Pi(t),d!==null){for(a.flags|=128,Wn(s,!1),t=d.updateQueue,a.updateQueue=t,sl(a,t),a.subtreeFlags=0,t=i,i=a.child;i!==null;)Mh(i,t),i=i.sibling;return _(Xt,Xt.current&1|2),gt&&Ct(a,s.treeForkCount),a.child}t=t.sibling}s.tail!==null&&ue()>gi&&(a.flags|=128,c=!0,Wn(s,!1),a.lanes=4194304)}else{if(!c)if(t=Pi(d),t!==null){if(a.flags|=128,c=!0,t=t.updateQueue,a.updateQueue=t,sl(a,t),Wn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!gt)return zt(a),null}else 2*ue()-s.renderingStartTime>gi&&i!==536870912&&(a.flags|=128,c=!0,Wn(s,!1),a.lanes=4194304);s.isBackwards?(d.sibling=a.child,a.child=d):(t=s.last,t!==null?t.sibling=d:a.child=d,s.last=d)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ue(),t.sibling=null,i=Xt.current,_(Xt,c?i&1|2:i&1),gt&&Ct(a,s.treeForkCount),t):(zt(a),null);case 22:case 23:return ce(a),ds(),s=a.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(a.flags|=8192):s&&(a.flags|=8192),s?(i&536870912)!==0&&(a.flags&128)===0&&(zt(a),a.subtreeFlags&6&&(a.flags|=8192)):zt(a),i=a.updateQueue,i!==null&&sl(a,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==i&&(a.flags|=2048),t!==null&&E(wa),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Ke(Gt),zt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function k0(t,a){switch(Wt(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Ke(Gt),sn(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Li(a),null;case 31:if(a.memoizedState!==null){if(ce(a),a.alternate===null)throw Error(r(340));Ga()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(ce(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ga()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return E(Xt),null;case 4:return sn(),null;case 10:return Ke(a.type),null;case 22:case 23:return ce(a),ds(),t!==null&&E(wa),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return Ke(Gt),null;case 25:return null;default:return null}}function Ko(t,a){switch(Wt(a),a.tag){case 3:Ke(Gt),sn();break;case 26:case 27:case 5:Li(a);break;case 4:sn();break;case 31:a.memoizedState!==null&&ce(a);break;case 13:ce(a);break;case 19:E(Xt);break;case 10:Ke(a.type);break;case 22:case 23:ce(a),ds(),t!==null&&E(wa);break;case 24:Ke(Gt)}}function kn(t,a){try{var i=a.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var c=s.next;i=c;do{if((i.tag&t)===t){s=void 0;var d=i.create,p=i.inst;s=d(),p.destroy=s}i=i.next}while(i!==c)}}catch(b){vt(a,a.return,b)}}function fa(t,a,i){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var d=c.next;s=d;do{if((s.tag&t)===t){var p=s.inst,b=p.destroy;if(b!==void 0){p.destroy=void 0,c=a;var D=i,B=b;try{B()}catch(K){vt(c,D,K)}}}s=s.next}while(s!==d)}}catch(K){vt(a,a.return,K)}}function Qo(t){var a=t.updateQueue;if(a!==null){var i=t.stateNode;try{Uu(a,i)}catch(s){vt(t,t.return,s)}}}function wo(t,a,i){i.props=La(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(s){vt(t,a,s)}}function In(t,a){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var s=ai(t.stateNode);break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof i=="function"?t.refCleanup=i(s):i.current=s}}catch(c){vt(t,a,c)}}function Le(t,a){var i=t.ref,s=t.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(c){vt(t,a,c)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(c){vt(t,a,c)}else i.current=null}function Zo(t){var a=t.type,i=t.memoizedProps,s=t.stateNode;try{wf(s,a,i,t)}catch(c){vt(t,t.return,c)}}function Vs(t,a,i){try{Zf(t.stateNode,t.type,i,a,t)}catch(s){vt(t,t.return,s)}}function Jo(t){return t.tag===5||t.tag===3||(Ge?t.tag===26:!1)||(wt?t.tag===27&&vn(t.type):!1)||t.tag===4}function Ks(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Jo(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(wt&&t.tag===27&&vn(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Qs(t,a,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,a?Pf(i,t,a):Kf(i,t);else if(s!==4&&(wt&&s===27&&vn(t.type)&&(i=t.stateNode,a=null),t=t.child,t!==null))for(Qs(t,a,i),t=t.sibling;t!==null;)Qs(t,a,i),t=t.sibling}function rl(t,a,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,a?Jf(i,t,a):Vf(i,t);else if(s!==4&&(wt&&s===27&&vn(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(rl(t,a,i),t=t.sibling;t!==null;)rl(t,a,i),t=t.sibling}function Po(t,a,i){t=t.containerInfo;try{wh(t,i)}catch(s){vt(a,a.return,s)}}function Fo(t){var a=t.stateNode,i=t.memoizedProps;try{j1(t.type,i,a,t)}catch(s){vt(t,t.return,s)}}function I0(t,a){for(Sf(t.containerInfo),Pt=a;Pt!==null;)if(t=Pt,a=t.child,(t.subtreeFlags&1028)!==0&&a!==null)a.return=t,Pt=a;else for(;Pt!==null;){t=Pt;var i=t.alternate;switch(a=t.flags,t.tag){case 0:if((a&4)!==0&&(a=t.updateQueue,a=a!==null?a.events:null,a!==null))for(var s=0;s<a.length;s++){var c=a[s];c.ref.impl=c.nextImpl}break;case 11:case 15:break;case 1:if((a&1024)!==0&&i!==null){a=void 0,s=t,c=i.memoizedProps,i=i.memoizedState;var d=s.stateNode;try{var p=La(s.type,c);a=d.getSnapshotBeforeUpdate(p,i),d.__reactInternalSnapshotBeforeUpdate=a}catch(b){vt(s,s.return,b)}}break;case 3:(a&1024)!==0&&ne&&e1(t.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=t.sibling,a!==null){a.return=t.return,Pt=a;break}Pt=t.return}}function Wo(t,a,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Ze(t,i),s&4&&kn(5,i);break;case 1:if(Ze(t,i),s&4)if(t=i.stateNode,a===null)try{t.componentDidMount()}catch(p){vt(i,i.return,p)}else{var c=La(i.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(c,a,t.__reactInternalSnapshotBeforeUpdate)}catch(p){vt(i,i.return,p)}}s&64&&Qo(i),s&512&&In(i,i.return);break;case 3:if(Ze(t,i),s&64&&(s=i.updateQueue,s!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=ai(i.child.stateNode);break;case 1:t=i.child.stateNode}try{Uu(s,t)}catch(p){vt(i,i.return,p)}}break;case 27:wt&&a===null&&s&4&&Fo(i);case 26:case 5:if(Ze(t,i),a===null){if(s&4)Zo(i);else if(s&64){t=i.type,a=i.memoizedProps,c=i.stateNode;try{T1(c,t,a,i)}catch(p){vt(i,i.return,p)}}}s&512&&In(i,i.return);break;case 12:Ze(t,i);break;case 31:Ze(t,i),s&4&&Io(t,i);break;case 13:Ze(t,i),s&4&&$o(t,i),s&64&&(s=i.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(i=sf.bind(null,i),l1(s,i))));break;case 22:if(s=i.memoizedState!==null||$e,!s){a=a!==null&&a.memoizedState!==null||Vt,c=$e;var d=Vt;$e=s,(Vt=a)&&!d?Je(t,i,(i.subtreeFlags&8772)!==0):Ze(t,i),$e=c,Vt=d}break;case 30:break;default:Ze(t,i)}}function ko(t){var a=t.alternate;a!==null&&(t.alternate=null,ko(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Rf(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ze(t,a,i){for(i=i.child;i!==null;)ws(t,a,i),i=i.sibling}function ws(t,a,i){if(me&&typeof me.onCommitFiberUnmount=="function")try{me.onCommitFiberUnmount(li,i)}catch{}switch(i.tag){case 26:if(Ge){Vt||Le(i,a),ze(t,a,i),i.memoizedState?$h(i.memoizedState):i.stateNode&&ec(i.stateNode);break}case 27:if(wt){Vt||Le(i,a);var s=Kt,c=oe;vn(i.type)&&(Kt=i.stateNode,oe=!1),ze(t,a,i),ic(i.stateNode),Kt=s,oe=c;break}case 5:Vt||Le(i,a);case 6:if(ne){if(s=Kt,c=oe,Kt=null,ze(t,a,i),Kt=s,oe=c,Kt!==null)if(oe)try{Wf(Kt,i.stateNode)}catch(d){vt(i,a,d)}else try{Ff(Kt,i.stateNode)}catch(d){vt(i,a,d)}}else ze(t,a,i);break;case 18:ne&&Kt!==null&&(oe?z1(Kt,i.stateNode):O1(Kt,i.stateNode));break;case 4:ne?(s=Kt,c=oe,Kt=i.stateNode.containerInfo,oe=!0,ze(t,a,i),Kt=s,oe=c):(Ye&&Po(i.stateNode,i,Kh()),ze(t,a,i));break;case 0:case 11:case 14:case 15:fa(2,i,a),Vt||fa(4,i,a),ze(t,a,i);break;case 1:Vt||(Le(i,a),s=i.stateNode,typeof s.componentWillUnmount=="function"&&wo(i,a,s)),ze(t,a,i);break;case 21:ze(t,a,i);break;case 22:Vt=(s=Vt)||i.memoizedState!==null,ze(t,a,i),Vt=s;break;default:ze(t,a,i)}}function Io(t,a){if(ie&&a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{A1(t)}catch(i){vt(a,a.return,i)}}}function $o(t,a){if(ie&&a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{M1(t)}catch(i){vt(a,a.return,i)}}function $0(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new gc),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new gc),a;default:throw Error(r(435,t.tag))}}function ul(t,a){var i=$0(t);a.forEach(function(s){if(!i.has(s)){i.add(s);var c=rf.bind(null,t,s);s.then(c,c)}})}function ae(t,a){var i=a.deletions;if(i!==null)for(var s=0;s<i.length;s++){var c=i[s],d=t,p=a;if(ne){var b=p;t:for(;b!==null;){switch(b.tag){case 27:if(wt){if(vn(b.type)){Kt=b.stateNode,oe=!1;break t}break}case 5:Kt=b.stateNode,oe=!1;break t;case 3:case 4:Kt=b.stateNode.containerInfo,oe=!0;break t}b=b.return}if(Kt===null)throw Error(r(160));ws(d,p,c),Kt=null,oe=!1}else ws(d,p,c);d=c.alternate,d!==null&&(d.return=null),c.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)th(a,t),a=a.sibling}function th(t,a){var i=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ae(a,t),se(t),s&4&&(fa(3,t,t.return),kn(3,t),fa(5,t,t.return));break;case 1:ae(a,t),se(t),s&512&&(Vt||i===null||Le(i,i.return)),s&64&&$e&&(t=t.updateQueue,t!==null&&(s=t.callbacks,s!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:if(Ge){var c=He;if(ae(a,t),se(t),s&512&&(Vt||i===null||Le(i,i.return)),s&4){s=i!==null?i.memoizedState:null;var d=t.memoizedState;i===null?d===null?t.stateNode===null?t.stateNode=U1(c,t.type,t.memoizedProps,t):tc(c,t.type,t.stateNode):t.stateNode=Ih(c,d,t.memoizedProps):s!==d?(s===null?i.stateNode!==null&&ec(i.stateNode):$h(s),d===null?tc(c,t.type,t.stateNode):Ih(c,d,t.memoizedProps)):d===null&&t.stateNode!==null&&Vs(t,t.memoizedProps,i.memoizedProps)}break}case 27:if(wt){ae(a,t),se(t),s&512&&(Vt||i===null||Le(i,i.return)),i!==null&&s&4&&Vs(t,t.memoizedProps,i.memoizedProps);break}case 5:if(ae(a,t),se(t),s&512&&(Vt||i===null||Le(i,i.return)),ne){if(t.flags&32){c=t.stateNode;try{Vh(c)}catch(Y){vt(t,t.return,Y)}}s&4&&t.stateNode!=null&&(c=t.memoizedProps,Vs(t,c,i!==null?i.memoizedProps:c)),s&1024&&(Gr=!0)}else Ye&&t.alternate!==null&&(t.alternate.stateNode=t.stateNode);break;case 6:if(ae(a,t),se(t),s&4&&ne){if(t.stateNode===null)throw Error(r(162));s=t.memoizedProps,i=i!==null?i.memoizedProps:s,c=t.stateNode;try{Qf(c,i,s)}catch(Y){vt(t,t.return,Y)}}break;case 3:if(Ge?(Y1(),c=He,He=pr(a.containerInfo),ae(a,t),He=c):ae(a,t),se(t),s&4){if(ne&&ie&&i!==null&&i.memoizedState.isDehydrated)try{x1(a.containerInfo)}catch(Y){vt(t,t.return,Y)}if(Ye){s=a.containerInfo,i=a.pendingChildren;try{wh(s,i)}catch(Y){vt(t,t.return,Y)}}}Gr&&(Gr=!1,eh(t));break;case 4:Ge?(i=He,He=pr(t.stateNode.containerInfo),ae(a,t),se(t),He=i):(ae(a,t),se(t)),s&4&&Ye&&Po(t.stateNode,t,t.stateNode.pendingChildren);break;case 12:ae(a,t),se(t);break;case 31:ae(a,t),se(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,ul(t,s)));break;case 13:ae(a,t),se(t),t.child.flags&8192&&t.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Bl=ue()),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,ul(t,s)));break;case 22:c=t.memoizedState!==null;var p=i!==null&&i.memoizedState!==null,b=$e,D=Vt;if($e=b||c,Vt=D||p,ae(a,t),Vt=D,$e=b,se(t),s&8192&&(a=t.stateNode,a._visibility=c?a._visibility&-2:a._visibility|1,c&&(i===null||p||$e||Vt||Ya(t)),ne)){t:if(i=null,ne)for(a=t;;){if(a.tag===5||Ge&&a.tag===26){if(i===null){p=i=a;try{d=p.stateNode,c?kf(d):$f(p.stateNode,p.memoizedProps)}catch(Y){vt(p,p.return,Y)}}}else if(a.tag===6){if(i===null){p=a;try{var B=p.stateNode;c?If(B):t1(B,p.memoizedProps)}catch(Y){vt(p,p.return,Y)}}}else if(a.tag===18){if(i===null){p=a;try{var K=p.stateNode;c?D1(K):G1(p.stateNode)}catch(Y){vt(p,p.return,Y)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break t;for(;a.sibling===null;){if(a.return===null||a.return===t)break t;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}}s&4&&(s=t.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,ul(t,i))));break;case 19:ae(a,t),se(t),s&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,ul(t,s)));break;case 30:break;case 21:break;default:ae(a,t),se(t)}}function se(t){var a=t.flags;if(a&2){try{for(var i,s=t.return;s!==null;){if(Jo(s)){i=s;break}s=s.return}if(ne){if(i==null)throw Error(r(160));switch(i.tag){case 27:if(wt){var c=i.stateNode,d=Ks(t);rl(t,d,c);break}case 5:var p=i.stateNode;i.flags&32&&(Vh(p),i.flags&=-33);var b=Ks(t);rl(t,b,p);break;case 3:case 4:var D=i.stateNode.containerInfo,B=Ks(t);Qs(t,B,D);break;default:throw Error(r(161))}}}catch(K){vt(t,t.return,K)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function eh(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;eh(a),a.tag===5&&a.flags&1024&&Gf(a.stateNode),t=t.sibling}}function Ze(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Wo(t,a.alternate,a),a=a.sibling}function Ya(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:fa(4,a,a.return),Ya(a);break;case 1:Le(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&wo(a,a.return,i),Ya(a);break;case 27:wt&&ic(a.stateNode);case 26:case 5:Le(a,a.return),Ya(a);break;case 22:a.memoizedState===null&&Ya(a);break;case 30:Ya(a);break;default:Ya(a)}t=t.sibling}}function Je(t,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var s=a.alternate,c=t,d=a,p=d.flags;switch(d.tag){case 0:case 11:case 15:Je(c,d,i),kn(4,d);break;case 1:if(Je(c,d,i),s=d,c=s.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(B){vt(s,s.return,B)}if(s=d,c=s.updateQueue,c!==null){var b=s.stateNode;try{var D=c.shared.hiddenCallbacks;if(D!==null)for(c.shared.hiddenCallbacks=null,c=0;c<D.length;c++)Bu(D[c],b)}catch(B){vt(s,s.return,B)}}i&&p&64&&Qo(d),In(d,d.return);break;case 27:wt&&Fo(d);case 26:case 5:Je(c,d,i),i&&s===null&&p&4&&Zo(d),In(d,d.return);break;case 12:Je(c,d,i);break;case 31:Je(c,d,i),i&&p&4&&Io(c,d);break;case 13:Je(c,d,i),i&&p&4&&$o(c,d);break;case 22:d.memoizedState===null&&Je(c,d,i),In(d,d.return);break;case 30:break;default:Je(c,d,i)}a=a.sibling}}function Zs(t,a){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&Vn(i))}function Js(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Vn(t))}function De(t,a,i,s){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)ah(t,a,i,s),a=a.sibling}function ah(t,a,i,s){var c=a.flags;switch(a.tag){case 0:case 11:case 15:De(t,a,i,s),c&2048&&kn(9,a);break;case 1:De(t,a,i,s);break;case 3:De(t,a,i,s),c&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Vn(t)));break;case 12:if(c&2048){De(t,a,i,s),t=a.stateNode;try{var d=a.memoizedProps,p=d.id,b=d.onPostCommit;typeof b=="function"&&b(p,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(D){vt(a,a.return,D)}}else De(t,a,i,s);break;case 31:De(t,a,i,s);break;case 13:De(t,a,i,s);break;case 23:break;case 22:d=a.stateNode,p=a.alternate,a.memoizedState!==null?d._visibility&2?De(t,a,i,s):$n(t,a):d._visibility&2?De(t,a,i,s):(d._visibility|=2,cn(t,a,i,s,(a.subtreeFlags&10256)!==0||!1)),c&2048&&Zs(p,a);break;case 24:De(t,a,i,s),c&2048&&Js(a.alternate,a);break;default:De(t,a,i,s)}}function cn(t,a,i,s,c){for(c=c&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var d=t,p=a,b=i,D=s,B=p.flags;switch(p.tag){case 0:case 11:case 15:cn(d,p,b,D,c),kn(8,p);break;case 23:break;case 22:var K=p.stateNode;p.memoizedState!==null?K._visibility&2?cn(d,p,b,D,c):$n(d,p):(K._visibility|=2,cn(d,p,b,D,c)),c&&B&2048&&Zs(p.alternate,p);break;case 24:cn(d,p,b,D,c),c&&B&2048&&Js(p.alternate,p);break;default:cn(d,p,b,D,c)}a=a.sibling}}function $n(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=t,s=a,c=s.flags;switch(s.tag){case 22:$n(i,s),c&2048&&Zs(s.alternate,s);break;case 24:$n(i,s),c&2048&&Js(s.alternate,s);break;default:$n(i,s)}a=a.sibling}}function Xa(t,a,i){if(t.subtreeFlags&zn)for(t=t.child;t!==null;)nh(t,a,i),t=t.sibling}function nh(t,a,i){switch(t.tag){case 26:if(Xa(t,a,i),t.flags&zn)if(t.memoizedState!==null)q1(i,He,t.memoizedState,t.memoizedProps);else{var s=t.stateNode,c=t.type;t=t.memoizedProps,((a&335544128)===a||dr(c,t))&&jh(i,s,c,t)}break;case 5:Xa(t,a,i),t.flags&zn&&(s=t.stateNode,c=t.type,t=t.memoizedProps,((a&335544128)===a||dr(c,t))&&jh(i,s,c,t));break;case 3:case 4:Ge?(s=He,He=pr(t.stateNode.containerInfo),Xa(t,a,i),He=s):Xa(t,a,i);break;case 22:t.memoizedState===null&&(s=t.alternate,s!==null&&s.memoizedState!==null?(s=zn,zn=16777216,Xa(t,a,i),zn=s):Xa(t,a,i));break;default:Xa(t,a,i)}}function ih(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function ti(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var s=a[i];Pt=s,sh(s,t)}ih(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)lh(t),t=t.sibling}function lh(t){switch(t.tag){case 0:case 11:case 15:ti(t),t.flags&2048&&fa(9,t,t.return);break;case 3:ti(t);break;case 12:ti(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,ol(t)):ti(t);break;default:ti(t)}}function ol(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var s=a[i];Pt=s,sh(s,t)}ih(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:fa(8,a,a.return),ol(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,ol(a));break;default:ol(a)}t=t.sibling}}function sh(t,a){for(;Pt!==null;){var i=Pt;switch(i.tag){case 0:case 11:case 15:fa(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Vn(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Pt=s;else t:for(i=t;Pt!==null;){s=Pt;var c=s.sibling,d=s.return;if(ko(s),s===i){Pt=null;break t}if(c!==null){c.return=d,Pt=c;break t}Pt=d}}}function Ps(t){var a=Tf(t);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(r(364));return a}if(t=Uf(t),t===null)throw Error(r(362));return t.stateNode.current}function Fs(t,a){var i=t.tag;switch(a.$$typeof){case Ol:if(t.type===a.value)return!0;break;case zl:t:{for(a=a.value,t=[t,0],i=0;i<t.length;){var s=t[i++],c=s.tag,d=t[i++],p=a[d];if(c!==5&&c!==26&&c!==27||!ii(s)){for(;p!=null&&Fs(s,p);)d++,p=a[d];if(d===a.length){a=!0;break t}else for(s=s.child;s!==null;)t.push(s,d),s=s.sibling}}a=!1}return a;case Dl:if((i===5||i===26||i===27)&&Xf(t.stateNode,a.value))return!0;break;case Hl:if((i===5||i===6||i===26||i===27)&&(t=Yf(t),t!==null&&0<=t.indexOf(a.value)))return!0;break;case Gl:if((i===5||i===26||i===27)&&(t=t.memoizedProps["data-testname"],typeof t=="string"&&t.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function Ws(t){switch(t.$$typeof){case Ol:return"<"+(S(t.value)||"Unknown")+">";case zl:return":has("+(Ws(t)||"")+")";case Dl:return'[role="'+t.value+'"]';case Hl:return'"'+t.value+'"';case Gl:return'[data-testname="'+t.value+'"]';default:throw Error(r(365))}}function rh(t,a){var i=[];t=[t,0];for(var s=0;s<t.length;){var c=t[s++],d=c.tag,p=t[s++],b=a[p];if(d!==5&&d!==26&&d!==27||!ii(c)){for(;b!=null&&Fs(c,b);)p++,b=a[p];if(p===a.length)i.push(c);else for(c=c.child;c!==null;)t.push(c,p),c=c.sibling}}return i}function ks(t,a){if(!ni)throw Error(r(363));t=Ps(t),t=rh(t,a),a=[],t=Array.from(t);for(var i=0;i<t.length;){var s=t[i++],c=s.tag;if(c===5||c===26||c===27)ii(s)||a.push(s.stateNode);else for(s=s.child;s!==null;)t.push(s),s=s.sibling}return a}function fe(){return(ot&2)!==0&&ft!==0?ft&-ft:$.T!==null?ss():Af()}function uh(){if(Se===0)if((ft&536870912)===0||gt){var t=vl;vl<<=1,(vl&3932160)===0&&(vl=262144),Se=t}else Se=536870912;return t=ve.current,t!==null&&(t.flags|=32),Se}function re(t,a,i){(t===xt&&(Et===2||Et===9)||t.cancelPendingCommit!==null)&&(fn(t,0),da(t,ft,Se,!1)),L(t,i),((ot&2)===0||t!==xt)&&(t===xt&&((ot&2)===0&&(Fa|=i),Lt===4&&da(t,ft,Se,!1)),Ue(t))}function oh(t,a,i){if((ot&6)!==0)throw Error(r(327));var s=!i&&(a&127)===0&&(a&t.expiredLanes)===0||M(t,a),c=s?af(t,a):$s(t,a,!0),d=s;do{if(c===0){Dn&&!s&&da(t,a,0,!1);break}else{if(i=t.current.alternate,d&&!tf(i)){c=$s(t,a,!1),d=!1;continue}if(c===2){if(d=a,t.errorRecoveryDisabledLanes&d)var p=0;else p=t.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){a=p;t:{var b=t;c=di;var D=ie&&b.current.memoizedState.isDehydrated;if(D&&(fn(b,p).flags|=256),p=$s(b,p,!1),p!==2){if(Hr&&!D){b.errorRecoveryDisabledLanes|=d,Fa|=d,c=4;break t}d=he,he=c,d!==null&&(he===null?he=d:he.push.apply(he,d))}c=p}if(d=!1,c!==2)continue}}if(c===1){fn(t,0),da(t,a,0,!0);break}t:{switch(s=t,d=c,d){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:da(s,a,Se,!_a);break t;case 2:he=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(c=Bl+300-ue(),10<c)){if(da(s,a,Se,!_a),O(s,0,!0)!==0)break t;ea=a,s.timeoutHandle=Ef(hh.bind(null,s,i,he,Ul,Ur,a,Se,Fa,Gn,_a,d,"Throttled",-0,0),c);break t}hh(s,i,he,Ul,Ur,a,Se,Fa,Gn,_a,d,null,-0,0)}}break}while(!0);Ue(t)}function hh(t,a,i,s,c,d,p,b,D,B,K,Y,J,nt){if(t.timeoutHandle=ja,Y=a.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y=zf(),nh(a,d,Y);var ee=(d&62914560)===d?Bl-ue():(d&4194048)===d?mc-ue():0;if(ee=Df(Y,ee),ee!==null){ea=d,t.cancelPendingCommit=ee(Sh.bind(null,t,a,d,i,s,c,p,b,D,K,Y,null,J,nt)),da(t,d,p,!B);return}}Sh(t,a,d,i,s,c,p,b,D)}function tf(t){for(var a=t;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var c=i[s],d=c.getSnapshot;c=c.value;try{if(!pe(d(),c))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function da(t,a,i,s){a&=~Br,a&=~Fa,t.suspendedLanes|=a,t.pingedLanes&=~a,s&&(t.warmLanes|=a),s=t.expirationTimes;for(var c=a;0<c;){var d=31-ge(c),p=1<<d;s[d]=-1,c&=~p}i!==0&&w(t,i,a)}function ch(){return(ot&6)===0?(on(0),!1):!0}function Is(){if(ht!==null){if(Et===0)var t=ht.return;else t=ht,ke=Ka=null,Ss(t),An=null,oi=0,t=ht;for(;t!==null;)Ko(t.alternate,t),t=t.return;ht=null}}function fn(t,a){var i=t.timeoutHandle;i!==ja&&(t.timeoutHandle=ja,bf(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),ea=0,Is(),xt=t,ht=i=Pe(t.current,null),ft=a,Et=0,ye=null,_a=!1,Dn=M(t,a),Hr=!1,Gn=Se=Br=Fa=Ca=Lt=0,he=di=null,Ur=!1,(a&8)!==0&&(a|=a&32);var s=t.entangledLanes;if(s!==0)for(t=t.entanglements,s&=a;0<s;){var c=31-ge(s),d=1<<c;a|=t[c],s&=~d}return ta=a,wi(),i}function fh(t,a){it=null,$.H=ci,a===xn||a===xl?(a=zu(),Et=3):a===Ar?(a=zu(),Et=4):Et=a===zr?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ye=a,ht===null&&(Lt=1,el(t,st(a,t.current)))}function dh(){var t=ve.current;return t===null?!0:(ft&4194048)===ft?Me===null:(ft&62914560)===ft||(ft&536870912)!==0?t===Me:!1}function gh(){var t=$.H;return $.H=ci,t===null?ci:t}function mh(){var t=$.A;return $.A=ed,t}function hl(){Lt=4,_a||(ft&4194048)!==ft&&ve.current!==null||(Dn=!0),(Ca&134217727)===0&&(Fa&134217727)===0||xt===null||da(xt,ft,Se,!1)}function $s(t,a,i){var s=ot;ot|=2;var c=gh(),d=mh();(xt!==t||ft!==a)&&(Ul=null,fn(t,a)),a=!1;var p=Lt;t:do try{if(Et!==0&&ht!==null){var b=ht,D=ye;switch(Et){case 8:Is(),p=6;break t;case 3:case 2:case 9:case 6:ve.current===null&&(a=!0);var B=Et;if(Et=0,ye=null,dn(t,b,D,B),i&&Dn){p=0;break t}break;default:B=Et,Et=0,ye=null,dn(t,b,D,B)}}ef(),p=Lt;break}catch(K){fh(t,K)}while(!0);return a&&t.shellSuspendCounter++,ke=Ka=null,ot=s,$.H=c,$.A=d,ht===null&&(xt=null,ft=0,wi()),p}function ef(){for(;ht!==null;)ph(ht)}function af(t,a){var i=ot;ot|=2;var s=gh(),c=mh();xt!==t||ft!==a?(Ul=null,gi=ue()+500,fn(t,a)):Dn=M(t,a);t:do try{if(Et!==0&&ht!==null){a=ht;var d=ye;e:switch(Et){case 1:Et=0,ye=null,dn(t,a,d,1);break;case 2:case 9:if(Nu(d)){Et=0,ye=null,vh(a);break}a=function(){Et!==2&&Et!==9||xt!==t||(Et=7),Ue(t)},d.then(a,a);break t;case 3:Et=7;break t;case 4:Et=5;break t;case 7:Nu(d)?(Et=0,ye=null,vh(a)):(Et=0,ye=null,dn(t,a,d,7));break;case 5:var p=null;switch(ht.tag){case 26:p=ht.memoizedState;case 5:case 27:var b=ht,D=b.type,B=b.pendingProps;if(p?ac(p):qh(b.stateNode,D,B)){Et=0,ye=null;var K=b.sibling;if(K!==null)ht=K;else{var Y=b.return;Y!==null?(ht=Y,cl(Y)):ht=null}break e}}Et=0,ye=null,dn(t,a,d,5);break;case 6:Et=0,ye=null,dn(t,a,d,6);break;case 8:Is(),Lt=6;break t;default:throw Error(r(462))}}nf();break}catch(J){fh(t,J)}while(!0);return ke=Ka=null,$.H=s,$.A=c,ot=i,ht!==null?0:(xt=null,ft=0,wi(),Lt)}function nf(){for(;ht!==null&&!Q1();)ph(ht)}function ph(t){var a=Yo(t.alternate,t,ta);t.memoizedProps=t.pendingProps,a===null?cl(t):ht=a}function vh(t){var a=t,i=a.alternate;switch(a.tag){case 15:case 0:a=Do(i,a,a.pendingProps,a.type,void 0,ft);break;case 11:a=Do(i,a,a.pendingProps,a.type.render,a.ref,ft);break;case 5:Ss(a);default:Ko(i,a),a=ht=Mh(a,ta),a=Yo(i,a,ta)}t.memoizedProps=t.pendingProps,a===null?cl(t):ht=a}function dn(t,a,i,s){ke=Ka=null,Ss(a),An=null,oi=0;var c=a.return;try{if(J0(t,c,a,i,ft)){Lt=1,el(t,st(i,t.current)),ht=null;return}}catch(d){if(c!==null)throw ht=c,d;Lt=1,el(t,st(i,t.current)),ht=null;return}a.flags&32768?(gt||s===1?t=!0:Dn||(ft&536870912)!==0?t=!1:(_a=t=!0,(s===2||s===9||s===3||s===6)&&(s=ve.current,s!==null&&s.tag===13&&(s.flags|=16384))),yh(a,t)):cl(a)}function cl(t){var a=t;do{if((a.flags&32768)!==0){yh(a,_a);return}t=a.return;var i=W0(a.alternate,a,ta);if(i!==null){ht=i;return}if(a=a.sibling,a!==null){ht=a;return}ht=a=t}while(a!==null);Lt===0&&(Lt=5)}function yh(t,a){do{var i=k0(t.alternate,t);if(i!==null){i.flags&=32767,ht=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(t=t.sibling,t!==null)){ht=t;return}ht=t=i}while(t!==null);Lt=6,ht=null}function Sh(t,a,i,s,c,d,p,b,D){t.cancelPendingCommit=null;do ei();while(Zt!==0);if((ot&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(d=a.lanes|a.childLanes,d|=Mr,P(t,i,d,p,b,D),t===xt&&(ht=xt=null,ft=0),Hn=a,ba=t,ea=i,Lr=d,Yr=c,pc=s,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,uf(Sr,function(){return Th(),null})):(t.callbackNode=null,t.callbackPriority=0),s=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||s){s=$.T,$.T=null,c=We(),Jt(2),p=ot,ot|=4;try{I0(t,a,i)}finally{ot=p,Jt(c),$.T=s}}Zt=1,_h(),Ch(),Eh()}}function _h(){if(Zt===1){Zt=0;var t=ba,a=Hn,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=$.T,$.T=null;var s=We();Jt(2);var c=ot;ot|=4;try{th(a,t),_f(t.containerInfo)}finally{ot=c,Jt(s),$.T=i}}t.current=a,Zt=2}}function Ch(){if(Zt===2){Zt=0;var t=ba,a=Hn,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=$.T,$.T=null;var s=We();Jt(2);var c=ot;ot|=4;try{Wo(t,a.alternate,a)}finally{ot=c,Jt(s),$.T=i}}Zt=3}}function Eh(){if(Zt===4||Zt===3){Zt=0,w1();var t=ba,a=Hn,i=ea,s=pc;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Zt=5:(Zt=0,Hn=ba=null,bh(t,t.pendingLanes));var c=t.pendingLanes;if(c===0&&(Ea=null),k(i),a=a.stateNode,me&&typeof me.onCommitFiberRoot=="function")try{me.onCommitFiberRoot(li,a,void 0,(a.current.flags&128)===128)}catch{}if(s!==null){a=$.T,c=We(),Jt(2),$.T=null;try{for(var d=t.onRecoverableError,p=0;p<s.length;p++){var b=s[p];d(b.value,{componentStack:b.stack})}}finally{$.T=a,Jt(c)}}(ea&3)!==0&&ei(),Ue(t),c=t.pendingLanes,(i&261930)!==0&&(c&42)!==0?t===Xr?mi++:(mi=0,Xr=t):mi=0,ie&&N1(),on(0)}}function bh(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Vn(a)))}function ei(){return _h(),Ch(),Eh(),Th()}function Th(){if(Zt!==5)return!1;var t=ba,a=Lr;Lr=0;var i=k(ea),s=32>i?32:i;i=$.T;var c=We();try{Jt(s),$.T=null,s=Yr,Yr=null;var d=ba,p=ea;if(Zt=0,Hn=ba=null,ea=0,(ot&6)!==0)throw Error(r(331));var b=ot;if(ot|=4,lh(d.current),ah(d,d.current,p,s),ot=b,on(0,!1),me&&typeof me.onPostCommitFiberRoot=="function")try{me.onPostCommitFiberRoot(li,d)}catch{}return!0}finally{Jt(c),$.T=i,bh(t,a)}}function xh(t,a,i){a=st(i,a),a=zs(t.stateNode,a,2),t=oa(t,a,2),t!==null&&(L(t,2),Ue(t))}function vt(t,a,i){if(t.tag===3)xh(t,t,i);else for(;a!==null;){if(a.tag===3){xh(a,t,i);break}else if(a.tag===1){var s=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ea===null||!Ea.has(s))){t=st(i,t),i=To(2),s=oa(a,i,2),s!==null&&(xo(i,s,a,t),L(s,2),Ue(s));break}}a=a.return}}function tr(t,a,i){var s=t.pingCache;if(s===null){s=t.pingCache=new ad;var c=new Set;s.set(a,c)}else c=s.get(a),c===void 0&&(c=new Set,s.set(a,c));c.has(i)||(Hr=!0,c.add(i),t=lf.bind(null,t,a,i),a.then(t,t))}function lf(t,a,i){var s=t.pingCache;s!==null&&s.delete(a),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,xt===t&&(ft&i)===i&&(Lt===4||Lt===3&&(ft&62914560)===ft&&300>ue()-Bl?(ot&2)===0&&fn(t,0):Br|=i,Gn===ft&&(Gn=0)),Ue(t)}function Ah(t,a){a===0&&(a=G()),t=Ua(t,a),t!==null&&(L(t,a),Ue(t))}function sf(t){var a=t.memoizedState,i=0;a!==null&&(i=a.retryLane),Ah(t,i)}function rf(t,a){var i=0;switch(t.tag){case 31:case 13:var s=t.stateNode,c=t.memoizedState;c!==null&&(i=c.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(r(314))}s!==null&&s.delete(a),Ah(t,i)}function uf(t,a){return Sl(t,a)}function of(t,a,i,s){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function er(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Pe(t,a){var i=t.alternate;return i===null?(i=n(t.tag,a,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=a,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&65011712,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,a=t.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function Mh(t,a){t.flags&=65011714;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,a=i.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function fl(t,a,i,s,c,d){var p=0;if(s=t,typeof t=="function")er(t)&&(p=1);else if(typeof t=="string")p=Ge&&wt?Wh(t,i,$t.current)?26:lc(t)?27:5:Ge?Wh(t,i,$t.current)?26:5:wt&&lc(t)?27:5;else t:switch(t){case cr:return t=n(31,i,a,c),t.elementType=cr,t.lanes=d,t;case mn:return qa(i.children,c,d,a);case Hh:p=8,c|=24;break;case sr:return t=n(12,i,a,c|2),t.elementType=sr,t.lanes=d,t;case ur:return t=n(13,i,a,c),t.elementType=ur,t.lanes=d,t;case or:return t=n(19,i,a,c),t.elementType=or,t.lanes=d,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ga:p=10;break t;case Bh:p=9;break t;case rr:p=11;break t;case hr:p=14;break t;case ma:p=16,s=null;break t}p=29,i=Error(r(130,t===null?"null":typeof t,"")),s=null}return a=n(p,i,a,c),a.elementType=t,a.type=s,a.lanes=d,a}function qa(t,a,i,s){return t=n(7,t,s,a),t.lanes=i,t}function ar(t,a,i){return t=n(6,t,null,a),t.lanes=i,t}function Rh(t){var a=n(18,null,null,0);return a.stateNode=t,a}function nr(t,a,i){return a=n(4,t.children!==null?t.children:[],t.key,a),a.lanes=i,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}function hf(t,a,i,s,c,d,p,b,D){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ja,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Q(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Q(0),this.hiddenUpdates=Q(null),this.identifierPrefix=s,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Nh(t,a,i,s,c,d,p,b,D,B,K,Y){return t=new hf(t,a,i,p,D,B,K,Y,b),a=1,d===!0&&(a|=24),d=n(3,null,null,a),t.current=d,d.stateNode=t,a=ls(),a.refCount++,t.pooledCache=a,a.refCount++,d.memoizedState={element:s,isDehydrated:i,cache:a},os(d),t}function Oh(t){return t?(t=Sn,t):Sn}function zh(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=f(a),t=t!==null?g(t):null,t===null?null:ai(t.stateNode)}function Dh(t,a,i,s,c,d){c=Oh(c),s.context===null?s.context=c:s.pendingContext=c,s=ua(a),s.payload={element:i},d=d===void 0?null:d,d!==null&&(s.callback=d),i=oa(t,s,a),i!==null&&(re(i,t,a),Qn(i,t,a))}function Gh(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<a?i:a}}function ir(t,a){Gh(t,a),(t=t.alternate)&&Gh(t,a)}var ut={},cf=kc(),de=id(),lr=Object.assign,ff=Symbol.for("react.element"),dl=Symbol.for("react.transitional.element"),gn=Symbol.for("react.portal"),mn=Symbol.for("react.fragment"),Hh=Symbol.for("react.strict_mode"),sr=Symbol.for("react.profiler"),Bh=Symbol.for("react.consumer"),ga=Symbol.for("react.context"),rr=Symbol.for("react.forward_ref"),ur=Symbol.for("react.suspense"),or=Symbol.for("react.suspense_list"),hr=Symbol.for("react.memo"),ma=Symbol.for("react.lazy"),cr=Symbol.for("react.activity"),df=Symbol.for("react.memo_cache_sentinel"),Uh=Symbol.iterator,gf=Symbol.for("react.client.reference"),gl=Array.isArray,$=cf.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,mf=e.rendererVersion,pf=e.rendererPackageName,Lh=e.extraDevToolsConfig,ai=e.getPublicInstance,vf=e.getRootHostContext,yf=e.getChildHostContext,Sf=e.prepareForCommit,_f=e.resetAfterCommit,Cf=e.createInstance;e.cloneMutableInstance;var fr=e.appendInitialChild,Yh=e.finalizeInitialChildren,ml=e.shouldSetTextContent,Xh=e.createTextInstance;e.cloneMutableTextInstance;var Ef=e.scheduleTimeout,bf=e.cancelTimeout,ja=e.noTimeout,Fe=e.isPrimaryRenderer;e.warnsIfNotActing;var ne=e.supportsMutation,Ye=e.supportsPersistence,ie=e.supportsHydration,Tf=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var xf=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Jt=e.setCurrentUpdatePriority,We=e.getCurrentUpdatePriority,Af=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var Mf=e.shouldAttemptEagerTransition,Rf=e.detachDeletedInstance;e.requestPostPaintCallback;var Nf=e.maySuspendCommit,Of=e.maySuspendCommitOnUpdate,dr=e.maySuspendCommitInSyncRender,qh=e.preloadInstance,zf=e.startSuspendingCommit,jh=e.suspendInstance;e.suspendOnActiveViewTransition;var Df=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var pn=e.NotPendingTransition,Va=e.HostTransitionContext,Gf=e.resetFormInstance;e.bindToConsole;var Hf=e.supportsMicrotasks,Bf=e.scheduleMicrotask,ni=e.supportsTestSelectors,Uf=e.findFiberRoot,Lf=e.getBoundingRect,Yf=e.getTextContent,ii=e.isHiddenSubtree,Xf=e.matchAccessibilityRole,qf=e.setFocusIfFocusable,jf=e.setupIntersectionObserver,Vf=e.appendChild,Kf=e.appendChildToContainer,Qf=e.commitTextUpdate,wf=e.commitMount,Zf=e.commitUpdate,Jf=e.insertBefore,Pf=e.insertInContainerBefore,Ff=e.removeChild,Wf=e.removeChildFromContainer,Vh=e.resetTextContent,kf=e.hideInstance,If=e.hideTextInstance,$f=e.unhideInstance,t1=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var e1=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var a1=e.cloneInstance,Kh=e.createContainerChildSet,Qh=e.appendChildToContainerChildSet,n1=e.finalizeContainerChildren,wh=e.replaceContainerChildren,Zh=e.cloneHiddenInstance,Jh=e.cloneHiddenTextInstance,gr=e.isSuspenseInstancePending,mr=e.isSuspenseInstanceFallback,i1=e.getSuspenseInstanceFallbackErrorDetails,l1=e.registerSuspenseInstanceRetry,s1=e.canHydrateFormStateMarker,r1=e.isFormStateMarkerMatching,Ph=e.getNextHydratableSibling,u1=e.getNextHydratableSiblingAfterSingleton,o1=e.getFirstHydratableChild,h1=e.getFirstHydratableChildWithinContainer,c1=e.getFirstHydratableChildWithinActivityInstance,f1=e.getFirstHydratableChildWithinSuspenseInstance,d1=e.getFirstHydratableChildWithinSingleton,g1=e.canHydrateInstance,m1=e.canHydrateTextInstance,p1=e.canHydrateActivityInstance,v1=e.canHydrateSuspenseInstance,y1=e.hydrateInstance,S1=e.hydrateTextInstance,_1=e.hydrateActivityInstance,C1=e.hydrateSuspenseInstance,E1=e.getNextHydratableInstanceAfterActivityInstance,b1=e.getNextHydratableInstanceAfterSuspenseInstance,T1=e.commitHydratedInstance,x1=e.commitHydratedContainer,A1=e.commitHydratedActivityInstance,M1=e.commitHydratedSuspenseInstance,R1=e.finalizeHydratedChildren,N1=e.flushHydrationEvents;e.clearActivityBoundary;var O1=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var z1=e.clearSuspenseBoundaryFromContainer,D1=e.hideDehydratedBoundary,G1=e.unhideDehydratedBoundary,Fh=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var H1=e.validateHydratableInstance,B1=e.validateHydratableTextInstance,Ge=e.supportsResources,Wh=e.isHostHoistableType,pr=e.getHoistableRoot,kh=e.getResource,Ih=e.acquireResource,$h=e.releaseResource,U1=e.hydrateHoistable,tc=e.mountHoistable,ec=e.unmountHoistable,L1=e.createHoistableInstance,Y1=e.prepareToCommitHoistables,X1=e.mayResourceSuspendCommit,ac=e.preloadResource,q1=e.suspendResource,wt=e.supportsSingletons,nc=e.resolveSingletonInstance,j1=e.acquireSingletonInstance,ic=e.releaseSingletonInstance,lc=e.isHostSingletonType,vn=e.isSingletonScope,vr=[],yn=-1,Sn={},ge=Math.clz32?Math.clz32:N,V1=Math.log,K1=Math.LN2,pl=256,vl=262144,yl=4194304,Sl=de.unstable_scheduleCallback,yr=de.unstable_cancelCallback,Q1=de.unstable_shouldYield,w1=de.unstable_requestPaint,ue=de.unstable_now,sc=de.unstable_ImmediatePriority,Z1=de.unstable_UserBlockingPriority,Sr=de.unstable_NormalPriority,J1=de.unstable_IdlePriority,P1=de.log,F1=de.unstable_setDisableYieldValue,li=null,me=null,pe=typeof Object.is=="function"?Object.is:rt,rc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},W1=Object.prototype.hasOwnProperty,_r,uc,Cr=!1,oc=new WeakMap,_n=[],Cn=0,_l=null,si=0,be=[],Te=0,pa=null,Xe=1,qe="",$t=y(null),ri=y(null),va=y(null),Cl=y(null),te=null,Dt=null,gt=!1,ya=null,xe=!1,Er=Error(r(519)),El=y(null),Ka=null,ke=null,k1=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(i,s){t.push(s)}};this.abort=function(){a.aborted=!0,t.forEach(function(i){return i()})}},I1=de.unstable_scheduleCallback,$1=de.unstable_NormalPriority,Gt={$$typeof:ga,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},bl=null,En=null,br=!1,Tl=!1,Tr=!1,Qa=0,ui=null,xr=0,bn=0,Tn=null,hc=$.S;$.S=function(t,a){mc=ue(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&X0(t,a),hc!==null&&hc(t,a)};var wa=y(null),xn=Error(r(460)),Ar=Error(r(474)),xl=Error(r(542)),Al={then:function(){}},Za=null,An=null,oi=0,Ja=Gu(!0),cc=Gu(!1),Ae=[],Mn=0,Mr=0,Sa=!1,Rr=!1,Rn=y(null),Ml=y(0),ve=y(null),Me=null,Xt=y(0),Ie=0,it=null,Tt=null,qt=null,Rl=!1,Nn=!1,Pa=!1,Nl=0,hi=0,On=null,td=0,ci={readContext:kt,use:Wi,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};ci.useEffectEvent=Ut;var fc={readContext:kt,use:Wi,useCallback:function(t,a){return le().memoizedState=[t,a===void 0?null:a],t},useContext:kt,useEffect:io,useImperativeHandle:function(t,a,i){i=i!=null?i.concat([t]):null,Ii(4194308,4,uo.bind(null,a,t),i)},useLayoutEffect:function(t,a){return Ii(4194308,4,t,a)},useInsertionEffect:function(t,a){Ii(4,2,t,a)},useMemo:function(t,a){var i=le();a=a===void 0?null:a;var s=t();if(Pa){lt(!0);try{t()}finally{lt(!1)}}return i.memoizedState=[s,a],s},useReducer:function(t,a,i){var s=le();if(i!==void 0){var c=i(a);if(Pa){lt(!0);try{i(a)}finally{lt(!1)}}}else c=a;return s.memoizedState=s.baseState=c,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:c},s.queue=t,t=t.dispatch=Z0.bind(null,it,t),[s.memoizedState,t]},useRef:function(t){var a=le();return t={current:t},a.memoizedState=t},useState:function(t){t=bs(t);var a=t.queue,i=yo.bind(null,it,a);return a.dispatch=i,[t.memoizedState,i]},useDebugValue:As,useDeferredValue:function(t,a){var i=le();return Ms(i,t,a)},useTransition:function(){var t=bs(!1);return t=go.bind(null,it,t.queue,!0,!1),le().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,i){var s=it,c=le();if(gt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=a(),xt===null)throw Error(r(349));(ft&127)!==0||Vu(s,a,i)}c.memoizedState=i;var d={value:i,getSnapshot:a};return c.queue=d,io(Qu.bind(null,s,d,t),[t]),s.flags|=2048,hn(9,{destroy:void 0},Ku.bind(null,s,d,i,a),null),i},useId:function(){var t=le(),a=xt.identifierPrefix;if(gt){var i=qe,s=Xe;i=(s&~(1<<32-ge(s)-1)).toString(32)+i,a="_"+a+"R_"+i,i=Nl++,0<i&&(a+="H"+i.toString(32)),a+="_"}else i=td++,a="_"+a+"r_"+i.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Rs,useFormState:$u,useActionState:$u,useOptimistic:function(t){var a=le();a.memoizedState=a.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=Ns.bind(null,it,!0,i),i.dispatch=a,[t,a]},useMemoCache:_s,useCacheRefresh:function(){return le().memoizedState=w0.bind(null,it)},useEffectEvent:function(t){var a=le(),i={impl:t};return a.memoizedState=i,function(){if((ot&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}},Nr={readContext:kt,use:Wi,useCallback:ho,useContext:kt,useEffect:xs,useImperativeHandle:oo,useInsertionEffect:so,useLayoutEffect:ro,useMemo:co,useReducer:ki,useRef:no,useState:function(){return ki(Qe)},useDebugValue:As,useDeferredValue:function(t,a){var i=Yt();return fo(i,Tt.memoizedState,t,a)},useTransition:function(){var t=ki(Qe)[0],a=Yt().memoizedState;return[typeof t=="boolean"?t:Jn(t),a]},useSyncExternalStore:ju,useId:po,useHostTransitionStatus:Rs,useFormState:to,useActionState:to,useOptimistic:function(t,a){var i=Yt();return Ju(i,Tt,t,a)},useMemoCache:_s,useCacheRefresh:vo};Nr.useEffectEvent=lo;var dc={readContext:kt,use:Wi,useCallback:ho,useContext:kt,useEffect:xs,useImperativeHandle:oo,useInsertionEffect:so,useLayoutEffect:ro,useMemo:co,useReducer:Es,useRef:no,useState:function(){return Es(Qe)},useDebugValue:As,useDeferredValue:function(t,a){var i=Yt();return Tt===null?Ms(i,t,a):fo(i,Tt.memoizedState,t,a)},useTransition:function(){var t=Es(Qe)[0],a=Yt().memoizedState;return[typeof t=="boolean"?t:Jn(t),a]},useSyncExternalStore:ju,useId:po,useHostTransitionStatus:Rs,useFormState:ao,useActionState:ao,useOptimistic:function(t,a){var i=Yt();return Tt!==null?Ju(i,Tt,t,a):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:_s,useCacheRefresh:vo};dc.useEffectEvent=lo;var Or={enqueueSetState:function(t,a,i){t=t._reactInternals;var s=fe(),c=ua(s);c.payload=a,i!=null&&(c.callback=i),a=oa(t,c,s),a!==null&&(re(a,t,s),Qn(a,t,s))},enqueueReplaceState:function(t,a,i){t=t._reactInternals;var s=fe(),c=ua(s);c.tag=1,c.payload=a,i!=null&&(c.callback=i),a=oa(t,c,s),a!==null&&(re(a,t,s),Qn(a,t,s))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var i=fe(),s=ua(i);s.tag=2,a!=null&&(s.callback=a),a=oa(t,s,i),a!==null&&(re(a,t,i),Qn(a,t,i))}},zr=Error(r(461)),jt=!1,Dr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},$e=!1,Vt=!1,Gr=!1,gc=typeof WeakSet=="function"?WeakSet:Set,Pt=null,Kt=null,oe=!1,He=null,zn=8192,ed={getCacheForType:function(t){var a=kt(Gt),i=a.data.get(t);return i===void 0&&(i=t(),a.data.set(t,i)),i},cacheSignal:function(){return kt(Gt).controller.signal}},Ol=0,zl=1,Dl=2,Gl=3,Hl=4;if(typeof Symbol=="function"&&Symbol.for){var fi=Symbol.for;Ol=fi("selector.component"),zl=fi("selector.has_pseudo_class"),Dl=fi("selector.role"),Gl=fi("selector.test_id"),Hl=fi("selector.text")}var ad=typeof WeakMap=="function"?WeakMap:Map,ot=0,xt=null,ht=null,ft=0,Et=0,ye=null,_a=!1,Dn=!1,Hr=!1,ta=0,Lt=0,Ca=0,Fa=0,Br=0,Se=0,Gn=0,di=null,he=null,Ur=!1,Bl=0,mc=0,gi=1/0,Ul=null,Ea=null,Zt=0,ba=null,Hn=null,ea=0,Lr=0,Yr=null,pc=null,mi=0,Xr=null;return ut.attemptContinuousHydration=function(t){if(t.tag===13||t.tag===31){var a=Ua(t,67108864);a!==null&&re(a,t,67108864),ir(t,67108864)}},ut.attemptHydrationAtCurrentPriority=function(t){if(t.tag===13||t.tag===31){var a=fe();a=ct(a);var i=Ua(t,a);i!==null&&re(i,t,a),ir(t,a)}},ut.attemptSynchronousHydration=function(t){switch(t.tag){case 3:if(t=t.stateNode,t.current.memoizedState.isDehydrated){var a=A(t.pendingLanes);if(a!==0){for(t.pendingLanes|=2,t.entangledLanes|=2;a;){var i=1<<31-ge(a);t.entanglements[1]|=i,a&=~i}Ue(t),(ot&6)===0&&(gi=ue()+500,on(0))}}break;case 31:case 13:a=Ua(t,2),a!==null&&re(a,t,2),ch(),ir(t,2)}},ut.batchedUpdates=function(t,a){return t(a)},ut.createComponentSelector=function(t){return{$$typeof:Ol,value:t}},ut.createContainer=function(t,a,i,s,c,d,p,b,D,B){return Nh(t,a,!1,null,i,s,d,null,p,b,D,B)},ut.createHasPseudoClassSelector=function(t){return{$$typeof:zl,value:t}},ut.createHydrationContainer=function(t,a,i,s,c,d,p,b,D,B,K,Y,J,nt){return t=Nh(i,s,!0,t,c,d,b,nt,D,B,K,Y),t.context=Oh(null),i=t.current,s=fe(),s=ct(s),c=ua(s),c.callback=a??null,oa(i,c,s),a=s,t.current.lanes=a,L(t,a),Ue(t),t},ut.createPortal=function(t,a,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:gn,key:s==null?null:""+s,children:t,containerInfo:a,implementation:i}},ut.createRoleSelector=function(t){return{$$typeof:Dl,value:t}},ut.createTestNameSelector=function(t){return{$$typeof:Gl,value:t}},ut.createTextSelector=function(t){return{$$typeof:Hl,value:t}},ut.defaultOnCaughtError=function(t){console.error(t)},ut.defaultOnRecoverableError=function(t){rc(t)},ut.defaultOnUncaughtError=function(t){rc(t)},ut.deferredUpdates=function(t){var a=$.T,i=We();try{return Jt(32),$.T=null,t()}finally{Jt(i),$.T=a}},ut.discreteUpdates=function(t,a,i,s,c){var d=$.T,p=We();try{return Jt(2),$.T=null,t(a,i,s,c)}finally{Jt(p),$.T=d,ot===0&&(gi=ue()+500)}},ut.findAllNodes=ks,ut.findBoundingRects=function(t,a){if(!ni)throw Error(r(363));a=ks(t,a),t=[];for(var i=0;i<a.length;i++)t.push(Lf(a[i]));for(a=t.length-1;0<a;a--){i=t[a];for(var s=i.x,c=s+i.width,d=i.y,p=d+i.height,b=a-1;0<=b;b--)if(a!==b){var D=t[b],B=D.x,K=B+D.width,Y=D.y,J=Y+D.height;if(s>=B&&d>=Y&&c<=K&&p<=J){t.splice(a,1);break}else if(s!==B||i.width!==D.width||J<d||Y>p){if(!(d!==Y||i.height!==D.height||K<s||B>c)){B>s&&(D.width+=B-s,D.x=s),K<c&&(D.width=c-B),t.splice(a,1);break}}else{Y>d&&(D.height+=Y-d,D.y=d),J<p&&(D.height=p-Y),t.splice(a,1);break}}}return t},ut.findHostInstance=zh,ut.findHostInstanceWithNoPortals=function(t){return t=f(t),t=t!==null?m(t):null,t===null?null:ai(t.stateNode)},ut.findHostInstanceWithWarning=function(t){return zh(t)},ut.flushPassiveEffects=ei,ut.flushSyncFromReconciler=function(t){var a=ot;ot|=1;var i=$.T,s=We();try{if(Jt(2),$.T=null,t)return t()}finally{Jt(s),$.T=i,ot=a,(ot&6)===0&&on(0)}},ut.flushSyncWork=ch,ut.focusWithin=function(t,a){if(!ni)throw Error(r(363));for(t=Ps(t),a=rh(t,a),a=Array.from(a),t=0;t<a.length;){var i=a[t++],s=i.tag;if(!ii(i)){if((s===5||s===26||s===27)&&qf(i.stateNode))return!0;for(i=i.child;i!==null;)a.push(i),i=i.sibling}}return!1},ut.getFindAllNodesFailureDescription=function(t,a){if(!ni)throw Error(r(363));var i=0,s=[];t=[Ps(t),0];for(var c=0;c<t.length;){var d=t[c++],p=d.tag,b=t[c++],D=a[b];if((p!==5&&p!==26&&p!==27||!ii(d))&&(Fs(d,D)&&(s.push(Ws(D)),b++,b>i&&(i=b)),b<a.length))for(d=d.child;d!==null;)t.push(d,b),d=d.sibling}if(i<a.length){for(t=[];i<a.length;i++)t.push(Ws(a[i]));return`findAllNodes was able to match part of the selector:
|
|
31
|
+
`+(s.join(" > ")+`
|
|
32
|
+
|
|
33
|
+
No matching component was found for:
|
|
34
|
+
`)+t.join(" > ")}return null},ut.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 27:case 5:return ai(t.child.stateNode);default:return t.child.stateNode}},ut.injectIntoDevTools=function(){var t={bundleType:0,version:mf,rendererPackageName:pf,currentDispatcherRef:$,reconcilerVersion:"19.2.0"};if(Lh!==null&&(t.rendererConfig=Lh),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")t=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)t=!0;else{try{li=a.inject(t),me=a}catch{}t=!!a.checkDCE}}return t},ut.isAlreadyRendering=function(){return(ot&6)!==0},ut.observeVisibleRects=function(t,a,i,s){if(!ni)throw Error(r(363));t=ks(t,a);var c=jf(t,i,s).disconnect;return{disconnect:function(){c()}}},ut.shouldError=function(){return null},ut.shouldSuspend=function(){return!1},ut.startHostTransition=function(t,a,i,s){if(t.tag!==5)throw Error(r(476));var c=mo(t).queue;go(t,c,a,pn,i===null?l:function(){var d=mo(t);return d.next===null&&(d=t.alternate.memoizedState),Pn(t,d.next.queue,{},fe()),i(s)})},ut.updateContainer=function(t,a,i,s){var c=a.current,d=fe();return Dh(c,d,t,a,i,s),d},ut.updateContainerSync=function(t,a,i,s){return Dh(a.current,2,t,a,i,s),2},ut},u.exports.default=u.exports,Object.defineProperty(u.exports,"__esModule",{value:!0})})(Wr)),Wr.exports}var Qc;function D3(){return Qc||(Qc=1,Fr.exports=z3()),Fr.exports}var G3=D3();const H3=ld(G3);var kr={exports:{}},aa={};/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-reconciler-constants.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var wc;function B3(){return wc||(wc=1,aa.ConcurrentRoot=1,aa.ContinuousEventPriority=8,aa.DefaultEventPriority=32,aa.DiscreteEventPriority=2,aa.IdleEventPriority=268435456,aa.LegacyRoot=0,aa.NoEventPriority=0),aa}var Zc;function U3(){return Zc||(Zc=1,kr.exports=B3()),kr.exports}var $l=U3();const Jc={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let Pc=!1,Fc=!1;const Gi=".react-konva-event",L3=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
43
|
+
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
44
|
+
Consider to add onDragMove or onDragEnd events.
|
|
45
|
+
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
46
|
+
`,Y3=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
47
|
+
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
48
|
+
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
49
|
+
`,X3={};let O0=()=>{};function q3(u){O0=u}let Ir=!1;function j3(u){return function(...e){const n=u.apply(this,e);if(!Ir){Ir=!0;try{O0()}finally{Ir=!1}}return n}}function ts(u,e,n=X3){if(!Pc&&"zIndex"in e&&(console.warn(Y3),Pc=!0),!Fc&&e.draggable){var l=e.x!==void 0||e.y!==void 0,r=e.onDragEnd||e.onDragMove;l&&!r&&(console.warn(L3),Fc=!0)}for(var o in n)if(!Jc[o]){var h=o.slice(0,2)==="on",f=n[o]!==e[o];if(h&&f){var g=o.substr(2).toLowerCase();g.substr(0,7)==="content"&&(g="content"+g.substr(7,1).toUpperCase()+g.substr(8)),u.off(g+Gi)}var m=!e.hasOwnProperty(o);m&&u.setAttr(o,void 0)}var v=e._useStrictMode,S={},y=!1;const E={};for(var o in e)if(!Jc[o]){var h=o.slice(0,2)==="on",_=n[o]!==e[o];if(h&&_){var g=o.substr(2).toLowerCase();g.substr(0,7)==="content"&&(g="content"+g.substr(7,1).toUpperCase()+g.substr(8)),e[o]&&(E[g]=e[o])}!h&&(e[o]!==n[o]||v&&e[o]!==u.getAttr(o))&&(y=!0,S[o]=e[o])}y&&(u.setAttrs(S),Da(u));for(var g in E)u.off(g+Gi),u.on(g+Gi,j3(E[g]))}function Da(u){if(!V.autoDrawEnabled){var e=u.getLayer()||u.getStage();e&&e.batchDraw()}}const z0={},V3={};Xn.Node.prototype._applyProps=ts;let D0=$l.DefaultEventPriority;function K3(u,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}u.add(e),Da(u)}function Q3(u,e,n){let l=Xn[u];l||(console.error(`Konva has no node with the type ${u}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${u}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),l=Xn.Group);const r={},o={};for(var h in e)if(h!=="ref"){var f=h.slice(0,2)==="on";f?o[h]=e[h]:r[h]=e[h]}const g=new l(r);return ts(g,o),g}function w3(u,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${u}"`)}function Z3(u,e,n){return!1}function J3(u){return u}function P3(){return null}function F3(){return null}function W3(u,e,n,l){return V3}function k3(){}function I3(u){}function $3(u,e){return!1}function t5(){return z0}function e5(){return z0}const a5=setTimeout,n5=clearTimeout,i5=!0,l5=typeof queueMicrotask=="function"?queueMicrotask:u=>Promise.resolve(null).then(u),s5=-1;function r5(u,e){return!1}const u5=!1,o5=!1,h5=!0,c5=!1,f5=!1;function d5(u,e){e.parent===u?e.moveToTop():u.add(e),Da(u)}function g5(u,e){e.parent===u?e.moveToTop():u.add(e),Da(u)}function G0(u,e,n){e._remove(),u.add(e),e.setZIndex(n.getZIndex()),Da(u)}function m5(u,e,n){G0(u,e,n)}function p5(u,e){e.destroy(),e.off(Gi),Da(u)}function v5(u,e){e.destroy(),e.off(Gi),Da(u)}function y5(u,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function S5(u,e,n){}function _5(u,e,n,l){ts(u,l,n)}function C5(u){u.hide(),Da(u)}function E5(u){}function b5(u,e){(e.visible==null||e.visible)&&u.show()}function T5(u,e){}function x5(u){}function A5(){}function M5(){return null}function R5(){}function N5(){}function O5(){return $l.DefaultEventPriority}function z5(){}function D5(){return null}function G5(u){D0=u}function H5(){return D0}function B5(){return $l.DiscreteEventPriority}function U5(){return!1}function L5(){}function Y5(){return null}function X5(){return-1.1}function q5(){}function j5(){return!1}function V5(){return!0}function K5(){}function Q5(){}function w5(){return null}const Z5=null,J5=_t.createContext(null);function P5(){}const F5=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:J5,NotPendingTransition:Z5,afterActiveInstanceBlur:N5,appendChild:d5,appendChildToContainer:g5,appendInitialChild:K3,beforeActiveInstanceBlur:R5,cancelTimeout:n5,clearContainer:x5,commitMount:S5,commitTextUpdate:y5,commitUpdate:_5,createInstance:Q3,createTextInstance:w3,detachDeletedInstance:A5,finalizeInitialChildren:Z3,getChildHostContext:e5,getCurrentEventPriority:O5,getCurrentUpdatePriority:H5,getInstanceFromNode:M5,getInstanceFromScope:D5,getPublicInstance:J3,getRootHostContext:t5,hideInstance:C5,hideTextInstance:E5,idlePriority:qr.unstable_IdlePriority,insertBefore:G0,insertInContainerBefore:m5,isPrimaryRenderer:u5,maySuspendCommit:j5,noTimeout:s5,now:qr.unstable_now,preloadInstance:V5,prepareForCommit:P3,preparePortalMount:F3,prepareScopeUpdate:z5,prepareUpdate:W3,removeChild:p5,removeChildFromContainer:v5,requestPostPaintCallback:q5,resetAfterCommit:k3,resetFormInstance:P5,resetTextContent:I3,resolveEventTimeStamp:X5,resolveEventType:Y5,resolveUpdatePriority:B5,run:qr.unstable_runWithPriority,scheduleMicrotask:l5,scheduleTimeout:a5,setCurrentUpdatePriority:G5,shouldAttemptEagerTransition:U5,shouldDeprioritizeSubtree:$3,shouldSetTextContent:r5,startSuspendingCommit:K5,supportsHydration:f5,supportsMicrotasks:i5,supportsMutation:h5,supportsPersistence:c5,suspendInstance:Q5,trackSchedulerEvent:L5,unhideInstance:b5,unhideTextInstance:T5,waitForCommitToBeReady:w5,warnsIfNotActing:o5},Symbol.toStringTag,{value:"Module"}));function H0(u,e,n){if(!u)return;if(n(u)===!0)return u;let l=u.child;for(;l;){const r=H0(l,e,n);if(r)return r;l=l.sibling}}function B0(u){try{return Object.defineProperties(u,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return u}}const vu=B0(Ne.createContext(null));class U0 extends Ne.Component{render(){return Ne.createElement(vu.Provider,{value:this._reactInternals},this.props.children)}}function W5(){const u=Ne.useContext(vu);if(u===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=Ne.useId();return Ne.useMemo(()=>{for(const n of[u,u?.alternate]){if(!n)continue;const l=H0(n,!1,r=>{let o=r.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(l)return l}},[u,e])}const k5=Symbol.for("react.context"),I5=u=>u!==null&&typeof u=="object"&&"$$typeof"in u&&u.$$typeof===k5;function $5(){const u=W5(),[e]=Ne.useState(()=>new Map);e.clear();let n=u;for(;n;){const l=n.type;I5(l)&&l!==vu&&!e.has(l)&&e.set(l,Ne.use(B0(l))),n=n.return}return e}function L0(){const u=$5();return Ne.useMemo(()=>Array.from(u.keys()).reduce((e,n)=>l=>Ne.createElement(e,null,Ne.createElement(n.Provider,{...l,value:u.get(n)})),e=>Ne.createElement(U0,{...e})),[u])}if(_t.version.indexOf("19")===-1)throw new Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function t4(u){const e=_t.useRef({});return _t.useLayoutEffect(()=>{e.current=u}),_t.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const e4=()=>{const u=_t.useRef(0);return _t.useMemo(()=>{u.current++},[]),u.current>1},a4=u=>{const e=_t.useRef(null),n=_t.useRef(null),l=_t.useRef(null),r=t4(u),o=L0(),h=_t.useRef(null),f=v=>{const{forwardedRef:S}=u;S&&(typeof S=="function"?S(v):S.current=v)},g=e4(),m=()=>{f(null),Ia.flushSyncFromReconciler(()=>{Ia.updateContainer(null,l.current,null)}),n.current?.destroy(),n.current=null};return _t.useLayoutEffect(()=>(h.current&&(clearTimeout(h.current),h.current=null),n.current?f(n.current):(n.current=new Xn.Stage({width:u.width,height:u.height,container:e.current}),f(n.current),l.current=Ia.createContainer(n.current,$l.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),Ia.updateContainer(_t.createElement(o,{},u.children),l.current,null,()=>{})),()=>{g?h.current=setTimeout(m,0):m()}),[]),_t.useLayoutEffect(()=>{f(n.current),ts(n.current,u,r),Ia.updateContainer(_t.createElement(o,{},u.children),l.current,null),Ia.flushSyncWork()}),_t.createElement("div",{ref:e,id:u.id,accessKey:u.accessKey,className:u.className,role:u.role,style:u.style,tabIndex:u.tabIndex,title:u.title})},p4="Layer",n4="Group",v4="Rect",y4="Circle",S4="Line",_4="Text",Ia=H3(F5);q3(()=>Ia.flushSyncWork());const C4=_t.forwardRef((u,e)=>_t.createElement(U0,{},_t.createElement(a4,{...u,forwardedRef:e})));var i4=function(u,e){var n={};for(var l in u)Object.prototype.hasOwnProperty.call(u,l)&&e.indexOf(l)<0&&(n[l]=u[l]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,l=Object.getOwnPropertySymbols(u);r<l.length;r++)e.indexOf(l[r])<0&&Object.prototype.propertyIsEnumerable.call(u,l[r])&&(n[l[r]]=u[l[r]]);return n};const l4=u=>{const e=window.getComputedStyle(u).position;return!(e==="absolute"||e==="relative")};function s4(u=()=>{}){const e=_t.useRef(u);return e.current=u,_t.useCallback((...n)=>e.current.apply(null,n),[])}const E4=({children:u,groupProps:e,divProps:n,transform:l,transformFunc:r,parentNodeFunc:o})=>{const h=L0(),f=_t.useRef(null),[g]=_t.useState(()=>document.createElement("div")),m=_t.useMemo(()=>sd.createRoot(g),[g]),v=l??!0,S=s4(()=>{if(v&&f.current){let A=f.current.getAbsoluteTransform().decompose();r&&(A=r(A)),g.style.position="absolute",g.style.zIndex="10",g.style.top="0px",g.style.left="0px",g.style.transform=`translate(${A.x}px, ${A.y}px) rotate(${A.rotation}deg) scaleX(${A.scaleX}) scaleY(${A.scaleY})`,g.style.transformOrigin="top left"}else g.style.position="",g.style.zIndex="",g.style.top="",g.style.left="",g.style.transform="",g.style.transformOrigin="";const y=n||{},{style:E}=y,_=i4(y,["style"]);Object.assign(g.style,E),Object.assign(g,_)});return _t.useLayoutEffect(()=>{var y;const E=f.current;if(!E)return;const _=o?o({stage:E.getStage()}):(y=E.getStage())===null||y===void 0?void 0:y.container();if(_)return _.appendChild(g),v&&l4(_)&&(_.style.position="relative"),E.on("absoluteTransformChange",S),S(),()=>{var N;E.off("absoluteTransformChange",S),(N=g.parentNode)===null||N===void 0||N.removeChild(g)}},[v,o]),_t.useLayoutEffect(()=>{S()},[n,r]),_t.useLayoutEffect(()=>{queueMicrotask(()=>{rd.flushSync(()=>{m.render(_t.createElement(h,null,u))})})}),_t.useLayoutEffect(()=>()=>{setTimeout(()=>{m.unmount()})},[]),_t.createElement(n4,Object.assign({ref:f},e))};var $r,Wc;function r4(){if(Wc)return $r;Wc=1;var u=kc();return $r=function(n,l,r){const o=u.useRef("loading"),h=u.useRef(),[f,g]=u.useState(0),m=u.useRef(),v=u.useRef(),S=u.useRef();return(m.current!==n||v.current!==l||S.current!==r)&&(o.current="loading",h.current=void 0,m.current=n,v.current=l,S.current=r),u.useLayoutEffect(function(){if(!n)return;var y=document.createElement("img");function E(){y.decode().catch(()=>{}).finally(()=>{o.current="loaded",h.current=y,g(Math.random())})}function _(){o.current="failed",h.current=void 0,g(Math.random())}return y.addEventListener("load",E),y.addEventListener("error",_),l&&(y.crossOrigin=l),r&&(y.referrerPolicy=r),y.src=n,function(){y.removeEventListener("load",E),y.removeEventListener("error",_)}},[n,l,r]),[h.current,o.current]},$r}r4();export{y4 as C,n4 as G,E4 as H,p4 as L,v4 as R,C4 as S,_4 as T,S4 as a};
|