polotno 0.42.7 → 0.42.8

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.
@@ -13,4 +13,4 @@
13
13
  strong {
14
14
  font-weight: 1800;
15
15
  }
16
- `,RichEditor=({html:e,onBlur:t,onChange:r,element:a})=>{const i=react_1.default.useRef(null);return react_1.default.useEffect((()=>{if(!i.current)return;const e=new quill_1.default(i.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1}});return exports.quillRef.editor.instance=e,window.__polotnoQuill=e,e.on("text-change",(()=>{var t;e.getSelection()&&(exports.quillRef.currentFormat=e.getFormat()),r(null===(t=i.current)||void 0===t?void 0:t.childNodes[0].innerHTML)})),e.setSelection(0,0,"api"),e.on("selection-change",(r=>{r||t(),r&&(exports.quillRef.currentFormat=e.getFormat())})),i.current.childNodes[0].addEventListener("blur",(e=>{var r;(null===(r=e.relatedTarget)||void 0===r?void 0:r.classList.contains("ql-clipboard"))||t()})),()=>{exports.quillRef.editor.instance=null,exports.quillRef.currentFormat={},delete window.__polotnoQuill}}),[]),react_1.default.useEffect((()=>{var t;const r=exports.quillRef.editor.instance,n=r.getSelection();if(!((null===(t=i.current)||void 0===t?void 0:t.childNodes[0].innerHTML)===a.text)){var o=r.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+e+"<p><br></p></div>");r.setContents(o),r.history.clear(),n&&(r.setSelection(n.index,n.length),exports.quillRef.currentFormat=r.getFormat())}}),[a.text]),react_1.default.createElement(RichTextContainer,{ref:i,style:{fontSize:a.fontSize,color:a.fill,width:a.width,fontFamily:a.fontFamily,lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,textAlign:a.align}})};function useHtmlSize(e,t,r){return react_1.default.useMemo((()=>(0,html2canvas_1.detectSize)(e)),[e,t.width,r])}exports.HTMLElement=(0,mobx_react_lite_1.observer)((({element:e,store:t})=>{const r=react_1.default.useRef(null),[a,i]=react_1.default.useState(),[n,o]=react_1.default.useState(!1),[l,s]=react_1.default.useState(!0),[c,u]=react_1.default.useState(!1),[d,f]=react_1.default.useState(!1),_=react_1.default.useRef(e.height),h=t.selectedElements.indexOf(e)>=0,m=e.fontSize/4,[g]=(0,text_element_1.useFontLoader)(t,e.fontFamily);(0,use_fadein_1.useFadeIn)(r);const p=g?e.fontFamily:"Arial",x=`<div style="width: ${e.width||100}px; color: ${e.fill}; font-size: ${e.fontSize}px; font-family: '${p}'; text-decoration: ${e.textDecoration}; text-align: ${e.align}; line-height: ${e.lineHeight}; letter-spacing: ${e.letterSpacing}; font-style: ${e.fontStyle}; font-weight: ${e.fontWeight}; -webkit-text-stroke: ${e.strokeWidth}px ${e.stroke};" contentEditable>${e.text}</div>`,{width:v,height:y}=useHtmlSize(x,e,g);react_1.default.useEffect((()=>{e.set({height:y})}),[y]),react_1.default.useLayoutEffect((()=>{if(n||c)return;const t=(0,loader_1.incrementLoader)(`text ${e.id}`);s(!0),async function(){await new Promise((e=>setTimeout(e)));const r=await(0,html2canvas_1.htmlToCanvas)({html:x,width:e.width||1,height:y||1,fontFamily:p,padding:m});i(r),s(!1),konva_1.default.Util.requestAnimFrame(t)}()}),[x,n,y,c,p]);const b=n||l;return react_1.default.useLayoutEffect((()=>mobx.autorun((()=>{const t=r.current;(0,apply_filters_1.applyFilter)(t,e)}))),[a,b]),react_1.default.createElement(react_1.default.Fragment,null,react_1.default.createElement(react_konva_1.Rect,{ref:r,name:"element",x:e.x,y:e.y,listening:e.selectable,rotation:e.rotation,width:e.width,height:e.height,visible:!b,draggable:!e.locked,opacity:c?0:e.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,hideInExport:!e.showInExport,onMouseEnter:()=>{f(!0)},onMouseLeave:()=>{f(!1)},onDragStart:()=>{t.history.startTransaction()},onDragMove:t=>{setTimeout((()=>{e.set({x:t.target.x(),y:t.target.y()})}))},onDragEnd:r=>{e.set({x:r.target.x(),y:r.target.y()}),t.history.endTransaction()},id:e.id,onDblClick:()=>{e.locked||u(!0)},onDblTap:()=>{e.locked||u(!0)},onTransformStart:t=>{o(!0),_.current=e.height},onTransform:t=>{var r;const a=t.target,i=(null===(r=a.getStage())||void 0===r?void 0:r.findOne("Transformer")).getActiveAnchor(),n="middle-left"===i||"middle-right"===i,o="top-center"===i||"bottom-center"===i,l=a.scaleX();if(n){const t=a.scaleX(),r=Math.max(a.width()*t,e.fontSize);a.width(r),a.scaleX(1),e.set({width:r,x:a.x()})}else if(o){const r=Math.max(y,_.current),i=Math.max(r,t.target.height()*t.target.scaleY());a.scaleY(1),console.log(i),e.set({x:a.x(),y:a.y(),height:i,rotation:a.rotation()})}else a.scaleX(1),a.scaleY(1),e.set({fontSize:e.fontSize*l,width:a.width()*l,x:a.x(),y:a.y(),rotation:a.rotation()})},onTransformEnd:t=>{o(!1),s(!0);const r=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:e.fontSize*r,width:t.target.width()*r,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})}}),react_1.default.createElement(react_konva_1.Image,{ref:r,image:a,x:e.x,y:e.y,offsetX:m,offsetY:m,listening:!1,rotation:e.rotation,width:e.width+2*m,height:e.height+2*m,visible:!b,opacity:c?0:e.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,hideInExport:!e.showInExport}),b&&react_1.default.createElement(react_konva_1.Group,{x:e.x,y:e.y,rotation:e.rotation},react_1.default.createElement(react_konva_utils_1.Html,{divProps:{style:{pointerEvents:"none"}}},react_1.default.createElement(RichTextContainer,{dangerouslySetInnerHTML:{__html:x},style:{pointerEvents:"none",display:"inline-block"}}))),c&&react_1.default.createElement(react_konva_1.Group,{x:e.x,y:e.y,rotation:e.rotation},react_1.default.createElement(react_konva_utils_1.Html,null,react_1.default.createElement(RichEditor,{html:x,element:e,onChange:t=>{e.set({text:t})},onBlur:e=>{u(!1)}}))),(h||d)&&react_1.default.createElement(highlighter_1.Highlighter,{element:e}))}));
16
+ `,RichEditor=({html:e,onBlur:t,onChange:r,element:a})=>{const i=react_1.default.useRef(null);return react_1.default.useEffect((()=>{if(!i.current)return;const e=new quill_1.default(i.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1}});return exports.quillRef.editor.instance=e,window.__polotnoQuill=e,e.on("text-change",(()=>{var t;e.getSelection()&&(exports.quillRef.currentFormat=e.getFormat()),r(null===(t=i.current)||void 0===t?void 0:t.childNodes[0].innerHTML)})),e.setSelection(0,0,"api"),e.on("selection-change",(r=>{r||t(),r&&(exports.quillRef.currentFormat=e.getFormat())})),i.current.childNodes[0].addEventListener("blur",(e=>{var r;(null===(r=e.relatedTarget)||void 0===r?void 0:r.classList.contains("ql-clipboard"))||t()})),()=>{exports.quillRef.editor.instance=null,exports.quillRef.currentFormat={},delete window.__polotnoQuill}}),[]),react_1.default.useEffect((()=>{var t;const r=exports.quillRef.editor.instance,n=r.getSelection();if(!((null===(t=i.current)||void 0===t?void 0:t.childNodes[0].innerHTML)===a.text)){var o=r.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+e+"<p><br></p></div>");r.setContents(o),r.history.clear(),n&&(r.setSelection(n.index,n.length),exports.quillRef.currentFormat=r.getFormat())}}),[a.text]),react_1.default.createElement(RichTextContainer,{ref:i,style:{fontSize:a.fontSize,color:a.fill,width:a.width,fontFamily:a.fontFamily,lineHeight:a.lineHeight,letterSpacing:a.letterSpacing+"rem",textAlign:a.align}})};function useHtmlSize(e,t,r){return react_1.default.useMemo((()=>(0,html2canvas_1.detectSize)(e)),[e,t.width,r])}exports.HTMLElement=(0,mobx_react_lite_1.observer)((({element:e,store:t})=>{const r=react_1.default.useRef(null),[a,i]=react_1.default.useState(),[n,o]=react_1.default.useState(!1),[l,c]=react_1.default.useState(!0),[s,u]=react_1.default.useState(!1),[d,f]=react_1.default.useState(!1),_=react_1.default.useRef(e.height),h=t.selectedElements.indexOf(e)>=0,m=e.fontSize/4,[g]=(0,text_element_1.useFontLoader)(t,e.fontFamily);(0,use_fadein_1.useFadeIn)(r);const p=g?e.fontFamily:"Arial",x=`<div style="width: ${e.width||100}px; color: ${e.fill}; font-size: ${e.fontSize}px; font-family: '${p}'; text-decoration: ${e.textDecoration}; text-align: ${e.align}; line-height: ${e.lineHeight}; letter-spacing: ${e.letterSpacing}rem; font-style: ${e.fontStyle}; font-weight: ${e.fontWeight}; -webkit-text-stroke: ${e.strokeWidth}px ${e.stroke};" contentEditable>${e.text}</div>`,{width:v,height:y}=useHtmlSize(x,e,g);react_1.default.useEffect((()=>{e.set({height:y})}),[y]);const b=react_1.default.useRef(0);react_1.default.useLayoutEffect((()=>{if(n||s)return;b.current++;const t=b.current,r=(0,loader_1.incrementLoader)(`text ${e.id}`);c(!0),async function(){await new Promise((e=>setTimeout(e)));const a=await(0,html2canvas_1.htmlToCanvas)({html:x,width:e.width||1,height:y||1,fontFamily:p,padding:m});t===b.current&&(i(a),c(!1),konva_1.default.Util.requestAnimFrame(r))}()}),[x,n,y,s,p]);const w=n||l;return react_1.default.useLayoutEffect((()=>mobx.autorun((()=>{const t=r.current;(0,apply_filters_1.applyFilter)(t,e)}))),[a,w]),react_1.default.createElement(react_1.default.Fragment,null,react_1.default.createElement(react_konva_1.Rect,{ref:r,name:"element",x:e.x,y:e.y,listening:e.selectable,rotation:e.rotation,width:e.width,height:e.height,visible:!w,draggable:!e.locked,opacity:s?0:e.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,hideInExport:!e.showInExport,onMouseEnter:()=>{f(!0)},onMouseLeave:()=>{f(!1)},onDragStart:()=>{t.history.startTransaction()},onDragMove:t=>{setTimeout((()=>{e.set({x:t.target.x(),y:t.target.y()})}))},onDragEnd:r=>{e.set({x:r.target.x(),y:r.target.y()}),t.history.endTransaction()},id:e.id,onDblClick:()=>{e.locked||u(!0)},onDblTap:()=>{e.locked||u(!0)},onTransformStart:t=>{o(!0),_.current=e.height},onTransform:t=>{var r;const a=t.target,i=(null===(r=a.getStage())||void 0===r?void 0:r.findOne("Transformer")).getActiveAnchor(),n="middle-left"===i||"middle-right"===i,o="top-center"===i||"bottom-center"===i,l=a.scaleX();if(n){const t=a.scaleX(),r=Math.max(a.width()*t,e.fontSize);a.width(r),a.scaleX(1),e.set({width:r,x:a.x()})}else if(o){const r=Math.max(y,_.current),i=Math.max(r,t.target.height()*t.target.scaleY());a.scaleY(1),console.log(i),e.set({x:a.x(),y:a.y(),height:i,rotation:a.rotation()})}else a.scaleX(1),a.scaleY(1),e.set({fontSize:e.fontSize*l,width:a.width()*l,x:a.x(),y:a.y(),rotation:a.rotation()})},onTransformEnd:t=>{o(!1),c(!0);const r=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:e.fontSize*r,width:t.target.width()*r,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})}}),react_1.default.createElement(react_konva_1.Image,{ref:r,image:a,x:e.x,y:e.y,offsetX:m,offsetY:m,listening:!1,rotation:e.rotation,width:e.width+2*m,height:e.height+2*m,visible:!w,opacity:s?0:e.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,hideInExport:!e.showInExport}),w&&react_1.default.createElement(react_konva_1.Group,{x:e.x,y:e.y,rotation:e.rotation},react_1.default.createElement(react_konva_utils_1.Html,{divProps:{style:{pointerEvents:"none"}}},react_1.default.createElement(RichTextContainer,{dangerouslySetInnerHTML:{__html:x},style:{pointerEvents:"none",display:"inline-block"}}))),s&&react_1.default.createElement(react_konva_1.Group,{x:e.x,y:e.y,rotation:e.rotation},react_1.default.createElement(react_konva_utils_1.Html,null,react_1.default.createElement(RichEditor,{html:x,element:e,onChange:t=>{e.set({text:t})},onBlur:e=>{u(!1)}}))),(h||d)&&react_1.default.createElement(highlighter_1.Highlighter,{element:e}))}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polotno",
3
- "version": "0.42.7",
3
+ "version": "0.42.8",
4
4
  "description": "Design Editor Framework",
5
5
  "author": "Anton Lavrenov",
