kritzel-stencil 0.3.28 → 0.3.29

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.
@@ -1,4 +1,4 @@
1
- import{p as t,H as e,c as n,h as i,d as r,t as s}from"./p-B43upypT.js";import{K as o}from"./p-D8W6LE-c.js";import{d as a,D as c,l,i as h,a as u,S as f,c as d,m as p,j as g,n as v,f as w,e as m,b as y,K as b,g as k,k as A}from"./p-BmKYyPpl.js";import{D as x,K as S,a as M}from"./p-CpzicliK.js";import{A as z,a as $,d as C}from"./p-CC0J_kEP.js";import{K as T,W as I}from"./p-DhMlShij.js";import{K as j,c as E,a as _,b as L,d as O}from"./p-BNu3Akp5.js";import{K as P}from"./p-WUdQqYnu.js";import{K as B,d as D}from"./p-BxpKq94F.js";import{O as R}from"./p-Dd-pMvlr.js";import*as W from"yjs";import{a as U,C as F}from"./p-CW-VyJgK.js";import{K,d as V}from"./p-CdR76C4L.js";import{K as N}from"./p-jGOpkGDl.js";import{d as G}from"./p-B4WfPDj0.js";import{d as H}from"./p-B4b6TDxp.js";var X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};const Y="__kritzelCustomElementRendererRegistry__";class Q{static get _renderers(){return(()=>{const t=globalThis,e=t[Y];if(e)return e;const n={renderers:new Map};return t[Y]=n,n})().renderers}static register(t,e){this._renderers.set(t,e)}static get(t){return this._renderers.get(t)}static unregister(t){return this._renderers.delete(t)}}class Z extends j{__class__="KritzelCustomElement";element;rendererKey=null;rendererData;constructor(t){super(),t&&(this.translateX=t.translateX||0,this.translateY=t.translateY||0,this.rotation=E.degreesToRadians(t.rotation??0),this.scale=t.scale||1,this.element=t.element??this.createPlaceholder(),this.height=t.height||0,this.width=t.width||0,this.rendererKey=t.rendererKey??null,this.rendererData=t.rendererData)}static create(t,e){const n=new Z(e);return n._core=t,n.id=n.generateId(),n.workspaceId=t.store.state.activeWorkspace.id,n.userId=t.user?.id,n.zIndex=t.store.currentZIndex,n}mount(t){if(null!==t){if(this.applyInteractiveState(),this.isMounted&&this.elementRef===t){if(this.rendererKey)return;if(this.element.parentElement===t)return}if(this.elementRef=t,this.isMounted=!0,this.rendererKey){const e=Q.get(this.rendererKey);if(e)return t.innerHTML="",e.onMount({object:this,container:t,data:this.rendererData}),void this.applyInteractiveState()}this.elementRef.innerHTML="",this.elementRef.appendChild(this.element),this.applyInteractiveState()}}setIsInteractive(t){const e=this.isInteractive!==t;this.isInteractive=t,this.applyInteractiveState(),e&&!t&&this.blurFocusedDescendant()}applyInteractiveState(){const t=this.isInteractive?"auto":"none",e=this.isInteractive?"auto":"";this.element&&(this.element.style.pointerEvents=t,this.element.style.cursor=e),this.elementRef instanceof HTMLElement&&(this.elementRef.style.pointerEvents="auto",this.elementRef.style.cursor="",Array.from(this.elementRef.children).forEach((n=>{n instanceof HTMLElement&&(n.style.pointerEvents=t,n.style.cursor=e)})))}blurFocusedDescendant(){if(!(this.element||this.elementRef instanceof HTMLElement))return;const t=this.getDeepActiveElement(),e=!!this.element&&this.isNodeInsideHost(t,this.element),n=this.elementRef instanceof HTMLElement&&this.isNodeInsideHost(t,this.elementRef);t&&(e||n)&&t.blur()}hasFocusedInputElement(){if(!this.isInteractive)return!1;const t=this.getFocusHosts();if(t.some((t=>this.hasFocusedInputDescendant(t))))return!0;const e=this.getDeepActiveElement();return!!(e&&this.isInputLikeElement(e)&&t.some((t=>this.isNodeInsideHost(e,t))))}getFocusHosts(){const t=[];if(this.element&&t.push(this.element),this.elementRef instanceof HTMLElement){t.push(this.elementRef);const e=this.elementRef.firstElementChild;e instanceof HTMLElement&&t.push(e)}return t}hasFocusedInputDescendant(t){if(this.isInputLikeElement(t)&&this.matchesFocus(t))return!0;if("function"==typeof t.matches)try{if(!t.matches(":focus-within"))return!1}catch{}return null!==this.findFocusedInputLikeElement(t)}findFocusedInputLikeElement(t){let e=null;try{e=t.querySelector(":focus")}catch{e=null}return e instanceof HTMLElement?this.isInputLikeElement(e)?e:e.shadowRoot?this.findFocusedInputLikeElement(e.shadowRoot):null:null}matchesFocus(t){if("function"!=typeof t.matches)return!1;try{return t.matches(":focus")}catch{return!1}}isInputLikeElement(t){const e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||t.isContentEditable}isNodeInsideHost(t,e){if(!t)return!1;let n=t;for(;n;){if(n===e)return!0;if(n.parentNode){n=n.parentNode;continue}const t=n.getRootNode();if(!(t instanceof ShadowRoot))break;n=t.host}return!1}getDeepActiveElement(t=document){const e=t.activeElement;return e instanceof HTMLElement?e.shadowRoot?this.getDeepActiveElement(e.shadowRoot)??e:e:null}unmount(){if(this.isMounted&&this.elementRef){if(this.rendererKey){const t=Q.get(this.rendererKey);if(t){const e=t.onUnmount({object:this,container:this.elementRef,data:this.rendererData});void 0!==e&&(this.rendererData=e)}}this.isMounted=!1,this.elementRef=null}}isElementScrollable(){return!!P.findScrollableElement(this.element)}createPlaceholder(){const t=document.createElement("div");return t.textContent="[Custom Element]",t.style.border="1px dashed #ccc",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.backgroundColor="#f9f9f9",t.style.color="#999",t.style.fontSize="12px",t}resize(t,e,n,i){n<=1||i<=1||(this.width=n,this.height=i,this.translateX=t,this.translateY=e,this.element&&(this.element.style.width=`${n}px`,this.element.style.height=`${i}px`),this._core.store.objects.update(this))}copy(){const t=Object.create(Object.getPrototypeOf(this));return Object.assign(t,this),t.id=this.generateId(),t.isMounted=!1,t.isSelected=!1,t.isHovered=!1,t.isInteractive=!1,t.resizing=!1,t.markedForRemoval=!1,t.isVisible=!0,t.element=this.element.cloneNode(!0),t}serialize(){const{_core:t,_elementRef:e,element:n,totalWidth:i,totalHeight:r,isSelected:s,isHovered:o,isMounted:a,isInteractive:c,resizing:l,markedForRemoval:h,isVisible:u,...f}=this,d=structuredClone(f);return d.rendererKey=this.rendererKey,d.rendererData=this.rendererData,d.htmlString=n?n.outerHTML:"",d.serializedWidth=this.width,d.serializedHeight=this.height,d}deserialize(t){if(super.deserialize(t),delete this.allowEmbeddedInteraction,this.rendererKey=t.rendererKey??null,this.rendererData=t.rendererData,t.htmlString)try{const e=document.createElement("div");e.innerHTML=t.htmlString,this.element=e.firstElementChild||this.createPlaceholder()}catch{this.element=this.createPlaceholder()}else this.element=this.createPlaceholder();return this}}class q extends a{toolType="brush";color=x[0];size=6;opacity=1;palette=[...x];sizes=[...c];static MIN_POINT_DISTANCE_PX=3;_currentPathId=null;shouldAppendPoint(t,e,n,i){const r=t.points;if(!r||0===r.length)return!0;const s=r[r.length-1],o=e-s[0],a=n-s[1],c=q.MIN_POINT_DISTANCE_PX/i;return o*o+a*a>=c*c}constructor(t){super(t)}handlePointerDown(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&l.isLeftClick(t)){this._core.store.state.isDrawing=!0;const e=this._core.store.state.scale,n=this._core.store.state.lockDrawingScale,i=n?e:1,r=_.create(this._core,{points:[[(t.clientX-this._core.store.offsetX)/i,(t.clientY-this._core.store.offsetY)/i]],translateX:-this._core.store.state.translateX/i,translateY:-this._core.store.state.translateY/i,scale:n?1:e,fill:this.color,strokeWidth:this.size,opacity:this.opacity});r.isCompleted=!1,this._currentPathId=r.id,this._core.store.objects.insert(r),this._core.store.objects?.setActiveDrawingObject(r.id)}if("touch"===t.pointerType||"pen"===t.pointerType){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length){const e=this._core.store.state.scale,n=this._core.store.state.lockDrawingScale,i=n?e:1,r=Math.round((t[0].clientX-this._core.store.offsetX)/i),s=Math.round((t[0].clientY-this._core.store.offsetY)/i);this._core.store.state.isDrawing=!0;const o=_.create(this._core,{points:[[r,s]],translateX:-this._core.store.state.translateX/i,translateY:-this._core.store.state.translateY/i,scale:n?1:e,fill:this.color,strokeWidth:this.size,opacity:this.opacity});o.isCompleted=!1,this._currentPathId=o.id,this._core.store.objects.insert(o),this._core.store.objects?.setActiveDrawingObject(o.id)}}}handlePointerMove(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&this._core.store.state.isDrawing&&this._currentPathId){const e=this._core.store.objects.findById(this._currentPathId);if(e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1,s=(t.clientX-this._core.store.offsetX)/r,o=(t.clientY-this._core.store.offsetY)/r;if(!this.shouldAppendPoint(e,s,o,r))return;const a=_.create(this._core,{points:[...e.points,[s,o]],translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,scale:i?1:n,fill:this.color,strokeWidth:this.size,opacity:this.opacity});a.id=e.id,a.workspaceId=e.workspaceId,a.zIndex=e.zIndex,a.isCompleted=!1,this._core.store.objects.update(a)}}if("touch"===t.pointerType||"pen"===t.pointerType){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length&&this._currentPathId){const e=this._core.store.objects.findById(this._currentPathId);if(e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1,s=Math.round((t[0].clientX-this._core.store.offsetX)/r),o=Math.round((t[0].clientY-this._core.store.offsetY)/r);if(!this.shouldAppendPoint(e,s,o,r))return;const a=_.create(this._core,{points:[...e.points,[s,o]],translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,scale:i?1:n,fill:this.color,strokeWidth:this.size,opacity:this.opacity});a.id=e.id,a.workspaceId=e.workspaceId,a.zIndex=e.zIndex,a.isCompleted=!1,this._core.store.objects.update(a)}}}}handlePointerUp(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&this._core.store.state.isDrawing&&(this._core.store.state.isDrawing=!1,this._currentPathId)){const t=this._core.store.objects.findById(this._currentPathId);t&&(t.isCompleted=!0,this._core.store.objects.update(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([t])),this._core.store.objects?.setActiveDrawingObject(null),this._currentPathId=null,this._core.store.objects?.stopUndoCapturing()}if(("touch"===t.pointerType||"pen"===t.pointerType)&&this._core.store.state.isDrawing&&(this._core.store.state.isDrawing=!1,this._currentPathId)){const t=this._core.store.objects.findById(this._currentPathId);t&&(t.isCompleted=!0,this._core.store.objects.update(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([t])),this._core.store.objects?.setActiveDrawingObject(null),this._currentPathId=null,this._core.store.objects?.stopUndoCapturing()}}}class J extends a{toolType="line";color=x[0];size=4;opacity=1;palette=[...x];sizes=[...c];arrows;_startX=0;_startY=0;_currentLineId=null;constructor(t){super(t)}handlePointerDown(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&l.isLeftClick(t)){this._core.store.state.isDrawing=!0;const e=this._core.store.state.scale,n=this._core.store.state.lockDrawingScale,i=n?e:1,r=(t.clientX-this._core.store.offsetX)/i,s=(t.clientY-this._core.store.offsetY)/i;this._startX=r,this._startY=s;const o=L.create(this._core,{startX:r,startY:s,endX:r,endY:s,translateX:-this._core.store.state.translateX/i,translateY:-this._core.store.state.translateY/i,scale:n?1:e,stroke:this.color,strokeWidth:this.size,opacity:this.opacity,arrows:this.arrows});o.isCompleted=!1,this._currentLineId=o.id,this._core.store.objects.insert(o),this._core.store.objects?.setActiveDrawingObject(o.id)}if("touch"===t.pointerType||"pen"===t.pointerType){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length){const e=this._core.store.state.scale,n=this._core.store.state.lockDrawingScale,i=n?e:1,r=Math.round((t[0].clientX-this._core.store.offsetX)/i),s=Math.round((t[0].clientY-this._core.store.offsetY)/i);this._core.store.state.isDrawing=!0,this._startX=r,this._startY=s;const o=L.create(this._core,{startX:r,startY:s,endX:r,endY:s,translateX:-this._core.store.state.translateX/i,translateY:-this._core.store.state.translateY/i,scale:n?1:e,stroke:this.color,strokeWidth:this.size,opacity:this.opacity,arrows:this.arrows});o.isCompleted=!1,this._currentLineId=o.id,this._core.store.objects.insert(o),this._core.store.objects?.setActiveDrawingObject(o.id)}}}handlePointerMove(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&this._core.store.state.isDrawing&&this._currentLineId){const e=this._core.store.objects.findById(this._currentLineId);if(e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1,s=L.create(this._core,{startX:this._startX,startY:this._startY,endX:(t.clientX-this._core.store.offsetX)/r,endY:(t.clientY-this._core.store.offsetY)/r,translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,scale:i?1:n,stroke:this.color,strokeWidth:this.size,opacity:this.opacity,arrows:this.arrows});s.id=e.id,s.workspaceId=e.workspaceId,s.zIndex=e.zIndex,s.isCompleted=!1,this._core.store.objects.update(s)}}if("touch"===t.pointerType||"pen"===t.pointerType){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length&&this._currentLineId){const e=this._core.store.objects.findById(this._currentLineId);if(e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1,s=Math.round((t[0].clientX-this._core.store.offsetX)/r),o=Math.round((t[0].clientY-this._core.store.offsetY)/r),a=L.create(this._core,{startX:this._startX,startY:this._startY,endX:s,endY:o,translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,scale:i?1:n,stroke:this.color,strokeWidth:this.size,opacity:this.opacity,arrows:this.arrows});a.id=e.id,a.workspaceId=e.workspaceId,a.zIndex=e.zIndex,a.isCompleted=!1,this._core.store.objects.update(a)}}}}handlePointerUp(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&this._core.store.state.isDrawing&&(this._core.store.state.isDrawing=!1,this._currentLineId)){const t=this._core.store.objects.findById(this._currentLineId);t&&(t.isCompleted=!0,this._core.store.objects.update(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([t]),this.selectLineAndSwitchTool(t)),this._core.store.objects?.setActiveDrawingObject(null),this._currentLineId=null,this._core.store.objects?.stopUndoCapturing()}if(("touch"===t.pointerType||"pen"===t.pointerType)&&this._core.store.state.isDrawing&&(this._core.store.state.isDrawing=!1,this._currentLineId)){const t=this._core.store.objects.findById(this._currentLineId);t&&(t.isCompleted=!0,this._core.store.objects.update(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([t]),this.selectLineAndSwitchTool(t)),this._core.store.objects?.setActiveDrawingObject(null),this._currentLineId=null,this._core.store.objects?.stopUndoCapturing()}}selectLineAndSwitchTool(t){const e=h.create(this._core);e.addOrRemove(t),e.isSelected=!0,e.rotation=t.rotation,this._core.addSelectionGroup(e),this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection")),this._core.rerender()}}class tt extends a{toolType="eraser";touchStartTimeout=null;constructor(t){super(t)}handlePointerDown(t){"mouse"===t.pointerType&&l.isLeftClick(t)&&(this._core.store.state.isErasing=!0),"touch"!==t.pointerType&&"pen"!==t.pointerType||(this.touchStartTimeout=setTimeout((()=>{1!==this._core.store.state.pointers.size||this._core.store.state.isScaling||(this._core.store.state.isErasing=!0)}),80))}handlePointerMove(t){if("mouse"===t.pointerType&&this._core.store.state.isErasing){const e=this._core.getObjectsFromPointerEvent(t,".object");if(0===e.length)return;const n=this._core.store.state.pointerX,i=this._core.store.state.pointerY;e.forEach((t=>{t.markedForRemoval=t.hitTest(n,i)})),this._core.rerender()}if(("touch"===t.pointerType||"pen"===t.pointerType)&&1===this._core.store.state.pointers.size&&this._core.store.state.isErasing){const e=this._core.store.state.host?.shadowRoot;if(!e)return;const n=this._core.getObjectsFromPointerEvent(t,".object");if(0===n.length)return;const i=this._core.store.state.pointerX,r=this._core.store.state.pointerY;n.forEach((t=>{t.markedForRemoval=t.hitTest(i,r)})),this._core.rerender()}}handlePointerUp(t){if("mouse"===t.pointerType&&this._core.store.state.isErasing){const t=this._core.store.allObjects.filter((t=>t.markedForRemoval));t.length>0&&(this._core.store.objects.stopUndoCapturing(),this._core.store.objects.transaction((()=>{t.forEach((t=>{t.markedForRemoval=!1,this._core.removeObject(t)}))})),this._core.rerender()),this._core.store.state.isErasing=!1,this._core.engine.emitObjectsChange(),t.length>0&&(this._core.engine.emitObjectsRemoved(t),this._core.store.objects.stopUndoCapturing())}if(("touch"===t.pointerType||"pen"===t.pointerType)&&(clearTimeout(this.touchStartTimeout),this._core.store.state.isErasing)){const t=this._core.store.allObjects.filter((t=>t.markedForRemoval));t.length>0&&(this._core.store.objects.stopUndoCapturing(),this._core.store.objects.transaction((()=>{t.forEach((t=>{t.markedForRemoval=!1,this._core.removeObject(t)}))})),this._core.rerender()),this._core.store.state.isErasing=!1,this._core.engine.emitObjectsChange(),t.length>0&&(this._core.engine.emitObjectsRemoved(t),this._core.store.objects.stopUndoCapturing())}}}function et(t,e){return new Promise((function(n,i){let r;return nt(t).then((function(t){try{return r=t,n(new Blob([e.slice(0,2),r,e.slice(2)],{type:"image/jpeg"}))}catch(t){return i(t)}}),i)}))}const nt=t=>new Promise(((e,n)=>{const i=new FileReader;i.addEventListener("load",(({target:{result:t}})=>{const i=new DataView(t);let r=0;if(65496!==i.getUint16(r))return n("not a valid JPEG");for(r+=2;;){const s=i.getUint16(r);if(65498===s)break;const o=i.getUint16(r+2);if(65505===s&&1165519206===i.getUint32(r+4)){const s=r+10;let a;switch(i.getUint16(s)){case 18761:a=!0;break;case 19789:a=!1;break;default:return n("TIFF header contains invalid endian")}if(42!==i.getUint16(s+2,a))return n("TIFF header contains invalid version");const c=i.getUint32(s+4,a),l=s+c+2+12*i.getUint16(s+c,a);for(let t=s+c+2;t<l;t+=12)if(274==i.getUint16(t,a)){if(3!==i.getUint16(t+2,a))return n("Orientation data type is invalid");if(1!==i.getUint32(t+4,a))return n("Orientation data count is invalid");i.setUint16(t+8,1,a);break}return e(t.slice(r,r+2+o))}r+=2+o}return e(new Blob)})),i.readAsArrayBuffer(t)}));var it={},rt={get exports(){return it},set exports(t){it=t}};!function(){var t,e,n={};rt.exports=n,n.parse=function(t,e){for(var i=n.bin.readUshort,r=n.bin.readUint,s=0,o={},a=new Uint8Array(t),c=a.length-4;101010256!=r(a,c);)c--;s=c,s+=4;var l=i(a,s+=4);i(a,s+=2);var h=r(a,s+=2),u=r(a,s+=4);s+=4,s=u;for(var f=0;f<l;f++){r(a,s),s+=4,s+=4,s+=4,r(a,s+=4),h=r(a,s+=4);var d=r(a,s+=4),p=i(a,s+=4),g=i(a,s+2),v=i(a,s+4);s+=6;var w=r(a,s+=8);s+=4,s+=p+g+v,n._readLocal(a,w,o,h,d,e)}return o},n._readLocal=function(t,e,i,r,s,o){var a=n.bin.readUshort,c=n.bin.readUint;c(t,e),a(t,e+=4),a(t,e+=2);var l=a(t,e+=2);c(t,e+=2),c(t,e+=4),e+=4;var h=a(t,e+=8),u=a(t,e+=2),f=n.bin.readUTF8(t,e+=2,h);if(e+=h,e+=u,o)i[f]={size:s,csize:r};else{var d=new Uint8Array(t.buffer,e);if(0==l)i[f]=new Uint8Array(d.buffer.slice(e,e+r));else{if(8!=l)throw"unknown compression method: "+l;var p=new Uint8Array(s);n.inflateRaw(d,p),i[f]=p}}},n.inflateRaw=function(t,e){return n.F.inflate(t,e)},n.inflate=function(t,e){return n.inflateRaw(new Uint8Array(t.buffer,t.byteOffset+2,t.length-6),e)},n.deflate=function(t,e){null==e&&(e={level:6});var i=0,r=new Uint8Array(50+Math.floor(1.1*t.length));r[i]=120,r[i+1]=156,i=n.F.deflateRaw(t,r,i+=2,e.level);var s=n.adler(t,0,t.length);return r[i+0]=s>>>24&255,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s>>>0&255,new Uint8Array(r.buffer,0,i+4)},n.deflateRaw=function(t,e){null==e&&(e={level:6});var i=new Uint8Array(50+Math.floor(1.1*t.length)),r=n.F.deflateRaw(t,i,r,e.level);return new Uint8Array(i.buffer,0,r)},n.encode=function(t,e){null==e&&(e=!1);var i=0,r=n.bin.writeUint,s=n.bin.writeUshort,o={};for(var a in t){var c=!n._noNeed(a)&&!e,l=t[a],h=n.crc.crc(l,0,l.length);o[a]={cpr:c,usize:l.length,crc:h,file:c?n.deflateRaw(l):l}}for(var a in o)i+=o[a].file.length+30+46+2*n.bin.sizeUTF8(a);i+=22;var u=new Uint8Array(i),f=0,d=[];for(var a in o){var p=o[a];d.push(f),f=n._writeHeader(u,f,a,p,0)}var g=0,v=f;for(var a in o)p=o[a],d.push(f),f=n._writeHeader(u,f,a,p,1,d[g++]);var w=f-v;return r(u,f,101010256),f+=4,s(u,f+=4,g),s(u,f+=2,g),r(u,f+=2,w),r(u,f+=4,v),f+=4,f+=2,u.buffer},n._noNeed=function(t){var e=t.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(e)},n._writeHeader=function(t,e,i,r,s,o){var a=n.bin.writeUint,c=n.bin.writeUshort,l=r.file;return a(t,e,0==s?67324752:33639248),e+=4,1==s&&(e+=2),c(t,e,20),c(t,e+=2,0),c(t,e+=2,r.cpr?8:0),a(t,e+=2,0),a(t,e+=4,r.crc),a(t,e+=4,l.length),a(t,e+=4,r.usize),c(t,e+=4,n.bin.sizeUTF8(i)),c(t,e+=2,0),e+=2,1==s&&(e+=2,e+=2,a(t,e+=6,o),e+=4),e+=n.bin.writeUTF8(t,e,i),0==s&&(t.set(l,e),e+=l.length),e},n.crc={table:function(){for(var t=new Uint32Array(256),e=0;e<256;e++){for(var n=e,i=0;i<8;i++)1&n?n=3988292384^n>>>1:n>>>=1;t[e]=n}return t}(),update:function(t,e,i,r){for(var s=0;s<r;s++)t=n.crc.table[255&(t^e[i+s])]^t>>>8;return t},crc:function(t,e,i){return 4294967295^n.crc.update(4294967295,t,e,i)}},n.adler=function(t,e,n){for(var i=1,r=0,s=e,o=e+n;s<o;){for(var a=Math.min(s+5552,o);s<a;)r+=i+=t[s++];i%=65521,r%=65521}return r<<16|i},n.bin={readUshort:function(t,e){return t[e]|t[e+1]<<8},writeUshort:function(t,e,n){t[e]=255&n,t[e+1]=n>>8&255},readUint:function(t,e){return 16777216*t[e+3]+(t[e+2]<<16|t[e+1]<<8|t[e])},writeUint:function(t,e,n){t[e]=255&n,t[e+1]=n>>8&255,t[e+2]=n>>16&255,t[e+3]=n>>24&255},readASCII:function(t,e,n){for(var i="",r=0;r<n;r++)i+=String.fromCharCode(t[e+r]);return i},writeASCII:function(t,e,n){for(var i=0;i<n.length;i++)t[e+i]=n.charCodeAt(i)},pad:function(t){return t.length<2?"0"+t:t},readUTF8:function(t,e,i){for(var r,s="",o=0;o<i;o++)s+="%"+n.bin.pad(t[e+o].toString(16));try{r=decodeURIComponent(s)}catch(r){return n.bin.readASCII(t,e,i)}return r},writeUTF8:function(t,e,n){for(var i=n.length,r=0,s=0;s<i;s++){var o=n.charCodeAt(s);if(4294967168&o)if(4294965248&o)if(4294901760&o){if(4292870144&o)throw"e";t[e+r]=240|o>>18,t[e+r+1]=128|o>>12&63,t[e+r+2]=128|o>>6&63,t[e+r+3]=128|63&o,r+=4}else t[e+r]=224|o>>12,t[e+r+1]=128|o>>6&63,t[e+r+2]=128|63&o,r+=3;else t[e+r]=192|o>>6,t[e+r+1]=128|63&o,r+=2;else t[e+r]=o,r++}return r},sizeUTF8:function(t){for(var e=t.length,n=0,i=0;i<e;i++){var r=t.charCodeAt(i);if(4294967168&r)if(4294965248&r)if(4294901760&r){if(4292870144&r)throw"e";n+=4}else n+=3;else n+=2;else n++}return n}},n.F={},n.F.deflateRaw=function(t,e,i,r){var s=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][r],o=n.F.U,a=n.F._goodIndex,c=n.F._putsE,l=0,h=i<<3,u=0,f=t.length;if(0==r){for(;l<f;)c(e,h,l+(S=Math.min(65535,f-l))==f?1:0),h=n.F._copyExact(t,l,S,e,h+8),l+=S;return h>>>3}var d=o.lits,p=o.strt,g=o.prev,v=0,w=0,m=0,y=0,b=0,k=0;for(f>2&&(p[k=n.F._hash(t,0)]=0),l=0;l<f;l++){if(b=k,l+1<f-2){k=n.F._hash(t,l+1);var A=l+1&32767;g[A]=p[k],p[k]=A}if(u<=l){(v>14e3||w>26697)&&f-l>100&&(u<l&&(d[v]=l-u,v+=2,u=l),h=n.F._writeBlock(l==f-1||u==f?1:0,d,v,y,t,m,l-m,e,h),v=w=y=0,m=l);var x=0;l<f-2&&(x=n.F._bestMatch(t,l,g,b,Math.min(s[2],f-l),s[3]));var S=x>>>16,M=65535&x;if(0!=x){M=65535&x;var z=a(S=x>>>16,o.of0);o.lhst[257+z]++;var $=a(M,o.df0);o.dhst[$]++,y+=o.exb[z]+o.dxb[$],d[v]=S<<23|l-u,d[v+1]=M<<16|z<<8|$,v+=2,u=l+S}else o.lhst[t[l]]++;w++}}for(m==l&&0!=t.length||(u<l&&(d[v]=l-u,v+=2,u=l),h=n.F._writeBlock(1,d,v,y,t,m,l-m,e,h),v=0,w=0,v=w=y=0,m=l);7&h;)h++;return h>>>3},n.F._bestMatch=function(t,e,i,r,s,o){var a=32767&e,c=i[a],l=a-c+32768&32767;if(c==a||r!=n.F._hash(t,e-l))return 0;for(var h=0,u=0,f=Math.min(32767,e);l<=f&&0!=--o&&c!=a;){if(0==h||t[e+h]==t[e+h-l]){var d=n.F._howLong(t,e,l);if(d>h){if(u=l,(h=d)>=s)break;l+2<d&&(d=l+2);for(var p=0,g=0;g<d-2;g++){var v=e-l+g+32768&32767,w=v-i[v]+32768&32767;w>p&&(p=w,c=v)}}}l+=(a=c)-(c=i[a])+32768&32767}return h<<16|u},n.F._howLong=function(t,e,n){if(t[e]!=t[e-n]||t[e+1]!=t[e+1-n]||t[e+2]!=t[e+2-n])return 0;var i=e,r=Math.min(t.length,e+258);for(e+=3;e<r&&t[e]==t[e-n];)e++;return e-i},n.F._hash=function(t,e){return(t[e]<<8|t[e+1])+(t[e+2]<<4)&65535},n.saved=0,n.F._writeBlock=function(t,e,i,r,s,o,a,c,l){var h,u,f,d,p,g,v,w,m,y=n.F.U,b=n.F._putsF,k=n.F._putsE;y.lhst[256]++,u=(h=n.F.getTrees())[0],f=h[1],d=h[2],p=h[3],g=h[4],v=h[5],w=h[6],m=h[7];var A=32+(l+3&7?8-(l+3&7):0)+(a<<3),x=r+n.F.contSize(y.fltree,y.lhst)+n.F.contSize(y.fdtree,y.dhst),S=r+n.F.contSize(y.ltree,y.lhst)+n.F.contSize(y.dtree,y.dhst);S+=14+3*v+n.F.contSize(y.itree,y.ihst)+(2*y.ihst[16]+3*y.ihst[17]+7*y.ihst[18]);for(var M=0;M<286;M++)y.lhst[M]=0;for(M=0;M<30;M++)y.dhst[M]=0;for(M=0;M<19;M++)y.ihst[M]=0;var z=A<x&&A<S?0:x<S?1:2;if(b(c,l,t),b(c,l+1,z),l+=3,0==z){for(;7&l;)l++;l=n.F._copyExact(s,o,a,c,l)}else{var $,C;if(1==z&&($=y.fltree,C=y.fdtree),2==z){n.F.makeCodes(y.ltree,u),n.F.revCodes(y.ltree,u),n.F.makeCodes(y.dtree,f),n.F.revCodes(y.dtree,f),n.F.makeCodes(y.itree,d),n.F.revCodes(y.itree,d),$=y.ltree,C=y.dtree,k(c,l,p-257),k(c,l+=5,g-1),k(c,l+=5,v-4),l+=4;for(var T=0;T<v;T++)k(c,l+3*T,y.itree[1+(y.ordr[T]<<1)]);l=n.F._codeTiny(w,y.itree,c,l+=3*v),l=n.F._codeTiny(m,y.itree,c,l)}for(var I=o,j=0;j<i;j+=2){for(var E=e[j],_=E>>>23,L=I+(8388607&E);I<L;)l=n.F._writeLit(s[I++],$,c,l);if(0!=_){var O=e[j+1],P=O>>16,B=O>>8&255,D=255&O;k(c,l=n.F._writeLit(257+B,$,c,l),_-y.of0[B]),b(c,l=n.F._writeLit(D,C,c,l+=y.exb[B]),P-y.df0[D]),l+=y.dxb[D],I+=_}}l=n.F._writeLit(256,$,c,l)}return l},n.F._copyExact=function(t,e,n,i,r){var s=r>>>3;return i[s]=n,i[s+1]=n>>>8,i[s+2]=255-i[s],i[s+3]=255-i[s+1],s+=4,i.set(new Uint8Array(t.buffer,e,n),s),r+(n+4<<3)},n.F.getTrees=function(){for(var t=n.F.U,e=n.F._hufTree(t.lhst,t.ltree,15),i=n.F._hufTree(t.dhst,t.dtree,15),r=[],s=n.F._lenCodes(t.ltree,r),o=[],a=n.F._lenCodes(t.dtree,o),c=0;c<r.length;c+=2)t.ihst[r[c]]++;for(c=0;c<o.length;c+=2)t.ihst[o[c]]++;for(var l=n.F._hufTree(t.ihst,t.itree,7),h=19;h>4&&0==t.itree[1+(t.ordr[h-1]<<1)];)h--;return[e,i,l,s,a,h,r,o]},n.F.getSecond=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(t[n+1]);return e},n.F.nonZero=function(t){for(var e="",n=0;n<t.length;n+=2)0!=t[n+1]&&(e+=(n>>1)+",");return e},n.F.contSize=function(t,e){for(var n=0,i=0;i<e.length;i++)n+=e[i]*t[1+(i<<1)];return n},n.F._codeTiny=function(t,e,i,r){for(var s=0;s<t.length;s+=2){var o=t[s],a=t[s+1];r=n.F._writeLit(o,e,i,r);var c=16==o?2:17==o?3:7;o>15&&(n.F._putsE(i,r,a,c),r+=c)}return r},n.F._lenCodes=function(t,e){for(var n=t.length;2!=n&&0==t[n-1];)n-=2;for(var i=0;i<n;i+=2){var r=t[i+1],s=i+3<n?t[i+3]:-1,o=i+5<n?t[i+5]:-1,a=0==i?-1:t[i-1];if(0==r&&s==r&&o==r){for(var c=i+5;c+2<n&&t[c+2]==r;)c+=2;(l=Math.min(c+1-i>>>1,138))<11?e.push(17,l-3):e.push(18,l-11),i+=2*l-2}else if(r==a&&s==r&&o==r){for(c=i+5;c+2<n&&t[c+2]==r;)c+=2;var l=Math.min(c+1-i>>>1,6);e.push(16,l-3),i+=2*l-2}else e.push(r,0)}return n>>>1},n.F._hufTree=function(t,e,i){var r=[],s=t.length,o=e.length,a=0;for(a=0;a<o;a+=2)e[a]=0,e[a+1]=0;for(a=0;a<s;a++)0!=t[a]&&r.push({lit:a,f:t[a]});var c=r.length,l=r.slice(0);if(0==c)return 0;if(1==c){var h=r[0].lit;return l=0==h?1:0,e[1+(h<<1)]=1,e[1+(l<<1)]=1,1}r.sort((function(t,e){return t.f-e.f}));var u=r[0],f=r[1],d=0,p=1,g=2;for(r[0]={lit:-1,f:u.f+f.f,l:u,r:f,d:0};p!=c-1;)u=d!=p&&(g==c||r[d].f<r[g].f)?r[d++]:r[g++],f=d!=p&&(g==c||r[d].f<r[g].f)?r[d++]:r[g++],r[p++]={lit:-1,f:u.f+f.f,l:u,r:f};var v=n.F.setDepth(r[p-1],0);for(v>i&&(n.F.restrictDepth(l,i,v),v=i),a=0;a<c;a++)e[1+(l[a].lit<<1)]=l[a].d;return v},n.F.setDepth=function(t,e){return-1!=t.lit?(t.d=e,e):Math.max(n.F.setDepth(t.l,e+1),n.F.setDepth(t.r,e+1))},n.F.restrictDepth=function(t,e,n){var i=0,r=1<<n-e,s=0;for(t.sort((function(t,e){return e.d==t.d?t.f-e.f:e.d-t.d})),i=0;i<t.length&&t[i].d>e;i++){var o=t[i].d;t[i].d=e,s+=r-(1<<n-o)}for(s>>>=n-e;s>0;)(o=t[i].d)<e?(t[i].d++,s-=1<<e-o-1):i++;for(;i>=0;i--)t[i].d==e&&s<0&&(t[i].d--,s++);0!=s&&console.log("debt left")},n.F._goodIndex=function(t,e){var n=0;return e[16|n]<=t&&(n|=16),e[8|n]<=t&&(n|=8),e[4|n]<=t&&(n|=4),e[2|n]<=t&&(n|=2),e[1|n]<=t&&(n|=1),n},n.F._writeLit=function(t,e,i,r){return n.F._putsF(i,r,e[t<<1]),r+e[1+(t<<1)]},n.F.inflate=function(t,e){var i=Uint8Array;if(3==t[0]&&0==t[1])return e||new i(0);var r=n.F,s=r._bitsF,o=r._bitsE,a=r._decodeTiny,c=r.makeCodes,l=r.codes2map,h=r._get17,u=r.U,f=null==e;f&&(e=new i(t.length>>>2<<3));for(var d,p,g=0,v=0,w=0,m=0,y=0,b=0,k=0,A=0,x=0;0==g;)if(g=s(t,x,1),v=s(t,x+1,2),x+=3,0!=v){if(f&&(e=n.F._check(e,A+(1<<17))),1==v&&(d=u.flmap,p=u.fdmap,b=511,k=31),2==v){w=o(t,x,5)+257,m=o(t,x+5,5)+1,y=o(t,x+10,4)+4,x+=14;for(var S=0;S<38;S+=2)u.itree[S]=0,u.itree[S+1]=0;var M=1;for(S=0;S<y;S++){var z=o(t,x+3*S,3);u.itree[1+(u.ordr[S]<<1)]=z,z>M&&(M=z)}x+=3*y,c(u.itree,M),l(u.itree,M,u.imap),d=u.lmap,p=u.dmap,x=a(u.imap,(1<<M)-1,w+m,t,x,u.ttree);var $=r._copyOut(u.ttree,0,w,u.ltree);b=(1<<$)-1;var C=r._copyOut(u.ttree,w,m,u.dtree);k=(1<<C)-1,c(u.ltree,$),l(u.ltree,$,d),c(u.dtree,C),l(u.dtree,C,p)}for(;;){var T=d[h(t,x)&b];x+=15&T;var I=T>>>4;if(I>>>8==0)e[A++]=I;else{if(256==I)break;var j=A+I-254;if(I>264){var E=u.ldef[I-257];j=A+(E>>>3)+o(t,x,7&E),x+=7&E}var _=p[h(t,x)&k],L=u.ddef[_>>>4],O=(L>>>4)+s(t,x+=15&_,15&L);for(x+=15&L,f&&(e=n.F._check(e,A+(1<<17)));A<j;)e[A]=e[A++-O],e[A]=e[A++-O],e[A]=e[A++-O],e[A]=e[A++-O];A=j}}}else{7&x&&(x+=8-(7&x));var P=4+(x>>>3),B=t[P-4]|t[P-3]<<8;f&&(e=n.F._check(e,A+B)),e.set(new i(t.buffer,t.byteOffset+P,B),A),x=P+B<<3,A+=B}return e.length==A?e:e.slice(0,A)},n.F._check=function(t,e){var n=t.length;if(e<=n)return t;var i=new Uint8Array(Math.max(n<<1,e));return i.set(t,0),i},n.F._decodeTiny=function(t,e,i,r,s,o){for(var a=n.F._bitsE,c=n.F._get17,l=0;l<i;){var h=t[c(r,s)&e];s+=15&h;var u=h>>>4;if(u<=15)o[l]=u,l++;else{var f=0,d=0;16==u?(d=3+a(r,s,2),s+=2,f=o[l-1]):17==u?(d=3+a(r,s,3),s+=3):18==u&&(d=11+a(r,s,7),s+=7);for(var p=l+d;l<p;)o[l]=f,l++}}return s},n.F._copyOut=function(t,e,n,i){for(var r=0,s=0,o=i.length>>>1;s<n;){var a=t[s+e];i[s<<1]=0,i[1+(s<<1)]=a,a>r&&(r=a),s++}for(;s<o;)i[s<<1]=0,i[1+(s<<1)]=0,s++;return r},n.F.makeCodes=function(t,e){for(var i,r,s,o,a=n.F.U,c=t.length,l=a.bl_count,h=0;h<=e;h++)l[h]=0;for(h=1;h<c;h+=2)l[t[h]]++;var u=a.next_code;for(i=0,l[0]=0,r=1;r<=e;r++)u[r]=i=i+l[r-1]<<1;for(s=0;s<c;s+=2)0!=(o=t[s+1])&&(t[s]=u[o],u[o]++)},n.F.codes2map=function(t,e,i){for(var r=t.length,s=n.F.U.rev15,o=0;o<r;o+=2)if(0!=t[o+1])for(var a=t[o+1],c=o>>1<<4|a,l=e-a,h=t[o]<<l,u=h+(1<<l);h!=u;)i[s[h]>>>15-e]=c,h++},n.F.revCodes=function(t,e){for(var i=n.F.U.rev15,r=15-e,s=0;s<t.length;s+=2)t[s]=i[t[s]<<e-t[s+1]]>>>r},n.F._putsE=function(t,e,n){var i=e>>>3;t[i]|=n<<=7&e,t[i+1]|=n>>>8},n.F._putsF=function(t,e,n){var i=e>>>3;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},n.F._bitsE=function(t,e,n){return(t[e>>>3]|t[1+(e>>>3)]<<8)>>>(7&e)&(1<<n)-1},n.F._bitsF=function(t,e,n){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16)>>>(7&e)&(1<<n)-1},n.F._get17=function(t,e){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16)>>>(7&e)},n.F._get25=function(t,e){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16|t[3+(e>>>3)]<<24)>>>(7&e)},n.F.U=(t=Uint16Array,e=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new t(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new e(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new e(286),dhst:new e(30),ihst:new e(19),lits:new e(15e3),strt:new t(65536),prev:new t(32768)}),function(){for(var t=n.F.U,e=0;e<32768;e++){var i=e;i=(4278255360&(i=(4042322160&(i=(3435973836&(i=(2863311530&i)>>>1|(1431655765&i)<<1))>>>2|(858993459&i)<<2))>>>4|(252645135&i)<<4))>>>8|(16711935&i)<<8,t.rev15[e]=(i>>>16|i<<16)>>>17}function r(t,e,n){for(;0!=e--;)t.push(0,n)}for(e=0;e<32;e++)t.ldef[e]=t.of0[e]<<3|t.exb[e],t.ddef[e]=t.df0[e]<<4|t.dxb[e];r(t.fltree,144,8),r(t.fltree,112,9),r(t.fltree,24,7),r(t.fltree,8,8),n.F.makeCodes(t.fltree,9),n.F.codes2map(t.fltree,9,t.flmap),n.F.revCodes(t.fltree,9),r(t.fdtree,32,5),n.F.makeCodes(t.fdtree,5),n.F.codes2map(t.fdtree,5,t.fdmap),n.F.revCodes(t.fdtree,5),r(t.itree,19,0),r(t.ltree,286,0),r(t.dtree,30,0),r(t.ttree,320,0)}()}();var st=function(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}({__proto__:null,default:it},[it]);const ot=function(){var t={nextZero(t,e){for(;0!=t[e];)e++;return e},readUshort:(t,e)=>t[e]<<8|t[e+1],writeUshort(t,e,n){t[e]=n>>8&255,t[e+1]=255&n},readUint:(t,e)=>16777216*t[e]+(t[e+1]<<16|t[e+2]<<8|t[e+3]),writeUint(t,e,n){t[e]=n>>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n},readASCII(t,e,n){let i="";for(let r=0;r<n;r++)i+=String.fromCharCode(t[e+r]);return i},writeASCII(t,e,n){for(let i=0;i<n.length;i++)t[e+i]=n.charCodeAt(i)},readBytes(t,e,n){const i=[];for(let r=0;r<n;r++)i.push(t[e+r]);return i},pad:t=>t.length<2?`0${t}`:t,readUTF8(e,n,i){let r,s="";for(let r=0;r<i;r++)s+=`%${t.pad(e[n+r].toString(16))}`;try{r=decodeURIComponent(s)}catch(r){return t.readASCII(e,n,i)}return r}};function e(e,n,i,r){const o=n*i,a=s(r),c=Math.ceil(n*a/8),l=new Uint8Array(4*o),h=new Uint32Array(l.buffer),{ctype:u}=r,{depth:f}=r,d=t.readUshort;if(6==u){const t=o<<2;if(8==f)for(var p=0;p<t;p+=4)l[p]=e[p],l[p+1]=e[p+1],l[p+2]=e[p+2],l[p+3]=e[p+3];if(16==f)for(p=0;p<t;p++)l[p]=e[p<<1]}else if(2==u){const t=r.tabs.tRNS;if(null==t){if(8==f)for(p=0;p<o;p++){var g=3*p;h[p]=255<<24|e[g+2]<<16|e[g+1]<<8|e[g]}if(16==f)for(p=0;p<o;p++)h[p]=255<<24|e[4+(g=6*p)]<<16|e[g+2]<<8|e[g]}else{var v=t[0];const n=t[1],i=t[2];if(8==f)for(p=0;p<o;p++){var w=p<<2;h[p]=255<<24|e[2+(g=3*p)]<<16|e[g+1]<<8|e[g],e[g]==v&&e[g+1]==n&&e[g+2]==i&&(l[w+3]=0)}if(16==f)for(p=0;p<o;p++)w=p<<2,h[p]=255<<24|e[4+(g=6*p)]<<16|e[g+2]<<8|e[g],d(e,g)==v&&d(e,g+2)==n&&d(e,g+4)==i&&(l[w+3]=0)}}else if(3==u){const t=r.tabs.PLTE,s=r.tabs.tRNS,a=s?s.length:0;if(1==f)for(var m=0;m<i;m++){var y=m*c,b=m*n;for(p=0;p<n;p++){var k=3*(A=e[y+(p>>3)]>>7-(7&p)&1);l[w=b+p<<2]=t[k],l[w+1]=t[k+1],l[w+2]=t[k+2],l[w+3]=A<a?s[A]:255}}if(2==f)for(m=0;m<i;m++)for(y=m*c,b=m*n,p=0;p<n;p++)k=3*(A=e[y+(p>>2)]>>6-((3&p)<<1)&3),l[w=b+p<<2]=t[k],l[w+1]=t[k+1],l[w+2]=t[k+2],l[w+3]=A<a?s[A]:255;if(4==f)for(m=0;m<i;m++)for(y=m*c,b=m*n,p=0;p<n;p++)k=3*(A=e[y+(p>>1)]>>4-((1&p)<<2)&15),l[w=b+p<<2]=t[k],l[w+1]=t[k+1],l[w+2]=t[k+2],l[w+3]=A<a?s[A]:255;if(8==f)for(p=0;p<o;p++){var A;k=3*(A=e[p]),l[w=p<<2]=t[k],l[w+1]=t[k+1],l[w+2]=t[k+2],l[w+3]=A<a?s[A]:255}}else if(4==u){if(8==f)for(p=0;p<o;p++){var x=e[S=p<<1];l[w=p<<2]=x,l[w+1]=x,l[w+2]=x,l[w+3]=e[S+1]}if(16==f)for(p=0;p<o;p++){var S;x=e[S=p<<2],l[w=p<<2]=x,l[w+1]=x,l[w+2]=x,l[w+3]=e[S+2]}}else if(0==u)for(v=r.tabs.tRNS?r.tabs.tRNS:-1,m=0;m<i;m++){const t=m*c,i=m*n;if(1==f)for(var M=0;M<n;M++){var z=(x=255*(e[t+(M>>>3)]>>>7-(7&M)&1))==255*v?0:255;h[i+M]=z<<24|x<<16|x<<8|x}else if(2==f)for(M=0;M<n;M++)z=(x=85*(e[t+(M>>>2)]>>>6-((3&M)<<1)&3))==85*v?0:255,h[i+M]=z<<24|x<<16|x<<8|x;else if(4==f)for(M=0;M<n;M++)z=(x=17*(e[t+(M>>>1)]>>>4-((1&M)<<2)&15))==17*v?0:255,h[i+M]=z<<24|x<<16|x<<8|x;else if(8==f)for(M=0;M<n;M++)z=(x=e[t+M])==v?0:255,h[i+M]=z<<24|x<<16|x<<8|x;else if(16==f)for(M=0;M<n;M++)x=e[t+(M<<1)],z=d(e,t+(M<<1))==v?0:255,h[i+M]=z<<24|x<<16|x<<8|x}return l}function n(t,e,n,a){const c=s(t),l=Math.ceil(n*c/8),h=new Uint8Array((l+1+t.interlace)*a);return e=t.tabs.CgBI?r(e,h):i(e,h),0==t.interlace?e=o(e,t,0,n,a):1==t.interlace&&(e=function(t,e){const n=e.width,i=e.height,r=s(e),a=r>>3,c=Math.ceil(n*r/8),l=new Uint8Array(i*c);let h=0;const u=[0,0,4,0,2,0,1],f=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1];let g=0;for(;g<7;){const s=d[g],w=p[g];let m=0,y=0,b=u[g];for(;b<i;)b+=s,y++;let k=f[g];for(;k<n;)k+=w,m++;const A=Math.ceil(m*r/8);o(t,e,h,m,y);let x=0,S=u[g];for(;S<i;){let e=f[g],i=h+x*A<<3;for(;e<n;){var v;if(1==r&&(v=(v=t[i>>3])>>7-(7&i)&1,l[S*c+(e>>3)]|=v<<7-(7&e)),2==r&&(v=(v=t[i>>3])>>6-(7&i)&3,l[S*c+(e>>2)]|=v<<6-((3&e)<<1)),4==r&&(v=(v=t[i>>3])>>4-(7&i)&15,l[S*c+(e>>1)]|=v<<4-((1&e)<<2)),r>=8){const n=S*c+e*a;for(let e=0;e<a;e++)l[n+e]=t[(i>>3)+e]}i+=r,e+=w}x++,S+=s}m*y!=0&&(h+=y*(1+A)),g+=1}return l}(e,t)),e}function i(t,e){return r(new Uint8Array(t.buffer,2,t.length-6),e)}var r=function(){const t={H:{}};return t.H.N=function(e,n){const i=Uint8Array;let r,s,o=0,a=0,c=0,l=0,h=0,u=0,f=0,d=0,p=0;if(3==e[0]&&0==e[1])return n||new i(0);const g=t.H,v=g.b,w=g.e,m=g.R,y=g.n,b=g.A,k=g.Z,A=g.m,x=null==n;for(x&&(n=new i(e.length>>>2<<5));0==o;)if(o=v(e,p,1),a=v(e,p+1,2),p+=3,0!=a){if(x&&(n=t.H.W(n,d+(1<<17))),1==a&&(r=A.J,s=A.h,u=511,f=31),2==a){c=w(e,p,5)+257,l=w(e,p+5,5)+1,h=w(e,p+10,4)+4,p+=14;let t=1;for(var S=0;S<38;S+=2)A.Q[S]=0,A.Q[S+1]=0;for(S=0;S<h;S++){const n=w(e,p+3*S,3);A.Q[1+(A.X[S]<<1)]=n,n>t&&(t=n)}p+=3*h,y(A.Q,t),b(A.Q,t,A.u),r=A.w,s=A.d,p=m(A.u,(1<<t)-1,c+l,e,p,A.v);const n=g.V(A.v,0,c,A.C);u=(1<<n)-1;const i=g.V(A.v,c,l,A.D);f=(1<<i)-1,y(A.C,n),b(A.C,n,r),y(A.D,i),b(A.D,i,s)}for(;;){const t=r[k(e,p)&u];p+=15&t;const i=t>>>4;if(i>>>8==0)n[d++]=i;else{if(256==i)break;{let t=d+i-254;if(i>264){const n=A.q[i-257];t=d+(n>>>3)+w(e,p,7&n),p+=7&n}const r=s[k(e,p)&f];p+=15&r;const o=A.c[r>>>4],a=(o>>>4)+v(e,p,15&o);for(p+=15&o;d<t;)n[d]=n[d++-a],n[d]=n[d++-a],n[d]=n[d++-a],n[d]=n[d++-a];d=t}}}}else{7&p&&(p+=8-(7&p));const r=4+(p>>>3),s=e[r-4]|e[r-3]<<8;x&&(n=t.H.W(n,d+s)),n.set(new i(e.buffer,e.byteOffset+r,s),d),p=r+s<<3,d+=s}return n.length==d?n:n.slice(0,d)},t.H.W=function(t,e){const n=t.length;if(e<=n)return t;const i=new Uint8Array(n<<1);return i.set(t,0),i},t.H.R=function(e,n,i,r,s,o){const a=t.H.e,c=t.H.Z;let l=0;for(;l<i;){const t=e[c(r,s)&n];s+=15&t;const i=t>>>4;if(i<=15)o[l]=i,l++;else{let t=0,e=0;16==i?(e=3+a(r,s,2),s+=2,t=o[l-1]):17==i?(e=3+a(r,s,3),s+=3):18==i&&(e=11+a(r,s,7),s+=7);const n=l+e;for(;l<n;)o[l]=t,l++}}return s},t.H.V=function(t,e,n,i){let r=0,s=0;const o=i.length>>>1;for(;s<n;){const n=t[s+e];i[s<<1]=0,i[1+(s<<1)]=n,n>r&&(r=n),s++}for(;s<o;)i[s<<1]=0,i[1+(s<<1)]=0,s++;return r},t.H.n=function(e,n){const i=t.H.m,r=e.length;let s,o,a,c;const l=i.j;for(var h=0;h<=n;h++)l[h]=0;for(h=1;h<r;h+=2)l[e[h]]++;const u=i.K;for(s=0,l[0]=0,o=1;o<=n;o++)s=s+l[o-1]<<1,u[o]=s;for(a=0;a<r;a+=2)c=e[a+1],0!=c&&(e[a]=u[c],u[c]++)},t.H.A=function(e,n,i){const r=e.length,s=t.H.m.r;for(let t=0;t<r;t+=2)if(0!=e[t+1]){const r=e[t+1],o=t>>1<<4|r,a=n-r;let c=e[t]<<a;const l=c+(1<<a);for(;c!=l;)i[s[c]>>>15-n]=o,c++}},t.H.l=function(e,n){const i=t.H.m.r,r=15-n;for(let t=0;t<e.length;t+=2)e[t]=i[e[t]<<n-e[t+1]]>>>r},t.H.M=function(t,e,n){const i=e>>>3;t[i]|=n<<=7&e,t[i+1]|=n>>>8},t.H.I=function(t,e,n){const i=e>>>3;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},t.H.e=function(t,e,n){return(t[e>>>3]|t[1+(e>>>3)]<<8)>>>(7&e)&(1<<n)-1},t.H.b=function(t,e,n){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16)>>>(7&e)&(1<<n)-1},t.H.Z=function(t,e){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16)>>>(7&e)},t.H.i=function(t,e){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16|t[3+(e>>>3)]<<24)>>>(7&e)},t.H.m=function(){const t=Uint16Array,e=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new e(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new e(286),Y:new e(30),a:new e(19),t:new e(15e3),k:new t(65536),g:new t(32768)}}(),function(){const e=t.H.m;for(var n=0;n<32768;n++){let t=n;t=(2863311530&t)>>>1|(1431655765&t)<<1,t=(3435973836&t)>>>2|(858993459&t)<<2,t=(4042322160&t)>>>4|(252645135&t)<<4,t=(4278255360&t)>>>8|(16711935&t)<<8,e.r[n]=(t>>>16|t<<16)>>>17}function i(t,e,n){for(;0!=e--;)t.push(0,n)}for(n=0;n<32;n++)e.q[n]=e.S[n]<<3|e.T[n],e.c[n]=e.p[n]<<4|e.z[n];i(e._,144,8),i(e._,112,9),i(e._,24,7),i(e._,8,8),t.H.n(e._,9),t.H.A(e._,9,e.J),t.H.l(e._,9),i(e.$,32,5),t.H.n(e.$,5),t.H.A(e.$,5,e.h),t.H.l(e.$,5),i(e.Q,19,0),i(e.C,286,0),i(e.D,30,0),i(e.v,320,0)}(),t.H.N}();function s(t){return[1,null,3,1,2,null,4][t.ctype]*t.depth}function o(t,e,n,i,r){let o=s(e);const c=Math.ceil(i*o/8);let l,h;o=Math.ceil(o/8);let u=t[n],f=0;if(u>1&&(t[n]=[0,0,1][u-2]),3==u)for(f=o;f<c;f++)t[f+1]=t[f+1]+(t[f+1-o]>>>1)&255;for(let e=0;e<r;e++)if(l=n+e*c,h=l+e+1,u=t[h-1],f=0,0==u)for(;f<c;f++)t[l+f]=t[h+f];else if(1==u){for(;f<o;f++)t[l+f]=t[h+f];for(;f<c;f++)t[l+f]=t[h+f]+t[l+f-o]}else if(2==u)for(;f<c;f++)t[l+f]=t[h+f]+t[l+f-c];else if(3==u){for(;f<o;f++)t[l+f]=t[h+f]+(t[l+f-c]>>>1);for(;f<c;f++)t[l+f]=t[h+f]+(t[l+f-c]+t[l+f-o]>>>1)}else{for(;f<o;f++)t[l+f]=t[h+f]+a(0,t[l+f-c],0);for(;f<c;f++)t[l+f]=t[h+f]+a(t[l+f-o],t[l+f-c],t[l+f-o-c])}return t}function a(t,e,n){const i=t+e-n,r=i-t,s=i-e,o=i-n;return r*r<=s*s&&r*r<=o*o?t:s*s<=o*o?e:n}function c(e,n,i){i.width=t.readUint(e,n),i.height=t.readUint(e,n+=4),i.depth=e[n+=4],n++,i.ctype=e[n],n++,i.compress=e[n],n++,i.filter=e[n],n++,i.interlace=e[n],n++}function l(t,e,n,i,r,s,o,a,c){const l=Math.min(e,r),h=Math.min(n,s);let u=0,f=0;for(let n=0;n<h;n++)for(let s=0;s<l;s++)if(o>=0&&a>=0?(u=n*e+s<<2,f=(a+n)*r+o+s<<2):(u=(-a+n)*e-o+s<<2,f=n*r+s<<2),0==c)i[f]=t[u],i[f+1]=t[u+1],i[f+2]=t[u+2],i[f+3]=t[u+3];else if(1==c){var d=t[u+3]*(1/255),p=t[u]*d,g=t[u+1]*d,v=t[u+2]*d,w=i[f+3]*(1/255),m=i[f]*w,y=i[f+1]*w,b=i[f+2]*w;const e=1-d,n=d+w*e,r=0==n?0:1/n;i[f+3]=255*n,i[f+0]=(p+m*e)*r,i[f+1]=(g+y*e)*r,i[f+2]=(v+b*e)*r}else if(2==c)p=t[u],g=t[u+1],v=t[u+2],m=i[f],y=i[f+1],b=i[f+2],(d=t[u+3])==(w=i[f+3])&&p==m&&g==y&&v==b?(i[f]=0,i[f+1]=0,i[f+2]=0,i[f+3]=0):(i[f]=p,i[f+1]=g,i[f+2]=v,i[f+3]=d);else if(3==c){if(p=t[u],g=t[u+1],v=t[u+2],m=i[f],y=i[f+1],b=i[f+2],(d=t[u+3])==(w=i[f+3])&&p==m&&g==y&&v==b)continue;if(d<220&&w>20)return!1}return!0}return{decode:function(e){const s=new Uint8Array(e);let o=8;const a=t,l=a.readUshort,h=a.readUint,u={tabs:{},frames:[]},f=new Uint8Array(s.length);let d,p=0,g=0;const v=[137,80,78,71,13,10,26,10];for(var w=0;w<8;w++)if(s[w]!=v[w])throw"The input is not a PNG file!";for(;o<s.length;){const t=a.readUint(s,o);o+=4;const e=a.readASCII(s,o,4);if(o+=4,"IHDR"==e)c(s,o,u);else if("iCCP"==e){for(var m=o;0!=s[m];)m++;a.readASCII(s,o,m-o);const n=s.slice(m+2,o+t);let c=null;try{c=i(n)}catch(t){c=r(n)}u.tabs[e]=c}else if("CgBI"==e)u.tabs[e]=s.slice(o,o+4);else if("IDAT"==e){for(w=0;w<t;w++)f[p+w]=s[o+w];p+=t}else if("acTL"==e)u.tabs[e]={num_frames:h(s,o),num_plays:h(s,o+4)},d=new Uint8Array(s.length);else if("fcTL"==e){0!=g&&((S=u.frames[u.frames.length-1]).data=n(u,d.slice(0,g),S.rect.width,S.rect.height),g=0);const t={x:h(s,o+12),y:h(s,o+16),width:h(s,o+4),height:h(s,o+8)};let e=l(s,o+22);e=l(s,o+20)/(0==e?100:e);const i={rect:t,delay:Math.round(1e3*e),dispose:s[o+24],blend:s[o+25]};u.frames.push(i)}else if("fdAT"==e){for(w=0;w<t-4;w++)d[g+w]=s[o+w+4];g+=t-4}else if("pHYs"==e)u.tabs[e]=[a.readUint(s,o),a.readUint(s,o+4),s[o+8]];else if("cHRM"==e)for(u.tabs[e]=[],w=0;w<8;w++)u.tabs[e].push(a.readUint(s,o+4*w));else if("tEXt"==e||"zTXt"==e){null==u.tabs[e]&&(u.tabs[e]={});var y=a.nextZero(s,o),b=a.readASCII(s,o,y-o),k=o+t-y-1;if("tEXt"==e)x=a.readASCII(s,y+1,k);else{var A=i(s.slice(y+2,y+2+k));x=a.readUTF8(A,0,A.length)}u.tabs[e][b]=x}else if("iTXt"==e){null==u.tabs[e]&&(u.tabs[e]={}),y=0,y=a.nextZero(s,m=o),b=a.readASCII(s,m,y-m);const n=s[m=y+1];var x;y=a.nextZero(s,m+=2),a.readASCII(s,m,y-m),y=a.nextZero(s,m=y+1),a.readUTF8(s,m,y-m),k=t-((m=y+1)-o),0==n?x=a.readUTF8(s,m,k):(A=i(s.slice(m,m+k)),x=a.readUTF8(A,0,A.length)),u.tabs[e][b]=x}else if("PLTE"==e)u.tabs[e]=a.readBytes(s,o,t);else if("hIST"==e){const t=u.tabs.PLTE.length/3;for(u.tabs[e]=[],w=0;w<t;w++)u.tabs[e].push(l(s,o+2*w))}else if("tRNS"==e)3==u.ctype?u.tabs[e]=a.readBytes(s,o,t):0==u.ctype?u.tabs[e]=l(s,o):2==u.ctype&&(u.tabs[e]=[l(s,o),l(s,o+2),l(s,o+4)]);else if("gAMA"==e)u.tabs[e]=a.readUint(s,o)/1e5;else if("sRGB"==e)u.tabs[e]=s[o];else if("bKGD"==e)0==u.ctype||4==u.ctype?u.tabs[e]=[l(s,o)]:2==u.ctype||6==u.ctype?u.tabs[e]=[l(s,o),l(s,o+2),l(s,o+4)]:3==u.ctype&&(u.tabs[e]=s[o]);else if("IEND"==e)break;o+=t,a.readUint(s,o),o+=4}var S;return 0!=g&&((S=u.frames[u.frames.length-1]).data=n(u,d.slice(0,g),S.rect.width,S.rect.height)),u.data=n(u,f,u.width,u.height),delete u.compress,delete u.interlace,delete u.filter,u},toRGBA8:function(t){const n=t.width,i=t.height;if(null==t.tabs.acTL)return[e(t.data,n,i,t).buffer];const r=[];null==t.frames[0].data&&(t.frames[0].data=t.data);const s=n*i*4,o=new Uint8Array(s),a=new Uint8Array(s),c=new Uint8Array(s);for(let u=0;u<t.frames.length;u++){const f=t.frames[u],d=f.rect.x,p=f.rect.y,g=f.rect.width,v=f.rect.height,w=e(f.data,g,v,t);if(0!=u)for(var h=0;h<s;h++)c[h]=o[h];if(0==f.blend?l(w,g,v,o,n,i,d,p,0):1==f.blend&&l(w,g,v,o,n,i,d,p,1),r.push(o.buffer.slice(0)),0==f.dispose);else if(1==f.dispose)l(a,g,v,o,n,i,d,p,0);else if(2==f.dispose)for(h=0;h<s;h++)o[h]=c[h]}return r},_paeth:a,_copyTile:l,_bin:t}}();!function(){const{_copyTile:t}=ot,{_bin:e}=ot,n=ot._paeth;var i={table:function(){const t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)1&n?n=3988292384^n>>>1:n>>>=1;t[e]=n}return t}(),update(t,e,n,r){for(let s=0;s<r;s++)t=i.table[255&(t^e[n+s])]^t>>>8;return t},crc:(t,e,n)=>4294967295^i.update(4294967295,t,e,n)};function r(t,e,n,i){e[n]+=t[0]*i>>4,e[n+1]+=t[1]*i>>4,e[n+2]+=t[2]*i>>4,e[n+3]+=t[3]*i>>4}function s(t){return Math.max(0,Math.min(255,t))}function o(t,e){const n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2],s=t[3]-e[3];return n*n+i*i+r*r+s*s}function a(t,e,n,i,a,c,l){null==l&&(l=1);const h=i.length,u=[];for(var f=0;f<h;f++){const t=i[f];u.push([t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255])}for(f=0;f<h;f++){let t=4294967295;for(var d=0,p=0;p<h;p++){var g=o(u[f],u[p]);p!=f&&g<t&&(t=g,d=p)}}const v=new Uint32Array(a.buffer),w=new Int16Array(e*n*4),m=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(f=0;f<m.length;f++)m[f]=255*((m[f]+.5)/16-.5);for(let a=0;a<n;a++)for(let b=0;b<e;b++){var y;f=4*(a*e+b),y=2!=l?[s(t[f]+w[f]),s(t[f+1]+w[f+1]),s(t[f+2]+w[f+2]),s(t[f+3]+w[f+3])]:[s(t[f]+(g=m[4*(3&a)+(3&b)])),s(t[f+1]+g),s(t[f+2]+g),s(t[f+3]+g)],d=0;let k=16777215;for(p=0;p<h;p++){const t=o(y,u[p]);t<k&&(k=t,d=p)}const A=u[d],x=[y[0]-A[0],y[1]-A[1],y[2]-A[2],y[3]-A[3]];1==l&&(b!=e-1&&r(x,w,f+4,7),a!=n-1&&(0!=b&&r(x,w,f+4*e-4,3),r(x,w,f+4*e,5),b!=e-1&&r(x,w,f+4*e+4,1))),c[f>>2]=d,v[f>>2]=i[d]}}function c(t,n,r,s,o){null==o&&(o={});const{crc:a}=i,c=e.writeUint,l=e.writeUshort,h=e.writeASCII;let u=8;const f=t.frames.length>1;let d,p=!1,g=33+(f?20:0);if(null!=o.sRGB&&(g+=13),null!=o.pHYs&&(g+=21),null!=o.iCCP&&(d=pako.deflate(o.iCCP),g+=21+d.length+4),3==t.ctype){for(var v=t.plte.length,w=0;w<v;w++)t.plte[w]>>>24!=255&&(p=!0);g+=8+3*v+4+(p?8+1*v+4:0)}for(var m=0;m<t.frames.length;m++)f&&(g+=38),g+=(A=t.frames[m]).cimg.length+12,0!=m&&(g+=4);g+=12;const y=new Uint8Array(g),b=[137,80,78,71,13,10,26,10];for(w=0;w<8;w++)y[w]=b[w];if(c(y,u,13),u+=4,h(y,u,"IHDR"),u+=4,c(y,u,n),u+=4,c(y,u,r),u+=4,y[u]=t.depth,u++,y[u]=t.ctype,u++,y[u]=0,u++,y[u]=0,u++,y[u]=0,u++,c(y,u,a(y,u-17,17)),u+=4,null!=o.sRGB&&(c(y,u,1),u+=4,h(y,u,"sRGB"),u+=4,y[u]=o.sRGB,u++,c(y,u,a(y,u-5,5)),u+=4),null!=o.iCCP){const t=13+d.length;c(y,u,t),u+=4,h(y,u,"iCCP"),u+=4,h(y,u,"ICC profile"),u+=11,u+=2,y.set(d,u),u+=d.length,c(y,u,a(y,u-(t+4),t+4)),u+=4}if(null!=o.pHYs&&(c(y,u,9),u+=4,h(y,u,"pHYs"),u+=4,c(y,u,o.pHYs[0]),u+=4,c(y,u,o.pHYs[1]),u+=4,y[u]=o.pHYs[2],u++,c(y,u,a(y,u-13,13)),u+=4),f&&(c(y,u,8),u+=4,h(y,u,"acTL"),u+=4,c(y,u,t.frames.length),u+=4,c(y,u,null!=o.loop?o.loop:0),u+=4,c(y,u,a(y,u-12,12)),u+=4),3==t.ctype){for(c(y,u,3*(v=t.plte.length)),u+=4,h(y,u,"PLTE"),u+=4,w=0;w<v;w++){const e=3*w,n=t.plte[w],i=n>>>8&255,r=n>>>16&255;y[u+e+0]=255&n,y[u+e+1]=i,y[u+e+2]=r}if(u+=3*v,c(y,u,a(y,u-3*v-4,3*v+4)),u+=4,p){for(c(y,u,v),u+=4,h(y,u,"tRNS"),u+=4,w=0;w<v;w++)y[u+w]=t.plte[w]>>>24&255;u+=v,c(y,u,a(y,u-v-4,v+4)),u+=4}}let k=0;for(m=0;m<t.frames.length;m++){var A=t.frames[m];f&&(c(y,u,26),u+=4,h(y,u,"fcTL"),u+=4,c(y,u,k++),u+=4,c(y,u,A.rect.width),u+=4,c(y,u,A.rect.height),u+=4,c(y,u,A.rect.x),u+=4,c(y,u,A.rect.y),u+=4,l(y,u,s[m]),u+=2,l(y,u,1e3),u+=2,y[u]=A.dispose,u++,y[u]=A.blend,u++,c(y,u,a(y,u-30,30)),u+=4);const e=A.cimg;c(y,u,(v=e.length)+(0==m?0:4)),u+=4;const n=u;h(y,u,0==m?"IDAT":"fdAT"),u+=4,0!=m&&(c(y,u,k++),u+=4),y.set(e,u),u+=v,c(y,u,a(y,n,u-n)),u+=4}return c(y,u,0),u+=4,h(y,u,"IEND"),u+=4,c(y,u,a(y,u-4,4)),u+=4,y.buffer}function l(t,e,n){for(let i=0;i<t.frames.length;i++){const r=t.frames[i],s=r.rect.height,o=new Uint8Array(s*r.bpl+s);r.cimg=d(r.img,s,r.bpp,r.bpl,o,e,n)}}function h(e,n,i,r,s){const o=s[0],c=s[1],l=s[2],h=s[3],d=s[4],p=s[5];let v=6,w=8,m=255;for(var y=0;y<e.length;y++){const t=new Uint8Array(e[y]);for(var b=t.length,k=0;k<b;k+=4)m&=t[k+3]}const A=255!=m,x=function(e,n,i,r,s,o){const a=[];for(var c=0;c<e.length;c++){const u=new Uint8Array(e[c]),d=new Uint32Array(u.buffer);var l;let g=0,v=0,w=n,m=i,y=r?1:0;if(0!=c){const b=o||r||1==c||0!=a[c-2].dispose?1:2;let k=0,A=1e9;for(let t=0;t<b;t++){var h=new Uint8Array(e[c-1-t]);const r=new Uint32Array(e[c-1-t]);let o=n,a=i,l=-1,u=-1;for(let t=0;t<i;t++)for(let e=0;e<n;e++)d[p=t*n+e]!=r[p]&&(e<o&&(o=e),e>l&&(l=e),t<a&&(a=t),t>u&&(u=t));-1==l&&(o=a=l=u=0),s&&(!(1&~o)&&o--,!(1&~a)&&a--);const f=(l-o+1)*(u-a+1);f<A&&(A=f,k=t,g=o,v=a,w=l-o+1,m=u-a+1)}h=new Uint8Array(e[c-1-k]),1==k&&(a[c-1].dispose=2),l=new Uint8Array(w*m*4),t(h,n,i,l,w,m,-g,-v,0),y=t(u,n,i,l,w,m,-g,-v,3)?1:0,1==y?f(u,n,i,l,{x:g,y:v,width:w,height:m}):t(u,n,i,l,w,m,-g,-v,0)}else l=u.slice(0);a.push({rect:{x:g,y:v,width:w,height:m},img:l,blend:y,dispose:0})}if(r)for(c=0;c<a.length;c++){if(1==(g=a[c]).blend)continue;const t=g.rect,r=a[c-1].rect,o=Math.min(t.x,r.x),l=Math.min(t.y,r.y),h={x:o,y:l,width:Math.max(t.x+t.width,r.x+r.width)-o,height:Math.max(t.y+t.height,r.y+r.height)-l};a[c-1].dispose=1,c-1!=0&&u(e,n,i,a,c-1,h,s),u(e,n,i,a,c,h,s)}let d=0;if(1!=e.length)for(var p=0;p<a.length;p++){var g;d+=(g=a[p]).rect.width*g.rect.height}return a}(e,n,i,o,c,l),S={},M=[],z=[];if(0!=r){const t=[];for(k=0;k<x.length;k++)t.push(x[k].img.buffer);const e=function(t){let e=0;for(var n=0;n<t.length;n++)e+=t[n].byteLength;const i=new Uint8Array(e);let r=0;for(n=0;n<t.length;n++){const e=new Uint8Array(t[n]),s=e.length;for(let t=0;t<s;t+=4){let n=e[t],s=e[t+1],o=e[t+2];const a=e[t+3];0==a&&(n=s=o=0),i[r+t]=n,i[r+t+1]=s,i[r+t+2]=o,i[r+t+3]=a}r+=s}return i.buffer}(t),n=g(e,r);for(k=0;k<n.plte.length;k++)M.push(n.plte[k].est.rgba);let i=0;for(k=0;k<x.length;k++){const t=(C=x[k]).img.length;var $=new Uint8Array(n.inds.buffer,i>>2,t>>2);z.push($);const e=new Uint8Array(n.abuf,i,t);p&&a(C.img,C.rect.width,C.rect.height,M,e,$),C.img.set(e),i+=t}}else for(y=0;y<x.length;y++){var C=x[y];const t=new Uint32Array(C.img.buffer);var T=C.rect.width;for(b=t.length,$=new Uint8Array(b),z.push($),k=0;k<b;k++){const e=t[k];if(0!=k&&e==t[k-1])$[k]=$[k-1];else if(k>T&&e==t[k-T])$[k]=$[k-T];else{let t=S[e];if(null==t&&(S[e]=t=M.length,M.push(e),M.length>=300))break;$[k]=t}}}const I=M.length;for(I<=256&&0==d&&(w=I<=2?1:I<=4?2:I<=16?4:8,w=Math.max(w,h)),y=0;y<x.length;y++){const t=(C=x[y]).rect.height;let e=C.img,n=4*(T=C.rect.width),i=4;if(I<=256&&0==d){n=Math.ceil(w*T/8);var j=new Uint8Array(n*t);const r=z[y];for(let e=0;e<t;e++){k=e*n;const t=e*T;if(8==w)for(var E=0;E<T;E++)j[k+E]=r[t+E];else if(4==w)for(E=0;E<T;E++)j[k+(E>>1)]|=r[t+E]<<4-4*(1&E);else if(2==w)for(E=0;E<T;E++)j[k+(E>>2)]|=r[t+E]<<6-2*(3&E);else if(1==w)for(E=0;E<T;E++)j[k+(E>>3)]|=r[t+E]<<7-1*(7&E)}e=j,v=3,i=1}else if(0==A&&1==x.length){j=new Uint8Array(T*t*3);const r=T*t;for(k=0;k<r;k++){const t=3*k,n=4*k;j[t]=e[n],j[t+1]=e[n+1],j[t+2]=e[n+2]}e=j,v=2,i=3,n=3*T}C.img=e,C.bpl=n,C.bpp=i}return{ctype:v,depth:w,plte:M,frames:x}}function u(e,n,i,r,s,o,a){const c=Uint8Array,l=Uint32Array,h=new c(e[s-1]),u=new l(e[s-1]),d=s+1<e.length?new c(e[s+1]):null,p=new c(e[s]),g=new l(p.buffer);let v=n,w=i,m=-1,y=-1;for(let t=0;t<o.height;t++)for(let e=0;e<o.width;e++){const i=o.x+e,a=o.y+t,c=a*n+i,l=g[c];0==l||0==r[s-1].dispose&&u[c]==l&&(null==d||0!=d[4*c+3])||(i<v&&(v=i),i>m&&(m=i),a<w&&(w=a),a>y&&(y=a))}-1==m&&(v=w=m=y=0),a&&(!(1&~v)&&v--,!(1&~w)&&w--);const b=r[s];b.rect=o={x:v,y:w,width:m-v+1,height:y-w+1},b.blend=1,b.img=new Uint8Array(o.width*o.height*4),0==r[s-1].dispose?(t(h,n,i,b.img,o.width,o.height,-o.x,-o.y,0),f(p,n,i,b.img,o)):t(p,n,i,b.img,o.width,o.height,-o.x,-o.y,0)}function f(e,n,i,r,s){t(e,n,i,r,s.width,s.height,-s.x,-s.y,2)}function d(t,e,n,i,r,s,o){const a=[];let c,l=[0,1,2,3,4];-1!=s?l=[s]:(e*i>5e5||1==n)&&(l=[0]),o&&(c={level:0});const h=st;for(var u=0;u<l.length;u++){for(let s=0;s<e;s++)p(r,t,s,i,n,l[u]);a.push(h.deflate(r,c))}let f,d=1e9;for(u=0;u<a.length;u++)a[u].length<d&&(f=u,d=a[u].length);return a[f]}function p(t,e,i,r,s,o){const a=i*r;let c=a+i;if(t[c]=o,c++,0==o)if(r<500)for(var l=0;l<r;l++)t[c+l]=e[a+l];else t.set(new Uint8Array(e.buffer,a,r),c);else if(1==o){for(l=0;l<s;l++)t[c+l]=e[a+l];for(l=s;l<r;l++)t[c+l]=e[a+l]-e[a+l-s]+256&255}else if(0==i){for(l=0;l<s;l++)t[c+l]=e[a+l];if(2==o)for(l=s;l<r;l++)t[c+l]=e[a+l];if(3==o)for(l=s;l<r;l++)t[c+l]=e[a+l]-(e[a+l-s]>>1)+256&255;if(4==o)for(l=s;l<r;l++)t[c+l]=e[a+l]-n(e[a+l-s],0,0)+256&255}else{if(2==o)for(l=0;l<r;l++)t[c+l]=e[a+l]+256-e[a+l-r]&255;if(3==o){for(l=0;l<s;l++)t[c+l]=e[a+l]+256-(e[a+l-r]>>1)&255;for(l=s;l<r;l++)t[c+l]=e[a+l]+256-(e[a+l-r]+e[a+l-s]>>1)&255}if(4==o){for(l=0;l<s;l++)t[c+l]=e[a+l]+256-n(0,e[a+l-r],0)&255;for(l=s;l<r;l++)t[c+l]=e[a+l]+256-n(e[a+l-s],e[a+l-r],e[a+l-s-r])&255}}}function g(t,e){const n=new Uint8Array(t),i=n.slice(0),r=new Uint32Array(i.buffer),s=v(i,e),o=s[0],a=s[1],c=n.length,l=new Uint8Array(c>>2);let h;if(n.length<2e7)for(var u=0;u<c;u+=4)h=w(o,f=n[u]*(1/255),d=n[u+1]*(1/255),p=n[u+2]*(1/255),g=n[u+3]*(1/255)),l[u>>2]=h.ind,r[u>>2]=h.est.rgba;else for(u=0;u<c;u+=4){var f=n[u]*(1/255),d=n[u+1]*(1/255),p=n[u+2]*(1/255),g=n[u+3]*(1/255);for(h=o;h.left;)h=m(h.est,f,d,p,g)<=0?h.left:h.right;l[u>>2]=h.ind,r[u>>2]=h.est.rgba}return{abuf:i.buffer,inds:l,plte:a}}function v(t,e,n){null==n&&(n=1e-4);const i=new Uint32Array(t.buffer),r={i0:0,i1:t.length,bst:null,est:null,tdst:0,left:null,right:null};r.bst=k(t,r.i0,r.i1),r.est=A(r.bst);const s=[r];for(;s.length<e;){let e=0,r=0;for(var o=0;o<s.length;o++)s[o].est.L>e&&(e=s[o].est.L,r=o);if(e<n)break;const a=s[r],c=y(t,i,a.i0,a.i1,a.est.e,a.est.eMq255);if(a.i0>=c||a.i1<=c){a.est.L=0;continue}const l={i0:a.i0,i1:c,bst:null,est:null,tdst:0,left:null,right:null};l.bst=k(t,l.i0,l.i1),l.est=A(l.bst);const h={i0:c,i1:a.i1,bst:null,est:null,tdst:0,left:null,right:null};for(h.bst={R:[],m:[],N:a.bst.N-l.bst.N},o=0;o<16;o++)h.bst.R[o]=a.bst.R[o]-l.bst.R[o];for(o=0;o<4;o++)h.bst.m[o]=a.bst.m[o]-l.bst.m[o];h.est=A(h.bst),a.left=l,a.right=h,s[r]=l,s.push(h)}for(s.sort(((t,e)=>e.bst.N-t.bst.N)),o=0;o<s.length;o++)s[o].ind=o;return[r,s]}function w(t,e,n,i,r){if(null==t.left)return t.tdst=function(t,e,n,i,r){const s=e-t[0],o=n-t[1],a=i-t[2],c=r-t[3];return s*s+o*o+a*a+c*c}(t.est.q,e,n,i,r),t;const s=m(t.est,e,n,i,r);let o=t.left,a=t.right;s>0&&(o=t.right,a=t.left);const c=w(o,e,n,i,r);if(c.tdst<=s*s)return c;const l=w(a,e,n,i,r);return l.tdst<c.tdst?l:c}function m(t,e,n,i,r){const{e:s}=t;return s[0]*e+s[1]*n+s[2]*i+s[3]*r-t.eMq}function y(t,e,n,i,r,s){for(i-=4;n<i;){for(;b(t,n,r)<=s;)n+=4;for(;b(t,i,r)>s;)i-=4;if(n>=i)break;const o=e[n>>2];e[n>>2]=e[i>>2],e[i>>2]=o,n+=4,i-=4}for(;b(t,n,r)>s;)n-=4;return n+4}function b(t,e,n){return t[e]*n[0]+t[e+1]*n[1]+t[e+2]*n[2]+t[e+3]*n[3]}function k(t,e,n){const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=[0,0,0,0],s=n-e>>2;for(let s=e;s<n;s+=4){const e=t[s]*(1/255),n=t[s+1]*(1/255),o=t[s+2]*(1/255),a=t[s+3]*(1/255);r[0]+=e,r[1]+=n,r[2]+=o,r[3]+=a,i[0]+=e*e,i[1]+=e*n,i[2]+=e*o,i[3]+=e*a,i[5]+=n*n,i[6]+=n*o,i[7]+=n*a,i[10]+=o*o,i[11]+=o*a,i[15]+=a*a}return i[4]=i[1],i[8]=i[2],i[9]=i[6],i[12]=i[3],i[13]=i[7],i[14]=i[11],{R:i,m:r,N:s}}function A(t){const{R:e}=t,{m:n}=t,{N:i}=t,r=n[0],s=n[1],o=n[2],a=n[3],c=0==i?0:1/i,l=[e[0]-r*r*c,e[1]-r*s*c,e[2]-r*o*c,e[3]-r*a*c,e[4]-s*r*c,e[5]-s*s*c,e[6]-s*o*c,e[7]-s*a*c,e[8]-o*r*c,e[9]-o*s*c,e[10]-o*o*c,e[11]-o*a*c,e[12]-a*r*c,e[13]-a*s*c,e[14]-a*o*c,e[15]-a*a*c],h=l,u=x;let f=[Math.random(),Math.random(),Math.random(),Math.random()],d=0,p=0;if(0!=i)for(let t=0;t<16&&(f=u.multVec(h,f),p=Math.sqrt(u.dot(f,f)),f=u.sml(1/p,f),!(0!=t&&Math.abs(p-d)<1e-9));t++)d=p;const g=[r*c,s*c,o*c,a*c];return{Cov:l,q:g,e:f,L:d,eMq255:u.dot(u.sml(255,g),f),eMq:u.dot(f,g),rgba:(Math.round(255*g[3])<<24|Math.round(255*g[2])<<16|Math.round(255*g[1])<<8|Math.round(255*g[0]))>>>0}}var x={multVec:(t,e)=>[t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3],t[4]*e[0]+t[5]*e[1]+t[6]*e[2]+t[7]*e[3],t[8]*e[0]+t[9]*e[1]+t[10]*e[2]+t[11]*e[3],t[12]*e[0]+t[13]*e[1]+t[14]*e[2]+t[15]*e[3]],dot:(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3],sml:(t,e)=>[t*e[0],t*e[1],t*e[2],t*e[3]]};ot.encode=function(t,e,n,i,r,s,o){null==i&&(i=0),null==o&&(o=!1);const a=h(t,e,n,i,[!1,!1,!1,0,o,!1]);return l(a,-1),c(a,e,n,r,s)},ot.encodeLL=function(t,e,n,i,r,s,o,a){const h={ctype:0+(1==i?0:2)+(0==r?0:4),depth:s,frames:[]},u=(i+r)*s,f=u*e;for(let i=0;i<t.length;i++)h.frames.push({rect:{x:0,y:0,width:e,height:n},img:new Uint8Array(t[i]),blend:0,dispose:1,bpp:Math.ceil(u/8),bpl:Math.ceil(f/8)});return l(h,0,!0),c(h,e,n,o,a)},ot.encode.compress=h,ot.encode.dither=a,ot.quantize=g,ot.quantize.getKDtree=v,ot.quantize.getNearest=w}();const at={toArrayBuffer(t,e){const n=t.width,i=t.height,r=n<<2,s=t.getContext("2d").getImageData(0,0,n,i),o=new Uint32Array(s.data.buffer),a=(32*n+31)/32<<2,c=a*i,l=122+c,h=new ArrayBuffer(l),u=new DataView(h),f=1<<20;let d,p,g,v,w=f,m=0,y=0,b=0;function k(t){u.setUint16(y,t,!0),y+=2}function A(t){u.setUint32(y,t,!0),y+=4}function x(t){y+=t}k(19778),A(l),x(4),A(122),A(108),A(n),A(-i>>>0),k(1),k(32),A(3),A(c),A(2835),A(2835),x(8),A(16711680),A(65280),A(255),A(4278190080),A(1466527264),function t(){for(;m<i&&w>0;){for(v=122+m*a,d=0;d<r;)w--,p=o[b++],g=p>>>24,u.setUint32(v+d,p<<8|g),d+=4;m++}b<o.length?(w=f,setTimeout(t,at._dly)):e(h)}()},toBlob(t,e){this.toArrayBuffer(t,(t=>{e(new Blob([t],{type:"image/bmp"}))}))},_dly:9};var ct={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},lt={[ct.CHROME]:16384,[ct.FIREFOX]:11180,[ct.DESKTOP_SAFARI]:16384,[ct.IE]:8192,[ct.IOS]:4096,[ct.ETC]:8192};const ht="undefined"!=typeof window,ut="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,ft=ht&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),dt=(ht||ut)&&(ft&&ft.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),pt=(ht||ut)&&(ft&&ft.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function gt(t,e,n=Date.now()){return new Promise((i=>{const r=t.split(","),s=r[0].match(/:(.*?);/)[1],o=globalThis.atob(r[1]);let a=o.length;const c=new Uint8Array(a);for(;a--;)c[a]=o.charCodeAt(a);const l=new Blob([c],{type:s});l.name=e,l.lastModified=n,i(l)}))}function vt(t){return new Promise(((e,n)=>{const i=new pt;i.onload=()=>e(i.result),i.onerror=t=>n(t),i.readAsDataURL(t)}))}function wt(t){return new Promise(((e,n)=>{const i=new Image;i.onload=()=>e(i),i.onerror=t=>n(t),i.src=t}))}function mt(){if(void 0!==mt.cachedResult)return mt.cachedResult;let t=ct.ETC;const{userAgent:e}=navigator;return/Chrom(e|ium)/i.test(e)?t=ct.CHROME:/iP(ad|od|hone)/i.test(e)&&/WebKit/i.test(e)?t=ct.IOS:/Safari/i.test(e)?t=ct.DESKTOP_SAFARI:/Firefox/i.test(e)?t=ct.FIREFOX:(/MSIE/i.test(e)||1==!!document.documentMode)&&(t=ct.IE),mt.cachedResult=t}function yt(t,e){const n=mt(),i=lt[n];let r=t,s=e,o=r*s;const a=r>s?s/r:r/s;for(;o>i*i;){const t=(i+r)/2,e=(i+s)/2;t<e?(s=e,r=e*a):(s=t*a,r=t),o=r*s}return{width:r,height:s}}function bt(t,e){let n,i;try{if(n=new OffscreenCanvas(t,e),i=n.getContext("2d"),null===i)throw new Error("getContext of OffscreenCanvas returns null")}catch(t){n=document.createElement("canvas"),i=n.getContext("2d")}return n.width=t,n.height=e,[n,i]}function kt(t,e){const{width:n,height:i}=yt(t.width,t.height),[r,s]=bt(n,i);return e&&/jpe?g/.test(e)&&(s.fillStyle="white",s.fillRect(0,0,r.width,r.height)),s.drawImage(t,0,0,r.width,r.height),r}function At(){return void 0!==At.cachedResult||(At.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),At.cachedResult}function xt(t,e={}){return new Promise((function(n,i){let r,s;var o=function(){try{return s=kt(r,e.fileType||t.type),n([r,s])}catch(t){return i(t)}},a=function(){try{var e=function(t){try{throw t}catch(t){return i(t)}};try{let n;return vt(t).then((function(t){try{return n=t,wt(n).then((function(t){try{return r=t,function(){try{return o()}catch(t){return i(t)}}()}catch(t){return e(t)}}),e)}catch(t){return e(t)}}),e)}catch(t){e(t)}}catch(t){return i(t)}};try{if(At()||[ct.DESKTOP_SAFARI,ct.MOBILE_SAFARI].includes(mt()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(t).then((function(t){try{return r=t,o()}catch(t){return a()}}),a)}catch(t){a()}}))}function St(t,e,n,i,r=1){return new Promise((function(s,o){let a;if("image/png"===e){let l,h,u;return l=t.getContext("2d"),({data:h}=l.getImageData(0,0,t.width,t.height)),u=ot.encode([h.buffer],t.width,t.height,4096*r),a=new Blob([u],{type:e}),a.name=n,a.lastModified=i,c.call(this)}{if("image/bmp"===e)return new Promise((e=>at.toBlob(t,e))).then(function(t){try{return a=t,a.name=n,a.lastModified=i,f.call(this)}catch(t){return o(t)}}.bind(this),o);{if("function"==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)return t.convertToBlob({type:e,quality:r}).then(function(t){try{return a=t,a.name=n,a.lastModified=i,d.call(this)}catch(t){return o(t)}}.bind(this),o);{let p;return p=t.toDataURL(e,r),gt(p,n,i).then(function(t){try{return a=t,d.call(this)}catch(t){return o(t)}}.bind(this),o)}function d(){return f.call(this)}}function f(){return c.call(this)}}function c(){return s(a)}}))}function Mt(t){t.width=0,t.height=0}function zt(){return new Promise((function(t,e){let n,i,r,s;return void 0!==zt.cachedResult?t(zt.cachedResult):gt("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(o){try{return n=o,xt(n).then((function(o){try{return i=o[1],St(i,n.type,n.name,n.lastModified).then((function(n){try{return r=n,Mt(i),xt(r).then((function(n){try{return s=n[0],t(zt.cachedResult=1===s.width&&2===s.height)}catch(t){return e(t)}}),e)}catch(t){return e(t)}}),e)}catch(t){return e(t)}}),e)}catch(t){return e(t)}}),e)}))}function $t(t){return new Promise(((e,n)=>{const i=new pt;i.onload=t=>{const n=new DataView(t.target.result);if(65496!=n.getUint16(0,!1))return e(-2);const i=n.byteLength;let r=2;for(;r<i;){if(n.getUint16(r+2,!1)<=8)return e(-1);const t=n.getUint16(r,!1);if(r+=2,65505==t){if(1165519206!=n.getUint32(r+=2,!1))return e(-1);const t=18761==n.getUint16(r+=6,!1);r+=n.getUint32(r+4,t);const i=n.getUint16(r,t);r+=2;for(let s=0;s<i;s++)if(274==n.getUint16(r+12*s,t))return e(n.getUint16(r+12*s+8,t))}else{if(65280&~t)break;r+=n.getUint16(r,!1)}}return e(-1)},i.onerror=t=>n(t),i.readAsArrayBuffer(t)}))}function Ct(t,e){const{width:n}=t,{height:i}=t,{maxWidthOrHeight:r}=e;let s,o=t;return isFinite(r)&&(n>r||i>r)&&([o,s]=bt(n,i),n>i?(o.width=r,o.height=i/n*r):(o.width=n/i*r,o.height=r),s.drawImage(t,0,0,o.width,o.height),Mt(t)),o}function Tt(t,e){const{width:n}=t,{height:i}=t,[r,s]=bt(n,i);switch(e>4&&e<9?(r.width=i,r.height=n):(r.width=n,r.height=i),e){case 2:s.transform(-1,0,0,1,n,0);break;case 3:s.transform(-1,0,0,-1,n,i);break;case 4:s.transform(1,0,0,-1,0,i);break;case 5:s.transform(0,1,1,0,0,0);break;case 6:s.transform(0,1,-1,0,i,0);break;case 7:s.transform(0,-1,-1,0,i,n);break;case 8:s.transform(0,-1,1,0,0,n)}return s.drawImage(t,0,0,n,i),Mt(t),r}function It(t,e,n=0){return new Promise((function(i,r){let s,o,a,c,l,h,u,f,d,p,g,v,w,m,y,b,k,A,x,S;function M(t=5){if(e.signal&&e.signal.aborted)throw e.signal.reason;s+=t,e.onProgress(Math.min(s,100))}function z(t){if(e.signal&&e.signal.aborted)throw e.signal.reason;s=Math.min(Math.max(t,s),100),e.onProgress(s)}return s=n,o=e.maxIteration||10,a=1024*e.maxSizeMB*1024,M(),xt(t,e).then(function(n){try{return[,c]=n,M(),l=Ct(c,e),M(),new Promise((function(n,i){var r;if(!(r=e.exifOrientation))return $t(t).then(function(t){try{return r=t,s.call(this)}catch(t){return i(t)}}.bind(this),i);function s(){return n(r)}return s.call(this)})).then(function(n){try{return h=n,M(),zt().then(function(n){try{return u=n?l:Tt(l,h),M(),f=e.initialQuality||1,d=e.fileType||t.type,St(u,d,t.name,t.lastModified,f).then(function(n){try{{if(p=n,M(),g=p.size>a,v=p.size>t.size,!g&&!v)return z(100),i(p);var s;function h(){if(o--&&(y>a||y>w)){let e,n;return e=S?.95*x.width:x.width,n=S?.95*x.height:x.height,[k,A]=bt(e,n),A.drawImage(x,0,0,e,n),f*="image/png"===d?.85:.95,St(k,d,t.name,t.lastModified,f).then((function(t){try{return b=t,Mt(x),x=k,y=b.size,z(Math.min(99,Math.floor((m-y)/(m-a)*100))),h}catch(t){return r(t)}}),r)}return[1]}return w=t.size,m=p.size,y=m,x=u,S=!e.alwaysKeepResolution&&g,(s=function(t){for(;t;){if(t.then)return void t.then(s,r);try{if(t.pop){if(t.length)return t.pop()?$.call(this):t;t=h}else t=t.call(this)}catch(t){return r(t)}}}.bind(this))(h);function $(){return Mt(x),Mt(k),Mt(l),Mt(u),Mt(c),z(100),i(b)}}}catch(C){return r(C)}}.bind(this),r)}catch(t){return r(t)}}.bind(this),r)}catch(t){return r(t)}}.bind(this),r)}catch(t){return r(t)}}.bind(this),r)}))}let jt;function Et(t,e){return new Promise(((n,i)=>{jt||(jt=function(){const t=[];return t.push("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"),URL.createObjectURL(new Blob(t))}());const r=new Worker(jt);r.addEventListener("message",(function(t){if(e.signal&&e.signal.aborted)r.terminate();else if(void 0===t.data.progress){if(t.data.error)return i(new Error(t.data.error)),void r.terminate();n(t.data.file),r.terminate()}else e.onProgress(t.data.progress)})),r.addEventListener("error",i),e.signal&&e.signal.addEventListener("abort",(()=>{i(e.signal.reason),r.terminate()})),r.postMessage({file:t,imageCompressionLibUrl:e.libURL,options:{...e,onProgress:void 0,signal:void 0}})}))}function _t(t,e){return new Promise((function(n,i){let r,s,o,a,c,l;if(r={...e},o=0,({onProgress:a}=r),r.maxSizeMB=r.maxSizeMB||Number.POSITIVE_INFINITY,c="boolean"!=typeof r.useWebWorker||r.useWebWorker,delete r.useWebWorker,r.onProgress=t=>{o=t,"function"==typeof a&&a(o)},!(t instanceof Blob||t instanceof dt))return i(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(t.type))return i(new Error("The file given is not an image"));if(l="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!c||"function"!=typeof Worker||l)return It(t,r).then(function(t){try{return s=t,f.call(this)}catch(t){return i(t)}}.bind(this),i);var h=function(){try{return f.call(this)}catch(t){return i(t)}}.bind(this),u=function(){try{return It(t,r).then((function(t){try{return s=t,h()}catch(t){return i(t)}}),i)}catch(t){return i(t)}};try{return r.libURL=r.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Et(t,r).then((function(t){try{return s=t,h()}catch(t){return u()}}),u)}catch(t){u()}function f(){try{s.name=t.name,s.lastModified=t.lastModified}catch(t){}try{r.preserveExif&&"image/jpeg"===t.type&&(!r.fileType||r.fileType&&r.fileType===t.type)&&(s=et(t,s))}catch(t){}return n(s)}}))}_t.getDataUrlFromFile=vt,_t.getFilefromDataUrl=gt,_t.loadImage=wt,_t.drawImageInCanvas=kt,_t.drawFileInCanvas=xt,_t.canvasToFile=St,_t.getExifOrientation=$t,_t.handleMaxWidthOrHeight=Ct,_t.followExifOrientation=Tt,_t.cleanupCanvasMemory=Mt,_t.isAutoOrientationInBrowser=zt,_t.approximateBelowMaximumCanvasSizeOfBrowser=yt,_t.copyExifWithoutOrientation=et,_t.getBrowserName=mt,_t.version="2.0.2";class Lt extends a{toolType="image";fileInput=null;maxCompressionSize=1200;multiImportOffset=20;constructor(t){super(t),this.setupFileInput()}onActivate(){this.openFilePicker()}openFilePicker(){this._core.store.isDisabled||this.fileInput?.click()}setupFileInput(){this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.accept="image/*",this.fileInput.multiple=!0,this.fileInput.style.display="none",this.fileInput.addEventListener("change",this.handleFileSelect.bind(this)),this.fileInput.addEventListener("cancel",this.handleCancel.bind(this)),document.body.appendChild(this.fileInput)}handleFileSelect(t){const e=t.target,n=e.files?Array.from(e.files):[];if(0===n.length)return console.info("File selection cancelled by user."),this.handleCancel(),void(e&&(e.value=""));const i=n.map((t=>_t(t,{maxWidthOrHeight:this.maxCompressionSize}).then((t=>u.fromBlob(this._core,t)))));Promise.allSettled(i).then((t=>{const e=[];for(const n of t)"fulfilled"===n.status?e.push(n.value):console.error("Error during image compression or processing:",n.reason);0!==e.length?this.addImagesToStore(e):this.handleCancel()})),e&&(e.value="")}addImagesToStore(t){const e=this._core.store.currentZIndex;t.forEach(((t,n)=>{if(t.zIndex=e+n,t.centerInViewport(),n>0){const e=n*this.multiImportOffset;t.updatePosition(t.translateX+e,t.translateY+e)}this._core.addObject(t)})),this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection")),this._core.selectObjects(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded(t)}handleCancel(){this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection"))}}class Ot extends a{toolType="shape";shapeType=f.Rectangle;fillColor={light:"transparent",dark:"transparent"};strokeColor=x[0];strokeWidth=4;opacity=1;fontFamily="Arial";fontSize=16;fontColor=x[0];palette=[...x];sizes=[...c];startX=0;startY=0;isDrawing=!1;currentShape=null;constructor(t){super(t)}handlePointerDown(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType){const e=t.composedPath().slice(1).find((t=>t.classList&&t.classList.contains("object"))),n=this._core.findObjectById(e?.id),i=this._core.store.activeShape;if(null===i&&n instanceof d)return void n.edit(t);if(null!==i&&n instanceof d)return i.save(),void n.edit(t);if(null!==i&&n instanceof d==0)return this._core.resetActiveShape(),void this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection"));if(!1===l.isLeftClick(t))return;this.startDrawing(t.clientX,t.clientY)}if("touch"===t.pointerType||"pen"===t.pointerType){const e=Array.from(this._core.store.state.pointers.values()),n=t.composedPath().slice(1).find((t=>t.classList&&t.classList.contains("object"))),i=this._core.findObjectById(n?.id),r=this._core.store.activeShape;if(null===r&&i instanceof d)return void i.edit(t);if(null!==r&&i instanceof d)return r.save(),void i.edit(t);if(null!==r&&i instanceof d==0)return this._core.resetActiveShape(),void this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection"));if(e.length>1)return;const s=Math.round(e[0].clientX),o=Math.round(e[0].clientY);this.startDrawing(s,o)}}handlePointerMove(t){if(t.cancelable&&t.preventDefault(),this.isDrawing&&this.currentShape&&("mouse"===t.pointerType&&this.updateShapeSize(t.clientX,t.clientY),"touch"===t.pointerType||"pen"===t.pointerType)){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length){const e=Math.round(t[0].clientX),n=Math.round(t[0].clientY);this.updateShapeSize(e,n)}}}handlePointerUp(t){t.cancelable&&t.preventDefault(),this.isDrawing&&this.currentShape&&this.finishDrawing()}startDrawing(t,e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1;this.startX=(t-this._core.store.offsetX)/r,this.startY=(e-this._core.store.offsetY)/r,this.isDrawing=!0,this.currentShape=d.create(this._core,{x:this.startX,y:this.startY,translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,width:1,height:1,shapeType:this.shapeType,fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,opacity:this.opacity,fontSize:this.fontSize,fontFamily:this.fontFamily,scale:i?1:n}),this._core.store.objects.insert(this.currentShape),this._core.store.objects?.setActiveDrawingObject(this.currentShape.id),this._core.rerender()}updateShapeSize(t,e){if(!this.currentShape)return;const n=this._core.store.state.lockDrawingScale?this._core.store.state.scale:1,i=(t-this._core.store.offsetX)/n,r=(e-this._core.store.offsetY)/n,s=Math.min(this.startX,i),o=Math.min(this.startY,r),a=Math.abs(i-this.startX),c=Math.abs(r-this.startY);this.currentShape.x=s,this.currentShape.y=o,this.currentShape.width=Math.max(1,a),this.currentShape.height=Math.max(1,c),this.currentShape.translateX=-this._core.store.state.translateX/n,this.currentShape.translateY=-this._core.store.state.translateY/n,this.currentShape.updateDimensions(),this._core.store.objects.update(this.currentShape)}finishDrawing(){if(this.currentShape){if(this.currentShape.width<10&&this.currentShape.height<10){const t=this.currentShape.id;this._core.store.objects.remove((e=>e.id===t))}else this.currentShape.zIndex=this._core.store.currentZIndex,this._core.store.objects.update(this.currentShape),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([this.currentShape]),this._core.selectObjects([this.currentShape]),this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection"));this.isDrawing=!1,this._core.store.objects?.setActiveDrawingObject(null),this.currentShape=null,this._core.store.objects?.stopUndoCapturing(),this._core.rerender()}}}class Pt{static _pointerCursor=null;static getPointerCursor(){return this._pointerCursor||(this._pointerCursor=this.getCursor({iconName:"pointer"})),this._pointerCursor}static getCursor(t){const e="default"===t.iconName?"mouse-pointer":t.iconName,n=K.get(e);if(!n)return console.warn(`Icon "${e}" not found in registry.`),"auto";const i=t.size||24,r=t.rotation||0,s=t.color||"black",o=t.hotspot||("default"===t.iconName?{x:4,y:4}:{x:i/2,y:i/2});let a=n.replace(/width="\d+"/,`width="${i}"`).replace(/height="\d+"/,`height="${i}"`).replace(/currentColor/g,s);const c=i/2;return`url('data:image/svg+xml;charset=utf-8,${encodeURIComponent(`\n <svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${i}" viewBox="0 0 ${i} ${i}">\n <g transform="rotate(${r} ${c} ${c})">\n ${a}\n </g>\n </svg>\n `.replace(/\s+/g," ").trim()).replace(/'/g,"%27").replace(/"/g,"%22")}') ${o.x} ${o.y}, auto`}}class Bt{_core;_anchorIndex=new Map;constructor(t){this._core=t}setAnchor(t,e,n){const i=this.getLineById(t);if(!i)return;if("start"===e&&i.endAnchor?.objectId===n)return;if("end"===e&&i.startAnchor?.objectId===n)return;this.removeAnchor(t,e);const r={objectId:n};"start"===e?i.startAnchor=r:i.endAnchor=r,this.addToIndex(n,t,e),this.snapEndpointToObject(i,e,n),this._core.store.objects.update(i)}removeAnchor(t,e){const n=this.getLineById(t);if(!n)return;const i="start"===e?n.startAnchor:n.endAnchor;i&&(this.removeFromIndex(i.objectId,t,e),"start"===e?n.startAnchor=void 0:n.endAnchor=void 0)}getAnchor(t,e){const n=this.getLineById(t);return n?("start"===e?n.startAnchor:n.endAnchor)??null:null}getLinesAnchoredTo(t){const e=this._anchorIndex.get(t);return e?Array.from(e):[]}updateAnchorsForObject(t){const e=this.getLinesAnchoredTo(t);if(0===e.length)return;if(!this.getObjectById(t))return;for(const n of e){const e=this.getLineById(n.lineId);e&&this.snapEndpointToObject(e,n.endpoint,t)}const n=this._core.store.selectionGroup;n&&this._core.store.state.isDragging&&n.hasExternalAnchoredLineConnections()&&n.refreshObjectDimensions(void 0,!0)}snapEndpointToObject(t,e,n){const i=this.getObjectById(n);if(!i)return;const r=this.worldToLineLocal(t,i.centerX,i.centerY);t.updateEndpoint(e,r.x,r.y)}worldToLineLocal(t,e,n){const i=e-t.centerX,r=n-t.centerY,s=Math.cos(-t.rotation),o=Math.sin(-t.rotation);return{x:(i*s-r*o+t.totalWidth/2/t.scale)*t.scale+t.x,y:(i*o+r*s+t.totalHeight/2/t.scale)*t.scale+t.y}}findSnapTarget(t,e,n,i,r="mouse"){return this.findBestSnapTarget(t,e,n,i,(n=>{const i=this.getSnapRadius(n,r),s=t-n.centerX,o=e-n.centerY;return Math.sqrt(s*s+o*o)<=i}))}findSnapPreviewTarget(t,e,n,i){return this.findBestSnapTarget(t,e,n,i,(()=>!0))}findBestSnapTarget(t,e,n,i,r){let s=null,o=-1/0;const a=this._core.store.allNonSelectionObjects;for(const c of a){if(c.id===n)continue;if(i&&c.id===i)continue;if(!this.isAnchorable(c))continue;const a=c.rotatedPolygon;O.isPointInPolygon({x:t,y:e},[a.topLeft,a.topRight,a.bottomRight,a.bottomLeft])&&r(c)&&c.zIndex>o&&(o=c.zIndex,s={objectId:c.id,centerX:c.centerX,centerY:c.centerY})}return s}getSnapRadius(t,e){const n=Math.min(t.width,t.height)/5;return"touch"===e||"pen"===e?Math.max(1.75*n,24/this.getSafeScale(this._core.store.state.scale)):n}setSnapCandidate(t){this._core.store.state.snapCandidate=t,this._core.rerender()}setSnapPreviewCandidate(t){this._core.store.state.snapPreviewCandidate=t,this._core.rerender()}getSnapCandidate(){return this._core.store.state.snapCandidate??null}getSnapPreviewCandidate(){return this._core.store.state.snapPreviewCandidate??null}clearSnapCandidate(){this._core.store.state.snapCandidate=null,this._core.rerender()}clearSnapPreviewCandidate(){this._core.store.state.snapPreviewCandidate=null,this._core.rerender()}getAnchorLinesRenderData(){const t=this._core.store.selectionGroup;if(!t||1!==t.objects.length)return null;const e=t.objects[0];if(!p.isInstanceOf(e,"KritzelLine"))return null;const n=e,i=this.computeAnchorVisualization(n,"start"),r=this.computeAnchorVisualization(n,"end"),s=this.isFiniteAnchorVisualization(i)?i:null,o=this.isFiniteAnchorVisualization(r)?r:null;if(!s&&!o)return null;const a=this.getSafeScale(this._core.store.state.scale),c=this.getSafeScale(n.scale),l=n.strokeWidth/c,h=""+2/a,u=Math.max(2*l,4/a),f=`${u} ${u}`,d=8/a;return this.areFiniteNumbers(l,u,d)?{lineStrokeWidth:l,indicatorStrokeWidth:h,dashArray:f,indicatorRadius:d,startAnchorViz:s,endAnchorViz:o}:null}getSnapIndicatorRenderData(){return this.getIndicatorRenderDataForCandidate(this.getSnapCandidate())}getSnapPreviewRenderData(){return this.getIndicatorRenderDataForCandidate(this.getSnapPreviewCandidate())}getIndicatorRenderDataForCandidate(t){if(!t)return null;if(!this.areFiniteNumbers(t.centerX,t.centerY,t.lineEndpointX,t.lineEndpointY))return null;const e=this.getSafeScale(this._core.store.state.scale),n=8/e,i=""+2/e,r=this.areFiniteNumbers(t.lineStrokeWidth)&&t.lineStrokeWidth>0?t.lineStrokeWidth:4/e,s=`${r}`,o=Math.max(2*r,4/e),a=`${o} ${o}`,c=t.lineStroke||"#000000";let l,h=this.areFiniteNumbers(t.edgeX)?t.edgeX:void 0,u=this.areFiniteNumbers(t.edgeY)?t.edgeY:void 0,f=h,d=u;const p=this.areFiniteNumbers(t.arrowOffset)&&t.arrowOffset>0?t.arrowOffset:void 0;if(void 0!==p&&void 0!==h&&void 0!==u){const e=t.lineEndpointX-h,n=t.lineEndpointY-u,i=Math.sqrt(e*e+n*n);i>p&&(f=h+e/i*p,d=u+n/i*p);const r=h-t.lineEndpointX,s=u-t.lineEndpointY,o=Math.sqrt(r*r+s*s);if(o>0){const t=r/o,e=s/o,n=-e,i=h,a=u,c=i-t*p,f=a-e*p,d=c+n*p/2,g=f+t*p/2,v=c-n*p/2,w=f-t*p/2;this.areFiniteNumbers(i,a,d,g,v,w)&&(l=`${i},${a} ${d},${g} ${v},${w}`)}}if(!this.areFiniteNumbers(n,r,o))return null;const g=(()=>{if(void 0!==t.controlX&&void 0!==t.controlY&&void 0!==t.t&&this.areFiniteNumbers(t.controlX,t.controlY,t.t)){const e="start"===t.endpoint?1-t.t:t.t;if(e>=1)return;const n=this.extractQuadraticSegment({x:t.lineEndpointX,y:t.lineEndpointY},{x:t.controlX,y:t.controlY},{x:t.centerX,y:t.centerY},e,1);if(!this.areFiniteNumbers(n.start.x,n.start.y,n.control.x,n.control.y,n.end.x,n.end.y))return;return`M ${n.start.x} ${n.start.y} Q ${n.control.x} ${n.control.y} ${n.end.x} ${n.end.y}`}})();return{indicatorRadius:n,indicatorStrokeWidth:i,lineStrokeWidth:s,dashArray:a,lineStroke:c,centerX:t.centerX,centerY:t.centerY,lineEndpointX:t.lineEndpointX,lineEndpointY:t.lineEndpointY,edgeX:h,edgeY:u,arrowOffset:p,arrowStyle:t.arrowStyle,arrowFill:t.arrowFill,solidLineEndX:f,solidLineEndY:d,arrowPoints:l,snapLinePath:g}}handleObjectDeleted(t){const e=this.getLinesAnchoredTo(t);for(const t of e){this.removeAnchor(t.lineId,t.endpoint);const e=this.getLineById(t.lineId);e&&this._core.store.objects.update(e)}this._anchorIndex.delete(t)}handleLineDeleted(t){const e=this.getLineById(t);e&&(e.startAnchor&&this.removeFromIndex(e.startAnchor.objectId,t,"start"),e.endAnchor&&this.removeFromIndex(e.endAnchor.objectId,t,"end"))}rebuildIndex(){this._anchorIndex.clear();const t=this._core.store.allObjects;for(const e of t)e instanceof L&&(e.startAnchor&&this.addToIndex(e.startAnchor.objectId,e.id,"start"),e.endAnchor&&this.addToIndex(e.endAnchor.objectId,e.id,"end"))}addToIndex(t,e,n){this._anchorIndex.has(t)||this._anchorIndex.set(t,new Set);const i=this._anchorIndex.get(t);for(const t of i)if(t.lineId===e&&t.endpoint===n)return;i.add({lineId:e,endpoint:n})}removeFromIndex(t,e,n){const i=this._anchorIndex.get(t);if(i){for(const t of i)if(t.lineId===e&&t.endpoint===n){i.delete(t);break}0===i.size&&this._anchorIndex.delete(t)}}getLineById(t){const e=this._core.store.objects.filter((e=>e.id===t));if(0===e.length)return null;const n=e[0];return n instanceof L?n:null}getObjectById(t){const e=this._core.store.objects.filter((e=>e.id===t));return e.length>0?e[0]:null}findAnchorTarget(t,e){const n="start"===e?t.startAnchor:t.endAnchor;return n?this._core.store.allNonSelectionObjects.find((t=>t.id===n.objectId))??null:null}computeAnchorVisualization(t,e){if(!("start"===e?t.startAnchor:t.endAnchor))return null;const n=this.findAnchorTarget(t,e);if(!n)return null;const i=this.computeAnchorClipInfo(t,e,n);if(!i)return null;const r=n.centerX,s=n.centerY;if(!this.areFiniteNumbers(i.worldX,i.worldY,r,s))return null;const o=this.buildAnchorPath(t,e,i,n)??void 0;return o&&!this.isFinitePathData(o)?null:{edgeX:i.worldX,edgeY:i.worldY,centerX:r,centerY:s,pathD:o}}computeClippedLinePath(t,e=!1){const n=this.getSnapCandidate(),i=this._core.store.selectionGroup,r=n&&i&&1===i.objects.length&&i.objects[0].id===t.id;if(!t.startAnchor&&!t.endAnchor&&!r)return e?void 0!==t.controlX&&void 0!==t.controlY?`M ${t.startX-t.x} ${t.startY-t.y} Q ${t.controlX-t.x} ${t.controlY-t.y} ${t.endX-t.x} ${t.endY-t.y}`:`M ${t.startX-t.x} ${t.startY-t.y} L ${t.endX-t.x} ${t.endY-t.y}`:t.d;const s=t.startAnchor?this.findAnchorTarget(t,"start"):null,o=t.endAnchor?this.findAnchorTarget(t,"end"):null;let a=s?this.computeAnchorClipInfo(t,"start",s):null,c=o?this.computeAnchorClipInfo(t,"end",o):null;if(r&&void 0!==n.edgeX&&void 0!==n.edgeY){const e=this.lineWorldToLocal(t,n.edgeX,n.edgeY),i={worldX:n.edgeX,worldY:n.edgeY,localX:e.x,localY:e.y,t:n.t};"start"===n.endpoint?a=i:c=i}const l=e?t.x:0,h=e?t.y:0;if(void 0!==t.controlX&&void 0!==t.controlY){let e=a?.t??0,n=c?.t??1;if(a&&t.hasStartArrow){const n=t.getArrowSize("start"),i=this.evaluateDerivativeSpeedAtT(t,e);i>0&&(e+=n/i)}if(c&&t.hasEndArrow){const e=t.getArrowSize("end"),i=this.evaluateDerivativeSpeedAtT(t,n);i>0&&(n-=e/i)}if(e<0&&(e=0),n>1&&(n=1),n<=e){const t=(e+n)/2;e=t,n=t}const i=this.extractQuadraticSegment({x:t.startX,y:t.startY},{x:t.controlX,y:t.controlY},{x:t.endX,y:t.endY},e,n);return`M ${i.start.x-l} ${i.start.y-h} Q ${i.control.x-l} ${i.control.y-h} ${i.end.x-l} ${i.end.y-h}`}let u=a?.localX??t.startX,f=a?.localY??t.startY,d=c?.localX??t.endX,p=c?.localY??t.endY;if(a&&t.hasStartArrow){const e=t.getArrowSize("start"),n=d-u,i=p-f,r=Math.sqrt(n*n+i*i);r>e&&(u+=n/r*e,f+=i/r*e)}if(c&&t.hasEndArrow){const e=t.getArrowSize("end"),n=u-d,i=f-p,r=Math.sqrt(n*n+i*i);r>e&&(d+=n/r*e,p+=i/r*e)}return`M ${u-l} ${f-h} L ${d-l} ${p-h}`}computeAnchorClipInfo(t,e,n){return void 0!==t.controlX&&void 0!==t.controlY?this.computeCurvedClipInfo(t,e,n):this.computeStraightClipInfo(t,e,n)}computeStraightClipInfo(t,e,n){const i="start"===e?this.lineLocalToWorld(t,t.endX,t.endY):this.lineLocalToWorld(t,t.startX,t.startY),r=this.getPathClipPoint(n,i);if(r){const n=this.lineWorldToLocal(t,r.x,r.y),i=Math.sqrt(Math.pow(t.endX-t.startX,2)+Math.pow(t.endY-t.startY,2)),s=Math.sqrt(Math.pow(n.x-t.startX,2)+Math.pow(n.y-t.startY,2));return{localX:n.x,localY:n.y,worldX:r.x,worldY:r.y,t:i>0?s/i:"start"===e?0:1}}const s=this.getClipPolygonForObject(n);let o;if(o=s?O.getLinePointsArrayIntersection(i,{x:n.centerX,y:n.centerY},s):O.getLinePolygonIntersection(i,{x:n.centerX,y:n.centerY},n.rotatedPolygon),!o)return null;const a=this.lineWorldToLocal(t,o.x,o.y),c=Math.sqrt(Math.pow(t.endX-t.startX,2)+Math.pow(t.endY-t.startY,2)),l=Math.sqrt(Math.pow(a.x-t.startX,2)+Math.pow(a.y-t.startY,2));return{localX:a.x,localY:a.y,worldX:o.x,worldY:o.y,t:c>0?l/c:"start"===e?0:1}}computeCurvedClipInfo(t,e,n){if(p.isInstanceOf(n,"KritzelPath"))return this.findCurveExitPointForPath(t,e,n);const i=this.getClipPolygonForObject(n),r=i??this.getPolygonPoints(n.rotatedPolygon),s=this.findCurveExitPoint(t,e,r);if(s)return s;const o="start"===e?this.lineLocalToWorld(t,t.endX,t.endY):this.lineLocalToWorld(t,t.startX,t.startY);let a;if(a=i?O.getLinePointsArrayIntersection(o,{x:n.centerX,y:n.centerY},i):O.getLinePolygonIntersection(o,{x:n.centerX,y:n.centerY},n.rotatedPolygon),!a)return null;const c=this.lineWorldToLocal(t,a.x,a.y),l=this.approximateParameterForWorldPoint(t,a);return{localX:c.x,localY:c.y,worldX:a.x,worldY:a.y,t:l}}findCurveExitPoint(t,e,n){const i="start"===e?0:1,r=this.evaluateLineAtT(t,i);let s=O.isPointInPolygon({x:r.worldX,y:r.worldY},n),o=i;for(let i=1;i<=64;i++){const r="start"===e?i/64:1-i/64,a=this.evaluateLineAtT(t,r),c=O.isPointInPolygon({x:a.worldX,y:a.worldY},n);if(s&&!c){const e=this.refineCurveExitParameter(t,n,o,r),i=this.evaluateLineAtT(t,e);return{localX:i.localX,localY:i.localY,worldX:i.worldX,worldY:i.worldY,t:e}}s=c,o=r}return null}findCurveExitPointForPath(t,e,n){const i="start"===e?0:1,r=n.strokeWidth/n.scale/2,s=this.getPathAdjustedPoints(n);if(s.length<1)return null;const o=this.evaluateLineAtT(t,i);let a=this.isPointInPathStroke(o.worldX,o.worldY,s,r),c=i;for(let n=1;n<=64;n++){const i="start"===e?n/64:1-n/64,o=this.evaluateLineAtT(t,i),l=this.isPointInPathStroke(o.worldX,o.worldY,s,r);if(a&&!l){const e=this.refineCurveExitParameterForPath(t,s,r,c,i),n=this.evaluateLineAtT(t,e);return{localX:n.localX,localY:n.localY,worldX:n.worldX,worldY:n.worldY,t:e}}a=l,c=i}return null}refineCurveExitParameterForPath(t,e,n,i,r){let s=i,o=r;for(let i=0;i<8;i++){const i=(s+o)/2,r=this.evaluateLineAtT(t,i);this.isPointInPathStroke(r.worldX,r.worldY,e,n)?s=i:o=i}return(s+o)/2}getPathAdjustedPoints(t){return this.computePathAdjustedPoints(t)}computePathAdjustedPoints(t){if(!t.points?.length)return[];const e=t.rotation,n=Math.cos(e),i=Math.sin(e),r=t.points.map((t=>t[0])),s=t.points.map((t=>t[1])),o={x:(Math.min(...r)+Math.max(...r))/2,y:(Math.min(...s)+Math.max(...s))/2},{x:a,y:c}=o;return t.points.map((([t,e])=>{const r=t-a,s=e-c;return[a+r*n-s*i,c+r*i+s*n]})).map((([e,n])=>[Math.abs(e-t.x)/t.scale+t.translateX,Math.abs(n-t.y)/t.scale+t.translateY]))}isPointInPathStroke(t,e,n,i){if(1===n.length){const r=n[0],s=t-r[0],o=e-r[1];return Math.sqrt(s*s+o*o)<=i}for(let r=0;r<n.length-1;r++){const s=n[r],o=n[r+1];if(this.pointToSegmentDistance(t,e,s[0],s[1],o[0],o[1])<=i)return!0}return!1}pointToSegmentDistance(t,e,n,i,r,s){const o=r-n,a=s-i,c=o*o+a*a;if(0===c)return Math.sqrt((t-n)*(t-n)+(e-i)*(e-i));let l=((t-n)*o+(e-i)*a)/c;l=Math.max(0,Math.min(1,l));const h=n+l*o,u=i+l*a;return Math.sqrt((t-h)*(t-h)+(e-u)*(e-u))}refineCurveExitParameter(t,e,n,i){let r=n,s=i;for(let n=0;n<8;n++){const n=(r+s)/2,i=this.evaluateLineAtT(t,n);O.isPointInPolygon({x:i.worldX,y:i.worldY},e)?r=n:s=n}return(r+s)/2}approximateParameterForWorldPoint(t,e){let n=0,i=1/0;for(let r=0;r<=80;r++){const s=r/80,o=this.evaluateLineAtT(t,s),a=Math.hypot(o.worldX-e.x,o.worldY-e.y);a<i&&(i=a,n=s)}return n}evaluateLineAtT(t,e){const n=Math.max(0,Math.min(1,e));let i,r;if(void 0!==t.controlX&&void 0!==t.controlY){const e=1-n;i=e*e*t.startX+2*e*n*t.controlX+n*n*t.endX,r=e*e*t.startY+2*e*n*t.controlY+n*n*t.endY}else i=t.startX+(t.endX-t.startX)*n,r=t.startY+(t.endY-t.startY)*n;const s=this.lineLocalToWorld(t,i,r);return{t:n,localX:i,localY:r,worldX:s.x,worldY:s.y}}evaluateDerivativeSpeedAtT(t,e){const n=Math.max(0,Math.min(1,e));if(void 0!==t.controlX&&void 0!==t.controlY){const e=t.controlX,i=t.controlY,r=2*(1-n)*(e-t.startX)+2*n*(t.endX-e),s=2*(1-n)*(i-t.startY)+2*n*(t.endY-i);return Math.sqrt(r*r+s*s)}{const e=t.endX-t.startX,n=t.endY-t.startY;return Math.sqrt(e*e+n*n)}}extractQuadraticSegment(t,e,n,i,r){let s=Math.max(0,Math.min(1,i)),o=Math.max(0,Math.min(1,r));if(o<s){const t=s;s=o,o=t}let a={start:t,control:e,end:n};if(s>0){a=this.splitQuadraticSegment(a,s).right;const t=1-s;o=t>0?(o-s)/t:1}return o<1&&(a=this.splitQuadraticSegment(a,o).left),a}splitQuadraticSegment(t,e){const n=Math.max(0,Math.min(1,e)),i=t.start,r=t.control,s=t.end,o=this.lerpPoint(i,r,n),a=this.lerpPoint(r,s,n),c=this.lerpPoint(o,a,n);return{left:{start:i,control:o,end:c},right:{start:c,control:a,end:s}}}lerpPoint(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}}buildAnchorPath(t,e,n,i){if(void 0===t.controlX||void 0===t.controlY||void 0===n.t)return`M ${n.worldX} ${n.worldY} L ${i.centerX} ${i.centerY}`;const r="start"===e?0:n.t,s="start"===e?n.t:1;if(s<=r)return`M ${n.worldX} ${n.worldY} L ${i.centerX} ${i.centerY}`;const o=this.extractQuadraticSegment({x:t.startX,y:t.startY},{x:t.controlX,y:t.controlY},{x:t.endX,y:t.endY},r,s);return this.buildWorldQuadraticPath(t,o,"start"===e)}buildWorldQuadraticPath(t,e,n=!1){const i=n?e.end:e.start,r=n?e.start:e.end,s=e.control,o=this.lineLocalToWorld(t,i.x,i.y),a=this.lineLocalToWorld(t,s.x,s.y),c=this.lineLocalToWorld(t,r.x,r.y);return`M ${o.x} ${o.y} Q ${a.x} ${a.y} ${c.x} ${c.y}`}getPolygonPoints(t){return[t.topLeft,t.topRight,t.bottomRight,t.bottomLeft]}getClipPolygonForObject(t){return p.isInstanceOf(t,"KritzelShape")?t.getClipPolygon():null}getPathClipPoint(t,e){return p.isInstanceOf(t,"KritzelPath")?t.getClipPoint(e):null}lineLocalToWorld(t,e,n){const i=e-t.x,r=n-t.y,s=t.totalWidth/2,o=t.totalHeight/2,a=Math.cos(t.rotation),c=Math.sin(t.rotation),l=(i-s)*a-(r-o)*c+s,h=(i-s)*c+(r-o)*a+o,u=this.getSafeScale(t.scale);return{x:l/u+t.translateX,y:h/u+t.translateY}}lineWorldToLocal(t,e,n){const i=this.getSafeScale(t.scale),r=(e-t.translateX)*i,s=(n-t.translateY)*i,o=t.totalWidth/2,a=t.totalHeight/2,c=Math.cos(-t.rotation),l=Math.sin(-t.rotation);return{x:(r-o)*c-(s-a)*l+o+t.x,y:(r-o)*l+(s-a)*c+a+t.y}}getSafeScale(t){return Number.isFinite(t)&&Math.abs(t)>1e-6?t:1}areFiniteNumbers(...t){return t.every((t=>void 0!==t&&Number.isFinite(t)))}isFiniteAnchorVisualization(t){return!(!t||!this.areFiniteNumbers(t.edgeX,t.edgeY,t.centerX,t.centerY)||t.pathD&&!this.isFinitePathData(t.pathD))}isFinitePathData(t){return!t.includes("Infinity")&&!t.includes("NaN")}isAnchorable(t){return!(t instanceof g||t instanceof h)&&!(t instanceof L)&&t.isVisible}}class Dt{static interpolate(t,e){return e?t.replace(/\{(\w+)\}/g,((t,n)=>{const i=e[n];return null==i?t:String(i)})):t}}const Rt={code:"en",label:"English",terms:{"menu.copy":"Copy","menu.cut":"Cut","menu.paste":"Paste","menu.selectAll":"Select All","menu.order":"Order","menu.bringToFront":"Bring to Front","menu.sendToBack":"Send to Back","menu.moveUp":"Move Up","menu.moveDown":"Move Down","menu.align":"Align","menu.alignLeft":"Align Left","menu.alignCenterHorizontal":"Align Center Horizontally","menu.alignRight":"Align Right","menu.alignTop":"Align Top","menu.alignCenterVertical":"Align Center Vertically","menu.alignBottom":"Align Bottom","menu.group":"Group","menu.ungroup":"Ungroup","menu.export":"Export","menu.exportAsSvg":"Export as SVG","menu.exportAsPng":"Export as PNG","menu.delete":"Delete","menu.share":"Share","menu.import":"Import","menu.settings":"Settings","menu.logout":"Logout","settings.dialogTitle":"Settings","settings.categories.general":"General","settings.categories.viewport":"Viewport","settings.categories.shortcuts":"Keyboard Shortcuts","settings.categories.developer":"Developer Options","settings.categories.about":"About","settings.general.title":"General Settings","settings.general.theme.label":"Theme","settings.general.theme.description":"Select a registered color theme for the editor interface.","settings.general.language.label":"Language","settings.general.language.description":"Select the display language for the editor interface.","settings.general.lockDrawingScale.label":"Lock Drawing Scale","settings.general.lockDrawingScale.description":"When enabled, drawn objects maintain a fixed visual size regardless of the current zoom level.","settings.viewport.title":"Viewport Settings","settings.viewport.minZoom.label":"Minimum Zoom Level","settings.viewport.minZoom.description":"Sets the minimum zoom level. Lower values allow zooming out further to see more of the canvas.","settings.viewport.maxZoom.label":"Maximum Zoom Level","settings.viewport.maxZoom.description":"Sets the maximum zoom level. Higher values allow zooming in closer for detailed work.","settings.viewport.boundaryLeft.label":"Viewport Boundary Left","settings.viewport.boundaryLeft.description":"Left boundary in world coordinates. Set to limit how far left the viewport can pan.","settings.viewport.boundaryRight.label":"Viewport Boundary Right","settings.viewport.boundaryRight.description":"Right boundary in world coordinates. Set to limit how far right the viewport can pan.","settings.viewport.boundaryTop.label":"Viewport Boundary Top","settings.viewport.boundaryTop.description":"Top boundary in world coordinates. Set to limit how far up the viewport can pan.","settings.viewport.boundaryBottom.label":"Viewport Boundary Bottom","settings.viewport.boundaryBottom.description":"Bottom boundary in world coordinates. Set to limit how far down the viewport can pan.","settings.viewport.boundaryPlaceholder":"Infinite","settings.shortcuts.title":"Keyboard Shortcuts","settings.developer.title":"Developer Options","settings.developer.showViewportInfo.label":"Show Viewport Info","settings.developer.showViewportInfo.description":"Display viewport debug information such as position, zoom level, and boundaries.","settings.developer.showObjectInfo.label":"Show Object Info","settings.developer.showObjectInfo.description":"Display debug information about objects on the canvas.","settings.developer.showSyncProviderInfo.label":"Show Sync Provider Info","settings.developer.showSyncProviderInfo.description":"Display debug information about the sync provider connection status.","settings.developer.showMigrationInfo.label":"Show Migration Info","settings.developer.showMigrationInfo.description":"Display debug information about data migrations.","settings.about.title":"About","settings.about.description":"Kritzel - A drawing application","export.dialogTitle":"Export","export.tabs.viewport":"Export Viewport","export.tabs.workspace":"Export Workspace","export.format.label":"Format","export.filename.label":"Filename","export.filename.placeholder":"Enter filename","export.exportButton":"Export","workspace.sharedTooltip":"Shared workspace","workspace.rename":"Rename","workspace.delete":"Delete","zoom.zoomIn":"Zoom in","zoom.zoomOut":"Zoom out","utility.undo":"Undo","utility.redo":"Redo","utility.delete":"Delete selected items","share.dialogTitle":"Share Workspace","share.linkSharing.label":"Link sharing","share.linkSharing.enabledDescription":"Anyone with the link can access this workspace.","share.linkSharing.disabledDescription":"Link sharing is disabled. Only you can access this workspace.","share.linkSharing.toggleLabel":"Enable link sharing","share.copyLink.title":"Copy link","share.copyLink.copied":"Copied!","login.dialogTitle":"Sign in","currentUser.dialogTitle":"Account","backToContent.label":"Back to content","toolConfig.collapse":"Collapse","toolConfig.expand":"Expand","moreMenu.ariaLabel":"More options","engine.loading":"Loading...","watermark.poweredBy":"Powered by Kritzel"}},Wt={code:"de",label:"Deutsch",terms:{"menu.copy":"Kopieren","menu.cut":"Ausschneiden","menu.paste":"Einfügen","menu.selectAll":"Alles auswählen","menu.order":"Anordnen","menu.bringToFront":"In den Vordergrund","menu.sendToBack":"In den Hintergrund","menu.moveUp":"Nach vorne","menu.moveDown":"Nach hinten","menu.align":"Ausrichten","menu.alignLeft":"Linksbündig ausrichten","menu.alignCenterHorizontal":"Horizontal zentrieren","menu.alignRight":"Rechtsbündig ausrichten","menu.alignTop":"Oben ausrichten","menu.alignCenterVertical":"Vertikal zentrieren","menu.alignBottom":"Unten ausrichten","menu.group":"Gruppieren","menu.ungroup":"Gruppierung aufheben","menu.export":"Exportieren","menu.exportAsSvg":"Als SVG exportieren","menu.exportAsPng":"Als PNG exportieren","menu.delete":"Löschen","menu.share":"Teilen","menu.import":"Importieren","menu.settings":"Einstellungen","menu.logout":"Abmelden","settings.dialogTitle":"Einstellungen","settings.categories.general":"Allgemein","settings.categories.viewport":"Ansichtsfenster","settings.categories.shortcuts":"Tastenkürzel","settings.categories.developer":"Entwickleroptionen","settings.categories.about":"Über","settings.general.title":"Allgemeine Einstellungen","settings.general.theme.label":"Design","settings.general.theme.description":"Wählen Sie ein registriertes Farbdesign für die Editor-Oberfläche.","settings.general.language.label":"Sprache","settings.general.language.description":"Wählen Sie die Anzeigesprache für die Editor-Oberfläche.","settings.general.lockDrawingScale.label":"Zeichenskalierung sperren","settings.general.lockDrawingScale.description":"Wenn aktiviert, behalten gezeichnete Objekte unabhängig von der aktuellen Zoomstufe eine feste visuelle Größe.","settings.viewport.title":"Ansichtsfenster-Einstellungen","settings.viewport.minZoom.label":"Minimale Zoomstufe","settings.viewport.minZoom.description":"Legt die minimale Zoomstufe fest. Niedrigere Werte ermöglichen weiteres Herauszoomen, um mehr von der Zeichenfläche zu sehen.","settings.viewport.maxZoom.label":"Maximale Zoomstufe","settings.viewport.maxZoom.description":"Legt die maximale Zoomstufe fest. Höhere Werte ermöglichen näheres Heranzoomen für Detailarbeit.","settings.viewport.boundaryLeft.label":"Ansichtsfenster-Grenze links","settings.viewport.boundaryLeft.description":"Linke Grenze in Weltkoordinaten. Legen Sie fest, wie weit das Ansichtsfenster nach links verschoben werden kann.","settings.viewport.boundaryRight.label":"Ansichtsfenster-Grenze rechts","settings.viewport.boundaryRight.description":"Rechte Grenze in Weltkoordinaten. Legen Sie fest, wie weit das Ansichtsfenster nach rechts verschoben werden kann.","settings.viewport.boundaryTop.label":"Ansichtsfenster-Grenze oben","settings.viewport.boundaryTop.description":"Obere Grenze in Weltkoordinaten. Legen Sie fest, wie weit das Ansichtsfenster nach oben verschoben werden kann.","settings.viewport.boundaryBottom.label":"Ansichtsfenster-Grenze unten","settings.viewport.boundaryBottom.description":"Untere Grenze in Weltkoordinaten. Legen Sie fest, wie weit das Ansichtsfenster nach unten verschoben werden kann.","settings.viewport.boundaryPlaceholder":"Unendlich","settings.shortcuts.title":"Tastenkürzel","settings.developer.title":"Entwickleroptionen","settings.developer.showViewportInfo.label":"Ansichtsfenster-Infos anzeigen","settings.developer.showViewportInfo.description":"Zeigt Debug-Informationen zum Ansichtsfenster an, z. B. Position, Zoomstufe und Grenzen.","settings.developer.showObjectInfo.label":"Objekt-Infos anzeigen","settings.developer.showObjectInfo.description":"Zeigt Debug-Informationen zu Objekten auf der Zeichenfläche an.","settings.developer.showSyncProviderInfo.label":"Sync-Provider-Infos anzeigen","settings.developer.showSyncProviderInfo.description":"Zeigt Debug-Informationen zum Verbindungsstatus des Sync-Providers an.","settings.developer.showMigrationInfo.label":"Migrations-Infos anzeigen","settings.developer.showMigrationInfo.description":"Zeigt Debug-Informationen zu Datenmigrationen an.","settings.about.title":"Über","settings.about.description":"Kritzel – Eine Zeichenanwendung","export.dialogTitle":"Exportieren","export.tabs.viewport":"Ansichtsfenster exportieren","export.tabs.workspace":"Arbeitsbereich exportieren","export.format.label":"Format","export.filename.label":"Dateiname","export.filename.placeholder":"Dateiname eingeben","export.exportButton":"Exportieren","workspace.sharedTooltip":"Geteilter Arbeitsbereich","workspace.rename":"Umbenennen","workspace.delete":"Löschen","zoom.zoomIn":"Vergrößern","zoom.zoomOut":"Verkleinern","utility.undo":"Rückgängig","utility.redo":"Wiederholen","utility.delete":"Ausgewählte Elemente löschen","share.dialogTitle":"Arbeitsbereich teilen","share.linkSharing.label":"Link-Freigabe","share.linkSharing.enabledDescription":"Jeder mit dem Link kann auf diesen Arbeitsbereich zugreifen.","share.linkSharing.disabledDescription":"Die Link-Freigabe ist deaktiviert. Nur Sie können auf diesen Arbeitsbereich zugreifen.","share.linkSharing.toggleLabel":"Link-Freigabe aktivieren","share.copyLink.title":"Link kopieren","share.copyLink.copied":"Kopiert!","login.dialogTitle":"Anmelden","currentUser.dialogTitle":"Konto","backToContent.label":"Zurück zum Inhalt","toolConfig.collapse":"Einklappen","toolConfig.expand":"Ausklappen","moreMenu.ariaLabel":"Weitere Optionen","engine.loading":"Wird geladen...","watermark.poweredBy":"Bereitgestellt von Kritzel"}},Ut={code:"fr",label:"Français",terms:{"menu.copy":"Copier","menu.cut":"Couper","menu.paste":"Coller","menu.selectAll":"Tout sélectionner","menu.order":"Ordre","menu.bringToFront":"Mettre au premier plan","menu.sendToBack":"Mettre à l'arrière-plan","menu.moveUp":"Avancer","menu.moveDown":"Reculer","menu.align":"Aligner","menu.alignLeft":"Aligner à gauche","menu.alignCenterHorizontal":"Centrer horizontalement","menu.alignRight":"Aligner à droite","menu.alignTop":"Aligner en haut","menu.alignCenterVertical":"Centrer verticalement","menu.alignBottom":"Aligner en bas","menu.group":"Grouper","menu.ungroup":"Dégrouper","menu.export":"Exporter","menu.exportAsSvg":"Exporter en SVG","menu.exportAsPng":"Exporter en PNG","menu.delete":"Supprimer","menu.share":"Partager","menu.import":"Importer","menu.settings":"Paramètres","menu.logout":"Déconnexion","settings.dialogTitle":"Paramètres","settings.categories.general":"Général","settings.categories.viewport":"Fenêtre d'affichage","settings.categories.shortcuts":"Raccourcis clavier","settings.categories.developer":"Options développeur","settings.categories.about":"À propos","settings.general.title":"Paramètres généraux","settings.general.theme.label":"Thème","settings.general.theme.description":"Sélectionnez un thème de couleurs enregistré pour l'interface de l'éditeur.","settings.general.language.label":"Langue","settings.general.language.description":"Sélectionnez la langue d'affichage de l'interface de l'éditeur.","settings.general.lockDrawingScale.label":"Verrouiller l'échelle de dessin","settings.general.lockDrawingScale.description":"Lorsque cette option est activée, les objets dessinés conservent une taille visuelle fixe quel que soit le niveau de zoom actuel.","settings.viewport.title":"Paramètres de la fenêtre d'affichage","settings.viewport.minZoom.label":"Niveau de zoom minimal","settings.viewport.minZoom.description":"Définit le niveau de zoom minimal. Des valeurs plus faibles permettent de dézoomer davantage pour voir une plus grande partie du canevas.","settings.viewport.maxZoom.label":"Niveau de zoom maximal","settings.viewport.maxZoom.description":"Définit le niveau de zoom maximal. Des valeurs plus élevées permettent de zoomer davantage pour un travail détaillé.","settings.viewport.boundaryLeft.label":"Limite gauche de la fenêtre d'affichage","settings.viewport.boundaryLeft.description":"Limite gauche en coordonnées du monde. Définissez jusqu'où la fenêtre d'affichage peut se déplacer vers la gauche.","settings.viewport.boundaryRight.label":"Limite droite de la fenêtre d'affichage","settings.viewport.boundaryRight.description":"Limite droite en coordonnées du monde. Définissez jusqu'où la fenêtre d'affichage peut se déplacer vers la droite.","settings.viewport.boundaryTop.label":"Limite supérieure de la fenêtre d'affichage","settings.viewport.boundaryTop.description":"Limite supérieure en coordonnées du monde. Définissez jusqu'où la fenêtre d'affichage peut se déplacer vers le haut.","settings.viewport.boundaryBottom.label":"Limite inférieure de la fenêtre d'affichage","settings.viewport.boundaryBottom.description":"Limite inférieure en coordonnées du monde. Définissez jusqu'où la fenêtre d'affichage peut se déplacer vers le bas.","settings.viewport.boundaryPlaceholder":"Infini","settings.shortcuts.title":"Raccourcis clavier","settings.developer.title":"Options développeur","settings.developer.showViewportInfo.label":"Afficher les infos de la fenêtre d'affichage","settings.developer.showViewportInfo.description":"Affiche les informations de débogage de la fenêtre d'affichage telles que la position, le niveau de zoom et les limites.","settings.developer.showObjectInfo.label":"Afficher les infos des objets","settings.developer.showObjectInfo.description":"Affiche les informations de débogage des objets sur le canevas.","settings.developer.showSyncProviderInfo.label":"Afficher les infos du fournisseur de synchronisation","settings.developer.showSyncProviderInfo.description":"Affiche les informations de débogage sur l'état de connexion du fournisseur de synchronisation.","settings.developer.showMigrationInfo.label":"Afficher les infos de migration","settings.developer.showMigrationInfo.description":"Affiche les informations de débogage sur les migrations de données.","settings.about.title":"À propos","settings.about.description":"Kritzel - Une application de dessin","export.dialogTitle":"Exporter","export.tabs.viewport":"Exporter la fenêtre d'affichage","export.tabs.workspace":"Exporter l'espace de travail","export.format.label":"Format","export.filename.label":"Nom du fichier","export.filename.placeholder":"Saisir le nom du fichier","export.exportButton":"Exporter","workspace.sharedTooltip":"Espace de travail partagé","workspace.rename":"Renommer","workspace.delete":"Supprimer","zoom.zoomIn":"Zoom avant","zoom.zoomOut":"Zoom arrière","utility.undo":"Annuler","utility.redo":"Rétablir","utility.delete":"Supprimer les éléments sélectionnés","share.dialogTitle":"Partager l'espace de travail","share.linkSharing.label":"Partage par lien","share.linkSharing.enabledDescription":"Toute personne disposant du lien peut accéder à cet espace de travail.","share.linkSharing.disabledDescription":"Le partage par lien est désactivé. Vous seul pouvez accéder à cet espace de travail.","share.linkSharing.toggleLabel":"Activer le partage par lien","share.copyLink.title":"Copier le lien","share.copyLink.copied":"Copié !","login.dialogTitle":"Se connecter","currentUser.dialogTitle":"Compte","backToContent.label":"Retour au contenu","toolConfig.collapse":"Réduire","toolConfig.expand":"Développer","moreMenu.ariaLabel":"Plus d'options","engine.loading":"Chargement...","watermark.poweredBy":"Propulsé par Kritzel"}},Ft="kritzel-settings",Kt="en";class Vt{_core;_storageKey;_builtinLocales=new Map;_customLocales=new Map;_currentLocale=Kt;_fallbackLocale=Kt;constructor(t){this._core=t,this._storageKey=t.editorId?`${Ft}-${t.editorId}`:Ft,this._builtinLocales.set(Rt.code,Rt),this._builtinLocales.set(Wt.code,Wt),this._builtinLocales.set(Ut.code,Ut),this._currentLocale=this.getStoredLocale()}get currentLocale(){return this._currentLocale}get fallbackLocale(){return this._fallbackLocale}setFallbackLocale(t){this._fallbackLocale=t}registerLocales(t){for(const e of t)this._customLocales.set(e.code,e)}setLocale(t){this._currentLocale=t,this._core.rerender()}getAvailableLocales(){return Array.from(new Set([...this._builtinLocales.keys(),...this._customLocales.keys()]))}getAvailableLocaleOptions(){return this.getAvailableLocales().map((t=>({code:t,label:this.getLocaleLabel(t)})))}getLocaleLabel(t){return this._customLocales.get(t)?.label??this._builtinLocales.get(t)?.label??t}translate(t,e){const n=this._customLocales.get(this._currentLocale)?.terms[t]??this._builtinLocales.get(this._currentLocale)?.terms[t]??this._customLocales.get(this._fallbackLocale)?.terms[t]??this._builtinLocales.get(this._fallbackLocale)?.terms[t]??t;return Dt.interpolate(n,e)}getAllTerms(){const t=new Set;for(const e of[...this._builtinLocales.values(),...this._customLocales.values()])for(const n of Object.keys(e.terms))t.add(n);const e={};for(const n of t)e[n]=this.translate(n);return e}getStoredLocale(){if("undefined"==typeof localStorage)return Kt;const t=localStorage.getItem(this._storageKey);if(!t)return Kt;try{const e=JSON.parse(t);if("string"==typeof e?.locale)return e.locale}catch{}return Kt}cleanup(){this._customLocales.clear()}}class Nt{_core;_licenseKey;_isLicensed=!1;_verifiedToken;_validationId=0;_publicKeyPromise;_timer=null;constructor(t){this._core=t}get isLicensed(){return this._isLicensed}validate(t){this._licenseKey=t;const e=++this._validationId;let n;try{n=this.preCheck(t)}catch{return this.commit(!0,e),this._isLicensed}return"rejected"===n.status?(this._verifiedToken=void 0,this.commit(!1,e),this._isLicensed):this._verifiedToken===t?(this.commit(!0,e),this._isLicensed):(this.verifySignature(n.payloadSegment,n.signatureSegment).then((n=>{e===this._validationId&&(n?(this._verifiedToken=t,this.commit(!0,e)):(this._verifiedToken=void 0,this.commit(!1,e)))})).catch((()=>{e===this._validationId&&this.commit(!0,e)})),this._isLicensed)}startPeriodicValidation(){this.stopPeriodicValidation(),this.scheduleNextValidation()}stopPeriodicValidation(){null!==this._timer&&(clearTimeout(this._timer),this._timer=null)}destroy(){this.stopPeriodicValidation()}commit(t,e){e===this._validationId&&t!==this._isLicensed&&(this._isLicensed=t,this._core.rerender())}scheduleNextValidation(){const t=this.getRandomRevalidationDelay();this._timer=setTimeout((()=>{this.validate(this._licenseKey),this.scheduleNextValidation()}),t)}getRandomRevalidationDelay(){return 3e4+Math.floor(30001*Math.random())}preCheck(t){if(null==t)return{status:"rejected"};const e=t.trim();if(0===e.length||!e.startsWith("KRTZL1."))return{status:"rejected"};const n=e.slice(7).split(".");if(2!==n.length||0===n[0].length||0===n[1].length)return{status:"rejected"};const[i,r]=n;let s;try{s=JSON.parse(this.base64UrlToString(i))}catch{return{status:"rejected"}}return null===s||"object"!=typeof s||"number"==typeof s.exp&&1e3*s.exp<=Date.now()?{status:"rejected"}:{status:"pass",payloadSegment:i,signatureSegment:r,claims:s}}async verifySignature(t,e){const n=await this.getPublicKey(),i=this.utf8Bytes(t),r=this.base64UrlToBytes(e);return crypto.subtle.verify("Ed25519",n,r,i)}getPublicKey(){if(!this._publicKeyPromise){const t=this.base64UrlToBytes("I-pYJlxDEjT94rwSaqhXW5Sv__fMKS-JKKnV3pg0PaM");this._publicKeyPromise=Promise.resolve().then((()=>crypto.subtle.importKey("raw",t,{name:"Ed25519"},!1,["verify"]))),this._publicKeyPromise.catch((()=>{this._publicKeyPromise=void 0}))}return this._publicKeyPromise}base64UrlToString(t){return(new TextDecoder).decode(this.base64UrlToBytes(t))}base64UrlToBytes(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e.padEnd(e.length+(4-e.length%4)%4,"="),i=atob(n),r=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)r[t]=i.charCodeAt(t);return r}utf8Bytes(t){const e=(new TextEncoder).encode(t),n=new Uint8Array(new ArrayBuffer(e.length));return n.set(e),n}}var Gt;function Ht(t,e,n,i,r,s){const o=s?.quiet??!0,a=e.get("schemaVersion")??0;if(a>=r)return{migrated:!1,fromVersion:a,toVersion:a};const c=i.filter((t=>t.fromVersion>=a&&t.toVersion<=r)).sort(((t,e)=>t.fromVersion-e.fromVersion));return o||console.log(`[Kritzel] Running ${c.length} migration(s) from v${a} to v${r}`),t.transact((()=>{for(const e of c)o||console.log(`[Kritzel] Migrating v${e.fromVersion} → v${e.toVersion}`),e.migrate(t,n);e.set("schemaVersion",r)}),"migration"),o||console.log(`[Kritzel] Migrations complete. Schema now at v${r}`),{migrated:!0,fromVersion:a,toVersion:r}}!function(t){t.StartHorizontal="start-horizontal",t.CenterHorizontal="center-horizontal",t.EndHorizontal="end-horizontal",t.StartVertical="start-vertical",t.CenterVertical="center-vertical",t.EndVertical="end-vertical"}(Gt||(Gt={}));const Xt=[{fromVersion:1,toVersion:2,migrate(t,e){const n=e.workspaces;n&&n.forEach(((t,e)=>{const i=t?.viewport;if(!i)return;if("centerWorldX"in i)return;const r=i.scale??1,s=i.translateX??0,o=i.translateY??0,a={...t,viewport:{centerWorldX:-s/r||0,centerWorldY:-o/r||0,scale:r}};n.set(e,a)}))}}],Yt=[{fromVersion:1,toVersion:2,migrate(t,e){}}],Qt={providers:[]};var Zt,qt,Jt,te={exports:{}},ee=(Zt||(Zt=1,qt=te,Jt=te.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",i="__lodash_placeholder__",r=32,s=128,o=1/0,a=9007199254740991,c=NaN,l=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",r],["partialRight",64],["rearg",256]],u="[object Arguments]",f="[object Array]",d="[object Boolean]",p="[object Date]",g="[object Error]",v="[object Function]",w="[object GeneratorFunction]",m="[object Map]",y="[object Number]",b="[object Object]",k="[object Promise]",A="[object RegExp]",x="[object Set]",S="[object String]",M="[object Symbol]",z="[object WeakMap]",$="[object ArrayBuffer]",C="[object DataView]",T="[object Float32Array]",I="[object Float64Array]",j="[object Int8Array]",E="[object Int16Array]",_="[object Int32Array]",L="[object Uint8Array]",O="[object Uint8ClampedArray]",P="[object Uint16Array]",B="[object Uint32Array]",D=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,K=RegExp(U.source),V=RegExp(F.source),N=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,Z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/[\\^$.*+?()[\]{}|]/g,J=RegExp(q.source),tt=/^\s+/,et=/\s/,nt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,it=/\{\n\/\* \[wrapped with (.+)\] \*/,rt=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ot=/[()=,{}\[\]\/\s]/,at=/\\(\\)?/g,ct=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,ut=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,pt=/^(?:0|[1-9]\d*)$/,gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,mt="\\ud800-\\udfff",yt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",bt="\\u2700-\\u27bf",kt="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",xt="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Mt="["+mt+"]",zt="["+St+"]",$t="["+yt+"]",Ct="\\d+",Tt="["+bt+"]",It="["+kt+"]",jt="[^"+mt+St+Ct+bt+kt+At+"]",Et="\\ud83c[\\udffb-\\udfff]",_t="[^"+mt+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ot="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+At+"]",Bt="\\u200d",Dt="(?:"+It+"|"+jt+")",Rt="(?:"+Pt+"|"+jt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ft="(?:"+$t+"|"+Et+")?",Kt="["+xt+"]?",Vt=Kt+Ft+"(?:"+Bt+"(?:"+[_t,Lt,Ot].join("|")+")"+Kt+Ft+")*",Nt="(?:"+[Tt,Lt,Ot].join("|")+")"+Vt,Gt="(?:"+[_t+$t+"?",$t,Lt,Ot,Mt].join("|")+")",Ht=RegExp("['’]","g"),Xt=RegExp($t,"g"),Yt=RegExp(Et+"(?="+Et+")|"+Gt+Vt,"g"),Qt=RegExp([Pt+"?"+It+"+"+Wt+"(?="+[zt,Pt,"$"].join("|")+")",Rt+"+"+Ut+"(?="+[zt,Pt+Dt,"$"].join("|")+")",Pt+"?"+Dt+"+"+Wt,Pt+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ct,Nt].join("|"),"g"),Zt=RegExp("["+Bt+mt+yt+xt+"]"),te=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ee=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ne=-1,ie={};ie[T]=ie[I]=ie[j]=ie[E]=ie[_]=ie[L]=ie[O]=ie[P]=ie[B]=!0,ie[u]=ie[f]=ie[$]=ie[d]=ie[C]=ie[p]=ie[g]=ie[v]=ie[m]=ie[y]=ie[b]=ie[A]=ie[x]=ie[S]=ie[z]=!1;var re={};re[u]=re[f]=re[$]=re[C]=re[d]=re[p]=re[T]=re[I]=re[j]=re[E]=re[_]=re[m]=re[y]=re[b]=re[A]=re[x]=re[S]=re[M]=re[L]=re[O]=re[P]=re[B]=!0,re[g]=re[v]=re[z]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},oe=parseFloat,ae=parseInt,ce="object"==typeof X&&X&&X.Object===Object&&X,le="object"==typeof self&&self&&self.Object===Object&&self,he=ce||le||Function("return this")(),ue=Jt&&!Jt.nodeType&&Jt,fe=ue&&qt&&!qt.nodeType&&qt,de=fe&&fe.exports===ue,pe=de&&ce.process,ge=function(){try{return fe&&fe.require&&fe.require("util").types||pe&&pe.binding&&pe.binding("util")}catch(t){}}(),ve=ge&&ge.isArrayBuffer,we=ge&&ge.isDate,me=ge&&ge.isMap,ye=ge&&ge.isRegExp,be=ge&&ge.isSet,ke=ge&&ge.isTypedArray;function Ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,i){for(var r=-1,s=null==t?0:t.length;++r<s;){var o=t[r];e(i,o,n(o),t)}return i}function Se(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t}function Me(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function ze(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(!e(t[n],n,t))return!1;return!0}function $e(t,e){for(var n=-1,i=null==t?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}function Ce(t,e){return!(null==t||!t.length)&&De(t,e,0)>-1}function Te(t,e,n){for(var i=-1,r=null==t?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}function Ie(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}function je(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}function Ee(t,e,n,i){var r=-1,s=null==t?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}function _e(t,e,n,i){var r=null==t?0:t.length;for(i&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}function Le(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}var Oe=Fe("length");function Pe(t,e,n){var i;return n(t,(function(t,n,r){if(e(t,n,r))return i=n,!1})),i}function Be(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}function De(t,e,n){return e==e?function(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}(t,e,n):Be(t,We,n)}function Re(t,e,n,i){for(var r=n-1,s=t.length;++r<s;)if(i(t[r],e))return r;return-1}function We(t){return t!=t}function Ue(t,e){var n=null==t?0:t.length;return n?Ne(t,e)/n:c}function Fe(e){return function(n){return null==n?t:n[e]}}function Ke(e){return function(n){return null==e?t:e[n]}}function Ve(t,e,n,i,r){return r(t,(function(t,r,s){n=i?(i=!1,t):e(n,t,r,s)})),n}function Ne(e,n){for(var i,r=-1,s=e.length;++r<s;){var o=n(e[r]);o!==t&&(i=i===t?o:i+o)}return i}function Ge(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function He(t){return t?t.slice(0,un(t)+1).replace(tt,""):t}function Xe(t){return function(e){return t(e)}}function Ye(t,e){return Ie(e,(function(e){return t[e]}))}function Qe(t,e){return t.has(e)}function Ze(t,e){for(var n=-1,i=t.length;++n<i&&De(e,t[n],0)>-1;);return n}function qe(t,e){for(var n=t.length;n--&&De(e,t[n],0)>-1;);return n}var Je=Ke({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ke({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function en(t){return"\\"+se[t]}function nn(t){return Zt.test(t)}function rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function on(t,e){for(var n=-1,r=t.length,s=0,o=[];++n<r;){var a=t[n];a!==e&&a!==i||(t[n]=i,o[s++]=n)}return o}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function ln(t){return nn(t)?function(t){for(var e=Yt.lastIndex=0;Yt.test(t);)++e;return e}(t):Oe(t)}function hn(t){return nn(t)?function(t){return t.match(Yt)||[]}(t):function(t){return t.split("")}(t)}function un(t){for(var e=t.length;e--&&et.test(t.charAt(e)););return e}var fn=Ke({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),dn=function X(et){var mt,yt=(et=null==et?he:dn.defaults(he.Object(),et,dn.pick(he,ee))).Array,bt=et.Date,kt=et.Error,At=et.Function,xt=et.Math,St=et.Object,Mt=et.RegExp,zt=et.String,$t=et.TypeError,Ct=yt.prototype,Tt=St.prototype,It=et["__core-js_shared__"],jt=At.prototype.toString,Et=Tt.hasOwnProperty,_t=0,Lt=(mt=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||""))?"Symbol(src)_1."+mt:"",Ot=Tt.toString,Pt=jt.call(St),Bt=he._,Dt=Mt("^"+jt.call(Et).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=de?et.Buffer:t,Wt=et.Symbol,Ut=et.Uint8Array,Ft=Rt?Rt.allocUnsafe:t,Kt=sn(St.getPrototypeOf,St),Vt=St.create,Nt=Tt.propertyIsEnumerable,Gt=Ct.splice,Yt=Wt?Wt.isConcatSpreadable:t,Zt=Wt?Wt.iterator:t,qt=Wt?Wt.toStringTag:t,Jt=function(){try{var t=as(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),se=et.clearTimeout!==he.clearTimeout&&et.clearTimeout,ce=bt&&bt.now!==he.Date.now&&bt.now,le=et.setTimeout!==he.setTimeout&&et.setTimeout,ue=xt.ceil,fe=xt.floor,pe=St.getOwnPropertySymbols,ge=Rt?Rt.isBuffer:t,Oe=et.isFinite,Ke=Ct.join,pn=sn(St.keys,St),gn=xt.max,vn=xt.min,wn=bt.now,mn=et.parseInt,yn=xt.random,bn=Ct.reverse,kn=as(et,"DataView"),An=as(et,"Map"),xn=as(et,"Promise"),Sn=as(et,"Set"),Mn=as(et,"WeakMap"),zn=as(St,"create"),$n=Mn&&new Mn,Cn={},Tn=_s(kn),In=_s(An),jn=_s(xn),En=_s(Sn),_n=_s(Mn),Ln=Wt?Wt.prototype:t,On=Ln?Ln.valueOf:t,Pn=Ln?Ln.toString:t;function Bn(t){if(Zo(t)&&!Wo(t)&&!(t instanceof Un)){if(t instanceof Wn)return t;if(Et.call(t,"__wrapped__"))return Ls(t)}return new Wn(t)}var Dn=function(){function e(){}return function(n){if(!Qo(n))return{};if(Vt)return Vt(n);e.prototype=n;var i=new e;return e.prototype=t,i}}();function Rn(){}function Wn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=l,this.__views__=[]}function Fn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Nn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Vn;++e<n;)this.add(t[e])}function Gn(t){var e=this.__data__=new Kn(t);this.size=e.size}function Hn(t,e){var n=Wo(t),i=!n&&Ro(t),r=!n&&!i&&Vo(t),s=!n&&!i&&!r&&sa(t),o=n||i||r||s,a=o?Ge(t.length,zt):[],c=a.length;for(var l in t)!e&&!Et.call(t,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ps(l,c))||a.push(l);return a}function Xn(e){var n=e.length;return n?e[Vi(0,n-1)]:t}function Yn(t,e){return Is(Mr(t),ri(e,0,t.length))}function Qn(t){return Is(Mr(t))}function Zn(e,n,i){(i!==t&&!Po(e[n],i)||i===t&&!(n in e))&&ni(e,n,i)}function qn(e,n,i){var r=e[n];Et.call(e,n)&&Po(r,i)&&(i!==t||n in e)||ni(e,n,i)}function Jn(t,e){for(var n=t.length;n--;)if(Po(t[n][0],e))return n;return-1}function ti(t,e,n,i){return li(t,(function(t,r,s){e(i,t,n(t),s)})),i}function ei(t,e){return t&&zr(e,$a(e),t)}function ni(t,e,n){"__proto__"==e&&Jt?Jt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ii(e,n){for(var i=-1,r=n.length,s=yt(r),o=null==e;++i<r;)s[i]=o?t:Aa(e,n[i]);return s}function ri(e,n,i){return e==e&&(i!==t&&(e=e<=i?e:i),n!==t&&(e=e>=n?e:n)),e}function si(e,n,i,r,s,o){var a,c=1&n,l=2&n,h=4&n;if(i&&(a=s?i(e,r,s,o):i(e)),a!==t)return a;if(!Qo(e))return e;var f=Wo(e);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Et.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!c)return Mr(e,a)}else{var g=hs(e),k=g==v||g==w;if(Vo(e))return yr(e,c);if(g==b||g==u||k&&!s){if(a=l||k?{}:fs(e),!c)return l?function(t,e){return zr(t,ls(t),e)}(e,function(t,e){return t&&zr(e,Ca(e),t)}(a,e)):function(t,e){return zr(t,cs(t),e)}(e,ei(a,e))}else{if(!re[g])return s?e:{};a=function(t,e,n){var i=t.constructor;switch(e){case $:return br(t);case d:case p:return new i(+t);case C:return function(t,e){var n=e?br(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case I:case j:case E:case _:case L:case O:case P:case B:return kr(t,n);case m:return new i;case y:case S:return new i(t);case A:return function(t){var e=new t.constructor(t.source,lt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case x:return new i;case M:return On?St(On.call(t)):{}}}(e,g,c)}}o||(o=new Gn);var z=o.get(e);if(z)return z;o.set(e,a),na(e)?e.forEach((function(t){a.add(si(t,n,i,t,e,o))})):qo(e)&&e.forEach((function(t,r){a.set(r,si(t,n,i,r,e,o))}));var D=f?t:(h?l?ts:Jr:l?Ca:$a)(e);return Se(D||e,(function(t,r){D&&(t=e[r=t]),qn(a,r,si(t,n,i,r,e,o))})),a}function oi(e,n,i){var r=i.length;if(null==e)return!r;for(e=St(e);r--;){var s=i[r],o=e[s];if(o===t&&!(s in e)||!(0,n[s])(o))return!1}return!0}function ai(n,i,r){if("function"!=typeof n)throw new $t(e);return zs((function(){n.apply(t,r)}),i)}function ci(t,e,n,i){var r=-1,s=Ce,o=!0,a=t.length,c=[],l=e.length;if(!a)return c;n&&(e=Ie(e,Xe(n))),i?(s=Te,o=!1):e.length>=200&&(s=Qe,o=!1,e=new Nn(e));t:for(;++r<a;){var h=t[r],u=null==n?h:n(h);if(h=i||0!==h?h:0,o&&u==u){for(var f=l;f--;)if(e[f]===u)continue t;c.push(h)}else s(e,u,i)||c.push(h)}return c}Bn.templateSettings={escape:N,evaluate:G,interpolate:H,variable:"",imports:{_:Bn}},(Bn.prototype=Rn.prototype).constructor=Bn,(Wn.prototype=Dn(Rn.prototype)).constructor=Wn,(Un.prototype=Dn(Rn.prototype)).constructor=Un,Fn.prototype.clear=function(){this.__data__=zn?zn(null):{},this.size=0},Fn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Fn.prototype.get=function(e){var i=this.__data__;if(zn){var r=i[e];return r===n?t:r}return Et.call(i,e)?i[e]:t},Fn.prototype.has=function(e){var n=this.__data__;return zn?n[e]!==t:Et.call(n,e)},Fn.prototype.set=function(e,i){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=zn&&i===t?n:i,this},Kn.prototype.clear=function(){this.__data__=[],this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=Jn(e,t);return!(n<0||(n==e.length-1?e.pop():Gt.call(e,n,1),--this.size,0))},Kn.prototype.get=function(e){var n=this.__data__,i=Jn(n,e);return i<0?t:n[i][1]},Kn.prototype.has=function(t){return Jn(this.__data__,t)>-1},Kn.prototype.set=function(t,e){var n=this.__data__,i=Jn(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Vn.prototype.clear=function(){this.size=0,this.__data__={hash:new Fn,map:new(An||Kn),string:new Fn}},Vn.prototype.delete=function(t){var e=ss(this,t).delete(t);return this.size-=e?1:0,e},Vn.prototype.get=function(t){return ss(this,t).get(t)},Vn.prototype.has=function(t){return ss(this,t).has(t)},Vn.prototype.set=function(t,e){var n=ss(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},Nn.prototype.add=Nn.prototype.push=function(t){return this.__data__.set(t,n),this},Nn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Kn){var i=n.__data__;if(!An||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Vn(i)}return n.set(t,e),this.size=n.size,this};var li=Tr(wi),hi=Tr(mi,!0);function ui(t,e){var n=!0;return li(t,(function(t,i,r){return n=!!e(t,i,r)})),n}function fi(e,n,i){for(var r=-1,s=e.length;++r<s;){var o=e[r],a=n(o);if(null!=a&&(c===t?a==a&&!ra(a):i(a,c)))var c=a,l=o}return l}function di(t,e){var n=[];return li(t,(function(t,i,r){e(t,i,r)&&n.push(t)})),n}function pi(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=ds),r||(r=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?pi(a,e-1,n,i,r):je(r,a):i||(r[r.length]=a)}return r}var gi=Ir(),vi=Ir(!0);function wi(t,e){return t&&gi(t,e,$a)}function mi(t,e){return t&&vi(t,e,$a)}function yi(t,e){return $e(e,(function(e){return Ho(t[e])}))}function bi(e,n){for(var i=0,r=(n=gr(n,e)).length;null!=e&&i<r;)e=e[Es(n[i++])];return i&&i==r?e:t}function ki(t,e,n){var i=e(t);return Wo(t)?i:je(i,n(t))}function Ai(e){return null==e?e===t?"[object Undefined]":"[object Null]":qt&&qt in St(e)?function(e){var n=Et.call(e,qt),i=e[qt];try{e[qt]=t;var r=!0}catch(t){}var s=Ot.call(e);return r&&(n?e[qt]=i:delete e[qt]),s}(e):function(t){return Ot.call(t)}(e)}function xi(t,e){return t>e}function Si(t,e){return null!=t&&Et.call(t,e)}function Mi(t,e){return null!=t&&e in St(t)}function zi(e,n,i){for(var r=i?Te:Ce,s=e[0].length,o=e.length,a=o,c=yt(o),l=1/0,h=[];a--;){var u=e[a];a&&n&&(u=Ie(u,Xe(n))),l=vn(u.length,l),c[a]=!i&&(n||s>=120&&u.length>=120)?new Nn(a&&u):t}u=e[0];var f=-1,d=c[0];t:for(;++f<s&&h.length<l;){var p=u[f],g=n?n(p):p;if(p=i||0!==p?p:0,!(d?Qe(d,g):r(h,g,i))){for(a=o;--a;){var v=c[a];if(!(v?Qe(v,g):r(e[a],g,i)))continue t}d&&d.push(g),h.push(p)}}return h}function $i(e,n,i){var r=null==(e=xs(e,n=gr(n,e)))?e:e[Es(Ns(n))];return null==r?t:Ae(r,e,i)}function Ci(t){return Zo(t)&&Ai(t)==u}function Ti(e,n,i,r,s){return e===n||(null==e||null==n||!Zo(e)&&!Zo(n)?e!=e&&n!=n:function(e,n,i,r,s,o){var a=Wo(e),c=Wo(n),l=a?f:hs(e),h=c?f:hs(n),v=(l=l==u?b:l)==b,w=(h=h==u?b:h)==b,k=l==h;if(k&&Vo(e)){if(!Vo(n))return!1;a=!0,v=!1}if(k&&!v)return o||(o=new Gn),a||sa(e)?Zr(e,n,i,r,s,o):function(t,e,n,i,r,s,o){switch(n){case C:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case $:return!(t.byteLength!=e.byteLength||!s(new Ut(t),new Ut(e)));case d:case p:case y:return Po(+t,+e);case g:return t.name==e.name&&t.message==e.message;case A:case S:return t==e+"";case m:var a=rn;case x:if(a||(a=an),t.size!=e.size&&!(1&i))return!1;var c=o.get(t);if(c)return c==e;i|=2,o.set(t,e);var l=Zr(a(t),a(e),i,r,s,o);return o.delete(t),l;case M:if(On)return On.call(t)==On.call(e)}return!1}(e,n,l,i,r,s,o);if(!(1&i)){var z=v&&Et.call(e,"__wrapped__"),T=w&&Et.call(n,"__wrapped__");if(z||T){var I=z?e.value():e,j=T?n.value():n;return o||(o=new Gn),s(I,j,i,r,o)}}return!!k&&(o||(o=new Gn),function(e,n,i,r,s,o){var a=1&i,c=Jr(e),l=c.length;if(l!=Jr(n).length&&!a)return!1;for(var h=l;h--;){var u=c[h];if(!(a?u in n:Et.call(n,u)))return!1}var f=o.get(e),d=o.get(n);if(f&&d)return f==n&&d==e;var p=!0;o.set(e,n),o.set(n,e);for(var g=a;++h<l;){var v=e[u=c[h]],w=n[u];if(r)var m=a?r(w,v,u,n,e,o):r(v,w,u,e,n,o);if(!(m===t?v===w||s(v,w,i,r,o):m)){p=!1;break}g||(g="constructor"==u)}if(p&&!g){var y=e.constructor,b=n.constructor;y==b||!("constructor"in e)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(p=!1)}return o.delete(e),o.delete(n),p}(e,n,i,r,s,o))}(e,n,i,r,Ti,s))}function Ii(e,n,i,r){var s=i.length,o=s,a=!r;if(null==e)return!o;for(e=St(e);s--;){var c=i[s];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++s<o;){var l=(c=i[s])[0],h=e[l],u=c[1];if(a&&c[2]){if(h===t&&!(l in e))return!1}else{var f=new Gn;if(r)var d=r(h,u,l,e,n,f);if(!(d===t?Ti(u,h,3,r,f):d))return!1}}return!0}function ji(t){return!(!Qo(t)||(e=t,Lt&&Lt in e))&&(Ho(t)?Dt:ft).test(_s(t));var e}function Ei(t){return"function"==typeof t?t:null==t?Ja:"object"==typeof t?Wo(t)?Bi(t[0],t[1]):Pi(t):cc(t)}function _i(t){if(!ys(t))return pn(t);var e=[];for(var n in St(t))Et.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Li(t,e){return t<e}function Oi(t,e){var n=-1,i=Fo(t)?yt(t.length):[];return li(t,(function(t,r,s){i[++n]=e(t,r,s)})),i}function Pi(t){var e=os(t);return 1==e.length&&e[0][2]?ks(e[0][0],e[0][1]):function(n){return n===t||Ii(n,t,e)}}function Bi(e,n){return vs(e)&&bs(n)?ks(Es(e),n):function(i){var r=Aa(i,e);return r===t&&r===n?xa(i,e):Ti(n,r,3)}}function Di(e,n,i,r,s){e!==n&&gi(n,(function(o,a){if(s||(s=new Gn),Qo(o))!function(e,n,i,r,s,o,a){var c=Ss(e,i),l=Ss(n,i),h=a.get(l);if(h)Zn(e,i,h);else{var u=o?o(c,l,i+"",e,n,a):t,f=u===t;if(f){var d=Wo(l),p=!d&&Vo(l),g=!d&&!p&&sa(l);u=l,d||p||g?Wo(c)?u=c:Ko(c)?u=Mr(c):p?(f=!1,u=yr(l,!0)):g?(f=!1,u=kr(l,!0)):u=[]:ta(l)||Ro(l)?(u=c,Ro(c)?u=da(c):Qo(c)&&!Ho(c)||(u=fs(l))):f=!1}f&&(a.set(l,u),s(u,l,r,o,a),a.delete(l)),Zn(e,i,u)}}(e,n,a,i,Di,r,s);else{var c=r?r(Ss(e,a),o,a+"",e,n,s):t;c===t&&(c=o),Zn(e,a,c)}}),Ca)}function Ri(e,n){var i=e.length;if(i)return ps(n+=n<0?i:0,i)?e[n]:t}function Wi(t,e,n){e=e.length?Ie(e,(function(t){return Wo(t)?function(e){return bi(e,1===t.length?t[0]:t)}:t})):[Ja];var i=-1;e=Ie(e,Xe(rs()));var r=Oi(t,(function(t){var n=Ie(e,(function(e){return e(t)}));return{criteria:n,index:++i,value:t}}));return function(t){var e=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var i=-1,r=t.criteria,s=e.criteria,o=r.length,a=n.length;++i<o;){var c=Ar(r[i],s[i]);if(c)return i>=a?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)}));e--;)t[e]=t[e].value;return t}(r)}function Ui(t,e,n){for(var i=-1,r=e.length,s={};++i<r;){var o=e[i],a=bi(t,o);n(a,o)&&Yi(s,gr(o,t),a)}return s}function Fi(t,e,n,i){var r=i?Re:De,s=-1,o=e.length,a=t;for(t===e&&(e=Mr(e)),n&&(a=Ie(t,Xe(n)));++s<o;)for(var c=0,l=e[s],h=n?n(l):l;(c=r(a,h,c,i))>-1;)a!==t&&Gt.call(a,c,1),Gt.call(t,c,1);return t}function Ki(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==s){var s=r;ps(r)?Gt.call(t,r,1):ar(t,r)}}return t}function Vi(t,e){return t+fe(yn()*(e-t+1))}function Ni(t,e){var n="";if(!t||e<1||e>a)return n;do{e%2&&(n+=t),(e=fe(e/2))&&(t+=t)}while(e);return n}function Gi(t,e){return $s(As(t,e,Ja),t+"")}function Hi(t){return Xn(Pa(t))}function Xi(t,e){var n=Pa(t);return Is(n,ri(e,0,n.length))}function Yi(e,n,i,r){if(!Qo(e))return e;for(var s=-1,o=(n=gr(n,e)).length,a=o-1,c=e;null!=c&&++s<o;){var l=Es(n[s]),h=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(s!=a){var u=c[l];(h=r?r(u,l,c):t)===t&&(h=Qo(u)?u:ps(n[s+1])?[]:{})}qn(c,l,h),c=c[l]}return e}var Qi=$n?function(t,e){return $n.set(t,e),t}:Ja,Zi=Jt?function(t,e){return Jt(t,"toString",{configurable:!0,enumerable:!1,value:Qa(e),writable:!0})}:Ja;function qi(t){return Is(Pa(t))}function Ji(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var s=yt(r);++i<r;)s[i]=t[i+e];return s}function tr(t,e){var n;return li(t,(function(t,i,r){return!(n=e(t,i,r))})),!!n}function er(t,e,n){var i=0,r=null==t?i:t.length;if("number"==typeof e&&e==e&&r<=2147483647){for(;i<r;){var s=i+r>>>1,o=t[s];null!==o&&!ra(o)&&(n?o<=e:o<e)?i=s+1:r=s}return r}return nr(t,e,Ja,n)}function nr(e,n,i,r){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(n=i(n))!=n,c=null===n,l=ra(n),h=n===t;s<o;){var u=fe((s+o)/2),f=i(e[u]),d=f!==t,p=null===f,g=f==f,v=ra(f);if(a)var w=r||g;else w=h?g&&(r||d):c?g&&d&&(r||!p):l?g&&d&&!p&&(r||!v):!p&&!v&&(r?f<=n:f<n);w?s=u+1:o=u}return vn(o,4294967294)}function ir(t,e){for(var n=-1,i=t.length,r=0,s=[];++n<i;){var o=t[n],a=e?e(o):o;if(!n||!Po(a,c)){var c=a;s[r++]=0===o?0:o}}return s}function rr(t){return"number"==typeof t?t:ra(t)?c:+t}function sr(t){if("string"==typeof t)return t;if(Wo(t))return Ie(t,sr)+"";if(ra(t))return Pn?Pn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function or(t,e,n){var i=-1,r=Ce,s=t.length,o=!0,a=[],c=a;if(n)o=!1,r=Te;else if(s>=200){var l=e?null:Nr(t);if(l)return an(l);o=!1,r=Qe,c=new Nn}else c=e?[]:a;t:for(;++i<s;){var h=t[i],u=e?e(h):h;if(h=n||0!==h?h:0,o&&u==u){for(var f=c.length;f--;)if(c[f]===u)continue t;e&&c.push(u),a.push(h)}else r(c,u,n)||(c!==a&&c.push(u),a.push(h))}return a}function ar(t,e){var n=-1,i=(e=gr(e,t)).length;if(!i)return!0;for(;++n<i;){var r=Es(e[n]);if("__proto__"===r&&!Et.call(t,"__proto__"))return!1;if(("constructor"===r||"prototype"===r)&&n<i-1)return!1}var s=xs(t,e);return null==s||delete s[Es(Ns(e))]}function cr(t,e,n,i){return Yi(t,e,n(bi(t,e)),i)}function lr(t,e,n,i){for(var r=t.length,s=i?r:-1;(i?s--:++s<r)&&e(t[s],s,t););return n?Ji(t,i?0:s,i?s+1:r):Ji(t,i?s+1:0,i?r:s)}function hr(t,e){var n=t;return n instanceof Un&&(n=n.value()),Ee(e,(function(t,e){return e.func.apply(e.thisArg,je([t],e.args))}),n)}function ur(t,e,n){var i=t.length;if(i<2)return i?or(t[0]):[];for(var r=-1,s=yt(i);++r<i;)for(var o=t[r],a=-1;++a<i;)a!=r&&(s[r]=ci(s[r]||o,t[a],e,n));return or(pi(s,1),e,n)}function fr(e,n,i){for(var r=-1,s=e.length,o=n.length,a={};++r<s;)i(a,e[r],r<o?n[r]:t);return a}function dr(t){return Ko(t)?t:[]}function pr(t){return"function"==typeof t?t:Ja}function gr(t,e){return Wo(t)?t:vs(t,e)?[t]:js(pa(t))}var vr=Gi;function wr(e,n,i){var r=e.length;return i=i===t?r:i,!n&&i>=r?e:Ji(e,n,i)}var mr=se||function(t){return he.clearTimeout(t)};function yr(t,e){if(e)return t.slice();var n=t.length,i=Ft?Ft(n):new t.constructor(n);return t.copy(i),i}function br(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function kr(t,e){var n=e?br(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ar(e,n){if(e!==n){var i=e!==t,r=null===e,s=e==e,o=ra(e),a=n!==t,c=null===n,l=n==n,h=ra(n);if(!c&&!h&&!o&&e>n||o&&a&&l&&!c&&!h||r&&a&&l||!i&&l||!s)return 1;if(!r&&!o&&!h&&e<n||h&&i&&s&&!r&&!o||c&&i&&s||!a&&s||!l)return-1}return 0}function xr(t,e,n,i){for(var r=-1,s=t.length,o=n.length,a=-1,c=e.length,l=gn(s-o,0),h=yt(c+l),u=!i;++a<c;)h[a]=e[a];for(;++r<o;)(u||r<s)&&(h[n[r]]=t[r]);for(;l--;)h[a++]=t[r++];return h}function Sr(t,e,n,i){for(var r=-1,s=t.length,o=-1,a=n.length,c=-1,l=e.length,h=gn(s-a,0),u=yt(h+l),f=!i;++r<h;)u[r]=t[r];for(var d=r;++c<l;)u[d+c]=e[c];for(;++o<a;)(f||r<s)&&(u[d+n[o]]=t[r++]);return u}function Mr(t,e){var n=-1,i=t.length;for(e||(e=yt(i));++n<i;)e[n]=t[n];return e}function zr(e,n,i,r){var s=!i;i||(i={});for(var o=-1,a=n.length;++o<a;){var c=n[o],l=r?r(i[c],e[c],c,i,e):t;l===t&&(l=e[c]),s?ni(i,c,l):qn(i,c,l)}return i}function $r(t,e){return function(n,i){var r=Wo(n)?xe:ti,s=e?e():{};return r(n,t,rs(i,2),s)}}function Cr(e){return Gi((function(n,i){var r=-1,s=i.length,o=s>1?i[s-1]:t,a=s>2?i[2]:t;for(o=e.length>3&&"function"==typeof o?(s--,o):t,a&&gs(i[0],i[1],a)&&(o=s<3?t:o,s=1),n=St(n);++r<s;){var c=i[r];c&&e(n,c,r,o)}return n}))}function Tr(t,e){return function(n,i){if(null==n)return n;if(!Fo(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=St(n);(e?s--:++s<r)&&!1!==i(o[s],s,o););return n}}function Ir(t){return function(e,n,i){for(var r=-1,s=St(e),o=i(e),a=o.length;a--;){var c=o[t?a:++r];if(!1===n(s[c],c,s))break}return e}}function jr(e){return function(n){var i=nn(n=pa(n))?hn(n):t,r=i?i[0]:n.charAt(0),s=i?wr(i,1).join(""):n.slice(1);return r[e]()+s}}function Er(t){return function(e){return Ee(Ha(Ra(e).replace(Ht,"")),t,"")}}function _r(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Dn(t.prototype),i=t.apply(n,e);return Qo(i)?i:n}}function Lr(e){return function(n,i,r){var s=St(n);if(!Fo(n)){var o=rs(i,3);n=$a(n),i=function(t){return o(s[t],t,s)}}var a=e(n,i,r);return a>-1?s[o?n[a]:a]:t}}function Or(n){return qr((function(i){var r=i.length,s=r,o=Wn.prototype.thru;for(n&&i.reverse();s--;){var a=i[s];if("function"!=typeof a)throw new $t(e);if(o&&!c&&"wrapper"==ns(a))var c=new Wn([],!0)}for(s=c?s:r;++s<r;){var l=ns(a=i[s]),h="wrapper"==l?es(a):t;c=h&&ws(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?c[ns(h[0])].apply(c,h[3]):1==a.length&&ws(a)?c[l]():c.thru(a)}return function(){var t=arguments,e=t[0];if(c&&1==t.length&&Wo(e))return c.plant(e).value();for(var n=0,s=r?i[n].apply(this,t):e;++n<r;)s=i[n].call(this,s);return s}}))}function Pr(e,n,i,r,o,a,c,l,h,u){var f=n&s,d=1&n,p=2&n,g=24&n,v=512&n,w=p?t:_r(e);return function s(){for(var m=arguments.length,y=yt(m),b=m;b--;)y[b]=arguments[b];if(g)var k=is(s),A=function(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}(y,k);if(r&&(y=xr(y,r,o,g)),a&&(y=Sr(y,a,c,g)),m-=A,g&&m<u){var x=on(y,k);return Kr(e,n,Pr,s.placeholder,i,y,x,l,h,u-m)}var S=d?i:this,M=p?S[e]:e;return m=y.length,l?y=function(e,n){for(var i=e.length,r=vn(n.length,i),s=Mr(e);r--;){var o=n[r];e[r]=ps(o,i)?s[o]:t}return e}(y,l):v&&m>1&&y.reverse(),f&&h<m&&(y.length=h),this&&this!==he&&this instanceof s&&(M=w||_r(M)),M.apply(S,y)}}function Br(t,e){return function(n,i){return function(t,e,n,i){return wi(t,(function(t,r,s){e(i,n(t),r,s)})),i}(n,t,e(i),{})}}function Dr(e,n){return function(i,r){var s;if(i===t&&r===t)return n;if(i!==t&&(s=i),r!==t){if(s===t)return r;"string"==typeof i||"string"==typeof r?(i=sr(i),r=sr(r)):(i=rr(i),r=rr(r)),s=e(i,r)}return s}}function Rr(t){return qr((function(e){return e=Ie(e,Xe(rs())),Gi((function(n){var i=this;return t(e,(function(t){return Ae(t,i,n)}))}))}))}function Wr(e,n){var i=(n=n===t?" ":sr(n)).length;if(i<2)return i?Ni(n,e):n;var r=Ni(n,ue(e/ln(n)));return nn(n)?wr(hn(r),0,e).join(""):r.slice(0,e)}function Ur(e){return function(n,i,r){return r&&"number"!=typeof r&&gs(n,i,r)&&(i=r=t),n=la(n),i===t?(i=n,n=0):i=la(i),function(t,e,n,i){for(var r=-1,s=gn(ue((e-t)/(n||1)),0),o=yt(s);s--;)o[i?s:++r]=t,t+=n;return o}(n,i,r=r===t?n<i?1:-1:la(r),e)}}function Fr(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=fa(e),n=fa(n)),t(e,n)}}function Kr(e,n,i,s,o,a,c,l,h,u){var f=8&n;n|=f?r:64,4&(n&=~(f?64:r))||(n&=-4);var d=[e,n,o,f?a:t,f?c:t,f?t:a,f?t:c,l,h,u],p=i.apply(t,d);return ws(e)&&Ms(p,d),p.placeholder=s,Cs(p,e,n)}function Vr(t){var e=xt[t];return function(t,n){if(t=fa(t),(n=null==n?0:vn(ha(n),292))&&Oe(t)){var i=(pa(t)+"e").split("e");return+((i=(pa(e(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return e(t)}}var Nr=Sn&&1/an(new Sn([,-0]))[1]==o?function(t){return new Sn(t)}:rc;function Gr(t){return function(e){var n=hs(e);return n==m?rn(e):n==x?cn(e):function(t,e){return Ie(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Hr(n,o,a,c,l,h,u,f){var d=2&o;if(!d&&"function"!=typeof n)throw new $t(e);var p=c?c.length:0;if(p||(o&=-97,c=l=t),u=u===t?u:gn(ha(u),0),f=f===t?f:ha(f),p-=l?l.length:0,64&o){var g=c,v=l;c=l=t}var w=d?t:es(n),m=[n,o,a,c,l,g,v,h,u,f];if(w&&function(t,e){var n=t[1],r=e[1],o=n|r;if(!(o<131||(r==s&&8==n||r==s&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n)))return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var a=e[3];if(a){var c=t[3];t[3]=c?xr(c,a,e[4]):a,t[4]=c?on(t[3],i):e[4]}(a=e[5])&&(t[5]=(c=t[5])?Sr(c,a,e[6]):a,t[6]=c?on(t[5],i):e[6]),(a=e[7])&&(t[7]=a),r&s&&(t[8]=null==t[8]?e[8]:vn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(m,w),n=m[0],o=m[1],a=m[2],c=m[3],l=m[4],!(f=m[9]=m[9]===t?d?0:n.length:gn(m[9]-p,0))&&24&o&&(o&=-25),o&&1!=o)y=8==o||16==o?function(e,n,i){var r=_r(e);return function s(){for(var o=arguments.length,a=yt(o),c=o,l=is(s);c--;)a[c]=arguments[c];var h=o<3&&a[0]!==l&&a[o-1]!==l?[]:on(a,l);return(o-=h.length)<i?Kr(e,n,Pr,s.placeholder,t,a,h,t,t,i-o):Ae(this&&this!==he&&this instanceof s?r:e,this,a)}}(n,o,f):o!=r&&33!=o||l.length?Pr.apply(t,m):function(t,e,n,i){var r=1&e,s=_r(t);return function e(){for(var o=-1,a=arguments.length,c=-1,l=i.length,h=yt(l+a),u=this&&this!==he&&this instanceof e?s:t;++c<l;)h[c]=i[c];for(;a--;)h[c++]=arguments[++o];return Ae(u,r?n:this,h)}}(n,o,a,c);else var y=function(t,e,n){var i=1&e,r=_r(t);return function e(){return(this&&this!==he&&this instanceof e?r:t).apply(i?n:this,arguments)}}(n,o,a);return Cs((w?Qi:Ms)(y,m),n,o)}function Xr(e,n,i,r){return e===t||Po(e,Tt[i])&&!Et.call(r,i)?n:e}function Yr(e,n,i,r,s,o){return Qo(e)&&Qo(n)&&(o.set(n,e),Di(e,n,t,Yr,o),o.delete(n)),e}function Qr(e){return ta(e)?t:e}function Zr(e,n,i,r,s,o){var a=1&i,c=e.length,l=n.length;if(c!=l&&!(a&&l>c))return!1;var h=o.get(e),u=o.get(n);if(h&&u)return h==n&&u==e;var f=-1,d=!0,p=2&i?new Nn:t;for(o.set(e,n),o.set(n,e);++f<c;){var g=e[f],v=n[f];if(r)var w=a?r(v,g,f,n,e,o):r(g,v,f,e,n,o);if(w!==t){if(w)continue;d=!1;break}if(p){if(!Le(n,(function(t,e){if(!Qe(p,e)&&(g===t||s(g,t,i,r,o)))return p.push(e)}))){d=!1;break}}else if(g!==v&&!s(g,v,i,r,o)){d=!1;break}}return o.delete(e),o.delete(n),d}function qr(e){return $s(As(e,t,Ws),e+"")}function Jr(t){return ki(t,$a,cs)}function ts(t){return ki(t,Ca,ls)}var es=$n?function(t){return $n.get(t)}:rc;function ns(t){for(var e=t.name+"",n=Cn[e],i=Et.call(Cn,e)?n.length:0;i--;){var r=n[i],s=r.func;if(null==s||s==t)return r.name}return e}function is(t){return(Et.call(Bn,"placeholder")?Bn:t).placeholder}function rs(){var t=Bn.iteratee||tc;return t=t===tc?Ei:t,arguments.length?t(arguments[0],arguments[1]):t}function ss(t,e){var n,i,r=t.__data__;return("string"==(i=typeof(n=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function os(t){for(var e=$a(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,bs(r)]}return e}function as(e,n){var i=function(e,n){return null==e?t:e[n]}(e,n);return ji(i)?i:t}var cs=pe?function(t){return null==t?[]:(t=St(t),$e(pe(t),(function(e){return Nt.call(t,e)})))}:uc,ls=pe?function(t){for(var e=[];t;)je(e,cs(t)),t=Kt(t);return e}:uc,hs=Ai;function us(t,e,n){for(var i=-1,r=(e=gr(e,t)).length,s=!1;++i<r;){var o=Es(e[i]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++i!=r?s:!!(r=null==t?0:t.length)&&Yo(r)&&ps(o,r)&&(Wo(t)||Ro(t))}function fs(t){return"function"!=typeof t.constructor||ys(t)?{}:Dn(Kt(t))}function ds(t){return Wo(t)||Ro(t)||!!(Yt&&t&&t[Yt])}function ps(t,e){var n=typeof t;return!!(e=null==e?a:e)&&("number"==n||"symbol"!=n&&pt.test(t))&&t>-1&&t%1==0&&t<e}function gs(t,e,n){if(!Qo(n))return!1;var i=typeof e;return!!("number"==i?Fo(n)&&ps(e,n.length):"string"==i&&e in n)&&Po(n[e],t)}function vs(t,e){if(Wo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ra(t))||Q.test(t)||!Y.test(t)||null!=e&&t in St(e)}function ws(t){var e=ns(t),n=Bn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var i=es(n);return!!i&&t===i[0]}(kn&&hs(new kn(new ArrayBuffer(1)))!=C||An&&hs(new An)!=m||xn&&hs(xn.resolve())!=k||Sn&&hs(new Sn)!=x||Mn&&hs(new Mn)!=z)&&(hs=function(e){var n=Ai(e),i=n==b?e.constructor:t,r=i?_s(i):"";if(r)switch(r){case Tn:return C;case In:return m;case jn:return k;case En:return x;case _n:return z}return n});var ms=It?Ho:fc;function ys(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Tt)}function bs(t){return t==t&&!Qo(t)}function ks(e,n){return function(i){return null!=i&&i[e]===n&&(n!==t||e in St(i))}}function As(e,n,i){return n=gn(n===t?e.length-1:n,0),function(){for(var t=arguments,r=-1,s=gn(t.length-n,0),o=yt(s);++r<s;)o[r]=t[n+r];r=-1;for(var a=yt(n+1);++r<n;)a[r]=t[r];return a[n]=i(o),Ae(e,this,a)}}function xs(t,e){return e.length<2?t:bi(t,Ji(e,0,-1))}function Ss(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ms=Ts(Qi),zs=le||function(t,e){return he.setTimeout(t,e)},$s=Ts(Zi);function Cs(t,e,n){var i=e+"";return $s(t,function(t,e){var n=e.length;if(!n)return t;var i=n-1;return e[i]=(n>1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(nt,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Se(h,(function(n){var i="_."+n[0];e&n[1]&&!Ce(t,i)&&t.push(i)})),t.sort()}(function(t){var e=t.match(it);return e?e[1].split(rt):[]}(i),n)))}function Ts(e){var n=0,i=0;return function(){var r=wn(),s=16-(r-i);if(i=r,s>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Is(e,n){var i=-1,r=e.length,s=r-1;for(n=n===t?r:n;++i<n;){var o=Vi(i,s),a=e[o];e[o]=e[i],e[i]=a}return e.length=n,e}var js=function(){var t=Io((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Z,(function(t,n,i,r){e.push(i?r.replace(at,"$1"):n||t)})),e}),(function(t){return 500===e.size&&e.clear(),t})),e=t.cache;return t}();function Es(t){if("string"==typeof t||ra(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function _s(t){if(null!=t){try{return jt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ls(t){if(t instanceof Un)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=Mr(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Os=Gi((function(t,e){return Ko(t)?ci(t,pi(e,1,Ko,!0)):[]})),Ps=Gi((function(e,n){var i=Ns(n);return Ko(i)&&(i=t),Ko(e)?ci(e,pi(n,1,Ko,!0),rs(i,2)):[]})),Bs=Gi((function(e,n){var i=Ns(n);return Ko(i)&&(i=t),Ko(e)?ci(e,pi(n,1,Ko,!0),t,i):[]}));function Ds(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:ha(n);return r<0&&(r=gn(i+r,0)),Be(t,rs(e,3),r)}function Rs(e,n,i){var r=null==e?0:e.length;if(!r)return-1;var s=r-1;return i!==t&&(s=ha(i),s=i<0?gn(r+s,0):vn(s,r-1)),Be(e,rs(n,3),s,!0)}function Ws(t){return null!=t&&t.length?pi(t,1):[]}function Us(e){return e&&e.length?e[0]:t}var Fs=Gi((function(t){var e=Ie(t,dr);return e.length&&e[0]===t[0]?zi(e):[]})),Ks=Gi((function(e){var n=Ns(e),i=Ie(e,dr);return n===Ns(i)?n=t:i.pop(),i.length&&i[0]===e[0]?zi(i,rs(n,2)):[]})),Vs=Gi((function(e){var n=Ns(e),i=Ie(e,dr);return(n="function"==typeof n?n:t)&&i.pop(),i.length&&i[0]===e[0]?zi(i,t,n):[]}));function Ns(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Gs=Gi(Hs);function Hs(t,e){return t&&t.length&&e&&e.length?Fi(t,e):t}var Xs=qr((function(t,e){var n=null==t?0:t.length,i=ii(t,e);return Ki(t,Ie(e,(function(t){return ps(t,n)?+t:t})).sort(Ar)),i}));function Ys(t){return null==t?t:bn.call(t)}var Qs=Gi((function(t){return or(pi(t,1,Ko,!0))})),Zs=Gi((function(e){var n=Ns(e);return Ko(n)&&(n=t),or(pi(e,1,Ko,!0),rs(n,2))})),qs=Gi((function(e){var n=Ns(e);return n="function"==typeof n?n:t,or(pi(e,1,Ko,!0),t,n)}));function Js(t){if(!t||!t.length)return[];var e=0;return t=$e(t,(function(t){if(Ko(t))return e=gn(t.length,e),!0})),Ge(e,(function(e){return Ie(t,Fe(e))}))}function to(e,n){if(!e||!e.length)return[];var i=Js(e);return null==n?i:Ie(i,(function(e){return Ae(n,t,e)}))}var eo=Gi((function(t,e){return Ko(t)?ci(t,e):[]})),no=Gi((function(t){return ur($e(t,Ko))})),io=Gi((function(e){var n=Ns(e);return Ko(n)&&(n=t),ur($e(e,Ko),rs(n,2))})),ro=Gi((function(e){var n=Ns(e);return n="function"==typeof n?n:t,ur($e(e,Ko),t,n)})),so=Gi(Js),oo=Gi((function(e){var n=e.length,i=n>1?e[n-1]:t;return i="function"==typeof i?(e.pop(),i):t,to(e,i)}));function ao(t){var e=Bn(t);return e.__chain__=!0,e}function co(t,e){return e(t)}var lo=qr((function(e){var n=e.length,i=n?e[0]:0,r=this.__wrapped__,s=function(t){return ii(t,e)};return!(n>1||this.__actions__.length)&&r instanceof Un&&ps(i)?((r=r.slice(i,+i+(n?1:0))).__actions__.push({func:co,args:[s],thisArg:t}),new Wn(r,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(s)})),ho=$r((function(t,e,n){Et.call(t,n)?++t[n]:ni(t,n,1)})),uo=Lr(Ds),fo=Lr(Rs);function po(t,e){return(Wo(t)?Se:li)(t,rs(e,3))}function go(t,e){return(Wo(t)?Me:hi)(t,rs(e,3))}var vo=$r((function(t,e,n){Et.call(t,n)?t[n].push(e):ni(t,n,[e])})),wo=Gi((function(t,e,n){var i=-1,r="function"==typeof e,s=Fo(t)?yt(t.length):[];return li(t,(function(t){s[++i]=r?Ae(e,t,n):$i(t,e,n)})),s})),mo=$r((function(t,e,n){ni(t,n,e)}));function yo(t,e){return(Wo(t)?Ie:Oi)(t,rs(e,3))}var bo=$r((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),ko=Gi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&gs(t,e[0],e[1])?e=[]:n>2&&gs(e[0],e[1],e[2])&&(e=[e[0]]),Wi(t,pi(e,1),[])})),Ao=ce||function(){return he.Date.now()};function xo(e,n,i){return n=i?t:n,Hr(e,s,t,t,t,t,n=e&&null==n?e.length:n)}function So(n,i){var r;if("function"!=typeof i)throw new $t(e);return n=ha(n),function(){return--n>0&&(r=i.apply(this,arguments)),n<=1&&(i=t),r}}var Mo=Gi((function(t,e,n){var i=1;if(n.length){var s=on(n,is(Mo));i|=r}return Hr(t,i,e,n,s)})),zo=Gi((function(t,e,n){var i=3;if(n.length){var s=on(n,is(zo));i|=r}return Hr(e,i,t,n,s)}));function $o(n,i,r){var s,o,a,c,l,h,u=0,f=!1,d=!1,p=!0;if("function"!=typeof n)throw new $t(e);function g(e){var i=s,r=o;return s=o=t,u=e,c=n.apply(r,i)}function v(e){var n=e-h;return h===t||n>=i||n<0||d&&e-u>=a}function w(){var t=Ao();if(v(t))return m(t);l=zs(w,function(t){var e=i-(t-h);return d?vn(e,a-(t-u)):e}(t))}function m(e){return l=t,p&&s?g(e):(s=o=t,c)}function y(){var e=Ao(),n=v(e);if(s=arguments,o=this,h=e,n){if(l===t)return function(t){return u=t,l=zs(w,i),f?g(t):c}(h);if(d)return mr(l),l=zs(w,i),g(h)}return l===t&&(l=zs(w,i)),c}return i=fa(i)||0,Qo(r)&&(f=!!r.leading,a=(d="maxWait"in r)?gn(fa(r.maxWait)||0,i):a,p="trailing"in r?!!r.trailing:p),y.cancel=function(){l!==t&&mr(l),u=0,s=h=o=l=t},y.flush=function(){return l===t?c:m(Ao())},y}var Co=Gi((function(t,e){return ai(t,1,e)})),To=Gi((function(t,e,n){return ai(t,fa(e)||0,n)}));function Io(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new $t(e);var i=function(){var e=arguments,r=n?n.apply(this,e):e[0],s=i.cache;if(s.has(r))return s.get(r);var o=t.apply(this,e);return i.cache=s.set(r,o)||s,o};return i.cache=new(Io.Cache||Vn),i}function jo(t){if("function"!=typeof t)throw new $t(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Io.Cache=Vn;var Eo=vr((function(t,e){var n=(e=1==e.length&&Wo(e[0])?Ie(e[0],Xe(rs())):Ie(pi(e,1),Xe(rs()))).length;return Gi((function(i){for(var r=-1,s=vn(i.length,n);++r<s;)i[r]=e[r].call(this,i[r]);return Ae(t,this,i)}))})),_o=Gi((function(e,n){var i=on(n,is(_o));return Hr(e,r,t,n,i)})),Lo=Gi((function(e,n){var i=on(n,is(Lo));return Hr(e,64,t,n,i)})),Oo=qr((function(e,n){return Hr(e,256,t,t,t,n)}));function Po(t,e){return t===e||t!=t&&e!=e}var Bo=Fr(xi),Do=Fr((function(t,e){return t>=e})),Ro=Ci(function(){return arguments}())?Ci:function(t){return Zo(t)&&Et.call(t,"callee")&&!Nt.call(t,"callee")},Wo=yt.isArray,Uo=ve?Xe(ve):function(t){return Zo(t)&&Ai(t)==$};function Fo(t){return null!=t&&Yo(t.length)&&!Ho(t)}function Ko(t){return Zo(t)&&Fo(t)}var Vo=ge||fc,No=we?Xe(we):function(t){return Zo(t)&&Ai(t)==p};function Go(t){if(!Zo(t))return!1;var e=Ai(t);return e==g||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ta(t)}function Ho(t){if(!Qo(t))return!1;var e=Ai(t);return e==v||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Xo(t){return"number"==typeof t&&t==ha(t)}function Yo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Qo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Zo(t){return null!=t&&"object"==typeof t}var qo=me?Xe(me):function(t){return Zo(t)&&hs(t)==m};function Jo(t){return"number"==typeof t||Zo(t)&&Ai(t)==y}function ta(t){if(!Zo(t)||Ai(t)!=b)return!1;var e=Kt(t);if(null===e)return!0;var n=Et.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&jt.call(n)==Pt}var ea=ye?Xe(ye):function(t){return Zo(t)&&Ai(t)==A},na=be?Xe(be):function(t){return Zo(t)&&hs(t)==x};function ia(t){return"string"==typeof t||!Wo(t)&&Zo(t)&&Ai(t)==S}function ra(t){return"symbol"==typeof t||Zo(t)&&Ai(t)==M}var sa=ke?Xe(ke):function(t){return Zo(t)&&Yo(t.length)&&!!ie[Ai(t)]},oa=Fr(Li),aa=Fr((function(t,e){return t<=e}));function ca(t){if(!t)return[];if(Fo(t))return ia(t)?hn(t):Mr(t);if(Zt&&t[Zt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Zt]());var e=hs(t);return(e==m?rn:e==x?an:Pa)(t)}function la(t){return t?(t=fa(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ha(t){var e=la(t),n=e%1;return e==e?n?e-n:e:0}function ua(t){return t?ri(ha(t),0,l):0}function fa(t){if("number"==typeof t)return t;if(ra(t))return c;if(Qo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=He(t);var n=ut.test(t);return n||dt.test(t)?ae(t.slice(2),n?2:8):ht.test(t)?c:+t}function da(t){return zr(t,Ca(t))}function pa(t){return null==t?"":sr(t)}var ga=Cr((function(t,e){if(ys(e)||Fo(e))zr(e,$a(e),t);else for(var n in e)Et.call(e,n)&&qn(t,n,e[n])})),va=Cr((function(t,e){zr(e,Ca(e),t)})),wa=Cr((function(t,e,n,i){zr(e,Ca(e),t,i)})),ma=Cr((function(t,e,n,i){zr(e,$a(e),t,i)})),ya=qr(ii),ba=Gi((function(e,n){e=St(e);var i=-1,r=n.length,s=r>2?n[2]:t;for(s&&gs(n[0],n[1],s)&&(r=1);++i<r;)for(var o=n[i],a=Ca(o),c=-1,l=a.length;++c<l;){var h=a[c],u=e[h];(u===t||Po(u,Tt[h])&&!Et.call(e,h))&&(e[h]=o[h])}return e})),ka=Gi((function(e){return e.push(t,Yr),Ae(Ia,t,e)}));function Aa(e,n,i){var r=null==e?t:bi(e,n);return r===t?i:r}function xa(t,e){return null!=t&&us(t,e,Mi)}var Sa=Br((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ot.call(e)),t[e]=n}),Qa(Ja)),Ma=Br((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ot.call(e)),Et.call(t,e)?t[e].push(n):t[e]=[n]}),rs),za=Gi($i);function $a(t){return Fo(t)?Hn(t):_i(t)}function Ca(t){return Fo(t)?Hn(t,!0):function(t){if(!Qo(t))return function(t){var e=[];if(null!=t)for(var n in St(t))e.push(n);return e}(t);var e=ys(t),n=[];for(var i in t)("constructor"!=i||!e&&Et.call(t,i))&&n.push(i);return n}(t)}var Ta=Cr((function(t,e,n){Di(t,e,n)})),Ia=Cr((function(t,e,n,i){Di(t,e,n,i)})),ja=qr((function(t,e){var n={};if(null==t)return n;var i=!1;e=Ie(e,(function(e){return e=gr(e,t),i||(i=e.length>1),e})),zr(t,ts(t),n),i&&(n=si(n,7,Qr));for(var r=e.length;r--;)ar(n,e[r]);return n})),Ea=qr((function(t,e){return null==t?{}:function(t,e){return Ui(t,e,(function(e,n){return xa(t,n)}))}(t,e)}));function _a(t,e){if(null==t)return{};var n=Ie(ts(t),(function(t){return[t]}));return e=rs(e),Ui(t,n,(function(t,n){return e(t,n[0])}))}var La=Gr($a),Oa=Gr(Ca);function Pa(t){return null==t?[]:Ye(t,$a(t))}var Ba=Er((function(t,e,n){return e=e.toLowerCase(),t+(n?Da(e):e)}));function Da(t){return Ga(pa(t).toLowerCase())}function Ra(t){return(t=pa(t))&&t.replace(gt,Je).replace(Xt,"")}var Wa=Er((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ua=Er((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Fa=jr("toLowerCase"),Ka=Er((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Va=Er((function(t,e,n){return t+(n?" ":"")+Ga(e)})),Na=Er((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ga=jr("toUpperCase");function Ha(e,n,i){return e=pa(e),(n=i?t:n)===t?function(t){return te.test(t)}(e)?function(t){return t.match(Qt)||[]}(e):function(t){return t.match(st)||[]}(e):e.match(n)||[]}var Xa=Gi((function(e,n){try{return Ae(e,t,n)}catch(t){return Go(t)?t:new kt(t)}})),Ya=qr((function(t,e){return Se(e,(function(e){e=Es(e),ni(t,e,Mo(t[e],t))})),t}));function Qa(t){return function(){return t}}var Za=Or(),qa=Or(!0);function Ja(t){return t}function tc(t){return Ei("function"==typeof t?t:si(t,1))}var ec=Gi((function(t,e){return function(n){return $i(n,t,e)}})),nc=Gi((function(t,e){return function(n){return $i(t,n,e)}}));function ic(t,e,n){var i=$a(e),r=yi(e,i);null!=n||Qo(e)&&(r.length||!i.length)||(n=e,e=t,t=this,r=yi(e,$a(e)));var s=!(Qo(n)&&"chain"in n&&!n.chain),o=Ho(t);return Se(r,(function(n){var i=e[n];t[n]=i,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__);return(n.__actions__=Mr(this.__actions__)).push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,je([this.value()],arguments))})})),t}function rc(){}var sc=Rr(Ie),oc=Rr(ze),ac=Rr(Le);function cc(t){return vs(t)?Fe(Es(t)):function(t){return function(e){return bi(e,t)}}(t)}var lc=Ur(),hc=Ur(!0);function uc(){return[]}function fc(){return!1}var dc,pc=Dr((function(t,e){return t+e}),0),gc=Vr("ceil"),vc=Dr((function(t,e){return t/e}),1),wc=Vr("floor"),mc=Dr((function(t,e){return t*e}),1),yc=Vr("round"),bc=Dr((function(t,e){return t-e}),0);return Bn.after=function(t,n){if("function"!=typeof n)throw new $t(e);return t=ha(t),function(){if(--t<1)return n.apply(this,arguments)}},Bn.ary=xo,Bn.assign=ga,Bn.assignIn=va,Bn.assignInWith=wa,Bn.assignWith=ma,Bn.at=ya,Bn.before=So,Bn.bind=Mo,Bn.bindAll=Ya,Bn.bindKey=zo,Bn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wo(t)?t:[t]},Bn.chain=ao,Bn.chunk=function(e,n,i){n=(i?gs(e,n,i):n===t)?1:gn(ha(n),0);var r=null==e?0:e.length;if(!r||n<1)return[];for(var s=0,o=0,a=yt(ue(r/n));s<r;)a[o++]=Ji(e,s,s+=n);return a},Bn.compact=function(t){for(var e=-1,n=null==t?0:t.length,i=0,r=[];++e<n;){var s=t[e];s&&(r[i++]=s)}return r},Bn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=yt(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return je(Wo(n)?Mr(n):[n],pi(e,1))},Bn.cond=function(t){var n=null==t?0:t.length,i=rs();return t=n?Ie(t,(function(t){if("function"!=typeof t[1])throw new $t(e);return[i(t[0]),t[1]]})):[],Gi((function(e){for(var i=-1;++i<n;){var r=t[i];if(Ae(r[0],this,e))return Ae(r[1],this,e)}}))},Bn.conforms=function(t){return function(t){var e=$a(t);return function(n){return oi(n,t,e)}}(si(t,1))},Bn.constant=Qa,Bn.countBy=ho,Bn.create=function(t,e){var n=Dn(t);return null==e?n:ei(n,e)},Bn.curry=function e(n,i,r){var s=Hr(n,8,t,t,t,t,t,i=r?t:i);return s.placeholder=e.placeholder,s},Bn.curryRight=function e(n,i,r){var s=Hr(n,16,t,t,t,t,t,i=r?t:i);return s.placeholder=e.placeholder,s},Bn.debounce=$o,Bn.defaults=ba,Bn.defaultsDeep=ka,Bn.defer=Co,Bn.delay=To,Bn.difference=Os,Bn.differenceBy=Ps,Bn.differenceWith=Bs,Bn.drop=function(e,n,i){var r=null==e?0:e.length;return r?Ji(e,(n=i||n===t?1:ha(n))<0?0:n,r):[]},Bn.dropRight=function(e,n,i){var r=null==e?0:e.length;return r?Ji(e,0,(n=r-(n=i||n===t?1:ha(n)))<0?0:n):[]},Bn.dropRightWhile=function(t,e){return t&&t.length?lr(t,rs(e,3),!0,!0):[]},Bn.dropWhile=function(t,e){return t&&t.length?lr(t,rs(e,3),!0):[]},Bn.fill=function(e,n,i,r){var s=null==e?0:e.length;return s?(i&&"number"!=typeof i&&gs(e,n,i)&&(i=0,r=s),function(e,n,i,r){var s=e.length;for((i=ha(i))<0&&(i=-i>s?0:s+i),(r=r===t||r>s?s:ha(r))<0&&(r+=s),r=i>r?0:ua(r);i<r;)e[i++]=n;return e}(e,n,i,r)):[]},Bn.filter=function(t,e){return(Wo(t)?$e:di)(t,rs(e,3))},Bn.flatMap=function(t,e){return pi(yo(t,e),1)},Bn.flatMapDeep=function(t,e){return pi(yo(t,e),o)},Bn.flatMapDepth=function(e,n,i){return i=i===t?1:ha(i),pi(yo(e,n),i)},Bn.flatten=Ws,Bn.flattenDeep=function(t){return null!=t&&t.length?pi(t,o):[]},Bn.flattenDepth=function(e,n){return null!=e&&e.length?pi(e,n=n===t?1:ha(n)):[]},Bn.flip=function(t){return Hr(t,512)},Bn.flow=Za,Bn.flowRight=qa,Bn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,i={};++e<n;){var r=t[e];ni(i,r[0],r[1])}return i},Bn.functions=function(t){return null==t?[]:yi(t,$a(t))},Bn.functionsIn=function(t){return null==t?[]:yi(t,Ca(t))},Bn.groupBy=vo,Bn.initial=function(t){return null!=t&&t.length?Ji(t,0,-1):[]},Bn.intersection=Fs,Bn.intersectionBy=Ks,Bn.intersectionWith=Vs,Bn.invert=Sa,Bn.invertBy=Ma,Bn.invokeMap=wo,Bn.iteratee=tc,Bn.keyBy=mo,Bn.keys=$a,Bn.keysIn=Ca,Bn.map=yo,Bn.mapKeys=function(t,e){var n={};return e=rs(e,3),wi(t,(function(t,i,r){ni(n,e(t,i,r),t)})),n},Bn.mapValues=function(t,e){var n={};return e=rs(e,3),wi(t,(function(t,i,r){ni(n,i,e(t,i,r))})),n},Bn.matches=function(t){return Pi(si(t,1))},Bn.matchesProperty=function(t,e){return Bi(t,si(e,1))},Bn.memoize=Io,Bn.merge=Ta,Bn.mergeWith=Ia,Bn.method=ec,Bn.methodOf=nc,Bn.mixin=ic,Bn.negate=jo,Bn.nthArg=function(t){return t=ha(t),Gi((function(e){return Ri(e,t)}))},Bn.omit=ja,Bn.omitBy=function(t,e){return _a(t,jo(rs(e)))},Bn.once=function(t){return So(2,t)},Bn.orderBy=function(e,n,i,r){return null==e?[]:(Wo(n)||(n=null==n?[]:[n]),Wo(i=r?t:i)||(i=null==i?[]:[i]),Wi(e,n,i))},Bn.over=sc,Bn.overArgs=Eo,Bn.overEvery=oc,Bn.overSome=ac,Bn.partial=_o,Bn.partialRight=Lo,Bn.partition=bo,Bn.pick=Ea,Bn.pickBy=_a,Bn.property=cc,Bn.propertyOf=function(e){return function(n){return null==e?t:bi(e,n)}},Bn.pull=Gs,Bn.pullAll=Hs,Bn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Fi(t,e,rs(n,2)):t},Bn.pullAllWith=function(e,n,i){return e&&e.length&&n&&n.length?Fi(e,n,t,i):e},Bn.pullAt=Xs,Bn.range=lc,Bn.rangeRight=hc,Bn.rearg=Oo,Bn.reject=function(t,e){return(Wo(t)?$e:di)(t,jo(rs(e,3)))},Bn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var i=-1,r=[],s=t.length;for(e=rs(e,3);++i<s;){var o=t[i];e(o,i,t)&&(n.push(o),r.push(i))}return Ki(t,r),n},Bn.rest=function(n,i){if("function"!=typeof n)throw new $t(e);return Gi(n,i=i===t?i:ha(i))},Bn.reverse=Ys,Bn.sampleSize=function(e,n,i){return n=(i?gs(e,n,i):n===t)?1:ha(n),(Wo(e)?Yn:Xi)(e,n)},Bn.set=function(t,e,n){return null==t?t:Yi(t,e,n)},Bn.setWith=function(e,n,i,r){return r="function"==typeof r?r:t,null==e?e:Yi(e,n,i,r)},Bn.shuffle=function(t){return(Wo(t)?Qn:qi)(t)},Bn.slice=function(e,n,i){var r=null==e?0:e.length;return r?(i&&"number"!=typeof i&&gs(e,n,i)?(n=0,i=r):(n=null==n?0:ha(n),i=i===t?r:ha(i)),Ji(e,n,i)):[]},Bn.sortBy=ko,Bn.sortedUniq=function(t){return t&&t.length?ir(t):[]},Bn.sortedUniqBy=function(t,e){return t&&t.length?ir(t,rs(e,2)):[]},Bn.split=function(e,n,i){return i&&"number"!=typeof i&&gs(e,n,i)&&(n=i=t),(i=i===t?l:i>>>0)?(e=pa(e))&&("string"==typeof n||null!=n&&!ea(n))&&!(n=sr(n))&&nn(e)?wr(hn(e),0,i):e.split(n,i):[]},Bn.spread=function(t,n){if("function"!=typeof t)throw new $t(e);return n=null==n?0:gn(ha(n),0),Gi((function(e){var i=e[n],r=wr(e,0,n);return i&&je(r,i),Ae(t,this,r)}))},Bn.tail=function(t){var e=null==t?0:t.length;return e?Ji(t,1,e):[]},Bn.take=function(e,n,i){return e&&e.length?Ji(e,0,(n=i||n===t?1:ha(n))<0?0:n):[]},Bn.takeRight=function(e,n,i){var r=null==e?0:e.length;return r?Ji(e,(n=r-(n=i||n===t?1:ha(n)))<0?0:n,r):[]},Bn.takeRightWhile=function(t,e){return t&&t.length?lr(t,rs(e,3),!1,!0):[]},Bn.takeWhile=function(t,e){return t&&t.length?lr(t,rs(e,3)):[]},Bn.tap=function(t,e){return e(t),t},Bn.throttle=function(t,n,i){var r=!0,s=!0;if("function"!=typeof t)throw new $t(e);return Qo(i)&&(r="leading"in i?!!i.leading:r,s="trailing"in i?!!i.trailing:s),$o(t,n,{leading:r,maxWait:n,trailing:s})},Bn.thru=co,Bn.toArray=ca,Bn.toPairs=La,Bn.toPairsIn=Oa,Bn.toPath=function(t){return Wo(t)?Ie(t,Es):ra(t)?[t]:Mr(js(pa(t)))},Bn.toPlainObject=da,Bn.transform=function(t,e,n){var i=Wo(t),r=i||Vo(t)||sa(t);if(e=rs(e,4),null==n){var s=t&&t.constructor;n=r?i?new s:[]:Qo(t)&&Ho(s)?Dn(Kt(t)):{}}return(r?Se:wi)(t,(function(t,i,r){return e(n,t,i,r)})),n},Bn.unary=function(t){return xo(t,1)},Bn.union=Qs,Bn.unionBy=Zs,Bn.unionWith=qs,Bn.uniq=function(t){return t&&t.length?or(t):[]},Bn.uniqBy=function(t,e){return t&&t.length?or(t,rs(e,2)):[]},Bn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?or(e,t,n):[]},Bn.unset=function(t,e){return null==t||ar(t,e)},Bn.unzip=Js,Bn.unzipWith=to,Bn.update=function(t,e,n){return null==t?t:cr(t,e,pr(n))},Bn.updateWith=function(e,n,i,r){return r="function"==typeof r?r:t,null==e?e:cr(e,n,pr(i),r)},Bn.values=Pa,Bn.valuesIn=function(t){return null==t?[]:Ye(t,Ca(t))},Bn.without=eo,Bn.words=Ha,Bn.wrap=function(t,e){return _o(pr(e),t)},Bn.xor=no,Bn.xorBy=io,Bn.xorWith=ro,Bn.zip=so,Bn.zipObject=function(t,e){return fr(t||[],e||[],qn)},Bn.zipObjectDeep=function(t,e){return fr(t||[],e||[],Yi)},Bn.zipWith=oo,Bn.entries=La,Bn.entriesIn=Oa,Bn.extend=va,Bn.extendWith=wa,ic(Bn,Bn),Bn.add=pc,Bn.attempt=Xa,Bn.camelCase=Ba,Bn.capitalize=Da,Bn.ceil=gc,Bn.clamp=function(e,n,i){return i===t&&(i=n,n=t),i!==t&&(i=(i=fa(i))==i?i:0),n!==t&&(n=(n=fa(n))==n?n:0),ri(fa(e),n,i)},Bn.clone=function(t){return si(t,4)},Bn.cloneDeep=function(t){return si(t,5)},Bn.cloneDeepWith=function(e,n){return si(e,5,n="function"==typeof n?n:t)},Bn.cloneWith=function(e,n){return si(e,4,n="function"==typeof n?n:t)},Bn.conformsTo=function(t,e){return null==e||oi(t,e,$a(e))},Bn.deburr=Ra,Bn.defaultTo=function(t,e){return null==t||t!=t?e:t},Bn.divide=vc,Bn.endsWith=function(e,n,i){e=pa(e),n=sr(n);var r=e.length,s=i=i===t?r:ri(ha(i),0,r);return(i-=n.length)>=0&&e.slice(i,s)==n},Bn.eq=Po,Bn.escape=function(t){return(t=pa(t))&&V.test(t)?t.replace(F,tn):t},Bn.escapeRegExp=function(t){return(t=pa(t))&&J.test(t)?t.replace(q,"\\$&"):t},Bn.every=function(e,n,i){var r=Wo(e)?ze:ui;return i&&gs(e,n,i)&&(n=t),r(e,rs(n,3))},Bn.find=uo,Bn.findIndex=Ds,Bn.findKey=function(t,e){return Pe(t,rs(e,3),wi)},Bn.findLast=fo,Bn.findLastIndex=Rs,Bn.findLastKey=function(t,e){return Pe(t,rs(e,3),mi)},Bn.floor=wc,Bn.forEach=po,Bn.forEachRight=go,Bn.forIn=function(t,e){return null==t?t:gi(t,rs(e,3),Ca)},Bn.forInRight=function(t,e){return null==t?t:vi(t,rs(e,3),Ca)},Bn.forOwn=function(t,e){return t&&wi(t,rs(e,3))},Bn.forOwnRight=function(t,e){return t&&mi(t,rs(e,3))},Bn.get=Aa,Bn.gt=Bo,Bn.gte=Do,Bn.has=function(t,e){return null!=t&&us(t,e,Si)},Bn.hasIn=xa,Bn.head=Us,Bn.identity=Ja,Bn.includes=function(t,e,n,i){t=Fo(t)?t:Pa(t),n=n&&!i?ha(n):0;var r=t.length;return n<0&&(n=gn(r+n,0)),ia(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&De(t,e,n)>-1},Bn.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:ha(n);return r<0&&(r=gn(i+r,0)),De(t,e,r)},Bn.inRange=function(e,n,i){return n=la(n),i===t?(i=n,n=0):i=la(i),function(t,e,n){return t>=vn(e,n)&&t<gn(e,n)}(e=fa(e),n,i)},Bn.invoke=za,Bn.isArguments=Ro,Bn.isArray=Wo,Bn.isArrayBuffer=Uo,Bn.isArrayLike=Fo,Bn.isArrayLikeObject=Ko,Bn.isBoolean=function(t){return!0===t||!1===t||Zo(t)&&Ai(t)==d},Bn.isBuffer=Vo,Bn.isDate=No,Bn.isElement=function(t){return Zo(t)&&1===t.nodeType&&!ta(t)},Bn.isEmpty=function(t){if(null==t)return!0;if(Fo(t)&&(Wo(t)||"string"==typeof t||"function"==typeof t.splice||Vo(t)||sa(t)||Ro(t)))return!t.length;var e=hs(t);if(e==m||e==x)return!t.size;if(ys(t))return!_i(t).length;for(var n in t)if(Et.call(t,n))return!1;return!0},Bn.isEqual=function(t,e){return Ti(t,e)},Bn.isEqualWith=function(e,n,i){var r=(i="function"==typeof i?i:t)?i(e,n):t;return r===t?Ti(e,n,t,i):!!r},Bn.isError=Go,Bn.isFinite=function(t){return"number"==typeof t&&Oe(t)},Bn.isFunction=Ho,Bn.isInteger=Xo,Bn.isLength=Yo,Bn.isMap=qo,Bn.isMatch=function(t,e){return t===e||Ii(t,e,os(e))},Bn.isMatchWith=function(e,n,i){return i="function"==typeof i?i:t,Ii(e,n,os(n),i)},Bn.isNaN=function(t){return Jo(t)&&t!=+t},Bn.isNative=function(t){if(ms(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return ji(t)},Bn.isNil=function(t){return null==t},Bn.isNull=function(t){return null===t},Bn.isNumber=Jo,Bn.isObject=Qo,Bn.isObjectLike=Zo,Bn.isPlainObject=ta,Bn.isRegExp=ea,Bn.isSafeInteger=function(t){return Xo(t)&&t>=-9007199254740991&&t<=a},Bn.isSet=na,Bn.isString=ia,Bn.isSymbol=ra,Bn.isTypedArray=sa,Bn.isUndefined=function(e){return e===t},Bn.isWeakMap=function(t){return Zo(t)&&hs(t)==z},Bn.isWeakSet=function(t){return Zo(t)&&"[object WeakSet]"==Ai(t)},Bn.join=function(t,e){return null==t?"":Ke.call(t,e)},Bn.kebabCase=Wa,Bn.last=Ns,Bn.lastIndexOf=function(e,n,i){var r=null==e?0:e.length;if(!r)return-1;var s=r;return i!==t&&(s=(s=ha(i))<0?gn(r+s,0):vn(s,r-1)),n==n?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(e,n,s):Be(e,We,s,!0)},Bn.lowerCase=Ua,Bn.lowerFirst=Fa,Bn.lt=oa,Bn.lte=aa,Bn.max=function(e){return e&&e.length?fi(e,Ja,xi):t},Bn.maxBy=function(e,n){return e&&e.length?fi(e,rs(n,2),xi):t},Bn.mean=function(t){return Ue(t,Ja)},Bn.meanBy=function(t,e){return Ue(t,rs(e,2))},Bn.min=function(e){return e&&e.length?fi(e,Ja,Li):t},Bn.minBy=function(e,n){return e&&e.length?fi(e,rs(n,2),Li):t},Bn.stubArray=uc,Bn.stubFalse=fc,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=mc,Bn.nth=function(e,n){return e&&e.length?Ri(e,ha(n)):t},Bn.noConflict=function(){return he._===this&&(he._=Bt),this},Bn.noop=rc,Bn.now=Ao,Bn.pad=function(t,e,n){t=pa(t);var i=(e=ha(e))?ln(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Wr(fe(r),n)+t+Wr(ue(r),n)},Bn.padEnd=function(t,e,n){t=pa(t);var i=(e=ha(e))?ln(t):0;return e&&i<e?t+Wr(e-i,n):t},Bn.padStart=function(t,e,n){t=pa(t);var i=(e=ha(e))?ln(t):0;return e&&i<e?Wr(e-i,n)+t:t},Bn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),mn(pa(t).replace(tt,""),e||0)},Bn.random=function(e,n,i){if(i&&"boolean"!=typeof i&&gs(e,n,i)&&(n=i=t),i===t&&("boolean"==typeof n?(i=n,n=t):"boolean"==typeof e&&(i=e,e=t)),e===t&&n===t?(e=0,n=1):(e=la(e),n===t?(n=e,e=0):n=la(n)),e>n){var r=e;e=n,n=r}if(i||e%1||n%1){var s=yn();return vn(e+s*(n-e+oe("1e-"+((s+"").length-1))),n)}return Vi(e,n)},Bn.reduce=function(t,e,n){var i=Wo(t)?Ee:Ve,r=arguments.length<3;return i(t,rs(e,4),n,r,li)},Bn.reduceRight=function(t,e,n){var i=Wo(t)?_e:Ve,r=arguments.length<3;return i(t,rs(e,4),n,r,hi)},Bn.repeat=function(e,n,i){return n=(i?gs(e,n,i):n===t)?1:ha(n),Ni(pa(e),n)},Bn.replace=function(){var t=arguments,e=pa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Bn.result=function(e,n,i){var r=-1,s=(n=gr(n,e)).length;for(s||(s=1,e=t);++r<s;){var o=null==e?t:e[Es(n[r])];o===t&&(r=s,o=i),e=Ho(o)?o.call(e):o}return e},Bn.round=yc,Bn.runInContext=X,Bn.sample=function(t){return(Wo(t)?Xn:Hi)(t)},Bn.size=function(t){if(null==t)return 0;if(Fo(t))return ia(t)?ln(t):t.length;var e=hs(t);return e==m||e==x?t.size:_i(t).length},Bn.snakeCase=Ka,Bn.some=function(e,n,i){var r=Wo(e)?Le:tr;return i&&gs(e,n,i)&&(n=t),r(e,rs(n,3))},Bn.sortedIndex=function(t,e){return er(t,e)},Bn.sortedIndexBy=function(t,e,n){return nr(t,e,rs(n,2))},Bn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var i=er(t,e);if(i<n&&Po(t[i],e))return i}return-1},Bn.sortedLastIndex=function(t,e){return er(t,e,!0)},Bn.sortedLastIndexBy=function(t,e,n){return nr(t,e,rs(n,2),!0)},Bn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=er(t,e,!0)-1;if(Po(t[n],e))return n}return-1},Bn.startCase=Va,Bn.startsWith=function(t,e,n){return t=pa(t),n=null==n?0:ri(ha(n),0,t.length),e=sr(e),t.slice(n,n+e.length)==e},Bn.subtract=bc,Bn.sum=function(t){return t&&t.length?Ne(t,Ja):0},Bn.sumBy=function(t,e){return t&&t.length?Ne(t,rs(e,2)):0},Bn.template=function(e,n,i){var r=Bn.templateSettings;i&&gs(e,n,i)&&(n=t),e=pa(e),n=ma({},n,r,Xr);var s=ma({},n.imports,r.imports,Xr),o=$a(s),a=Ye(s,o);Se(o,(function(t){if(ot.test(t))throw new kt("Invalid `imports` option passed into `_.template`")}));var c,l,h=0,u=n.interpolate||vt,f="__p += '",d=Mt((n.escape||vt).source+"|"+u.source+"|"+(u===H?ct:vt).source+"|"+(n.evaluate||vt).source+"|$","g"),p="//# sourceURL="+(Et.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ne+"]")+"\n";e.replace(d,(function(t,n,i,r,s,o){return i||(i=r),f+=e.slice(h,o).replace(wt,en),n&&(c=!0,f+="' +\n__e("+n+") +\n'"),s&&(l=!0,f+="';\n"+s+";\n__p += '"),i&&(f+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),h=o+t.length,t})),f+="';\n";var g=Et.call(n,"variable")&&n.variable;if(g){if(ot.test(g))throw new kt("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(l?f.replace(D,""):f).replace(R,"$1").replace(W,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(c?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Xa((function(){return At(o,p+"return "+f).apply(t,a)}));if(v.source=f,Go(v))throw v;return v},Bn.times=function(t,e){if((t=ha(t))<1||t>a)return[];var n=l,i=vn(t,l);e=rs(e),t-=l;for(var r=Ge(i,e);++n<t;)e(n);return r},Bn.toFinite=la,Bn.toInteger=ha,Bn.toLength=ua,Bn.toLower=function(t){return pa(t).toLowerCase()},Bn.toNumber=fa,Bn.toSafeInteger=function(t){return t?ri(ha(t),-9007199254740991,a):0===t?t:0},Bn.toString=pa,Bn.toUpper=function(t){return pa(t).toUpperCase()},Bn.trim=function(e,n,i){if((e=pa(e))&&(i||n===t))return He(e);if(!e||!(n=sr(n)))return e;var r=hn(e),s=hn(n);return wr(r,Ze(r,s),qe(r,s)+1).join("")},Bn.trimEnd=function(e,n,i){if((e=pa(e))&&(i||n===t))return e.slice(0,un(e)+1);if(!e||!(n=sr(n)))return e;var r=hn(e);return wr(r,0,qe(r,hn(n))+1).join("")},Bn.trimStart=function(e,n,i){if((e=pa(e))&&(i||n===t))return e.replace(tt,"");if(!e||!(n=sr(n)))return e;var r=hn(e);return wr(r,Ze(r,hn(n))).join("")},Bn.truncate=function(e,n){var i=30,r="...";if(Qo(n)){var s="separator"in n?n.separator:s;i="length"in n?ha(n.length):i,r="omission"in n?sr(n.omission):r}var o=(e=pa(e)).length;if(nn(e)){var a=hn(e);o=a.length}if(i>=o)return e;var c=i-ln(r);if(c<1)return r;var l=a?wr(a,0,c).join(""):e.slice(0,c);if(s===t)return l+r;if(a&&(c+=l.length-c),ea(s)){if(e.slice(c).search(s)){var h,u=l;for(s.global||(s=Mt(s.source,pa(lt.exec(s))+"g")),s.lastIndex=0;h=s.exec(u);)var f=h.index;l=l.slice(0,f===t?c:f)}}else if(e.indexOf(sr(s),c)!=c){var d=l.lastIndexOf(s);d>-1&&(l=l.slice(0,d))}return l+r},Bn.unescape=function(t){return(t=pa(t))&&K.test(t)?t.replace(U,fn):t},Bn.uniqueId=function(t){var e=++_t;return pa(t)+e},Bn.upperCase=Na,Bn.upperFirst=Ga,Bn.each=po,Bn.eachRight=go,Bn.first=Us,ic(Bn,(dc={},wi(Bn,(function(t,e){Et.call(Bn.prototype,e)||(dc[e]=t)})),dc),{chain:!1}),Bn.VERSION="4.18.1",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Bn[t].placeholder=Bn})),Se(["drop","take"],(function(e,n){Un.prototype[e]=function(i){i=i===t?1:gn(ha(i),0);var r=this.__filtered__&&!n?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=vn(i,r.__takeCount__):r.__views__.push({size:vn(i,l),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Se(["filter","map","takeWhile"],(function(t,e){var n=e+1,i=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:rs(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}})),Se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),Se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(Ja)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Gi((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return $i(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(jo(rs(t)))},Un.prototype.slice=function(e,n){e=ha(e);var i=this;return i.__filtered__&&(e>0||n<0)?new Un(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),n!==t&&(i=(n=ha(n))<0?i.dropRight(-n):i.take(n-e)),i)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(l)},wi(Un.prototype,(function(e,n){var i=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),s=Bn[r?"take"+("last"==n?"Right":""):n],o=r||/^find/.test(n);s&&(Bn.prototype[n]=function(){var n=this.__wrapped__,a=r?[1]:arguments,c=n instanceof Un,l=a[0],h=c||Wo(n),u=function(t){var e=s.apply(Bn,je([t],a));return r&&f?e[0]:e};h&&i&&"function"==typeof l&&1!=l.length&&(c=h=!1);var f=this.__chain__,d=o&&!f,p=c&&!this.__actions__.length;if(!o&&h){n=p?n:new Un(this);var g=e.apply(n,a);return g.__actions__.push({func:co,args:[u],thisArg:t}),new Wn(g,f)}return d&&p?e.apply(this,a):(g=this.thru(u),d?r?g.value()[0]:g.value():g)})})),Se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Bn.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Wo(r)?r:[],t)}return this[n]((function(n){return e.apply(Wo(n)?n:[],t)}))}})),wi(Un.prototype,(function(t,e){var n=Bn[e];if(n){var i=n.name+"";Et.call(Cn,i)||(Cn[i]=[]),Cn[i].push({name:e,func:n})}})),Cn[Pr(t,2).name]=[{name:"wrapper",func:t}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=Mr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Mr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Mr(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Wo(t),i=e<0,r=n?t.length:0,s=function(t,e,n){for(var i=-1,r=n.length;++i<r;){var s=n[i],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=vn(e,t+o);break;case"takeRight":t=gn(t,e-o)}}return{start:t,end:e}}(0,r,this.__views__),o=s.start,a=s.end,c=a-o,l=i?a:o-1,h=this.__iteratees__,u=h.length,f=0,d=vn(c,this.__takeCount__);if(!n||!i&&r==c&&d==c)return hr(t,this.__actions__);var p=[];t:for(;c--&&f<d;){for(var g=-1,v=t[l+=e];++g<u;){var w=h[g],m=w.type,y=(0,w.iteratee)(v);if(2==m)v=y;else if(!y){if(1==m)continue t;break t}}p[f++]=v}return p},Bn.prototype.at=lo,Bn.prototype.chain=function(){return ao(this)},Bn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},Bn.prototype.next=function(){this.__values__===t&&(this.__values__=ca(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Bn.prototype.plant=function(e){for(var n,i=this;i instanceof Rn;){var r=Ls(i);r.__index__=0,r.__values__=t,n?s.__wrapped__=r:n=r;var s=r;i=i.__wrapped__}return s.__wrapped__=e,n},Bn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var n=e;return this.__actions__.length&&(n=new Un(this)),(n=n.reverse()).__actions__.push({func:co,args:[Ys],thisArg:t}),new Wn(n,this.__chain__)}return this.thru(Ys)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return hr(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Zt&&(Bn.prototype[Zt]=function(){return this}),Bn}();fe?((fe.exports=dn)._=dn,ue._=dn):he._=dn}.call(te.exports)),te.exports);
1
+ import{p as t,H as e,c as n,h as i,d as r,t as s}from"./p-B43upypT.js";import{K as o}from"./p-D8W6LE-c.js";import{d as a,D as c,l,i as h,a as u,S as f,c as d,m as p,j as g,n as v,f as w,e as m,b as y,K as b,g as k,k as A}from"./p-CPnjRgkl.js";import{D as x,K as S,a as M}from"./p-CpzicliK.js";import{A as z,a as $,d as C}from"./p-CC0J_kEP.js";import{K as T,W as I}from"./p-DhMlShij.js";import{K as j,c as E,a as _,b as L,d as O}from"./p-BNu3Akp5.js";import{K as P}from"./p-WUdQqYnu.js";import{K as B,d as D}from"./p-BxpKq94F.js";import{O as R}from"./p-Dd-pMvlr.js";import*as W from"yjs";import{a as U,C as F}from"./p-CW-VyJgK.js";import{K,d as V}from"./p-CdR76C4L.js";import{K as N}from"./p-jGOpkGDl.js";import{d as G}from"./p-B4WfPDj0.js";import{d as H}from"./p-B4b6TDxp.js";var X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};const Y="__kritzelCustomElementRendererRegistry__";class Q{static get _renderers(){return(()=>{const t=globalThis,e=t[Y];if(e)return e;const n={renderers:new Map};return t[Y]=n,n})().renderers}static register(t,e){this._renderers.set(t,e)}static get(t){return this._renderers.get(t)}static unregister(t){return this._renderers.delete(t)}}class Z extends j{__class__="KritzelCustomElement";element;rendererKey=null;rendererData;constructor(t){super(),t&&(this.translateX=t.translateX||0,this.translateY=t.translateY||0,this.rotation=E.degreesToRadians(t.rotation??0),this.scale=t.scale||1,this.element=t.element??this.createPlaceholder(),this.height=t.height||0,this.width=t.width||0,this.rendererKey=t.rendererKey??null,this.rendererData=t.rendererData)}static create(t,e){const n=new Z(e);return n._core=t,n.id=n.generateId(),n.workspaceId=t.store.state.activeWorkspace.id,n.userId=t.user?.id,n.zIndex=t.store.currentZIndex,n}mount(t){if(null!==t){if(this.applyInteractiveState(),this.isMounted&&this.elementRef===t){if(this.rendererKey)return;if(this.element.parentElement===t)return}if(this.elementRef=t,this.isMounted=!0,this.rendererKey){const e=Q.get(this.rendererKey);if(e)return t.innerHTML="",e.onMount({object:this,container:t,data:this.rendererData}),void this.applyInteractiveState()}this.elementRef.innerHTML="",this.elementRef.appendChild(this.element),this.applyInteractiveState()}}setIsInteractive(t){const e=this.isInteractive!==t;this.isInteractive=t,this.applyInteractiveState(),e&&!t&&this.blurFocusedDescendant()}applyInteractiveState(){const t=this.isInteractive?"auto":"none",e=this.isInteractive?"auto":"";this.element&&(this.element.style.pointerEvents=t,this.element.style.cursor=e),this.elementRef instanceof HTMLElement&&(this.elementRef.style.pointerEvents="auto",this.elementRef.style.cursor="",Array.from(this.elementRef.children).forEach((n=>{n instanceof HTMLElement&&(n.style.pointerEvents=t,n.style.cursor=e)})))}blurFocusedDescendant(){if(!(this.element||this.elementRef instanceof HTMLElement))return;const t=this.getDeepActiveElement(),e=!!this.element&&this.isNodeInsideHost(t,this.element),n=this.elementRef instanceof HTMLElement&&this.isNodeInsideHost(t,this.elementRef);t&&(e||n)&&t.blur()}hasFocusedInputElement(){if(!this.isInteractive)return!1;const t=this.getFocusHosts();if(t.some((t=>this.hasFocusedInputDescendant(t))))return!0;const e=this.getDeepActiveElement();return!!(e&&this.isInputLikeElement(e)&&t.some((t=>this.isNodeInsideHost(e,t))))}getFocusHosts(){const t=[];if(this.element&&t.push(this.element),this.elementRef instanceof HTMLElement){t.push(this.elementRef);const e=this.elementRef.firstElementChild;e instanceof HTMLElement&&t.push(e)}return t}hasFocusedInputDescendant(t){if(this.isInputLikeElement(t)&&this.matchesFocus(t))return!0;if("function"==typeof t.matches)try{if(!t.matches(":focus-within"))return!1}catch{}return null!==this.findFocusedInputLikeElement(t)}findFocusedInputLikeElement(t){let e=null;try{e=t.querySelector(":focus")}catch{e=null}return e instanceof HTMLElement?this.isInputLikeElement(e)?e:e.shadowRoot?this.findFocusedInputLikeElement(e.shadowRoot):null:null}matchesFocus(t){if("function"!=typeof t.matches)return!1;try{return t.matches(":focus")}catch{return!1}}isInputLikeElement(t){const e=t.tagName;return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e||t.isContentEditable}isNodeInsideHost(t,e){if(!t)return!1;let n=t;for(;n;){if(n===e)return!0;if(n.parentNode){n=n.parentNode;continue}const t=n.getRootNode();if(!(t instanceof ShadowRoot))break;n=t.host}return!1}getDeepActiveElement(t=document){const e=t.activeElement;return e instanceof HTMLElement?e.shadowRoot?this.getDeepActiveElement(e.shadowRoot)??e:e:null}unmount(){if(this.isMounted&&this.elementRef){if(this.rendererKey){const t=Q.get(this.rendererKey);if(t){const e=t.onUnmount({object:this,container:this.elementRef,data:this.rendererData});void 0!==e&&(this.rendererData=e)}}this.isMounted=!1,this.elementRef=null}}isElementScrollable(){return!!P.findScrollableElement(this.element)}createPlaceholder(){const t=document.createElement("div");return t.textContent="[Custom Element]",t.style.border="1px dashed #ccc",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.backgroundColor="#f9f9f9",t.style.color="#999",t.style.fontSize="12px",t}resize(t,e,n,i){n<=1||i<=1||(this.width=n,this.height=i,this.translateX=t,this.translateY=e,this.element&&(this.element.style.width=`${n}px`,this.element.style.height=`${i}px`),this._core.store.objects.update(this))}copy(){const t=Object.create(Object.getPrototypeOf(this));return Object.assign(t,this),t.id=this.generateId(),t.isMounted=!1,t.isSelected=!1,t.isHovered=!1,t.isInteractive=!1,t.resizing=!1,t.markedForRemoval=!1,t.isVisible=!0,t.element=this.element.cloneNode(!0),t}serialize(){const{_core:t,_elementRef:e,element:n,totalWidth:i,totalHeight:r,isSelected:s,isHovered:o,isMounted:a,isInteractive:c,resizing:l,markedForRemoval:h,isVisible:u,...f}=this,d=structuredClone(f);return d.rendererKey=this.rendererKey,d.rendererData=this.rendererData,d.htmlString=n?n.outerHTML:"",d.serializedWidth=this.width,d.serializedHeight=this.height,d}deserialize(t){if(super.deserialize(t),delete this.allowEmbeddedInteraction,this.rendererKey=t.rendererKey??null,this.rendererData=t.rendererData,t.htmlString)try{const e=document.createElement("div");e.innerHTML=t.htmlString,this.element=e.firstElementChild||this.createPlaceholder()}catch{this.element=this.createPlaceholder()}else this.element=this.createPlaceholder();return this}}class q extends a{toolType="brush";color=x[0];size=6;opacity=1;palette=[...x];sizes=[...c];static MIN_POINT_DISTANCE_PX=3;_currentPathId=null;shouldAppendPoint(t,e,n,i){const r=t.points;if(!r||0===r.length)return!0;const s=r[r.length-1],o=e-s[0],a=n-s[1],c=q.MIN_POINT_DISTANCE_PX/i;return o*o+a*a>=c*c}constructor(t){super(t)}handlePointerDown(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&l.isLeftClick(t)){this._core.store.state.isDrawing=!0;const e=this._core.store.state.scale,n=this._core.store.state.lockDrawingScale,i=n?e:1,r=_.create(this._core,{points:[[(t.clientX-this._core.store.offsetX)/i,(t.clientY-this._core.store.offsetY)/i]],translateX:-this._core.store.state.translateX/i,translateY:-this._core.store.state.translateY/i,scale:n?1:e,fill:this.color,strokeWidth:this.size,opacity:this.opacity});r.isCompleted=!1,this._currentPathId=r.id,this._core.store.objects.insert(r),this._core.store.objects?.setActiveDrawingObject(r.id)}if("touch"===t.pointerType||"pen"===t.pointerType){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length){const e=this._core.store.state.scale,n=this._core.store.state.lockDrawingScale,i=n?e:1,r=Math.round((t[0].clientX-this._core.store.offsetX)/i),s=Math.round((t[0].clientY-this._core.store.offsetY)/i);this._core.store.state.isDrawing=!0;const o=_.create(this._core,{points:[[r,s]],translateX:-this._core.store.state.translateX/i,translateY:-this._core.store.state.translateY/i,scale:n?1:e,fill:this.color,strokeWidth:this.size,opacity:this.opacity});o.isCompleted=!1,this._currentPathId=o.id,this._core.store.objects.insert(o),this._core.store.objects?.setActiveDrawingObject(o.id)}}}handlePointerMove(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&this._core.store.state.isDrawing&&this._currentPathId){const e=this._core.store.objects.findById(this._currentPathId);if(e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1,s=(t.clientX-this._core.store.offsetX)/r,o=(t.clientY-this._core.store.offsetY)/r;if(!this.shouldAppendPoint(e,s,o,r))return;const a=_.create(this._core,{points:[...e.points,[s,o]],translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,scale:i?1:n,fill:this.color,strokeWidth:this.size,opacity:this.opacity});a.id=e.id,a.workspaceId=e.workspaceId,a.zIndex=e.zIndex,a.isCompleted=!1,this._core.store.objects.update(a)}}if("touch"===t.pointerType||"pen"===t.pointerType){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length&&this._currentPathId){const e=this._core.store.objects.findById(this._currentPathId);if(e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1,s=Math.round((t[0].clientX-this._core.store.offsetX)/r),o=Math.round((t[0].clientY-this._core.store.offsetY)/r);if(!this.shouldAppendPoint(e,s,o,r))return;const a=_.create(this._core,{points:[...e.points,[s,o]],translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,scale:i?1:n,fill:this.color,strokeWidth:this.size,opacity:this.opacity});a.id=e.id,a.workspaceId=e.workspaceId,a.zIndex=e.zIndex,a.isCompleted=!1,this._core.store.objects.update(a)}}}}handlePointerUp(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&this._core.store.state.isDrawing&&(this._core.store.state.isDrawing=!1,this._currentPathId)){const t=this._core.store.objects.findById(this._currentPathId);t&&(t.isCompleted=!0,this._core.store.objects.update(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([t])),this._core.store.objects?.setActiveDrawingObject(null),this._currentPathId=null,this._core.store.objects?.stopUndoCapturing()}if(("touch"===t.pointerType||"pen"===t.pointerType)&&this._core.store.state.isDrawing&&(this._core.store.state.isDrawing=!1,this._currentPathId)){const t=this._core.store.objects.findById(this._currentPathId);t&&(t.isCompleted=!0,this._core.store.objects.update(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([t])),this._core.store.objects?.setActiveDrawingObject(null),this._currentPathId=null,this._core.store.objects?.stopUndoCapturing()}}}class J extends a{toolType="line";color=x[0];size=4;opacity=1;palette=[...x];sizes=[...c];arrows;_startX=0;_startY=0;_currentLineId=null;constructor(t){super(t)}handlePointerDown(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&l.isLeftClick(t)){this._core.store.state.isDrawing=!0;const e=this._core.store.state.scale,n=this._core.store.state.lockDrawingScale,i=n?e:1,r=(t.clientX-this._core.store.offsetX)/i,s=(t.clientY-this._core.store.offsetY)/i;this._startX=r,this._startY=s;const o=L.create(this._core,{startX:r,startY:s,endX:r,endY:s,translateX:-this._core.store.state.translateX/i,translateY:-this._core.store.state.translateY/i,scale:n?1:e,stroke:this.color,strokeWidth:this.size,opacity:this.opacity,arrows:this.arrows});o.isCompleted=!1,this._currentLineId=o.id,this._core.store.objects.insert(o),this._core.store.objects?.setActiveDrawingObject(o.id)}if("touch"===t.pointerType||"pen"===t.pointerType){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length){const e=this._core.store.state.scale,n=this._core.store.state.lockDrawingScale,i=n?e:1,r=Math.round((t[0].clientX-this._core.store.offsetX)/i),s=Math.round((t[0].clientY-this._core.store.offsetY)/i);this._core.store.state.isDrawing=!0,this._startX=r,this._startY=s;const o=L.create(this._core,{startX:r,startY:s,endX:r,endY:s,translateX:-this._core.store.state.translateX/i,translateY:-this._core.store.state.translateY/i,scale:n?1:e,stroke:this.color,strokeWidth:this.size,opacity:this.opacity,arrows:this.arrows});o.isCompleted=!1,this._currentLineId=o.id,this._core.store.objects.insert(o),this._core.store.objects?.setActiveDrawingObject(o.id)}}}handlePointerMove(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&this._core.store.state.isDrawing&&this._currentLineId){const e=this._core.store.objects.findById(this._currentLineId);if(e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1,s=L.create(this._core,{startX:this._startX,startY:this._startY,endX:(t.clientX-this._core.store.offsetX)/r,endY:(t.clientY-this._core.store.offsetY)/r,translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,scale:i?1:n,stroke:this.color,strokeWidth:this.size,opacity:this.opacity,arrows:this.arrows});s.id=e.id,s.workspaceId=e.workspaceId,s.zIndex=e.zIndex,s.isCompleted=!1,this._core.store.objects.update(s)}}if("touch"===t.pointerType||"pen"===t.pointerType){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length&&this._currentLineId){const e=this._core.store.objects.findById(this._currentLineId);if(e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1,s=Math.round((t[0].clientX-this._core.store.offsetX)/r),o=Math.round((t[0].clientY-this._core.store.offsetY)/r),a=L.create(this._core,{startX:this._startX,startY:this._startY,endX:s,endY:o,translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,scale:i?1:n,stroke:this.color,strokeWidth:this.size,opacity:this.opacity,arrows:this.arrows});a.id=e.id,a.workspaceId=e.workspaceId,a.zIndex=e.zIndex,a.isCompleted=!1,this._core.store.objects.update(a)}}}}handlePointerUp(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType&&this._core.store.state.isDrawing&&(this._core.store.state.isDrawing=!1,this._currentLineId)){const t=this._core.store.objects.findById(this._currentLineId);t&&(t.isCompleted=!0,this._core.store.objects.update(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([t]),this.selectLineAndSwitchTool(t)),this._core.store.objects?.setActiveDrawingObject(null),this._currentLineId=null,this._core.store.objects?.stopUndoCapturing()}if(("touch"===t.pointerType||"pen"===t.pointerType)&&this._core.store.state.isDrawing&&(this._core.store.state.isDrawing=!1,this._currentLineId)){const t=this._core.store.objects.findById(this._currentLineId);t&&(t.isCompleted=!0,this._core.store.objects.update(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([t]),this.selectLineAndSwitchTool(t)),this._core.store.objects?.setActiveDrawingObject(null),this._currentLineId=null,this._core.store.objects?.stopUndoCapturing()}}selectLineAndSwitchTool(t){const e=h.create(this._core);e.addOrRemove(t),e.isSelected=!0,e.rotation=t.rotation,this._core.addSelectionGroup(e),this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection")),this._core.rerender()}}class tt extends a{toolType="eraser";touchStartTimeout=null;constructor(t){super(t)}handlePointerDown(t){"mouse"===t.pointerType&&l.isLeftClick(t)&&(this._core.store.state.isErasing=!0),"touch"!==t.pointerType&&"pen"!==t.pointerType||(this.touchStartTimeout=setTimeout((()=>{1!==this._core.store.state.pointers.size||this._core.store.state.isScaling||(this._core.store.state.isErasing=!0)}),80))}handlePointerMove(t){if("mouse"===t.pointerType&&this._core.store.state.isErasing){const e=this._core.getObjectsFromPointerEvent(t,".object");if(0===e.length)return;const n=this._core.store.state.pointerX,i=this._core.store.state.pointerY;e.forEach((t=>{t.markedForRemoval=t.hitTest(n,i)})),this._core.rerender()}if(("touch"===t.pointerType||"pen"===t.pointerType)&&1===this._core.store.state.pointers.size&&this._core.store.state.isErasing){const e=this._core.store.state.host?.shadowRoot;if(!e)return;const n=this._core.getObjectsFromPointerEvent(t,".object");if(0===n.length)return;const i=this._core.store.state.pointerX,r=this._core.store.state.pointerY;n.forEach((t=>{t.markedForRemoval=t.hitTest(i,r)})),this._core.rerender()}}handlePointerUp(t){if("mouse"===t.pointerType&&this._core.store.state.isErasing){const t=this._core.store.allObjects.filter((t=>t.markedForRemoval));t.length>0&&(this._core.store.objects.stopUndoCapturing(),this._core.store.objects.transaction((()=>{t.forEach((t=>{t.markedForRemoval=!1,this._core.removeObject(t)}))})),this._core.rerender()),this._core.store.state.isErasing=!1,this._core.engine.emitObjectsChange(),t.length>0&&(this._core.engine.emitObjectsRemoved(t),this._core.store.objects.stopUndoCapturing())}if(("touch"===t.pointerType||"pen"===t.pointerType)&&(clearTimeout(this.touchStartTimeout),this._core.store.state.isErasing)){const t=this._core.store.allObjects.filter((t=>t.markedForRemoval));t.length>0&&(this._core.store.objects.stopUndoCapturing(),this._core.store.objects.transaction((()=>{t.forEach((t=>{t.markedForRemoval=!1,this._core.removeObject(t)}))})),this._core.rerender()),this._core.store.state.isErasing=!1,this._core.engine.emitObjectsChange(),t.length>0&&(this._core.engine.emitObjectsRemoved(t),this._core.store.objects.stopUndoCapturing())}}}function et(t,e){return new Promise((function(n,i){let r;return nt(t).then((function(t){try{return r=t,n(new Blob([e.slice(0,2),r,e.slice(2)],{type:"image/jpeg"}))}catch(t){return i(t)}}),i)}))}const nt=t=>new Promise(((e,n)=>{const i=new FileReader;i.addEventListener("load",(({target:{result:t}})=>{const i=new DataView(t);let r=0;if(65496!==i.getUint16(r))return n("not a valid JPEG");for(r+=2;;){const s=i.getUint16(r);if(65498===s)break;const o=i.getUint16(r+2);if(65505===s&&1165519206===i.getUint32(r+4)){const s=r+10;let a;switch(i.getUint16(s)){case 18761:a=!0;break;case 19789:a=!1;break;default:return n("TIFF header contains invalid endian")}if(42!==i.getUint16(s+2,a))return n("TIFF header contains invalid version");const c=i.getUint32(s+4,a),l=s+c+2+12*i.getUint16(s+c,a);for(let t=s+c+2;t<l;t+=12)if(274==i.getUint16(t,a)){if(3!==i.getUint16(t+2,a))return n("Orientation data type is invalid");if(1!==i.getUint32(t+4,a))return n("Orientation data count is invalid");i.setUint16(t+8,1,a);break}return e(t.slice(r,r+2+o))}r+=2+o}return e(new Blob)})),i.readAsArrayBuffer(t)}));var it={},rt={get exports(){return it},set exports(t){it=t}};!function(){var t,e,n={};rt.exports=n,n.parse=function(t,e){for(var i=n.bin.readUshort,r=n.bin.readUint,s=0,o={},a=new Uint8Array(t),c=a.length-4;101010256!=r(a,c);)c--;s=c,s+=4;var l=i(a,s+=4);i(a,s+=2);var h=r(a,s+=2),u=r(a,s+=4);s+=4,s=u;for(var f=0;f<l;f++){r(a,s),s+=4,s+=4,s+=4,r(a,s+=4),h=r(a,s+=4);var d=r(a,s+=4),p=i(a,s+=4),g=i(a,s+2),v=i(a,s+4);s+=6;var w=r(a,s+=8);s+=4,s+=p+g+v,n._readLocal(a,w,o,h,d,e)}return o},n._readLocal=function(t,e,i,r,s,o){var a=n.bin.readUshort,c=n.bin.readUint;c(t,e),a(t,e+=4),a(t,e+=2);var l=a(t,e+=2);c(t,e+=2),c(t,e+=4),e+=4;var h=a(t,e+=8),u=a(t,e+=2),f=n.bin.readUTF8(t,e+=2,h);if(e+=h,e+=u,o)i[f]={size:s,csize:r};else{var d=new Uint8Array(t.buffer,e);if(0==l)i[f]=new Uint8Array(d.buffer.slice(e,e+r));else{if(8!=l)throw"unknown compression method: "+l;var p=new Uint8Array(s);n.inflateRaw(d,p),i[f]=p}}},n.inflateRaw=function(t,e){return n.F.inflate(t,e)},n.inflate=function(t,e){return n.inflateRaw(new Uint8Array(t.buffer,t.byteOffset+2,t.length-6),e)},n.deflate=function(t,e){null==e&&(e={level:6});var i=0,r=new Uint8Array(50+Math.floor(1.1*t.length));r[i]=120,r[i+1]=156,i=n.F.deflateRaw(t,r,i+=2,e.level);var s=n.adler(t,0,t.length);return r[i+0]=s>>>24&255,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s>>>0&255,new Uint8Array(r.buffer,0,i+4)},n.deflateRaw=function(t,e){null==e&&(e={level:6});var i=new Uint8Array(50+Math.floor(1.1*t.length)),r=n.F.deflateRaw(t,i,r,e.level);return new Uint8Array(i.buffer,0,r)},n.encode=function(t,e){null==e&&(e=!1);var i=0,r=n.bin.writeUint,s=n.bin.writeUshort,o={};for(var a in t){var c=!n._noNeed(a)&&!e,l=t[a],h=n.crc.crc(l,0,l.length);o[a]={cpr:c,usize:l.length,crc:h,file:c?n.deflateRaw(l):l}}for(var a in o)i+=o[a].file.length+30+46+2*n.bin.sizeUTF8(a);i+=22;var u=new Uint8Array(i),f=0,d=[];for(var a in o){var p=o[a];d.push(f),f=n._writeHeader(u,f,a,p,0)}var g=0,v=f;for(var a in o)p=o[a],d.push(f),f=n._writeHeader(u,f,a,p,1,d[g++]);var w=f-v;return r(u,f,101010256),f+=4,s(u,f+=4,g),s(u,f+=2,g),r(u,f+=2,w),r(u,f+=4,v),f+=4,f+=2,u.buffer},n._noNeed=function(t){var e=t.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(e)},n._writeHeader=function(t,e,i,r,s,o){var a=n.bin.writeUint,c=n.bin.writeUshort,l=r.file;return a(t,e,0==s?67324752:33639248),e+=4,1==s&&(e+=2),c(t,e,20),c(t,e+=2,0),c(t,e+=2,r.cpr?8:0),a(t,e+=2,0),a(t,e+=4,r.crc),a(t,e+=4,l.length),a(t,e+=4,r.usize),c(t,e+=4,n.bin.sizeUTF8(i)),c(t,e+=2,0),e+=2,1==s&&(e+=2,e+=2,a(t,e+=6,o),e+=4),e+=n.bin.writeUTF8(t,e,i),0==s&&(t.set(l,e),e+=l.length),e},n.crc={table:function(){for(var t=new Uint32Array(256),e=0;e<256;e++){for(var n=e,i=0;i<8;i++)1&n?n=3988292384^n>>>1:n>>>=1;t[e]=n}return t}(),update:function(t,e,i,r){for(var s=0;s<r;s++)t=n.crc.table[255&(t^e[i+s])]^t>>>8;return t},crc:function(t,e,i){return 4294967295^n.crc.update(4294967295,t,e,i)}},n.adler=function(t,e,n){for(var i=1,r=0,s=e,o=e+n;s<o;){for(var a=Math.min(s+5552,o);s<a;)r+=i+=t[s++];i%=65521,r%=65521}return r<<16|i},n.bin={readUshort:function(t,e){return t[e]|t[e+1]<<8},writeUshort:function(t,e,n){t[e]=255&n,t[e+1]=n>>8&255},readUint:function(t,e){return 16777216*t[e+3]+(t[e+2]<<16|t[e+1]<<8|t[e])},writeUint:function(t,e,n){t[e]=255&n,t[e+1]=n>>8&255,t[e+2]=n>>16&255,t[e+3]=n>>24&255},readASCII:function(t,e,n){for(var i="",r=0;r<n;r++)i+=String.fromCharCode(t[e+r]);return i},writeASCII:function(t,e,n){for(var i=0;i<n.length;i++)t[e+i]=n.charCodeAt(i)},pad:function(t){return t.length<2?"0"+t:t},readUTF8:function(t,e,i){for(var r,s="",o=0;o<i;o++)s+="%"+n.bin.pad(t[e+o].toString(16));try{r=decodeURIComponent(s)}catch(r){return n.bin.readASCII(t,e,i)}return r},writeUTF8:function(t,e,n){for(var i=n.length,r=0,s=0;s<i;s++){var o=n.charCodeAt(s);if(4294967168&o)if(4294965248&o)if(4294901760&o){if(4292870144&o)throw"e";t[e+r]=240|o>>18,t[e+r+1]=128|o>>12&63,t[e+r+2]=128|o>>6&63,t[e+r+3]=128|63&o,r+=4}else t[e+r]=224|o>>12,t[e+r+1]=128|o>>6&63,t[e+r+2]=128|63&o,r+=3;else t[e+r]=192|o>>6,t[e+r+1]=128|63&o,r+=2;else t[e+r]=o,r++}return r},sizeUTF8:function(t){for(var e=t.length,n=0,i=0;i<e;i++){var r=t.charCodeAt(i);if(4294967168&r)if(4294965248&r)if(4294901760&r){if(4292870144&r)throw"e";n+=4}else n+=3;else n+=2;else n++}return n}},n.F={},n.F.deflateRaw=function(t,e,i,r){var s=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][r],o=n.F.U,a=n.F._goodIndex,c=n.F._putsE,l=0,h=i<<3,u=0,f=t.length;if(0==r){for(;l<f;)c(e,h,l+(S=Math.min(65535,f-l))==f?1:0),h=n.F._copyExact(t,l,S,e,h+8),l+=S;return h>>>3}var d=o.lits,p=o.strt,g=o.prev,v=0,w=0,m=0,y=0,b=0,k=0;for(f>2&&(p[k=n.F._hash(t,0)]=0),l=0;l<f;l++){if(b=k,l+1<f-2){k=n.F._hash(t,l+1);var A=l+1&32767;g[A]=p[k],p[k]=A}if(u<=l){(v>14e3||w>26697)&&f-l>100&&(u<l&&(d[v]=l-u,v+=2,u=l),h=n.F._writeBlock(l==f-1||u==f?1:0,d,v,y,t,m,l-m,e,h),v=w=y=0,m=l);var x=0;l<f-2&&(x=n.F._bestMatch(t,l,g,b,Math.min(s[2],f-l),s[3]));var S=x>>>16,M=65535&x;if(0!=x){M=65535&x;var z=a(S=x>>>16,o.of0);o.lhst[257+z]++;var $=a(M,o.df0);o.dhst[$]++,y+=o.exb[z]+o.dxb[$],d[v]=S<<23|l-u,d[v+1]=M<<16|z<<8|$,v+=2,u=l+S}else o.lhst[t[l]]++;w++}}for(m==l&&0!=t.length||(u<l&&(d[v]=l-u,v+=2,u=l),h=n.F._writeBlock(1,d,v,y,t,m,l-m,e,h),v=0,w=0,v=w=y=0,m=l);7&h;)h++;return h>>>3},n.F._bestMatch=function(t,e,i,r,s,o){var a=32767&e,c=i[a],l=a-c+32768&32767;if(c==a||r!=n.F._hash(t,e-l))return 0;for(var h=0,u=0,f=Math.min(32767,e);l<=f&&0!=--o&&c!=a;){if(0==h||t[e+h]==t[e+h-l]){var d=n.F._howLong(t,e,l);if(d>h){if(u=l,(h=d)>=s)break;l+2<d&&(d=l+2);for(var p=0,g=0;g<d-2;g++){var v=e-l+g+32768&32767,w=v-i[v]+32768&32767;w>p&&(p=w,c=v)}}}l+=(a=c)-(c=i[a])+32768&32767}return h<<16|u},n.F._howLong=function(t,e,n){if(t[e]!=t[e-n]||t[e+1]!=t[e+1-n]||t[e+2]!=t[e+2-n])return 0;var i=e,r=Math.min(t.length,e+258);for(e+=3;e<r&&t[e]==t[e-n];)e++;return e-i},n.F._hash=function(t,e){return(t[e]<<8|t[e+1])+(t[e+2]<<4)&65535},n.saved=0,n.F._writeBlock=function(t,e,i,r,s,o,a,c,l){var h,u,f,d,p,g,v,w,m,y=n.F.U,b=n.F._putsF,k=n.F._putsE;y.lhst[256]++,u=(h=n.F.getTrees())[0],f=h[1],d=h[2],p=h[3],g=h[4],v=h[5],w=h[6],m=h[7];var A=32+(l+3&7?8-(l+3&7):0)+(a<<3),x=r+n.F.contSize(y.fltree,y.lhst)+n.F.contSize(y.fdtree,y.dhst),S=r+n.F.contSize(y.ltree,y.lhst)+n.F.contSize(y.dtree,y.dhst);S+=14+3*v+n.F.contSize(y.itree,y.ihst)+(2*y.ihst[16]+3*y.ihst[17]+7*y.ihst[18]);for(var M=0;M<286;M++)y.lhst[M]=0;for(M=0;M<30;M++)y.dhst[M]=0;for(M=0;M<19;M++)y.ihst[M]=0;var z=A<x&&A<S?0:x<S?1:2;if(b(c,l,t),b(c,l+1,z),l+=3,0==z){for(;7&l;)l++;l=n.F._copyExact(s,o,a,c,l)}else{var $,C;if(1==z&&($=y.fltree,C=y.fdtree),2==z){n.F.makeCodes(y.ltree,u),n.F.revCodes(y.ltree,u),n.F.makeCodes(y.dtree,f),n.F.revCodes(y.dtree,f),n.F.makeCodes(y.itree,d),n.F.revCodes(y.itree,d),$=y.ltree,C=y.dtree,k(c,l,p-257),k(c,l+=5,g-1),k(c,l+=5,v-4),l+=4;for(var T=0;T<v;T++)k(c,l+3*T,y.itree[1+(y.ordr[T]<<1)]);l=n.F._codeTiny(w,y.itree,c,l+=3*v),l=n.F._codeTiny(m,y.itree,c,l)}for(var I=o,j=0;j<i;j+=2){for(var E=e[j],_=E>>>23,L=I+(8388607&E);I<L;)l=n.F._writeLit(s[I++],$,c,l);if(0!=_){var O=e[j+1],P=O>>16,B=O>>8&255,D=255&O;k(c,l=n.F._writeLit(257+B,$,c,l),_-y.of0[B]),b(c,l=n.F._writeLit(D,C,c,l+=y.exb[B]),P-y.df0[D]),l+=y.dxb[D],I+=_}}l=n.F._writeLit(256,$,c,l)}return l},n.F._copyExact=function(t,e,n,i,r){var s=r>>>3;return i[s]=n,i[s+1]=n>>>8,i[s+2]=255-i[s],i[s+3]=255-i[s+1],s+=4,i.set(new Uint8Array(t.buffer,e,n),s),r+(n+4<<3)},n.F.getTrees=function(){for(var t=n.F.U,e=n.F._hufTree(t.lhst,t.ltree,15),i=n.F._hufTree(t.dhst,t.dtree,15),r=[],s=n.F._lenCodes(t.ltree,r),o=[],a=n.F._lenCodes(t.dtree,o),c=0;c<r.length;c+=2)t.ihst[r[c]]++;for(c=0;c<o.length;c+=2)t.ihst[o[c]]++;for(var l=n.F._hufTree(t.ihst,t.itree,7),h=19;h>4&&0==t.itree[1+(t.ordr[h-1]<<1)];)h--;return[e,i,l,s,a,h,r,o]},n.F.getSecond=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(t[n+1]);return e},n.F.nonZero=function(t){for(var e="",n=0;n<t.length;n+=2)0!=t[n+1]&&(e+=(n>>1)+",");return e},n.F.contSize=function(t,e){for(var n=0,i=0;i<e.length;i++)n+=e[i]*t[1+(i<<1)];return n},n.F._codeTiny=function(t,e,i,r){for(var s=0;s<t.length;s+=2){var o=t[s],a=t[s+1];r=n.F._writeLit(o,e,i,r);var c=16==o?2:17==o?3:7;o>15&&(n.F._putsE(i,r,a,c),r+=c)}return r},n.F._lenCodes=function(t,e){for(var n=t.length;2!=n&&0==t[n-1];)n-=2;for(var i=0;i<n;i+=2){var r=t[i+1],s=i+3<n?t[i+3]:-1,o=i+5<n?t[i+5]:-1,a=0==i?-1:t[i-1];if(0==r&&s==r&&o==r){for(var c=i+5;c+2<n&&t[c+2]==r;)c+=2;(l=Math.min(c+1-i>>>1,138))<11?e.push(17,l-3):e.push(18,l-11),i+=2*l-2}else if(r==a&&s==r&&o==r){for(c=i+5;c+2<n&&t[c+2]==r;)c+=2;var l=Math.min(c+1-i>>>1,6);e.push(16,l-3),i+=2*l-2}else e.push(r,0)}return n>>>1},n.F._hufTree=function(t,e,i){var r=[],s=t.length,o=e.length,a=0;for(a=0;a<o;a+=2)e[a]=0,e[a+1]=0;for(a=0;a<s;a++)0!=t[a]&&r.push({lit:a,f:t[a]});var c=r.length,l=r.slice(0);if(0==c)return 0;if(1==c){var h=r[0].lit;return l=0==h?1:0,e[1+(h<<1)]=1,e[1+(l<<1)]=1,1}r.sort((function(t,e){return t.f-e.f}));var u=r[0],f=r[1],d=0,p=1,g=2;for(r[0]={lit:-1,f:u.f+f.f,l:u,r:f,d:0};p!=c-1;)u=d!=p&&(g==c||r[d].f<r[g].f)?r[d++]:r[g++],f=d!=p&&(g==c||r[d].f<r[g].f)?r[d++]:r[g++],r[p++]={lit:-1,f:u.f+f.f,l:u,r:f};var v=n.F.setDepth(r[p-1],0);for(v>i&&(n.F.restrictDepth(l,i,v),v=i),a=0;a<c;a++)e[1+(l[a].lit<<1)]=l[a].d;return v},n.F.setDepth=function(t,e){return-1!=t.lit?(t.d=e,e):Math.max(n.F.setDepth(t.l,e+1),n.F.setDepth(t.r,e+1))},n.F.restrictDepth=function(t,e,n){var i=0,r=1<<n-e,s=0;for(t.sort((function(t,e){return e.d==t.d?t.f-e.f:e.d-t.d})),i=0;i<t.length&&t[i].d>e;i++){var o=t[i].d;t[i].d=e,s+=r-(1<<n-o)}for(s>>>=n-e;s>0;)(o=t[i].d)<e?(t[i].d++,s-=1<<e-o-1):i++;for(;i>=0;i--)t[i].d==e&&s<0&&(t[i].d--,s++);0!=s&&console.log("debt left")},n.F._goodIndex=function(t,e){var n=0;return e[16|n]<=t&&(n|=16),e[8|n]<=t&&(n|=8),e[4|n]<=t&&(n|=4),e[2|n]<=t&&(n|=2),e[1|n]<=t&&(n|=1),n},n.F._writeLit=function(t,e,i,r){return n.F._putsF(i,r,e[t<<1]),r+e[1+(t<<1)]},n.F.inflate=function(t,e){var i=Uint8Array;if(3==t[0]&&0==t[1])return e||new i(0);var r=n.F,s=r._bitsF,o=r._bitsE,a=r._decodeTiny,c=r.makeCodes,l=r.codes2map,h=r._get17,u=r.U,f=null==e;f&&(e=new i(t.length>>>2<<3));for(var d,p,g=0,v=0,w=0,m=0,y=0,b=0,k=0,A=0,x=0;0==g;)if(g=s(t,x,1),v=s(t,x+1,2),x+=3,0!=v){if(f&&(e=n.F._check(e,A+(1<<17))),1==v&&(d=u.flmap,p=u.fdmap,b=511,k=31),2==v){w=o(t,x,5)+257,m=o(t,x+5,5)+1,y=o(t,x+10,4)+4,x+=14;for(var S=0;S<38;S+=2)u.itree[S]=0,u.itree[S+1]=0;var M=1;for(S=0;S<y;S++){var z=o(t,x+3*S,3);u.itree[1+(u.ordr[S]<<1)]=z,z>M&&(M=z)}x+=3*y,c(u.itree,M),l(u.itree,M,u.imap),d=u.lmap,p=u.dmap,x=a(u.imap,(1<<M)-1,w+m,t,x,u.ttree);var $=r._copyOut(u.ttree,0,w,u.ltree);b=(1<<$)-1;var C=r._copyOut(u.ttree,w,m,u.dtree);k=(1<<C)-1,c(u.ltree,$),l(u.ltree,$,d),c(u.dtree,C),l(u.dtree,C,p)}for(;;){var T=d[h(t,x)&b];x+=15&T;var I=T>>>4;if(I>>>8==0)e[A++]=I;else{if(256==I)break;var j=A+I-254;if(I>264){var E=u.ldef[I-257];j=A+(E>>>3)+o(t,x,7&E),x+=7&E}var _=p[h(t,x)&k],L=u.ddef[_>>>4],O=(L>>>4)+s(t,x+=15&_,15&L);for(x+=15&L,f&&(e=n.F._check(e,A+(1<<17)));A<j;)e[A]=e[A++-O],e[A]=e[A++-O],e[A]=e[A++-O],e[A]=e[A++-O];A=j}}}else{7&x&&(x+=8-(7&x));var P=4+(x>>>3),B=t[P-4]|t[P-3]<<8;f&&(e=n.F._check(e,A+B)),e.set(new i(t.buffer,t.byteOffset+P,B),A),x=P+B<<3,A+=B}return e.length==A?e:e.slice(0,A)},n.F._check=function(t,e){var n=t.length;if(e<=n)return t;var i=new Uint8Array(Math.max(n<<1,e));return i.set(t,0),i},n.F._decodeTiny=function(t,e,i,r,s,o){for(var a=n.F._bitsE,c=n.F._get17,l=0;l<i;){var h=t[c(r,s)&e];s+=15&h;var u=h>>>4;if(u<=15)o[l]=u,l++;else{var f=0,d=0;16==u?(d=3+a(r,s,2),s+=2,f=o[l-1]):17==u?(d=3+a(r,s,3),s+=3):18==u&&(d=11+a(r,s,7),s+=7);for(var p=l+d;l<p;)o[l]=f,l++}}return s},n.F._copyOut=function(t,e,n,i){for(var r=0,s=0,o=i.length>>>1;s<n;){var a=t[s+e];i[s<<1]=0,i[1+(s<<1)]=a,a>r&&(r=a),s++}for(;s<o;)i[s<<1]=0,i[1+(s<<1)]=0,s++;return r},n.F.makeCodes=function(t,e){for(var i,r,s,o,a=n.F.U,c=t.length,l=a.bl_count,h=0;h<=e;h++)l[h]=0;for(h=1;h<c;h+=2)l[t[h]]++;var u=a.next_code;for(i=0,l[0]=0,r=1;r<=e;r++)u[r]=i=i+l[r-1]<<1;for(s=0;s<c;s+=2)0!=(o=t[s+1])&&(t[s]=u[o],u[o]++)},n.F.codes2map=function(t,e,i){for(var r=t.length,s=n.F.U.rev15,o=0;o<r;o+=2)if(0!=t[o+1])for(var a=t[o+1],c=o>>1<<4|a,l=e-a,h=t[o]<<l,u=h+(1<<l);h!=u;)i[s[h]>>>15-e]=c,h++},n.F.revCodes=function(t,e){for(var i=n.F.U.rev15,r=15-e,s=0;s<t.length;s+=2)t[s]=i[t[s]<<e-t[s+1]]>>>r},n.F._putsE=function(t,e,n){var i=e>>>3;t[i]|=n<<=7&e,t[i+1]|=n>>>8},n.F._putsF=function(t,e,n){var i=e>>>3;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},n.F._bitsE=function(t,e,n){return(t[e>>>3]|t[1+(e>>>3)]<<8)>>>(7&e)&(1<<n)-1},n.F._bitsF=function(t,e,n){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16)>>>(7&e)&(1<<n)-1},n.F._get17=function(t,e){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16)>>>(7&e)},n.F._get25=function(t,e){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16|t[3+(e>>>3)]<<24)>>>(7&e)},n.F.U=(t=Uint16Array,e=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new t(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new e(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new e(286),dhst:new e(30),ihst:new e(19),lits:new e(15e3),strt:new t(65536),prev:new t(32768)}),function(){for(var t=n.F.U,e=0;e<32768;e++){var i=e;i=(4278255360&(i=(4042322160&(i=(3435973836&(i=(2863311530&i)>>>1|(1431655765&i)<<1))>>>2|(858993459&i)<<2))>>>4|(252645135&i)<<4))>>>8|(16711935&i)<<8,t.rev15[e]=(i>>>16|i<<16)>>>17}function r(t,e,n){for(;0!=e--;)t.push(0,n)}for(e=0;e<32;e++)t.ldef[e]=t.of0[e]<<3|t.exb[e],t.ddef[e]=t.df0[e]<<4|t.dxb[e];r(t.fltree,144,8),r(t.fltree,112,9),r(t.fltree,24,7),r(t.fltree,8,8),n.F.makeCodes(t.fltree,9),n.F.codes2map(t.fltree,9,t.flmap),n.F.revCodes(t.fltree,9),r(t.fdtree,32,5),n.F.makeCodes(t.fdtree,5),n.F.codes2map(t.fdtree,5,t.fdmap),n.F.revCodes(t.fdtree,5),r(t.itree,19,0),r(t.ltree,286,0),r(t.dtree,30,0),r(t.ttree,320,0)}()}();var st=function(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}({__proto__:null,default:it},[it]);const ot=function(){var t={nextZero(t,e){for(;0!=t[e];)e++;return e},readUshort:(t,e)=>t[e]<<8|t[e+1],writeUshort(t,e,n){t[e]=n>>8&255,t[e+1]=255&n},readUint:(t,e)=>16777216*t[e]+(t[e+1]<<16|t[e+2]<<8|t[e+3]),writeUint(t,e,n){t[e]=n>>24&255,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n},readASCII(t,e,n){let i="";for(let r=0;r<n;r++)i+=String.fromCharCode(t[e+r]);return i},writeASCII(t,e,n){for(let i=0;i<n.length;i++)t[e+i]=n.charCodeAt(i)},readBytes(t,e,n){const i=[];for(let r=0;r<n;r++)i.push(t[e+r]);return i},pad:t=>t.length<2?`0${t}`:t,readUTF8(e,n,i){let r,s="";for(let r=0;r<i;r++)s+=`%${t.pad(e[n+r].toString(16))}`;try{r=decodeURIComponent(s)}catch(r){return t.readASCII(e,n,i)}return r}};function e(e,n,i,r){const o=n*i,a=s(r),c=Math.ceil(n*a/8),l=new Uint8Array(4*o),h=new Uint32Array(l.buffer),{ctype:u}=r,{depth:f}=r,d=t.readUshort;if(6==u){const t=o<<2;if(8==f)for(var p=0;p<t;p+=4)l[p]=e[p],l[p+1]=e[p+1],l[p+2]=e[p+2],l[p+3]=e[p+3];if(16==f)for(p=0;p<t;p++)l[p]=e[p<<1]}else if(2==u){const t=r.tabs.tRNS;if(null==t){if(8==f)for(p=0;p<o;p++){var g=3*p;h[p]=255<<24|e[g+2]<<16|e[g+1]<<8|e[g]}if(16==f)for(p=0;p<o;p++)h[p]=255<<24|e[4+(g=6*p)]<<16|e[g+2]<<8|e[g]}else{var v=t[0];const n=t[1],i=t[2];if(8==f)for(p=0;p<o;p++){var w=p<<2;h[p]=255<<24|e[2+(g=3*p)]<<16|e[g+1]<<8|e[g],e[g]==v&&e[g+1]==n&&e[g+2]==i&&(l[w+3]=0)}if(16==f)for(p=0;p<o;p++)w=p<<2,h[p]=255<<24|e[4+(g=6*p)]<<16|e[g+2]<<8|e[g],d(e,g)==v&&d(e,g+2)==n&&d(e,g+4)==i&&(l[w+3]=0)}}else if(3==u){const t=r.tabs.PLTE,s=r.tabs.tRNS,a=s?s.length:0;if(1==f)for(var m=0;m<i;m++){var y=m*c,b=m*n;for(p=0;p<n;p++){var k=3*(A=e[y+(p>>3)]>>7-(7&p)&1);l[w=b+p<<2]=t[k],l[w+1]=t[k+1],l[w+2]=t[k+2],l[w+3]=A<a?s[A]:255}}if(2==f)for(m=0;m<i;m++)for(y=m*c,b=m*n,p=0;p<n;p++)k=3*(A=e[y+(p>>2)]>>6-((3&p)<<1)&3),l[w=b+p<<2]=t[k],l[w+1]=t[k+1],l[w+2]=t[k+2],l[w+3]=A<a?s[A]:255;if(4==f)for(m=0;m<i;m++)for(y=m*c,b=m*n,p=0;p<n;p++)k=3*(A=e[y+(p>>1)]>>4-((1&p)<<2)&15),l[w=b+p<<2]=t[k],l[w+1]=t[k+1],l[w+2]=t[k+2],l[w+3]=A<a?s[A]:255;if(8==f)for(p=0;p<o;p++){var A;k=3*(A=e[p]),l[w=p<<2]=t[k],l[w+1]=t[k+1],l[w+2]=t[k+2],l[w+3]=A<a?s[A]:255}}else if(4==u){if(8==f)for(p=0;p<o;p++){var x=e[S=p<<1];l[w=p<<2]=x,l[w+1]=x,l[w+2]=x,l[w+3]=e[S+1]}if(16==f)for(p=0;p<o;p++){var S;x=e[S=p<<2],l[w=p<<2]=x,l[w+1]=x,l[w+2]=x,l[w+3]=e[S+2]}}else if(0==u)for(v=r.tabs.tRNS?r.tabs.tRNS:-1,m=0;m<i;m++){const t=m*c,i=m*n;if(1==f)for(var M=0;M<n;M++){var z=(x=255*(e[t+(M>>>3)]>>>7-(7&M)&1))==255*v?0:255;h[i+M]=z<<24|x<<16|x<<8|x}else if(2==f)for(M=0;M<n;M++)z=(x=85*(e[t+(M>>>2)]>>>6-((3&M)<<1)&3))==85*v?0:255,h[i+M]=z<<24|x<<16|x<<8|x;else if(4==f)for(M=0;M<n;M++)z=(x=17*(e[t+(M>>>1)]>>>4-((1&M)<<2)&15))==17*v?0:255,h[i+M]=z<<24|x<<16|x<<8|x;else if(8==f)for(M=0;M<n;M++)z=(x=e[t+M])==v?0:255,h[i+M]=z<<24|x<<16|x<<8|x;else if(16==f)for(M=0;M<n;M++)x=e[t+(M<<1)],z=d(e,t+(M<<1))==v?0:255,h[i+M]=z<<24|x<<16|x<<8|x}return l}function n(t,e,n,a){const c=s(t),l=Math.ceil(n*c/8),h=new Uint8Array((l+1+t.interlace)*a);return e=t.tabs.CgBI?r(e,h):i(e,h),0==t.interlace?e=o(e,t,0,n,a):1==t.interlace&&(e=function(t,e){const n=e.width,i=e.height,r=s(e),a=r>>3,c=Math.ceil(n*r/8),l=new Uint8Array(i*c);let h=0;const u=[0,0,4,0,2,0,1],f=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1];let g=0;for(;g<7;){const s=d[g],w=p[g];let m=0,y=0,b=u[g];for(;b<i;)b+=s,y++;let k=f[g];for(;k<n;)k+=w,m++;const A=Math.ceil(m*r/8);o(t,e,h,m,y);let x=0,S=u[g];for(;S<i;){let e=f[g],i=h+x*A<<3;for(;e<n;){var v;if(1==r&&(v=(v=t[i>>3])>>7-(7&i)&1,l[S*c+(e>>3)]|=v<<7-(7&e)),2==r&&(v=(v=t[i>>3])>>6-(7&i)&3,l[S*c+(e>>2)]|=v<<6-((3&e)<<1)),4==r&&(v=(v=t[i>>3])>>4-(7&i)&15,l[S*c+(e>>1)]|=v<<4-((1&e)<<2)),r>=8){const n=S*c+e*a;for(let e=0;e<a;e++)l[n+e]=t[(i>>3)+e]}i+=r,e+=w}x++,S+=s}m*y!=0&&(h+=y*(1+A)),g+=1}return l}(e,t)),e}function i(t,e){return r(new Uint8Array(t.buffer,2,t.length-6),e)}var r=function(){const t={H:{}};return t.H.N=function(e,n){const i=Uint8Array;let r,s,o=0,a=0,c=0,l=0,h=0,u=0,f=0,d=0,p=0;if(3==e[0]&&0==e[1])return n||new i(0);const g=t.H,v=g.b,w=g.e,m=g.R,y=g.n,b=g.A,k=g.Z,A=g.m,x=null==n;for(x&&(n=new i(e.length>>>2<<5));0==o;)if(o=v(e,p,1),a=v(e,p+1,2),p+=3,0!=a){if(x&&(n=t.H.W(n,d+(1<<17))),1==a&&(r=A.J,s=A.h,u=511,f=31),2==a){c=w(e,p,5)+257,l=w(e,p+5,5)+1,h=w(e,p+10,4)+4,p+=14;let t=1;for(var S=0;S<38;S+=2)A.Q[S]=0,A.Q[S+1]=0;for(S=0;S<h;S++){const n=w(e,p+3*S,3);A.Q[1+(A.X[S]<<1)]=n,n>t&&(t=n)}p+=3*h,y(A.Q,t),b(A.Q,t,A.u),r=A.w,s=A.d,p=m(A.u,(1<<t)-1,c+l,e,p,A.v);const n=g.V(A.v,0,c,A.C);u=(1<<n)-1;const i=g.V(A.v,c,l,A.D);f=(1<<i)-1,y(A.C,n),b(A.C,n,r),y(A.D,i),b(A.D,i,s)}for(;;){const t=r[k(e,p)&u];p+=15&t;const i=t>>>4;if(i>>>8==0)n[d++]=i;else{if(256==i)break;{let t=d+i-254;if(i>264){const n=A.q[i-257];t=d+(n>>>3)+w(e,p,7&n),p+=7&n}const r=s[k(e,p)&f];p+=15&r;const o=A.c[r>>>4],a=(o>>>4)+v(e,p,15&o);for(p+=15&o;d<t;)n[d]=n[d++-a],n[d]=n[d++-a],n[d]=n[d++-a],n[d]=n[d++-a];d=t}}}}else{7&p&&(p+=8-(7&p));const r=4+(p>>>3),s=e[r-4]|e[r-3]<<8;x&&(n=t.H.W(n,d+s)),n.set(new i(e.buffer,e.byteOffset+r,s),d),p=r+s<<3,d+=s}return n.length==d?n:n.slice(0,d)},t.H.W=function(t,e){const n=t.length;if(e<=n)return t;const i=new Uint8Array(n<<1);return i.set(t,0),i},t.H.R=function(e,n,i,r,s,o){const a=t.H.e,c=t.H.Z;let l=0;for(;l<i;){const t=e[c(r,s)&n];s+=15&t;const i=t>>>4;if(i<=15)o[l]=i,l++;else{let t=0,e=0;16==i?(e=3+a(r,s,2),s+=2,t=o[l-1]):17==i?(e=3+a(r,s,3),s+=3):18==i&&(e=11+a(r,s,7),s+=7);const n=l+e;for(;l<n;)o[l]=t,l++}}return s},t.H.V=function(t,e,n,i){let r=0,s=0;const o=i.length>>>1;for(;s<n;){const n=t[s+e];i[s<<1]=0,i[1+(s<<1)]=n,n>r&&(r=n),s++}for(;s<o;)i[s<<1]=0,i[1+(s<<1)]=0,s++;return r},t.H.n=function(e,n){const i=t.H.m,r=e.length;let s,o,a,c;const l=i.j;for(var h=0;h<=n;h++)l[h]=0;for(h=1;h<r;h+=2)l[e[h]]++;const u=i.K;for(s=0,l[0]=0,o=1;o<=n;o++)s=s+l[o-1]<<1,u[o]=s;for(a=0;a<r;a+=2)c=e[a+1],0!=c&&(e[a]=u[c],u[c]++)},t.H.A=function(e,n,i){const r=e.length,s=t.H.m.r;for(let t=0;t<r;t+=2)if(0!=e[t+1]){const r=e[t+1],o=t>>1<<4|r,a=n-r;let c=e[t]<<a;const l=c+(1<<a);for(;c!=l;)i[s[c]>>>15-n]=o,c++}},t.H.l=function(e,n){const i=t.H.m.r,r=15-n;for(let t=0;t<e.length;t+=2)e[t]=i[e[t]<<n-e[t+1]]>>>r},t.H.M=function(t,e,n){const i=e>>>3;t[i]|=n<<=7&e,t[i+1]|=n>>>8},t.H.I=function(t,e,n){const i=e>>>3;t[i]|=n<<=7&e,t[i+1]|=n>>>8,t[i+2]|=n>>>16},t.H.e=function(t,e,n){return(t[e>>>3]|t[1+(e>>>3)]<<8)>>>(7&e)&(1<<n)-1},t.H.b=function(t,e,n){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16)>>>(7&e)&(1<<n)-1},t.H.Z=function(t,e){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16)>>>(7&e)},t.H.i=function(t,e){return(t[e>>>3]|t[1+(e>>>3)]<<8|t[2+(e>>>3)]<<16|t[3+(e>>>3)]<<24)>>>(7&e)},t.H.m=function(){const t=Uint16Array,e=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new e(32),J:new t(512),_:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new e(286),Y:new e(30),a:new e(19),t:new e(15e3),k:new t(65536),g:new t(32768)}}(),function(){const e=t.H.m;for(var n=0;n<32768;n++){let t=n;t=(2863311530&t)>>>1|(1431655765&t)<<1,t=(3435973836&t)>>>2|(858993459&t)<<2,t=(4042322160&t)>>>4|(252645135&t)<<4,t=(4278255360&t)>>>8|(16711935&t)<<8,e.r[n]=(t>>>16|t<<16)>>>17}function i(t,e,n){for(;0!=e--;)t.push(0,n)}for(n=0;n<32;n++)e.q[n]=e.S[n]<<3|e.T[n],e.c[n]=e.p[n]<<4|e.z[n];i(e._,144,8),i(e._,112,9),i(e._,24,7),i(e._,8,8),t.H.n(e._,9),t.H.A(e._,9,e.J),t.H.l(e._,9),i(e.$,32,5),t.H.n(e.$,5),t.H.A(e.$,5,e.h),t.H.l(e.$,5),i(e.Q,19,0),i(e.C,286,0),i(e.D,30,0),i(e.v,320,0)}(),t.H.N}();function s(t){return[1,null,3,1,2,null,4][t.ctype]*t.depth}function o(t,e,n,i,r){let o=s(e);const c=Math.ceil(i*o/8);let l,h;o=Math.ceil(o/8);let u=t[n],f=0;if(u>1&&(t[n]=[0,0,1][u-2]),3==u)for(f=o;f<c;f++)t[f+1]=t[f+1]+(t[f+1-o]>>>1)&255;for(let e=0;e<r;e++)if(l=n+e*c,h=l+e+1,u=t[h-1],f=0,0==u)for(;f<c;f++)t[l+f]=t[h+f];else if(1==u){for(;f<o;f++)t[l+f]=t[h+f];for(;f<c;f++)t[l+f]=t[h+f]+t[l+f-o]}else if(2==u)for(;f<c;f++)t[l+f]=t[h+f]+t[l+f-c];else if(3==u){for(;f<o;f++)t[l+f]=t[h+f]+(t[l+f-c]>>>1);for(;f<c;f++)t[l+f]=t[h+f]+(t[l+f-c]+t[l+f-o]>>>1)}else{for(;f<o;f++)t[l+f]=t[h+f]+a(0,t[l+f-c],0);for(;f<c;f++)t[l+f]=t[h+f]+a(t[l+f-o],t[l+f-c],t[l+f-o-c])}return t}function a(t,e,n){const i=t+e-n,r=i-t,s=i-e,o=i-n;return r*r<=s*s&&r*r<=o*o?t:s*s<=o*o?e:n}function c(e,n,i){i.width=t.readUint(e,n),i.height=t.readUint(e,n+=4),i.depth=e[n+=4],n++,i.ctype=e[n],n++,i.compress=e[n],n++,i.filter=e[n],n++,i.interlace=e[n],n++}function l(t,e,n,i,r,s,o,a,c){const l=Math.min(e,r),h=Math.min(n,s);let u=0,f=0;for(let n=0;n<h;n++)for(let s=0;s<l;s++)if(o>=0&&a>=0?(u=n*e+s<<2,f=(a+n)*r+o+s<<2):(u=(-a+n)*e-o+s<<2,f=n*r+s<<2),0==c)i[f]=t[u],i[f+1]=t[u+1],i[f+2]=t[u+2],i[f+3]=t[u+3];else if(1==c){var d=t[u+3]*(1/255),p=t[u]*d,g=t[u+1]*d,v=t[u+2]*d,w=i[f+3]*(1/255),m=i[f]*w,y=i[f+1]*w,b=i[f+2]*w;const e=1-d,n=d+w*e,r=0==n?0:1/n;i[f+3]=255*n,i[f+0]=(p+m*e)*r,i[f+1]=(g+y*e)*r,i[f+2]=(v+b*e)*r}else if(2==c)p=t[u],g=t[u+1],v=t[u+2],m=i[f],y=i[f+1],b=i[f+2],(d=t[u+3])==(w=i[f+3])&&p==m&&g==y&&v==b?(i[f]=0,i[f+1]=0,i[f+2]=0,i[f+3]=0):(i[f]=p,i[f+1]=g,i[f+2]=v,i[f+3]=d);else if(3==c){if(p=t[u],g=t[u+1],v=t[u+2],m=i[f],y=i[f+1],b=i[f+2],(d=t[u+3])==(w=i[f+3])&&p==m&&g==y&&v==b)continue;if(d<220&&w>20)return!1}return!0}return{decode:function(e){const s=new Uint8Array(e);let o=8;const a=t,l=a.readUshort,h=a.readUint,u={tabs:{},frames:[]},f=new Uint8Array(s.length);let d,p=0,g=0;const v=[137,80,78,71,13,10,26,10];for(var w=0;w<8;w++)if(s[w]!=v[w])throw"The input is not a PNG file!";for(;o<s.length;){const t=a.readUint(s,o);o+=4;const e=a.readASCII(s,o,4);if(o+=4,"IHDR"==e)c(s,o,u);else if("iCCP"==e){for(var m=o;0!=s[m];)m++;a.readASCII(s,o,m-o);const n=s.slice(m+2,o+t);let c=null;try{c=i(n)}catch(t){c=r(n)}u.tabs[e]=c}else if("CgBI"==e)u.tabs[e]=s.slice(o,o+4);else if("IDAT"==e){for(w=0;w<t;w++)f[p+w]=s[o+w];p+=t}else if("acTL"==e)u.tabs[e]={num_frames:h(s,o),num_plays:h(s,o+4)},d=new Uint8Array(s.length);else if("fcTL"==e){0!=g&&((S=u.frames[u.frames.length-1]).data=n(u,d.slice(0,g),S.rect.width,S.rect.height),g=0);const t={x:h(s,o+12),y:h(s,o+16),width:h(s,o+4),height:h(s,o+8)};let e=l(s,o+22);e=l(s,o+20)/(0==e?100:e);const i={rect:t,delay:Math.round(1e3*e),dispose:s[o+24],blend:s[o+25]};u.frames.push(i)}else if("fdAT"==e){for(w=0;w<t-4;w++)d[g+w]=s[o+w+4];g+=t-4}else if("pHYs"==e)u.tabs[e]=[a.readUint(s,o),a.readUint(s,o+4),s[o+8]];else if("cHRM"==e)for(u.tabs[e]=[],w=0;w<8;w++)u.tabs[e].push(a.readUint(s,o+4*w));else if("tEXt"==e||"zTXt"==e){null==u.tabs[e]&&(u.tabs[e]={});var y=a.nextZero(s,o),b=a.readASCII(s,o,y-o),k=o+t-y-1;if("tEXt"==e)x=a.readASCII(s,y+1,k);else{var A=i(s.slice(y+2,y+2+k));x=a.readUTF8(A,0,A.length)}u.tabs[e][b]=x}else if("iTXt"==e){null==u.tabs[e]&&(u.tabs[e]={}),y=0,y=a.nextZero(s,m=o),b=a.readASCII(s,m,y-m);const n=s[m=y+1];var x;y=a.nextZero(s,m+=2),a.readASCII(s,m,y-m),y=a.nextZero(s,m=y+1),a.readUTF8(s,m,y-m),k=t-((m=y+1)-o),0==n?x=a.readUTF8(s,m,k):(A=i(s.slice(m,m+k)),x=a.readUTF8(A,0,A.length)),u.tabs[e][b]=x}else if("PLTE"==e)u.tabs[e]=a.readBytes(s,o,t);else if("hIST"==e){const t=u.tabs.PLTE.length/3;for(u.tabs[e]=[],w=0;w<t;w++)u.tabs[e].push(l(s,o+2*w))}else if("tRNS"==e)3==u.ctype?u.tabs[e]=a.readBytes(s,o,t):0==u.ctype?u.tabs[e]=l(s,o):2==u.ctype&&(u.tabs[e]=[l(s,o),l(s,o+2),l(s,o+4)]);else if("gAMA"==e)u.tabs[e]=a.readUint(s,o)/1e5;else if("sRGB"==e)u.tabs[e]=s[o];else if("bKGD"==e)0==u.ctype||4==u.ctype?u.tabs[e]=[l(s,o)]:2==u.ctype||6==u.ctype?u.tabs[e]=[l(s,o),l(s,o+2),l(s,o+4)]:3==u.ctype&&(u.tabs[e]=s[o]);else if("IEND"==e)break;o+=t,a.readUint(s,o),o+=4}var S;return 0!=g&&((S=u.frames[u.frames.length-1]).data=n(u,d.slice(0,g),S.rect.width,S.rect.height)),u.data=n(u,f,u.width,u.height),delete u.compress,delete u.interlace,delete u.filter,u},toRGBA8:function(t){const n=t.width,i=t.height;if(null==t.tabs.acTL)return[e(t.data,n,i,t).buffer];const r=[];null==t.frames[0].data&&(t.frames[0].data=t.data);const s=n*i*4,o=new Uint8Array(s),a=new Uint8Array(s),c=new Uint8Array(s);for(let u=0;u<t.frames.length;u++){const f=t.frames[u],d=f.rect.x,p=f.rect.y,g=f.rect.width,v=f.rect.height,w=e(f.data,g,v,t);if(0!=u)for(var h=0;h<s;h++)c[h]=o[h];if(0==f.blend?l(w,g,v,o,n,i,d,p,0):1==f.blend&&l(w,g,v,o,n,i,d,p,1),r.push(o.buffer.slice(0)),0==f.dispose);else if(1==f.dispose)l(a,g,v,o,n,i,d,p,0);else if(2==f.dispose)for(h=0;h<s;h++)o[h]=c[h]}return r},_paeth:a,_copyTile:l,_bin:t}}();!function(){const{_copyTile:t}=ot,{_bin:e}=ot,n=ot._paeth;var i={table:function(){const t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)1&n?n=3988292384^n>>>1:n>>>=1;t[e]=n}return t}(),update(t,e,n,r){for(let s=0;s<r;s++)t=i.table[255&(t^e[n+s])]^t>>>8;return t},crc:(t,e,n)=>4294967295^i.update(4294967295,t,e,n)};function r(t,e,n,i){e[n]+=t[0]*i>>4,e[n+1]+=t[1]*i>>4,e[n+2]+=t[2]*i>>4,e[n+3]+=t[3]*i>>4}function s(t){return Math.max(0,Math.min(255,t))}function o(t,e){const n=t[0]-e[0],i=t[1]-e[1],r=t[2]-e[2],s=t[3]-e[3];return n*n+i*i+r*r+s*s}function a(t,e,n,i,a,c,l){null==l&&(l=1);const h=i.length,u=[];for(var f=0;f<h;f++){const t=i[f];u.push([t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255])}for(f=0;f<h;f++){let t=4294967295;for(var d=0,p=0;p<h;p++){var g=o(u[f],u[p]);p!=f&&g<t&&(t=g,d=p)}}const v=new Uint32Array(a.buffer),w=new Int16Array(e*n*4),m=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(f=0;f<m.length;f++)m[f]=255*((m[f]+.5)/16-.5);for(let a=0;a<n;a++)for(let b=0;b<e;b++){var y;f=4*(a*e+b),y=2!=l?[s(t[f]+w[f]),s(t[f+1]+w[f+1]),s(t[f+2]+w[f+2]),s(t[f+3]+w[f+3])]:[s(t[f]+(g=m[4*(3&a)+(3&b)])),s(t[f+1]+g),s(t[f+2]+g),s(t[f+3]+g)],d=0;let k=16777215;for(p=0;p<h;p++){const t=o(y,u[p]);t<k&&(k=t,d=p)}const A=u[d],x=[y[0]-A[0],y[1]-A[1],y[2]-A[2],y[3]-A[3]];1==l&&(b!=e-1&&r(x,w,f+4,7),a!=n-1&&(0!=b&&r(x,w,f+4*e-4,3),r(x,w,f+4*e,5),b!=e-1&&r(x,w,f+4*e+4,1))),c[f>>2]=d,v[f>>2]=i[d]}}function c(t,n,r,s,o){null==o&&(o={});const{crc:a}=i,c=e.writeUint,l=e.writeUshort,h=e.writeASCII;let u=8;const f=t.frames.length>1;let d,p=!1,g=33+(f?20:0);if(null!=o.sRGB&&(g+=13),null!=o.pHYs&&(g+=21),null!=o.iCCP&&(d=pako.deflate(o.iCCP),g+=21+d.length+4),3==t.ctype){for(var v=t.plte.length,w=0;w<v;w++)t.plte[w]>>>24!=255&&(p=!0);g+=8+3*v+4+(p?8+1*v+4:0)}for(var m=0;m<t.frames.length;m++)f&&(g+=38),g+=(A=t.frames[m]).cimg.length+12,0!=m&&(g+=4);g+=12;const y=new Uint8Array(g),b=[137,80,78,71,13,10,26,10];for(w=0;w<8;w++)y[w]=b[w];if(c(y,u,13),u+=4,h(y,u,"IHDR"),u+=4,c(y,u,n),u+=4,c(y,u,r),u+=4,y[u]=t.depth,u++,y[u]=t.ctype,u++,y[u]=0,u++,y[u]=0,u++,y[u]=0,u++,c(y,u,a(y,u-17,17)),u+=4,null!=o.sRGB&&(c(y,u,1),u+=4,h(y,u,"sRGB"),u+=4,y[u]=o.sRGB,u++,c(y,u,a(y,u-5,5)),u+=4),null!=o.iCCP){const t=13+d.length;c(y,u,t),u+=4,h(y,u,"iCCP"),u+=4,h(y,u,"ICC profile"),u+=11,u+=2,y.set(d,u),u+=d.length,c(y,u,a(y,u-(t+4),t+4)),u+=4}if(null!=o.pHYs&&(c(y,u,9),u+=4,h(y,u,"pHYs"),u+=4,c(y,u,o.pHYs[0]),u+=4,c(y,u,o.pHYs[1]),u+=4,y[u]=o.pHYs[2],u++,c(y,u,a(y,u-13,13)),u+=4),f&&(c(y,u,8),u+=4,h(y,u,"acTL"),u+=4,c(y,u,t.frames.length),u+=4,c(y,u,null!=o.loop?o.loop:0),u+=4,c(y,u,a(y,u-12,12)),u+=4),3==t.ctype){for(c(y,u,3*(v=t.plte.length)),u+=4,h(y,u,"PLTE"),u+=4,w=0;w<v;w++){const e=3*w,n=t.plte[w],i=n>>>8&255,r=n>>>16&255;y[u+e+0]=255&n,y[u+e+1]=i,y[u+e+2]=r}if(u+=3*v,c(y,u,a(y,u-3*v-4,3*v+4)),u+=4,p){for(c(y,u,v),u+=4,h(y,u,"tRNS"),u+=4,w=0;w<v;w++)y[u+w]=t.plte[w]>>>24&255;u+=v,c(y,u,a(y,u-v-4,v+4)),u+=4}}let k=0;for(m=0;m<t.frames.length;m++){var A=t.frames[m];f&&(c(y,u,26),u+=4,h(y,u,"fcTL"),u+=4,c(y,u,k++),u+=4,c(y,u,A.rect.width),u+=4,c(y,u,A.rect.height),u+=4,c(y,u,A.rect.x),u+=4,c(y,u,A.rect.y),u+=4,l(y,u,s[m]),u+=2,l(y,u,1e3),u+=2,y[u]=A.dispose,u++,y[u]=A.blend,u++,c(y,u,a(y,u-30,30)),u+=4);const e=A.cimg;c(y,u,(v=e.length)+(0==m?0:4)),u+=4;const n=u;h(y,u,0==m?"IDAT":"fdAT"),u+=4,0!=m&&(c(y,u,k++),u+=4),y.set(e,u),u+=v,c(y,u,a(y,n,u-n)),u+=4}return c(y,u,0),u+=4,h(y,u,"IEND"),u+=4,c(y,u,a(y,u-4,4)),u+=4,y.buffer}function l(t,e,n){for(let i=0;i<t.frames.length;i++){const r=t.frames[i],s=r.rect.height,o=new Uint8Array(s*r.bpl+s);r.cimg=d(r.img,s,r.bpp,r.bpl,o,e,n)}}function h(e,n,i,r,s){const o=s[0],c=s[1],l=s[2],h=s[3],d=s[4],p=s[5];let v=6,w=8,m=255;for(var y=0;y<e.length;y++){const t=new Uint8Array(e[y]);for(var b=t.length,k=0;k<b;k+=4)m&=t[k+3]}const A=255!=m,x=function(e,n,i,r,s,o){const a=[];for(var c=0;c<e.length;c++){const u=new Uint8Array(e[c]),d=new Uint32Array(u.buffer);var l;let g=0,v=0,w=n,m=i,y=r?1:0;if(0!=c){const b=o||r||1==c||0!=a[c-2].dispose?1:2;let k=0,A=1e9;for(let t=0;t<b;t++){var h=new Uint8Array(e[c-1-t]);const r=new Uint32Array(e[c-1-t]);let o=n,a=i,l=-1,u=-1;for(let t=0;t<i;t++)for(let e=0;e<n;e++)d[p=t*n+e]!=r[p]&&(e<o&&(o=e),e>l&&(l=e),t<a&&(a=t),t>u&&(u=t));-1==l&&(o=a=l=u=0),s&&(!(1&~o)&&o--,!(1&~a)&&a--);const f=(l-o+1)*(u-a+1);f<A&&(A=f,k=t,g=o,v=a,w=l-o+1,m=u-a+1)}h=new Uint8Array(e[c-1-k]),1==k&&(a[c-1].dispose=2),l=new Uint8Array(w*m*4),t(h,n,i,l,w,m,-g,-v,0),y=t(u,n,i,l,w,m,-g,-v,3)?1:0,1==y?f(u,n,i,l,{x:g,y:v,width:w,height:m}):t(u,n,i,l,w,m,-g,-v,0)}else l=u.slice(0);a.push({rect:{x:g,y:v,width:w,height:m},img:l,blend:y,dispose:0})}if(r)for(c=0;c<a.length;c++){if(1==(g=a[c]).blend)continue;const t=g.rect,r=a[c-1].rect,o=Math.min(t.x,r.x),l=Math.min(t.y,r.y),h={x:o,y:l,width:Math.max(t.x+t.width,r.x+r.width)-o,height:Math.max(t.y+t.height,r.y+r.height)-l};a[c-1].dispose=1,c-1!=0&&u(e,n,i,a,c-1,h,s),u(e,n,i,a,c,h,s)}let d=0;if(1!=e.length)for(var p=0;p<a.length;p++){var g;d+=(g=a[p]).rect.width*g.rect.height}return a}(e,n,i,o,c,l),S={},M=[],z=[];if(0!=r){const t=[];for(k=0;k<x.length;k++)t.push(x[k].img.buffer);const e=function(t){let e=0;for(var n=0;n<t.length;n++)e+=t[n].byteLength;const i=new Uint8Array(e);let r=0;for(n=0;n<t.length;n++){const e=new Uint8Array(t[n]),s=e.length;for(let t=0;t<s;t+=4){let n=e[t],s=e[t+1],o=e[t+2];const a=e[t+3];0==a&&(n=s=o=0),i[r+t]=n,i[r+t+1]=s,i[r+t+2]=o,i[r+t+3]=a}r+=s}return i.buffer}(t),n=g(e,r);for(k=0;k<n.plte.length;k++)M.push(n.plte[k].est.rgba);let i=0;for(k=0;k<x.length;k++){const t=(C=x[k]).img.length;var $=new Uint8Array(n.inds.buffer,i>>2,t>>2);z.push($);const e=new Uint8Array(n.abuf,i,t);p&&a(C.img,C.rect.width,C.rect.height,M,e,$),C.img.set(e),i+=t}}else for(y=0;y<x.length;y++){var C=x[y];const t=new Uint32Array(C.img.buffer);var T=C.rect.width;for(b=t.length,$=new Uint8Array(b),z.push($),k=0;k<b;k++){const e=t[k];if(0!=k&&e==t[k-1])$[k]=$[k-1];else if(k>T&&e==t[k-T])$[k]=$[k-T];else{let t=S[e];if(null==t&&(S[e]=t=M.length,M.push(e),M.length>=300))break;$[k]=t}}}const I=M.length;for(I<=256&&0==d&&(w=I<=2?1:I<=4?2:I<=16?4:8,w=Math.max(w,h)),y=0;y<x.length;y++){const t=(C=x[y]).rect.height;let e=C.img,n=4*(T=C.rect.width),i=4;if(I<=256&&0==d){n=Math.ceil(w*T/8);var j=new Uint8Array(n*t);const r=z[y];for(let e=0;e<t;e++){k=e*n;const t=e*T;if(8==w)for(var E=0;E<T;E++)j[k+E]=r[t+E];else if(4==w)for(E=0;E<T;E++)j[k+(E>>1)]|=r[t+E]<<4-4*(1&E);else if(2==w)for(E=0;E<T;E++)j[k+(E>>2)]|=r[t+E]<<6-2*(3&E);else if(1==w)for(E=0;E<T;E++)j[k+(E>>3)]|=r[t+E]<<7-1*(7&E)}e=j,v=3,i=1}else if(0==A&&1==x.length){j=new Uint8Array(T*t*3);const r=T*t;for(k=0;k<r;k++){const t=3*k,n=4*k;j[t]=e[n],j[t+1]=e[n+1],j[t+2]=e[n+2]}e=j,v=2,i=3,n=3*T}C.img=e,C.bpl=n,C.bpp=i}return{ctype:v,depth:w,plte:M,frames:x}}function u(e,n,i,r,s,o,a){const c=Uint8Array,l=Uint32Array,h=new c(e[s-1]),u=new l(e[s-1]),d=s+1<e.length?new c(e[s+1]):null,p=new c(e[s]),g=new l(p.buffer);let v=n,w=i,m=-1,y=-1;for(let t=0;t<o.height;t++)for(let e=0;e<o.width;e++){const i=o.x+e,a=o.y+t,c=a*n+i,l=g[c];0==l||0==r[s-1].dispose&&u[c]==l&&(null==d||0!=d[4*c+3])||(i<v&&(v=i),i>m&&(m=i),a<w&&(w=a),a>y&&(y=a))}-1==m&&(v=w=m=y=0),a&&(!(1&~v)&&v--,!(1&~w)&&w--);const b=r[s];b.rect=o={x:v,y:w,width:m-v+1,height:y-w+1},b.blend=1,b.img=new Uint8Array(o.width*o.height*4),0==r[s-1].dispose?(t(h,n,i,b.img,o.width,o.height,-o.x,-o.y,0),f(p,n,i,b.img,o)):t(p,n,i,b.img,o.width,o.height,-o.x,-o.y,0)}function f(e,n,i,r,s){t(e,n,i,r,s.width,s.height,-s.x,-s.y,2)}function d(t,e,n,i,r,s,o){const a=[];let c,l=[0,1,2,3,4];-1!=s?l=[s]:(e*i>5e5||1==n)&&(l=[0]),o&&(c={level:0});const h=st;for(var u=0;u<l.length;u++){for(let s=0;s<e;s++)p(r,t,s,i,n,l[u]);a.push(h.deflate(r,c))}let f,d=1e9;for(u=0;u<a.length;u++)a[u].length<d&&(f=u,d=a[u].length);return a[f]}function p(t,e,i,r,s,o){const a=i*r;let c=a+i;if(t[c]=o,c++,0==o)if(r<500)for(var l=0;l<r;l++)t[c+l]=e[a+l];else t.set(new Uint8Array(e.buffer,a,r),c);else if(1==o){for(l=0;l<s;l++)t[c+l]=e[a+l];for(l=s;l<r;l++)t[c+l]=e[a+l]-e[a+l-s]+256&255}else if(0==i){for(l=0;l<s;l++)t[c+l]=e[a+l];if(2==o)for(l=s;l<r;l++)t[c+l]=e[a+l];if(3==o)for(l=s;l<r;l++)t[c+l]=e[a+l]-(e[a+l-s]>>1)+256&255;if(4==o)for(l=s;l<r;l++)t[c+l]=e[a+l]-n(e[a+l-s],0,0)+256&255}else{if(2==o)for(l=0;l<r;l++)t[c+l]=e[a+l]+256-e[a+l-r]&255;if(3==o){for(l=0;l<s;l++)t[c+l]=e[a+l]+256-(e[a+l-r]>>1)&255;for(l=s;l<r;l++)t[c+l]=e[a+l]+256-(e[a+l-r]+e[a+l-s]>>1)&255}if(4==o){for(l=0;l<s;l++)t[c+l]=e[a+l]+256-n(0,e[a+l-r],0)&255;for(l=s;l<r;l++)t[c+l]=e[a+l]+256-n(e[a+l-s],e[a+l-r],e[a+l-s-r])&255}}}function g(t,e){const n=new Uint8Array(t),i=n.slice(0),r=new Uint32Array(i.buffer),s=v(i,e),o=s[0],a=s[1],c=n.length,l=new Uint8Array(c>>2);let h;if(n.length<2e7)for(var u=0;u<c;u+=4)h=w(o,f=n[u]*(1/255),d=n[u+1]*(1/255),p=n[u+2]*(1/255),g=n[u+3]*(1/255)),l[u>>2]=h.ind,r[u>>2]=h.est.rgba;else for(u=0;u<c;u+=4){var f=n[u]*(1/255),d=n[u+1]*(1/255),p=n[u+2]*(1/255),g=n[u+3]*(1/255);for(h=o;h.left;)h=m(h.est,f,d,p,g)<=0?h.left:h.right;l[u>>2]=h.ind,r[u>>2]=h.est.rgba}return{abuf:i.buffer,inds:l,plte:a}}function v(t,e,n){null==n&&(n=1e-4);const i=new Uint32Array(t.buffer),r={i0:0,i1:t.length,bst:null,est:null,tdst:0,left:null,right:null};r.bst=k(t,r.i0,r.i1),r.est=A(r.bst);const s=[r];for(;s.length<e;){let e=0,r=0;for(var o=0;o<s.length;o++)s[o].est.L>e&&(e=s[o].est.L,r=o);if(e<n)break;const a=s[r],c=y(t,i,a.i0,a.i1,a.est.e,a.est.eMq255);if(a.i0>=c||a.i1<=c){a.est.L=0;continue}const l={i0:a.i0,i1:c,bst:null,est:null,tdst:0,left:null,right:null};l.bst=k(t,l.i0,l.i1),l.est=A(l.bst);const h={i0:c,i1:a.i1,bst:null,est:null,tdst:0,left:null,right:null};for(h.bst={R:[],m:[],N:a.bst.N-l.bst.N},o=0;o<16;o++)h.bst.R[o]=a.bst.R[o]-l.bst.R[o];for(o=0;o<4;o++)h.bst.m[o]=a.bst.m[o]-l.bst.m[o];h.est=A(h.bst),a.left=l,a.right=h,s[r]=l,s.push(h)}for(s.sort(((t,e)=>e.bst.N-t.bst.N)),o=0;o<s.length;o++)s[o].ind=o;return[r,s]}function w(t,e,n,i,r){if(null==t.left)return t.tdst=function(t,e,n,i,r){const s=e-t[0],o=n-t[1],a=i-t[2],c=r-t[3];return s*s+o*o+a*a+c*c}(t.est.q,e,n,i,r),t;const s=m(t.est,e,n,i,r);let o=t.left,a=t.right;s>0&&(o=t.right,a=t.left);const c=w(o,e,n,i,r);if(c.tdst<=s*s)return c;const l=w(a,e,n,i,r);return l.tdst<c.tdst?l:c}function m(t,e,n,i,r){const{e:s}=t;return s[0]*e+s[1]*n+s[2]*i+s[3]*r-t.eMq}function y(t,e,n,i,r,s){for(i-=4;n<i;){for(;b(t,n,r)<=s;)n+=4;for(;b(t,i,r)>s;)i-=4;if(n>=i)break;const o=e[n>>2];e[n>>2]=e[i>>2],e[i>>2]=o,n+=4,i-=4}for(;b(t,n,r)>s;)n-=4;return n+4}function b(t,e,n){return t[e]*n[0]+t[e+1]*n[1]+t[e+2]*n[2]+t[e+3]*n[3]}function k(t,e,n){const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=[0,0,0,0],s=n-e>>2;for(let s=e;s<n;s+=4){const e=t[s]*(1/255),n=t[s+1]*(1/255),o=t[s+2]*(1/255),a=t[s+3]*(1/255);r[0]+=e,r[1]+=n,r[2]+=o,r[3]+=a,i[0]+=e*e,i[1]+=e*n,i[2]+=e*o,i[3]+=e*a,i[5]+=n*n,i[6]+=n*o,i[7]+=n*a,i[10]+=o*o,i[11]+=o*a,i[15]+=a*a}return i[4]=i[1],i[8]=i[2],i[9]=i[6],i[12]=i[3],i[13]=i[7],i[14]=i[11],{R:i,m:r,N:s}}function A(t){const{R:e}=t,{m:n}=t,{N:i}=t,r=n[0],s=n[1],o=n[2],a=n[3],c=0==i?0:1/i,l=[e[0]-r*r*c,e[1]-r*s*c,e[2]-r*o*c,e[3]-r*a*c,e[4]-s*r*c,e[5]-s*s*c,e[6]-s*o*c,e[7]-s*a*c,e[8]-o*r*c,e[9]-o*s*c,e[10]-o*o*c,e[11]-o*a*c,e[12]-a*r*c,e[13]-a*s*c,e[14]-a*o*c,e[15]-a*a*c],h=l,u=x;let f=[Math.random(),Math.random(),Math.random(),Math.random()],d=0,p=0;if(0!=i)for(let t=0;t<16&&(f=u.multVec(h,f),p=Math.sqrt(u.dot(f,f)),f=u.sml(1/p,f),!(0!=t&&Math.abs(p-d)<1e-9));t++)d=p;const g=[r*c,s*c,o*c,a*c];return{Cov:l,q:g,e:f,L:d,eMq255:u.dot(u.sml(255,g),f),eMq:u.dot(f,g),rgba:(Math.round(255*g[3])<<24|Math.round(255*g[2])<<16|Math.round(255*g[1])<<8|Math.round(255*g[0]))>>>0}}var x={multVec:(t,e)=>[t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3],t[4]*e[0]+t[5]*e[1]+t[6]*e[2]+t[7]*e[3],t[8]*e[0]+t[9]*e[1]+t[10]*e[2]+t[11]*e[3],t[12]*e[0]+t[13]*e[1]+t[14]*e[2]+t[15]*e[3]],dot:(t,e)=>t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3],sml:(t,e)=>[t*e[0],t*e[1],t*e[2],t*e[3]]};ot.encode=function(t,e,n,i,r,s,o){null==i&&(i=0),null==o&&(o=!1);const a=h(t,e,n,i,[!1,!1,!1,0,o,!1]);return l(a,-1),c(a,e,n,r,s)},ot.encodeLL=function(t,e,n,i,r,s,o,a){const h={ctype:0+(1==i?0:2)+(0==r?0:4),depth:s,frames:[]},u=(i+r)*s,f=u*e;for(let i=0;i<t.length;i++)h.frames.push({rect:{x:0,y:0,width:e,height:n},img:new Uint8Array(t[i]),blend:0,dispose:1,bpp:Math.ceil(u/8),bpl:Math.ceil(f/8)});return l(h,0,!0),c(h,e,n,o,a)},ot.encode.compress=h,ot.encode.dither=a,ot.quantize=g,ot.quantize.getKDtree=v,ot.quantize.getNearest=w}();const at={toArrayBuffer(t,e){const n=t.width,i=t.height,r=n<<2,s=t.getContext("2d").getImageData(0,0,n,i),o=new Uint32Array(s.data.buffer),a=(32*n+31)/32<<2,c=a*i,l=122+c,h=new ArrayBuffer(l),u=new DataView(h),f=1<<20;let d,p,g,v,w=f,m=0,y=0,b=0;function k(t){u.setUint16(y,t,!0),y+=2}function A(t){u.setUint32(y,t,!0),y+=4}function x(t){y+=t}k(19778),A(l),x(4),A(122),A(108),A(n),A(-i>>>0),k(1),k(32),A(3),A(c),A(2835),A(2835),x(8),A(16711680),A(65280),A(255),A(4278190080),A(1466527264),function t(){for(;m<i&&w>0;){for(v=122+m*a,d=0;d<r;)w--,p=o[b++],g=p>>>24,u.setUint32(v+d,p<<8|g),d+=4;m++}b<o.length?(w=f,setTimeout(t,at._dly)):e(h)}()},toBlob(t,e){this.toArrayBuffer(t,(t=>{e(new Blob([t],{type:"image/bmp"}))}))},_dly:9};var ct={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},lt={[ct.CHROME]:16384,[ct.FIREFOX]:11180,[ct.DESKTOP_SAFARI]:16384,[ct.IE]:8192,[ct.IOS]:4096,[ct.ETC]:8192};const ht="undefined"!=typeof window,ut="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,ft=ht&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),dt=(ht||ut)&&(ft&&ft.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),pt=(ht||ut)&&(ft&&ft.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function gt(t,e,n=Date.now()){return new Promise((i=>{const r=t.split(","),s=r[0].match(/:(.*?);/)[1],o=globalThis.atob(r[1]);let a=o.length;const c=new Uint8Array(a);for(;a--;)c[a]=o.charCodeAt(a);const l=new Blob([c],{type:s});l.name=e,l.lastModified=n,i(l)}))}function vt(t){return new Promise(((e,n)=>{const i=new pt;i.onload=()=>e(i.result),i.onerror=t=>n(t),i.readAsDataURL(t)}))}function wt(t){return new Promise(((e,n)=>{const i=new Image;i.onload=()=>e(i),i.onerror=t=>n(t),i.src=t}))}function mt(){if(void 0!==mt.cachedResult)return mt.cachedResult;let t=ct.ETC;const{userAgent:e}=navigator;return/Chrom(e|ium)/i.test(e)?t=ct.CHROME:/iP(ad|od|hone)/i.test(e)&&/WebKit/i.test(e)?t=ct.IOS:/Safari/i.test(e)?t=ct.DESKTOP_SAFARI:/Firefox/i.test(e)?t=ct.FIREFOX:(/MSIE/i.test(e)||1==!!document.documentMode)&&(t=ct.IE),mt.cachedResult=t}function yt(t,e){const n=mt(),i=lt[n];let r=t,s=e,o=r*s;const a=r>s?s/r:r/s;for(;o>i*i;){const t=(i+r)/2,e=(i+s)/2;t<e?(s=e,r=e*a):(s=t*a,r=t),o=r*s}return{width:r,height:s}}function bt(t,e){let n,i;try{if(n=new OffscreenCanvas(t,e),i=n.getContext("2d"),null===i)throw new Error("getContext of OffscreenCanvas returns null")}catch(t){n=document.createElement("canvas"),i=n.getContext("2d")}return n.width=t,n.height=e,[n,i]}function kt(t,e){const{width:n,height:i}=yt(t.width,t.height),[r,s]=bt(n,i);return e&&/jpe?g/.test(e)&&(s.fillStyle="white",s.fillRect(0,0,r.width,r.height)),s.drawImage(t,0,0,r.width,r.height),r}function At(){return void 0!==At.cachedResult||(At.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),At.cachedResult}function xt(t,e={}){return new Promise((function(n,i){let r,s;var o=function(){try{return s=kt(r,e.fileType||t.type),n([r,s])}catch(t){return i(t)}},a=function(){try{var e=function(t){try{throw t}catch(t){return i(t)}};try{let n;return vt(t).then((function(t){try{return n=t,wt(n).then((function(t){try{return r=t,function(){try{return o()}catch(t){return i(t)}}()}catch(t){return e(t)}}),e)}catch(t){return e(t)}}),e)}catch(t){e(t)}}catch(t){return i(t)}};try{if(At()||[ct.DESKTOP_SAFARI,ct.MOBILE_SAFARI].includes(mt()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(t).then((function(t){try{return r=t,o()}catch(t){return a()}}),a)}catch(t){a()}}))}function St(t,e,n,i,r=1){return new Promise((function(s,o){let a;if("image/png"===e){let l,h,u;return l=t.getContext("2d"),({data:h}=l.getImageData(0,0,t.width,t.height)),u=ot.encode([h.buffer],t.width,t.height,4096*r),a=new Blob([u],{type:e}),a.name=n,a.lastModified=i,c.call(this)}{if("image/bmp"===e)return new Promise((e=>at.toBlob(t,e))).then(function(t){try{return a=t,a.name=n,a.lastModified=i,f.call(this)}catch(t){return o(t)}}.bind(this),o);{if("function"==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)return t.convertToBlob({type:e,quality:r}).then(function(t){try{return a=t,a.name=n,a.lastModified=i,d.call(this)}catch(t){return o(t)}}.bind(this),o);{let p;return p=t.toDataURL(e,r),gt(p,n,i).then(function(t){try{return a=t,d.call(this)}catch(t){return o(t)}}.bind(this),o)}function d(){return f.call(this)}}function f(){return c.call(this)}}function c(){return s(a)}}))}function Mt(t){t.width=0,t.height=0}function zt(){return new Promise((function(t,e){let n,i,r,s;return void 0!==zt.cachedResult?t(zt.cachedResult):gt("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(o){try{return n=o,xt(n).then((function(o){try{return i=o[1],St(i,n.type,n.name,n.lastModified).then((function(n){try{return r=n,Mt(i),xt(r).then((function(n){try{return s=n[0],t(zt.cachedResult=1===s.width&&2===s.height)}catch(t){return e(t)}}),e)}catch(t){return e(t)}}),e)}catch(t){return e(t)}}),e)}catch(t){return e(t)}}),e)}))}function $t(t){return new Promise(((e,n)=>{const i=new pt;i.onload=t=>{const n=new DataView(t.target.result);if(65496!=n.getUint16(0,!1))return e(-2);const i=n.byteLength;let r=2;for(;r<i;){if(n.getUint16(r+2,!1)<=8)return e(-1);const t=n.getUint16(r,!1);if(r+=2,65505==t){if(1165519206!=n.getUint32(r+=2,!1))return e(-1);const t=18761==n.getUint16(r+=6,!1);r+=n.getUint32(r+4,t);const i=n.getUint16(r,t);r+=2;for(let s=0;s<i;s++)if(274==n.getUint16(r+12*s,t))return e(n.getUint16(r+12*s+8,t))}else{if(65280&~t)break;r+=n.getUint16(r,!1)}}return e(-1)},i.onerror=t=>n(t),i.readAsArrayBuffer(t)}))}function Ct(t,e){const{width:n}=t,{height:i}=t,{maxWidthOrHeight:r}=e;let s,o=t;return isFinite(r)&&(n>r||i>r)&&([o,s]=bt(n,i),n>i?(o.width=r,o.height=i/n*r):(o.width=n/i*r,o.height=r),s.drawImage(t,0,0,o.width,o.height),Mt(t)),o}function Tt(t,e){const{width:n}=t,{height:i}=t,[r,s]=bt(n,i);switch(e>4&&e<9?(r.width=i,r.height=n):(r.width=n,r.height=i),e){case 2:s.transform(-1,0,0,1,n,0);break;case 3:s.transform(-1,0,0,-1,n,i);break;case 4:s.transform(1,0,0,-1,0,i);break;case 5:s.transform(0,1,1,0,0,0);break;case 6:s.transform(0,1,-1,0,i,0);break;case 7:s.transform(0,-1,-1,0,i,n);break;case 8:s.transform(0,-1,1,0,0,n)}return s.drawImage(t,0,0,n,i),Mt(t),r}function It(t,e,n=0){return new Promise((function(i,r){let s,o,a,c,l,h,u,f,d,p,g,v,w,m,y,b,k,A,x,S;function M(t=5){if(e.signal&&e.signal.aborted)throw e.signal.reason;s+=t,e.onProgress(Math.min(s,100))}function z(t){if(e.signal&&e.signal.aborted)throw e.signal.reason;s=Math.min(Math.max(t,s),100),e.onProgress(s)}return s=n,o=e.maxIteration||10,a=1024*e.maxSizeMB*1024,M(),xt(t,e).then(function(n){try{return[,c]=n,M(),l=Ct(c,e),M(),new Promise((function(n,i){var r;if(!(r=e.exifOrientation))return $t(t).then(function(t){try{return r=t,s.call(this)}catch(t){return i(t)}}.bind(this),i);function s(){return n(r)}return s.call(this)})).then(function(n){try{return h=n,M(),zt().then(function(n){try{return u=n?l:Tt(l,h),M(),f=e.initialQuality||1,d=e.fileType||t.type,St(u,d,t.name,t.lastModified,f).then(function(n){try{{if(p=n,M(),g=p.size>a,v=p.size>t.size,!g&&!v)return z(100),i(p);var s;function h(){if(o--&&(y>a||y>w)){let e,n;return e=S?.95*x.width:x.width,n=S?.95*x.height:x.height,[k,A]=bt(e,n),A.drawImage(x,0,0,e,n),f*="image/png"===d?.85:.95,St(k,d,t.name,t.lastModified,f).then((function(t){try{return b=t,Mt(x),x=k,y=b.size,z(Math.min(99,Math.floor((m-y)/(m-a)*100))),h}catch(t){return r(t)}}),r)}return[1]}return w=t.size,m=p.size,y=m,x=u,S=!e.alwaysKeepResolution&&g,(s=function(t){for(;t;){if(t.then)return void t.then(s,r);try{if(t.pop){if(t.length)return t.pop()?$.call(this):t;t=h}else t=t.call(this)}catch(t){return r(t)}}}.bind(this))(h);function $(){return Mt(x),Mt(k),Mt(l),Mt(u),Mt(c),z(100),i(b)}}}catch(C){return r(C)}}.bind(this),r)}catch(t){return r(t)}}.bind(this),r)}catch(t){return r(t)}}.bind(this),r)}catch(t){return r(t)}}.bind(this),r)}))}let jt;function Et(t,e){return new Promise(((n,i)=>{jt||(jt=function(){const t=[];return t.push("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"),URL.createObjectURL(new Blob(t))}());const r=new Worker(jt);r.addEventListener("message",(function(t){if(e.signal&&e.signal.aborted)r.terminate();else if(void 0===t.data.progress){if(t.data.error)return i(new Error(t.data.error)),void r.terminate();n(t.data.file),r.terminate()}else e.onProgress(t.data.progress)})),r.addEventListener("error",i),e.signal&&e.signal.addEventListener("abort",(()=>{i(e.signal.reason),r.terminate()})),r.postMessage({file:t,imageCompressionLibUrl:e.libURL,options:{...e,onProgress:void 0,signal:void 0}})}))}function _t(t,e){return new Promise((function(n,i){let r,s,o,a,c,l;if(r={...e},o=0,({onProgress:a}=r),r.maxSizeMB=r.maxSizeMB||Number.POSITIVE_INFINITY,c="boolean"!=typeof r.useWebWorker||r.useWebWorker,delete r.useWebWorker,r.onProgress=t=>{o=t,"function"==typeof a&&a(o)},!(t instanceof Blob||t instanceof dt))return i(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(t.type))return i(new Error("The file given is not an image"));if(l="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!c||"function"!=typeof Worker||l)return It(t,r).then(function(t){try{return s=t,f.call(this)}catch(t){return i(t)}}.bind(this),i);var h=function(){try{return f.call(this)}catch(t){return i(t)}}.bind(this),u=function(){try{return It(t,r).then((function(t){try{return s=t,h()}catch(t){return i(t)}}),i)}catch(t){return i(t)}};try{return r.libURL=r.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Et(t,r).then((function(t){try{return s=t,h()}catch(t){return u()}}),u)}catch(t){u()}function f(){try{s.name=t.name,s.lastModified=t.lastModified}catch(t){}try{r.preserveExif&&"image/jpeg"===t.type&&(!r.fileType||r.fileType&&r.fileType===t.type)&&(s=et(t,s))}catch(t){}return n(s)}}))}_t.getDataUrlFromFile=vt,_t.getFilefromDataUrl=gt,_t.loadImage=wt,_t.drawImageInCanvas=kt,_t.drawFileInCanvas=xt,_t.canvasToFile=St,_t.getExifOrientation=$t,_t.handleMaxWidthOrHeight=Ct,_t.followExifOrientation=Tt,_t.cleanupCanvasMemory=Mt,_t.isAutoOrientationInBrowser=zt,_t.approximateBelowMaximumCanvasSizeOfBrowser=yt,_t.copyExifWithoutOrientation=et,_t.getBrowserName=mt,_t.version="2.0.2";class Lt extends a{toolType="image";fileInput=null;maxCompressionSize=1200;multiImportOffset=20;constructor(t){super(t),this.setupFileInput()}onActivate(){this.openFilePicker()}openFilePicker(){this._core.store.isDisabled||this.fileInput?.click()}setupFileInput(){this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.accept="image/*",this.fileInput.multiple=!0,this.fileInput.style.display="none",this.fileInput.addEventListener("change",this.handleFileSelect.bind(this)),this.fileInput.addEventListener("cancel",this.handleCancel.bind(this)),document.body.appendChild(this.fileInput)}handleFileSelect(t){const e=t.target,n=e.files?Array.from(e.files):[];if(0===n.length)return console.info("File selection cancelled by user."),this.handleCancel(),void(e&&(e.value=""));const i=n.map((t=>_t(t,{maxWidthOrHeight:this.maxCompressionSize}).then((t=>u.fromBlob(this._core,t)))));Promise.allSettled(i).then((t=>{const e=[];for(const n of t)"fulfilled"===n.status?e.push(n.value):console.error("Error during image compression or processing:",n.reason);0!==e.length?this.addImagesToStore(e):this.handleCancel()})),e&&(e.value="")}addImagesToStore(t){const e=this._core.store.currentZIndex;t.forEach(((t,n)=>{if(t.zIndex=e+n,t.centerInViewport(),n>0){const e=n*this.multiImportOffset;t.updatePosition(t.translateX+e,t.translateY+e)}this._core.addObject(t)})),this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection")),this._core.selectObjects(t),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded(t)}handleCancel(){this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection"))}}class Ot extends a{toolType="shape";shapeType=f.Rectangle;fillColor={light:"transparent",dark:"transparent"};strokeColor=x[0];strokeWidth=4;opacity=1;fontFamily="Arial";fontSize=16;fontColor=x[0];palette=[...x];sizes=[...c];startX=0;startY=0;isDrawing=!1;currentShape=null;constructor(t){super(t)}handlePointerDown(t){if(t.cancelable&&t.preventDefault(),"mouse"===t.pointerType){const e=t.composedPath().slice(1).find((t=>t.classList&&t.classList.contains("object"))),n=this._core.findObjectById(e?.id),i=this._core.store.activeShape;if(null===i&&n instanceof d)return void n.edit(t);if(null!==i&&n instanceof d)return i.save(),void n.edit(t);if(null!==i&&n instanceof d==0)return this._core.resetActiveShape(),void this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection"));if(!1===l.isLeftClick(t))return;this.startDrawing(t.clientX,t.clientY)}if("touch"===t.pointerType||"pen"===t.pointerType){const e=Array.from(this._core.store.state.pointers.values()),n=t.composedPath().slice(1).find((t=>t.classList&&t.classList.contains("object"))),i=this._core.findObjectById(n?.id),r=this._core.store.activeShape;if(null===r&&i instanceof d)return void i.edit(t);if(null!==r&&i instanceof d)return r.save(),void i.edit(t);if(null!==r&&i instanceof d==0)return this._core.resetActiveShape(),void this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection"));if(e.length>1)return;const s=Math.round(e[0].clientX),o=Math.round(e[0].clientY);this.startDrawing(s,o)}}handlePointerMove(t){if(t.cancelable&&t.preventDefault(),this.isDrawing&&this.currentShape&&("mouse"===t.pointerType&&this.updateShapeSize(t.clientX,t.clientY),"touch"===t.pointerType||"pen"===t.pointerType)){const t=Array.from(this._core.store.state.pointers.values());if(1===t.length){const e=Math.round(t[0].clientX),n=Math.round(t[0].clientY);this.updateShapeSize(e,n)}}}handlePointerUp(t){t.cancelable&&t.preventDefault(),this.isDrawing&&this.currentShape&&this.finishDrawing()}startDrawing(t,e){const n=this._core.store.state.scale,i=this._core.store.state.lockDrawingScale,r=i?n:1;this.startX=(t-this._core.store.offsetX)/r,this.startY=(e-this._core.store.offsetY)/r,this.isDrawing=!0,this.currentShape=d.create(this._core,{x:this.startX,y:this.startY,translateX:-this._core.store.state.translateX/r,translateY:-this._core.store.state.translateY/r,width:1,height:1,shapeType:this.shapeType,fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,opacity:this.opacity,fontSize:this.fontSize,fontFamily:this.fontFamily,scale:i?1:n}),this._core.store.objects.insert(this.currentShape),this._core.store.objects?.setActiveDrawingObject(this.currentShape.id),this._core.rerender()}updateShapeSize(t,e){if(!this.currentShape)return;const n=this._core.store.state.lockDrawingScale?this._core.store.state.scale:1,i=(t-this._core.store.offsetX)/n,r=(e-this._core.store.offsetY)/n,s=Math.min(this.startX,i),o=Math.min(this.startY,r),a=Math.abs(i-this.startX),c=Math.abs(r-this.startY);this.currentShape.x=s,this.currentShape.y=o,this.currentShape.width=Math.max(1,a),this.currentShape.height=Math.max(1,c),this.currentShape.translateX=-this._core.store.state.translateX/n,this.currentShape.translateY=-this._core.store.state.translateY/n,this.currentShape.updateDimensions(),this._core.store.objects.update(this.currentShape)}finishDrawing(){if(this.currentShape){if(this.currentShape.width<10&&this.currentShape.height<10){const t=this.currentShape.id;this._core.store.objects.remove((e=>e.id===t))}else this.currentShape.zIndex=this._core.store.currentZIndex,this._core.store.objects.update(this.currentShape),this._core.engine.emitObjectsChange(),this._core.engine.emitObjectsAdded([this.currentShape]),this._core.selectObjects([this.currentShape]),this._core.store.setState("activeTool",this._core.toolRegistry.getTool("selection"));this.isDrawing=!1,this._core.store.objects?.setActiveDrawingObject(null),this.currentShape=null,this._core.store.objects?.stopUndoCapturing(),this._core.rerender()}}}class Pt{static _pointerCursor=null;static getPointerCursor(){return this._pointerCursor||(this._pointerCursor=this.getCursor({iconName:"pointer"})),this._pointerCursor}static getCursor(t){const e="default"===t.iconName?"mouse-pointer":t.iconName,n=K.get(e);if(!n)return console.warn(`Icon "${e}" not found in registry.`),"auto";const i=t.size||24,r=t.rotation||0,s=t.color||"black",o=t.hotspot||("default"===t.iconName?{x:4,y:4}:{x:i/2,y:i/2});let a=n.replace(/width="\d+"/,`width="${i}"`).replace(/height="\d+"/,`height="${i}"`).replace(/currentColor/g,s);const c=i/2;return`url('data:image/svg+xml;charset=utf-8,${encodeURIComponent(`\n <svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${i}" viewBox="0 0 ${i} ${i}">\n <g transform="rotate(${r} ${c} ${c})">\n ${a}\n </g>\n </svg>\n `.replace(/\s+/g," ").trim()).replace(/'/g,"%27").replace(/"/g,"%22")}') ${o.x} ${o.y}, auto`}}class Bt{_core;_anchorIndex=new Map;constructor(t){this._core=t}setAnchor(t,e,n){const i=this.getLineById(t);if(!i)return;if("start"===e&&i.endAnchor?.objectId===n)return;if("end"===e&&i.startAnchor?.objectId===n)return;this.removeAnchor(t,e);const r={objectId:n};"start"===e?i.startAnchor=r:i.endAnchor=r,this.addToIndex(n,t,e),this.snapEndpointToObject(i,e,n),this._core.store.objects.update(i)}removeAnchor(t,e){const n=this.getLineById(t);if(!n)return;const i="start"===e?n.startAnchor:n.endAnchor;i&&(this.removeFromIndex(i.objectId,t,e),"start"===e?n.startAnchor=void 0:n.endAnchor=void 0)}getAnchor(t,e){const n=this.getLineById(t);return n?("start"===e?n.startAnchor:n.endAnchor)??null:null}getLinesAnchoredTo(t){const e=this._anchorIndex.get(t);return e?Array.from(e):[]}updateAnchorsForObject(t){const e=this.getLinesAnchoredTo(t);if(0===e.length)return;if(!this.getObjectById(t))return;for(const n of e){const e=this.getLineById(n.lineId);e&&this.snapEndpointToObject(e,n.endpoint,t)}const n=this._core.store.selectionGroup;n&&this._core.store.state.isDragging&&n.hasExternalAnchoredLineConnections()&&n.refreshObjectDimensions(void 0,!0)}snapEndpointToObject(t,e,n){const i=this.getObjectById(n);if(!i)return;const r=this.worldToLineLocal(t,i.centerX,i.centerY);t.updateEndpoint(e,r.x,r.y)}worldToLineLocal(t,e,n){const i=e-t.centerX,r=n-t.centerY,s=Math.cos(-t.rotation),o=Math.sin(-t.rotation);return{x:(i*s-r*o+t.totalWidth/2/t.scale)*t.scale+t.x,y:(i*o+r*s+t.totalHeight/2/t.scale)*t.scale+t.y}}findSnapTarget(t,e,n,i,r="mouse"){return this.findBestSnapTarget(t,e,n,i,(n=>{const i=this.getSnapRadius(n,r),s=t-n.centerX,o=e-n.centerY;return Math.sqrt(s*s+o*o)<=i}))}findSnapPreviewTarget(t,e,n,i){return this.findBestSnapTarget(t,e,n,i,(()=>!0))}findBestSnapTarget(t,e,n,i,r){let s=null,o=-1/0;const a=this._core.store.allNonSelectionObjects;for(const c of a){if(c.id===n)continue;if(i&&c.id===i)continue;if(!this.isAnchorable(c))continue;const a=c.rotatedPolygon;O.isPointInPolygon({x:t,y:e},[a.topLeft,a.topRight,a.bottomRight,a.bottomLeft])&&r(c)&&c.zIndex>o&&(o=c.zIndex,s={objectId:c.id,centerX:c.centerX,centerY:c.centerY})}return s}getSnapRadius(t,e){const n=Math.min(t.width,t.height)/5;return"touch"===e||"pen"===e?Math.max(1.75*n,24/this.getSafeScale(this._core.store.state.scale)):n}setSnapCandidate(t){this._core.store.state.snapCandidate=t,this._core.rerender()}setSnapPreviewCandidate(t){this._core.store.state.snapPreviewCandidate=t,this._core.rerender()}getSnapCandidate(){return this._core.store.state.snapCandidate??null}getSnapPreviewCandidate(){return this._core.store.state.snapPreviewCandidate??null}clearSnapCandidate(){this._core.store.state.snapCandidate=null,this._core.rerender()}clearSnapPreviewCandidate(){this._core.store.state.snapPreviewCandidate=null,this._core.rerender()}getAnchorLinesRenderData(){const t=this._core.store.selectionGroup;if(!t||1!==t.objects.length)return null;const e=t.objects[0];if(!p.isInstanceOf(e,"KritzelLine"))return null;const n=e,i=this.computeAnchorVisualization(n,"start"),r=this.computeAnchorVisualization(n,"end"),s=this.isFiniteAnchorVisualization(i)?i:null,o=this.isFiniteAnchorVisualization(r)?r:null;if(!s&&!o)return null;const a=this.getSafeScale(this._core.store.state.scale),c=this.getSafeScale(n.scale),l=n.strokeWidth/c,h=""+2/a,u=Math.max(2*l,4/a),f=`${u} ${u}`,d=8/a;return this.areFiniteNumbers(l,u,d)?{lineStrokeWidth:l,indicatorStrokeWidth:h,dashArray:f,indicatorRadius:d,startAnchorViz:s,endAnchorViz:o}:null}getSnapIndicatorRenderData(){return this.getIndicatorRenderDataForCandidate(this.getSnapCandidate())}getSnapPreviewRenderData(){return this.getIndicatorRenderDataForCandidate(this.getSnapPreviewCandidate())}getIndicatorRenderDataForCandidate(t){if(!t)return null;if(!this.areFiniteNumbers(t.centerX,t.centerY,t.lineEndpointX,t.lineEndpointY))return null;const e=this.getSafeScale(this._core.store.state.scale),n=8/e,i=""+2/e,r=this.areFiniteNumbers(t.lineStrokeWidth)&&t.lineStrokeWidth>0?t.lineStrokeWidth:4/e,s=`${r}`,o=Math.max(2*r,4/e),a=`${o} ${o}`,c=t.lineStroke||"#000000";let l,h=this.areFiniteNumbers(t.edgeX)?t.edgeX:void 0,u=this.areFiniteNumbers(t.edgeY)?t.edgeY:void 0,f=h,d=u;const p=this.areFiniteNumbers(t.arrowOffset)&&t.arrowOffset>0?t.arrowOffset:void 0;if(void 0!==p&&void 0!==h&&void 0!==u){const e=t.lineEndpointX-h,n=t.lineEndpointY-u,i=Math.sqrt(e*e+n*n);i>p&&(f=h+e/i*p,d=u+n/i*p);const r=h-t.lineEndpointX,s=u-t.lineEndpointY,o=Math.sqrt(r*r+s*s);if(o>0){const t=r/o,e=s/o,n=-e,i=h,a=u,c=i-t*p,f=a-e*p,d=c+n*p/2,g=f+t*p/2,v=c-n*p/2,w=f-t*p/2;this.areFiniteNumbers(i,a,d,g,v,w)&&(l=`${i},${a} ${d},${g} ${v},${w}`)}}if(!this.areFiniteNumbers(n,r,o))return null;const g=(()=>{if(void 0!==t.controlX&&void 0!==t.controlY&&void 0!==t.t&&this.areFiniteNumbers(t.controlX,t.controlY,t.t)){const e="start"===t.endpoint?1-t.t:t.t;if(e>=1)return;const n=this.extractQuadraticSegment({x:t.lineEndpointX,y:t.lineEndpointY},{x:t.controlX,y:t.controlY},{x:t.centerX,y:t.centerY},e,1);if(!this.areFiniteNumbers(n.start.x,n.start.y,n.control.x,n.control.y,n.end.x,n.end.y))return;return`M ${n.start.x} ${n.start.y} Q ${n.control.x} ${n.control.y} ${n.end.x} ${n.end.y}`}})();return{indicatorRadius:n,indicatorStrokeWidth:i,lineStrokeWidth:s,dashArray:a,lineStroke:c,centerX:t.centerX,centerY:t.centerY,lineEndpointX:t.lineEndpointX,lineEndpointY:t.lineEndpointY,edgeX:h,edgeY:u,arrowOffset:p,arrowStyle:t.arrowStyle,arrowFill:t.arrowFill,solidLineEndX:f,solidLineEndY:d,arrowPoints:l,snapLinePath:g}}handleObjectDeleted(t){const e=this.getLinesAnchoredTo(t);for(const t of e){this.removeAnchor(t.lineId,t.endpoint);const e=this.getLineById(t.lineId);e&&this._core.store.objects.update(e)}this._anchorIndex.delete(t)}handleLineDeleted(t){const e=this.getLineById(t);e&&(e.startAnchor&&this.removeFromIndex(e.startAnchor.objectId,t,"start"),e.endAnchor&&this.removeFromIndex(e.endAnchor.objectId,t,"end"))}rebuildIndex(){this._anchorIndex.clear();const t=this._core.store.allObjects;for(const e of t)e instanceof L&&(e.startAnchor&&this.addToIndex(e.startAnchor.objectId,e.id,"start"),e.endAnchor&&this.addToIndex(e.endAnchor.objectId,e.id,"end"))}addToIndex(t,e,n){this._anchorIndex.has(t)||this._anchorIndex.set(t,new Set);const i=this._anchorIndex.get(t);for(const t of i)if(t.lineId===e&&t.endpoint===n)return;i.add({lineId:e,endpoint:n})}removeFromIndex(t,e,n){const i=this._anchorIndex.get(t);if(i){for(const t of i)if(t.lineId===e&&t.endpoint===n){i.delete(t);break}0===i.size&&this._anchorIndex.delete(t)}}getLineById(t){const e=this._core.store.objects.filter((e=>e.id===t));if(0===e.length)return null;const n=e[0];return n instanceof L?n:null}getObjectById(t){const e=this._core.store.objects.filter((e=>e.id===t));return e.length>0?e[0]:null}findAnchorTarget(t,e){const n="start"===e?t.startAnchor:t.endAnchor;return n?this._core.store.allNonSelectionObjects.find((t=>t.id===n.objectId))??null:null}computeAnchorVisualization(t,e){if(!("start"===e?t.startAnchor:t.endAnchor))return null;const n=this.findAnchorTarget(t,e);if(!n)return null;const i=this.computeAnchorClipInfo(t,e,n);if(!i)return null;const r=n.centerX,s=n.centerY;if(!this.areFiniteNumbers(i.worldX,i.worldY,r,s))return null;const o=this.buildAnchorPath(t,e,i,n)??void 0;return o&&!this.isFinitePathData(o)?null:{edgeX:i.worldX,edgeY:i.worldY,centerX:r,centerY:s,pathD:o}}computeClippedLinePath(t,e=!1){const n=this.getSnapCandidate(),i=this._core.store.selectionGroup,r=n&&i&&1===i.objects.length&&i.objects[0].id===t.id;if(!t.startAnchor&&!t.endAnchor&&!r)return e?void 0!==t.controlX&&void 0!==t.controlY?`M ${t.startX-t.x} ${t.startY-t.y} Q ${t.controlX-t.x} ${t.controlY-t.y} ${t.endX-t.x} ${t.endY-t.y}`:`M ${t.startX-t.x} ${t.startY-t.y} L ${t.endX-t.x} ${t.endY-t.y}`:t.d;const s=t.startAnchor?this.findAnchorTarget(t,"start"):null,o=t.endAnchor?this.findAnchorTarget(t,"end"):null;let a=s?this.computeAnchorClipInfo(t,"start",s):null,c=o?this.computeAnchorClipInfo(t,"end",o):null;if(r&&void 0!==n.edgeX&&void 0!==n.edgeY){const e=this.lineWorldToLocal(t,n.edgeX,n.edgeY),i={worldX:n.edgeX,worldY:n.edgeY,localX:e.x,localY:e.y,t:n.t};"start"===n.endpoint?a=i:c=i}const l=e?t.x:0,h=e?t.y:0;if(void 0!==t.controlX&&void 0!==t.controlY){let e=a?.t??0,n=c?.t??1;if(a&&t.hasStartArrow){const n=t.getArrowSize("start"),i=this.evaluateDerivativeSpeedAtT(t,e);i>0&&(e+=n/i)}if(c&&t.hasEndArrow){const e=t.getArrowSize("end"),i=this.evaluateDerivativeSpeedAtT(t,n);i>0&&(n-=e/i)}if(e<0&&(e=0),n>1&&(n=1),n<=e){const t=(e+n)/2;e=t,n=t}const i=this.extractQuadraticSegment({x:t.startX,y:t.startY},{x:t.controlX,y:t.controlY},{x:t.endX,y:t.endY},e,n);return`M ${i.start.x-l} ${i.start.y-h} Q ${i.control.x-l} ${i.control.y-h} ${i.end.x-l} ${i.end.y-h}`}let u=a?.localX??t.startX,f=a?.localY??t.startY,d=c?.localX??t.endX,p=c?.localY??t.endY;if(a&&t.hasStartArrow){const e=t.getArrowSize("start"),n=d-u,i=p-f,r=Math.sqrt(n*n+i*i);r>e&&(u+=n/r*e,f+=i/r*e)}if(c&&t.hasEndArrow){const e=t.getArrowSize("end"),n=u-d,i=f-p,r=Math.sqrt(n*n+i*i);r>e&&(d+=n/r*e,p+=i/r*e)}return`M ${u-l} ${f-h} L ${d-l} ${p-h}`}computeAnchorClipInfo(t,e,n){return void 0!==t.controlX&&void 0!==t.controlY?this.computeCurvedClipInfo(t,e,n):this.computeStraightClipInfo(t,e,n)}computeStraightClipInfo(t,e,n){const i="start"===e?this.lineLocalToWorld(t,t.endX,t.endY):this.lineLocalToWorld(t,t.startX,t.startY),r=this.getPathClipPoint(n,i);if(r){const n=this.lineWorldToLocal(t,r.x,r.y),i=Math.sqrt(Math.pow(t.endX-t.startX,2)+Math.pow(t.endY-t.startY,2)),s=Math.sqrt(Math.pow(n.x-t.startX,2)+Math.pow(n.y-t.startY,2));return{localX:n.x,localY:n.y,worldX:r.x,worldY:r.y,t:i>0?s/i:"start"===e?0:1}}const s=this.getClipPolygonForObject(n);let o;if(o=s?O.getLinePointsArrayIntersection(i,{x:n.centerX,y:n.centerY},s):O.getLinePolygonIntersection(i,{x:n.centerX,y:n.centerY},n.rotatedPolygon),!o)return null;const a=this.lineWorldToLocal(t,o.x,o.y),c=Math.sqrt(Math.pow(t.endX-t.startX,2)+Math.pow(t.endY-t.startY,2)),l=Math.sqrt(Math.pow(a.x-t.startX,2)+Math.pow(a.y-t.startY,2));return{localX:a.x,localY:a.y,worldX:o.x,worldY:o.y,t:c>0?l/c:"start"===e?0:1}}computeCurvedClipInfo(t,e,n){if(p.isInstanceOf(n,"KritzelPath"))return this.findCurveExitPointForPath(t,e,n);const i=this.getClipPolygonForObject(n),r=i??this.getPolygonPoints(n.rotatedPolygon),s=this.findCurveExitPoint(t,e,r);if(s)return s;const o="start"===e?this.lineLocalToWorld(t,t.endX,t.endY):this.lineLocalToWorld(t,t.startX,t.startY);let a;if(a=i?O.getLinePointsArrayIntersection(o,{x:n.centerX,y:n.centerY},i):O.getLinePolygonIntersection(o,{x:n.centerX,y:n.centerY},n.rotatedPolygon),!a)return null;const c=this.lineWorldToLocal(t,a.x,a.y),l=this.approximateParameterForWorldPoint(t,a);return{localX:c.x,localY:c.y,worldX:a.x,worldY:a.y,t:l}}findCurveExitPoint(t,e,n){const i="start"===e?0:1,r=this.evaluateLineAtT(t,i);let s=O.isPointInPolygon({x:r.worldX,y:r.worldY},n),o=i;for(let i=1;i<=64;i++){const r="start"===e?i/64:1-i/64,a=this.evaluateLineAtT(t,r),c=O.isPointInPolygon({x:a.worldX,y:a.worldY},n);if(s&&!c){const e=this.refineCurveExitParameter(t,n,o,r),i=this.evaluateLineAtT(t,e);return{localX:i.localX,localY:i.localY,worldX:i.worldX,worldY:i.worldY,t:e}}s=c,o=r}return null}findCurveExitPointForPath(t,e,n){const i="start"===e?0:1,r=n.strokeWidth/n.scale/2,s=this.getPathAdjustedPoints(n);if(s.length<1)return null;const o=this.evaluateLineAtT(t,i);let a=this.isPointInPathStroke(o.worldX,o.worldY,s,r),c=i;for(let n=1;n<=64;n++){const i="start"===e?n/64:1-n/64,o=this.evaluateLineAtT(t,i),l=this.isPointInPathStroke(o.worldX,o.worldY,s,r);if(a&&!l){const e=this.refineCurveExitParameterForPath(t,s,r,c,i),n=this.evaluateLineAtT(t,e);return{localX:n.localX,localY:n.localY,worldX:n.worldX,worldY:n.worldY,t:e}}a=l,c=i}return null}refineCurveExitParameterForPath(t,e,n,i,r){let s=i,o=r;for(let i=0;i<8;i++){const i=(s+o)/2,r=this.evaluateLineAtT(t,i);this.isPointInPathStroke(r.worldX,r.worldY,e,n)?s=i:o=i}return(s+o)/2}getPathAdjustedPoints(t){return this.computePathAdjustedPoints(t)}computePathAdjustedPoints(t){if(!t.points?.length)return[];const e=t.rotation,n=Math.cos(e),i=Math.sin(e),r=t.points.map((t=>t[0])),s=t.points.map((t=>t[1])),o={x:(Math.min(...r)+Math.max(...r))/2,y:(Math.min(...s)+Math.max(...s))/2},{x:a,y:c}=o;return t.points.map((([t,e])=>{const r=t-a,s=e-c;return[a+r*n-s*i,c+r*i+s*n]})).map((([e,n])=>[Math.abs(e-t.x)/t.scale+t.translateX,Math.abs(n-t.y)/t.scale+t.translateY]))}isPointInPathStroke(t,e,n,i){if(1===n.length){const r=n[0],s=t-r[0],o=e-r[1];return Math.sqrt(s*s+o*o)<=i}for(let r=0;r<n.length-1;r++){const s=n[r],o=n[r+1];if(this.pointToSegmentDistance(t,e,s[0],s[1],o[0],o[1])<=i)return!0}return!1}pointToSegmentDistance(t,e,n,i,r,s){const o=r-n,a=s-i,c=o*o+a*a;if(0===c)return Math.sqrt((t-n)*(t-n)+(e-i)*(e-i));let l=((t-n)*o+(e-i)*a)/c;l=Math.max(0,Math.min(1,l));const h=n+l*o,u=i+l*a;return Math.sqrt((t-h)*(t-h)+(e-u)*(e-u))}refineCurveExitParameter(t,e,n,i){let r=n,s=i;for(let n=0;n<8;n++){const n=(r+s)/2,i=this.evaluateLineAtT(t,n);O.isPointInPolygon({x:i.worldX,y:i.worldY},e)?r=n:s=n}return(r+s)/2}approximateParameterForWorldPoint(t,e){let n=0,i=1/0;for(let r=0;r<=80;r++){const s=r/80,o=this.evaluateLineAtT(t,s),a=Math.hypot(o.worldX-e.x,o.worldY-e.y);a<i&&(i=a,n=s)}return n}evaluateLineAtT(t,e){const n=Math.max(0,Math.min(1,e));let i,r;if(void 0!==t.controlX&&void 0!==t.controlY){const e=1-n;i=e*e*t.startX+2*e*n*t.controlX+n*n*t.endX,r=e*e*t.startY+2*e*n*t.controlY+n*n*t.endY}else i=t.startX+(t.endX-t.startX)*n,r=t.startY+(t.endY-t.startY)*n;const s=this.lineLocalToWorld(t,i,r);return{t:n,localX:i,localY:r,worldX:s.x,worldY:s.y}}evaluateDerivativeSpeedAtT(t,e){const n=Math.max(0,Math.min(1,e));if(void 0!==t.controlX&&void 0!==t.controlY){const e=t.controlX,i=t.controlY,r=2*(1-n)*(e-t.startX)+2*n*(t.endX-e),s=2*(1-n)*(i-t.startY)+2*n*(t.endY-i);return Math.sqrt(r*r+s*s)}{const e=t.endX-t.startX,n=t.endY-t.startY;return Math.sqrt(e*e+n*n)}}extractQuadraticSegment(t,e,n,i,r){let s=Math.max(0,Math.min(1,i)),o=Math.max(0,Math.min(1,r));if(o<s){const t=s;s=o,o=t}let a={start:t,control:e,end:n};if(s>0){a=this.splitQuadraticSegment(a,s).right;const t=1-s;o=t>0?(o-s)/t:1}return o<1&&(a=this.splitQuadraticSegment(a,o).left),a}splitQuadraticSegment(t,e){const n=Math.max(0,Math.min(1,e)),i=t.start,r=t.control,s=t.end,o=this.lerpPoint(i,r,n),a=this.lerpPoint(r,s,n),c=this.lerpPoint(o,a,n);return{left:{start:i,control:o,end:c},right:{start:c,control:a,end:s}}}lerpPoint(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}}buildAnchorPath(t,e,n,i){if(void 0===t.controlX||void 0===t.controlY||void 0===n.t)return`M ${n.worldX} ${n.worldY} L ${i.centerX} ${i.centerY}`;const r="start"===e?0:n.t,s="start"===e?n.t:1;if(s<=r)return`M ${n.worldX} ${n.worldY} L ${i.centerX} ${i.centerY}`;const o=this.extractQuadraticSegment({x:t.startX,y:t.startY},{x:t.controlX,y:t.controlY},{x:t.endX,y:t.endY},r,s);return this.buildWorldQuadraticPath(t,o,"start"===e)}buildWorldQuadraticPath(t,e,n=!1){const i=n?e.end:e.start,r=n?e.start:e.end,s=e.control,o=this.lineLocalToWorld(t,i.x,i.y),a=this.lineLocalToWorld(t,s.x,s.y),c=this.lineLocalToWorld(t,r.x,r.y);return`M ${o.x} ${o.y} Q ${a.x} ${a.y} ${c.x} ${c.y}`}getPolygonPoints(t){return[t.topLeft,t.topRight,t.bottomRight,t.bottomLeft]}getClipPolygonForObject(t){return p.isInstanceOf(t,"KritzelShape")?t.getClipPolygon():null}getPathClipPoint(t,e){return p.isInstanceOf(t,"KritzelPath")?t.getClipPoint(e):null}lineLocalToWorld(t,e,n){const i=e-t.x,r=n-t.y,s=t.totalWidth/2,o=t.totalHeight/2,a=Math.cos(t.rotation),c=Math.sin(t.rotation),l=(i-s)*a-(r-o)*c+s,h=(i-s)*c+(r-o)*a+o,u=this.getSafeScale(t.scale);return{x:l/u+t.translateX,y:h/u+t.translateY}}lineWorldToLocal(t,e,n){const i=this.getSafeScale(t.scale),r=(e-t.translateX)*i,s=(n-t.translateY)*i,o=t.totalWidth/2,a=t.totalHeight/2,c=Math.cos(-t.rotation),l=Math.sin(-t.rotation);return{x:(r-o)*c-(s-a)*l+o+t.x,y:(r-o)*l+(s-a)*c+a+t.y}}getSafeScale(t){return Number.isFinite(t)&&Math.abs(t)>1e-6?t:1}areFiniteNumbers(...t){return t.every((t=>void 0!==t&&Number.isFinite(t)))}isFiniteAnchorVisualization(t){return!(!t||!this.areFiniteNumbers(t.edgeX,t.edgeY,t.centerX,t.centerY)||t.pathD&&!this.isFinitePathData(t.pathD))}isFinitePathData(t){return!t.includes("Infinity")&&!t.includes("NaN")}isAnchorable(t){return!(t instanceof g||t instanceof h)&&!(t instanceof L)&&t.isVisible}}class Dt{static interpolate(t,e){return e?t.replace(/\{(\w+)\}/g,((t,n)=>{const i=e[n];return null==i?t:String(i)})):t}}const Rt={code:"en",label:"English",terms:{"menu.copy":"Copy","menu.cut":"Cut","menu.paste":"Paste","menu.selectAll":"Select All","menu.order":"Order","menu.bringToFront":"Bring to Front","menu.sendToBack":"Send to Back","menu.moveUp":"Move Up","menu.moveDown":"Move Down","menu.align":"Align","menu.alignLeft":"Align Left","menu.alignCenterHorizontal":"Align Center Horizontally","menu.alignRight":"Align Right","menu.alignTop":"Align Top","menu.alignCenterVertical":"Align Center Vertically","menu.alignBottom":"Align Bottom","menu.group":"Group","menu.ungroup":"Ungroup","menu.export":"Export","menu.exportAsSvg":"Export as SVG","menu.exportAsPng":"Export as PNG","menu.delete":"Delete","menu.share":"Share","menu.import":"Import","menu.settings":"Settings","menu.logout":"Logout","settings.dialogTitle":"Settings","settings.categories.general":"General","settings.categories.viewport":"Viewport","settings.categories.shortcuts":"Keyboard Shortcuts","settings.categories.developer":"Developer Options","settings.categories.about":"About","settings.general.title":"General Settings","settings.general.theme.label":"Theme","settings.general.theme.description":"Select a registered color theme for the editor interface.","settings.general.language.label":"Language","settings.general.language.description":"Select the display language for the editor interface.","settings.general.lockDrawingScale.label":"Lock Drawing Scale","settings.general.lockDrawingScale.description":"When enabled, drawn objects maintain a fixed visual size regardless of the current zoom level.","settings.viewport.title":"Viewport Settings","settings.viewport.minZoom.label":"Minimum Zoom Level","settings.viewport.minZoom.description":"Sets the minimum zoom level. Lower values allow zooming out further to see more of the canvas.","settings.viewport.maxZoom.label":"Maximum Zoom Level","settings.viewport.maxZoom.description":"Sets the maximum zoom level. Higher values allow zooming in closer for detailed work.","settings.viewport.boundaryLeft.label":"Viewport Boundary Left","settings.viewport.boundaryLeft.description":"Left boundary in world coordinates. Set to limit how far left the viewport can pan.","settings.viewport.boundaryRight.label":"Viewport Boundary Right","settings.viewport.boundaryRight.description":"Right boundary in world coordinates. Set to limit how far right the viewport can pan.","settings.viewport.boundaryTop.label":"Viewport Boundary Top","settings.viewport.boundaryTop.description":"Top boundary in world coordinates. Set to limit how far up the viewport can pan.","settings.viewport.boundaryBottom.label":"Viewport Boundary Bottom","settings.viewport.boundaryBottom.description":"Bottom boundary in world coordinates. Set to limit how far down the viewport can pan.","settings.viewport.boundaryPlaceholder":"Infinite","settings.shortcuts.title":"Keyboard Shortcuts","settings.developer.title":"Developer Options","settings.developer.showViewportInfo.label":"Show Viewport Info","settings.developer.showViewportInfo.description":"Display viewport debug information such as position, zoom level, and boundaries.","settings.developer.showObjectInfo.label":"Show Object Info","settings.developer.showObjectInfo.description":"Display debug information about objects on the canvas.","settings.developer.showSyncProviderInfo.label":"Show Sync Provider Info","settings.developer.showSyncProviderInfo.description":"Display debug information about the sync provider connection status.","settings.developer.showMigrationInfo.label":"Show Migration Info","settings.developer.showMigrationInfo.description":"Display debug information about data migrations.","settings.about.title":"About","settings.about.description":"Kritzel - A drawing application","export.dialogTitle":"Export","export.tabs.viewport":"Export Viewport","export.tabs.workspace":"Export Workspace","export.format.label":"Format","export.filename.label":"Filename","export.filename.placeholder":"Enter filename","export.exportButton":"Export","workspace.sharedTooltip":"Shared workspace","workspace.rename":"Rename","workspace.delete":"Delete","zoom.zoomIn":"Zoom in","zoom.zoomOut":"Zoom out","utility.undo":"Undo","utility.redo":"Redo","utility.delete":"Delete selected items","share.dialogTitle":"Share Workspace","share.linkSharing.label":"Link sharing","share.linkSharing.enabledDescription":"Anyone with the link can access this workspace.","share.linkSharing.disabledDescription":"Link sharing is disabled. Only you can access this workspace.","share.linkSharing.toggleLabel":"Enable link sharing","share.copyLink.title":"Copy link","share.copyLink.copied":"Copied!","login.dialogTitle":"Sign in","currentUser.dialogTitle":"Account","backToContent.label":"Back to content","toolConfig.collapse":"Collapse","toolConfig.expand":"Expand","moreMenu.ariaLabel":"More options","engine.loading":"Loading...","watermark.poweredBy":"Powered by Kritzel"}},Wt={code:"de",label:"Deutsch",terms:{"menu.copy":"Kopieren","menu.cut":"Ausschneiden","menu.paste":"Einfügen","menu.selectAll":"Alles auswählen","menu.order":"Anordnen","menu.bringToFront":"In den Vordergrund","menu.sendToBack":"In den Hintergrund","menu.moveUp":"Nach vorne","menu.moveDown":"Nach hinten","menu.align":"Ausrichten","menu.alignLeft":"Linksbündig ausrichten","menu.alignCenterHorizontal":"Horizontal zentrieren","menu.alignRight":"Rechtsbündig ausrichten","menu.alignTop":"Oben ausrichten","menu.alignCenterVertical":"Vertikal zentrieren","menu.alignBottom":"Unten ausrichten","menu.group":"Gruppieren","menu.ungroup":"Gruppierung aufheben","menu.export":"Exportieren","menu.exportAsSvg":"Als SVG exportieren","menu.exportAsPng":"Als PNG exportieren","menu.delete":"Löschen","menu.share":"Teilen","menu.import":"Importieren","menu.settings":"Einstellungen","menu.logout":"Abmelden","settings.dialogTitle":"Einstellungen","settings.categories.general":"Allgemein","settings.categories.viewport":"Ansichtsfenster","settings.categories.shortcuts":"Tastenkürzel","settings.categories.developer":"Entwickleroptionen","settings.categories.about":"Über","settings.general.title":"Allgemeine Einstellungen","settings.general.theme.label":"Design","settings.general.theme.description":"Wählen Sie ein registriertes Farbdesign für die Editor-Oberfläche.","settings.general.language.label":"Sprache","settings.general.language.description":"Wählen Sie die Anzeigesprache für die Editor-Oberfläche.","settings.general.lockDrawingScale.label":"Zeichenskalierung sperren","settings.general.lockDrawingScale.description":"Wenn aktiviert, behalten gezeichnete Objekte unabhängig von der aktuellen Zoomstufe eine feste visuelle Größe.","settings.viewport.title":"Ansichtsfenster-Einstellungen","settings.viewport.minZoom.label":"Minimale Zoomstufe","settings.viewport.minZoom.description":"Legt die minimale Zoomstufe fest. Niedrigere Werte ermöglichen weiteres Herauszoomen, um mehr von der Zeichenfläche zu sehen.","settings.viewport.maxZoom.label":"Maximale Zoomstufe","settings.viewport.maxZoom.description":"Legt die maximale Zoomstufe fest. Höhere Werte ermöglichen näheres Heranzoomen für Detailarbeit.","settings.viewport.boundaryLeft.label":"Ansichtsfenster-Grenze links","settings.viewport.boundaryLeft.description":"Linke Grenze in Weltkoordinaten. Legen Sie fest, wie weit das Ansichtsfenster nach links verschoben werden kann.","settings.viewport.boundaryRight.label":"Ansichtsfenster-Grenze rechts","settings.viewport.boundaryRight.description":"Rechte Grenze in Weltkoordinaten. Legen Sie fest, wie weit das Ansichtsfenster nach rechts verschoben werden kann.","settings.viewport.boundaryTop.label":"Ansichtsfenster-Grenze oben","settings.viewport.boundaryTop.description":"Obere Grenze in Weltkoordinaten. Legen Sie fest, wie weit das Ansichtsfenster nach oben verschoben werden kann.","settings.viewport.boundaryBottom.label":"Ansichtsfenster-Grenze unten","settings.viewport.boundaryBottom.description":"Untere Grenze in Weltkoordinaten. Legen Sie fest, wie weit das Ansichtsfenster nach unten verschoben werden kann.","settings.viewport.boundaryPlaceholder":"Unendlich","settings.shortcuts.title":"Tastenkürzel","settings.developer.title":"Entwickleroptionen","settings.developer.showViewportInfo.label":"Ansichtsfenster-Infos anzeigen","settings.developer.showViewportInfo.description":"Zeigt Debug-Informationen zum Ansichtsfenster an, z. B. Position, Zoomstufe und Grenzen.","settings.developer.showObjectInfo.label":"Objekt-Infos anzeigen","settings.developer.showObjectInfo.description":"Zeigt Debug-Informationen zu Objekten auf der Zeichenfläche an.","settings.developer.showSyncProviderInfo.label":"Sync-Provider-Infos anzeigen","settings.developer.showSyncProviderInfo.description":"Zeigt Debug-Informationen zum Verbindungsstatus des Sync-Providers an.","settings.developer.showMigrationInfo.label":"Migrations-Infos anzeigen","settings.developer.showMigrationInfo.description":"Zeigt Debug-Informationen zu Datenmigrationen an.","settings.about.title":"Über","settings.about.description":"Kritzel – Eine Zeichenanwendung","export.dialogTitle":"Exportieren","export.tabs.viewport":"Ansichtsfenster exportieren","export.tabs.workspace":"Arbeitsbereich exportieren","export.format.label":"Format","export.filename.label":"Dateiname","export.filename.placeholder":"Dateiname eingeben","export.exportButton":"Exportieren","workspace.sharedTooltip":"Geteilter Arbeitsbereich","workspace.rename":"Umbenennen","workspace.delete":"Löschen","zoom.zoomIn":"Vergrößern","zoom.zoomOut":"Verkleinern","utility.undo":"Rückgängig","utility.redo":"Wiederholen","utility.delete":"Ausgewählte Elemente löschen","share.dialogTitle":"Arbeitsbereich teilen","share.linkSharing.label":"Link-Freigabe","share.linkSharing.enabledDescription":"Jeder mit dem Link kann auf diesen Arbeitsbereich zugreifen.","share.linkSharing.disabledDescription":"Die Link-Freigabe ist deaktiviert. Nur Sie können auf diesen Arbeitsbereich zugreifen.","share.linkSharing.toggleLabel":"Link-Freigabe aktivieren","share.copyLink.title":"Link kopieren","share.copyLink.copied":"Kopiert!","login.dialogTitle":"Anmelden","currentUser.dialogTitle":"Konto","backToContent.label":"Zurück zum Inhalt","toolConfig.collapse":"Einklappen","toolConfig.expand":"Ausklappen","moreMenu.ariaLabel":"Weitere Optionen","engine.loading":"Wird geladen...","watermark.poweredBy":"Bereitgestellt von Kritzel"}},Ut={code:"fr",label:"Français",terms:{"menu.copy":"Copier","menu.cut":"Couper","menu.paste":"Coller","menu.selectAll":"Tout sélectionner","menu.order":"Ordre","menu.bringToFront":"Mettre au premier plan","menu.sendToBack":"Mettre à l'arrière-plan","menu.moveUp":"Avancer","menu.moveDown":"Reculer","menu.align":"Aligner","menu.alignLeft":"Aligner à gauche","menu.alignCenterHorizontal":"Centrer horizontalement","menu.alignRight":"Aligner à droite","menu.alignTop":"Aligner en haut","menu.alignCenterVertical":"Centrer verticalement","menu.alignBottom":"Aligner en bas","menu.group":"Grouper","menu.ungroup":"Dégrouper","menu.export":"Exporter","menu.exportAsSvg":"Exporter en SVG","menu.exportAsPng":"Exporter en PNG","menu.delete":"Supprimer","menu.share":"Partager","menu.import":"Importer","menu.settings":"Paramètres","menu.logout":"Déconnexion","settings.dialogTitle":"Paramètres","settings.categories.general":"Général","settings.categories.viewport":"Fenêtre d'affichage","settings.categories.shortcuts":"Raccourcis clavier","settings.categories.developer":"Options développeur","settings.categories.about":"À propos","settings.general.title":"Paramètres généraux","settings.general.theme.label":"Thème","settings.general.theme.description":"Sélectionnez un thème de couleurs enregistré pour l'interface de l'éditeur.","settings.general.language.label":"Langue","settings.general.language.description":"Sélectionnez la langue d'affichage de l'interface de l'éditeur.","settings.general.lockDrawingScale.label":"Verrouiller l'échelle de dessin","settings.general.lockDrawingScale.description":"Lorsque cette option est activée, les objets dessinés conservent une taille visuelle fixe quel que soit le niveau de zoom actuel.","settings.viewport.title":"Paramètres de la fenêtre d'affichage","settings.viewport.minZoom.label":"Niveau de zoom minimal","settings.viewport.minZoom.description":"Définit le niveau de zoom minimal. Des valeurs plus faibles permettent de dézoomer davantage pour voir une plus grande partie du canevas.","settings.viewport.maxZoom.label":"Niveau de zoom maximal","settings.viewport.maxZoom.description":"Définit le niveau de zoom maximal. Des valeurs plus élevées permettent de zoomer davantage pour un travail détaillé.","settings.viewport.boundaryLeft.label":"Limite gauche de la fenêtre d'affichage","settings.viewport.boundaryLeft.description":"Limite gauche en coordonnées du monde. Définissez jusqu'où la fenêtre d'affichage peut se déplacer vers la gauche.","settings.viewport.boundaryRight.label":"Limite droite de la fenêtre d'affichage","settings.viewport.boundaryRight.description":"Limite droite en coordonnées du monde. Définissez jusqu'où la fenêtre d'affichage peut se déplacer vers la droite.","settings.viewport.boundaryTop.label":"Limite supérieure de la fenêtre d'affichage","settings.viewport.boundaryTop.description":"Limite supérieure en coordonnées du monde. Définissez jusqu'où la fenêtre d'affichage peut se déplacer vers le haut.","settings.viewport.boundaryBottom.label":"Limite inférieure de la fenêtre d'affichage","settings.viewport.boundaryBottom.description":"Limite inférieure en coordonnées du monde. Définissez jusqu'où la fenêtre d'affichage peut se déplacer vers le bas.","settings.viewport.boundaryPlaceholder":"Infini","settings.shortcuts.title":"Raccourcis clavier","settings.developer.title":"Options développeur","settings.developer.showViewportInfo.label":"Afficher les infos de la fenêtre d'affichage","settings.developer.showViewportInfo.description":"Affiche les informations de débogage de la fenêtre d'affichage telles que la position, le niveau de zoom et les limites.","settings.developer.showObjectInfo.label":"Afficher les infos des objets","settings.developer.showObjectInfo.description":"Affiche les informations de débogage des objets sur le canevas.","settings.developer.showSyncProviderInfo.label":"Afficher les infos du fournisseur de synchronisation","settings.developer.showSyncProviderInfo.description":"Affiche les informations de débogage sur l'état de connexion du fournisseur de synchronisation.","settings.developer.showMigrationInfo.label":"Afficher les infos de migration","settings.developer.showMigrationInfo.description":"Affiche les informations de débogage sur les migrations de données.","settings.about.title":"À propos","settings.about.description":"Kritzel - Une application de dessin","export.dialogTitle":"Exporter","export.tabs.viewport":"Exporter la fenêtre d'affichage","export.tabs.workspace":"Exporter l'espace de travail","export.format.label":"Format","export.filename.label":"Nom du fichier","export.filename.placeholder":"Saisir le nom du fichier","export.exportButton":"Exporter","workspace.sharedTooltip":"Espace de travail partagé","workspace.rename":"Renommer","workspace.delete":"Supprimer","zoom.zoomIn":"Zoom avant","zoom.zoomOut":"Zoom arrière","utility.undo":"Annuler","utility.redo":"Rétablir","utility.delete":"Supprimer les éléments sélectionnés","share.dialogTitle":"Partager l'espace de travail","share.linkSharing.label":"Partage par lien","share.linkSharing.enabledDescription":"Toute personne disposant du lien peut accéder à cet espace de travail.","share.linkSharing.disabledDescription":"Le partage par lien est désactivé. Vous seul pouvez accéder à cet espace de travail.","share.linkSharing.toggleLabel":"Activer le partage par lien","share.copyLink.title":"Copier le lien","share.copyLink.copied":"Copié !","login.dialogTitle":"Se connecter","currentUser.dialogTitle":"Compte","backToContent.label":"Retour au contenu","toolConfig.collapse":"Réduire","toolConfig.expand":"Développer","moreMenu.ariaLabel":"Plus d'options","engine.loading":"Chargement...","watermark.poweredBy":"Propulsé par Kritzel"}},Ft="kritzel-settings",Kt="en";class Vt{_core;_storageKey;_builtinLocales=new Map;_customLocales=new Map;_currentLocale=Kt;_fallbackLocale=Kt;constructor(t){this._core=t,this._storageKey=t.editorId?`${Ft}-${t.editorId}`:Ft,this._builtinLocales.set(Rt.code,Rt),this._builtinLocales.set(Wt.code,Wt),this._builtinLocales.set(Ut.code,Ut),this._currentLocale=this.getStoredLocale()}get currentLocale(){return this._currentLocale}get fallbackLocale(){return this._fallbackLocale}setFallbackLocale(t){this._fallbackLocale=t}registerLocales(t){for(const e of t)this._customLocales.set(e.code,e)}setLocale(t){this._currentLocale=t,this._core.rerender()}getAvailableLocales(){return Array.from(new Set([...this._builtinLocales.keys(),...this._customLocales.keys()]))}getAvailableLocaleOptions(){return this.getAvailableLocales().map((t=>({code:t,label:this.getLocaleLabel(t)})))}getLocaleLabel(t){return this._customLocales.get(t)?.label??this._builtinLocales.get(t)?.label??t}translate(t,e){const n=this._customLocales.get(this._currentLocale)?.terms[t]??this._builtinLocales.get(this._currentLocale)?.terms[t]??this._customLocales.get(this._fallbackLocale)?.terms[t]??this._builtinLocales.get(this._fallbackLocale)?.terms[t]??t;return Dt.interpolate(n,e)}getAllTerms(){const t=new Set;for(const e of[...this._builtinLocales.values(),...this._customLocales.values()])for(const n of Object.keys(e.terms))t.add(n);const e={};for(const n of t)e[n]=this.translate(n);return e}getStoredLocale(){if("undefined"==typeof localStorage)return Kt;const t=localStorage.getItem(this._storageKey);if(!t)return Kt;try{const e=JSON.parse(t);if("string"==typeof e?.locale)return e.locale}catch{}return Kt}cleanup(){this._customLocales.clear()}}class Nt{_core;_licenseKey;_isLicensed=!1;_verifiedToken;_validationId=0;_publicKeyPromise;_timer=null;constructor(t){this._core=t}get isLicensed(){return this._isLicensed}validate(t){this._licenseKey=t;const e=++this._validationId;let n;try{n=this.preCheck(t)}catch{return this.commit(!0,e),this._isLicensed}return"rejected"===n.status?(this._verifiedToken=void 0,this.commit(!1,e),this._isLicensed):this._verifiedToken===t?(this.commit(!0,e),this._isLicensed):(this.verifySignature(n.payloadSegment,n.signatureSegment).then((n=>{e===this._validationId&&(n?(this._verifiedToken=t,this.commit(!0,e)):(this._verifiedToken=void 0,this.commit(!1,e)))})).catch((()=>{e===this._validationId&&this.commit(!0,e)})),this._isLicensed)}startPeriodicValidation(){this.stopPeriodicValidation(),this.scheduleNextValidation()}stopPeriodicValidation(){null!==this._timer&&(clearTimeout(this._timer),this._timer=null)}destroy(){this.stopPeriodicValidation()}commit(t,e){e===this._validationId&&t!==this._isLicensed&&(this._isLicensed=t,this._core.rerender())}scheduleNextValidation(){const t=this.getRandomRevalidationDelay();this._timer=setTimeout((()=>{this.validate(this._licenseKey),this.scheduleNextValidation()}),t)}getRandomRevalidationDelay(){return 3e4+Math.floor(30001*Math.random())}preCheck(t){if(null==t)return{status:"rejected"};const e=t.trim();if(0===e.length||!e.startsWith("KRTZL1."))return{status:"rejected"};const n=e.slice(7).split(".");if(2!==n.length||0===n[0].length||0===n[1].length)return{status:"rejected"};const[i,r]=n;let s;try{s=JSON.parse(this.base64UrlToString(i))}catch{return{status:"rejected"}}return null===s||"object"!=typeof s||"number"==typeof s.exp&&1e3*s.exp<=Date.now()?{status:"rejected"}:{status:"pass",payloadSegment:i,signatureSegment:r,claims:s}}async verifySignature(t,e){const n=await this.getPublicKey(),i=this.utf8Bytes(t),r=this.base64UrlToBytes(e);return crypto.subtle.verify("Ed25519",n,r,i)}getPublicKey(){if(!this._publicKeyPromise){const t=this.base64UrlToBytes("I-pYJlxDEjT94rwSaqhXW5Sv__fMKS-JKKnV3pg0PaM");this._publicKeyPromise=Promise.resolve().then((()=>crypto.subtle.importKey("raw",t,{name:"Ed25519"},!1,["verify"]))),this._publicKeyPromise.catch((()=>{this._publicKeyPromise=void 0}))}return this._publicKeyPromise}base64UrlToString(t){return(new TextDecoder).decode(this.base64UrlToBytes(t))}base64UrlToBytes(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e.padEnd(e.length+(4-e.length%4)%4,"="),i=atob(n),r=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)r[t]=i.charCodeAt(t);return r}utf8Bytes(t){const e=(new TextEncoder).encode(t),n=new Uint8Array(new ArrayBuffer(e.length));return n.set(e),n}}var Gt;function Ht(t,e,n,i,r,s){const o=s?.quiet??!0,a=e.get("schemaVersion")??0;if(a>=r)return{migrated:!1,fromVersion:a,toVersion:a};const c=i.filter((t=>t.fromVersion>=a&&t.toVersion<=r)).sort(((t,e)=>t.fromVersion-e.fromVersion));return o||console.log(`[Kritzel] Running ${c.length} migration(s) from v${a} to v${r}`),t.transact((()=>{for(const e of c)o||console.log(`[Kritzel] Migrating v${e.fromVersion} → v${e.toVersion}`),e.migrate(t,n);e.set("schemaVersion",r)}),"migration"),o||console.log(`[Kritzel] Migrations complete. Schema now at v${r}`),{migrated:!0,fromVersion:a,toVersion:r}}!function(t){t.StartHorizontal="start-horizontal",t.CenterHorizontal="center-horizontal",t.EndHorizontal="end-horizontal",t.StartVertical="start-vertical",t.CenterVertical="center-vertical",t.EndVertical="end-vertical"}(Gt||(Gt={}));const Xt=[{fromVersion:1,toVersion:2,migrate(t,e){const n=e.workspaces;n&&n.forEach(((t,e)=>{const i=t?.viewport;if(!i)return;if("centerWorldX"in i)return;const r=i.scale??1,s=i.translateX??0,o=i.translateY??0,a={...t,viewport:{centerWorldX:-s/r||0,centerWorldY:-o/r||0,scale:r}};n.set(e,a)}))}}],Yt=[{fromVersion:1,toVersion:2,migrate(t,e){}}],Qt={providers:[]};var Zt,qt,Jt,te={exports:{}},ee=(Zt||(Zt=1,qt=te,Jt=te.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",i="__lodash_placeholder__",r=32,s=128,o=1/0,a=9007199254740991,c=NaN,l=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",r],["partialRight",64],["rearg",256]],u="[object Arguments]",f="[object Array]",d="[object Boolean]",p="[object Date]",g="[object Error]",v="[object Function]",w="[object GeneratorFunction]",m="[object Map]",y="[object Number]",b="[object Object]",k="[object Promise]",A="[object RegExp]",x="[object Set]",S="[object String]",M="[object Symbol]",z="[object WeakMap]",$="[object ArrayBuffer]",C="[object DataView]",T="[object Float32Array]",I="[object Float64Array]",j="[object Int8Array]",E="[object Int16Array]",_="[object Int32Array]",L="[object Uint8Array]",O="[object Uint8ClampedArray]",P="[object Uint16Array]",B="[object Uint32Array]",D=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,U=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,K=RegExp(U.source),V=RegExp(F.source),N=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,Z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/[\\^$.*+?()[\]{}|]/g,J=RegExp(q.source),tt=/^\s+/,et=/\s/,nt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,it=/\{\n\/\* \[wrapped with (.+)\] \*/,rt=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ot=/[()=,{}\[\]\/\s]/,at=/\\(\\)?/g,ct=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lt=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,ut=/^0b[01]+$/i,ft=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,pt=/^(?:0|[1-9]\d*)$/,gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,wt=/['\n\r\u2028\u2029\\]/g,mt="\\ud800-\\udfff",yt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",bt="\\u2700-\\u27bf",kt="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",xt="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Mt="["+mt+"]",zt="["+St+"]",$t="["+yt+"]",Ct="\\d+",Tt="["+bt+"]",It="["+kt+"]",jt="[^"+mt+St+Ct+bt+kt+At+"]",Et="\\ud83c[\\udffb-\\udfff]",_t="[^"+mt+"]",Lt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ot="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+At+"]",Bt="\\u200d",Dt="(?:"+It+"|"+jt+")",Rt="(?:"+Pt+"|"+jt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ft="(?:"+$t+"|"+Et+")?",Kt="["+xt+"]?",Vt=Kt+Ft+"(?:"+Bt+"(?:"+[_t,Lt,Ot].join("|")+")"+Kt+Ft+")*",Nt="(?:"+[Tt,Lt,Ot].join("|")+")"+Vt,Gt="(?:"+[_t+$t+"?",$t,Lt,Ot,Mt].join("|")+")",Ht=RegExp("['’]","g"),Xt=RegExp($t,"g"),Yt=RegExp(Et+"(?="+Et+")|"+Gt+Vt,"g"),Qt=RegExp([Pt+"?"+It+"+"+Wt+"(?="+[zt,Pt,"$"].join("|")+")",Rt+"+"+Ut+"(?="+[zt,Pt+Dt,"$"].join("|")+")",Pt+"?"+Dt+"+"+Wt,Pt+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ct,Nt].join("|"),"g"),Zt=RegExp("["+Bt+mt+yt+xt+"]"),te=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ee=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ne=-1,ie={};ie[T]=ie[I]=ie[j]=ie[E]=ie[_]=ie[L]=ie[O]=ie[P]=ie[B]=!0,ie[u]=ie[f]=ie[$]=ie[d]=ie[C]=ie[p]=ie[g]=ie[v]=ie[m]=ie[y]=ie[b]=ie[A]=ie[x]=ie[S]=ie[z]=!1;var re={};re[u]=re[f]=re[$]=re[C]=re[d]=re[p]=re[T]=re[I]=re[j]=re[E]=re[_]=re[m]=re[y]=re[b]=re[A]=re[x]=re[S]=re[M]=re[L]=re[O]=re[P]=re[B]=!0,re[g]=re[v]=re[z]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},oe=parseFloat,ae=parseInt,ce="object"==typeof X&&X&&X.Object===Object&&X,le="object"==typeof self&&self&&self.Object===Object&&self,he=ce||le||Function("return this")(),ue=Jt&&!Jt.nodeType&&Jt,fe=ue&&qt&&!qt.nodeType&&qt,de=fe&&fe.exports===ue,pe=de&&ce.process,ge=function(){try{return fe&&fe.require&&fe.require("util").types||pe&&pe.binding&&pe.binding("util")}catch(t){}}(),ve=ge&&ge.isArrayBuffer,we=ge&&ge.isDate,me=ge&&ge.isMap,ye=ge&&ge.isRegExp,be=ge&&ge.isSet,ke=ge&&ge.isTypedArray;function Ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,i){for(var r=-1,s=null==t?0:t.length;++r<s;){var o=t[r];e(i,o,n(o),t)}return i}function Se(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t}function Me(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function ze(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(!e(t[n],n,t))return!1;return!0}function $e(t,e){for(var n=-1,i=null==t?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}function Ce(t,e){return!(null==t||!t.length)&&De(t,e,0)>-1}function Te(t,e,n){for(var i=-1,r=null==t?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}function Ie(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}function je(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}function Ee(t,e,n,i){var r=-1,s=null==t?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}function _e(t,e,n,i){var r=null==t?0:t.length;for(i&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}function Le(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}var Oe=Fe("length");function Pe(t,e,n){var i;return n(t,(function(t,n,r){if(e(t,n,r))return i=n,!1})),i}function Be(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}function De(t,e,n){return e==e?function(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}(t,e,n):Be(t,We,n)}function Re(t,e,n,i){for(var r=n-1,s=t.length;++r<s;)if(i(t[r],e))return r;return-1}function We(t){return t!=t}function Ue(t,e){var n=null==t?0:t.length;return n?Ne(t,e)/n:c}function Fe(e){return function(n){return null==n?t:n[e]}}function Ke(e){return function(n){return null==e?t:e[n]}}function Ve(t,e,n,i,r){return r(t,(function(t,r,s){n=i?(i=!1,t):e(n,t,r,s)})),n}function Ne(e,n){for(var i,r=-1,s=e.length;++r<s;){var o=n(e[r]);o!==t&&(i=i===t?o:i+o)}return i}function Ge(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function He(t){return t?t.slice(0,un(t)+1).replace(tt,""):t}function Xe(t){return function(e){return t(e)}}function Ye(t,e){return Ie(e,(function(e){return t[e]}))}function Qe(t,e){return t.has(e)}function Ze(t,e){for(var n=-1,i=t.length;++n<i&&De(e,t[n],0)>-1;);return n}function qe(t,e){for(var n=t.length;n--&&De(e,t[n],0)>-1;);return n}var Je=Ke({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Ke({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function en(t){return"\\"+se[t]}function nn(t){return Zt.test(t)}function rn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function on(t,e){for(var n=-1,r=t.length,s=0,o=[];++n<r;){var a=t[n];a!==e&&a!==i||(t[n]=i,o[s++]=n)}return o}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function ln(t){return nn(t)?function(t){for(var e=Yt.lastIndex=0;Yt.test(t);)++e;return e}(t):Oe(t)}function hn(t){return nn(t)?function(t){return t.match(Yt)||[]}(t):function(t){return t.split("")}(t)}function un(t){for(var e=t.length;e--&&et.test(t.charAt(e)););return e}var fn=Ke({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),dn=function X(et){var mt,yt=(et=null==et?he:dn.defaults(he.Object(),et,dn.pick(he,ee))).Array,bt=et.Date,kt=et.Error,At=et.Function,xt=et.Math,St=et.Object,Mt=et.RegExp,zt=et.String,$t=et.TypeError,Ct=yt.prototype,Tt=St.prototype,It=et["__core-js_shared__"],jt=At.prototype.toString,Et=Tt.hasOwnProperty,_t=0,Lt=(mt=/[^.]+$/.exec(It&&It.keys&&It.keys.IE_PROTO||""))?"Symbol(src)_1."+mt:"",Ot=Tt.toString,Pt=jt.call(St),Bt=he._,Dt=Mt("^"+jt.call(Et).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=de?et.Buffer:t,Wt=et.Symbol,Ut=et.Uint8Array,Ft=Rt?Rt.allocUnsafe:t,Kt=sn(St.getPrototypeOf,St),Vt=St.create,Nt=Tt.propertyIsEnumerable,Gt=Ct.splice,Yt=Wt?Wt.isConcatSpreadable:t,Zt=Wt?Wt.iterator:t,qt=Wt?Wt.toStringTag:t,Jt=function(){try{var t=as(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),se=et.clearTimeout!==he.clearTimeout&&et.clearTimeout,ce=bt&&bt.now!==he.Date.now&&bt.now,le=et.setTimeout!==he.setTimeout&&et.setTimeout,ue=xt.ceil,fe=xt.floor,pe=St.getOwnPropertySymbols,ge=Rt?Rt.isBuffer:t,Oe=et.isFinite,Ke=Ct.join,pn=sn(St.keys,St),gn=xt.max,vn=xt.min,wn=bt.now,mn=et.parseInt,yn=xt.random,bn=Ct.reverse,kn=as(et,"DataView"),An=as(et,"Map"),xn=as(et,"Promise"),Sn=as(et,"Set"),Mn=as(et,"WeakMap"),zn=as(St,"create"),$n=Mn&&new Mn,Cn={},Tn=_s(kn),In=_s(An),jn=_s(xn),En=_s(Sn),_n=_s(Mn),Ln=Wt?Wt.prototype:t,On=Ln?Ln.valueOf:t,Pn=Ln?Ln.toString:t;function Bn(t){if(Zo(t)&&!Wo(t)&&!(t instanceof Un)){if(t instanceof Wn)return t;if(Et.call(t,"__wrapped__"))return Ls(t)}return new Wn(t)}var Dn=function(){function e(){}return function(n){if(!Qo(n))return{};if(Vt)return Vt(n);e.prototype=n;var i=new e;return e.prototype=t,i}}();function Rn(){}function Wn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Un(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=l,this.__views__=[]}function Fn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Nn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Vn;++e<n;)this.add(t[e])}function Gn(t){var e=this.__data__=new Kn(t);this.size=e.size}function Hn(t,e){var n=Wo(t),i=!n&&Ro(t),r=!n&&!i&&Vo(t),s=!n&&!i&&!r&&sa(t),o=n||i||r||s,a=o?Ge(t.length,zt):[],c=a.length;for(var l in t)!e&&!Et.call(t,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ps(l,c))||a.push(l);return a}function Xn(e){var n=e.length;return n?e[Vi(0,n-1)]:t}function Yn(t,e){return Is(Mr(t),ri(e,0,t.length))}function Qn(t){return Is(Mr(t))}function Zn(e,n,i){(i!==t&&!Po(e[n],i)||i===t&&!(n in e))&&ni(e,n,i)}function qn(e,n,i){var r=e[n];Et.call(e,n)&&Po(r,i)&&(i!==t||n in e)||ni(e,n,i)}function Jn(t,e){for(var n=t.length;n--;)if(Po(t[n][0],e))return n;return-1}function ti(t,e,n,i){return li(t,(function(t,r,s){e(i,t,n(t),s)})),i}function ei(t,e){return t&&zr(e,$a(e),t)}function ni(t,e,n){"__proto__"==e&&Jt?Jt(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ii(e,n){for(var i=-1,r=n.length,s=yt(r),o=null==e;++i<r;)s[i]=o?t:Aa(e,n[i]);return s}function ri(e,n,i){return e==e&&(i!==t&&(e=e<=i?e:i),n!==t&&(e=e>=n?e:n)),e}function si(e,n,i,r,s,o){var a,c=1&n,l=2&n,h=4&n;if(i&&(a=s?i(e,r,s,o):i(e)),a!==t)return a;if(!Qo(e))return e;var f=Wo(e);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Et.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!c)return Mr(e,a)}else{var g=hs(e),k=g==v||g==w;if(Vo(e))return yr(e,c);if(g==b||g==u||k&&!s){if(a=l||k?{}:fs(e),!c)return l?function(t,e){return zr(t,ls(t),e)}(e,function(t,e){return t&&zr(e,Ca(e),t)}(a,e)):function(t,e){return zr(t,cs(t),e)}(e,ei(a,e))}else{if(!re[g])return s?e:{};a=function(t,e,n){var i=t.constructor;switch(e){case $:return br(t);case d:case p:return new i(+t);case C:return function(t,e){var n=e?br(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case I:case j:case E:case _:case L:case O:case P:case B:return kr(t,n);case m:return new i;case y:case S:return new i(t);case A:return function(t){var e=new t.constructor(t.source,lt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case x:return new i;case M:return On?St(On.call(t)):{}}}(e,g,c)}}o||(o=new Gn);var z=o.get(e);if(z)return z;o.set(e,a),na(e)?e.forEach((function(t){a.add(si(t,n,i,t,e,o))})):qo(e)&&e.forEach((function(t,r){a.set(r,si(t,n,i,r,e,o))}));var D=f?t:(h?l?ts:Jr:l?Ca:$a)(e);return Se(D||e,(function(t,r){D&&(t=e[r=t]),qn(a,r,si(t,n,i,r,e,o))})),a}function oi(e,n,i){var r=i.length;if(null==e)return!r;for(e=St(e);r--;){var s=i[r],o=e[s];if(o===t&&!(s in e)||!(0,n[s])(o))return!1}return!0}function ai(n,i,r){if("function"!=typeof n)throw new $t(e);return zs((function(){n.apply(t,r)}),i)}function ci(t,e,n,i){var r=-1,s=Ce,o=!0,a=t.length,c=[],l=e.length;if(!a)return c;n&&(e=Ie(e,Xe(n))),i?(s=Te,o=!1):e.length>=200&&(s=Qe,o=!1,e=new Nn(e));t:for(;++r<a;){var h=t[r],u=null==n?h:n(h);if(h=i||0!==h?h:0,o&&u==u){for(var f=l;f--;)if(e[f]===u)continue t;c.push(h)}else s(e,u,i)||c.push(h)}return c}Bn.templateSettings={escape:N,evaluate:G,interpolate:H,variable:"",imports:{_:Bn}},(Bn.prototype=Rn.prototype).constructor=Bn,(Wn.prototype=Dn(Rn.prototype)).constructor=Wn,(Un.prototype=Dn(Rn.prototype)).constructor=Un,Fn.prototype.clear=function(){this.__data__=zn?zn(null):{},this.size=0},Fn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Fn.prototype.get=function(e){var i=this.__data__;if(zn){var r=i[e];return r===n?t:r}return Et.call(i,e)?i[e]:t},Fn.prototype.has=function(e){var n=this.__data__;return zn?n[e]!==t:Et.call(n,e)},Fn.prototype.set=function(e,i){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=zn&&i===t?n:i,this},Kn.prototype.clear=function(){this.__data__=[],this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=Jn(e,t);return!(n<0||(n==e.length-1?e.pop():Gt.call(e,n,1),--this.size,0))},Kn.prototype.get=function(e){var n=this.__data__,i=Jn(n,e);return i<0?t:n[i][1]},Kn.prototype.has=function(t){return Jn(this.__data__,t)>-1},Kn.prototype.set=function(t,e){var n=this.__data__,i=Jn(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Vn.prototype.clear=function(){this.size=0,this.__data__={hash:new Fn,map:new(An||Kn),string:new Fn}},Vn.prototype.delete=function(t){var e=ss(this,t).delete(t);return this.size-=e?1:0,e},Vn.prototype.get=function(t){return ss(this,t).get(t)},Vn.prototype.has=function(t){return ss(this,t).has(t)},Vn.prototype.set=function(t,e){var n=ss(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},Nn.prototype.add=Nn.prototype.push=function(t){return this.__data__.set(t,n),this},Nn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.clear=function(){this.__data__=new Kn,this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gn.prototype.get=function(t){return this.__data__.get(t)},Gn.prototype.has=function(t){return this.__data__.has(t)},Gn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Kn){var i=n.__data__;if(!An||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Vn(i)}return n.set(t,e),this.size=n.size,this};var li=Tr(wi),hi=Tr(mi,!0);function ui(t,e){var n=!0;return li(t,(function(t,i,r){return n=!!e(t,i,r)})),n}function fi(e,n,i){for(var r=-1,s=e.length;++r<s;){var o=e[r],a=n(o);if(null!=a&&(c===t?a==a&&!ra(a):i(a,c)))var c=a,l=o}return l}function di(t,e){var n=[];return li(t,(function(t,i,r){e(t,i,r)&&n.push(t)})),n}function pi(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=ds),r||(r=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?pi(a,e-1,n,i,r):je(r,a):i||(r[r.length]=a)}return r}var gi=Ir(),vi=Ir(!0);function wi(t,e){return t&&gi(t,e,$a)}function mi(t,e){return t&&vi(t,e,$a)}function yi(t,e){return $e(e,(function(e){return Ho(t[e])}))}function bi(e,n){for(var i=0,r=(n=gr(n,e)).length;null!=e&&i<r;)e=e[Es(n[i++])];return i&&i==r?e:t}function ki(t,e,n){var i=e(t);return Wo(t)?i:je(i,n(t))}function Ai(e){return null==e?e===t?"[object Undefined]":"[object Null]":qt&&qt in St(e)?function(e){var n=Et.call(e,qt),i=e[qt];try{e[qt]=t;var r=!0}catch(t){}var s=Ot.call(e);return r&&(n?e[qt]=i:delete e[qt]),s}(e):function(t){return Ot.call(t)}(e)}function xi(t,e){return t>e}function Si(t,e){return null!=t&&Et.call(t,e)}function Mi(t,e){return null!=t&&e in St(t)}function zi(e,n,i){for(var r=i?Te:Ce,s=e[0].length,o=e.length,a=o,c=yt(o),l=1/0,h=[];a--;){var u=e[a];a&&n&&(u=Ie(u,Xe(n))),l=vn(u.length,l),c[a]=!i&&(n||s>=120&&u.length>=120)?new Nn(a&&u):t}u=e[0];var f=-1,d=c[0];t:for(;++f<s&&h.length<l;){var p=u[f],g=n?n(p):p;if(p=i||0!==p?p:0,!(d?Qe(d,g):r(h,g,i))){for(a=o;--a;){var v=c[a];if(!(v?Qe(v,g):r(e[a],g,i)))continue t}d&&d.push(g),h.push(p)}}return h}function $i(e,n,i){var r=null==(e=xs(e,n=gr(n,e)))?e:e[Es(Ns(n))];return null==r?t:Ae(r,e,i)}function Ci(t){return Zo(t)&&Ai(t)==u}function Ti(e,n,i,r,s){return e===n||(null==e||null==n||!Zo(e)&&!Zo(n)?e!=e&&n!=n:function(e,n,i,r,s,o){var a=Wo(e),c=Wo(n),l=a?f:hs(e),h=c?f:hs(n),v=(l=l==u?b:l)==b,w=(h=h==u?b:h)==b,k=l==h;if(k&&Vo(e)){if(!Vo(n))return!1;a=!0,v=!1}if(k&&!v)return o||(o=new Gn),a||sa(e)?Zr(e,n,i,r,s,o):function(t,e,n,i,r,s,o){switch(n){case C:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case $:return!(t.byteLength!=e.byteLength||!s(new Ut(t),new Ut(e)));case d:case p:case y:return Po(+t,+e);case g:return t.name==e.name&&t.message==e.message;case A:case S:return t==e+"";case m:var a=rn;case x:if(a||(a=an),t.size!=e.size&&!(1&i))return!1;var c=o.get(t);if(c)return c==e;i|=2,o.set(t,e);var l=Zr(a(t),a(e),i,r,s,o);return o.delete(t),l;case M:if(On)return On.call(t)==On.call(e)}return!1}(e,n,l,i,r,s,o);if(!(1&i)){var z=v&&Et.call(e,"__wrapped__"),T=w&&Et.call(n,"__wrapped__");if(z||T){var I=z?e.value():e,j=T?n.value():n;return o||(o=new Gn),s(I,j,i,r,o)}}return!!k&&(o||(o=new Gn),function(e,n,i,r,s,o){var a=1&i,c=Jr(e),l=c.length;if(l!=Jr(n).length&&!a)return!1;for(var h=l;h--;){var u=c[h];if(!(a?u in n:Et.call(n,u)))return!1}var f=o.get(e),d=o.get(n);if(f&&d)return f==n&&d==e;var p=!0;o.set(e,n),o.set(n,e);for(var g=a;++h<l;){var v=e[u=c[h]],w=n[u];if(r)var m=a?r(w,v,u,n,e,o):r(v,w,u,e,n,o);if(!(m===t?v===w||s(v,w,i,r,o):m)){p=!1;break}g||(g="constructor"==u)}if(p&&!g){var y=e.constructor,b=n.constructor;y==b||!("constructor"in e)||!("constructor"in n)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(p=!1)}return o.delete(e),o.delete(n),p}(e,n,i,r,s,o))}(e,n,i,r,Ti,s))}function Ii(e,n,i,r){var s=i.length,o=s,a=!r;if(null==e)return!o;for(e=St(e);s--;){var c=i[s];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++s<o;){var l=(c=i[s])[0],h=e[l],u=c[1];if(a&&c[2]){if(h===t&&!(l in e))return!1}else{var f=new Gn;if(r)var d=r(h,u,l,e,n,f);if(!(d===t?Ti(u,h,3,r,f):d))return!1}}return!0}function ji(t){return!(!Qo(t)||(e=t,Lt&&Lt in e))&&(Ho(t)?Dt:ft).test(_s(t));var e}function Ei(t){return"function"==typeof t?t:null==t?Ja:"object"==typeof t?Wo(t)?Bi(t[0],t[1]):Pi(t):cc(t)}function _i(t){if(!ys(t))return pn(t);var e=[];for(var n in St(t))Et.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Li(t,e){return t<e}function Oi(t,e){var n=-1,i=Fo(t)?yt(t.length):[];return li(t,(function(t,r,s){i[++n]=e(t,r,s)})),i}function Pi(t){var e=os(t);return 1==e.length&&e[0][2]?ks(e[0][0],e[0][1]):function(n){return n===t||Ii(n,t,e)}}function Bi(e,n){return vs(e)&&bs(n)?ks(Es(e),n):function(i){var r=Aa(i,e);return r===t&&r===n?xa(i,e):Ti(n,r,3)}}function Di(e,n,i,r,s){e!==n&&gi(n,(function(o,a){if(s||(s=new Gn),Qo(o))!function(e,n,i,r,s,o,a){var c=Ss(e,i),l=Ss(n,i),h=a.get(l);if(h)Zn(e,i,h);else{var u=o?o(c,l,i+"",e,n,a):t,f=u===t;if(f){var d=Wo(l),p=!d&&Vo(l),g=!d&&!p&&sa(l);u=l,d||p||g?Wo(c)?u=c:Ko(c)?u=Mr(c):p?(f=!1,u=yr(l,!0)):g?(f=!1,u=kr(l,!0)):u=[]:ta(l)||Ro(l)?(u=c,Ro(c)?u=da(c):Qo(c)&&!Ho(c)||(u=fs(l))):f=!1}f&&(a.set(l,u),s(u,l,r,o,a),a.delete(l)),Zn(e,i,u)}}(e,n,a,i,Di,r,s);else{var c=r?r(Ss(e,a),o,a+"",e,n,s):t;c===t&&(c=o),Zn(e,a,c)}}),Ca)}function Ri(e,n){var i=e.length;if(i)return ps(n+=n<0?i:0,i)?e[n]:t}function Wi(t,e,n){e=e.length?Ie(e,(function(t){return Wo(t)?function(e){return bi(e,1===t.length?t[0]:t)}:t})):[Ja];var i=-1;e=Ie(e,Xe(rs()));var r=Oi(t,(function(t){var n=Ie(e,(function(e){return e(t)}));return{criteria:n,index:++i,value:t}}));return function(t){var e=t.length;for(t.sort((function(t,e){return function(t,e,n){for(var i=-1,r=t.criteria,s=e.criteria,o=r.length,a=n.length;++i<o;){var c=Ar(r[i],s[i]);if(c)return i>=a?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)}));e--;)t[e]=t[e].value;return t}(r)}function Ui(t,e,n){for(var i=-1,r=e.length,s={};++i<r;){var o=e[i],a=bi(t,o);n(a,o)&&Yi(s,gr(o,t),a)}return s}function Fi(t,e,n,i){var r=i?Re:De,s=-1,o=e.length,a=t;for(t===e&&(e=Mr(e)),n&&(a=Ie(t,Xe(n)));++s<o;)for(var c=0,l=e[s],h=n?n(l):l;(c=r(a,h,c,i))>-1;)a!==t&&Gt.call(a,c,1),Gt.call(t,c,1);return t}function Ki(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==s){var s=r;ps(r)?Gt.call(t,r,1):ar(t,r)}}return t}function Vi(t,e){return t+fe(yn()*(e-t+1))}function Ni(t,e){var n="";if(!t||e<1||e>a)return n;do{e%2&&(n+=t),(e=fe(e/2))&&(t+=t)}while(e);return n}function Gi(t,e){return $s(As(t,e,Ja),t+"")}function Hi(t){return Xn(Pa(t))}function Xi(t,e){var n=Pa(t);return Is(n,ri(e,0,n.length))}function Yi(e,n,i,r){if(!Qo(e))return e;for(var s=-1,o=(n=gr(n,e)).length,a=o-1,c=e;null!=c&&++s<o;){var l=Es(n[s]),h=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(s!=a){var u=c[l];(h=r?r(u,l,c):t)===t&&(h=Qo(u)?u:ps(n[s+1])?[]:{})}qn(c,l,h),c=c[l]}return e}var Qi=$n?function(t,e){return $n.set(t,e),t}:Ja,Zi=Jt?function(t,e){return Jt(t,"toString",{configurable:!0,enumerable:!1,value:Qa(e),writable:!0})}:Ja;function qi(t){return Is(Pa(t))}function Ji(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var s=yt(r);++i<r;)s[i]=t[i+e];return s}function tr(t,e){var n;return li(t,(function(t,i,r){return!(n=e(t,i,r))})),!!n}function er(t,e,n){var i=0,r=null==t?i:t.length;if("number"==typeof e&&e==e&&r<=2147483647){for(;i<r;){var s=i+r>>>1,o=t[s];null!==o&&!ra(o)&&(n?o<=e:o<e)?i=s+1:r=s}return r}return nr(t,e,Ja,n)}function nr(e,n,i,r){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(n=i(n))!=n,c=null===n,l=ra(n),h=n===t;s<o;){var u=fe((s+o)/2),f=i(e[u]),d=f!==t,p=null===f,g=f==f,v=ra(f);if(a)var w=r||g;else w=h?g&&(r||d):c?g&&d&&(r||!p):l?g&&d&&!p&&(r||!v):!p&&!v&&(r?f<=n:f<n);w?s=u+1:o=u}return vn(o,4294967294)}function ir(t,e){for(var n=-1,i=t.length,r=0,s=[];++n<i;){var o=t[n],a=e?e(o):o;if(!n||!Po(a,c)){var c=a;s[r++]=0===o?0:o}}return s}function rr(t){return"number"==typeof t?t:ra(t)?c:+t}function sr(t){if("string"==typeof t)return t;if(Wo(t))return Ie(t,sr)+"";if(ra(t))return Pn?Pn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function or(t,e,n){var i=-1,r=Ce,s=t.length,o=!0,a=[],c=a;if(n)o=!1,r=Te;else if(s>=200){var l=e?null:Nr(t);if(l)return an(l);o=!1,r=Qe,c=new Nn}else c=e?[]:a;t:for(;++i<s;){var h=t[i],u=e?e(h):h;if(h=n||0!==h?h:0,o&&u==u){for(var f=c.length;f--;)if(c[f]===u)continue t;e&&c.push(u),a.push(h)}else r(c,u,n)||(c!==a&&c.push(u),a.push(h))}return a}function ar(t,e){var n=-1,i=(e=gr(e,t)).length;if(!i)return!0;for(;++n<i;){var r=Es(e[n]);if("__proto__"===r&&!Et.call(t,"__proto__"))return!1;if(("constructor"===r||"prototype"===r)&&n<i-1)return!1}var s=xs(t,e);return null==s||delete s[Es(Ns(e))]}function cr(t,e,n,i){return Yi(t,e,n(bi(t,e)),i)}function lr(t,e,n,i){for(var r=t.length,s=i?r:-1;(i?s--:++s<r)&&e(t[s],s,t););return n?Ji(t,i?0:s,i?s+1:r):Ji(t,i?s+1:0,i?r:s)}function hr(t,e){var n=t;return n instanceof Un&&(n=n.value()),Ee(e,(function(t,e){return e.func.apply(e.thisArg,je([t],e.args))}),n)}function ur(t,e,n){var i=t.length;if(i<2)return i?or(t[0]):[];for(var r=-1,s=yt(i);++r<i;)for(var o=t[r],a=-1;++a<i;)a!=r&&(s[r]=ci(s[r]||o,t[a],e,n));return or(pi(s,1),e,n)}function fr(e,n,i){for(var r=-1,s=e.length,o=n.length,a={};++r<s;)i(a,e[r],r<o?n[r]:t);return a}function dr(t){return Ko(t)?t:[]}function pr(t){return"function"==typeof t?t:Ja}function gr(t,e){return Wo(t)?t:vs(t,e)?[t]:js(pa(t))}var vr=Gi;function wr(e,n,i){var r=e.length;return i=i===t?r:i,!n&&i>=r?e:Ji(e,n,i)}var mr=se||function(t){return he.clearTimeout(t)};function yr(t,e){if(e)return t.slice();var n=t.length,i=Ft?Ft(n):new t.constructor(n);return t.copy(i),i}function br(t){var e=new t.constructor(t.byteLength);return new Ut(e).set(new Ut(t)),e}function kr(t,e){var n=e?br(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ar(e,n){if(e!==n){var i=e!==t,r=null===e,s=e==e,o=ra(e),a=n!==t,c=null===n,l=n==n,h=ra(n);if(!c&&!h&&!o&&e>n||o&&a&&l&&!c&&!h||r&&a&&l||!i&&l||!s)return 1;if(!r&&!o&&!h&&e<n||h&&i&&s&&!r&&!o||c&&i&&s||!a&&s||!l)return-1}return 0}function xr(t,e,n,i){for(var r=-1,s=t.length,o=n.length,a=-1,c=e.length,l=gn(s-o,0),h=yt(c+l),u=!i;++a<c;)h[a]=e[a];for(;++r<o;)(u||r<s)&&(h[n[r]]=t[r]);for(;l--;)h[a++]=t[r++];return h}function Sr(t,e,n,i){for(var r=-1,s=t.length,o=-1,a=n.length,c=-1,l=e.length,h=gn(s-a,0),u=yt(h+l),f=!i;++r<h;)u[r]=t[r];for(var d=r;++c<l;)u[d+c]=e[c];for(;++o<a;)(f||r<s)&&(u[d+n[o]]=t[r++]);return u}function Mr(t,e){var n=-1,i=t.length;for(e||(e=yt(i));++n<i;)e[n]=t[n];return e}function zr(e,n,i,r){var s=!i;i||(i={});for(var o=-1,a=n.length;++o<a;){var c=n[o],l=r?r(i[c],e[c],c,i,e):t;l===t&&(l=e[c]),s?ni(i,c,l):qn(i,c,l)}return i}function $r(t,e){return function(n,i){var r=Wo(n)?xe:ti,s=e?e():{};return r(n,t,rs(i,2),s)}}function Cr(e){return Gi((function(n,i){var r=-1,s=i.length,o=s>1?i[s-1]:t,a=s>2?i[2]:t;for(o=e.length>3&&"function"==typeof o?(s--,o):t,a&&gs(i[0],i[1],a)&&(o=s<3?t:o,s=1),n=St(n);++r<s;){var c=i[r];c&&e(n,c,r,o)}return n}))}function Tr(t,e){return function(n,i){if(null==n)return n;if(!Fo(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=St(n);(e?s--:++s<r)&&!1!==i(o[s],s,o););return n}}function Ir(t){return function(e,n,i){for(var r=-1,s=St(e),o=i(e),a=o.length;a--;){var c=o[t?a:++r];if(!1===n(s[c],c,s))break}return e}}function jr(e){return function(n){var i=nn(n=pa(n))?hn(n):t,r=i?i[0]:n.charAt(0),s=i?wr(i,1).join(""):n.slice(1);return r[e]()+s}}function Er(t){return function(e){return Ee(Ha(Ra(e).replace(Ht,"")),t,"")}}function _r(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Dn(t.prototype),i=t.apply(n,e);return Qo(i)?i:n}}function Lr(e){return function(n,i,r){var s=St(n);if(!Fo(n)){var o=rs(i,3);n=$a(n),i=function(t){return o(s[t],t,s)}}var a=e(n,i,r);return a>-1?s[o?n[a]:a]:t}}function Or(n){return qr((function(i){var r=i.length,s=r,o=Wn.prototype.thru;for(n&&i.reverse();s--;){var a=i[s];if("function"!=typeof a)throw new $t(e);if(o&&!c&&"wrapper"==ns(a))var c=new Wn([],!0)}for(s=c?s:r;++s<r;){var l=ns(a=i[s]),h="wrapper"==l?es(a):t;c=h&&ws(h[0])&&424==h[1]&&!h[4].length&&1==h[9]?c[ns(h[0])].apply(c,h[3]):1==a.length&&ws(a)?c[l]():c.thru(a)}return function(){var t=arguments,e=t[0];if(c&&1==t.length&&Wo(e))return c.plant(e).value();for(var n=0,s=r?i[n].apply(this,t):e;++n<r;)s=i[n].call(this,s);return s}}))}function Pr(e,n,i,r,o,a,c,l,h,u){var f=n&s,d=1&n,p=2&n,g=24&n,v=512&n,w=p?t:_r(e);return function s(){for(var m=arguments.length,y=yt(m),b=m;b--;)y[b]=arguments[b];if(g)var k=is(s),A=function(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}(y,k);if(r&&(y=xr(y,r,o,g)),a&&(y=Sr(y,a,c,g)),m-=A,g&&m<u){var x=on(y,k);return Kr(e,n,Pr,s.placeholder,i,y,x,l,h,u-m)}var S=d?i:this,M=p?S[e]:e;return m=y.length,l?y=function(e,n){for(var i=e.length,r=vn(n.length,i),s=Mr(e);r--;){var o=n[r];e[r]=ps(o,i)?s[o]:t}return e}(y,l):v&&m>1&&y.reverse(),f&&h<m&&(y.length=h),this&&this!==he&&this instanceof s&&(M=w||_r(M)),M.apply(S,y)}}function Br(t,e){return function(n,i){return function(t,e,n,i){return wi(t,(function(t,r,s){e(i,n(t),r,s)})),i}(n,t,e(i),{})}}function Dr(e,n){return function(i,r){var s;if(i===t&&r===t)return n;if(i!==t&&(s=i),r!==t){if(s===t)return r;"string"==typeof i||"string"==typeof r?(i=sr(i),r=sr(r)):(i=rr(i),r=rr(r)),s=e(i,r)}return s}}function Rr(t){return qr((function(e){return e=Ie(e,Xe(rs())),Gi((function(n){var i=this;return t(e,(function(t){return Ae(t,i,n)}))}))}))}function Wr(e,n){var i=(n=n===t?" ":sr(n)).length;if(i<2)return i?Ni(n,e):n;var r=Ni(n,ue(e/ln(n)));return nn(n)?wr(hn(r),0,e).join(""):r.slice(0,e)}function Ur(e){return function(n,i,r){return r&&"number"!=typeof r&&gs(n,i,r)&&(i=r=t),n=la(n),i===t?(i=n,n=0):i=la(i),function(t,e,n,i){for(var r=-1,s=gn(ue((e-t)/(n||1)),0),o=yt(s);s--;)o[i?s:++r]=t,t+=n;return o}(n,i,r=r===t?n<i?1:-1:la(r),e)}}function Fr(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=fa(e),n=fa(n)),t(e,n)}}function Kr(e,n,i,s,o,a,c,l,h,u){var f=8&n;n|=f?r:64,4&(n&=~(f?64:r))||(n&=-4);var d=[e,n,o,f?a:t,f?c:t,f?t:a,f?t:c,l,h,u],p=i.apply(t,d);return ws(e)&&Ms(p,d),p.placeholder=s,Cs(p,e,n)}function Vr(t){var e=xt[t];return function(t,n){if(t=fa(t),(n=null==n?0:vn(ha(n),292))&&Oe(t)){var i=(pa(t)+"e").split("e");return+((i=(pa(e(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return e(t)}}var Nr=Sn&&1/an(new Sn([,-0]))[1]==o?function(t){return new Sn(t)}:rc;function Gr(t){return function(e){var n=hs(e);return n==m?rn(e):n==x?cn(e):function(t,e){return Ie(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Hr(n,o,a,c,l,h,u,f){var d=2&o;if(!d&&"function"!=typeof n)throw new $t(e);var p=c?c.length:0;if(p||(o&=-97,c=l=t),u=u===t?u:gn(ha(u),0),f=f===t?f:ha(f),p-=l?l.length:0,64&o){var g=c,v=l;c=l=t}var w=d?t:es(n),m=[n,o,a,c,l,g,v,h,u,f];if(w&&function(t,e){var n=t[1],r=e[1],o=n|r;if(!(o<131||(r==s&&8==n||r==s&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n)))return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var a=e[3];if(a){var c=t[3];t[3]=c?xr(c,a,e[4]):a,t[4]=c?on(t[3],i):e[4]}(a=e[5])&&(t[5]=(c=t[5])?Sr(c,a,e[6]):a,t[6]=c?on(t[5],i):e[6]),(a=e[7])&&(t[7]=a),r&s&&(t[8]=null==t[8]?e[8]:vn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(m,w),n=m[0],o=m[1],a=m[2],c=m[3],l=m[4],!(f=m[9]=m[9]===t?d?0:n.length:gn(m[9]-p,0))&&24&o&&(o&=-25),o&&1!=o)y=8==o||16==o?function(e,n,i){var r=_r(e);return function s(){for(var o=arguments.length,a=yt(o),c=o,l=is(s);c--;)a[c]=arguments[c];var h=o<3&&a[0]!==l&&a[o-1]!==l?[]:on(a,l);return(o-=h.length)<i?Kr(e,n,Pr,s.placeholder,t,a,h,t,t,i-o):Ae(this&&this!==he&&this instanceof s?r:e,this,a)}}(n,o,f):o!=r&&33!=o||l.length?Pr.apply(t,m):function(t,e,n,i){var r=1&e,s=_r(t);return function e(){for(var o=-1,a=arguments.length,c=-1,l=i.length,h=yt(l+a),u=this&&this!==he&&this instanceof e?s:t;++c<l;)h[c]=i[c];for(;a--;)h[c++]=arguments[++o];return Ae(u,r?n:this,h)}}(n,o,a,c);else var y=function(t,e,n){var i=1&e,r=_r(t);return function e(){return(this&&this!==he&&this instanceof e?r:t).apply(i?n:this,arguments)}}(n,o,a);return Cs((w?Qi:Ms)(y,m),n,o)}function Xr(e,n,i,r){return e===t||Po(e,Tt[i])&&!Et.call(r,i)?n:e}function Yr(e,n,i,r,s,o){return Qo(e)&&Qo(n)&&(o.set(n,e),Di(e,n,t,Yr,o),o.delete(n)),e}function Qr(e){return ta(e)?t:e}function Zr(e,n,i,r,s,o){var a=1&i,c=e.length,l=n.length;if(c!=l&&!(a&&l>c))return!1;var h=o.get(e),u=o.get(n);if(h&&u)return h==n&&u==e;var f=-1,d=!0,p=2&i?new Nn:t;for(o.set(e,n),o.set(n,e);++f<c;){var g=e[f],v=n[f];if(r)var w=a?r(v,g,f,n,e,o):r(g,v,f,e,n,o);if(w!==t){if(w)continue;d=!1;break}if(p){if(!Le(n,(function(t,e){if(!Qe(p,e)&&(g===t||s(g,t,i,r,o)))return p.push(e)}))){d=!1;break}}else if(g!==v&&!s(g,v,i,r,o)){d=!1;break}}return o.delete(e),o.delete(n),d}function qr(e){return $s(As(e,t,Ws),e+"")}function Jr(t){return ki(t,$a,cs)}function ts(t){return ki(t,Ca,ls)}var es=$n?function(t){return $n.get(t)}:rc;function ns(t){for(var e=t.name+"",n=Cn[e],i=Et.call(Cn,e)?n.length:0;i--;){var r=n[i],s=r.func;if(null==s||s==t)return r.name}return e}function is(t){return(Et.call(Bn,"placeholder")?Bn:t).placeholder}function rs(){var t=Bn.iteratee||tc;return t=t===tc?Ei:t,arguments.length?t(arguments[0],arguments[1]):t}function ss(t,e){var n,i,r=t.__data__;return("string"==(i=typeof(n=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function os(t){for(var e=$a(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,bs(r)]}return e}function as(e,n){var i=function(e,n){return null==e?t:e[n]}(e,n);return ji(i)?i:t}var cs=pe?function(t){return null==t?[]:(t=St(t),$e(pe(t),(function(e){return Nt.call(t,e)})))}:uc,ls=pe?function(t){for(var e=[];t;)je(e,cs(t)),t=Kt(t);return e}:uc,hs=Ai;function us(t,e,n){for(var i=-1,r=(e=gr(e,t)).length,s=!1;++i<r;){var o=Es(e[i]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++i!=r?s:!!(r=null==t?0:t.length)&&Yo(r)&&ps(o,r)&&(Wo(t)||Ro(t))}function fs(t){return"function"!=typeof t.constructor||ys(t)?{}:Dn(Kt(t))}function ds(t){return Wo(t)||Ro(t)||!!(Yt&&t&&t[Yt])}function ps(t,e){var n=typeof t;return!!(e=null==e?a:e)&&("number"==n||"symbol"!=n&&pt.test(t))&&t>-1&&t%1==0&&t<e}function gs(t,e,n){if(!Qo(n))return!1;var i=typeof e;return!!("number"==i?Fo(n)&&ps(e,n.length):"string"==i&&e in n)&&Po(n[e],t)}function vs(t,e){if(Wo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ra(t))||Q.test(t)||!Y.test(t)||null!=e&&t in St(e)}function ws(t){var e=ns(t),n=Bn[e];if("function"!=typeof n||!(e in Un.prototype))return!1;if(t===n)return!0;var i=es(n);return!!i&&t===i[0]}(kn&&hs(new kn(new ArrayBuffer(1)))!=C||An&&hs(new An)!=m||xn&&hs(xn.resolve())!=k||Sn&&hs(new Sn)!=x||Mn&&hs(new Mn)!=z)&&(hs=function(e){var n=Ai(e),i=n==b?e.constructor:t,r=i?_s(i):"";if(r)switch(r){case Tn:return C;case In:return m;case jn:return k;case En:return x;case _n:return z}return n});var ms=It?Ho:fc;function ys(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Tt)}function bs(t){return t==t&&!Qo(t)}function ks(e,n){return function(i){return null!=i&&i[e]===n&&(n!==t||e in St(i))}}function As(e,n,i){return n=gn(n===t?e.length-1:n,0),function(){for(var t=arguments,r=-1,s=gn(t.length-n,0),o=yt(s);++r<s;)o[r]=t[n+r];r=-1;for(var a=yt(n+1);++r<n;)a[r]=t[r];return a[n]=i(o),Ae(e,this,a)}}function xs(t,e){return e.length<2?t:bi(t,Ji(e,0,-1))}function Ss(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ms=Ts(Qi),zs=le||function(t,e){return he.setTimeout(t,e)},$s=Ts(Zi);function Cs(t,e,n){var i=e+"";return $s(t,function(t,e){var n=e.length;if(!n)return t;var i=n-1;return e[i]=(n>1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(nt,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Se(h,(function(n){var i="_."+n[0];e&n[1]&&!Ce(t,i)&&t.push(i)})),t.sort()}(function(t){var e=t.match(it);return e?e[1].split(rt):[]}(i),n)))}function Ts(e){var n=0,i=0;return function(){var r=wn(),s=16-(r-i);if(i=r,s>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Is(e,n){var i=-1,r=e.length,s=r-1;for(n=n===t?r:n;++i<n;){var o=Vi(i,s),a=e[o];e[o]=e[i],e[i]=a}return e.length=n,e}var js=function(){var t=Io((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Z,(function(t,n,i,r){e.push(i?r.replace(at,"$1"):n||t)})),e}),(function(t){return 500===e.size&&e.clear(),t})),e=t.cache;return t}();function Es(t){if("string"==typeof t||ra(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function _s(t){if(null!=t){try{return jt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ls(t){if(t instanceof Un)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=Mr(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Os=Gi((function(t,e){return Ko(t)?ci(t,pi(e,1,Ko,!0)):[]})),Ps=Gi((function(e,n){var i=Ns(n);return Ko(i)&&(i=t),Ko(e)?ci(e,pi(n,1,Ko,!0),rs(i,2)):[]})),Bs=Gi((function(e,n){var i=Ns(n);return Ko(i)&&(i=t),Ko(e)?ci(e,pi(n,1,Ko,!0),t,i):[]}));function Ds(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:ha(n);return r<0&&(r=gn(i+r,0)),Be(t,rs(e,3),r)}function Rs(e,n,i){var r=null==e?0:e.length;if(!r)return-1;var s=r-1;return i!==t&&(s=ha(i),s=i<0?gn(r+s,0):vn(s,r-1)),Be(e,rs(n,3),s,!0)}function Ws(t){return null!=t&&t.length?pi(t,1):[]}function Us(e){return e&&e.length?e[0]:t}var Fs=Gi((function(t){var e=Ie(t,dr);return e.length&&e[0]===t[0]?zi(e):[]})),Ks=Gi((function(e){var n=Ns(e),i=Ie(e,dr);return n===Ns(i)?n=t:i.pop(),i.length&&i[0]===e[0]?zi(i,rs(n,2)):[]})),Vs=Gi((function(e){var n=Ns(e),i=Ie(e,dr);return(n="function"==typeof n?n:t)&&i.pop(),i.length&&i[0]===e[0]?zi(i,t,n):[]}));function Ns(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Gs=Gi(Hs);function Hs(t,e){return t&&t.length&&e&&e.length?Fi(t,e):t}var Xs=qr((function(t,e){var n=null==t?0:t.length,i=ii(t,e);return Ki(t,Ie(e,(function(t){return ps(t,n)?+t:t})).sort(Ar)),i}));function Ys(t){return null==t?t:bn.call(t)}var Qs=Gi((function(t){return or(pi(t,1,Ko,!0))})),Zs=Gi((function(e){var n=Ns(e);return Ko(n)&&(n=t),or(pi(e,1,Ko,!0),rs(n,2))})),qs=Gi((function(e){var n=Ns(e);return n="function"==typeof n?n:t,or(pi(e,1,Ko,!0),t,n)}));function Js(t){if(!t||!t.length)return[];var e=0;return t=$e(t,(function(t){if(Ko(t))return e=gn(t.length,e),!0})),Ge(e,(function(e){return Ie(t,Fe(e))}))}function to(e,n){if(!e||!e.length)return[];var i=Js(e);return null==n?i:Ie(i,(function(e){return Ae(n,t,e)}))}var eo=Gi((function(t,e){return Ko(t)?ci(t,e):[]})),no=Gi((function(t){return ur($e(t,Ko))})),io=Gi((function(e){var n=Ns(e);return Ko(n)&&(n=t),ur($e(e,Ko),rs(n,2))})),ro=Gi((function(e){var n=Ns(e);return n="function"==typeof n?n:t,ur($e(e,Ko),t,n)})),so=Gi(Js),oo=Gi((function(e){var n=e.length,i=n>1?e[n-1]:t;return i="function"==typeof i?(e.pop(),i):t,to(e,i)}));function ao(t){var e=Bn(t);return e.__chain__=!0,e}function co(t,e){return e(t)}var lo=qr((function(e){var n=e.length,i=n?e[0]:0,r=this.__wrapped__,s=function(t){return ii(t,e)};return!(n>1||this.__actions__.length)&&r instanceof Un&&ps(i)?((r=r.slice(i,+i+(n?1:0))).__actions__.push({func:co,args:[s],thisArg:t}),new Wn(r,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(s)})),ho=$r((function(t,e,n){Et.call(t,n)?++t[n]:ni(t,n,1)})),uo=Lr(Ds),fo=Lr(Rs);function po(t,e){return(Wo(t)?Se:li)(t,rs(e,3))}function go(t,e){return(Wo(t)?Me:hi)(t,rs(e,3))}var vo=$r((function(t,e,n){Et.call(t,n)?t[n].push(e):ni(t,n,[e])})),wo=Gi((function(t,e,n){var i=-1,r="function"==typeof e,s=Fo(t)?yt(t.length):[];return li(t,(function(t){s[++i]=r?Ae(e,t,n):$i(t,e,n)})),s})),mo=$r((function(t,e,n){ni(t,n,e)}));function yo(t,e){return(Wo(t)?Ie:Oi)(t,rs(e,3))}var bo=$r((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),ko=Gi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&gs(t,e[0],e[1])?e=[]:n>2&&gs(e[0],e[1],e[2])&&(e=[e[0]]),Wi(t,pi(e,1),[])})),Ao=ce||function(){return he.Date.now()};function xo(e,n,i){return n=i?t:n,Hr(e,s,t,t,t,t,n=e&&null==n?e.length:n)}function So(n,i){var r;if("function"!=typeof i)throw new $t(e);return n=ha(n),function(){return--n>0&&(r=i.apply(this,arguments)),n<=1&&(i=t),r}}var Mo=Gi((function(t,e,n){var i=1;if(n.length){var s=on(n,is(Mo));i|=r}return Hr(t,i,e,n,s)})),zo=Gi((function(t,e,n){var i=3;if(n.length){var s=on(n,is(zo));i|=r}return Hr(e,i,t,n,s)}));function $o(n,i,r){var s,o,a,c,l,h,u=0,f=!1,d=!1,p=!0;if("function"!=typeof n)throw new $t(e);function g(e){var i=s,r=o;return s=o=t,u=e,c=n.apply(r,i)}function v(e){var n=e-h;return h===t||n>=i||n<0||d&&e-u>=a}function w(){var t=Ao();if(v(t))return m(t);l=zs(w,function(t){var e=i-(t-h);return d?vn(e,a-(t-u)):e}(t))}function m(e){return l=t,p&&s?g(e):(s=o=t,c)}function y(){var e=Ao(),n=v(e);if(s=arguments,o=this,h=e,n){if(l===t)return function(t){return u=t,l=zs(w,i),f?g(t):c}(h);if(d)return mr(l),l=zs(w,i),g(h)}return l===t&&(l=zs(w,i)),c}return i=fa(i)||0,Qo(r)&&(f=!!r.leading,a=(d="maxWait"in r)?gn(fa(r.maxWait)||0,i):a,p="trailing"in r?!!r.trailing:p),y.cancel=function(){l!==t&&mr(l),u=0,s=h=o=l=t},y.flush=function(){return l===t?c:m(Ao())},y}var Co=Gi((function(t,e){return ai(t,1,e)})),To=Gi((function(t,e,n){return ai(t,fa(e)||0,n)}));function Io(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new $t(e);var i=function(){var e=arguments,r=n?n.apply(this,e):e[0],s=i.cache;if(s.has(r))return s.get(r);var o=t.apply(this,e);return i.cache=s.set(r,o)||s,o};return i.cache=new(Io.Cache||Vn),i}function jo(t){if("function"!=typeof t)throw new $t(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Io.Cache=Vn;var Eo=vr((function(t,e){var n=(e=1==e.length&&Wo(e[0])?Ie(e[0],Xe(rs())):Ie(pi(e,1),Xe(rs()))).length;return Gi((function(i){for(var r=-1,s=vn(i.length,n);++r<s;)i[r]=e[r].call(this,i[r]);return Ae(t,this,i)}))})),_o=Gi((function(e,n){var i=on(n,is(_o));return Hr(e,r,t,n,i)})),Lo=Gi((function(e,n){var i=on(n,is(Lo));return Hr(e,64,t,n,i)})),Oo=qr((function(e,n){return Hr(e,256,t,t,t,n)}));function Po(t,e){return t===e||t!=t&&e!=e}var Bo=Fr(xi),Do=Fr((function(t,e){return t>=e})),Ro=Ci(function(){return arguments}())?Ci:function(t){return Zo(t)&&Et.call(t,"callee")&&!Nt.call(t,"callee")},Wo=yt.isArray,Uo=ve?Xe(ve):function(t){return Zo(t)&&Ai(t)==$};function Fo(t){return null!=t&&Yo(t.length)&&!Ho(t)}function Ko(t){return Zo(t)&&Fo(t)}var Vo=ge||fc,No=we?Xe(we):function(t){return Zo(t)&&Ai(t)==p};function Go(t){if(!Zo(t))return!1;var e=Ai(t);return e==g||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ta(t)}function Ho(t){if(!Qo(t))return!1;var e=Ai(t);return e==v||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Xo(t){return"number"==typeof t&&t==ha(t)}function Yo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Qo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Zo(t){return null!=t&&"object"==typeof t}var qo=me?Xe(me):function(t){return Zo(t)&&hs(t)==m};function Jo(t){return"number"==typeof t||Zo(t)&&Ai(t)==y}function ta(t){if(!Zo(t)||Ai(t)!=b)return!1;var e=Kt(t);if(null===e)return!0;var n=Et.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&jt.call(n)==Pt}var ea=ye?Xe(ye):function(t){return Zo(t)&&Ai(t)==A},na=be?Xe(be):function(t){return Zo(t)&&hs(t)==x};function ia(t){return"string"==typeof t||!Wo(t)&&Zo(t)&&Ai(t)==S}function ra(t){return"symbol"==typeof t||Zo(t)&&Ai(t)==M}var sa=ke?Xe(ke):function(t){return Zo(t)&&Yo(t.length)&&!!ie[Ai(t)]},oa=Fr(Li),aa=Fr((function(t,e){return t<=e}));function ca(t){if(!t)return[];if(Fo(t))return ia(t)?hn(t):Mr(t);if(Zt&&t[Zt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Zt]());var e=hs(t);return(e==m?rn:e==x?an:Pa)(t)}function la(t){return t?(t=fa(t))===o||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ha(t){var e=la(t),n=e%1;return e==e?n?e-n:e:0}function ua(t){return t?ri(ha(t),0,l):0}function fa(t){if("number"==typeof t)return t;if(ra(t))return c;if(Qo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Qo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=He(t);var n=ut.test(t);return n||dt.test(t)?ae(t.slice(2),n?2:8):ht.test(t)?c:+t}function da(t){return zr(t,Ca(t))}function pa(t){return null==t?"":sr(t)}var ga=Cr((function(t,e){if(ys(e)||Fo(e))zr(e,$a(e),t);else for(var n in e)Et.call(e,n)&&qn(t,n,e[n])})),va=Cr((function(t,e){zr(e,Ca(e),t)})),wa=Cr((function(t,e,n,i){zr(e,Ca(e),t,i)})),ma=Cr((function(t,e,n,i){zr(e,$a(e),t,i)})),ya=qr(ii),ba=Gi((function(e,n){e=St(e);var i=-1,r=n.length,s=r>2?n[2]:t;for(s&&gs(n[0],n[1],s)&&(r=1);++i<r;)for(var o=n[i],a=Ca(o),c=-1,l=a.length;++c<l;){var h=a[c],u=e[h];(u===t||Po(u,Tt[h])&&!Et.call(e,h))&&(e[h]=o[h])}return e})),ka=Gi((function(e){return e.push(t,Yr),Ae(Ia,t,e)}));function Aa(e,n,i){var r=null==e?t:bi(e,n);return r===t?i:r}function xa(t,e){return null!=t&&us(t,e,Mi)}var Sa=Br((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ot.call(e)),t[e]=n}),Qa(Ja)),Ma=Br((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ot.call(e)),Et.call(t,e)?t[e].push(n):t[e]=[n]}),rs),za=Gi($i);function $a(t){return Fo(t)?Hn(t):_i(t)}function Ca(t){return Fo(t)?Hn(t,!0):function(t){if(!Qo(t))return function(t){var e=[];if(null!=t)for(var n in St(t))e.push(n);return e}(t);var e=ys(t),n=[];for(var i in t)("constructor"!=i||!e&&Et.call(t,i))&&n.push(i);return n}(t)}var Ta=Cr((function(t,e,n){Di(t,e,n)})),Ia=Cr((function(t,e,n,i){Di(t,e,n,i)})),ja=qr((function(t,e){var n={};if(null==t)return n;var i=!1;e=Ie(e,(function(e){return e=gr(e,t),i||(i=e.length>1),e})),zr(t,ts(t),n),i&&(n=si(n,7,Qr));for(var r=e.length;r--;)ar(n,e[r]);return n})),Ea=qr((function(t,e){return null==t?{}:function(t,e){return Ui(t,e,(function(e,n){return xa(t,n)}))}(t,e)}));function _a(t,e){if(null==t)return{};var n=Ie(ts(t),(function(t){return[t]}));return e=rs(e),Ui(t,n,(function(t,n){return e(t,n[0])}))}var La=Gr($a),Oa=Gr(Ca);function Pa(t){return null==t?[]:Ye(t,$a(t))}var Ba=Er((function(t,e,n){return e=e.toLowerCase(),t+(n?Da(e):e)}));function Da(t){return Ga(pa(t).toLowerCase())}function Ra(t){return(t=pa(t))&&t.replace(gt,Je).replace(Xt,"")}var Wa=Er((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ua=Er((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Fa=jr("toLowerCase"),Ka=Er((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Va=Er((function(t,e,n){return t+(n?" ":"")+Ga(e)})),Na=Er((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ga=jr("toUpperCase");function Ha(e,n,i){return e=pa(e),(n=i?t:n)===t?function(t){return te.test(t)}(e)?function(t){return t.match(Qt)||[]}(e):function(t){return t.match(st)||[]}(e):e.match(n)||[]}var Xa=Gi((function(e,n){try{return Ae(e,t,n)}catch(t){return Go(t)?t:new kt(t)}})),Ya=qr((function(t,e){return Se(e,(function(e){e=Es(e),ni(t,e,Mo(t[e],t))})),t}));function Qa(t){return function(){return t}}var Za=Or(),qa=Or(!0);function Ja(t){return t}function tc(t){return Ei("function"==typeof t?t:si(t,1))}var ec=Gi((function(t,e){return function(n){return $i(n,t,e)}})),nc=Gi((function(t,e){return function(n){return $i(t,n,e)}}));function ic(t,e,n){var i=$a(e),r=yi(e,i);null!=n||Qo(e)&&(r.length||!i.length)||(n=e,e=t,t=this,r=yi(e,$a(e)));var s=!(Qo(n)&&"chain"in n&&!n.chain),o=Ho(t);return Se(r,(function(n){var i=e[n];t[n]=i,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__);return(n.__actions__=Mr(this.__actions__)).push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,je([this.value()],arguments))})})),t}function rc(){}var sc=Rr(Ie),oc=Rr(ze),ac=Rr(Le);function cc(t){return vs(t)?Fe(Es(t)):function(t){return function(e){return bi(e,t)}}(t)}var lc=Ur(),hc=Ur(!0);function uc(){return[]}function fc(){return!1}var dc,pc=Dr((function(t,e){return t+e}),0),gc=Vr("ceil"),vc=Dr((function(t,e){return t/e}),1),wc=Vr("floor"),mc=Dr((function(t,e){return t*e}),1),yc=Vr("round"),bc=Dr((function(t,e){return t-e}),0);return Bn.after=function(t,n){if("function"!=typeof n)throw new $t(e);return t=ha(t),function(){if(--t<1)return n.apply(this,arguments)}},Bn.ary=xo,Bn.assign=ga,Bn.assignIn=va,Bn.assignInWith=wa,Bn.assignWith=ma,Bn.at=ya,Bn.before=So,Bn.bind=Mo,Bn.bindAll=Ya,Bn.bindKey=zo,Bn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wo(t)?t:[t]},Bn.chain=ao,Bn.chunk=function(e,n,i){n=(i?gs(e,n,i):n===t)?1:gn(ha(n),0);var r=null==e?0:e.length;if(!r||n<1)return[];for(var s=0,o=0,a=yt(ue(r/n));s<r;)a[o++]=Ji(e,s,s+=n);return a},Bn.compact=function(t){for(var e=-1,n=null==t?0:t.length,i=0,r=[];++e<n;){var s=t[e];s&&(r[i++]=s)}return r},Bn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=yt(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return je(Wo(n)?Mr(n):[n],pi(e,1))},Bn.cond=function(t){var n=null==t?0:t.length,i=rs();return t=n?Ie(t,(function(t){if("function"!=typeof t[1])throw new $t(e);return[i(t[0]),t[1]]})):[],Gi((function(e){for(var i=-1;++i<n;){var r=t[i];if(Ae(r[0],this,e))return Ae(r[1],this,e)}}))},Bn.conforms=function(t){return function(t){var e=$a(t);return function(n){return oi(n,t,e)}}(si(t,1))},Bn.constant=Qa,Bn.countBy=ho,Bn.create=function(t,e){var n=Dn(t);return null==e?n:ei(n,e)},Bn.curry=function e(n,i,r){var s=Hr(n,8,t,t,t,t,t,i=r?t:i);return s.placeholder=e.placeholder,s},Bn.curryRight=function e(n,i,r){var s=Hr(n,16,t,t,t,t,t,i=r?t:i);return s.placeholder=e.placeholder,s},Bn.debounce=$o,Bn.defaults=ba,Bn.defaultsDeep=ka,Bn.defer=Co,Bn.delay=To,Bn.difference=Os,Bn.differenceBy=Ps,Bn.differenceWith=Bs,Bn.drop=function(e,n,i){var r=null==e?0:e.length;return r?Ji(e,(n=i||n===t?1:ha(n))<0?0:n,r):[]},Bn.dropRight=function(e,n,i){var r=null==e?0:e.length;return r?Ji(e,0,(n=r-(n=i||n===t?1:ha(n)))<0?0:n):[]},Bn.dropRightWhile=function(t,e){return t&&t.length?lr(t,rs(e,3),!0,!0):[]},Bn.dropWhile=function(t,e){return t&&t.length?lr(t,rs(e,3),!0):[]},Bn.fill=function(e,n,i,r){var s=null==e?0:e.length;return s?(i&&"number"!=typeof i&&gs(e,n,i)&&(i=0,r=s),function(e,n,i,r){var s=e.length;for((i=ha(i))<0&&(i=-i>s?0:s+i),(r=r===t||r>s?s:ha(r))<0&&(r+=s),r=i>r?0:ua(r);i<r;)e[i++]=n;return e}(e,n,i,r)):[]},Bn.filter=function(t,e){return(Wo(t)?$e:di)(t,rs(e,3))},Bn.flatMap=function(t,e){return pi(yo(t,e),1)},Bn.flatMapDeep=function(t,e){return pi(yo(t,e),o)},Bn.flatMapDepth=function(e,n,i){return i=i===t?1:ha(i),pi(yo(e,n),i)},Bn.flatten=Ws,Bn.flattenDeep=function(t){return null!=t&&t.length?pi(t,o):[]},Bn.flattenDepth=function(e,n){return null!=e&&e.length?pi(e,n=n===t?1:ha(n)):[]},Bn.flip=function(t){return Hr(t,512)},Bn.flow=Za,Bn.flowRight=qa,Bn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,i={};++e<n;){var r=t[e];ni(i,r[0],r[1])}return i},Bn.functions=function(t){return null==t?[]:yi(t,$a(t))},Bn.functionsIn=function(t){return null==t?[]:yi(t,Ca(t))},Bn.groupBy=vo,Bn.initial=function(t){return null!=t&&t.length?Ji(t,0,-1):[]},Bn.intersection=Fs,Bn.intersectionBy=Ks,Bn.intersectionWith=Vs,Bn.invert=Sa,Bn.invertBy=Ma,Bn.invokeMap=wo,Bn.iteratee=tc,Bn.keyBy=mo,Bn.keys=$a,Bn.keysIn=Ca,Bn.map=yo,Bn.mapKeys=function(t,e){var n={};return e=rs(e,3),wi(t,(function(t,i,r){ni(n,e(t,i,r),t)})),n},Bn.mapValues=function(t,e){var n={};return e=rs(e,3),wi(t,(function(t,i,r){ni(n,i,e(t,i,r))})),n},Bn.matches=function(t){return Pi(si(t,1))},Bn.matchesProperty=function(t,e){return Bi(t,si(e,1))},Bn.memoize=Io,Bn.merge=Ta,Bn.mergeWith=Ia,Bn.method=ec,Bn.methodOf=nc,Bn.mixin=ic,Bn.negate=jo,Bn.nthArg=function(t){return t=ha(t),Gi((function(e){return Ri(e,t)}))},Bn.omit=ja,Bn.omitBy=function(t,e){return _a(t,jo(rs(e)))},Bn.once=function(t){return So(2,t)},Bn.orderBy=function(e,n,i,r){return null==e?[]:(Wo(n)||(n=null==n?[]:[n]),Wo(i=r?t:i)||(i=null==i?[]:[i]),Wi(e,n,i))},Bn.over=sc,Bn.overArgs=Eo,Bn.overEvery=oc,Bn.overSome=ac,Bn.partial=_o,Bn.partialRight=Lo,Bn.partition=bo,Bn.pick=Ea,Bn.pickBy=_a,Bn.property=cc,Bn.propertyOf=function(e){return function(n){return null==e?t:bi(e,n)}},Bn.pull=Gs,Bn.pullAll=Hs,Bn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Fi(t,e,rs(n,2)):t},Bn.pullAllWith=function(e,n,i){return e&&e.length&&n&&n.length?Fi(e,n,t,i):e},Bn.pullAt=Xs,Bn.range=lc,Bn.rangeRight=hc,Bn.rearg=Oo,Bn.reject=function(t,e){return(Wo(t)?$e:di)(t,jo(rs(e,3)))},Bn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var i=-1,r=[],s=t.length;for(e=rs(e,3);++i<s;){var o=t[i];e(o,i,t)&&(n.push(o),r.push(i))}return Ki(t,r),n},Bn.rest=function(n,i){if("function"!=typeof n)throw new $t(e);return Gi(n,i=i===t?i:ha(i))},Bn.reverse=Ys,Bn.sampleSize=function(e,n,i){return n=(i?gs(e,n,i):n===t)?1:ha(n),(Wo(e)?Yn:Xi)(e,n)},Bn.set=function(t,e,n){return null==t?t:Yi(t,e,n)},Bn.setWith=function(e,n,i,r){return r="function"==typeof r?r:t,null==e?e:Yi(e,n,i,r)},Bn.shuffle=function(t){return(Wo(t)?Qn:qi)(t)},Bn.slice=function(e,n,i){var r=null==e?0:e.length;return r?(i&&"number"!=typeof i&&gs(e,n,i)?(n=0,i=r):(n=null==n?0:ha(n),i=i===t?r:ha(i)),Ji(e,n,i)):[]},Bn.sortBy=ko,Bn.sortedUniq=function(t){return t&&t.length?ir(t):[]},Bn.sortedUniqBy=function(t,e){return t&&t.length?ir(t,rs(e,2)):[]},Bn.split=function(e,n,i){return i&&"number"!=typeof i&&gs(e,n,i)&&(n=i=t),(i=i===t?l:i>>>0)?(e=pa(e))&&("string"==typeof n||null!=n&&!ea(n))&&!(n=sr(n))&&nn(e)?wr(hn(e),0,i):e.split(n,i):[]},Bn.spread=function(t,n){if("function"!=typeof t)throw new $t(e);return n=null==n?0:gn(ha(n),0),Gi((function(e){var i=e[n],r=wr(e,0,n);return i&&je(r,i),Ae(t,this,r)}))},Bn.tail=function(t){var e=null==t?0:t.length;return e?Ji(t,1,e):[]},Bn.take=function(e,n,i){return e&&e.length?Ji(e,0,(n=i||n===t?1:ha(n))<0?0:n):[]},Bn.takeRight=function(e,n,i){var r=null==e?0:e.length;return r?Ji(e,(n=r-(n=i||n===t?1:ha(n)))<0?0:n,r):[]},Bn.takeRightWhile=function(t,e){return t&&t.length?lr(t,rs(e,3),!1,!0):[]},Bn.takeWhile=function(t,e){return t&&t.length?lr(t,rs(e,3)):[]},Bn.tap=function(t,e){return e(t),t},Bn.throttle=function(t,n,i){var r=!0,s=!0;if("function"!=typeof t)throw new $t(e);return Qo(i)&&(r="leading"in i?!!i.leading:r,s="trailing"in i?!!i.trailing:s),$o(t,n,{leading:r,maxWait:n,trailing:s})},Bn.thru=co,Bn.toArray=ca,Bn.toPairs=La,Bn.toPairsIn=Oa,Bn.toPath=function(t){return Wo(t)?Ie(t,Es):ra(t)?[t]:Mr(js(pa(t)))},Bn.toPlainObject=da,Bn.transform=function(t,e,n){var i=Wo(t),r=i||Vo(t)||sa(t);if(e=rs(e,4),null==n){var s=t&&t.constructor;n=r?i?new s:[]:Qo(t)&&Ho(s)?Dn(Kt(t)):{}}return(r?Se:wi)(t,(function(t,i,r){return e(n,t,i,r)})),n},Bn.unary=function(t){return xo(t,1)},Bn.union=Qs,Bn.unionBy=Zs,Bn.unionWith=qs,Bn.uniq=function(t){return t&&t.length?or(t):[]},Bn.uniqBy=function(t,e){return t&&t.length?or(t,rs(e,2)):[]},Bn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?or(e,t,n):[]},Bn.unset=function(t,e){return null==t||ar(t,e)},Bn.unzip=Js,Bn.unzipWith=to,Bn.update=function(t,e,n){return null==t?t:cr(t,e,pr(n))},Bn.updateWith=function(e,n,i,r){return r="function"==typeof r?r:t,null==e?e:cr(e,n,pr(i),r)},Bn.values=Pa,Bn.valuesIn=function(t){return null==t?[]:Ye(t,Ca(t))},Bn.without=eo,Bn.words=Ha,Bn.wrap=function(t,e){return _o(pr(e),t)},Bn.xor=no,Bn.xorBy=io,Bn.xorWith=ro,Bn.zip=so,Bn.zipObject=function(t,e){return fr(t||[],e||[],qn)},Bn.zipObjectDeep=function(t,e){return fr(t||[],e||[],Yi)},Bn.zipWith=oo,Bn.entries=La,Bn.entriesIn=Oa,Bn.extend=va,Bn.extendWith=wa,ic(Bn,Bn),Bn.add=pc,Bn.attempt=Xa,Bn.camelCase=Ba,Bn.capitalize=Da,Bn.ceil=gc,Bn.clamp=function(e,n,i){return i===t&&(i=n,n=t),i!==t&&(i=(i=fa(i))==i?i:0),n!==t&&(n=(n=fa(n))==n?n:0),ri(fa(e),n,i)},Bn.clone=function(t){return si(t,4)},Bn.cloneDeep=function(t){return si(t,5)},Bn.cloneDeepWith=function(e,n){return si(e,5,n="function"==typeof n?n:t)},Bn.cloneWith=function(e,n){return si(e,4,n="function"==typeof n?n:t)},Bn.conformsTo=function(t,e){return null==e||oi(t,e,$a(e))},Bn.deburr=Ra,Bn.defaultTo=function(t,e){return null==t||t!=t?e:t},Bn.divide=vc,Bn.endsWith=function(e,n,i){e=pa(e),n=sr(n);var r=e.length,s=i=i===t?r:ri(ha(i),0,r);return(i-=n.length)>=0&&e.slice(i,s)==n},Bn.eq=Po,Bn.escape=function(t){return(t=pa(t))&&V.test(t)?t.replace(F,tn):t},Bn.escapeRegExp=function(t){return(t=pa(t))&&J.test(t)?t.replace(q,"\\$&"):t},Bn.every=function(e,n,i){var r=Wo(e)?ze:ui;return i&&gs(e,n,i)&&(n=t),r(e,rs(n,3))},Bn.find=uo,Bn.findIndex=Ds,Bn.findKey=function(t,e){return Pe(t,rs(e,3),wi)},Bn.findLast=fo,Bn.findLastIndex=Rs,Bn.findLastKey=function(t,e){return Pe(t,rs(e,3),mi)},Bn.floor=wc,Bn.forEach=po,Bn.forEachRight=go,Bn.forIn=function(t,e){return null==t?t:gi(t,rs(e,3),Ca)},Bn.forInRight=function(t,e){return null==t?t:vi(t,rs(e,3),Ca)},Bn.forOwn=function(t,e){return t&&wi(t,rs(e,3))},Bn.forOwnRight=function(t,e){return t&&mi(t,rs(e,3))},Bn.get=Aa,Bn.gt=Bo,Bn.gte=Do,Bn.has=function(t,e){return null!=t&&us(t,e,Si)},Bn.hasIn=xa,Bn.head=Us,Bn.identity=Ja,Bn.includes=function(t,e,n,i){t=Fo(t)?t:Pa(t),n=n&&!i?ha(n):0;var r=t.length;return n<0&&(n=gn(r+n,0)),ia(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&De(t,e,n)>-1},Bn.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:ha(n);return r<0&&(r=gn(i+r,0)),De(t,e,r)},Bn.inRange=function(e,n,i){return n=la(n),i===t?(i=n,n=0):i=la(i),function(t,e,n){return t>=vn(e,n)&&t<gn(e,n)}(e=fa(e),n,i)},Bn.invoke=za,Bn.isArguments=Ro,Bn.isArray=Wo,Bn.isArrayBuffer=Uo,Bn.isArrayLike=Fo,Bn.isArrayLikeObject=Ko,Bn.isBoolean=function(t){return!0===t||!1===t||Zo(t)&&Ai(t)==d},Bn.isBuffer=Vo,Bn.isDate=No,Bn.isElement=function(t){return Zo(t)&&1===t.nodeType&&!ta(t)},Bn.isEmpty=function(t){if(null==t)return!0;if(Fo(t)&&(Wo(t)||"string"==typeof t||"function"==typeof t.splice||Vo(t)||sa(t)||Ro(t)))return!t.length;var e=hs(t);if(e==m||e==x)return!t.size;if(ys(t))return!_i(t).length;for(var n in t)if(Et.call(t,n))return!1;return!0},Bn.isEqual=function(t,e){return Ti(t,e)},Bn.isEqualWith=function(e,n,i){var r=(i="function"==typeof i?i:t)?i(e,n):t;return r===t?Ti(e,n,t,i):!!r},Bn.isError=Go,Bn.isFinite=function(t){return"number"==typeof t&&Oe(t)},Bn.isFunction=Ho,Bn.isInteger=Xo,Bn.isLength=Yo,Bn.isMap=qo,Bn.isMatch=function(t,e){return t===e||Ii(t,e,os(e))},Bn.isMatchWith=function(e,n,i){return i="function"==typeof i?i:t,Ii(e,n,os(n),i)},Bn.isNaN=function(t){return Jo(t)&&t!=+t},Bn.isNative=function(t){if(ms(t))throw new kt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return ji(t)},Bn.isNil=function(t){return null==t},Bn.isNull=function(t){return null===t},Bn.isNumber=Jo,Bn.isObject=Qo,Bn.isObjectLike=Zo,Bn.isPlainObject=ta,Bn.isRegExp=ea,Bn.isSafeInteger=function(t){return Xo(t)&&t>=-9007199254740991&&t<=a},Bn.isSet=na,Bn.isString=ia,Bn.isSymbol=ra,Bn.isTypedArray=sa,Bn.isUndefined=function(e){return e===t},Bn.isWeakMap=function(t){return Zo(t)&&hs(t)==z},Bn.isWeakSet=function(t){return Zo(t)&&"[object WeakSet]"==Ai(t)},Bn.join=function(t,e){return null==t?"":Ke.call(t,e)},Bn.kebabCase=Wa,Bn.last=Ns,Bn.lastIndexOf=function(e,n,i){var r=null==e?0:e.length;if(!r)return-1;var s=r;return i!==t&&(s=(s=ha(i))<0?gn(r+s,0):vn(s,r-1)),n==n?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(e,n,s):Be(e,We,s,!0)},Bn.lowerCase=Ua,Bn.lowerFirst=Fa,Bn.lt=oa,Bn.lte=aa,Bn.max=function(e){return e&&e.length?fi(e,Ja,xi):t},Bn.maxBy=function(e,n){return e&&e.length?fi(e,rs(n,2),xi):t},Bn.mean=function(t){return Ue(t,Ja)},Bn.meanBy=function(t,e){return Ue(t,rs(e,2))},Bn.min=function(e){return e&&e.length?fi(e,Ja,Li):t},Bn.minBy=function(e,n){return e&&e.length?fi(e,rs(n,2),Li):t},Bn.stubArray=uc,Bn.stubFalse=fc,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=mc,Bn.nth=function(e,n){return e&&e.length?Ri(e,ha(n)):t},Bn.noConflict=function(){return he._===this&&(he._=Bt),this},Bn.noop=rc,Bn.now=Ao,Bn.pad=function(t,e,n){t=pa(t);var i=(e=ha(e))?ln(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Wr(fe(r),n)+t+Wr(ue(r),n)},Bn.padEnd=function(t,e,n){t=pa(t);var i=(e=ha(e))?ln(t):0;return e&&i<e?t+Wr(e-i,n):t},Bn.padStart=function(t,e,n){t=pa(t);var i=(e=ha(e))?ln(t):0;return e&&i<e?Wr(e-i,n)+t:t},Bn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),mn(pa(t).replace(tt,""),e||0)},Bn.random=function(e,n,i){if(i&&"boolean"!=typeof i&&gs(e,n,i)&&(n=i=t),i===t&&("boolean"==typeof n?(i=n,n=t):"boolean"==typeof e&&(i=e,e=t)),e===t&&n===t?(e=0,n=1):(e=la(e),n===t?(n=e,e=0):n=la(n)),e>n){var r=e;e=n,n=r}if(i||e%1||n%1){var s=yn();return vn(e+s*(n-e+oe("1e-"+((s+"").length-1))),n)}return Vi(e,n)},Bn.reduce=function(t,e,n){var i=Wo(t)?Ee:Ve,r=arguments.length<3;return i(t,rs(e,4),n,r,li)},Bn.reduceRight=function(t,e,n){var i=Wo(t)?_e:Ve,r=arguments.length<3;return i(t,rs(e,4),n,r,hi)},Bn.repeat=function(e,n,i){return n=(i?gs(e,n,i):n===t)?1:ha(n),Ni(pa(e),n)},Bn.replace=function(){var t=arguments,e=pa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Bn.result=function(e,n,i){var r=-1,s=(n=gr(n,e)).length;for(s||(s=1,e=t);++r<s;){var o=null==e?t:e[Es(n[r])];o===t&&(r=s,o=i),e=Ho(o)?o.call(e):o}return e},Bn.round=yc,Bn.runInContext=X,Bn.sample=function(t){return(Wo(t)?Xn:Hi)(t)},Bn.size=function(t){if(null==t)return 0;if(Fo(t))return ia(t)?ln(t):t.length;var e=hs(t);return e==m||e==x?t.size:_i(t).length},Bn.snakeCase=Ka,Bn.some=function(e,n,i){var r=Wo(e)?Le:tr;return i&&gs(e,n,i)&&(n=t),r(e,rs(n,3))},Bn.sortedIndex=function(t,e){return er(t,e)},Bn.sortedIndexBy=function(t,e,n){return nr(t,e,rs(n,2))},Bn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var i=er(t,e);if(i<n&&Po(t[i],e))return i}return-1},Bn.sortedLastIndex=function(t,e){return er(t,e,!0)},Bn.sortedLastIndexBy=function(t,e,n){return nr(t,e,rs(n,2),!0)},Bn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=er(t,e,!0)-1;if(Po(t[n],e))return n}return-1},Bn.startCase=Va,Bn.startsWith=function(t,e,n){return t=pa(t),n=null==n?0:ri(ha(n),0,t.length),e=sr(e),t.slice(n,n+e.length)==e},Bn.subtract=bc,Bn.sum=function(t){return t&&t.length?Ne(t,Ja):0},Bn.sumBy=function(t,e){return t&&t.length?Ne(t,rs(e,2)):0},Bn.template=function(e,n,i){var r=Bn.templateSettings;i&&gs(e,n,i)&&(n=t),e=pa(e),n=ma({},n,r,Xr);var s=ma({},n.imports,r.imports,Xr),o=$a(s),a=Ye(s,o);Se(o,(function(t){if(ot.test(t))throw new kt("Invalid `imports` option passed into `_.template`")}));var c,l,h=0,u=n.interpolate||vt,f="__p += '",d=Mt((n.escape||vt).source+"|"+u.source+"|"+(u===H?ct:vt).source+"|"+(n.evaluate||vt).source+"|$","g"),p="//# sourceURL="+(Et.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ne+"]")+"\n";e.replace(d,(function(t,n,i,r,s,o){return i||(i=r),f+=e.slice(h,o).replace(wt,en),n&&(c=!0,f+="' +\n__e("+n+") +\n'"),s&&(l=!0,f+="';\n"+s+";\n__p += '"),i&&(f+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),h=o+t.length,t})),f+="';\n";var g=Et.call(n,"variable")&&n.variable;if(g){if(ot.test(g))throw new kt("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(l?f.replace(D,""):f).replace(R,"$1").replace(W,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(c?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=Xa((function(){return At(o,p+"return "+f).apply(t,a)}));if(v.source=f,Go(v))throw v;return v},Bn.times=function(t,e){if((t=ha(t))<1||t>a)return[];var n=l,i=vn(t,l);e=rs(e),t-=l;for(var r=Ge(i,e);++n<t;)e(n);return r},Bn.toFinite=la,Bn.toInteger=ha,Bn.toLength=ua,Bn.toLower=function(t){return pa(t).toLowerCase()},Bn.toNumber=fa,Bn.toSafeInteger=function(t){return t?ri(ha(t),-9007199254740991,a):0===t?t:0},Bn.toString=pa,Bn.toUpper=function(t){return pa(t).toUpperCase()},Bn.trim=function(e,n,i){if((e=pa(e))&&(i||n===t))return He(e);if(!e||!(n=sr(n)))return e;var r=hn(e),s=hn(n);return wr(r,Ze(r,s),qe(r,s)+1).join("")},Bn.trimEnd=function(e,n,i){if((e=pa(e))&&(i||n===t))return e.slice(0,un(e)+1);if(!e||!(n=sr(n)))return e;var r=hn(e);return wr(r,0,qe(r,hn(n))+1).join("")},Bn.trimStart=function(e,n,i){if((e=pa(e))&&(i||n===t))return e.replace(tt,"");if(!e||!(n=sr(n)))return e;var r=hn(e);return wr(r,Ze(r,hn(n))).join("")},Bn.truncate=function(e,n){var i=30,r="...";if(Qo(n)){var s="separator"in n?n.separator:s;i="length"in n?ha(n.length):i,r="omission"in n?sr(n.omission):r}var o=(e=pa(e)).length;if(nn(e)){var a=hn(e);o=a.length}if(i>=o)return e;var c=i-ln(r);if(c<1)return r;var l=a?wr(a,0,c).join(""):e.slice(0,c);if(s===t)return l+r;if(a&&(c+=l.length-c),ea(s)){if(e.slice(c).search(s)){var h,u=l;for(s.global||(s=Mt(s.source,pa(lt.exec(s))+"g")),s.lastIndex=0;h=s.exec(u);)var f=h.index;l=l.slice(0,f===t?c:f)}}else if(e.indexOf(sr(s),c)!=c){var d=l.lastIndexOf(s);d>-1&&(l=l.slice(0,d))}return l+r},Bn.unescape=function(t){return(t=pa(t))&&K.test(t)?t.replace(U,fn):t},Bn.uniqueId=function(t){var e=++_t;return pa(t)+e},Bn.upperCase=Na,Bn.upperFirst=Ga,Bn.each=po,Bn.eachRight=go,Bn.first=Us,ic(Bn,(dc={},wi(Bn,(function(t,e){Et.call(Bn.prototype,e)||(dc[e]=t)})),dc),{chain:!1}),Bn.VERSION="4.18.1",Se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Bn[t].placeholder=Bn})),Se(["drop","take"],(function(e,n){Un.prototype[e]=function(i){i=i===t?1:gn(ha(i),0);var r=this.__filtered__&&!n?new Un(this):this.clone();return r.__filtered__?r.__takeCount__=vn(i,r.__takeCount__):r.__views__.push({size:vn(i,l),type:e+(r.__dir__<0?"Right":"")}),r},Un.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Se(["filter","map","takeWhile"],(function(t,e){var n=e+1,i=1==n||3==n;Un.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:rs(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}})),Se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Un.prototype[t]=function(){return this[n](1).value()[0]}})),Se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Un.prototype[t]=function(){return this.__filtered__?new Un(this):this[n](1)}})),Un.prototype.compact=function(){return this.filter(Ja)},Un.prototype.find=function(t){return this.filter(t).head()},Un.prototype.findLast=function(t){return this.reverse().find(t)},Un.prototype.invokeMap=Gi((function(t,e){return"function"==typeof t?new Un(this):this.map((function(n){return $i(n,t,e)}))})),Un.prototype.reject=function(t){return this.filter(jo(rs(t)))},Un.prototype.slice=function(e,n){e=ha(e);var i=this;return i.__filtered__&&(e>0||n<0)?new Un(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),n!==t&&(i=(n=ha(n))<0?i.dropRight(-n):i.take(n-e)),i)},Un.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Un.prototype.toArray=function(){return this.take(l)},wi(Un.prototype,(function(e,n){var i=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),s=Bn[r?"take"+("last"==n?"Right":""):n],o=r||/^find/.test(n);s&&(Bn.prototype[n]=function(){var n=this.__wrapped__,a=r?[1]:arguments,c=n instanceof Un,l=a[0],h=c||Wo(n),u=function(t){var e=s.apply(Bn,je([t],a));return r&&f?e[0]:e};h&&i&&"function"==typeof l&&1!=l.length&&(c=h=!1);var f=this.__chain__,d=o&&!f,p=c&&!this.__actions__.length;if(!o&&h){n=p?n:new Un(this);var g=e.apply(n,a);return g.__actions__.push({func:co,args:[u],thisArg:t}),new Wn(g,f)}return d&&p?e.apply(this,a):(g=this.thru(u),d?r?g.value()[0]:g.value():g)})})),Se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Bn.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Wo(r)?r:[],t)}return this[n]((function(n){return e.apply(Wo(n)?n:[],t)}))}})),wi(Un.prototype,(function(t,e){var n=Bn[e];if(n){var i=n.name+"";Et.call(Cn,i)||(Cn[i]=[]),Cn[i].push({name:e,func:n})}})),Cn[Pr(t,2).name]=[{name:"wrapper",func:t}],Un.prototype.clone=function(){var t=new Un(this.__wrapped__);return t.__actions__=Mr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Mr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Mr(this.__views__),t},Un.prototype.reverse=function(){if(this.__filtered__){var t=new Un(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Un.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Wo(t),i=e<0,r=n?t.length:0,s=function(t,e,n){for(var i=-1,r=n.length;++i<r;){var s=n[i],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=vn(e,t+o);break;case"takeRight":t=gn(t,e-o)}}return{start:t,end:e}}(0,r,this.__views__),o=s.start,a=s.end,c=a-o,l=i?a:o-1,h=this.__iteratees__,u=h.length,f=0,d=vn(c,this.__takeCount__);if(!n||!i&&r==c&&d==c)return hr(t,this.__actions__);var p=[];t:for(;c--&&f<d;){for(var g=-1,v=t[l+=e];++g<u;){var w=h[g],m=w.type,y=(0,w.iteratee)(v);if(2==m)v=y;else if(!y){if(1==m)continue t;break t}}p[f++]=v}return p},Bn.prototype.at=lo,Bn.prototype.chain=function(){return ao(this)},Bn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},Bn.prototype.next=function(){this.__values__===t&&(this.__values__=ca(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Bn.prototype.plant=function(e){for(var n,i=this;i instanceof Rn;){var r=Ls(i);r.__index__=0,r.__values__=t,n?s.__wrapped__=r:n=r;var s=r;i=i.__wrapped__}return s.__wrapped__=e,n},Bn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Un){var n=e;return this.__actions__.length&&(n=new Un(this)),(n=n.reverse()).__actions__.push({func:co,args:[Ys],thisArg:t}),new Wn(n,this.__chain__)}return this.thru(Ys)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return hr(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Zt&&(Bn.prototype[Zt]=function(){return this}),Bn}();fe?((fe.exports=dn)._=dn,ue._=dn):he._=dn}.call(te.exports)),te.exports);
2
2
  /**
3
3
  * @license
4
4
  * Lodash <https://lodash.com/>