6
6
  "keywords": [
package/polotno.bundle.js CHANGED
@@ -61,7 +61,7 @@ THE SOFTWARE.
61
61
  strong {
62
62
  font-weight: 1800;
63
63
  }
64
- `,ju=({html:e,onBlur:t,onChange:r,element:o})=>{const i=n(u).useRef(null);return n(u).useEffect((()=>{if(!i.current)return;const e=new(n(hc))(i.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1}});return Nu.editor.instance=e,window.__polotnoQuill=e,e.on("text-change",(()=>{e.getSelection()&&(Nu.currentFormat=e.getFormat()),r(i.current?.childNodes[0].innerHTML)})),e.setSelection(0,0,"api"),e.on("selection-change",(n=>{n||t(),n&&(Nu.currentFormat=e.getFormat())})),i.current.childNodes[0].addEventListener("blur",(e=>{e.relatedTarget?.classList.contains("ql-clipboard")||t()})),()=>{Nu.editor.instance=null,Nu.currentFormat={},delete window.__polotnoQuill}}),[]),n(u).useEffect((()=>{const t=Nu.editor.instance,n=t.getSelection();if(!(i.current?.childNodes[0].innerHTML===o.text)){var r=t.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+e+"<p><br></p></div>");t.setContents(r),t.history.clear(),n&&(t.setSelection(n.index,n.length),Nu.currentFormat=t.getFormat())}}),[o.text]),s.jsx(Ru,{ref:i,style:{fontSize:o.fontSize,color:o.fill,width:o.width,fontFamily:o.fontFamily,lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,textAlign:o.align}})};function Vu(e,t,r){return n(u).useMemo((()=>function(e){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000",wu.appendChild(t);const n=t.getBoundingClientRect();return wu.removeChild(t),{width:n.width,height:n.height}}(e)),[e,t.width,r])}const Iu=Br((({element:e,store:t})=>{const r=n(u).useRef(null),[o,i]=n(u).useState(),[a,l]=n(u).useState(!1),[c,h]=n(u).useState(!0),[f,d]=n(u).useState(!1),[p,v]=n(u).useState(!1),m=n(u).useRef(e.height),g=t.selectedElements.indexOf(e)>=0,y=e.fontSize/4,[b]=Ns(t,e.fontFamily);us(r);const w=b?e.fontFamily:"Arial",x=`<div style="width: ${e.width||100}px; color: ${e.fill}; font-size: ${e.fontSize}px; font-family: '${w}'; text-decoration: ${e.textDecoration}; text-align: ${e.align}; line-height: ${e.lineHeight}; letter-spacing: ${e.letterSpacing}; font-style: ${e.fontStyle}; font-weight: ${e.fontWeight}; -webkit-text-stroke: ${e.strokeWidth}px ${e.stroke};" contentEditable>${e.text}</div>`,{width:_,height:E}=Vu(x,e,b);n(u).useEffect((()=>{e.set({height:E})}),[E]),n(u).useLayoutEffect((()=>{if(a||f)return;const t=ds(`text ${e.id}`);h(!0),async function(){await new Promise((e=>setTimeout(e)));const n=await async function({html:e,width:t,height:n,fontFamily:r,padding:o}){const i=document.createElement("canvas");"Arial"!==r&&(e+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${r}" rel="stylesheet">`),e+="\n<style>\n html, body {\n padding: 0;\n margin: 0;\n }\n p {\n margin: 0;\n padding: 0\n }\n ul {\n list-style-position: inside;\n margin: 0;\n }\n</style>\n";const a=await bu.drawHTML(`<div style="padding: ${o}px;">${e}</div>`,i,{width:t+2*o,height:n+2*o});return i.width=2*(t+2*o),i.height=2*(n+2*o),i.getContext("2d")?.drawImage(a.image,0,0,2*a.image.width,2*a.image.height),i}({html:x,width:e.width||1,height:E||1,fontFamily:w,padding:y});i(n),h(!1),Ja.Util.requestAnimFrame(t)}()}),[x,a,E,f,w]);const z=a||c;return n(u).useLayoutEffect((()=>Ut((()=>{Ls(r.current,e)}))),[o,z]),s.jsxs(n(u).Fragment,{children:[s.jsx(Ql,{ref:r,name:"element",x:e.x,y:e.y,listening:e.selectable,rotation:e.rotation,width:e.width,height:e.height,visible:!z,draggable:!e.locked,opacity:f?0:e.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,hideInExport:!e.showInExport,onMouseEnter:()=>{v(!0)},onMouseLeave:()=>{v(!1)},onDragStart:()=>{t.history.startTransaction()},onDragMove:t=>{setTimeout((()=>{e.set({x:t.target.x(),y:t.target.y()})}))},onDragEnd:n=>{e.set({x:n.target.x(),y:n.target.y()}),t.history.endTransaction()},id:e.id,onDblClick:()=>{e.locked||d(!0)},onDblTap:()=>{e.locked||d(!0)},onTransformStart:t=>{l(!0),m.current=e.height},onTransform:t=>{const n=t.target,r=n.getStage()?.findOne("Transformer"),o=r.getActiveAnchor(),i="middle-left"===o||"middle-right"===o,a="top-center"===o||"bottom-center"===o,l=n.scaleX();if(i){const t=n.scaleX(),r=Math.max(n.width()*t,e.fontSize);n.width(r),n.scaleX(1),e.set({width:r,x:n.x()})}else if(a){const r=Math.max(E,m.current),o=Math.max(r,t.target.height()*t.target.scaleY());n.scaleY(1),console.log(o),e.set({x:n.x(),y:n.y(),height:o,rotation:n.rotation()})}else n.scaleX(1),n.scaleY(1),e.set({fontSize:e.fontSize*l,width:n.width()*l,x:n.x(),y:n.y(),rotation:n.rotation()})},onTransformEnd:t=>{l(!1),h(!0);const n=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:e.fontSize*n,width:t.target.width()*n,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})}}),s.jsx(Jl,{ref:r,image:o,x:e.x,y:e.y,offsetX:y,offsetY:y,listening:!1,rotation:e.rotation,width:e.width+2*y,height:e.height+2*y,visible:!z,opacity:f?0:e.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,hideInExport:!e.showInExport}),z&&s.jsx($l,{x:e.x,y:e.y,rotation:e.rotation,children:s.jsx(is.Html,{divProps:{style:{pointerEvents:"none"}},children:s.jsx(Ru,{dangerouslySetInnerHTML:{__html:x},style:{pointerEvents:"none",display:"inline-block"}})})}),f&&s.jsx($l,{x:e.x,y:e.y,rotation:e.rotation,children:s.jsx(is.Html,{children:s.jsx(ju,{html:x,element:e,onChange:t=>{e.set({text:t})},onBlur:e=>{d(!1)}})})}),(g||p)&&s.jsx(ks,{element:e})]})})),Du={text:Rs,image:lc,svg:lc};var Fu=Br((e=>{let t=Du[e.element.type];return"text"===e.element.type&&Ms.htmlRenderEnabled&&(t=Iu),e.element.visible?t?s.jsx(t,{...e}):(console.error("Can not find component for "+e.element.type),null):null}));u=l("8NFma");function Bu(e,t,n,r,o){const i=Math.sqrt(n*n+r*r);o+=Math.atan2(r,n);return{x:e+i*Math.cos(o),y:t+i*Math.sin(o)}}function Uu(e){const{x:t,y:n,width:r,height:o}=e,i=Ja.Util.degToRad(e.rotation),a=Bu(t,n,0,0,i),l=Bu(t,n,r,0,i),s=Bu(t,n,r,o,i),c=Bu(t,n,0,o,i),u=Math.min(a.x,l.x,s.x,c.x),h=Math.min(a.y,l.y,s.y,c.y),f=Math.max(a.x,l.x,s.x,c.x),d=Math.max(a.y,l.y,s.y,c.y);return{x:u,y:h,width:f-u,height:d-h,minX:u,minY:h,maxX:f,maxY:d}}function Gu(e,t){var n=[],r=[];e.vertical.forEach((e=>{t.vertical.forEach((t=>{var r=Math.abs(e-t.guide);r<5&&n.push({lineGuide:e,diff:r,snap:t.snap,offset:t.offset})}))})),e.horizontal.forEach((e=>{t.horizontal.forEach((t=>{var n=Math.abs(e-t.guide);n<5&&r.push({lineGuide:e,diff:n,snap:t.snap,offset:t.offset})}))}));var o=[];const i=n.sort(((e,t)=>e.diff-t.diff)),a=r.sort(((e,t)=>e.diff-t.diff));var l=i[0],s=a[0];if(l){i.filter((e=>Math.abs(e.diff-l.diff)<.1)).forEach((e=>{o.push({orientation:"V",...e})}))}if(s){a.filter((e=>Math.abs(e.diff-s.diff)<.1)).forEach((e=>{o.push({orientation:"H",...e})}))}return o}function qu(e){const t=e=>e.hasName("element")||e.hasName("page-background")||e.hasName("elements-area");function r(n){const r=e.current?.getStage();var o=[],i=[];return r.find(t).forEach((e=>{if(!(n.indexOf(e)>=0)){var t=e.getClientRect({skipShadow:!0,skipStroke:!0});o.push(t.x,t.x+t.width,t.x+t.width/2),i.push(t.y,t.y+t.height,t.y+t.height/2)}})),{vertical:o,horizontal:i}}function o(t){const n=e.current?.getLayer(),r=n?.children.find((e=>"line-guides"===e.name()));t.forEach((e=>{if("H"===e.orientation){var t=new Ja.Line({points:[-6e3,e.lineGuide,6e3,e.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});r?.add(t),n.batchDraw()}else if("V"===e.orientation){t=new Ja.Line({points:[e.lineGuide,-6e3,e.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});r?.add(t)}}))}const i=e=>{e.target.getLayer().children.find((e=>"line-guides"===e.name())).destroyChildren();var t=r(e.target.nodes()),n=function(e){const t=e.__getNodeRect(),n=Uu({...t,rotation:Ja.Util.radToDeg(t.rotation)}),r=e.getAbsolutePosition();return{vertical:[{guide:n.x,offset:r.x-n.x,snap:"start"},{guide:n.x+n.width/2,offset:r.x-n.x-n.width/2,snap:"center"},{guide:n.x+n.width,offset:r.x-n.x-n.width,snap:"end"}],horizontal:[{guide:n.y,offset:r.y-n.y,snap:"start"},{guide:n.y+n.height/2,offset:r.y-n.y-n.height/2,snap:"center"},{guide:n.y+n.height,offset:r.y-n.y-n.height,snap:"end"}]}}(e.target),i=Gu(t,n);if(!i.length)return;o(i);const a=e.target.getAbsolutePosition(),l={...a};i.forEach((e=>{switch(e.snap){case"start":case"center":case"end":switch(e.orientation){case"V":l.x=e.lineGuide+e.offset;break;case"H":l.y=e.lineGuide+e.offset}}}));const s=l.x-a.x,c=l.y-a.y;e.evt.ctrlKey||e.evt.metaKey||e.target.nodes().forEach((e=>{const t=e.getAbsolutePosition();e.setAbsolutePosition({x:t.x+s,y:t.y+c})}))},a=(t,n,i)=>{const a=e.current,l=a.getLayer();if(l.children.find((e=>"line-guides"===e.name())).destroyChildren(),"rotater"===a.getActiveAnchor())return n;if(Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))>50)return n;if(!l)return n;var s=Gu(r(a.nodes()),{vertical:[{guide:n.x,offset:0,snap:"start"}],horizontal:[{guide:n.y,offset:0,snap:"start"}]});if(!s.length)return n;o(s);if(i.ctrlKey||i.metaKey)return n;let c=n.x,u=n.x;s.forEach((e=>{switch(e.orientation){case"V":c=e.lineGuide;break;case"H":u=e.lineGuide}}));const h=Math.abs(n.x-c)<10,f=Math.abs(n.y-u)<10;return h&&!f?{x:c,y:t.y}:f&&!h?{x:t.x,y:u}:h&&f?{x:c,y:u}:n},l=e=>{const t=e.target.getLayer();t.children.find((e=>"line-guides"===e.name())).destroyChildren(),t.batchDraw()};n(u).useEffect((()=>{e.current&&(e.current.anchorDragBoundFunc(a),e.current.on("dragstart",(()=>{setTimeout((()=>{const e=[...Ja.DD._dragElements.entries()];e.reverse(),Ja.DD._dragElements.clear(),e.forEach((([e,t])=>{Ja.DD._dragElements.set(e,t)}))}))})),e.current.on("dragmove",i),e.current.on("dragend",l),e.current.on("transformend",l))}),[])}l("8NFma");var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.LegacyColors=Wu.Colors=void 0;var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.Colors=void 0;const Yu={CERULEAN1:"#0C5174",CERULEAN2:"#0F6894",CERULEAN3:"#147EB3",CERULEAN4:"#3FA6DA",CERULEAN5:"#68C1EE",FOREST1:"#1D7324",FOREST2:"#238C2C",FOREST3:"#29A634",FOREST4:"#43BF4D",FOREST5:"#62D96B",GOLD1:"#5C4405",GOLD2:"#866103",GOLD3:"#D1980B",GOLD4:"#F0B726",GOLD5:"#FBD065",INDIGO1:"#5642A6",INDIGO2:"#634DBF",INDIGO3:"#7961DB",INDIGO4:"#9881F3",INDIGO5:"#BDADFF",LIME1:"#43501B",LIME2:"#5A701A",LIME3:"#8EB125",LIME4:"#B6D94C",LIME5:"#D4F17E",ROSE1:"#A82255",ROSE2:"#C22762",ROSE3:"#DB2C6F",ROSE4:"#F5498B",ROSE5:"#FF66A1",SEPIA1:"#5E4123",SEPIA2:"#7A542E",SEPIA3:"#946638",SEPIA4:"#AF855A",SEPIA5:"#D0B090",TURQUOISE1:"#004D46",TURQUOISE2:"#007067",TURQUOISE3:"#00A396",TURQUOISE4:"#13C9BA",TURQUOISE5:"#7AE1D8",VERMILION1:"#96290D",VERMILION2:"#B83211",VERMILION3:"#D33D17",VERMILION4:"#EB6847",VERMILION5:"#FF9980",VIOLET1:"#5C255C",VIOLET2:"#7C327C",VIOLET3:"#9D3F9D",VIOLET4:"#BD6BBD",VIOLET5:"#D69FD6"},Xu={COBALT1:Yu.CERULEAN1,COBALT2:Yu.CERULEAN2,COBALT3:Yu.CERULEAN3,COBALT4:Yu.CERULEAN4,COBALT5:Yu.CERULEAN5};Ku.Colors=Object.assign(Object.assign(Object.assign(Object.assign({},{BLACK:"#111418",DARK_GRAY1:"#1C2127",DARK_GRAY2:"#252A31",DARK_GRAY3:"#2F343C",DARK_GRAY4:"#383E47",DARK_GRAY5:"#404854",GRAY1:"#5F6B7C",GRAY2:"#738091",GRAY3:"#8F99A8",GRAY4:"#ABB3BF",GRAY5:"#C5CBD3",LIGHT_GRAY1:"#D3D8DE",LIGHT_GRAY2:"#DCE0E5",LIGHT_GRAY3:"#E5E8EB",LIGHT_GRAY4:"#EDEFF2",LIGHT_GRAY5:"#F6F7F9",WHITE:"#FFFFFF"}),{BLUE1:"#184A90",BLUE2:"#215DB0",BLUE3:"#2D72D2",BLUE4:"#4C90F0",BLUE5:"#8ABBFF",GREEN1:"#165A36",GREEN2:"#1C6E42",GREEN3:"#238551",GREEN4:"#32A467",GREEN5:"#72CA9B",ORANGE1:"#77450D",ORANGE2:"#935610",ORANGE3:"#C87619",ORANGE4:"#EC9A3C",ORANGE5:"#FBB360",RED1:"#8E292C",RED2:"#AC2F33",RED3:"#CD4246",RED4:"#E76A6E",RED5:"#FA999C"}),Yu),Xu),Object.defineProperty(Wu,"Colors",{enumerable:!0,get:function(){return Ku.Colors}});var $u={};Object.defineProperty($u,"__esModule",{value:!0}),$u.LegacyColors=void 0,$u.LegacyColors={BLACK:"#10161A",BLUE1:"#0E5A8A",BLUE2:"#106BA3",BLUE3:"#137CBD",BLUE4:"#2B95D6",BLUE5:"#48AFF0",COBALT1:"#1F4B99",COBALT2:"#2458B3",COBALT3:"#2965CC",COBALT4:"#4580E6",COBALT5:"#669EFF",DARK_GRAY1:"#182026",DARK_GRAY2:"#202B33",DARK_GRAY3:"#293742",DARK_GRAY4:"#30404D",DARK_GRAY5:"#394B59",FOREST1:"#1D7324",FOREST2:"#238C2C",FOREST3:"#29A634",FOREST4:"#43BF4D",FOREST5:"#62D96B",GOLD1:"#A67908",GOLD2:"#BF8C0A",GOLD3:"#D99E0B",GOLD4:"#F2B824",GOLD5:"#FFC940",GRAY1:"#5C7080",GRAY2:"#738694",GRAY3:"#8A9BA8",GRAY4:"#A7B6C2",GRAY5:"#BFCCD6",GREEN1:"#0A6640",GREEN2:"#0D8050",GREEN3:"#0F9960",GREEN4:"#15B371",GREEN5:"#3DCC91",INDIGO1:"#5642A6",INDIGO2:"#634DBF",INDIGO3:"#7157D9",INDIGO4:"#9179F2",INDIGO5:"#AD99FF",LIGHT_GRAY1:"#CED9E0",LIGHT_GRAY2:"#D8E1E8",LIGHT_GRAY3:"#E1E8ED",LIGHT_GRAY4:"#EBF1F5",LIGHT_GRAY5:"#F5F8FA",LIME1:"#728C23",LIME2:"#87A629",LIME3:"#9BBF30",LIME4:"#B6D94C",LIME5:"#D1F26D",ORANGE1:"#A66321",ORANGE2:"#BF7326",ORANGE3:"#D9822B",ORANGE4:"#F29D49",ORANGE5:"#FFB366",RED1:"#A82A2A",RED2:"#C23030",RED3:"#DB3737",RED4:"#F55656",RED5:"#FF7373",ROSE1:"#A82255",ROSE2:"#C22762",ROSE3:"#DB2C6F",ROSE4:"#F5498B",ROSE5:"#FF66A1",SEPIA1:"#63411E",SEPIA2:"#7D5125",SEPIA3:"#96622D",SEPIA4:"#B07B46",SEPIA5:"#C99765",TURQUOISE1:"#008075",TURQUOISE2:"#00998C",TURQUOISE3:"#00B3A4",TURQUOISE4:"#14CCBD",TURQUOISE5:"#2EE6D6",VERMILION1:"#9E2B0E",VERMILION2:"#B83211",VERMILION3:"#D13913",VERMILION4:"#EB532D",VERMILION5:"#FF6E4A",VIOLET1:"#5C255C",VIOLET2:"#752F75",VIOLET3:"#8F398F",VIOLET4:"#A854A8",VIOLET5:"#C274C2",WHITE:"#FFFFFF"},Object.defineProperty(Wu,"LegacyColors",{enumerable:!0,get:function(){return $u.LegacyColors}});var Qu={};e(Qu,"ACTIVE",(()=>kh)),e(Qu,"ALIGN_LEFT",(()=>Ph)),e(Qu,"ALIGN_RIGHT",(()=>Th)),e(Qu,"DARK",(()=>Hh)),e(Qu,"DISABLED",(()=>Nh)),e(Qu,"FILL",(()=>Rh)),e(Qu,"FIXED",(()=>jh)),e(Qu,"FIXED_TOP",(()=>Vh)),e(Qu,"INLINE",(()=>Ih)),e(Qu,"INTERACTIVE",(()=>Dh)),e(Qu,"LARGE",(()=>Fh)),e(Qu,"LOADING",(()=>Bh)),e(Qu,"MINIMAL",(()=>Uh)),e(Qu,"OUTLINED",(()=>Gh)),e(Qu,"MULTILINE",(()=>qh)),e(Qu,"ROUND",(()=>Wh)),e(Qu,"SELECTED",(()=>Kh)),e(Qu,"SMALL",(()=>Yh)),e(Qu,"VERTICAL",(()=>Xh)),e(Qu,"POSITION_TOP",(()=>$h)),e(Qu,"positionClass",(()=>tm)),e(Qu,"POSITION_BOTTOM",(()=>Qh)),e(Qu,"POSITION_LEFT",(()=>Zh)),e(Qu,"POSITION_RIGHT",(()=>Jh)),e(Qu,"ELEVATION_0",(()=>ef)),e(Qu,"elevationClass",(()=>Zv)),e(Qu,"ELEVATION_1",(()=>tf)),e(Qu,"ELEVATION_2",(()=>nf)),e(Qu,"ELEVATION_3",(()=>rf)),e(Qu,"ELEVATION_4",(()=>of)),e(Qu,"INTENT_PRIMARY",(()=>af)),e(Qu,"intentClass",(()=>em)),e(Qu,"INTENT_SUCCESS",(()=>lf)),e(Qu,"INTENT_WARNING",(()=>sf)),e(Qu,"INTENT_DANGER",(()=>cf)),e(Qu,"FOCUS_DISABLED",(()=>uf)),e(Qu,"FOCUS_STYLE_MANAGER_IGNORE",(()=>hf)),e(Qu,"UI_TEXT",(()=>ff)),e(Qu,"RUNNING_TEXT",(()=>df)),e(Qu,"MONOSPACE_TEXT",(()=>pf)),e(Qu,"TEXT_LARGE",(()=>vf)),e(Qu,"TEXT_SMALL",(()=>mf)),e(Qu,"TEXT_MUTED",(()=>gf)),e(Qu,"TEXT_DISABLED",(()=>yf)),e(Qu,"TEXT_OVERFLOW_ELLIPSIS",(()=>bf)),e(Qu,"BLOCKQUOTE",(()=>wf)),e(Qu,"CODE",(()=>xf)),e(Qu,"CODE_BLOCK",(()=>_f)),e(Qu,"HEADING",(()=>Ef)),e(Qu,"LIST",(()=>zf)),e(Qu,"LIST_UNSTYLED",(()=>Sf)),e(Qu,"RTL",(()=>Cf)),e(Qu,"ALERT",(()=>Of)),e(Qu,"ALERT_BODY",(()=>Mf)),e(Qu,"ALERT_CONTENTS",(()=>Af)),e(Qu,"ALERT_FOOTER",(()=>Lf)),e(Qu,"BREADCRUMB",(()=>kf)),e(Qu,"BREADCRUMB_CURRENT",(()=>Pf)),e(Qu,"BREADCRUMBS",(()=>Tf)),e(Qu,"BREADCRUMBS_COLLAPSED",(()=>Hf)),e(Qu,"BUTTON",(()=>Nf)),e(Qu,"BUTTON_GROUP",(()=>Rf)),e(Qu,"BUTTON_SPINNER",(()=>jf)),e(Qu,"BUTTON_TEXT",(()=>Vf)),e(Qu,"CALLOUT",(()=>If)),e(Qu,"CALLOUT_ICON",(()=>Df)),e(Qu,"CARD",(()=>Ff)),e(Qu,"COLLAPSE",(()=>Bf)),e(Qu,"COLLAPSE_BODY",(()=>Uf)),e(Qu,"COLLAPSIBLE_LIST",(()=>Gf)),e(Qu,"CONTEXT_MENU",(()=>qf)),e(Qu,"CONTEXT_MENU_POPOVER_TARGET",(()=>Wf)),e(Qu,"CONTROL_GROUP",(()=>Kf)),e(Qu,"DIALOG",(()=>Yf)),e(Qu,"DIALOG_CONTAINER",(()=>Xf)),e(Qu,"DIALOG_BODY",(()=>$f)),e(Qu,"DIALOG_CLOSE_BUTTON",(()=>Qf)),e(Qu,"DIALOG_FOOTER",(()=>Zf)),e(Qu,"DIALOG_FOOTER_ACTIONS",(()=>Jf)),e(Qu,"DIALOG_HEADER",(()=>ed)),e(Qu,"DIALOG_STEP",(()=>td)),e(Qu,"DIALOG_STEP_CONTAINER",(()=>nd)),e(Qu,"DIALOG_STEP_TITLE",(()=>rd)),e(Qu,"DIALOG_STEP_ICON",(()=>od)),e(Qu,"DIALOG_STEP_VIEWED",(()=>id)),e(Qu,"DIVIDER",(()=>ad)),e(Qu,"DRAWER",(()=>ld)),e(Qu,"DRAWER_BODY",(()=>sd)),e(Qu,"DRAWER_FOOTER",(()=>cd)),e(Qu,"DRAWER_HEADER",(()=>ud)),e(Qu,"EDITABLE_TEXT",(()=>hd)),e(Qu,"EDITABLE_TEXT_CONTENT",(()=>fd)),e(Qu,"EDITABLE_TEXT_EDITING",(()=>dd)),e(Qu,"EDITABLE_TEXT_INPUT",(()=>pd)),e(Qu,"EDITABLE_TEXT_PLACEHOLDER",(()=>vd)),e(Qu,"FLEX_EXPANDER",(()=>md)),e(Qu,"HTML_SELECT",(()=>gd)),e(Qu,"SELECT",(()=>yd)),e(Qu,"HTML_TABLE",(()=>bd)),e(Qu,"HTML_TABLE_BORDERED",(()=>wd)),e(Qu,"HTML_TABLE_CONDENSED",(()=>xd)),e(Qu,"HTML_TABLE_STRIPED",(()=>_d)),e(Qu,"INPUT",(()=>Ed)),e(Qu,"INPUT_GHOST",(()=>zd)),e(Qu,"INPUT_GROUP",(()=>Sd)),e(Qu,"INPUT_LEFT_CONTAINER",(()=>Cd)),e(Qu,"INPUT_ACTION",(()=>Od)),e(Qu,"CONTROL",(()=>Md)),e(Qu,"CONTROL_INDICATOR",(()=>Ad)),e(Qu,"CONTROL_INDICATOR_CHILD",(()=>Ld)),e(Qu,"CHECKBOX",(()=>kd)),e(Qu,"RADIO",(()=>Pd)),e(Qu,"SWITCH",(()=>Td)),e(Qu,"SWITCH_INNER_TEXT",(()=>Hd)),e(Qu,"FILE_INPUT",(()=>Nd)),e(Qu,"FILE_INPUT_HAS_SELECTION",(()=>Rd)),e(Qu,"FILE_UPLOAD_INPUT",(()=>jd)),e(Qu,"FILE_UPLOAD_INPUT_CUSTOM_TEXT",(()=>Vd)),e(Qu,"KEY",(()=>Id)),e(Qu,"KEY_COMBO",(()=>Dd)),e(Qu,"MODIFIER_KEY",(()=>Fd)),e(Qu,"HOTKEY",(()=>Bd)),e(Qu,"HOTKEY_LABEL",(()=>Ud)),e(Qu,"HOTKEY_COLUMN",(()=>Gd)),e(Qu,"HOTKEY_DIALOG",(()=>qd)),e(Qu,"LABEL",(()=>Wd)),e(Qu,"FORM_GROUP",(()=>Kd)),e(Qu,"FORM_CONTENT",(()=>Yd)),e(Qu,"FORM_HELPER_TEXT",(()=>Xd)),e(Qu,"FORM_GROUP_SUB_LABEL",(()=>$d)),e(Qu,"MENU",(()=>Qd)),e(Qu,"MENU_ITEM",(()=>Zd)),e(Qu,"MENU_ITEM_ICON",(()=>Jd)),e(Qu,"MENU_ITEM_LABEL",(()=>ep)),e(Qu,"MENU_SUBMENU",(()=>tp)),e(Qu,"MENU_SUBMENU_ICON",(()=>np)),e(Qu,"MENU_DIVIDER",(()=>rp)),e(Qu,"MENU_HEADER",(()=>op)),e(Qu,"MULTISTEP_DIALOG",(()=>ip)),e(Qu,"MULTISTEP_DIALOG_PANELS",(()=>ap)),e(Qu,"MULTISTEP_DIALOG_LEFT_PANEL",(()=>lp)),e(Qu,"MULTISTEP_DIALOG_RIGHT_PANEL",(()=>sp)),e(Qu,"MULTISTEP_DIALOG_FOOTER",(()=>cp)),e(Qu,"MULTISTEP_DIALOG_NAV_TOP",(()=>up)),e(Qu,"MULTISTEP_DIALOG_NAV_RIGHT",(()=>hp)),e(Qu,"NAVBAR",(()=>fp)),e(Qu,"NAVBAR_GROUP",(()=>dp)),e(Qu,"NAVBAR_HEADING",(()=>pp)),e(Qu,"NAVBAR_DIVIDER",(()=>vp)),e(Qu,"NON_IDEAL_STATE",(()=>mp)),e(Qu,"NON_IDEAL_STATE_VISUAL",(()=>gp)),e(Qu,"NON_IDEAL_STATE_TEXT",(()=>yp)),e(Qu,"NUMERIC_INPUT",(()=>bp)),e(Qu,"OVERFLOW_LIST",(()=>wp)),e(Qu,"OVERFLOW_LIST_SPACER",(()=>xp)),e(Qu,"OVERLAY",(()=>_p)),e(Qu,"OVERLAY_BACKDROP",(()=>Ep)),e(Qu,"OVERLAY_CONTAINER",(()=>zp)),e(Qu,"OVERLAY_CONTENT",(()=>Sp)),e(Qu,"OVERLAY_INLINE",(()=>Cp)),e(Qu,"OVERLAY_OPEN",(()=>Op)),e(Qu,"OVERLAY_SCROLL_CONTAINER",(()=>Mp)),e(Qu,"OVERLAY_START_FOCUS_TRAP",(()=>Ap)),e(Qu,"OVERLAY_END_FOCUS_TRAP",(()=>Lp)),e(Qu,"PANEL_STACK",(()=>kp)),e(Qu,"PANEL_STACK_HEADER",(()=>Pp)),e(Qu,"PANEL_STACK_HEADER_BACK",(()=>Tp)),e(Qu,"PANEL_STACK_VIEW",(()=>Hp)),e(Qu,"PANEL_STACK2",(()=>Np)),e(Qu,"PANEL_STACK2_HEADER",(()=>Rp)),e(Qu,"PANEL_STACK2_HEADER_BACK",(()=>jp)),e(Qu,"PANEL_STACK2_VIEW",(()=>Vp)),e(Qu,"POPOVER",(()=>Ip)),e(Qu,"POPOVER_ARROW",(()=>Dp)),e(Qu,"POPOVER_BACKDROP",(()=>Fp)),e(Qu,"POPOVER_CAPTURING_DISMISS",(()=>Bp)),e(Qu,"POPOVER_CONTENT",(()=>Up)),e(Qu,"POPOVER_CONTENT_SIZING",(()=>Gp)),e(Qu,"POPOVER_DISMISS",(()=>qp)),e(Qu,"POPOVER_DISMISS_OVERRIDE",(()=>Wp)),e(Qu,"POPOVER_OPEN",(()=>Kp)),e(Qu,"POPOVER_OUT_OF_BOUNDARIES",(()=>Yp)),e(Qu,"POPOVER_TARGET",(()=>Xp)),e(Qu,"POPOVER_WRAPPER",(()=>$p)),e(Qu,"TRANSITION_CONTAINER",(()=>Qp)),e(Qu,"PROGRESS_BAR",(()=>Zp)),e(Qu,"PROGRESS_METER",(()=>Jp)),e(Qu,"PROGRESS_NO_STRIPES",(()=>ev)),e(Qu,"PROGRESS_NO_ANIMATION",(()=>tv)),e(Qu,"PORTAL",(()=>nv)),e(Qu,"SKELETON",(()=>rv)),e(Qu,"SLIDER",(()=>ov)),e(Qu,"SLIDER_AXIS",(()=>iv)),e(Qu,"SLIDER_HANDLE",(()=>av)),e(Qu,"SLIDER_LABEL",(()=>lv)),e(Qu,"SLIDER_TRACK",(()=>sv)),e(Qu,"SLIDER_PROGRESS",(()=>cv)),e(Qu,"START",(()=>uv)),e(Qu,"END",(()=>hv)),e(Qu,"SPINNER",(()=>fv)),e(Qu,"SPINNER_ANIMATION",(()=>dv)),e(Qu,"SPINNER_HEAD",(()=>pv)),e(Qu,"SPINNER_NO_SPIN",(()=>vv)),e(Qu,"SPINNER_TRACK",(()=>mv)),e(Qu,"TAB",(()=>gv)),e(Qu,"TAB_INDICATOR",(()=>yv)),e(Qu,"TAB_INDICATOR_WRAPPER",(()=>bv)),e(Qu,"TAB_LIST",(()=>wv)),e(Qu,"TAB_PANEL",(()=>xv)),e(Qu,"TABS",(()=>_v)),e(Qu,"TAG",(()=>Ev)),e(Qu,"TAG_REMOVE",(()=>zv)),e(Qu,"TAG_INPUT",(()=>Sv)),e(Qu,"TAG_INPUT_ICON",(()=>Cv)),e(Qu,"TAG_INPUT_VALUES",(()=>Ov)),e(Qu,"TOAST",(()=>Mv)),e(Qu,"TOAST_CONTAINER",(()=>Av)),e(Qu,"TOAST_MESSAGE",(()=>Lv)),e(Qu,"TOOLTIP",(()=>kv)),e(Qu,"TOOLTIP_INDICATOR",(()=>Pv)),e(Qu,"TREE",(()=>Tv)),e(Qu,"TREE_NODE",(()=>Hv)),e(Qu,"TREE_NODE_CARET",(()=>Nv)),e(Qu,"TREE_NODE_CARET_CLOSED",(()=>Rv)),e(Qu,"TREE_NODE_CARET_NONE",(()=>jv)),e(Qu,"TREE_NODE_CARET_OPEN",(()=>Vv)),e(Qu,"TREE_NODE_CONTENT",(()=>Iv)),e(Qu,"TREE_NODE_EXPANDED",(()=>Dv)),e(Qu,"TREE_NODE_ICON",(()=>Fv)),e(Qu,"TREE_NODE_LABEL",(()=>Bv)),e(Qu,"TREE_NODE_LIST",(()=>Uv)),e(Qu,"TREE_NODE_SECONDARY_LABEL",(()=>Gv)),e(Qu,"TREE_NODE_SELECTED",(()=>qv)),e(Qu,"TREE_ROOT",(()=>Wv)),e(Qu,"ICON",(()=>Kv)),e(Qu,"ICON_STANDARD",(()=>Yv)),e(Qu,"ICON_LARGE",(()=>Xv)),e(Qu,"getClassNamespace",(()=>$v)),e(Qu,"alignmentClass",(()=>Qv)),e(Qu,"iconClass",(()=>Jv));var Zu="left",Ju="right",eh=0,th=1,nh=2,rh=3,oh=4,ih="none",ah="primary",lh="success",sh="warning",ch="danger",uh={BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",LEFT:"left",LEFT_BOTTOM:"left-bottom",LEFT_TOP:"left-top",RIGHT:"right",RIGHT_BOTTOM:"right-bottom",RIGHT_TOP:"right-top",TOP:"top",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var hh,fh,dh,ph=hh={};function vh(){throw new Error("setTimeout has not been defined")}function mh(){throw new Error("clearTimeout has not been defined")}function gh(e){if(fh===setTimeout)return setTimeout(e,0);if((fh===vh||!fh)&&setTimeout)return fh=setTimeout,setTimeout(e,0);try{return fh(e,0)}catch(t){try{return fh.call(null,e,0)}catch(t){return fh.call(this,e,0)}}}!function(){try{fh="function"==typeof setTimeout?setTimeout:vh}catch(e){fh=vh}try{dh="function"==typeof clearTimeout?clearTimeout:mh}catch(e){dh=mh}}();var yh,bh,wh,xh,_h,Eh=[],zh=!1,Sh=-1;function Ch(){zh&&yh&&(zh=!1,yh.length?Eh=yh.concat(Eh):Sh=-1,Eh.length&&Oh())}function Oh(){if(!zh){var e=gh(Ch);zh=!0;for(var t=Eh.length;t;){for(yh=Eh,Eh=[];++Sh<t;)yh&&yh[Sh].run();Sh=-1,t=Eh.length}yh=null,zh=!1,function(e){if(dh===clearTimeout)return clearTimeout(e);if((dh===mh||!dh)&&clearTimeout)return dh=clearTimeout,clearTimeout(e);try{dh(e)}catch(t){try{return dh.call(null,e)}catch(t){return dh.call(this,e)}}}(e)}}function Mh(e,t){this.fun=e,this.array=t}function Ah(){}ph.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Eh.push(new Mh(e,t)),1!==Eh.length||zh||gh(Oh)},Mh.prototype.run=function(){this.fun.apply(null,this.array)},ph.title="browser",ph.browser=!0,ph.env={},ph.argv=[],ph.version="",ph.versions={},ph.on=Ah,ph.addListener=Ah,ph.once=Ah,ph.off=Ah,ph.removeListener=Ah,ph.removeAllListeners=Ah,ph.emit=Ah,ph.prependListener=Ah,ph.prependOnceListener=Ah,ph.listeners=function(e){return[]},ph.binding=function(e){throw new Error("process.binding is not supported")},ph.cwd=function(){return"/"},ph.chdir=function(e){throw new Error("process.chdir is not supported")},ph.umask=function(){return 0};var Lh="bp4";void 0!==hh&&(Lh=null!==(_h=null!==(wh=void 0===(bh={})?void 0:bh.BLUEPRINT_NAMESPACE)&&void 0!==wh?wh:void 0===(xh={})?void 0:xh.REACT_APP_BLUEPRINT_NAMESPACE)&&void 0!==_h?_h:Lh);var kh="".concat(Lh,"-active"),Ph="".concat(Lh,"-align-left"),Th="".concat(Lh,"-align-right"),Hh="".concat(Lh,"-dark"),Nh="".concat(Lh,"-disabled"),Rh="".concat(Lh,"-fill"),jh="".concat(Lh,"-fixed"),Vh="".concat(Lh,"-fixed-top"),Ih="".concat(Lh,"-inline"),Dh="".concat(Lh,"-interactive"),Fh="".concat(Lh,"-large"),Bh="".concat(Lh,"-loading"),Uh="".concat(Lh,"-minimal"),Gh="".concat(Lh,"-outlined"),qh="".concat(Lh,"-multiline"),Wh="".concat(Lh,"-round"),Kh="".concat(Lh,"-selected"),Yh="".concat(Lh,"-small"),Xh="".concat(Lh,"-vertical"),$h=tm(uh.TOP),Qh=tm(uh.BOTTOM),Zh=tm(uh.LEFT),Jh=tm(uh.RIGHT),ef=Zv(eh),tf=Zv(th),nf=Zv(nh),rf=Zv(rh),of=Zv(oh),af=em(ah),lf=em(lh),sf=em(sh),cf=em(ch),uf="".concat(Lh,"-focus-disabled"),hf="".concat(Lh,"-focus-style-manager-ignore"),ff="".concat(Lh,"-ui-text"),df="".concat(Lh,"-running-text"),pf="".concat(Lh,"-monospace-text"),vf="".concat(Lh,"-text-large"),mf="".concat(Lh,"-text-small"),gf="".concat(Lh,"-text-muted"),yf="".concat(Lh,"-text-disabled"),bf="".concat(Lh,"-text-overflow-ellipsis"),wf="".concat(Lh,"-blockquote"),xf="".concat(Lh,"-code"),_f="".concat(Lh,"-code-block"),Ef="".concat(Lh,"-heading"),zf="".concat(Lh,"-list"),Sf="".concat(Lh,"-list-unstyled"),Cf="".concat(Lh,"-rtl"),Of="".concat(Lh,"-alert"),Mf="".concat(Of,"-body"),Af="".concat(Of,"-contents"),Lf="".concat(Of,"-footer"),kf="".concat(Lh,"-breadcrumb"),Pf="".concat(kf,"-current"),Tf="".concat(kf,"s"),Hf="".concat(kf,"s-collapsed"),Nf="".concat(Lh,"-button"),Rf="".concat(Nf,"-group"),jf="".concat(Nf,"-spinner"),Vf="".concat(Nf,"-text"),If="".concat(Lh,"-callout"),Df="".concat(If,"-icon"),Ff="".concat(Lh,"-card"),Bf="".concat(Lh,"-collapse"),Uf="".concat(Bf,"-body"),Gf="".concat(Lh,"-collapse-list"),qf="".concat(Lh,"-context-menu"),Wf="".concat(qf,"-popover-target"),Kf="".concat(Lh,"-control-group"),Yf="".concat(Lh,"-dialog"),Xf="".concat(Yf,"-container"),$f="".concat(Yf,"-body"),Qf="".concat(Yf,"-close-button"),Zf="".concat(Yf,"-footer"),Jf="".concat(Yf,"-footer-actions"),ed="".concat(Yf,"-header"),td="".concat(Lh,"-dialog-step"),nd="".concat(td,"-container"),rd="".concat(td,"-title"),od="".concat(td,"-icon"),id="".concat(td,"-viewed"),ad="".concat(Lh,"-divider"),ld="".concat(Lh,"-drawer"),sd="".concat(ld,"-body"),cd="".concat(ld,"-footer"),ud="".concat(ld,"-header"),hd="".concat(Lh,"-editable-text"),fd="".concat(hd,"-content"),dd="".concat(hd,"-editing"),pd="".concat(hd,"-input"),vd="".concat(hd,"-placeholder"),md="".concat(Lh,"-flex-expander"),gd="".concat(Lh,"-html-select"),yd="".concat(Lh,"-select"),bd="".concat(Lh,"-html-table"),wd="".concat(bd,"-bordered"),xd="".concat(bd,"-condensed"),_d="".concat(bd,"-striped"),Ed="".concat(Lh,"-input"),zd="".concat(Ed,"-ghost"),Sd="".concat(Ed,"-group"),Cd="".concat(Ed,"-left-container"),Od="".concat(Ed,"-action"),Md="".concat(Lh,"-control"),Ad="".concat(Md,"-indicator"),Ld="".concat(Ad,"-child"),kd="".concat(Lh,"-checkbox"),Pd="".concat(Lh,"-radio"),Td="".concat(Lh,"-switch"),Hd="".concat(Td,"-inner-text"),Nd="".concat(Lh,"-file-input"),Rd="".concat(Lh,"-file-input-has-selection"),jd="".concat(Lh,"-file-upload-input"),Vd="".concat(Lh,"-file-upload-input-custom-text"),Id="".concat(Lh,"-key"),Dd="".concat(Id,"-combo"),Fd="".concat(Lh,"-modifier-key"),Bd="".concat(Lh,"-hotkey"),Ud="".concat(Bd,"-label"),Gd="".concat(Bd,"-column"),qd="".concat(Bd,"-dialog"),Wd="".concat(Lh,"-label"),Kd="".concat(Lh,"-form-group"),Yd="".concat(Lh,"-form-content"),Xd="".concat(Lh,"-form-helper-text"),$d="".concat(Lh,"-form-group-sub-label"),Qd="".concat(Lh,"-menu"),Zd="".concat(Qd,"-item"),Jd="".concat(Zd,"-icon"),ep="".concat(Zd,"-label"),tp="".concat(Lh,"-submenu"),np="".concat(tp,"-icon"),rp="".concat(Qd,"-divider"),op="".concat(Qd,"-header"),ip="".concat(Lh,"-multistep-dialog"),ap="".concat(ip,"-panels"),lp="".concat(ip,"-left-panel"),sp="".concat(ip,"-right-panel"),cp="".concat(ip,"-footer"),up="".concat(ip,"-nav-top"),hp="".concat(ip,"-nav-right"),fp="".concat(Lh,"-navbar"),dp="".concat(fp,"-group"),pp="".concat(fp,"-heading"),vp="".concat(fp,"-divider"),mp="".concat(Lh,"-non-ideal-state"),gp="".concat(mp,"-visual"),yp="".concat(mp,"-text"),bp="".concat(Lh,"-numeric-input"),wp="".concat(Lh,"-overflow-list"),xp="".concat(wp,"-spacer"),_p="".concat(Lh,"-overlay"),Ep="".concat(_p,"-backdrop"),zp="".concat(_p,"-container"),Sp="".concat(_p,"-content"),Cp="".concat(_p,"-inline"),Op="".concat(_p,"-open"),Mp="".concat(_p,"-scroll-container"),Ap="".concat(_p,"-start-focus-trap"),Lp="".concat(_p,"-end-focus-trap"),kp="".concat(Lh,"-panel-stack"),Pp="".concat(kp,"-header"),Tp="".concat(kp,"-header-back"),Hp="".concat(kp,"-view"),Np="".concat(Lh,"-panel-stack2"),Rp="".concat(kp,"-header"),jp="".concat(kp,"-header-back"),Vp="".concat(kp,"-view"),Ip="".concat(Lh,"-popover"),Dp="".concat(Ip,"-arrow"),Fp="".concat(Ip,"-backdrop"),Bp="".concat(Ip,"-capturing-dismiss"),Up="".concat(Ip,"-content"),Gp="".concat(Up,"-sizing"),qp="".concat(Ip,"-dismiss"),Wp="".concat(qp,"-override"),Kp="".concat(Ip,"-open"),Yp="".concat(Ip,"-out-of-boundaries"),Xp="".concat(Ip,"-target"),$p="".concat(Ip,"-wrapper"),Qp="".concat(Lh,"-transition-container"),Zp="".concat(Lh,"-progress-bar"),Jp="".concat(Lh,"-progress-meter"),ev="".concat(Lh,"-no-stripes"),tv="".concat(Lh,"-no-animation"),nv="".concat(Lh,"-portal"),rv="".concat(Lh,"-skeleton"),ov="".concat(Lh,"-slider"),iv="".concat(ov,"-axis"),av="".concat(ov,"-handle"),lv="".concat(ov,"-label"),sv="".concat(ov,"-track"),cv="".concat(ov,"-progress"),uv="".concat(Lh,"-start"),hv="".concat(Lh,"-end"),fv="".concat(Lh,"-spinner"),dv="".concat(fv,"-animation"),pv="".concat(fv,"-head"),vv="".concat(Lh,"-no-spin"),mv="".concat(fv,"-track"),gv="".concat(Lh,"-tab"),yv="".concat(gv,"-indicator"),bv="".concat(yv,"-wrapper"),wv="".concat(gv,"-list"),xv="".concat(gv,"-panel"),_v="".concat(gv,"s"),Ev="".concat(Lh,"-tag"),zv="".concat(Ev,"-remove"),Sv="".concat(Lh,"-tag-input"),Cv="".concat(Sv,"-icon"),Ov="".concat(Sv,"-values"),Mv="".concat(Lh,"-toast"),Av="".concat(Mv,"-container"),Lv="".concat(Mv,"-message"),kv="".concat(Lh,"-tooltip"),Pv="".concat(kv,"-indicator"),Tv="".concat(Lh,"-tree"),Hv="".concat(Lh,"-tree-node"),Nv="".concat(Hv,"-caret"),Rv="".concat(Nv,"-closed"),jv="".concat(Nv,"-none"),Vv="".concat(Nv,"-open"),Iv="".concat(Hv,"-content"),Dv="".concat(Hv,"-expanded"),Fv="".concat(Hv,"-icon"),Bv="".concat(Hv,"-label"),Uv="".concat(Hv,"-list"),Gv="".concat(Hv,"-secondary-label"),qv="".concat(Hv,"-selected"),Wv="".concat(Lh,"-tree-root"),Kv="".concat(Lh,"-icon"),Yv="".concat(Kv,"-standard"),Xv="".concat(Kv,"-large");function $v(){return Lh}function Qv(e){switch(e){case Zu:return Ph;case Ju:return Th;default:return}}function Zv(e){if(void 0!==e)return"".concat(Lh,"-elevation-").concat(e)}function Jv(e){if(null!=e)return 0===e.indexOf("".concat(Lh,"-icon-"))?e:"".concat(Lh,"-icon-").concat(e)}function em(e){if(null!=e&&e!==ih)return"".concat(Lh,"-intent-").concat(e.toLowerCase())}function tm(e){if(void 0!==e)return"".concat(Lh,"-position-").concat(e)}var nm={};e(nm,"BACKSPACE",(()=>rm)),e(nm,"TAB",(()=>om)),e(nm,"ENTER",(()=>im)),e(nm,"SHIFT",(()=>am)),e(nm,"ESCAPE",(()=>lm)),e(nm,"SPACE",(()=>sm)),e(nm,"ARROW_LEFT",(()=>cm)),e(nm,"ARROW_UP",(()=>um)),e(nm,"ARROW_RIGHT",(()=>hm)),e(nm,"ARROW_DOWN",(()=>fm)),e(nm,"DELETE",(()=>dm)),e(nm,"isKeyboardClick",(()=>pm));var rm=8,om=9,im=13,am=16,lm=27,sm=32,cm=37,um=38,hm=39,fm=40,dm=46;function pm(e){return e===im||e===sm}var vm={};e(vm,"isDarkTheme",(()=>Km)),e(vm,"setRef",(()=>Ym)),e(vm,"getRef",(()=>$m));var mm={};function gm(e,t,n){return void 0===n&&(n=function(e,t){return e===t}),null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((function(e,r){return n(e,t[r])}))}function ym(e,t,n){if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e)||Array.isArray(t))return!1;if(null!=n)return xm(e,t,n);var r=Object.keys(e),o=Object.keys(t);return xm(e,t,{include:r})&&xm(e,t,{include:o})}function bm(e,t,n){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e)||Array.isArray(t))return gm(e,t,bm);if(Em(e)||Em(t))return e===t;if(null!=n)return _m(e,t,n);if(e.constructor!==t.constructor)return!1;var r=Object.keys(e),o=Object.keys(t);return null!=r&&null!=o&&(0===r.length&&0===o.length||gm(r,o)&&_m(e,t,r))}function wm(e,t,n){void 0===e&&(e={}),void 0===t&&(t={});var r=null==n?function(e,t){var n=Object.keys(e),r=Object.keys(t),o=zm(n.concat(r));return Object.keys(o)}(e,t):n;return function(e,t,n,r){return n.filter((function(n){return!r(e,t,n)})).map((function(n){return{key:n,valueA:e[n],valueB:t[n]}}))}(e,t,r,(function(e,t,n){return bm(e,t,[n])}))}function xm(e,t,n){return function(e,t,n){if(function(e){return null!=e&&null!=e.include}(n))return n.include;if(function(e){return null!=e&&null!=e.exclude}(n)){var r=Object.keys(e),o=Object.keys(t),i=zm(r.concat(o));return n.exclude.forEach((function(e){return delete i[e]})),Object.keys(i)}return[]}(e,t,n).every((function(n){return e.hasOwnProperty(n)===t.hasOwnProperty(n)&&e[n]===t[n]}))}function _m(e,t,n){return n.every((function(n){return e.hasOwnProperty(n)===t.hasOwnProperty(n)&&bm(e[n],t[n])}))}function Em(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e}function zm(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})}e(mm,"arraysEqual",(()=>gm)),e(mm,"shallowCompareKeys",(()=>ym)),e(mm,"deepCompareKeys",(()=>bm)),e(mm,"getDeepUnequalKeyValues",(()=>wm));var Sm={};function Cm(e,t){return e===t||e.contains(t)}function Om(e,t,n){var r=Lm((function(t){e.dispatchEvent(new CustomEvent(n,t))}));return e.addEventListener(t,r),r}function Mm(e,t){return void 0===t&&(t={}),Lm(e,(function(e){t.preventDefault&&e.preventDefault()}),(function(e){return e.persist()}))}function Am(e){return Lm(e)}function Lm(e,t,n){var r=!1;return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null==t||t.apply(void 0,o),r||(r=!0,null==n||n.apply(void 0,o),requestAnimationFrame((function(){e.apply(void 0,o),r=!1})))}}e(Sm,"elementIsOrContains",(()=>Cm)),e(Sm,"throttleEvent",(()=>Om)),e(Sm,"throttleReactEventCallback",(()=>Mm)),e(Sm,"throttle",(()=>Am));var km={};function Pm(e){return"function"==typeof e}e(km,"isFunction",(()=>Pm));var Tm={};e(Tm,"isNodeEnv",(()=>Hm)),e(Tm,"arrayLengthCompare",(()=>Nm)),e(Tm,"approxEqual",(()=>Rm)),e(Tm,"clamp",(()=>jm)),e(Tm,"countDecimalPlaces",(()=>Vm)),e(Tm,"uniqueId",(()=>Dm));function Hm(e){return void 0!==hh&&hh.env&&"production"===e}function Nm(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),e.length-t.length}function Rm(e,t,n){return void 0===n&&(n=1e-5),Math.abs(e-t)<=n}function jm(e,t,n){if(null==e)return e;if(n<t)throw new Error("[Blueprint] clamp: max cannot be less than min");return Math.min(Math.max(e,t),n)}function Vm(e){if(!isFinite(e))return 0;for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}var Im=new Map;function Dm(e){var t,n=null!==(t=Im.get(e))&&void 0!==t?t:0;return Im.set(e,n+1),"".concat(e,"-").concat(n)}var Fm={};e(Fm,"isReactNodeEmpty",(()=>Bm)),e(Fm,"isReactChildrenElementOrElements",(()=>Um)),e(Fm,"ensureElement",(()=>Gm)),e(Fm,"getDisplayName",(()=>qm)),e(Fm,"isElementOfType",(()=>Wm));u=l("8NFma");function Bm(e,t){return void 0===t&&(t=!1),null==e||""===e||!1===e||!t&&Array.isArray(e)&&(0===e.length||e.every((function(e){return Bm(e,!0)})))}function Um(e){return!Bm(e,!0)&&!0!==e}function Gm(e,t){return void 0===t&&(t="span"),null==e||"boolean"==typeof e?void 0:"string"==typeof e?e.trim().length>0?u.createElement(t,{},e):void 0:"number"==typeof e||"symbol"==typeof e.type||Array.isArray(e)?u.createElement(t,{},e):function(e){return"object"==typeof e&&void 0!==e.type&&void 0!==e.props}(e)?e:void 0}function qm(e){return e.displayName||e.name||"Unknown"}function Wm(e,t){return null!=e&&null!=e.type&&null!=e.type.displayName&&e.type.displayName===t.displayName}function Km(e){return null!=e&&e instanceof Element&&null!=e.closest(".".concat(Hh))}function Ym(e,t){var n;null!=(n=e)&&"function"!=typeof n?e.current=t:function(e){return"function"==typeof e}(e)&&e(t)}function Xm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){e.forEach((function(e){Ym(e,t)}))}}function $m(e){var t;return null===e?null:null!==(t=e.current)&&void 0!==t?t:e}function Qm(e,t,n){return function(r){e[t]=r,Ym(n,r)}}"undefined"!=typeof window&&"undefined"!=typeof document&&l("2j10E"),r(vm,mm),r(vm,Sm),r(vm,km),r(vm,Tm),r(vm,Fm);
64
+ `,ju=({html:e,onBlur:t,onChange:r,element:o})=>{const i=n(u).useRef(null);return n(u).useEffect((()=>{if(!i.current)return;const e=new(n(hc))(i.current,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1}});return Nu.editor.instance=e,window.__polotnoQuill=e,e.on("text-change",(()=>{e.getSelection()&&(Nu.currentFormat=e.getFormat()),r(i.current?.childNodes[0].innerHTML)})),e.setSelection(0,0,"api"),e.on("selection-change",(n=>{n||t(),n&&(Nu.currentFormat=e.getFormat())})),i.current.childNodes[0].addEventListener("blur",(e=>{e.relatedTarget?.classList.contains("ql-clipboard")||t()})),()=>{Nu.editor.instance=null,Nu.currentFormat={},delete window.__polotnoQuill}}),[]),n(u).useEffect((()=>{const t=Nu.editor.instance,n=t.getSelection();if(!(i.current?.childNodes[0].innerHTML===o.text)){var r=t.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+e+"<p><br></p></div>");t.setContents(r),t.history.clear(),n&&(t.setSelection(n.index,n.length),Nu.currentFormat=t.getFormat())}}),[o.text]),s.jsx(Ru,{ref:i,style:{fontSize:o.fontSize,color:o.fill,width:o.width,fontFamily:o.fontFamily,lineHeight:o.lineHeight,letterSpacing:o.letterSpacing+"rem",textAlign:o.align}})};function Vu(e,t,r){return n(u).useMemo((()=>function(e){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000",wu.appendChild(t);const n=t.getBoundingClientRect();return wu.removeChild(t),{width:n.width,height:n.height}}(e)),[e,t.width,r])}const Iu=Br((({element:e,store:t})=>{const r=n(u).useRef(null),[o,i]=n(u).useState(),[a,l]=n(u).useState(!1),[c,h]=n(u).useState(!0),[f,d]=n(u).useState(!1),[p,v]=n(u).useState(!1),m=n(u).useRef(e.height),g=t.selectedElements.indexOf(e)>=0,y=e.fontSize/4,[b]=Ns(t,e.fontFamily);us(r);const w=b?e.fontFamily:"Arial",x=`<div style="width: ${e.width||100}px; color: ${e.fill}; font-size: ${e.fontSize}px; font-family: '${w}'; text-decoration: ${e.textDecoration}; text-align: ${e.align}; line-height: ${e.lineHeight}; letter-spacing: ${e.letterSpacing}rem; font-style: ${e.fontStyle}; font-weight: ${e.fontWeight}; -webkit-text-stroke: ${e.strokeWidth}px ${e.stroke};" contentEditable>${e.text}</div>`,{width:_,height:E}=Vu(x,e,b);n(u).useEffect((()=>{e.set({height:E})}),[E]);const z=n(u).useRef(0);n(u).useLayoutEffect((()=>{if(a||f)return;z.current++;const t=z.current,n=ds(`text ${e.id}`);h(!0),async function(){await new Promise((e=>setTimeout(e)));const r=await async function({html:e,width:t,height:n,fontFamily:r,padding:o}){const i=document.createElement("canvas");"Arial"!==r&&(e+=`<link type="text/css" href="https://fonts.googleapis.com/css?family=${r}" rel="stylesheet">`),e+="\n<style>\n html, body {\n padding: 0;\n margin: 0;\n }\n p {\n margin: 0;\n padding: 0\n }\n ul {\n list-style-position: inside;\n margin: 0;\n }\n</style>\n";const a=await bu.drawHTML(`<div style="padding: ${o}px;">${e}</div>`,i,{width:t+2*o,height:n+2*o});return i.width=2*(t+2*o),i.height=2*(n+2*o),i.getContext("2d")?.drawImage(a.image,0,0,2*a.image.width,2*a.image.height),i}({html:x,width:e.width||1,height:E||1,fontFamily:w,padding:y});t===z.current&&(i(r),h(!1),Ja.Util.requestAnimFrame(n))}()}),[x,a,E,f,w]);const S=a||c;return n(u).useLayoutEffect((()=>Ut((()=>{Ls(r.current,e)}))),[o,S]),s.jsxs(n(u).Fragment,{children:[s.jsx(Ql,{ref:r,name:"element",x:e.x,y:e.y,listening:e.selectable,rotation:e.rotation,width:e.width,height:e.height,visible:!S,draggable:!e.locked,opacity:f?0:e.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,hideInExport:!e.showInExport,onMouseEnter:()=>{v(!0)},onMouseLeave:()=>{v(!1)},onDragStart:()=>{t.history.startTransaction()},onDragMove:t=>{setTimeout((()=>{e.set({x:t.target.x(),y:t.target.y()})}))},onDragEnd:n=>{e.set({x:n.target.x(),y:n.target.y()}),t.history.endTransaction()},id:e.id,onDblClick:()=>{e.locked||d(!0)},onDblTap:()=>{e.locked||d(!0)},onTransformStart:t=>{l(!0),m.current=e.height},onTransform:t=>{const n=t.target,r=n.getStage()?.findOne("Transformer"),o=r.getActiveAnchor(),i="middle-left"===o||"middle-right"===o,a="top-center"===o||"bottom-center"===o,l=n.scaleX();if(i){const t=n.scaleX(),r=Math.max(n.width()*t,e.fontSize);n.width(r),n.scaleX(1),e.set({width:r,x:n.x()})}else if(a){const r=Math.max(E,m.current),o=Math.max(r,t.target.height()*t.target.scaleY());n.scaleY(1),console.log(o),e.set({x:n.x(),y:n.y(),height:o,rotation:n.rotation()})}else n.scaleX(1),n.scaleY(1),e.set({fontSize:e.fontSize*l,width:n.width()*l,x:n.x(),y:n.y(),rotation:n.rotation()})},onTransformEnd:t=>{l(!1),h(!0);const n=t.target.scaleX();t.target.scaleX(1),t.target.scaleY(1),e.set({fontSize:e.fontSize*n,width:t.target.width()*n,x:t.target.x(),y:t.target.y(),rotation:t.target.rotation()})}}),s.jsx(Jl,{ref:r,image:o,x:e.x,y:e.y,offsetX:y,offsetY:y,listening:!1,rotation:e.rotation,width:e.width+2*y,height:e.height+2*y,visible:!S,opacity:f?0:e.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,hideInExport:!e.showInExport}),S&&s.jsx($l,{x:e.x,y:e.y,rotation:e.rotation,children:s.jsx(is.Html,{divProps:{style:{pointerEvents:"none"}},children:s.jsx(Ru,{dangerouslySetInnerHTML:{__html:x},style:{pointerEvents:"none",display:"inline-block"}})})}),f&&s.jsx($l,{x:e.x,y:e.y,rotation:e.rotation,children:s.jsx(is.Html,{children:s.jsx(ju,{html:x,element:e,onChange:t=>{e.set({text:t})},onBlur:e=>{d(!1)}})})}),(g||p)&&s.jsx(ks,{element:e})]})})),Du={text:Rs,image:lc,svg:lc};var Fu=Br((e=>{let t=Du[e.element.type];return"text"===e.element.type&&Ms.htmlRenderEnabled&&(t=Iu),e.element.visible?t?s.jsx(t,{...e}):(console.error("Can not find component for "+e.element.type),null):null}));u=l("8NFma");function Bu(e,t,n,r,o){const i=Math.sqrt(n*n+r*r);o+=Math.atan2(r,n);return{x:e+i*Math.cos(o),y:t+i*Math.sin(o)}}function Uu(e){const{x:t,y:n,width:r,height:o}=e,i=Ja.Util.degToRad(e.rotation),a=Bu(t,n,0,0,i),l=Bu(t,n,r,0,i),s=Bu(t,n,r,o,i),c=Bu(t,n,0,o,i),u=Math.min(a.x,l.x,s.x,c.x),h=Math.min(a.y,l.y,s.y,c.y),f=Math.max(a.x,l.x,s.x,c.x),d=Math.max(a.y,l.y,s.y,c.y);return{x:u,y:h,width:f-u,height:d-h,minX:u,minY:h,maxX:f,maxY:d}}function Gu(e,t){var n=[],r=[];e.vertical.forEach((e=>{t.vertical.forEach((t=>{var r=Math.abs(e-t.guide);r<5&&n.push({lineGuide:e,diff:r,snap:t.snap,offset:t.offset})}))})),e.horizontal.forEach((e=>{t.horizontal.forEach((t=>{var n=Math.abs(e-t.guide);n<5&&r.push({lineGuide:e,diff:n,snap:t.snap,offset:t.offset})}))}));var o=[];const i=n.sort(((e,t)=>e.diff-t.diff)),a=r.sort(((e,t)=>e.diff-t.diff));var l=i[0],s=a[0];if(l){i.filter((e=>Math.abs(e.diff-l.diff)<.1)).forEach((e=>{o.push({orientation:"V",...e})}))}if(s){a.filter((e=>Math.abs(e.diff-s.diff)<.1)).forEach((e=>{o.push({orientation:"H",...e})}))}return o}function qu(e){const t=e=>e.hasName("element")||e.hasName("page-background")||e.hasName("elements-area");function r(n){const r=e.current?.getStage();var o=[],i=[];return r.find(t).forEach((e=>{if(!(n.indexOf(e)>=0)){var t=e.getClientRect({skipShadow:!0,skipStroke:!0});o.push(t.x,t.x+t.width,t.x+t.width/2),i.push(t.y,t.y+t.height,t.y+t.height/2)}})),{vertical:o,horizontal:i}}function o(t){const n=e.current?.getLayer(),r=n?.children.find((e=>"line-guides"===e.name()));t.forEach((e=>{if("H"===e.orientation){var t=new Ja.Line({points:[-6e3,e.lineGuide,6e3,e.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});r?.add(t),n.batchDraw()}else if("V"===e.orientation){t=new Ja.Line({points:[e.lineGuide,-6e3,e.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});r?.add(t)}}))}const i=e=>{e.target.getLayer().children.find((e=>"line-guides"===e.name())).destroyChildren();var t=r(e.target.nodes()),n=function(e){const t=e.__getNodeRect(),n=Uu({...t,rotation:Ja.Util.radToDeg(t.rotation)}),r=e.getAbsolutePosition();return{vertical:[{guide:n.x,offset:r.x-n.x,snap:"start"},{guide:n.x+n.width/2,offset:r.x-n.x-n.width/2,snap:"center"},{guide:n.x+n.width,offset:r.x-n.x-n.width,snap:"end"}],horizontal:[{guide:n.y,offset:r.y-n.y,snap:"start"},{guide:n.y+n.height/2,offset:r.y-n.y-n.height/2,snap:"center"},{guide:n.y+n.height,offset:r.y-n.y-n.height,snap:"end"}]}}(e.target),i=Gu(t,n);if(!i.length)return;o(i);const a=e.target.getAbsolutePosition(),l={...a};i.forEach((e=>{switch(e.snap){case"start":case"center":case"end":switch(e.orientation){case"V":l.x=e.lineGuide+e.offset;break;case"H":l.y=e.lineGuide+e.offset}}}));const s=l.x-a.x,c=l.y-a.y;e.evt.ctrlKey||e.evt.metaKey||e.target.nodes().forEach((e=>{const t=e.getAbsolutePosition();e.setAbsolutePosition({x:t.x+s,y:t.y+c})}))},a=(t,n,i)=>{const a=e.current,l=a.getLayer();if(l.children.find((e=>"line-guides"===e.name())).destroyChildren(),"rotater"===a.getActiveAnchor())return n;if(Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))>50)return n;if(!l)return n;var s=Gu(r(a.nodes()),{vertical:[{guide:n.x,offset:0,snap:"start"}],horizontal:[{guide:n.y,offset:0,snap:"start"}]});if(!s.length)return n;o(s);if(i.ctrlKey||i.metaKey)return n;let c=n.x,u=n.x;s.forEach((e=>{switch(e.orientation){case"V":c=e.lineGuide;break;case"H":u=e.lineGuide}}));const h=Math.abs(n.x-c)<10,f=Math.abs(n.y-u)<10;return h&&!f?{x:c,y:t.y}:f&&!h?{x:t.x,y:u}:h&&f?{x:c,y:u}:n},l=e=>{const t=e.target.getLayer();t.children.find((e=>"line-guides"===e.name())).destroyChildren(),t.batchDraw()};n(u).useEffect((()=>{e.current&&(e.current.anchorDragBoundFunc(a),e.current.on("dragstart",(()=>{setTimeout((()=>{const e=[...Ja.DD._dragElements.entries()];e.reverse(),Ja.DD._dragElements.clear(),e.forEach((([e,t])=>{Ja.DD._dragElements.set(e,t)}))}))})),e.current.on("dragmove",i),e.current.on("dragend",l),e.current.on("transformend",l))}),[])}l("8NFma");var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.LegacyColors=Wu.Colors=void 0;var Ku={};Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.Colors=void 0;const Yu={CERULEAN1:"#0C5174",CERULEAN2:"#0F6894",CERULEAN3:"#147EB3",CERULEAN4:"#3FA6DA",CERULEAN5:"#68C1EE",FOREST1:"#1D7324",FOREST2:"#238C2C",FOREST3:"#29A634",FOREST4:"#43BF4D",FOREST5:"#62D96B",GOLD1:"#5C4405",GOLD2:"#866103",GOLD3:"#D1980B",GOLD4:"#F0B726",GOLD5:"#FBD065",INDIGO1:"#5642A6",INDIGO2:"#634DBF",INDIGO3:"#7961DB",INDIGO4:"#9881F3",INDIGO5:"#BDADFF",LIME1:"#43501B",LIME2:"#5A701A",LIME3:"#8EB125",LIME4:"#B6D94C",LIME5:"#D4F17E",ROSE1:"#A82255",ROSE2:"#C22762",ROSE3:"#DB2C6F",ROSE4:"#F5498B",ROSE5:"#FF66A1",SEPIA1:"#5E4123",SEPIA2:"#7A542E",SEPIA3:"#946638",SEPIA4:"#AF855A",SEPIA5:"#D0B090",TURQUOISE1:"#004D46",TURQUOISE2:"#007067",TURQUOISE3:"#00A396",TURQUOISE4:"#13C9BA",TURQUOISE5:"#7AE1D8",VERMILION1:"#96290D",VERMILION2:"#B83211",VERMILION3:"#D33D17",VERMILION4:"#EB6847",VERMILION5:"#FF9980",VIOLET1:"#5C255C",VIOLET2:"#7C327C",VIOLET3:"#9D3F9D",VIOLET4:"#BD6BBD",VIOLET5:"#D69FD6"},Xu={COBALT1:Yu.CERULEAN1,COBALT2:Yu.CERULEAN2,COBALT3:Yu.CERULEAN3,COBALT4:Yu.CERULEAN4,COBALT5:Yu.CERULEAN5};Ku.Colors=Object.assign(Object.assign(Object.assign(Object.assign({},{BLACK:"#111418",DARK_GRAY1:"#1C2127",DARK_GRAY2:"#252A31",DARK_GRAY3:"#2F343C",DARK_GRAY4:"#383E47",DARK_GRAY5:"#404854",GRAY1:"#5F6B7C",GRAY2:"#738091",GRAY3:"#8F99A8",GRAY4:"#ABB3BF",GRAY5:"#C5CBD3",LIGHT_GRAY1:"#D3D8DE",LIGHT_GRAY2:"#DCE0E5",LIGHT_GRAY3:"#E5E8EB",LIGHT_GRAY4:"#EDEFF2",LIGHT_GRAY5:"#F6F7F9",WHITE:"#FFFFFF"}),{BLUE1:"#184A90",BLUE2:"#215DB0",BLUE3:"#2D72D2",BLUE4:"#4C90F0",BLUE5:"#8ABBFF",GREEN1:"#165A36",GREEN2:"#1C6E42",GREEN3:"#238551",GREEN4:"#32A467",GREEN5:"#72CA9B",ORANGE1:"#77450D",ORANGE2:"#935610",ORANGE3:"#C87619",ORANGE4:"#EC9A3C",ORANGE5:"#FBB360",RED1:"#8E292C",RED2:"#AC2F33",RED3:"#CD4246",RED4:"#E76A6E",RED5:"#FA999C"}),Yu),Xu),Object.defineProperty(Wu,"Colors",{enumerable:!0,get:function(){return Ku.Colors}});var $u={};Object.defineProperty($u,"__esModule",{value:!0}),$u.LegacyColors=void 0,$u.LegacyColors={BLACK:"#10161A",BLUE1:"#0E5A8A",BLUE2:"#106BA3",BLUE3:"#137CBD",BLUE4:"#2B95D6",BLUE5:"#48AFF0",COBALT1:"#1F4B99",COBALT2:"#2458B3",COBALT3:"#2965CC",COBALT4:"#4580E6",COBALT5:"#669EFF",DARK_GRAY1:"#182026",DARK_GRAY2:"#202B33",DARK_GRAY3:"#293742",DARK_GRAY4:"#30404D",DARK_GRAY5:"#394B59",FOREST1:"#1D7324",FOREST2:"#238C2C",FOREST3:"#29A634",FOREST4:"#43BF4D",FOREST5:"#62D96B",GOLD1:"#A67908",GOLD2:"#BF8C0A",GOLD3:"#D99E0B",GOLD4:"#F2B824",GOLD5:"#FFC940",GRAY1:"#5C7080",GRAY2:"#738694",GRAY3:"#8A9BA8",GRAY4:"#A7B6C2",GRAY5:"#BFCCD6",GREEN1:"#0A6640",GREEN2:"#0D8050",GREEN3:"#0F9960",GREEN4:"#15B371",GREEN5:"#3DCC91",INDIGO1:"#5642A6",INDIGO2:"#634DBF",INDIGO3:"#7157D9",INDIGO4:"#9179F2",INDIGO5:"#AD99FF",LIGHT_GRAY1:"#CED9E0",LIGHT_GRAY2:"#D8E1E8",LIGHT_GRAY3:"#E1E8ED",LIGHT_GRAY4:"#EBF1F5",LIGHT_GRAY5:"#F5F8FA",LIME1:"#728C23",LIME2:"#87A629",LIME3:"#9BBF30",LIME4:"#B6D94C",LIME5:"#D1F26D",ORANGE1:"#A66321",ORANGE2:"#BF7326",ORANGE3:"#D9822B",ORANGE4:"#F29D49",ORANGE5:"#FFB366",RED1:"#A82A2A",RED2:"#C23030",RED3:"#DB3737",RED4:"#F55656",RED5:"#FF7373",ROSE1:"#A82255",ROSE2:"#C22762",ROSE3:"#DB2C6F",ROSE4:"#F5498B",ROSE5:"#FF66A1",SEPIA1:"#63411E",SEPIA2:"#7D5125",SEPIA3:"#96622D",SEPIA4:"#B07B46",SEPIA5:"#C99765",TURQUOISE1:"#008075",TURQUOISE2:"#00998C",TURQUOISE3:"#00B3A4",TURQUOISE4:"#14CCBD",TURQUOISE5:"#2EE6D6",VERMILION1:"#9E2B0E",VERMILION2:"#B83211",VERMILION3:"#D13913",VERMILION4:"#EB532D",VERMILION5:"#FF6E4A",VIOLET1:"#5C255C",VIOLET2:"#752F75",VIOLET3:"#8F398F",VIOLET4:"#A854A8",VIOLET5:"#C274C2",WHITE:"#FFFFFF"},Object.defineProperty(Wu,"LegacyColors",{enumerable:!0,get:function(){return $u.LegacyColors}});var Qu={};e(Qu,"ACTIVE",(()=>kh)),e(Qu,"ALIGN_LEFT",(()=>Ph)),e(Qu,"ALIGN_RIGHT",(()=>Th)),e(Qu,"DARK",(()=>Hh)),e(Qu,"DISABLED",(()=>Nh)),e(Qu,"FILL",(()=>Rh)),e(Qu,"FIXED",(()=>jh)),e(Qu,"FIXED_TOP",(()=>Vh)),e(Qu,"INLINE",(()=>Ih)),e(Qu,"INTERACTIVE",(()=>Dh)),e(Qu,"LARGE",(()=>Fh)),e(Qu,"LOADING",(()=>Bh)),e(Qu,"MINIMAL",(()=>Uh)),e(Qu,"OUTLINED",(()=>Gh)),e(Qu,"MULTILINE",(()=>qh)),e(Qu,"ROUND",(()=>Wh)),e(Qu,"SELECTED",(()=>Kh)),e(Qu,"SMALL",(()=>Yh)),e(Qu,"VERTICAL",(()=>Xh)),e(Qu,"POSITION_TOP",(()=>$h)),e(Qu,"positionClass",(()=>tm)),e(Qu,"POSITION_BOTTOM",(()=>Qh)),e(Qu,"POSITION_LEFT",(()=>Zh)),e(Qu,"POSITION_RIGHT",(()=>Jh)),e(Qu,"ELEVATION_0",(()=>ef)),e(Qu,"elevationClass",(()=>Zv)),e(Qu,"ELEVATION_1",(()=>tf)),e(Qu,"ELEVATION_2",(()=>nf)),e(Qu,"ELEVATION_3",(()=>rf)),e(Qu,"ELEVATION_4",(()=>of)),e(Qu,"INTENT_PRIMARY",(()=>af)),e(Qu,"intentClass",(()=>em)),e(Qu,"INTENT_SUCCESS",(()=>lf)),e(Qu,"INTENT_WARNING",(()=>sf)),e(Qu,"INTENT_DANGER",(()=>cf)),e(Qu,"FOCUS_DISABLED",(()=>uf)),e(Qu,"FOCUS_STYLE_MANAGER_IGNORE",(()=>hf)),e(Qu,"UI_TEXT",(()=>ff)),e(Qu,"RUNNING_TEXT",(()=>df)),e(Qu,"MONOSPACE_TEXT",(()=>pf)),e(Qu,"TEXT_LARGE",(()=>vf)),e(Qu,"TEXT_SMALL",(()=>mf)),e(Qu,"TEXT_MUTED",(()=>gf)),e(Qu,"TEXT_DISABLED",(()=>yf)),e(Qu,"TEXT_OVERFLOW_ELLIPSIS",(()=>bf)),e(Qu,"BLOCKQUOTE",(()=>wf)),e(Qu,"CODE",(()=>xf)),e(Qu,"CODE_BLOCK",(()=>_f)),e(Qu,"HEADING",(()=>Ef)),e(Qu,"LIST",(()=>zf)),e(Qu,"LIST_UNSTYLED",(()=>Sf)),e(Qu,"RTL",(()=>Cf)),e(Qu,"ALERT",(()=>Of)),e(Qu,"ALERT_BODY",(()=>Mf)),e(Qu,"ALERT_CONTENTS",(()=>Af)),e(Qu,"ALERT_FOOTER",(()=>Lf)),e(Qu,"BREADCRUMB",(()=>kf)),e(Qu,"BREADCRUMB_CURRENT",(()=>Pf)),e(Qu,"BREADCRUMBS",(()=>Tf)),e(Qu,"BREADCRUMBS_COLLAPSED",(()=>Hf)),e(Qu,"BUTTON",(()=>Nf)),e(Qu,"BUTTON_GROUP",(()=>Rf)),e(Qu,"BUTTON_SPINNER",(()=>jf)),e(Qu,"BUTTON_TEXT",(()=>Vf)),e(Qu,"CALLOUT",(()=>If)),e(Qu,"CALLOUT_ICON",(()=>Df)),e(Qu,"CARD",(()=>Ff)),e(Qu,"COLLAPSE",(()=>Bf)),e(Qu,"COLLAPSE_BODY",(()=>Uf)),e(Qu,"COLLAPSIBLE_LIST",(()=>Gf)),e(Qu,"CONTEXT_MENU",(()=>qf)),e(Qu,"CONTEXT_MENU_POPOVER_TARGET",(()=>Wf)),e(Qu,"CONTROL_GROUP",(()=>Kf)),e(Qu,"DIALOG",(()=>Yf)),e(Qu,"DIALOG_CONTAINER",(()=>Xf)),e(Qu,"DIALOG_BODY",(()=>$f)),e(Qu,"DIALOG_CLOSE_BUTTON",(()=>Qf)),e(Qu,"DIALOG_FOOTER",(()=>Zf)),e(Qu,"DIALOG_FOOTER_ACTIONS",(()=>Jf)),e(Qu,"DIALOG_HEADER",(()=>ed)),e(Qu,"DIALOG_STEP",(()=>td)),e(Qu,"DIALOG_STEP_CONTAINER",(()=>nd)),e(Qu,"DIALOG_STEP_TITLE",(()=>rd)),e(Qu,"DIALOG_STEP_ICON",(()=>od)),e(Qu,"DIALOG_STEP_VIEWED",(()=>id)),e(Qu,"DIVIDER",(()=>ad)),e(Qu,"DRAWER",(()=>ld)),e(Qu,"DRAWER_BODY",(()=>sd)),e(Qu,"DRAWER_FOOTER",(()=>cd)),e(Qu,"DRAWER_HEADER",(()=>ud)),e(Qu,"EDITABLE_TEXT",(()=>hd)),e(Qu,"EDITABLE_TEXT_CONTENT",(()=>fd)),e(Qu,"EDITABLE_TEXT_EDITING",(()=>dd)),e(Qu,"EDITABLE_TEXT_INPUT",(()=>pd)),e(Qu,"EDITABLE_TEXT_PLACEHOLDER",(()=>vd)),e(Qu,"FLEX_EXPANDER",(()=>md)),e(Qu,"HTML_SELECT",(()=>gd)),e(Qu,"SELECT",(()=>yd)),e(Qu,"HTML_TABLE",(()=>bd)),e(Qu,"HTML_TABLE_BORDERED",(()=>wd)),e(Qu,"HTML_TABLE_CONDENSED",(()=>xd)),e(Qu,"HTML_TABLE_STRIPED",(()=>_d)),e(Qu,"INPUT",(()=>Ed)),e(Qu,"INPUT_GHOST",(()=>zd)),e(Qu,"INPUT_GROUP",(()=>Sd)),e(Qu,"INPUT_LEFT_CONTAINER",(()=>Cd)),e(Qu,"INPUT_ACTION",(()=>Od)),e(Qu,"CONTROL",(()=>Md)),e(Qu,"CONTROL_INDICATOR",(()=>Ad)),e(Qu,"CONTROL_INDICATOR_CHILD",(()=>Ld)),e(Qu,"CHECKBOX",(()=>kd)),e(Qu,"RADIO",(()=>Pd)),e(Qu,"SWITCH",(()=>Td)),e(Qu,"SWITCH_INNER_TEXT",(()=>Hd)),e(Qu,"FILE_INPUT",(()=>Nd)),e(Qu,"FILE_INPUT_HAS_SELECTION",(()=>Rd)),e(Qu,"FILE_UPLOAD_INPUT",(()=>jd)),e(Qu,"FILE_UPLOAD_INPUT_CUSTOM_TEXT",(()=>Vd)),e(Qu,"KEY",(()=>Id)),e(Qu,"KEY_COMBO",(()=>Dd)),e(Qu,"MODIFIER_KEY",(()=>Fd)),e(Qu,"HOTKEY",(()=>Bd)),e(Qu,"HOTKEY_LABEL",(()=>Ud)),e(Qu,"HOTKEY_COLUMN",(()=>Gd)),e(Qu,"HOTKEY_DIALOG",(()=>qd)),e(Qu,"LABEL",(()=>Wd)),e(Qu,"FORM_GROUP",(()=>Kd)),e(Qu,"FORM_CONTENT",(()=>Yd)),e(Qu,"FORM_HELPER_TEXT",(()=>Xd)),e(Qu,"FORM_GROUP_SUB_LABEL",(()=>$d)),e(Qu,"MENU",(()=>Qd)),e(Qu,"MENU_ITEM",(()=>Zd)),e(Qu,"MENU_ITEM_ICON",(()=>Jd)),e(Qu,"MENU_ITEM_LABEL",(()=>ep)),e(Qu,"MENU_SUBMENU",(()=>tp)),e(Qu,"MENU_SUBMENU_ICON",(()=>np)),e(Qu,"MENU_DIVIDER",(()=>rp)),e(Qu,"MENU_HEADER",(()=>op)),e(Qu,"MULTISTEP_DIALOG",(()=>ip)),e(Qu,"MULTISTEP_DIALOG_PANELS",(()=>ap)),e(Qu,"MULTISTEP_DIALOG_LEFT_PANEL",(()=>lp)),e(Qu,"MULTISTEP_DIALOG_RIGHT_PANEL",(()=>sp)),e(Qu,"MULTISTEP_DIALOG_FOOTER",(()=>cp)),e(Qu,"MULTISTEP_DIALOG_NAV_TOP",(()=>up)),e(Qu,"MULTISTEP_DIALOG_NAV_RIGHT",(()=>hp)),e(Qu,"NAVBAR",(()=>fp)),e(Qu,"NAVBAR_GROUP",(()=>dp)),e(Qu,"NAVBAR_HEADING",(()=>pp)),e(Qu,"NAVBAR_DIVIDER",(()=>vp)),e(Qu,"NON_IDEAL_STATE",(()=>mp)),e(Qu,"NON_IDEAL_STATE_VISUAL",(()=>gp)),e(Qu,"NON_IDEAL_STATE_TEXT",(()=>yp)),e(Qu,"NUMERIC_INPUT",(()=>bp)),e(Qu,"OVERFLOW_LIST",(()=>wp)),e(Qu,"OVERFLOW_LIST_SPACER",(()=>xp)),e(Qu,"OVERLAY",(()=>_p)),e(Qu,"OVERLAY_BACKDROP",(()=>Ep)),e(Qu,"OVERLAY_CONTAINER",(()=>zp)),e(Qu,"OVERLAY_CONTENT",(()=>Sp)),e(Qu,"OVERLAY_INLINE",(()=>Cp)),e(Qu,"OVERLAY_OPEN",(()=>Op)),e(Qu,"OVERLAY_SCROLL_CONTAINER",(()=>Mp)),e(Qu,"OVERLAY_START_FOCUS_TRAP",(()=>Ap)),e(Qu,"OVERLAY_END_FOCUS_TRAP",(()=>Lp)),e(Qu,"PANEL_STACK",(()=>kp)),e(Qu,"PANEL_STACK_HEADER",(()=>Pp)),e(Qu,"PANEL_STACK_HEADER_BACK",(()=>Tp)),e(Qu,"PANEL_STACK_VIEW",(()=>Hp)),e(Qu,"PANEL_STACK2",(()=>Np)),e(Qu,"PANEL_STACK2_HEADER",(()=>Rp)),e(Qu,"PANEL_STACK2_HEADER_BACK",(()=>jp)),e(Qu,"PANEL_STACK2_VIEW",(()=>Vp)),e(Qu,"POPOVER",(()=>Ip)),e(Qu,"POPOVER_ARROW",(()=>Dp)),e(Qu,"POPOVER_BACKDROP",(()=>Fp)),e(Qu,"POPOVER_CAPTURING_DISMISS",(()=>Bp)),e(Qu,"POPOVER_CONTENT",(()=>Up)),e(Qu,"POPOVER_CONTENT_SIZING",(()=>Gp)),e(Qu,"POPOVER_DISMISS",(()=>qp)),e(Qu,"POPOVER_DISMISS_OVERRIDE",(()=>Wp)),e(Qu,"POPOVER_OPEN",(()=>Kp)),e(Qu,"POPOVER_OUT_OF_BOUNDARIES",(()=>Yp)),e(Qu,"POPOVER_TARGET",(()=>Xp)),e(Qu,"POPOVER_WRAPPER",(()=>$p)),e(Qu,"TRANSITION_CONTAINER",(()=>Qp)),e(Qu,"PROGRESS_BAR",(()=>Zp)),e(Qu,"PROGRESS_METER",(()=>Jp)),e(Qu,"PROGRESS_NO_STRIPES",(()=>ev)),e(Qu,"PROGRESS_NO_ANIMATION",(()=>tv)),e(Qu,"PORTAL",(()=>nv)),e(Qu,"SKELETON",(()=>rv)),e(Qu,"SLIDER",(()=>ov)),e(Qu,"SLIDER_AXIS",(()=>iv)),e(Qu,"SLIDER_HANDLE",(()=>av)),e(Qu,"SLIDER_LABEL",(()=>lv)),e(Qu,"SLIDER_TRACK",(()=>sv)),e(Qu,"SLIDER_PROGRESS",(()=>cv)),e(Qu,"START",(()=>uv)),e(Qu,"END",(()=>hv)),e(Qu,"SPINNER",(()=>fv)),e(Qu,"SPINNER_ANIMATION",(()=>dv)),e(Qu,"SPINNER_HEAD",(()=>pv)),e(Qu,"SPINNER_NO_SPIN",(()=>vv)),e(Qu,"SPINNER_TRACK",(()=>mv)),e(Qu,"TAB",(()=>gv)),e(Qu,"TAB_INDICATOR",(()=>yv)),e(Qu,"TAB_INDICATOR_WRAPPER",(()=>bv)),e(Qu,"TAB_LIST",(()=>wv)),e(Qu,"TAB_PANEL",(()=>xv)),e(Qu,"TABS",(()=>_v)),e(Qu,"TAG",(()=>Ev)),e(Qu,"TAG_REMOVE",(()=>zv)),e(Qu,"TAG_INPUT",(()=>Sv)),e(Qu,"TAG_INPUT_ICON",(()=>Cv)),e(Qu,"TAG_INPUT_VALUES",(()=>Ov)),e(Qu,"TOAST",(()=>Mv)),e(Qu,"TOAST_CONTAINER",(()=>Av)),e(Qu,"TOAST_MESSAGE",(()=>Lv)),e(Qu,"TOOLTIP",(()=>kv)),e(Qu,"TOOLTIP_INDICATOR",(()=>Pv)),e(Qu,"TREE",(()=>Tv)),e(Qu,"TREE_NODE",(()=>Hv)),e(Qu,"TREE_NODE_CARET",(()=>Nv)),e(Qu,"TREE_NODE_CARET_CLOSED",(()=>Rv)),e(Qu,"TREE_NODE_CARET_NONE",(()=>jv)),e(Qu,"TREE_NODE_CARET_OPEN",(()=>Vv)),e(Qu,"TREE_NODE_CONTENT",(()=>Iv)),e(Qu,"TREE_NODE_EXPANDED",(()=>Dv)),e(Qu,"TREE_NODE_ICON",(()=>Fv)),e(Qu,"TREE_NODE_LABEL",(()=>Bv)),e(Qu,"TREE_NODE_LIST",(()=>Uv)),e(Qu,"TREE_NODE_SECONDARY_LABEL",(()=>Gv)),e(Qu,"TREE_NODE_SELECTED",(()=>qv)),e(Qu,"TREE_ROOT",(()=>Wv)),e(Qu,"ICON",(()=>Kv)),e(Qu,"ICON_STANDARD",(()=>Yv)),e(Qu,"ICON_LARGE",(()=>Xv)),e(Qu,"getClassNamespace",(()=>$v)),e(Qu,"alignmentClass",(()=>Qv)),e(Qu,"iconClass",(()=>Jv));var Zu="left",Ju="right",eh=0,th=1,nh=2,rh=3,oh=4,ih="none",ah="primary",lh="success",sh="warning",ch="danger",uh={BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",LEFT:"left",LEFT_BOTTOM:"left-bottom",LEFT_TOP:"left-top",RIGHT:"right",RIGHT_BOTTOM:"right-bottom",RIGHT_TOP:"right-top",TOP:"top",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};var hh,fh,dh,ph=hh={};function vh(){throw new Error("setTimeout has not been defined")}function mh(){throw new Error("clearTimeout has not been defined")}function gh(e){if(fh===setTimeout)return setTimeout(e,0);if((fh===vh||!fh)&&setTimeout)return fh=setTimeout,setTimeout(e,0);try{return fh(e,0)}catch(t){try{return fh.call(null,e,0)}catch(t){return fh.call(this,e,0)}}}!function(){try{fh="function"==typeof setTimeout?setTimeout:vh}catch(e){fh=vh}try{dh="function"==typeof clearTimeout?clearTimeout:mh}catch(e){dh=mh}}();var yh,bh,wh,xh,_h,Eh=[],zh=!1,Sh=-1;function Ch(){zh&&yh&&(zh=!1,yh.length?Eh=yh.concat(Eh):Sh=-1,Eh.length&&Oh())}function Oh(){if(!zh){var e=gh(Ch);zh=!0;for(var t=Eh.length;t;){for(yh=Eh,Eh=[];++Sh<t;)yh&&yh[Sh].run();Sh=-1,t=Eh.length}yh=null,zh=!1,function(e){if(dh===clearTimeout)return clearTimeout(e);if((dh===mh||!dh)&&clearTimeout)return dh=clearTimeout,clearTimeout(e);try{dh(e)}catch(t){try{return dh.call(null,e)}catch(t){return dh.call(this,e)}}}(e)}}function Mh(e,t){this.fun=e,this.array=t}function Ah(){}ph.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Eh.push(new Mh(e,t)),1!==Eh.length||zh||gh(Oh)},Mh.prototype.run=function(){this.fun.apply(null,this.array)},ph.title="browser",ph.browser=!0,ph.env={},ph.argv=[],ph.version="",ph.versions={},ph.on=Ah,ph.addListener=Ah,ph.once=Ah,ph.off=Ah,ph.removeListener=Ah,ph.removeAllListeners=Ah,ph.emit=Ah,ph.prependListener=Ah,ph.prependOnceListener=Ah,ph.listeners=function(e){return[]},ph.binding=function(e){throw new Error("process.binding is not supported")},ph.cwd=function(){return"/"},ph.chdir=function(e){throw new Error("process.chdir is not supported")},ph.umask=function(){return 0};var Lh="bp4";void 0!==hh&&(Lh=null!==(_h=null!==(wh=void 0===(bh={})?void 0:bh.BLUEPRINT_NAMESPACE)&&void 0!==wh?wh:void 0===(xh={})?void 0:xh.REACT_APP_BLUEPRINT_NAMESPACE)&&void 0!==_h?_h:Lh);var kh="".concat(Lh,"-active"),Ph="".concat(Lh,"-align-left"),Th="".concat(Lh,"-align-right"),Hh="".concat(Lh,"-dark"),Nh="".concat(Lh,"-disabled"),Rh="".concat(Lh,"-fill"),jh="".concat(Lh,"-fixed"),Vh="".concat(Lh,"-fixed-top"),Ih="".concat(Lh,"-inline"),Dh="".concat(Lh,"-interactive"),Fh="".concat(Lh,"-large"),Bh="".concat(Lh,"-loading"),Uh="".concat(Lh,"-minimal"),Gh="".concat(Lh,"-outlined"),qh="".concat(Lh,"-multiline"),Wh="".concat(Lh,"-round"),Kh="".concat(Lh,"-selected"),Yh="".concat(Lh,"-small"),Xh="".concat(Lh,"-vertical"),$h=tm(uh.TOP),Qh=tm(uh.BOTTOM),Zh=tm(uh.LEFT),Jh=tm(uh.RIGHT),ef=Zv(eh),tf=Zv(th),nf=Zv(nh),rf=Zv(rh),of=Zv(oh),af=em(ah),lf=em(lh),sf=em(sh),cf=em(ch),uf="".concat(Lh,"-focus-disabled"),hf="".concat(Lh,"-focus-style-manager-ignore"),ff="".concat(Lh,"-ui-text"),df="".concat(Lh,"-running-text"),pf="".concat(Lh,"-monospace-text"),vf="".concat(Lh,"-text-large"),mf="".concat(Lh,"-text-small"),gf="".concat(Lh,"-text-muted"),yf="".concat(Lh,"-text-disabled"),bf="".concat(Lh,"-text-overflow-ellipsis"),wf="".concat(Lh,"-blockquote"),xf="".concat(Lh,"-code"),_f="".concat(Lh,"-code-block"),Ef="".concat(Lh,"-heading"),zf="".concat(Lh,"-list"),Sf="".concat(Lh,"-list-unstyled"),Cf="".concat(Lh,"-rtl"),Of="".concat(Lh,"-alert"),Mf="".concat(Of,"-body"),Af="".concat(Of,"-contents"),Lf="".concat(Of,"-footer"),kf="".concat(Lh,"-breadcrumb"),Pf="".concat(kf,"-current"),Tf="".concat(kf,"s"),Hf="".concat(kf,"s-collapsed"),Nf="".concat(Lh,"-button"),Rf="".concat(Nf,"-group"),jf="".concat(Nf,"-spinner"),Vf="".concat(Nf,"-text"),If="".concat(Lh,"-callout"),Df="".concat(If,"-icon"),Ff="".concat(Lh,"-card"),Bf="".concat(Lh,"-collapse"),Uf="".concat(Bf,"-body"),Gf="".concat(Lh,"-collapse-list"),qf="".concat(Lh,"-context-menu"),Wf="".concat(qf,"-popover-target"),Kf="".concat(Lh,"-control-group"),Yf="".concat(Lh,"-dialog"),Xf="".concat(Yf,"-container"),$f="".concat(Yf,"-body"),Qf="".concat(Yf,"-close-button"),Zf="".concat(Yf,"-footer"),Jf="".concat(Yf,"-footer-actions"),ed="".concat(Yf,"-header"),td="".concat(Lh,"-dialog-step"),nd="".concat(td,"-container"),rd="".concat(td,"-title"),od="".concat(td,"-icon"),id="".concat(td,"-viewed"),ad="".concat(Lh,"-divider"),ld="".concat(Lh,"-drawer"),sd="".concat(ld,"-body"),cd="".concat(ld,"-footer"),ud="".concat(ld,"-header"),hd="".concat(Lh,"-editable-text"),fd="".concat(hd,"-content"),dd="".concat(hd,"-editing"),pd="".concat(hd,"-input"),vd="".concat(hd,"-placeholder"),md="".concat(Lh,"-flex-expander"),gd="".concat(Lh,"-html-select"),yd="".concat(Lh,"-select"),bd="".concat(Lh,"-html-table"),wd="".concat(bd,"-bordered"),xd="".concat(bd,"-condensed"),_d="".concat(bd,"-striped"),Ed="".concat(Lh,"-input"),zd="".concat(Ed,"-ghost"),Sd="".concat(Ed,"-group"),Cd="".concat(Ed,"-left-container"),Od="".concat(Ed,"-action"),Md="".concat(Lh,"-control"),Ad="".concat(Md,"-indicator"),Ld="".concat(Ad,"-child"),kd="".concat(Lh,"-checkbox"),Pd="".concat(Lh,"-radio"),Td="".concat(Lh,"-switch"),Hd="".concat(Td,"-inner-text"),Nd="".concat(Lh,"-file-input"),Rd="".concat(Lh,"-file-input-has-selection"),jd="".concat(Lh,"-file-upload-input"),Vd="".concat(Lh,"-file-upload-input-custom-text"),Id="".concat(Lh,"-key"),Dd="".concat(Id,"-combo"),Fd="".concat(Lh,"-modifier-key"),Bd="".concat(Lh,"-hotkey"),Ud="".concat(Bd,"-label"),Gd="".concat(Bd,"-column"),qd="".concat(Bd,"-dialog"),Wd="".concat(Lh,"-label"),Kd="".concat(Lh,"-form-group"),Yd="".concat(Lh,"-form-content"),Xd="".concat(Lh,"-form-helper-text"),$d="".concat(Lh,"-form-group-sub-label"),Qd="".concat(Lh,"-menu"),Zd="".concat(Qd,"-item"),Jd="".concat(Zd,"-icon"),ep="".concat(Zd,"-label"),tp="".concat(Lh,"-submenu"),np="".concat(tp,"-icon"),rp="".concat(Qd,"-divider"),op="".concat(Qd,"-header"),ip="".concat(Lh,"-multistep-dialog"),ap="".concat(ip,"-panels"),lp="".concat(ip,"-left-panel"),sp="".concat(ip,"-right-panel"),cp="".concat(ip,"-footer"),up="".concat(ip,"-nav-top"),hp="".concat(ip,"-nav-right"),fp="".concat(Lh,"-navbar"),dp="".concat(fp,"-group"),pp="".concat(fp,"-heading"),vp="".concat(fp,"-divider"),mp="".concat(Lh,"-non-ideal-state"),gp="".concat(mp,"-visual"),yp="".concat(mp,"-text"),bp="".concat(Lh,"-numeric-input"),wp="".concat(Lh,"-overflow-list"),xp="".concat(wp,"-spacer"),_p="".concat(Lh,"-overlay"),Ep="".concat(_p,"-backdrop"),zp="".concat(_p,"-container"),Sp="".concat(_p,"-content"),Cp="".concat(_p,"-inline"),Op="".concat(_p,"-open"),Mp="".concat(_p,"-scroll-container"),Ap="".concat(_p,"-start-focus-trap"),Lp="".concat(_p,"-end-focus-trap"),kp="".concat(Lh,"-panel-stack"),Pp="".concat(kp,"-header"),Tp="".concat(kp,"-header-back"),Hp="".concat(kp,"-view"),Np="".concat(Lh,"-panel-stack2"),Rp="".concat(kp,"-header"),jp="".concat(kp,"-header-back"),Vp="".concat(kp,"-view"),Ip="".concat(Lh,"-popover"),Dp="".concat(Ip,"-arrow"),Fp="".concat(Ip,"-backdrop"),Bp="".concat(Ip,"-capturing-dismiss"),Up="".concat(Ip,"-content"),Gp="".concat(Up,"-sizing"),qp="".concat(Ip,"-dismiss"),Wp="".concat(qp,"-override"),Kp="".concat(Ip,"-open"),Yp="".concat(Ip,"-out-of-boundaries"),Xp="".concat(Ip,"-target"),$p="".concat(Ip,"-wrapper"),Qp="".concat(Lh,"-transition-container"),Zp="".concat(Lh,"-progress-bar"),Jp="".concat(Lh,"-progress-meter"),ev="".concat(Lh,"-no-stripes"),tv="".concat(Lh,"-no-animation"),nv="".concat(Lh,"-portal"),rv="".concat(Lh,"-skeleton"),ov="".concat(Lh,"-slider"),iv="".concat(ov,"-axis"),av="".concat(ov,"-handle"),lv="".concat(ov,"-label"),sv="".concat(ov,"-track"),cv="".concat(ov,"-progress"),uv="".concat(Lh,"-start"),hv="".concat(Lh,"-end"),fv="".concat(Lh,"-spinner"),dv="".concat(fv,"-animation"),pv="".concat(fv,"-head"),vv="".concat(Lh,"-no-spin"),mv="".concat(fv,"-track"),gv="".concat(Lh,"-tab"),yv="".concat(gv,"-indicator"),bv="".concat(yv,"-wrapper"),wv="".concat(gv,"-list"),xv="".concat(gv,"-panel"),_v="".concat(gv,"s"),Ev="".concat(Lh,"-tag"),zv="".concat(Ev,"-remove"),Sv="".concat(Lh,"-tag-input"),Cv="".concat(Sv,"-icon"),Ov="".concat(Sv,"-values"),Mv="".concat(Lh,"-toast"),Av="".concat(Mv,"-container"),Lv="".concat(Mv,"-message"),kv="".concat(Lh,"-tooltip"),Pv="".concat(kv,"-indicator"),Tv="".concat(Lh,"-tree"),Hv="".concat(Lh,"-tree-node"),Nv="".concat(Hv,"-caret"),Rv="".concat(Nv,"-closed"),jv="".concat(Nv,"-none"),Vv="".concat(Nv,"-open"),Iv="".concat(Hv,"-content"),Dv="".concat(Hv,"-expanded"),Fv="".concat(Hv,"-icon"),Bv="".concat(Hv,"-label"),Uv="".concat(Hv,"-list"),Gv="".concat(Hv,"-secondary-label"),qv="".concat(Hv,"-selected"),Wv="".concat(Lh,"-tree-root"),Kv="".concat(Lh,"-icon"),Yv="".concat(Kv,"-standard"),Xv="".concat(Kv,"-large");function $v(){return Lh}function Qv(e){switch(e){case Zu:return Ph;case Ju:return Th;default:return}}function Zv(e){if(void 0!==e)return"".concat(Lh,"-elevation-").concat(e)}function Jv(e){if(null!=e)return 0===e.indexOf("".concat(Lh,"-icon-"))?e:"".concat(Lh,"-icon-").concat(e)}function em(e){if(null!=e&&e!==ih)return"".concat(Lh,"-intent-").concat(e.toLowerCase())}function tm(e){if(void 0!==e)return"".concat(Lh,"-position-").concat(e)}var nm={};e(nm,"BACKSPACE",(()=>rm)),e(nm,"TAB",(()=>om)),e(nm,"ENTER",(()=>im)),e(nm,"SHIFT",(()=>am)),e(nm,"ESCAPE",(()=>lm)),e(nm,"SPACE",(()=>sm)),e(nm,"ARROW_LEFT",(()=>cm)),e(nm,"ARROW_UP",(()=>um)),e(nm,"ARROW_RIGHT",(()=>hm)),e(nm,"ARROW_DOWN",(()=>fm)),e(nm,"DELETE",(()=>dm)),e(nm,"isKeyboardClick",(()=>pm));var rm=8,om=9,im=13,am=16,lm=27,sm=32,cm=37,um=38,hm=39,fm=40,dm=46;function pm(e){return e===im||e===sm}var vm={};e(vm,"isDarkTheme",(()=>Km)),e(vm,"setRef",(()=>Ym)),e(vm,"getRef",(()=>$m));var mm={};function gm(e,t,n){return void 0===n&&(n=function(e,t){return e===t}),null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((function(e,r){return n(e,t[r])}))}function ym(e,t,n){if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e)||Array.isArray(t))return!1;if(null!=n)return xm(e,t,n);var r=Object.keys(e),o=Object.keys(t);return xm(e,t,{include:r})&&xm(e,t,{include:o})}function bm(e,t,n){if(e===t)return!0;if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e)||Array.isArray(t))return gm(e,t,bm);if(Em(e)||Em(t))return e===t;if(null!=n)return _m(e,t,n);if(e.constructor!==t.constructor)return!1;var r=Object.keys(e),o=Object.keys(t);return null!=r&&null!=o&&(0===r.length&&0===o.length||gm(r,o)&&_m(e,t,r))}function wm(e,t,n){void 0===e&&(e={}),void 0===t&&(t={});var r=null==n?function(e,t){var n=Object.keys(e),r=Object.keys(t),o=zm(n.concat(r));return Object.keys(o)}(e,t):n;return function(e,t,n,r){return n.filter((function(n){return!r(e,t,n)})).map((function(n){return{key:n,valueA:e[n],valueB:t[n]}}))}(e,t,r,(function(e,t,n){return bm(e,t,[n])}))}function xm(e,t,n){return function(e,t,n){if(function(e){return null!=e&&null!=e.include}(n))return n.include;if(function(e){return null!=e&&null!=e.exclude}(n)){var r=Object.keys(e),o=Object.keys(t),i=zm(r.concat(o));return n.exclude.forEach((function(e){return delete i[e]})),Object.keys(i)}return[]}(e,t,n).every((function(n){return e.hasOwnProperty(n)===t.hasOwnProperty(n)&&e[n]===t[n]}))}function _m(e,t,n){return n.every((function(n){return e.hasOwnProperty(n)===t.hasOwnProperty(n)&&bm(e[n],t[n])}))}function Em(e){return"number"==typeof e||"string"==typeof e||"boolean"==typeof e}function zm(e){return e.reduce((function(e,t){return e[t]=!0,e}),{})}e(mm,"arraysEqual",(()=>gm)),e(mm,"shallowCompareKeys",(()=>ym)),e(mm,"deepCompareKeys",(()=>bm)),e(mm,"getDeepUnequalKeyValues",(()=>wm));var Sm={};function Cm(e,t){return e===t||e.contains(t)}function Om(e,t,n){var r=Lm((function(t){e.dispatchEvent(new CustomEvent(n,t))}));return e.addEventListener(t,r),r}function Mm(e,t){return void 0===t&&(t={}),Lm(e,(function(e){t.preventDefault&&e.preventDefault()}),(function(e){return e.persist()}))}function Am(e){return Lm(e)}function Lm(e,t,n){var r=!1;return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null==t||t.apply(void 0,o),r||(r=!0,null==n||n.apply(void 0,o),requestAnimationFrame((function(){e.apply(void 0,o),r=!1})))}}e(Sm,"elementIsOrContains",(()=>Cm)),e(Sm,"throttleEvent",(()=>Om)),e(Sm,"throttleReactEventCallback",(()=>Mm)),e(Sm,"throttle",(()=>Am));var km={};function Pm(e){return"function"==typeof e}e(km,"isFunction",(()=>Pm));var Tm={};e(Tm,"isNodeEnv",(()=>Hm)),e(Tm,"arrayLengthCompare",(()=>Nm)),e(Tm,"approxEqual",(()=>Rm)),e(Tm,"clamp",(()=>jm)),e(Tm,"countDecimalPlaces",(()=>Vm)),e(Tm,"uniqueId",(()=>Dm));function Hm(e){return void 0!==hh&&hh.env&&"production"===e}function Nm(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),e.length-t.length}function Rm(e,t,n){return void 0===n&&(n=1e-5),Math.abs(e-t)<=n}function jm(e,t,n){if(null==e)return e;if(n<t)throw new Error("[Blueprint] clamp: max cannot be less than min");return Math.min(Math.max(e,t),n)}function Vm(e){if(!isFinite(e))return 0;for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}var Im=new Map;function Dm(e){var t,n=null!==(t=Im.get(e))&&void 0!==t?t:0;return Im.set(e,n+1),"".concat(e,"-").concat(n)}var Fm={};e(Fm,"isReactNodeEmpty",(()=>Bm)),e(Fm,"isReactChildrenElementOrElements",(()=>Um)),e(Fm,"ensureElement",(()=>Gm)),e(Fm,"getDisplayName",(()=>qm)),e(Fm,"isElementOfType",(()=>Wm));u=l("8NFma");function Bm(e,t){return void 0===t&&(t=!1),null==e||""===e||!1===e||!t&&Array.isArray(e)&&(0===e.length||e.every((function(e){return Bm(e,!0)})))}function Um(e){return!Bm(e,!0)&&!0!==e}function Gm(e,t){return void 0===t&&(t="span"),null==e||"boolean"==typeof e?void 0:"string"==typeof e?e.trim().length>0?u.createElement(t,{},e):void 0:"number"==typeof e||"symbol"==typeof e.type||Array.isArray(e)?u.createElement(t,{},e):function(e){return"object"==typeof e&&void 0!==e.type&&void 0!==e.props}(e)?e:void 0}function qm(e){return e.displayName||e.name||"Unknown"}function Wm(e,t){return null!=e&&null!=e.type&&null!=e.type.displayName&&e.type.displayName===t.displayName}function Km(e){return null!=e&&e instanceof Element&&null!=e.closest(".".concat(Hh))}function Ym(e,t){var n;null!=(n=e)&&"function"!=typeof n?e.current=t:function(e){return"function"==typeof e}(e)&&e(t)}function Xm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){e.forEach((function(e){Ym(e,t)}))}}function $m(e){var t;return null===e?null:null!==(t=e.current)&&void 0!==t?t:e}function Qm(e,t,n){return function(r){e[t]=r,Ym(n,r)}}"undefined"!=typeof window&&"undefined"!=typeof document&&l("2j10E"),r(vm,mm),r(vm,Sm),r(vm,km),r(vm,Tm),r(vm,Fm);
65
65
  /*! *****************************************************************************
66
66
  Copyright (c) Microsoft Corporation.
67
67
 
@@ -158,7 +158,7 @@ PERFORMANCE OF THIS SOFTWARE.
158
158
  .bp4-dark & {
159
159
  filter: invert(1);
160
160
  }
161
- `,Z9=bs(),J9=({fontFamily:e,handleClick:t,modifiers:r,store:o,isCustom:i})=>{n(u).useEffect((()=>{i&&o.loadFont(e)}),[e,i]);const a=i?e:s.jsx(Q9,{src:CW(e)});return s.jsx(OU,{text:a,active:r.active,disabled:r.disabled,onClick:t,style:{fontFamily:'"'+e+'"'}})},e7=({onChange:e,defaultValue:t})=>{const r=n(u).useRef(null);return n(u).useEffect((()=>{r.current&&r.current.focus()}),[]),s.jsx(fU,{leftIcon:"search",inputRef:r,defaultValue:t,onChange:t=>e(t.target.value)})},t7=({store:e,fonts:t,activeFont:r,activeFontLabel:o,onFontSelect:i})=>{const[a,l]=n(u).useState(""),c=t.filter((e=>e.toLowerCase().indexOf(a.toLowerCase())>=0));return s.jsx(dW,{content:s.jsxs("div",{children:[s.jsx(e7,{onChange:e=>l(e),defaultValue:a}),s.jsx("div",{style:{paddingTop:"5px"},children:s.jsx(vK,{innerElementType:n(u).forwardRef(((e,t)=>s.jsx(zU,{ref:t,...e}))),height:Math.min(400,30*c.length)+10,width:210,itemCount:c.length,itemSize:30,children:({index:t,style:n})=>{const o=c[t];return s.jsx("div",{style:n,children:s.jsx(J9,{fontFamily:o,modifiers:{active:r===o},handleClick:()=>i(o),store:e,isCustom:e.fonts.find((e=>e.fontFamily===o))||ws.find((e=>e.fontFamily===o))},o)})}})})]}),children:s.jsx(YB,{text:o,rightIcon:"caret-down",minimal:!0,style:{marginRight:"5px",fontFamily:'"'+r+'"',overflow:"hidden",whiteSpace:"nowrap"}})})},n7=Br((({element:e,store:t})=>{const{data:r,mutate:o}=sY(SW(),MY,{isPaused:()=>ys(),fallbackData:[]});n(u).useEffect((()=>{o()}),[ys()]);const i=t.fonts.concat(ws).map((e=>e.fontFamily)).concat(r?.length?r:Z9);let a=e.fontFamily;return a.length>15&&(a=e.fontFamily.slice(0,15)+"..."),s.jsx(t7,{fonts:i,activeFont:e.fontFamily,activeFontLabel:a,store:t,onFontSelect:t=>{e.set({fontFamily:t})}})})),r7=Br((({element:e})=>s.jsx(EU,{onValueChange:t=>{e.set({fontSize:t})},value:Math.round(e.fontSize),style:{width:"50px"},min:5}))),o7=["left","center","right","justify"],i7=Br((({element:e})=>s.jsxs(XB,{children:[s.jsx(YB,{minimal:!0,icon:"align-"+e.align,onClick:()=>{const t=(o7.indexOf(e.align)+1+o7.length)%o7.length,n=o7[t];e.set({align:n})}}),s.jsx(YB,{minimal:!0,icon:"bold",active:Nu.currentFormat.bold||"bold"===e.fontWeight||"700"===e.fontWeight,onMouseDown:e=>{e.preventDefault()},onClick:t=>{const n=window.__polotnoQuill;if(n){const e=n.getSelection();return void n.formatText(e.index,e.length,"bold",!Nu.currentFormat.bold,"user")}"bold"===e.fontWeight||"700"===e.fontWeight?e.set({fontWeight:"normal"}):e.set({fontWeight:"bold"})}}),s.jsx(YB,{minimal:!0,icon:"italic",onMouseDown:e=>{e.preventDefault()},active:Nu.currentFormat.italic||"italic"===e.fontStyle,onClick:()=>{const t=window.__polotnoQuill;if(t){const e=t.getSelection();t.formatText(e.index,e.length,"italic",!Nu.currentFormat.italic,"user")}else"italic"===e.fontStyle?e.set({fontStyle:"normal"}):e.set({fontStyle:"italic"})}}),s.jsx(YB,{minimal:!0,icon:"underline",active:Nu.currentFormat.underline||e.textDecoration.indexOf("underline")>=0,onMouseDown:e=>{e.preventDefault()},onClick:()=>{const t=window.__polotnoQuill;if(t){const e=t.getSelection();return void t.formatText(e.index,e.length,"underline",!Nu.currentFormat.underline,"user")}let n=e.textDecoration.split(" ");n.indexOf("underline")>=0?n=n.filter((e=>"underline"!==e)):n.push("underline"),e.set({textDecoration:n.join(" ")})}}),s.jsx(YB,{minimal:!0,icon:"properties",onMouseDown:e=>{e.preventDefault()},onClick:()=>{const e=window.__polotnoQuill;e.getFormat().list?e.format("list",!1):e.format("list","bullet")}})]}))),a7=Br((({element:e,store:t})=>s.jsx(_9,{value:Nu.currentFormat.color||e.fill,onChange:t=>{const n=window.__polotnoQuill,r=n?.getSelection(),o=r?.length>=n?.getLength()-1;if(n&&!o&&r?.length)n.formatText(r.index,r.length,"color",t,"user");else{var i=e.text.replace(/style=".*?"/g,"");e.set({fill:t,text:i})}},store:t}))),l7=Br((({element:e})=>s.jsx(dW,{content:s.jsxs("div",{style:{padding:"15px 25px",width:"200px"},children:[s.jsx("p",{children:"Line height"}),s.jsx(XU,{value:"number"==typeof e.lineHeight?100*e.lineHeight:120,labelStepSize:50,onChange:t=>{e.set({lineHeight:t/100})},min:50,max:250,stepSize:10,showTrackFill:!0}),s.jsx("p",{children:"Letter spacing"}),s.jsx(XU,{value:100*e.letterSpacing,labelStepSize:50,onChange:t=>{e.set({letterSpacing:t/100})},min:-50,max:250,stepSize:10,showTrackFill:!1})]}),position:uh.BOTTOM,children:s.jsx(YB,{icon:s.jsx(n(O9),{className:"bp4-icon",style:{fontSize:"20px"}}),minimal:!0})}))),s7={font:n7,fontSize:r7,fontVariant:i7,filter:z9,fontColor:a7,spacing:l7},c7=(Hu("div")`
161
+ `,Z9=bs(),J9=({fontFamily:e,handleClick:t,modifiers:r,store:o,isCustom:i})=>{n(u).useEffect((()=>{i&&o.loadFont(e)}),[e,i]);const a=i?e:s.jsx(Q9,{src:CW(e)});return s.jsx(OU,{text:a,active:r.active,disabled:r.disabled,onClick:t,style:{fontFamily:'"'+e+'"'}})},e7=({onChange:e,defaultValue:t})=>{const r=n(u).useRef(null);return n(u).useEffect((()=>{r.current&&r.current.focus()}),[]),s.jsx(fU,{leftIcon:"search",inputRef:r,defaultValue:t,onChange:t=>e(t.target.value)})},t7=({store:e,fonts:t,activeFont:r,activeFontLabel:o,onFontSelect:i})=>{const[a,l]=n(u).useState(""),c=t.filter((e=>e.toLowerCase().indexOf(a.toLowerCase())>=0));return s.jsx(dW,{content:s.jsxs("div",{children:[s.jsx(e7,{onChange:e=>l(e),defaultValue:a}),s.jsx("div",{style:{paddingTop:"5px"},children:s.jsx(vK,{innerElementType:n(u).forwardRef(((e,t)=>s.jsx(zU,{ref:t,...e}))),height:Math.min(400,30*c.length)+10,width:210,itemCount:c.length,itemSize:30,children:({index:t,style:n})=>{const o=c[t];return s.jsx("div",{style:n,children:s.jsx(J9,{fontFamily:o,modifiers:{active:r===o},handleClick:()=>i(o),store:e,isCustom:e.fonts.find((e=>e.fontFamily===o))||ws.find((e=>e.fontFamily===o))},o)})}})})]}),children:s.jsx(YB,{text:o,rightIcon:"caret-down",minimal:!0,style:{marginRight:"5px",fontFamily:'"'+r+'"',overflow:"hidden",whiteSpace:"nowrap"}})})},n7=Br((({element:e,store:t})=>{const{data:r,mutate:o}=sY(SW(),MY,{isPaused:()=>ys(),fallbackData:[]});n(u).useEffect((()=>{o()}),[ys()]);const i=t.fonts.concat(ws).map((e=>e.fontFamily)).concat(r?.length?r:Z9);let a=e.fontFamily;return a.length>15&&(a=e.fontFamily.slice(0,15)+"..."),s.jsx(t7,{fonts:i,activeFont:e.fontFamily,activeFontLabel:a,store:t,onFontSelect:t=>{e.set({fontFamily:t})}})})),r7=Br((({element:e})=>s.jsx(EU,{onValueChange:t=>{e.set({fontSize:t})},value:Math.round(e.fontSize),style:{width:"50px"},min:5}))),o7=["left","center","right","justify"],i7=Br((({element:e})=>s.jsxs(XB,{children:[s.jsx(YB,{minimal:!0,icon:"align-"+e.align,onClick:()=>{const t=(o7.indexOf(e.align)+1+o7.length)%o7.length,n=o7[t];e.set({align:n})}}),s.jsx(YB,{minimal:!0,icon:"bold",active:Nu.currentFormat.bold||"bold"===e.fontWeight||"700"===e.fontWeight,onMouseDown:e=>{e.preventDefault()},onClick:t=>{const n=window.__polotnoQuill;if(n){const e=n.getSelection();return void n.formatText(e.index,e.length,"bold",!Nu.currentFormat.bold,"user")}"bold"===e.fontWeight||"700"===e.fontWeight?e.set({fontWeight:"normal"}):e.set({fontWeight:"bold"})}}),s.jsx(YB,{minimal:!0,icon:"italic",onMouseDown:e=>{e.preventDefault()},active:Nu.currentFormat.italic||"italic"===e.fontStyle,onClick:()=>{const t=window.__polotnoQuill;if(t){const e=t.getSelection();t.formatText(e.index,e.length,"italic",!Nu.currentFormat.italic,"user")}else"italic"===e.fontStyle?e.set({fontStyle:"normal"}):e.set({fontStyle:"italic"})}}),s.jsx(YB,{minimal:!0,icon:"underline",active:Nu.currentFormat.underline||e.textDecoration.indexOf("underline")>=0,onMouseDown:e=>{e.preventDefault()},onClick:()=>{const t=window.__polotnoQuill;if(t){const e=t.getSelection();return void t.formatText(e.index,e.length,"underline",!Nu.currentFormat.underline,"user")}let n=e.textDecoration.split(" ");n.indexOf("underline")>=0?n=n.filter((e=>"underline"!==e)):n.push("underline"),e.set({textDecoration:n.join(" ")})}})]}))),a7=Br((({element:e,store:t})=>s.jsx(_9,{value:Nu.currentFormat.color||e.fill,onChange:t=>{const n=window.__polotnoQuill,r=n?.getSelection(),o=r?.length>=n?.getLength()-1;if(n&&!o&&r?.length)n.formatText(r.index,r.length,"color",t,"user");else{var i=e.text.replace(/style=".*?"/g,"");e.set({fill:t,text:i})}},store:t}))),l7=Br((({element:e})=>s.jsx(dW,{content:s.jsxs("div",{style:{padding:"15px 25px",width:"200px"},children:[s.jsx("p",{children:"Line height"}),s.jsx(XU,{value:"number"==typeof e.lineHeight?100*e.lineHeight:120,labelStepSize:50,onChange:t=>{e.set({lineHeight:t/100})},min:50,max:250,stepSize:10,showTrackFill:!0}),s.jsx("p",{children:"Letter spacing"}),s.jsx(XU,{value:100*e.letterSpacing,labelStepSize:50,onChange:t=>{e.set({letterSpacing:t/100})},min:-50,max:250,stepSize:10,showTrackFill:!1})]}),position:uh.BOTTOM,children:s.jsx(YB,{icon:s.jsx(n(O9),{className:"bp4-icon",style:{fontSize:"20px"}}),minimal:!0})}))),s7={font:n7,fontSize:r7,fontVariant:i7,filter:z9,fontColor:a7,spacing:l7},c7=(Hu("div")`
162
162
  width: calc(100% - 450px);
163
163
 
164
164
  @media screen and (max-width: 500px) {
@@ -4,7 +4,7 @@
4
4
  .bp4-dark & {
5
5
  filter: invert(1);
6
6
  }
7
- `,googleFonts=(0,fonts_1.getFontsList)(),FontItem=({fontFamily:e,handleClick:t,modifiers:n,store:l,isCustom:o})=>{react_1.default.useEffect((()=>{o&&l.loadFont(e)}),[e,o]);const r=o?e:react_1.default.createElement(Image,{src:(0,api_1.getGoogleFontImage)(e)});return react_1.default.createElement(core_1.MenuItem,{text:r,active:n.active,disabled:n.disabled,onClick:t,style:{fontFamily:'"'+e+'"'}})},SearchInput=({onChange:e,defaultValue:t})=>{const n=react_1.default.useRef(null);return react_1.default.useEffect((()=>{n.current&&n.current.focus()}),[]),react_1.default.createElement(core_1.InputGroup,{leftIcon:"search",inputRef:n,defaultValue:t,onChange:t=>e(t.target.value)})},FontMenu=({store:e,fonts:t,activeFont:n,activeFontLabel:l,onFontSelect:o})=>{const[r,i]=react_1.default.useState(""),a=t.filter((e=>e.toLowerCase().indexOf(r.toLowerCase())>=0));return react_1.default.createElement(popover2_1.Popover2,{content:react_1.default.createElement("div",null,react_1.default.createElement(SearchInput,{onChange:e=>i(e),defaultValue:r}),react_1.default.createElement("div",{style:{paddingTop:"5px"}},react_1.default.createElement(react_window_1.FixedSizeList,{innerElementType:react_1.default.forwardRef(((e,t)=>react_1.default.createElement(core_1.Menu,Object.assign({ref:t},e)))),height:Math.min(400,30*a.length)+10,width:210,itemCount:a.length,itemSize:30,children:({index:t,style:l})=>{const r=a[t];return react_1.default.createElement("div",{style:l},react_1.default.createElement(FontItem,{key:r,fontFamily:r,modifiers:{active:n===r},handleClick:()=>o(r),store:e,isCustom:e.fonts.find((e=>e.fontFamily===r))||fonts_1.globalFonts.find((e=>e.fontFamily===r))}))}})))},react_1.default.createElement(core_1.Button,{text:l,rightIcon:"caret-down",minimal:!0,style:{marginRight:"5px",fontFamily:'"'+n+'"',overflow:"hidden",whiteSpace:"nowrap"}}))};exports.FontFamilyInput=(0,mobx_react_lite_1.observer)((({element:e,store:t})=>{const{data:n,mutate:l}=(0,swr_1.default)((0,api_1.getGoogleFontsListAPI)(),use_api_1.fetcher,{isPaused:()=>(0,fonts_1.isGoogleFontChanged)(),fallbackData:[]});react_1.default.useEffect((()=>{l()}),[(0,fonts_1.isGoogleFontChanged)()]);const o=t.fonts.concat(fonts_1.globalFonts).map((e=>e.fontFamily)).concat((null==n?void 0:n.length)?n:googleFonts);let r=e.fontFamily;return r.length>15&&(r=e.fontFamily.slice(0,15)+"..."),react_1.default.createElement(FontMenu,{fonts:o,activeFont:e.fontFamily,activeFontLabel:r,store:t,onFontSelect:t=>{e.set({fontFamily:t})}})})),exports.FontSizeInput=(0,mobx_react_lite_1.observer)((({element:e})=>react_1.default.createElement(core_1.NumericInput,{onValueChange:t=>{e.set({fontSize:t})},value:Math.round(e.fontSize),style:{width:"50px"},min:5})));const ALIGN_OPTIONS=["left","center","right","justify"];exports.FontStyleGroup=(0,mobx_react_lite_1.observer)((({element:e})=>react_1.default.createElement(core_1.ButtonGroup,null,react_1.default.createElement(core_1.Button,{minimal:!0,icon:"align-"+e.align,onClick:()=>{const t=(ALIGN_OPTIONS.indexOf(e.align)+1+ALIGN_OPTIONS.length)%ALIGN_OPTIONS.length,n=ALIGN_OPTIONS[t];e.set({align:n})}}),react_1.default.createElement(core_1.Button,{minimal:!0,icon:"bold",active:html_element_1.quillRef.currentFormat.bold||"bold"===e.fontWeight||"700"===e.fontWeight,onMouseDown:e=>{e.preventDefault()},onClick:t=>{const n=window.__polotnoQuill;if(n){const e=n.getSelection();return void n.formatText(e.index,e.length,"bold",!html_element_1.quillRef.currentFormat.bold,"user")}"bold"===e.fontWeight||"700"===e.fontWeight?e.set({fontWeight:"normal"}):e.set({fontWeight:"bold"})}}),react_1.default.createElement(core_1.Button,{minimal:!0,icon:"italic",onMouseDown:e=>{e.preventDefault()},active:html_element_1.quillRef.currentFormat.italic||"italic"===e.fontStyle,onClick:()=>{const t=window.__polotnoQuill;if(t){const e=t.getSelection();t.formatText(e.index,e.length,"italic",!html_element_1.quillRef.currentFormat.italic,"user")}else"italic"===e.fontStyle?e.set({fontStyle:"normal"}):e.set({fontStyle:"italic"})}}),react_1.default.createElement(core_1.Button,{minimal:!0,icon:"underline",active:html_element_1.quillRef.currentFormat.underline||e.textDecoration.indexOf("underline")>=0,onMouseDown:e=>{e.preventDefault()},onClick:()=>{const t=window.__polotnoQuill;if(t){const e=t.getSelection();return void t.formatText(e.index,e.length,"underline",!html_element_1.quillRef.currentFormat.underline,"user")}let n=e.textDecoration.split(" ");n.indexOf("underline")>=0?n=n.filter((e=>"underline"!==e)):n.push("underline"),e.set({textDecoration:n.join(" ")})}}),react_1.default.createElement(core_1.Button,{minimal:!0,icon:"properties",onMouseDown:e=>{e.preventDefault()},onClick:()=>{const e=window.__polotnoQuill;e.getFormat().list?e.format("list",!1):e.format("list","bullet")}})))),exports.FontColorInput=(0,mobx_react_lite_1.observer)((({element:e,store:t})=>react_1.default.createElement(color_picker_1.default,{value:html_element_1.quillRef.currentFormat.color||e.fill,onChange:t=>{const n=window.__polotnoQuill,l=null==n?void 0:n.getSelection(),o=(null==l?void 0:l.length)>=(null==n?void 0:n.getLength())-1;if(n&&!o&&(null==l?void 0:l.length))n.formatText(l.index,l.length,"color",t,"user");else{var r=e.text.replace(/style=".*?"/g,"");e.set({fill:t,text:r})}},store:t}))),exports.SpacingInput=(0,mobx_react_lite_1.observer)((({element:e})=>react_1.default.createElement(popover2_1.Popover2,{content:react_1.default.createElement("div",{style:{padding:"15px 25px",width:"200px"}},react_1.default.createElement("p",null,"Line height"),react_1.default.createElement(core_1.Slider,{value:"number"==typeof e.lineHeight?100*e.lineHeight:120,labelStepSize:50,onChange:t=>{e.set({lineHeight:t/100})},min:50,max:250,stepSize:10,showTrackFill:!0}),react_1.default.createElement("p",null,"Letter spacing"),react_1.default.createElement(core_1.Slider,{value:100*e.letterSpacing,labelStepSize:50,onChange:t=>{e.set({letterSpacing:t/100})},min:-50,max:250,stepSize:10,showTrackFill:!1})),position:core_1.Position.BOTTOM},react_1.default.createElement(core_1.Button,{icon:react_1.default.createElement(MdcFormatLineSpacing_1.default,{className:"bp4-icon",style:{fontSize:"20px"}}),minimal:!0}))));const PROPS_MAP={font:exports.FontFamilyInput,fontSize:exports.FontSizeInput,fontVariant:exports.FontStyleGroup,filter:filters_picker_1.default,fontColor:exports.FontColorInput,spacing:exports.SpacingInput},Container=(0,styled_1.default)("div")`
7
+ `,googleFonts=(0,fonts_1.getFontsList)(),FontItem=({fontFamily:e,handleClick:t,modifiers:n,store:l,isCustom:o})=>{react_1.default.useEffect((()=>{o&&l.loadFont(e)}),[e,o]);const r=o?e:react_1.default.createElement(Image,{src:(0,api_1.getGoogleFontImage)(e)});return react_1.default.createElement(core_1.MenuItem,{text:r,active:n.active,disabled:n.disabled,onClick:t,style:{fontFamily:'"'+e+'"'}})},SearchInput=({onChange:e,defaultValue:t})=>{const n=react_1.default.useRef(null);return react_1.default.useEffect((()=>{n.current&&n.current.focus()}),[]),react_1.default.createElement(core_1.InputGroup,{leftIcon:"search",inputRef:n,defaultValue:t,onChange:t=>e(t.target.value)})},FontMenu=({store:e,fonts:t,activeFont:n,activeFontLabel:l,onFontSelect:o})=>{const[r,i]=react_1.default.useState(""),a=t.filter((e=>e.toLowerCase().indexOf(r.toLowerCase())>=0));return react_1.default.createElement(popover2_1.Popover2,{content:react_1.default.createElement("div",null,react_1.default.createElement(SearchInput,{onChange:e=>i(e),defaultValue:r}),react_1.default.createElement("div",{style:{paddingTop:"5px"}},react_1.default.createElement(react_window_1.FixedSizeList,{innerElementType:react_1.default.forwardRef(((e,t)=>react_1.default.createElement(core_1.Menu,Object.assign({ref:t},e)))),height:Math.min(400,30*a.length)+10,width:210,itemCount:a.length,itemSize:30,children:({index:t,style:l})=>{const r=a[t];return react_1.default.createElement("div",{style:l},react_1.default.createElement(FontItem,{key:r,fontFamily:r,modifiers:{active:n===r},handleClick:()=>o(r),store:e,isCustom:e.fonts.find((e=>e.fontFamily===r))||fonts_1.globalFonts.find((e=>e.fontFamily===r))}))}})))},react_1.default.createElement(core_1.Button,{text:l,rightIcon:"caret-down",minimal:!0,style:{marginRight:"5px",fontFamily:'"'+n+'"',overflow:"hidden",whiteSpace:"nowrap"}}))};exports.FontFamilyInput=(0,mobx_react_lite_1.observer)((({element:e,store:t})=>{const{data:n,mutate:l}=(0,swr_1.default)((0,api_1.getGoogleFontsListAPI)(),use_api_1.fetcher,{isPaused:()=>(0,fonts_1.isGoogleFontChanged)(),fallbackData:[]});react_1.default.useEffect((()=>{l()}),[(0,fonts_1.isGoogleFontChanged)()]);const o=t.fonts.concat(fonts_1.globalFonts).map((e=>e.fontFamily)).concat((null==n?void 0:n.length)?n:googleFonts);let r=e.fontFamily;return r.length>15&&(r=e.fontFamily.slice(0,15)+"..."),react_1.default.createElement(FontMenu,{fonts:o,activeFont:e.fontFamily,activeFontLabel:r,store:t,onFontSelect:t=>{e.set({fontFamily:t})}})})),exports.FontSizeInput=(0,mobx_react_lite_1.observer)((({element:e})=>react_1.default.createElement(core_1.NumericInput,{onValueChange:t=>{e.set({fontSize:t})},value:Math.round(e.fontSize),style:{width:"50px"},min:5})));const ALIGN_OPTIONS=["left","center","right","justify"];exports.FontStyleGroup=(0,mobx_react_lite_1.observer)((({element:e})=>react_1.default.createElement(core_1.ButtonGroup,null,react_1.default.createElement(core_1.Button,{minimal:!0,icon:"align-"+e.align,onClick:()=>{const t=(ALIGN_OPTIONS.indexOf(e.align)+1+ALIGN_OPTIONS.length)%ALIGN_OPTIONS.length,n=ALIGN_OPTIONS[t];e.set({align:n})}}),react_1.default.createElement(core_1.Button,{minimal:!0,icon:"bold",active:html_element_1.quillRef.currentFormat.bold||"bold"===e.fontWeight||"700"===e.fontWeight,onMouseDown:e=>{e.preventDefault()},onClick:t=>{const n=window.__polotnoQuill;if(n){const e=n.getSelection();return void n.formatText(e.index,e.length,"bold",!html_element_1.quillRef.currentFormat.bold,"user")}"bold"===e.fontWeight||"700"===e.fontWeight?e.set({fontWeight:"normal"}):e.set({fontWeight:"bold"})}}),react_1.default.createElement(core_1.Button,{minimal:!0,icon:"italic",onMouseDown:e=>{e.preventDefault()},active:html_element_1.quillRef.currentFormat.italic||"italic"===e.fontStyle,onClick:()=>{const t=window.__polotnoQuill;if(t){const e=t.getSelection();t.formatText(e.index,e.length,"italic",!html_element_1.quillRef.currentFormat.italic,"user")}else"italic"===e.fontStyle?e.set({fontStyle:"normal"}):e.set({fontStyle:"italic"})}}),react_1.default.createElement(core_1.Button,{minimal:!0,icon:"underline",active:html_element_1.quillRef.currentFormat.underline||e.textDecoration.indexOf("underline")>=0,onMouseDown:e=>{e.preventDefault()},onClick:()=>{const t=window.__polotnoQuill;if(t){const e=t.getSelection();return void t.formatText(e.index,e.length,"underline",!html_element_1.quillRef.currentFormat.underline,"user")}let n=e.textDecoration.split(" ");n.indexOf("underline")>=0?n=n.filter((e=>"underline"!==e)):n.push("underline"),e.set({textDecoration:n.join(" ")})}})))),exports.FontColorInput=(0,mobx_react_lite_1.observer)((({element:e,store:t})=>react_1.default.createElement(color_picker_1.default,{value:html_element_1.quillRef.currentFormat.color||e.fill,onChange:t=>{const n=window.__polotnoQuill,l=null==n?void 0:n.getSelection(),o=(null==l?void 0:l.length)>=(null==n?void 0:n.getLength())-1;if(n&&!o&&(null==l?void 0:l.length))n.formatText(l.index,l.length,"color",t,"user");else{var r=e.text.replace(/style=".*?"/g,"");e.set({fill:t,text:r})}},store:t}))),exports.SpacingInput=(0,mobx_react_lite_1.observer)((({element:e})=>react_1.default.createElement(popover2_1.Popover2,{content:react_1.default.createElement("div",{style:{padding:"15px 25px",width:"200px"}},react_1.default.createElement("p",null,"Line height"),react_1.default.createElement(core_1.Slider,{value:"number"==typeof e.lineHeight?100*e.lineHeight:120,labelStepSize:50,onChange:t=>{e.set({lineHeight:t/100})},min:50,max:250,stepSize:10,showTrackFill:!0}),react_1.default.createElement("p",null,"Letter spacing"),react_1.default.createElement(core_1.Slider,{value:100*e.letterSpacing,labelStepSize:50,onChange:t=>{e.set({letterSpacing:t/100})},min:-50,max:250,stepSize:10,showTrackFill:!1})),position:core_1.Position.BOTTOM},react_1.default.createElement(core_1.Button,{icon:react_1.default.createElement(MdcFormatLineSpacing_1.default,{className:"bp4-icon",style:{fontSize:"20px"}}),minimal:!0}))));const PROPS_MAP={font:exports.FontFamilyInput,fontSize:exports.FontSizeInput,fontVariant:exports.FontStyleGroup,filter:filters_picker_1.default,fontColor:exports.FontColorInput,spacing:exports.SpacingInput},Container=(0,styled_1.default)("div")`
8
8
  width: calc(100% - 450px);
9
9
 
10
10
  @media screen and (max-width: 500px) {
@@ -1,16 +0,0 @@
1
- interface PolotnoElement {
2
- type: string;
3
- id: string;
4
- x: number;
5
- y: number;
6
- }
7
- export declare function svgToURL(s: any): string;
8
- export declare function parseSVG(svgString: any): {
9
- width: number;
10
- height: number;
11
- pages: {
12
- id: string;
13
- children: PolotnoElement[];
14
- }[];
15
- };
16
- export {};
@@ -1 +0,0 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseSVG=exports.svgToURL=void 0;const konva_1=__importDefault(require("konva"));let count=0;const getId=()=>(count+=1,count.toString());function getSize(t){const e=t.getAttribute("viewBox"),[r,n,o,i]=(null==e?void 0:e.split(" "))||[];return t.getAttribute("width")||t.setAttribute("width",o+"px"),t.getAttribute("height")||t.setAttribute("height",i+"px"),{width:parseFloat(t.getAttribute("width")||o),height:parseFloat(t.getAttribute("height")||i)}}function parseTransform(t="translate(0 0)"){const[e,r]=t.replace(/translate\(([^)]+)\)/,"$1").split(" ");return{x:parseFloat(e)||0,y:parseFloat(r)||0}}function getTransform(t){var e;const r=(null===(e=t.transform.baseVal.consolidate())||void 0===e?void 0:e.matrix)||new DOMMatrix;return new konva_1.default.Transform([r.a,r.b,r.c,r.d,r.e,r.f])}function getAbsoluteTransform(t){t.getAttribute("transform");const e=getTransform(t);if(t.parentNode&&"svg"!==t.parentNode.nodeName){return getAbsoluteTransform(t.parentNode).multiply(e)}return e}function getAbsoluteAttrs(t){return getAbsoluteTransform(t).decompose()}function getAbsolutePosition(t){const{x:e,y:r}=t.getBoundingClientRect();if("svg"===t.nodeName)return{x:e,y:r};const n=getAbsolutePosition(t.parentNode);return{x:e+n.x,y:r+n.y}}function hasText(t){return t.getElementsByTagName("text").length>0}function hasImage(t){return t.getElementsByTagName("image").length>0}function svgToURL(t){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(t)))}exports.svgToURL=svgToURL;const isSmallGroup=t=>"g"===t.nodeName&&t.getBBox().width<400&&t.getBBox().height<400;function getQuery(t="url(#pattern)"){return t.replace(/url\(([^)]+)\)/,"$1").replace(/'/g,"")}function simplifyFontFamily(t){return t.includes("OpenSans")?"Open Sans":t.includes("Montserrat")?"Montserrat":t}function recursiveGetElements(t){var e,r,n;if("defs"===t.nodeName)return[];if("text"===t.nodeName){const e=Array.from(t.children).map((t=>t.innerHTML)).join("\n"),r=parseFloat(t.getAttribute("font-size")||"20"),{x:n,y:o,rotation:i}=getAbsoluteAttrs(t);return[{type:"text",text:e,id:getId(),x:n+t.getBBox().x,y:o,fontSize:r,rotation:i,width:t.getBBox().width,height:t.getBBox().height,fontFamily:simplifyFontFamily(t.getAttribute("font-family")||"Arial"),align:"left",fill:t.getAttribute("fill")||"black"}]}if("rect"===t.nodeName){const{x:n,y:o,rotation:i}=getAbsoluteAttrs(t),s=parseFloat(t.getAttribute("width")||"0"),a=parseFloat(t.getAttribute("height")||"0");if(t.getAttribute("fill").indexOf("url")>=0){const g=getQuery(t.getAttribute("fill")),u=null===(r=null===(e=t.parentElement)||void 0===e?void 0:e.parentElement)||void 0===r?void 0:r.querySelector(g),l=null==u?void 0:u.querySelector("image"),d=null==l?void 0:l.getAttribute("xlink:href");return[{type:"image",id:getId(),x:n,y:o,width:s,height:a,src:d,rotation:i}]}t.setAttribute("transform","");const g=`<svg xmlns="http://www.w3.org/2000/svg" width="${s}" height="${a}" viewBox="0 0 ${s} ${a}">${t.outerHTML}</svg>`;return[{type:"svg",id:getId(),x:n,y:o,width:s,height:a,src:svgToURL(g)}]}if("path"===t.nodeName||"polygon"===t.nodeName){const{x:e,y:r,rotation:n}=getAbsoluteAttrs(t),{width:o,height:i}=t.getBBox();t.setAttribute("transform","");const s=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${i}" viewBox="0 0 ${o} ${i}">${t.outerHTML}</svg>`;return t.getAttribute("id"),[{type:"svg",id:t.getAttribute("id")||getId(),x:e,y:r,width:o,height:i,rotation:n,src:svgToURL(s)}]}if(t.getAttribute("id"),isSmallGroup(t)){const{x:e,y:r}=t.getBBox(),{width:o,height:i}=(getAbsolutePosition(t),t.getBBox()),s=Array.from(t.querySelectorAll("*"));let a=e,g=r;s.forEach((t=>{if("g"===t.nodeName)return;const e=t.getBBox();a=Math.min(a,e.x),g=Math.min(g,e.y)}));const u=t.getBoundingClientRect(),l=null===(n=t.parentElement)||void 0===n?void 0:n.parentElement,d=null==l?void 0:l.getBoundingClientRect(),h=t.getAttribute("transform");t.setAttribute("transform","");const c=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${i}" viewBox="0 0 ${o} ${i}"><g transform="translate(${-e} ${-r})">${t.outerHTML}</g></svg>`;return t.setAttribute("transform",h),[{type:"svg",id:getId(),x:(u.x-d.x)/d.width*1240,y:(u.y-d.y)/d.height*1754,width:o,height:i,name:t.getAttribute("id")||"",src:svgToURL(c)}]}if(!hasText(t)&&!hasImage(t)){const e=[];return Array.from(t.children).forEach((t=>{e.push(...recursiveGetElements(t))})),e}const o=[];return Array.from(t.children).forEach((t=>{o.push(...recursiveGetElements(t))})),o}function parseSVG(t){const e=document.createElement("div");document.body.appendChild(e),e.innerHTML=t;const r=e.querySelector("svg"),{width:n,height:o}=getSize(r),i=[];return Array.from(r.children).forEach((t=>{i.push(...recursiveGetElements(t))})),{width:n,height:o,pages:[{id:getId(),children:i}]}}exports.parseSVG=parseSVG;