polotno 2.22.1 → 2.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polotno",
3
- "version": "2.22.1",
3
+ "version": "2.22.2",
4
4
  "description": "Design Editor Framework",
5
5
  "author": "Anton Lavrenov",
6
6
  "keywords": [
package/polotno.bundle.js CHANGED
@@ -258,7 +258,7 @@ For simpler debugging here is the log of the parent element:`,uF=(e,t,n,r,i,o)=>
258
258
  .bp5-dark & {
259
259
  filter: invert(1);
260
260
  }
261
- `,Pu=({fontFamily:e,handleClick:t,modifiers:n,store:r,isCustom:i})=>{let[o,a]=h(C).useState(!i);if(h(C).useEffect(()=>{o||r.loadFont(e)},[e,o]),"_divider"===e)return(0,b.jsx)("div",{style:{paddingTop:"10px"},children:(0,b.jsx)(yq,{})});let l=o?(0,b.jsx)(Ps,{src:lI(e),alt:e,onError:()=>{a(!1)}}):e;return(0,b.jsx)(yK,{text:l,active:n.active,disabled:n.disabled,onClick:t,style:{fontFamily:'"'+e+'"'}})},Pc=({onChange:e,defaultValue:t})=>{let n=h(C).useRef(null);return h(C).useEffect(()=>{n.current&&n.current.focus()},[]),(0,b.jsx)(bD,{leftIcon:(0,b.jsx)(wh,{}),inputRef:n,defaultValue:t,onChange:t=>e(t.target.value)})},Pd=({store:e,fonts:t,activeFont:n,activeFontLabel:r,onFontSelect:i})=>{let[o,a]=h(C).useState(""),l=t.filter(e=>e.toLowerCase().indexOf(o.toLowerCase())>=0);return(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{children:[(0,b.jsx)(Pc,{onChange:e=>a(e),defaultValue:o}),(0,b.jsx)("div",{style:{paddingTop:"5px"},children:(0,b.jsx)(xs,{innerElementType:h(C).forwardRef((e,t)=>(0,b.jsx)(yG,{ref:t,...e})),height:Math.min(400,30*l.length)+10,width:210,itemCount:l.length,itemSize:30,children:({index:t,style:r})=>{let o=l[t];return(0,b.jsx)("div",{style:r,children:(0,b.jsx)(Pu,{fontFamily:o,modifiers:{active:n===o},handleClick:()=>i(o),store:e,isCustom:e.fonts.find(e=>e.fontFamily===o)||iE.find(e=>e.fontFamily===o)},o)})}})})]}),children:(0,b.jsx)(mc,{text:r,rightIcon:(0,b.jsx)(wc,{}),minimal:!0,style:{marginRight:"5px",fontFamily:'"'+n+'"',overflow:"hidden",whiteSpace:"nowrap",maxHeight:"30px"}})})},Ph={},Pf=e=>Ph[e]?Promise.resolve(Ph[e]):fetch(e).then(e=>e.json()).then(t=>(Ph[e]=t,t)),Pp=R(({elements:e,store:t})=>{let{data:n,mutate:r}=wi(lL(),Pf,{isPaused:()=>iS(),fallbackData:[]});h(C).useEffect(()=>{r()},[iS()]);let i=t.fonts.concat(iE).map(e=>e.fontFamily).concat(n?.length&&!iS()?n:iC),o=e[0].fontFamily;o.length>15&&(o=o.slice(0,15)+"...");let a=[];t.find(e=>("text"===e.type&&a.push(e.fontFamily),!1));let l=[...new Set(a.concat("_divider").concat(i))];return(0,b.jsx)(Pd,{fonts:l,activeFont:e[0].fontFamily,activeFontLabel:o,store:t,onFontSelect:n=>{t.history.transaction(()=>{e.forEach(e=>{e.set({fontFamily:n})})})}})}),Pg=R(({elements:e,store:t})=>(0,b.jsx)(bq,{onValueChange:n=>{Number.isNaN(n)||t.history.transaction(()=>{e.forEach(e=>{e.set({fontSize:n,width:Math.max(n,e.width)})})})},value:Math.round(e[0].fontSize),style:{width:"50px"},min:5,max:4*t.height})),Pm=["left","center","right","justify"],Pv=["top","middle","bottom"],Py={top:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Po),{})}),middle:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Pa),{})}),bottom:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Pl),{})})},Pb=R(({elements:e,store:t})=>{let n=e[0];return(0,b.jsxs)(bL,{children:[(0,b.jsx)(mc,{minimal:!0,icon:"left"===n.align?(0,b.jsx)(wl,{}):"center"===n.align?(0,b.jsx)(wo,{}):"right"===n.align?(0,b.jsx)(ws,{}):(0,b.jsx)(wa,{}),onClick:()=>{let r=(Pm.indexOf(n.align)+1+Pm.length)%Pm.length,i=Pm[r];t.history.transaction(()=>{e.forEach(e=>{e.set({align:i})})})}}),iI.textVerticalResizeEnabled&&(0,b.jsx)(mc,{minimal:!0,icon:Py[n.verticalAlign],onClick:()=>{let r=(Pv.indexOf(n.verticalAlign)+1+Pv.length)%Pv.length,i=Pv[r];t.history.transaction(()=>{e.forEach(e=>{e.set({verticalAlign:i})})})}}),(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(wu,{}),active:"bold"===n.fontWeight||"700"===n.fontWeight,onClick:()=>{let r="bold"===n.fontWeight||"700"===n.fontWeight;t.history.transaction(()=>{e.forEach(e=>{r?e.set({fontWeight:"normal"}):e.set({fontWeight:"bold"})})})}}),(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(wd,{}),active:"italic"===n.fontStyle,onClick:()=>{let r="italic"===n.fontStyle;t.history.transaction(()=>{e.forEach(e=>{r?e.set({fontStyle:"normal"}):e.set({fontStyle:"italic"})})})}}),(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(wp,{}),active:n.textDecoration.indexOf("underline")>=0,onClick:()=>{let r=n.textDecoration.split(" ");r.indexOf("underline")>=0?r=r.filter(e=>"underline"!==e):r.push("underline"),t.history.transaction(()=>{e.forEach(e=>{e.set({textDecoration:r.join(" ")})})})}}),(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(wf,{}),active:n.textDecoration.indexOf("line-through")>=0,onClick:()=>{let r=n.textDecoration.split(" ");r.indexOf("line-through")>=0?r=r.filter(e=>"line-through"!==e):r.push("line-through"),t.history.transaction(()=>{e.forEach(e=>{e.set({textDecoration:r.join(" ")})})})}})]})}),Px=R(({elements:e,store:t})=>(0,b.jsx)(OT,{value:e[0].fill,style:{marginRight:"5px"},gradientEnabled:!0,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({fill:n})})}),store:t})),Pw=({value:e,onValueChange:t,...n})=>{let[r,i]=h(C).useState(e.toString());return h(C).useEffect(()=>{i(e.toString())},[e]),(0,b.jsx)(bq,{value:r,onValueChange:(e,n)=>{i(n),Number.isNaN(e)||t(e)},...n})},PC=R(({elements:e,store:t})=>{let n=e[0],r=n=>{t.history.transaction(()=>{e.forEach(e=>{e.set(n)})})},i="number"==typeof n.lineHeight?100*n.lineHeight:120;return(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{style:{padding:"15px",width:"230px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.lineHeight")}),(0,b.jsx)("div",{children:(0,b.jsx)(Pw,{value:Math.round(i),onValueChange:e=>{r({lineHeight:e/100})},style:{width:"50px"},min:50,max:250,buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:Math.round(i),onChange:e=>{r({lineHeight:e/100})},min:50,max:250,stepSize:1,showTrackFill:!1,labelRenderer:!1}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.letterSpacing")}),(0,b.jsx)("div",{children:(0,b.jsx)(Pw,{value:Math.round(100*n.letterSpacing),onValueChange:e=>{r({letterSpacing:e/100})},style:{width:"50px"},min:-50,max:250,buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:Math.round(100*n.letterSpacing),onChange:e=>{r({letterSpacing:e/100})},min:-50,max:250,stepSize:1,showTrackFill:!1,labelRenderer:!1})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(h(Pi),{className:"bp5-icon",style:{fontSize:"20px"}}),minimal:!0})})}),P_={TextFontFamily:Pp,TextFontSize:Pg,TextFontVariant:Pb,TextFill:Px,TextSpacing:PC,TextAiWrite:y2,TextFilters:OD,TextAnimations:Pr},PS=R(({store:e,components:t})=>{let n=e.selectedElements,r=yz({type:"text",usedItems:["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextFilters",iI.animationsEnabled&&"TextAnimations","TextAiWrite"],components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||P_[r];return(0,b.jsx)(i,{elements:n,element:n[0],store:e},r)}})});var C=v("8NFma"),PE={};PE=function(e){return EM({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zm-2 7v-3l-4 4 4 4v-3h12v-2H8z"}}]})(e)};var Pk={};Pk=function(e){return EM({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z"}}]})(e)};var PO={};PO=function(e){return EM({tag:"svg",attr:{version:"1.1",id:"mdi-format-list-bulleted",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}}]})(e)};var PP={};PP=function(e){return EM({tag:"svg",attr:{version:"1.1",id:"mdi-format-list-numbered",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z"}}]})(e)};let PT=({html:e})=>{let t=document.createElement("div");document.body.appendChild(t),t.style.display="none",t.style.whiteSpace="pre-wrap";let n=aP(t);return aT(n,e),n},PA=e=>{e.root.parentElement.remove()},Pj=["left","center","right","justify"],PN=["top","middle","bottom"],PR={top:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Po),{})}),middle:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Pa),{})}),bottom:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Pl),{})})},PL=R(({active:e,globalActive:t,format:n,element:r,disableGlobal:i,enableGlobal:o,icon:a})=>(0,b.jsx)(mc,{minimal:!0,icon:a,active:e,onMouseDown:e=>{e.preventDefault()},onClick:e=>{let a=window.__polotnoQuill;if(a){let e=a.getSelection();a.formatText(e.index,e.length,n,!aE.currentFormat[n],"user"),t&&i();return}(a=PT({html:r.text})).setSelection(0,a.getLength(),"api"),a.format(n,!1);let l=a.root.innerHTML;PA(a),r.set({text:l}),t?i():o()}})),PI=R(({element:e,store:t})=>(0,b.jsx)(PL,{format:"bold",active:aE.currentFormat.bold||"bold"===e.fontWeight||"700"===e.fontWeight,globalActive:"bold"===e.fontWeight||"700"===e.fontWeight,element:e,disableGlobal:()=>e.set({fontWeight:"normal"}),enableGlobal:()=>e.set({fontWeight:"bold"}),icon:(0,b.jsx)(wu,{})})),PM=R(({element:e,store:t,elements:n,components:r})=>{let i=r?.TextBold||PI;return(0,b.jsxs)(bL,{children:[(0,b.jsx)(i,{element:e,store:t}),(0,b.jsx)(PL,{format:"italic",active:aE.currentFormat.italic||"italic"===e.fontStyle,globalActive:"italic"===e.fontStyle,element:e,disableGlobal:()=>e.set({fontStyle:"normal"}),enableGlobal:()=>e.set({fontStyle:"italic"}),icon:(0,b.jsx)(wd,{})}),(0,b.jsx)(PL,{format:"underline",active:aE.currentFormat.underline||e.textDecoration.indexOf("underline")>=0,globalActive:e.textDecoration.indexOf("underline")>=0,element:e,disableGlobal:()=>{let t=e.textDecoration.split(" ");t=t.filter(e=>"underline"!==e),e.set({textDecoration:t.join(" ")})},enableGlobal:()=>{let t=e.textDecoration.split(" ");t.push("underline"),e.set({textDecoration:t.join(" ")})},icon:(0,b.jsx)(wp,{})}),(0,b.jsx)(PL,{format:"strike",active:aE.currentFormat.strike||e.textDecoration.indexOf("line-through")>=0,globalActive:e.textDecoration.indexOf("line-through")>=0,element:e,disableGlobal:()=>{let t=e.textDecoration.split(" ");t=t.filter(e=>"line-through"!==e),e.set({textDecoration:t.join(" ")})},enableGlobal:()=>{let t=e.textDecoration.split(" ");t.push("line-through"),e.set({textDecoration:t.join(" ")})},icon:(0,b.jsx)(wf,{})}),(0,b.jsx)(mc,{minimal:!0,icon:"left"===e.align?(0,b.jsx)(wl,{}):"center"===e.align?(0,b.jsx)(wo,{}):"right"===e.align?(0,b.jsx)(ws,{}):(0,b.jsx)(wa,{}),onClick:()=>{let r=(Pj.indexOf(e.align)+1+Pj.length)%Pj.length,i=Pj[r];t.history.transaction(()=>{n.forEach(e=>{e.set({align:i})})})}}),iI.textVerticalResizeEnabled&&(0,b.jsx)(mc,{minimal:!0,icon:PR[e.verticalAlign],onClick:()=>{let n=(PN.indexOf(e.verticalAlign)+1+PN.length)%PN.length,r=PN[n];t.history.transaction(()=>{e.set({verticalAlign:r})})}}),(0,b.jsx)(mc,{minimal:!0,icon:"bullet"===aE.currentFormat.list?(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(PP),{style:{width:"20px",height:"20px"}})}):(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(PO),{style:{width:"20px",height:"20px"}})}),onMouseDown:e=>{e.preventDefault()},onClick:()=>{let t=window.__polotnoQuill,n=!t;t=t||PT({html:e.text}),n&&t.setSelection(0,t.getLength(),"api");let r=t.getFormat();r.list?"bullet"===r.list?t.format("list","ordered"):t.format("list",!1):t.format("list","bullet"),n&&(e.set({text:t.root.innerHTML}),PA(t))}})]})}),PD={TextFontFamily:Pp,TextFontSize:Pg,TextFontVariant:PM,TextFilters:OD,TextFill:R(({element:e,store:t})=>{let[n,r]=h(C).useState(null);return(0,b.jsx)(OT,{value:aE.currentFormat.color||e.fill,gradientEnabled:!0,onOpen:()=>{let e=window.__polotnoQuill;e&&r(e.getSelection())},onClose:()=>{let e=window.__polotnoQuill;e&&e.setSelection(n)},onChange:t=>{let r=window.__polotnoQuill,i=r?.getSelection()||n;if(!i){var o=e.text.replace(/style=".*?"/g,"");e.set({fill:t,text:o});return}let a=i?.length>=r?.getLength()-1;if(r&&!a&&i?.length)r.formatText(i.index,i.length,"color",t,"user");else{var o=e.text.replace(/style=".*?"/g,"");e.set({fill:t,text:o})}},store:t})}),TextSpacing:PC,TextDirection:R(({element:e})=>{let t="rtl"===e.dir?h(PE):h(Pk);return(0,b.jsx)(mc,{icon:(0,b.jsx)(t,{className:"bp5-icon",style:{fontSize:"20px"}}),minimal:!0,onClick:()=>{e.set({dir:"rtl"===e.dir?"ltr":"rtl"})}})}),TextAnimations:Pr,TextAiWrite:y2},Pz=R(({store:e,components:t})=>{let n=e.selectedElements,r=e.selectedElements[0],i=yz({type:"text",usedItems:["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextFilters",iI.animationsEnabled&&"TextAnimations","TextAiWrite"],components:t});return(0,b.jsx)(yF,{items:i,itemRender:i=>{if("TextBold"===i)return null;let o=t[i]||PD[i];return(0,b.jsx)(o,{element:r,elements:n,store:e,components:t},i)}})});var C=v("8NFma"),uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),PF=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"crop",ref:t},e),C.createElement("path",{d:n?"M280 20C280 8.954 288.954 0 300 0C311.046 0 320 8.954 320 20L320 80L380 80C391.046 80 400 88.954 400 100C400 111.046 391.046 120 380 120L120 120L120 380.00002C120 391.04574 111.0458 400.0000252612 100 400.0000262268C88.9544 400.0000271924 80 391.04576 80 380.00002L80 320L20 320C8.95434 320 0.0000271924 311.0458 0.0000262268 300C0.0000252612 288.9544 8.95434 280 20 280L80 280L80 100C80 88.954 88.9544 80 100 80L280 80L280 20zM300 320L160 320L160 280L280 280L280 160L320 160L320 300.0002C320 311.0458 311.046 320 300 320zM0 400H400V0H0V400z":"M220 20C220 8.954 228.954 0 240 0C251.046 0 260 8.954 260 20V60H300C311.046 60 320 68.954 320 80C320 91.046 311.046 100 300 100H100.0002V300C100.0002 311.0457 91.0458 319.999999034354 80.0002 320C68.9544 320.000000965646 60.0002 311.04568 60.0002 300L60.0002 260L20.0002 260C8.95444 260 0.0001154066 251.0456 0.000152588 240C0.0001516224 228.9542 8.95444 220 20.0002 220L60.0002 220L60.0002 80C60.0002 68.954 68.9544 60 80.0002 60H220V20zM240 260.0002L120.0002 260.0002V220.0002L220 220.0002L220 120H260L260 240.0002C260 251.0458 251.046 260.0002 240 260.0002z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});PF.defaultProps={size:g6.IconSize.STANDARD},PF.displayName="Blueprint5.Icon.Crop";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),PB=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"tick",ref:t},e),C.createElement("path",{d:n?"M340 320C334.4 320 329.4 317.8 325.8 314.2L140 128.2L74.2 194C70.6 197.8 65.6 200 60 200C49 200 40 191 40 180C40 174.4 42.2 169.4 45.8 165.8L125.8 85.8C129.4 82.2 134.4 80 140 80S150.6 82.2 154.2 85.8L354.2000000000001 285.8C357.8 289.4 360 294.4 360 300C360 311 351 320 340 320z":"M280 260C274.4000000000001 260 269.4000000000001 257.8 265.8 254.2L120 108.2L54.2 174.2C50.6 177.8 45.6 180 40 180C29 180 20 171 20 160C20 154.4 22.2 149.4 25.8 145.8L105.8 65.8C109.4 62.2 114.4 60 120 60S130.6 62.2 134.2 65.8L294.2000000000001 225.8C297.8 229.4 300 234.4 300 240C300 251 291 260 280 260z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});PB.defaultProps={size:g6.IconSize.STANDARD},PB.displayName="Blueprint5.Icon.Tick",v("8NFma");var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),PH=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"arrows-horizontal",ref:t},e),C.createElement("path",{d:n?"M394 214L294 314C290 318 286 320 280 320C268 320 260 312 260 300C260 294 262 290 266 286L332 220H68L134 286C138 290 140 294 140 300C140 312 132 320 120 320C114 320 110 318 106 314L6 214C2 210 0 206 0 200S2 190 6 186L106 86C110 82 114 80 120 80C132 80 140 88 140 100C140 106 138 110 134 114L68 180H332L266 114C262 110 260 106 260 100C260 88 268 80 280 80C286 80 290 82 294 86L394 186C398 190 400 194 400 200S398 210 394 214L394 214z":"M314 174L234 254C230 258 226 260 220 260C208 260 200 250 200 240C200 234 202 230 206 226L252.0000000000001 180H68L114 226C118 230 120 234 120 240C120 250 112 260 100 260C94 260 90 258 86 254L6 174C2 170 0 166 0 160S2 150 6 146L86 66C90 62 94 60 100 60C112 60 120 68 120 80C120 86 118 90 114 94L68 140H252L206 94C202 90 200 86 200 80C200 68 208 60 220 60C226 60 230 62 234 66L314 146C318 150 320 154 320 160S318 170 314 174L314 174z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});PH.defaultProps={size:g6.IconSize.STANDARD},PH.displayName="Blueprint5.Icon.ArrowsHorizontal";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),PV=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"arrows-vertical",ref:t},e),C.createElement("path",{d:n?"M300 140C294 140 290 138 286 134L220 68V332L286 266C290 262 294 260 300 260C312 260 320 268 320 280C320 286 318 290 314 294L214 394C210 398 206 400 200 400S190 398 186 394L86 294C82 290 80 286 80 280C80 268 88 260 100 260C106 260 110 262 114 266L180 332V68.0000000000001L114 134.0000000000001C110 138 106 140 100 140C88 140 80 132 80 120C80 114 82 110 86 106L186 6C190 2 194 0 200 0S210 2 214 6L314 106C318 110 320 114 320 120C320 130 312 140 300 140L300 140z":"M240 120C234 120 230 118 226 114L180 68V252L226 206C230 202 234 200 240 200C252 200 260 208 260 220C260 226 258 230 254 234L174 314C170 318 166 320 160 320S150 318 146 314L66 234C62 230 60 226 60 220C60 208 70 200 80 200C86 200 90 202 94 206L140 252V68L94 114C90 118 86 120 80 120C70 120 60 112 60 100C60 94 62 90 66 86L146 6C150 2 154 0 160 0S170 2 174 6L254 86C258 90 260 94 260 100C260 112 252 120 240 120L240 120z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});PV.defaultProps={size:g6.IconSize.STANDARD},PV.displayName="Blueprint5.Icon.ArrowsVertical";var PU=({element:e,elements:t})=>(0,b.jsx)(ym,{content:(0,b.jsxs)(yG,{children:[(0,b.jsx)(yK,{shouldDismissPopover:!1,icon:(0,b.jsx)(PH,{}),text:uM("toolbar.flipHorizontally"),onClick:()=>{t.forEach(e=>{e.set({flipX:!e.flipX})})}}),(0,b.jsx)(yK,{shouldDismissPopover:!1,text:uM("toolbar.flipVertically"),icon:(0,b.jsx)(PV,{}),onClick:()=>{t.forEach(e=>{e.set({flipY:!e.flipY})})}})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{text:uM("toolbar.flip"),minimal:!0})}),C=v("8NFma");let PG=async e=>{let t=await fetch(lM(),{method:"POST",body:JSON.stringify({url:e})});return 200!==t.status?(alert(uM("error.removeBackground")),e):(await t.json()).url},Pq=R(({isOpen:e,onClose:t,element:n})=>{let[r,i]=h(C).useState(n.src);h(C).useEffect(()=>{i(n.src)},[n.src]);let[o,a]=h(C).useState(!1),l=async()=>{a(!0);try{i(await PG(n.src))}catch(e){console.error(e)}a(!1)},s=r!==n.src;return(0,b.jsxs)(yU,{onClose:t,title:uM("toolbar.removeBackgroundTitle"),isOpen:e,style:{width:"80%",maxWidth:"700px"},children:[(0,b.jsx)("div",{className:dt.DIALOG_BODY,children:(0,b.jsx)("img",{src:r,style:{width:"100%",maxHeight:"400px",objectFit:"contain"}})}),(0,b.jsx)("div",{className:dt.DIALOG_FOOTER,style:{position:"relative"},children:(0,b.jsxs)("div",{className:dt.DIALOG_FOOTER_ACTIONS,children:[!s&&(0,b.jsx)(mc,{onClick:l,loading:o,children:uM("toolbar.removeBackground")}),s&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(mc,{onClick:()=>{i(n.src),t()},loading:o,children:uM("toolbar.cancelRemoveBackground")}),(0,b.jsx)(mc,{onClick:()=>{n.set({src:r}),t()},loading:o,intent:"primary",children:uM("toolbar.confirmRemoveBackground")})]})]})})]})}),PW=R(({element:e,store:t,elements:n})=>e.contentEditable?e.clipSrc?(0,b.jsx)(mc,{text:uM("toolbar.removeClip"),minimal:!0,onClickCapture:e=>{n.forEach(e=>{e.set({clipSrc:""})})}}):(0,b.jsx)(mc,{minimal:!0,text:uM("toolbar.clip"),onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("image-clip")}}):null),P$=R(({element:e,store:t})=>!e.contentEditable||e.stretchEnabled?null:(0,b.jsx)(yw,{content:uM("toolbar.crop"),position:"bottom",children:(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(PF,{}),onClickCapture:t=>{t.stopPropagation(),e.toggleCropMode(!0)}})}));R(({element:e,store:t})=>e.clipSrc?(0,b.jsx)(mc,{text:uM("toolbar.removeClip"),minimal:!0,onClickCapture:t=>{e.set({clipSrc:""})}}):null);let PK={ImageFlip:PU,ImageFilters:OD,ImageFitToBackground:({element:e})=>(0,b.jsx)(mc,{text:uM("toolbar.fitToBackground"),minimal:!0,onClick:async()=>{let{page:t}=e,n=t.computedWidth+2*t.bleed,r=t.computedHeight+2*t.bleed,i=await l6(e.src),o=e.stretchEnabled?l7({width:n,height:r},i):{cropX:0,cropY:0,cropWidth:1,cropHeight:1};e.set({x:-t.bleed,y:-t.bleed,width:n,height:r,rotation:0,...o})}}),ImageCrop:P$,ImageClip:PW,ImageRemoveBackground:({element:e})=>{let[t,n]=h(C).useState(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(mc,{text:uM("toolbar.removeBackground"),minimal:!0,onClick:e=>{n(!0)}}),(0,b.jsx)(Pq,{isOpen:t,onClose:()=>{n(!1)},element:e})]})},ImageAnimations:Pr},PY=R(({store:e,components:t})=>{let n=e.selectedElements[0],r=n._cropModeEnabled,i=h(C).useRef({});h(C).useEffect(()=>{r&&(i.current={x:n.x,y:n.y,width:n.width,height:n.height,cropX:n.cropX,cropY:n.cropY,cropWidth:n.cropWidth,cropHeight:n.cropHeight})},[r]);let o=yz({type:"image",usedItems:["ImageFlip","ImageFilters","ImageFitToBackground","ImageClip","ImageCrop",iI.animationsEnabled&&"ImageAnimations",iI.removeBackgroundEnabled&&"ImageRemoveBackground"],components:t});return(0,b.jsxs)(b.Fragment,{children:[!r&&(0,b.jsx)(yF,{items:o,itemRender:r=>{let i=t[r]||PK[r];return(0,b.jsx)(i,{element:n,store:e,elements:e.selectedElements},r)}}),r&&(0,b.jsxs)(yj.Group,{children:[(0,b.jsx)(mc,{text:uM("toolbar.cropDone"),minimal:!0,icon:(0,b.jsx)(PB,{}),onClickCapture:e=>{n.toggleCropMode(!1)}}),(0,b.jsx)(mc,{text:uM("toolbar.cropCancel"),minimal:!0,icon:(0,b.jsx)(Oz,{}),onClickCapture:e=>{n.set({...i.current}),n.toggleCropMode(!1)}})]})]})});v("8NFma");let PX=(e,t)=>Array.from(e.keys()).find(e=>or(e,t)),PZ=(e,t)=>{let n=PX(e,t);return e.get(n||"")||t},PQ={SvgFlip:PU,SvgFilters:OD,SvgColors:R(({element:e,elements:t,store:n})=>{let r=oo(e.src);return(0,b.jsx)(b.Fragment,{children:!e.maskSrc&&r.slice(0,5).map(t=>(0,b.jsx)(OT,{value:PZ(e.colorsReplace,t),style:{marginLeft:"5px"},onChange:n=>{let r=PX(e.colorsReplace,t)||t;e.replaceColor(r,n)},store:n,gradientEnabled:!0},t))})}),SvgAnimations:Pr},PJ=R(({store:e,hideSvgEffects:t,components:n})=>{let r=e.selectedElements,i=yz({type:"svg",usedItems:["SvgFlip",!t&&"SvgFilters","SvgColors",iI.animationsEnabled&&"SvgAnimations"].filter(e=>!!e),components:n});return(0,b.jsx)(yF,{items:i,itemRender:t=>{let i=n[t]||PQ[t];return(0,b.jsx)(i,{elements:r,element:r[0],store:e},t)}})});v("8NFma");var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),P0=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"settings",ref:t},e),C.createElement("path",{d:n?"M80 380C80 391 71 400 60 400S40 391 40 380V280H80V380zM40 20C40 9 49 0 60 0S80 9 80 20V140H40V20zM220 380C220 391 211 400 200 400S180 391 180 380V220H220V380zM360 380C360 391 351 400 340 400S320 391 320 380V320H360V380zM180 20C180 9 189 0 200 0S220 9 220 20V80H180V20zM360 300H320C309 300 300 291 300 280V220C300 209 309 200 320 200H360C371 200 380 209 380 220V280C380 291 371 300 360 300zM320 20C320 9 329 0 340 0S360 9 360 20V180H320V20zM80 260H40C29 260 20 251 20 240V180C20 169 29 160 40 160H80C91 160 100 169 100 180V240C100 251 91 260 80 260zM220 200H180C169 200 160 191 160 180V120C160 109 169 100 180 100H220C231 100 240 109 240 120V180C240 191 231 200 220 200z":"M60 300C60 311 51 320 40 320S20 311 20 300V240H60V300zM60 220H20C9 220 0 211 0 200V160C0 149 9 140 20 140H60C71 140 80 149 80 160V200C80 211 71 220 60 220zM300 300C300 311 291 320 280 320S260 311 260 300V260H300V300zM180 300C180 311 171 320 160 320S140 311 140 300V180H180V300zM20 20C20 9 29 0 40 0S60 9 60 20V120H20V20zM300 240H260C249 240 240 231 240 220V180C240 169 249 160 260 160H300C311 160 320 169 320 180V220C320 231 311 240 300 240zM260 20C260 9 269 0 280 0S300 9 300 20V140H260V20zM180 160H140C129 160 120 151 120 140V100C120 89 129 80 140 80H180C191 80 200 89 200 100V140C200 151 191 160 180 160zM140 20C140 9 149 0 160 0S180 9 180 20V60H140V20z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});P0.defaultProps={size:g6.IconSize.STANDARD},P0.displayName="Blueprint5.Icon.Settings";let P1=R(({store:e,elements:t})=>{let n=n=>{e.history.transaction(()=>{t.forEach(e=>{e.set(n)})})},r=n=>{e.history.transaction(()=>{t.forEach(e=>{let{middleLeft:t,middleRight:r}=aq(e),{x:i,y:o,rotation:a}=aW(t,r,n);e.set({x:i,y:o,rotation:a,height:n})})})};return(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{style:{padding:"15px",paddingTop:"15px",width:"230px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.lineSize")}),(0,b.jsx)("div",{children:(0,b.jsx)(OL,{value:t[0].height,onValueChange:e=>{r(e)},style:{width:"50px"},min:1,max:100,buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:t[0].height,onChange:e=>{r(e)},min:1,max:100,labelRenderer:!1}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px",paddingTop:"15px"},children:[(0,b.jsx)(mc,{onClick:()=>{n({dash:[]})},active:0===t[0].dash.length,children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{n({dash:[4,1]})},active:4===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{n({dash:[2,1]})},active:2===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{n({dash:[1,1]})},active:1===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(P0,{}),minimal:!0})})}),P2=R(({elements:e,store:t})=>(0,b.jsx)(OT,{value:e[0].color,style:{marginRight:"5px"},gradientEnabled:!1,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({color:n})})}),store:t})),P3=(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 16 8"})})}),P4=(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 8 3 L 1 8 L 8 13",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),P8=(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 8 3 L 1 8 L 8 13 Z",fill:"currentColor",strokeLinejoin:"round",strokeLinecap:"round"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),P6=(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 3 L 1 13",strokeLinejoin:"round",strokeLinecap:"round"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),P5={"":P3,arrow:P4,triangle:P8,bar:P6,square:(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 4 L 9 4 L 9 12 L 1 12 Z",fill:"currentColor",strokeLinejoin:"round",strokeLinecap:"round"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),circle:(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("circle",{cx:"4",cy:"8",r:"4",fill:"currentColor"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})})},P9=({type:e,active:t,onClick:n,flipped:r})=>{let i=P5[e];return(0,b.jsx)(mc,{icon:r?(0,b.jsx)("span",{style:{transform:"scaleX(-1)"},children:i}):i,minimal:!0,onClick:n,active:t})},P7=R(({elements:e,store:t,property:n})=>{let r="endHead"===n,i=P5[e[0][n]],o=r?(0,b.jsx)("span",{style:{transform:"scaleX(-1)"},children:i}):i,a=r=>{t.history.transaction(()=>{e.forEach(e=>{e.set({[n]:r})})})};return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{style:{width:"150px",padding:"10px"},children:[(0,b.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["","arrow","triangle"].map(t=>(0,b.jsx)(P9,{type:t,active:e[0][n]===t,onClick:()=>{a(t)},flipped:r},t))}),(0,b.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["bar","square","circle"].map(t=>(0,b.jsx)(P9,{type:t,active:e[0][n]===t,onClick:()=>{a(t)},flipped:r},t))})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:o,minimal:!0})})})}),Te={LineSettings:P1,LineColor:P2,LineHeads:R(({elements:e,store:t})=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P7,{elements:e,store:t,property:"startHead"}),(0,b.jsx)(P7,{elements:e,store:t,property:"endHead"})]})),LineAnimations:Pr},Tt=R(({store:e,components:t})=>{let n=e.selectedElements[0],r=yz({type:"line",usedItems:["LineColor","LineSettings","LineHeads",iI.animationsEnabled&&"LineAnimations"].filter(e=>!!e),components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Te[r];return(0,b.jsx)(i,{element:n,store:e,elements:e.selectedElements},r)}})});var C=v("8NFma"),uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),Tn=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"cut",ref:t},e),C.createElement("path",{d:n?"M320 360C320 360 334.4 385.6 320 400L214.2 275L239.8 244.2L320 360zM321.6 160C310.6 160 300.2 157.6 290.8 153.6L86.2 400C72.2 385.6 86.2 360 86.2 360L175.2 228.8L111.4 153.4C101.8 157.6 91.2 160 80 160C35.8 160 0 124.2000000000001 0 80C0 35.8 35.8 0 80 0S160 35.8 160 80C160 93 156.6 105.2 151 116L201.8 189.4L251.6 116C246.2 105.2000000000001 242.8 93 242.8 80C242.8 35.8 278 0 321.2000000000001 0C364.6000000000001 0 399.6000000000001 35.8 399.6000000000001 80C400 124.2000000000001 364.8 160 321.6 160zM80 40C58 40 40 58 40 80C40 102 58 120 80 120S120 102 120 80C120 58 102 40 80 40zM321.6 40C300 40 282.4 58 282.4 80C282.4 102 300 120 321.6 120C343.2 120 360.8 102 360.8 80C360.8 58 343.2 40 321.6 40z":"M260 280C260 280 274.2000000000001 305.8 260 320L173.2 218.6L194.2 192.2L260 280zM261.4 120C253 120 245 118.2 237.8 114.8L66.2 320C52.4 305.8 66.2 280 66.2 280L139.8 179.6L84.4 114.8C76.8 118.2 68.6 120 60 120C26.8 120 0 93.2 0 60S26.8 0 60 0S120 26.8 120 60C120 69.2 117.8 77.8 114.2 85.4L162 149.2L208.6 85.4C205 77.6 202.8 69 202.8 60.0000000000001C202.8 26.8 229.0000000000001 1e-13 261.4 1e-13C293.8 1e-13 320 26.8 320 60.0000000000001S293.8 120 261.4 120zM60 40C49 40 40 49 40 60C40 71 49 80 60 80S80 71 80 60C80 49 71 40 60 40zM261.4 40C250.6 40 241.8 49 241.8 60C241.8 71 250.6 80 261.4 80S281 71 281 60C281 49 272.2 40 261.4 40z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});Tn.defaultProps={size:g6.IconSize.STANDARD},Tn.displayName="Blueprint5.Icon.Cut";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),Tr=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"volume-up",ref:t},e),C.createElement("path",{d:n?"M180 331.4C174.4 331.4 169.4 329.2 165.8 325.6L111.8 271.4H20C9 271.4 0 262.4 0 251.4V131.4C0 120.4 9 111.4 20 111.4H111.8L166 57.2C169.6 53.6 174.6 51.4 180.2000000000001 51.4C191.2000000000001 51.4 200.2000000000001 60.4 200.2000000000001 71.4V311.4C200 322.4 191 331.4 180 331.4zM346.2 362.6L313.8 338.6C342.8 296.8 360 246.2 360 191.4C360 136.6 342.8 86 313.8 44L346.2 20C380 68.6 400 127.6 400 191.4C400 255 380 314 346.2 362.6zM278.4 312.8L246.4 289.2C267.4 262.2000000000001 280 228.2 280 191.4C280 154.6 267.4 120.6 246.4 93.6L278.4 70C304.2000000000001 103.6 320 145.6 320 191.4C320 237 304.4000000000001 279 278.4 312.8z":"M140 282.8C134.4 282.8 129.4 280.6 125.8 277L71.8 222.8H20C9 222.8 0 213.8 0 202.8V122.8C0 111.8 9 102.8 20 102.8H71.8L126 48.6C129.6 45 134.6 42.8 140.2 42.8C151.2 42.8 160.2 51.8 160.2 62.8V262.8C160 273.8 151 282.8 140 282.8zM274.8 302.6L243.2 278.2C266.2 245.6 280 205.8 280 162.8C280 119.6 266.2 79.8 243 47.2L274.6 22.8C303 62.2 319.8 110.4 319.8 162.8C320 215 303 263.2 274.8 302.6zM179.6 229.6C192.4 210.4 200 187.4 200 162.8S192.4 115 179.6 96L211.4 71.6C229.4 97.4 240 128.8 240 162.8C240 196.8 229.4 228.2 211.4 254L179.6 229.6z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});Tr.defaultProps={size:g6.IconSize.STANDARD},Tr.displayName="Blueprint5.Icon.VolumeUp";let Ti=R(({store:e,components:t,element:n})=>{let r=h(C).useRef(null),[i,o]=h(C).useState([]);h(C).useEffect(()=>{o([])},[n.src]);let a=async()=>{if(!n.src||i.length)return;let{width:e,height:t}=await sn(n.src),{src:a}=n,l=r.current.offsetHeight,s=Math.ceil(r.current.offsetWidth/(e/t*l)),u=await sr(a),c=document.createElement("video");c.crossOrigin="anonymous",c.src=a;let d=document.createElement("canvas");d.width=480;try{await new Promise((e,t)=>{c.addEventListener("loadeddata",()=>{let t=c.videoWidth/c.videoHeight;d.height=480/t,e()}),c.addEventListener("error",t)}),o([]);for(let e=0;e<s;e++){let t=e*u/s,n=await so(c,d,t);o(e=>e.concat(n))}}catch(e){console.error("Error generating previews:",e)}},l=(e,t)=>{e.preventDefault();let i=e=>{e.preventDefault();let{clientX:i}=e,{left:o,width:a}=r.current.getBoundingClientRect(),{src:l}=n,s=(i-o)/a;"start"===t?n.set({startTime:Math.min(n.endTime,Math.max(0,s))}):"end"===t&&n.set({endTime:Math.min(1,Math.max(n.startTime,s))})};window.addEventListener("mousemove",i),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",i)})};return(0,b.jsx)(ym,{position:"bottom",onOpened:a,content:(0,b.jsx)(yj,{style:{boxShadow:"none",backgroundColor:"transparent",width:"calc(100vw - 300px)"},children:(0,b.jsxs)(yT,{children:[(0,b.jsx)(bq,{style:{width:"80px"},value:parseFloat((n.duration*(n.endTime-n.startTime)/1e3).toFixed(2)),minorStepSize:.01,stepSize:.1,buttonPosition:"none",readOnly:!0}),(0,b.jsxs)("div",{style:{width:"calc(100vw - 420px)",height:"30px",display:"flex",position:"relative",overflow:"hidden",marginLeft:"10px"},ref:r,children:[i.map((e,t)=>(0,b.jsx)("img",{src:e,style:{width:"auto",height:"100%",objectFit:"cover"}},t)),(0,b.jsx)("div",{style:{position:"absolute",top:"0",left:0,width:100*n.startTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),(0,b.jsx)("div",{style:{position:"absolute",top:"0",right:"0%",width:100-100*n.endTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),(0,b.jsx)("div",{style:{position:"absolute",top:"0",left:100*n.startTime+"%",width:"10px",height:"30px",borderRadius:"0px",backgroundColor:"rgb(0, 161, 255, 0.9)",cursor:"ew-resize"},onMouseDown:e=>{l(e,"start")}}),(0,b.jsx)("div",{style:{position:"absolute",top:"0",right:100-100*n.endTime+"%",width:"10px",height:"30px",borderRadius:"0px",backgroundColor:"rgb(0, 161, 255, 0.9)",cursor:"ew-resize"},onMouseDown:e=>{l(e,"end")}})]})]})}),children:(0,b.jsx)(mc,{icon:(0,b.jsx)(Tn,{}),minimal:!0,children:"Trim"})})}),To=(e,t,n)=>Math.max(t,Math.min(n,e)),Ta={VideoTrim:Ti,VideoAnimations:Pr,VideoVolume:R(({element:e})=>{let t=Math.round(100*e.volume),n=t=>{e.set({volume:t/100})};return(0,b.jsx)(ym,{position:"bottom",content:(0,b.jsx)("div",{style:{padding:"10px",width:"250px"},children:(0,b.jsxs)("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[(0,b.jsx)("div",{style:{paddingTop:"7px",paddingLeft:"10px",width:"calc(100% - 80px)"},children:(0,b.jsx)(b2,{value:t,onChange:e=>{n(e)},min:0,max:100,labelStepSize:50,showTrackFill:!1,labelRenderer:!1})}),(0,b.jsx)(bq,{value:t,onValueChange:e=>{n(To(e,0,100))},buttonPosition:"none",style:{width:"50px",padding:"0 5px",marginLeft:"10px"},min:0,max:100})]})}),children:(0,b.jsx)(mc,{icon:(0,b.jsx)(Tr,{}),minimal:!0})})}),VideoClip:R(({element:e,store:t})=>e.contentEditable?e.clipSrc?(0,b.jsx)(mc,{text:uM("toolbar.removeClip"),minimal:!0,onClickCapture:t=>{e.set({clipSrc:""})}}):(0,b.jsx)(mc,{minimal:!0,text:uM("toolbar.clip"),onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("image-clip")}}):null)},Tl=R(({store:e,components:t})=>{let n=e.selectedElements,r=yz({type:"video",usedItems:["VideoTrim","VideoVolume","VideoClip",iI.animationsEnabled&&"VideoAnimations"].filter(e=>!!e),components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Ta[r];return(0,b.jsx)(i,{elements:n,element:n[0],store:e},r)}})});v("8NFma");var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),Ts=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"disable",ref:t},e),C.createElement("path",{d:n?"M200 400C89.6 400 0 310.4 0 200C0 89.6 89.6 0 200 0S400 89.6 400 200C400 310.4 310.4 400 200 400zM40 200C40 288.4 111.6 360 200 360C237 360 271 347.4 298 326.2L73.8 102C52.6 129 40 163 40 200zM200 40C163 40 129 52.6 102 73.8L326.2 298C347.4000000000001 271 360 237 360 200C360 111.6 288.4 40 200 40z":"M159.8 320.2C71.4 320.2 -0.2 248.6 -0.2 160.2S71.4 0.2 159.8 0.2S319.8 71.8 319.8 160.2S248.2 320.2 159.8 320.2zM39.8 160.2C39.8 226.4 93.6 280.2 159.8 280.2C185.8 280.2 209.6 271.8 229.2 257.8L62.2 90.8C48.2 110.4 39.8 134.2 39.8 160.2zM159.8 40.2C133.8 40.2 110 48.6 90.4 62.6L257.4 229.6C271.4 210 279.8 186.2 279.8 160.2C279.8 93.8 226.2 40.2 159.8 40.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});Ts.defaultProps={size:g6.IconSize.STANDARD},Ts.displayName="Blueprint5.Icon.Disable";var Tu={};Tu=function(e){return EM({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor"},child:[{tag:"path",attr:{d:"M0 0h20v5H0V0zm0 7h20v4H0V7zm0 6h20v3H0v-3zm0 5h20v2H0v-2z"}}]})(e)};let Tc=R(({elements:e,store:t})=>(0,b.jsx)(OT,{value:e[0].fill,style:{marginRight:"5px"},gradientEnabled:!0,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({fill:n})})}),store:t})),Td=R(({store:e,elements:t,element:n})=>{let r=n=>{e.history.transaction(()=>{t.forEach(e=>{e.set(n)})})};return(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{style:{padding:"15px",paddingTop:"15px",width:"270px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"15px"},children:[(0,b.jsx)(mc,{onClick:()=>{r({strokeWidth:0})},active:0===t[0].strokeWidth,style:{width:"44px",height:"34px"},icon:(0,b.jsx)(Ts,{size:20})}),(0,b.jsx)(mc,{onClick:()=>{r({dash:[],strokeWidth:t[0].strokeWidth||10})},active:t[0].strokeWidth&&0===t[0].dash.length,children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{r({dash:[4,1],strokeWidth:t[0].strokeWidth||10})},active:t[0].strokeWidth&&4===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{r({dash:[2,1],strokeWidth:t[0].strokeWidth||10})},active:t[0].strokeWidth&&2===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{r({dash:[1,1],strokeWidth:t[0].strokeWidth||10})},active:t[0].strokeWidth&&1===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.strokeWidth")}),(0,b.jsx)("div",{children:(0,b.jsx)(OL,{value:t[0].strokeWidth,onValueChange:e=>{r({strokeWidth:e})},style:{width:"50px"},min:0,max:Math.round(Math.min(n.width,n.height)/2),buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:t[0].strokeWidth,onChange:e=>{r({strokeWidth:e})},min:0,max:Math.round(Math.min(n.width,n.height)/2),labelRenderer:!1}),"rect"===n.subType&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"15px",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.cornerRadius")}),(0,b.jsx)("div",{children:(0,b.jsx)(OL,{value:t[0].cornerRadius,onValueChange:e=>{r({cornerRadius:e})},style:{width:"50px"},min:0,max:Math.round(Math.max(n.width,n.height)/2),buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:t[0].cornerRadius,onChange:e=>{r({cornerRadius:e})},min:0,max:Math.round(Math.max(n.width,n.height)/2),labelRenderer:!1})]})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(h(Tu),{}),minimal:!0})})}),Th={FigureFill:Tc,FigureStroke:R(({elements:e,store:t})=>e.find(e=>e.strokeWidth)?(0,b.jsx)(OT,{value:e[0].stroke,style:{marginRight:"5px"},gradientEnabled:!1,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({stroke:n})})}),store:t}):null),FigureSettings:Td,FigureAnimations:Pr,FigureFilters:OM},Tf=R(({store:e,components:t})=>{let n=e.selectedElements[0],r=yz({type:"figure",usedItems:["FigureFill","FigureStroke","FigureSettings","FigureFilters",iI.animationsEnabled&&"FigureAnimations"].filter(e=>!!e),components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Th[r];return(0,b.jsx)(i,{element:n,store:e,elements:e.selectedElements},r)}})});v("8NFma");let Tp={GifFilters:OD,GifAnimations:Pr},Tg=R(({store:e,components:t})=>{let n=e.selectedElements,r=yz({type:"gif",usedItems:["GifFilters",iI.animationsEnabled&&"GifAnimations"].filter(e=>!!e),components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Tp[r];return(0,b.jsx)(i,{elements:n,element:n[0],store:e},r)}})});v("8NFma");let Tm={ManyAnimations:Pr},Tv=R(({store:e,components:t})=>{let n=e.selectedElements,r=yz({type:"many",usedItems:[iI.animationsEnabled&&"ManyAnimations"],components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Tm[r];return(0,b.jsx)(i,{elements:n,element:n[0],store:e},r)}})});var C=v("8NFma"),uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),Ty=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"time",ref:t},e),C.createElement("path",{d:n?"M220 208.2V320C220 331 211 340 200 340S180 331 180 320V200C180 194.4 182.2 189.4 185.8 185.8L245.8 125.8C249.4 122.2 254.4 120 260 120C271 120 280 129 280 140C280 145.6 277.8 150.6 274.2000000000001 154.2L220 208.2zM200 400C89.6 400 0 310.4 0 200C0 89.6 89.6 0 200 0S400 89.6 400 200C400 310.4 310.4 400 200 400zM200 40C111.6 40 40 111.6 40 200S111.6 360 200 360S360 288.4 360 200S288.4 40 200 40z":"M160 320C71.6 320 0 248.4 0 160S71.6 0 160 0S320 71.6 320 160S248.4 320 160 320zM160 40C93.8 40 40 93.8 40 160S93.8 280 160 280S280 226.2 280 160S226.2 40 160 40zM180 168.2V240C180 251 171 260 160 260S140 251 140 240V160C140 154.4 142.2 149.4 145.8 145.8L185.8 105.8C189.4 102.2 194.4 100 200 100C211 100 220 109 220 120C220 125.6 217.8 130.6 214.2 134.2L180 168.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});Ty.defaultProps={size:g6.IconSize.STANDARD},Ty.displayName="Blueprint5.Icon.Time";let Tb=({value:e,onValueChange:t,...n})=>{let[r,i]=h(C).useState(e.toString());return h(C).useEffect(()=>{i(e.toString())},[e]),(0,b.jsx)(bq,{value:r,onValueChange:(e,n)=>{i(n),Number.isNaN(e)||t(e)},...n})},Tx=R(({store:e})=>e.activePage?(0,b.jsx)(OT,{value:e.activePage.background||"white",onChange:t=>{e.activePage.set({background:t})},store:e,gradientEnabled:!0}):null),Tw={PageDuration:R(({store:e})=>{if(!e.activePage)return null;let{duration:t}=e.activePage;return(0,b.jsx)(ym,{position:"bottom",content:(0,b.jsxs)("div",{style:{padding:"15px",paddingTop:"15px",width:"230px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.duration")}),(0,b.jsx)("div",{children:(0,b.jsx)(Tb,{value:t/1e3,onValueChange:t=>{e.activePage.set({duration:1e3*t})},style:{width:"50px"},min:0,buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:Math.min(t/1e3,50),onChange:t=>{e.activePage.set({duration:1e3*t})},min:0,max:50,showTrackFill:!1,labelRenderer:!1})]}),children:(0,b.jsxs)(mc,{icon:(0,b.jsx)(Ty,{}),minimal:!0,children:[(e.activePage.duration/1e3).toFixed(1),"s"]})})}),PageBackground:Tx},TC=R(({store:e,components:t})=>{let n=yz({type:"page",usedItems:["PageBackground",iI.animationsEnabled&&"PageDuration"],components:t});return(0,b.jsx)(yF,{items:n,itemRender:n=>{let r=t[n]||Tw[n];return(0,b.jsx)(r,{store:e},n)}})});var C=v("8NFma"),uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),T_=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"document",ref:t},e),C.createElement("path",{d:n?"M239.6 400H79.6C68.6 400 59.6 391 59.6 380V20C59.6 9 68.6 0 79.6 0H339.6C350.6 0 359.6 9 359.6 20V280L239.6 400zM319.6 40H99.6V360H219.6V260H319.6V40z":"M180 320H60C49 320 40 311 40 300V20C40 9 49 0 60 0H260C271 0 280 9 280 20V220L180 320zM240 40H80V280H160V200H240V40z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});T_.defaultProps={size:g6.IconSize.STANDARD},T_.displayName="Blueprint5.Icon.Document";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),TS=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"import",ref:t},e),C.createElement("path",{d:n?"M185.8 85.8C189.4 82.2 194.4 80 200 80S210.6 82.2 214.2 85.8L314.2000000000001 185.8C317.8 189.4 320 194.4 320 200C320 211 311 220 300 220C294.4000000000001 220 289.4000000000001 217.8 285.8 214.2L220 148.2V380C220 391 211 400 200 400S180 391 180 380V148.2L114.2 214.2C110.6 217.8 105.6 220 100 220C89 220 80 211 80 200C80 194.4 82.2 189.4 85.8 185.8L185.8 85.8zM380 120C369 120 360 111 360 100V40H40V100C40 111 31 120 20 120S0 111 0 100V20C0 9 9 0 20 0H380C391 0 400 9 400 20V100C400 111 391 120 380 120z":"M145.8 85.8C149.4 82.2 154.4 80 160 80S170.6 82.2 174.2 85.8L254.2 165.8C257.8 169.4 260 174.4 260 180C260 191 251 200 240 200C234.4 200 229.4 197.8 225.8 194.2L180 148.2V300C180 311 171 320 160 320S140 311 140 300V148.2L94.2 194.2C90.6 197.8 85.6 200 80 200C69 200 60 191 60 180C60 174.4 62.2 169.4 65.8 165.8L145.8 85.8zM300 100C289 100 280 91 280 80V40H40V80C40 91 31 100 20 100S0 91 0 80V20C0 9 9 0 20 0H300C311 0 320 9 320 20V80C320 91 311 100 300 100z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});TS.defaultProps={size:g6.IconSize.STANDARD},TS.displayName="Blueprint5.Icon.Import";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),TE=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"media",ref:t},e),C.createElement("path",{d:n?"M300 220C322 220 340 238 340 260C340 282 322 300 300 300S260 282 260 260C260 238 278 220 300 220zM380 360H20C9 360 0 351 0 340V60C0 49 9 40 20 40H380C391 40 400 49 400 60V340C400 351 391 360 380 360zM360 100L240 200L200 160L120 260L40 100V320H360V100z":"M239.8 180.2C250.8 180.2 259.8 189.2 259.8 200.2S250.8 220.2 239.8 220.2S219.8 211.2 219.8 200.2S228.8 180.2 239.8 180.2zM299.8 280.2H19.8C8.8 280.2 -0.2 271.2 -0.2 260.2V60.2C-0.2 49.2 8.8 40.2 19.8 40.2H299.8C310.8 40.2 319.8 49.2 319.8 60.2V260.2C319.8 271.2 310.8 280.2 299.8 280.2zM279.8 100.2L179.8 160.2L159.8 120.2L99.8 200.2L39.8 100.2V240.2H279.8V100.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});TE.defaultProps={size:g6.IconSize.STANDARD},TE.displayName="Blueprint5.Icon.Media";let Tk=R(({store:e})=>{let[t,n]=h(C).useState(!1);return(0,b.jsx)(ym,{content:(0,b.jsxs)(yG,{children:[(0,b.jsx)(yK,{icon:(0,b.jsx)(TE,{}),text:uM("toolbar.saveAsImage"),onClick:async()=>{e.pages.forEach(t=>{e.saveAsImage({pageId:t.id})})}}),(0,b.jsx)(yK,{icon:(0,b.jsx)(T_,{}),text:uM("toolbar.saveAsPDF"),onClick:async()=>{n(!0),await e.saveAsPDF(),n(!1)}})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(TS,{}),text:uM("toolbar.download"),minimal:!0,loading:t})})});v("8NFma");let TO=R(({store:e})=>{let{lock:t,locked:n,disabled:r}=bO({store:e}),i=n?(0,b.jsx)(bm,{}):(0,b.jsx)(bv,{}),o=n?uM("toolbar.lockedDescription"):uM("toolbar.unlockedDescription");return(0,b.jsx)(yw,{content:o,disabled:r,position:"bottom",children:(0,b.jsx)(mc,{minimal:!0,disabled:r,icon:i,onClick:()=>t()})})});v("8NFma");var TP={};TP=function(e){return EM({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.66 8L12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8zM6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14H6z"}}]})(e)};let TT=R(({store:e})=>{let t=e.selectedShapes.length>0,n=t=>{t=Math.max(0,Math.min(t,100)),e.selectedShapes.forEach(e=>{e.set({opacity:t/100})})},r=Math.round(e.selectedShapes[0]?.opacity*100);return(0,b.jsx)(ym,{disabled:!t,minimal:!1,content:(0,b.jsxs)("div",{style:{padding:"10px 20px"},children:[(0,b.jsx)("div",{style:{textAlign:"center"},children:uM("toolbar.transparency")}),(0,b.jsxs)("div",{style:{display:"flex"},children:[(0,b.jsx)("div",{style:{paddingTop:"8px",paddingRight:"20px"},children:(0,b.jsx)(b2,{value:r,labelRenderer:!1,onChange:n,min:0,max:100})}),(0,b.jsx)(bq,{value:r,onValueChange:n,min:0,max:100,buttonPosition:"none",style:{width:"50px"},selectAllOnFocus:!0})]})]}),position:da.BOTTOM,children:(0,b.jsx)(yw,{content:uM("toolbar.transparency"),disabled:!t,position:da.BOTTOM,children:(0,b.jsx)(mc,{minimal:!0,disabled:!t,children:(0,b.jsx)(h(TP),{className:"bp5-icon",style:{fontSize:"20px"}})})})})});v("8NFma");var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),TA=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"cog",ref:t},e),C.createElement("path",{d:n?"M380 240H333.8C331 249.2 327.2000000000001 257.8 322.6 266L356.6 300C364.4000000000001 307.8 364.4000000000001 320.4 356.6 328.2L328.4000000000001 356.4C320.6 364.2 308.0000000000001 364.2 300.2000000000001 356.4L266.2000000000001 322.4C258.0000000000001 326.8 249.4000000000001 330.6 240.2000000000001 333.4V380C240.2000000000001 391 231.2000000000001 400 220.2000000000001 400H180C169 400 160 391 160 380V333.4C150.4 330.6 141.2 326.6 132.6 321.8L100 354.4C92.6 361.8 80.4 361.8 72.8 354.4L45.6 327.2C38.2 319.6 38.2 307.4 45.6 300L78 267.6C73.2 258.8 69.2 249.8 66.2 240H20C9 240 0 231 0 220V180C0 169 9 160 20 160H66.2C69 150.8 72.8 142.2 77.4 134L43.4 100C35.6 92.2 35.6 79.6 43.4 71.8L71.6 43.6C79.4 35.8 92 35.8 99.8 43.6L133.8 77.6C142 73.2 150.6 69.4 159.8 66.6V20C159.8 9 168.8 0 179.8 0H219.8C230.8 0 239.8 9 239.8 20V66.6C249.4 69.4 258.6 73.6 267.2 78.4L300 45.6C307.4 38.2 319.6 38.2 327.2 45.6L354.4 72.8C361.8 80.2 361.8 92.4 354.4 100L322 132.4C326.8 141 331 150.2000000000001 334 160H380C391 160 400 169 400 180V220C400 231 391 240 380 240zM200 120C155.8 120 120 155.8 120 200C120 244.2 155.8 280 200 280S280 244.2 280 200C280 155.8 244.2 120 200 120z":"M303.8 192.2H266.8C264.6 199.6 261.4 206.4 257.8 213L285 240.2C291.2 246.4000000000001 291.2 256.6 285 262.8L262.4000000000001 285.4C256.2 291.6 246 291.6 239.8000000000001 285.4L212.6000000000001 258.2C206 261.6 199.2 264.8 191.8 267V304.2C191.8 313 184.6 320.2 175.8 320.2H143.8C135 320.2 127.8 313 127.8 304.2V267C120 264.6 112.8 261.4 105.8 257.6L79.8 283.6C73.8 289.6 64 289.6 58 283.6L36.4 261.8C30.4 255.8 30.4 246 36.4 240L62.4 214C58.4 207.2 55.2 200 52.8 192.2H15.8C7 192.2 -0.2 185 -0.2 176.2V144.2C-0.2 135.4 7 128.2 15.8 128.2H52.8C55 120.8 58.2 114 61.8 107.4L34.6 80.2000000000001C28.4 74 28.4 63.8 34.6 57.6L57.2 35.0000000000001C63.4 28.8000000000001 73.6 28.8000000000001 79.8 35.0000000000001L107 62.2000000000001C113.6 58.6000000000001 120.4 55.6000000000001 127.8 53.4000000000001V16.2000000000001C127.8 7.4000000000001 135 0.2 143.8 0.2H175.8C184.6 0.2 191.8000000000001 7.4 191.8000000000001 16.2000000000001V53.4000000000001C199.6000000000001 55.8000000000001 206.8000000000001 59.0000000000001 213.8 62.8000000000001L239.8000000000001 36.8000000000001C245.8000000000001 30.8000000000001 255.6 30.8000000000001 261.6 36.8000000000001L283.4000000000001 58.6000000000001C289.4000000000001 64.6000000000001 289.4000000000001 74.4 283.4000000000001 80.4000000000001L257.4000000000001 106.4000000000001C261.2 113.4000000000001 264.6 120.6000000000001 267 128.4000000000001H304C312.8 128.4000000000001 320 135.6000000000001 320 144.4000000000001V176.4000000000001C319.8 185 312.6 192.2 303.8 192.2zM159.8 100.2C126.6 100.2 99.8 127 99.8 160.2S126.6 220.2 159.8 220.2S219.8 193.4 219.8 160.2S193 100.2 159.8 100.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});TA.defaultProps={size:g6.IconSize.STANDARD},TA.displayName="Blueprint5.Icon.Cog";let Tj=R(({store:e})=>{let t=e.selectedElements.length>0,n=e.selectedElements[0]||{},r=t=>{e.selectedElements.forEach(e=>{e.set(t)})};return(0,b.jsx)(ym,{disabled:!t,minimal:!1,content:(0,b.jsxs)("div",{style:{padding:"15px",paddingTop:"25px",width:"220px"},children:[(0,b.jsx)(Oj,{checked:n.selectable,label:uM("toolbar.selectable"),onChange:e=>{r({selectable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.draggable,label:uM("toolbar.draggable"),onChange:e=>{r({draggable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.removable,label:uM("toolbar.removable"),onChange:e=>{r({removable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.resizable,label:uM("toolbar.resizable"),onChange:e=>{r({resizable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.contentEditable,label:uM("toolbar.contentEditable"),onChange:e=>{r({contentEditable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.styleEditable,label:uM("toolbar.styleEditable"),onChange:e=>{r({styleEditable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.alwaysOnTop,label:uM("toolbar.alwaysOnTop"),onChange:e=>{r({alwaysOnTop:e.target.checked})},alignIndicator:dn.RIGHT,style:{marginTop:"20px"}}),(0,b.jsx)(Oj,{checked:n.showInExport,label:uM("toolbar.showInExport"),onChange:e=>{r({showInExport:e.target.checked})},alignIndicator:dn.RIGHT,style:{marginTop:"20px"}})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(TA,{}),minimal:!0,disabled:!t})})});v("8NFma");let TN=R(({store:e})=>{let{disabled:t,elementToCopy:n,setElementToCopy:r}=bb(e);return(0,b.jsx)(yw,{content:uM("toolbar.copyStyle"),disabled:t,children:(0,b.jsx)(mc,{icon:TR,active:!!n,intent:n?"primary":"none",minimal:!0,disabled:t,onClick:()=>{r(e.selectedElements[0])}})})}),TR=(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("rect",{width:"16",height:"6",x:"2",y:"2",rx:"2"}),(0,b.jsx)("path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2"}),(0,b.jsx)("rect",{width:"4",height:"6",x:"8",y:"16",rx:"1"})]})}),TL={text:PS,image:PY,svg:PJ,many:Tv,line:Tt,video:Tl,figure:Tf,gif:Tg,page:TC},TI=aS("div")`
261
+ `,Pu=({fontFamily:e,handleClick:t,modifiers:n,store:r,isCustom:i})=>{let[o,a]=h(C).useState(!i);if(h(C).useEffect(()=>{o||r.loadFont(e)},[e,o]),"_divider"===e)return(0,b.jsx)("div",{style:{paddingTop:"10px"},children:(0,b.jsx)(yq,{})});let l=o?(0,b.jsx)(Ps,{src:lI(e),alt:e,onError:()=>{a(!1)}}):e;return(0,b.jsx)(yK,{text:l,active:n.active,disabled:n.disabled,onClick:t,style:{fontFamily:'"'+e+'"'}})},Pc=({onChange:e,defaultValue:t})=>{let n=h(C).useRef(null);return h(C).useEffect(()=>{n.current&&n.current.focus()},[]),(0,b.jsx)(bD,{leftIcon:(0,b.jsx)(wh,{}),inputRef:n,defaultValue:t,onChange:t=>e(t.target.value)})},Pd=({store:e,fonts:t,activeFont:n,activeFontLabel:r,onFontSelect:i})=>{let[o,a]=h(C).useState(""),l=t.filter(e=>e.toLowerCase().indexOf(o.toLowerCase())>=0);return(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{children:[(0,b.jsx)(Pc,{onChange:e=>a(e),defaultValue:o}),(0,b.jsx)("div",{style:{paddingTop:"5px"},children:(0,b.jsx)(xs,{innerElementType:h(C).forwardRef((e,t)=>(0,b.jsx)(yG,{ref:t,...e})),height:Math.min(400,30*l.length)+10,width:210,itemCount:l.length,itemSize:30,children:({index:t,style:r})=>{let o=l[t];return(0,b.jsx)("div",{style:r,children:(0,b.jsx)(Pu,{fontFamily:o,modifiers:{active:n===o},handleClick:()=>i(o),store:e,isCustom:e.fonts.find(e=>e.fontFamily===o)||iE.find(e=>e.fontFamily===o)},o)})}})})]}),children:(0,b.jsx)(mc,{text:r,rightIcon:(0,b.jsx)(wc,{}),minimal:!0,style:{marginRight:"5px",fontFamily:'"'+n+'"',overflow:"hidden",whiteSpace:"nowrap",maxHeight:"30px"}})})},Ph={},Pf=e=>Ph[e]?Promise.resolve(Ph[e]):fetch(e).then(e=>e.json()).then(t=>(Ph[e]=t,t)),Pp=R(({elements:e,store:t})=>{let{data:n,mutate:r}=wi(lL(),Pf,{isPaused:()=>iS(),fallbackData:[]});h(C).useEffect(()=>{r()},[iS()]);let i=t.fonts.concat(iE).map(e=>e.fontFamily).concat(n?.length&&!iS()?n:iC),o=e[0].fontFamily;o.length>15&&(o=o.slice(0,15)+"...");let a=[];t.find(e=>("text"===e.type&&a.push(e.fontFamily),!1));let l=[...new Set(a.concat("_divider").concat(i))];return(0,b.jsx)(Pd,{fonts:l,activeFont:e[0].fontFamily,activeFontLabel:o,store:t,onFontSelect:n=>{t.history.transaction(()=>{e.forEach(e=>{e.set({fontFamily:n})})})}})}),Pg=R(({elements:e,store:t})=>(0,b.jsx)(bq,{onValueChange:n=>{Number.isNaN(n)||t.history.transaction(()=>{e.forEach(e=>{e.set({fontSize:n,width:Math.max(n,e.width)})})})},value:Math.round(e[0].fontSize),style:{width:"50px"},min:5,max:4*t.height})),Pm=["left","center","right","justify"],Pv=["top","middle","bottom"],Py={top:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Po),{})}),middle:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Pa),{})}),bottom:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Pl),{})})},Pb=R(({elements:e,store:t})=>{let n=e[0];return(0,b.jsxs)(bL,{children:[(0,b.jsx)(mc,{minimal:!0,icon:"left"===n.align?(0,b.jsx)(wl,{}):"center"===n.align?(0,b.jsx)(wo,{}):"right"===n.align?(0,b.jsx)(ws,{}):(0,b.jsx)(wa,{}),onClick:()=>{let r=(Pm.indexOf(n.align)+1+Pm.length)%Pm.length,i=Pm[r];t.history.transaction(()=>{e.forEach(e=>{e.set({align:i})})})}}),iI.textVerticalResizeEnabled&&(0,b.jsx)(mc,{minimal:!0,icon:Py[n.verticalAlign],onClick:()=>{let r=(Pv.indexOf(n.verticalAlign)+1+Pv.length)%Pv.length,i=Pv[r];t.history.transaction(()=>{e.forEach(e=>{e.set({verticalAlign:i})})})}}),(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(wu,{}),active:"bold"===n.fontWeight||"700"===n.fontWeight,onClick:()=>{let r="bold"===n.fontWeight||"700"===n.fontWeight;t.history.transaction(()=>{e.forEach(e=>{r?e.set({fontWeight:"normal"}):e.set({fontWeight:"bold"})})})}}),(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(wd,{}),active:"italic"===n.fontStyle,onClick:()=>{let r="italic"===n.fontStyle;t.history.transaction(()=>{e.forEach(e=>{r?e.set({fontStyle:"normal"}):e.set({fontStyle:"italic"})})})}}),(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(wp,{}),active:n.textDecoration.indexOf("underline")>=0,onClick:()=>{let r=n.textDecoration.split(" ");r.indexOf("underline")>=0?r=r.filter(e=>"underline"!==e):r.push("underline"),t.history.transaction(()=>{e.forEach(e=>{e.set({textDecoration:r.join(" ")})})})}}),(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(wf,{}),active:n.textDecoration.indexOf("line-through")>=0,onClick:()=>{let r=n.textDecoration.split(" ");r.indexOf("line-through")>=0?r=r.filter(e=>"line-through"!==e):r.push("line-through"),t.history.transaction(()=>{e.forEach(e=>{e.set({textDecoration:r.join(" ")})})})}})]})}),Px=R(({elements:e,store:t})=>(0,b.jsx)(OT,{value:e[0].fill,style:{marginRight:"5px"},gradientEnabled:!0,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({fill:n})})}),store:t})),Pw=({value:e,onValueChange:t,...n})=>{let[r,i]=h(C).useState(e.toString());return h(C).useEffect(()=>{i(e.toString())},[e]),(0,b.jsx)(bq,{value:r,onValueChange:(e,n)=>{i(n),Number.isNaN(e)||t(e)},...n})},PC=R(({elements:e,store:t})=>{let n=e[0],r=n=>{t.history.transaction(()=>{e.forEach(e=>{e.set(n)})})},i="number"==typeof n.lineHeight?100*n.lineHeight:120;return(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{style:{padding:"15px",width:"230px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.lineHeight")}),(0,b.jsx)("div",{children:(0,b.jsx)(Pw,{value:Math.round(i),onValueChange:e=>{r({lineHeight:e/100})},style:{width:"50px"},min:50,max:250,buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:Math.round(i),onChange:e=>{r({lineHeight:e/100})},min:50,max:250,stepSize:1,showTrackFill:!1,labelRenderer:!1}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.letterSpacing")}),(0,b.jsx)("div",{children:(0,b.jsx)(Pw,{value:Math.round(100*n.letterSpacing),onValueChange:e=>{r({letterSpacing:e/100})},style:{width:"50px"},min:-50,max:250,buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:Math.round(100*n.letterSpacing),onChange:e=>{r({letterSpacing:e/100})},min:-50,max:250,stepSize:1,showTrackFill:!1,labelRenderer:!1})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(h(Pi),{className:"bp5-icon",style:{fontSize:"20px"}}),minimal:!0})})}),P_={TextFontFamily:Pp,TextFontSize:Pg,TextFontVariant:Pb,TextFill:Px,TextSpacing:PC,TextAiWrite:y2,TextFilters:OD,TextAnimations:Pr},PS=R(({store:e,components:t})=>{let n=e.selectedElements,r=yz({type:"text",usedItems:["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextFilters",iI.animationsEnabled&&"TextAnimations","TextAiWrite"],components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||P_[r];return(0,b.jsx)(i,{elements:n,element:n[0],store:e},r)}})});var C=v("8NFma"),PE={};PE=function(e){return EM({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M10 10v5h2V4h2v11h2V4h2V2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4zm-2 7v-3l-4 4 4 4v-3h12v-2H8z"}}]})(e)};var Pk={};Pk=function(e){return EM({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M9 10v5h2V4h2v11h2V4h2V2H9C6.79 2 5 3.79 5 6s1.79 4 4 4zm12 8l-4-4v3H5v2h12v3l4-4z"}}]})(e)};var PO={};PO=function(e){return EM({tag:"svg",attr:{version:"1.1",id:"mdi-format-list-bulleted",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z"}}]})(e)};var PP={};PP=function(e){return EM({tag:"svg",attr:{version:"1.1",id:"mdi-format-list-numbered",viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z"}}]})(e)};let PT=({html:e})=>{let t=document.createElement("div");document.body.appendChild(t),t.style.display="none",t.style.whiteSpace="pre-wrap";let n=aP(t);return aT(n,e),n},PA=e=>{e.root.parentElement.remove()},Pj=["left","center","right","justify"],PN=["top","middle","bottom"],PR={top:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Po),{})}),middle:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Pa),{})}),bottom:(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(Pl),{})})},PL=R(({active:e,globalActive:t,format:n,element:r,disableGlobal:i,enableGlobal:o,icon:a})=>(0,b.jsx)(mc,{minimal:!0,icon:a,active:e,onMouseDown:e=>{e.preventDefault()},onClick:e=>{let a=window.__polotnoQuill;if(a){let e=a.getSelection();a.formatText(e.index,e.length,n,!aE.currentFormat[n],"user"),t&&i();return}(a=PT({html:r.text})).setSelection(0,a.getLength(),"api"),a.format(n,!1);let l=a.root.innerHTML;PA(a),r.set({text:l}),t?i():o()}})),PI=R(({element:e,store:t})=>(0,b.jsx)(PL,{format:"bold",active:aE.currentFormat.bold||"bold"===e.fontWeight||"700"===e.fontWeight,globalActive:"bold"===e.fontWeight||"700"===e.fontWeight,element:e,disableGlobal:()=>e.set({fontWeight:"normal"}),enableGlobal:()=>e.set({fontWeight:"bold"}),icon:(0,b.jsx)(wu,{})})),PM=R(({element:e,store:t,elements:n,components:r})=>{let i=r?.TextBold||PI;return(0,b.jsxs)(bL,{children:[(0,b.jsx)(i,{element:e,store:t}),(0,b.jsx)(PL,{format:"italic",active:aE.currentFormat.italic||"italic"===e.fontStyle,globalActive:"italic"===e.fontStyle,element:e,disableGlobal:()=>e.set({fontStyle:"normal"}),enableGlobal:()=>e.set({fontStyle:"italic"}),icon:(0,b.jsx)(wd,{})}),(0,b.jsx)(PL,{format:"underline",active:aE.currentFormat.underline||e.textDecoration.indexOf("underline")>=0,globalActive:e.textDecoration.indexOf("underline")>=0,element:e,disableGlobal:()=>{let t=e.textDecoration.split(" ");t=t.filter(e=>"underline"!==e),e.set({textDecoration:t.join(" ")})},enableGlobal:()=>{let t=e.textDecoration.split(" ");t.push("underline"),e.set({textDecoration:t.join(" ")})},icon:(0,b.jsx)(wp,{})}),(0,b.jsx)(PL,{format:"strike",active:aE.currentFormat.strike||e.textDecoration.indexOf("line-through")>=0,globalActive:e.textDecoration.indexOf("line-through")>=0,element:e,disableGlobal:()=>{let t=e.textDecoration.split(" ");t=t.filter(e=>"line-through"!==e),e.set({textDecoration:t.join(" ")})},enableGlobal:()=>{let t=e.textDecoration.split(" ");t.push("line-through"),e.set({textDecoration:t.join(" ")})},icon:(0,b.jsx)(wf,{})}),(0,b.jsx)(mc,{minimal:!0,icon:"left"===e.align?(0,b.jsx)(wl,{}):"center"===e.align?(0,b.jsx)(wo,{}):"right"===e.align?(0,b.jsx)(ws,{}):(0,b.jsx)(wa,{}),onClick:()=>{let r=(Pj.indexOf(e.align)+1+Pj.length)%Pj.length,i=Pj[r];t.history.transaction(()=>{n.forEach(e=>{e.set({align:i})})})}}),iI.textVerticalResizeEnabled&&(0,b.jsx)(mc,{minimal:!0,icon:PR[e.verticalAlign],onClick:()=>{let n=(PN.indexOf(e.verticalAlign)+1+PN.length)%PN.length,r=PN[n];t.history.transaction(()=>{e.set({verticalAlign:r})})}}),(0,b.jsx)(mc,{minimal:!0,icon:"bullet"===aE.currentFormat.list?(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(PP),{style:{width:"20px",height:"20px"}})}):(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsx)(h(PO),{style:{width:"20px",height:"20px"}})}),onMouseDown:e=>{e.preventDefault()},onClick:()=>{let t=window.__polotnoQuill,n=!t;t=t||PT({html:e.text}),n&&t.setSelection(0,t.getLength(),"api");let r=t.getFormat();r.list?"bullet"===r.list?t.format("list","ordered"):t.format("list",!1):t.format("list","bullet"),n&&(e.set({text:t.root.innerHTML}),PA(t))}})]})}),PD={TextFontFamily:Pp,TextFontSize:Pg,TextFontVariant:PM,TextFilters:OD,TextFill:R(({element:e,store:t})=>{let[n,r]=h(C).useState(null);return(0,b.jsx)(OT,{value:aE.currentFormat.color||e.fill,gradientEnabled:!0,onOpen:()=>{let e=window.__polotnoQuill;e&&r(e.getSelection())},onClose:()=>{let e=window.__polotnoQuill;e&&e.setSelection(n)},onChange:t=>{let r=window.__polotnoQuill,i=r?.getSelection()||n;if(!i){var o=e.text.replace(/style=".*?"/g,"");e.set({fill:t,text:o});return}let a=i?.length>=r?.getLength()-1;if(r&&!a&&i?.length)r.formatText(i.index,i.length,"color",t,"user");else{var o=e.text.replace(/style=".*?"/g,"");e.set({fill:t,text:o})}},store:t})}),TextSpacing:PC,TextDirection:R(({element:e})=>{let t="rtl"===e.dir?h(PE):h(Pk);return(0,b.jsx)(mc,{icon:(0,b.jsx)(t,{className:"bp5-icon",style:{fontSize:"20px"}}),minimal:!0,onClick:()=>{e.set({dir:"rtl"===e.dir?"ltr":"rtl"})}})}),TextAnimations:Pr,TextAiWrite:y2},Pz=R(({store:e,components:t})=>{let n=e.selectedElements,r=e.selectedElements[0],i=yz({type:"text",usedItems:["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextFilters",iI.animationsEnabled&&"TextAnimations","TextAiWrite"],components:t});return(0,b.jsx)(yF,{items:i,itemRender:i=>{if("TextBold"===i)return null;let o=t[i]||PD[i];return(0,b.jsx)(o,{element:r,elements:n,store:e,components:t},i)}})});var C=v("8NFma"),uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),PF=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"crop",ref:t},e),C.createElement("path",{d:n?"M280 20C280 8.954 288.954 0 300 0C311.046 0 320 8.954 320 20L320 80L380 80C391.046 80 400 88.954 400 100C400 111.046 391.046 120 380 120L120 120L120 380.00002C120 391.04574 111.0458 400.0000252612 100 400.0000262268C88.9544 400.0000271924 80 391.04576 80 380.00002L80 320L20 320C8.95434 320 0.0000271924 311.0458 0.0000262268 300C0.0000252612 288.9544 8.95434 280 20 280L80 280L80 100C80 88.954 88.9544 80 100 80L280 80L280 20zM300 320L160 320L160 280L280 280L280 160L320 160L320 300.0002C320 311.0458 311.046 320 300 320zM0 400H400V0H0V400z":"M220 20C220 8.954 228.954 0 240 0C251.046 0 260 8.954 260 20V60H300C311.046 60 320 68.954 320 80C320 91.046 311.046 100 300 100H100.0002V300C100.0002 311.0457 91.0458 319.999999034354 80.0002 320C68.9544 320.000000965646 60.0002 311.04568 60.0002 300L60.0002 260L20.0002 260C8.95444 260 0.0001154066 251.0456 0.000152588 240C0.0001516224 228.9542 8.95444 220 20.0002 220L60.0002 220L60.0002 80C60.0002 68.954 68.9544 60 80.0002 60H220V20zM240 260.0002L120.0002 260.0002V220.0002L220 220.0002L220 120H260L260 240.0002C260 251.0458 251.046 260.0002 240 260.0002z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});PF.defaultProps={size:g6.IconSize.STANDARD},PF.displayName="Blueprint5.Icon.Crop";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),PB=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"tick",ref:t},e),C.createElement("path",{d:n?"M340 320C334.4 320 329.4 317.8 325.8 314.2L140 128.2L74.2 194C70.6 197.8 65.6 200 60 200C49 200 40 191 40 180C40 174.4 42.2 169.4 45.8 165.8L125.8 85.8C129.4 82.2 134.4 80 140 80S150.6 82.2 154.2 85.8L354.2000000000001 285.8C357.8 289.4 360 294.4 360 300C360 311 351 320 340 320z":"M280 260C274.4000000000001 260 269.4000000000001 257.8 265.8 254.2L120 108.2L54.2 174.2C50.6 177.8 45.6 180 40 180C29 180 20 171 20 160C20 154.4 22.2 149.4 25.8 145.8L105.8 65.8C109.4 62.2 114.4 60 120 60S130.6 62.2 134.2 65.8L294.2000000000001 225.8C297.8 229.4 300 234.4 300 240C300 251 291 260 280 260z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});PB.defaultProps={size:g6.IconSize.STANDARD},PB.displayName="Blueprint5.Icon.Tick",v("8NFma");var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),PH=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"arrows-horizontal",ref:t},e),C.createElement("path",{d:n?"M394 214L294 314C290 318 286 320 280 320C268 320 260 312 260 300C260 294 262 290 266 286L332 220H68L134 286C138 290 140 294 140 300C140 312 132 320 120 320C114 320 110 318 106 314L6 214C2 210 0 206 0 200S2 190 6 186L106 86C110 82 114 80 120 80C132 80 140 88 140 100C140 106 138 110 134 114L68 180H332L266 114C262 110 260 106 260 100C260 88 268 80 280 80C286 80 290 82 294 86L394 186C398 190 400 194 400 200S398 210 394 214L394 214z":"M314 174L234 254C230 258 226 260 220 260C208 260 200 250 200 240C200 234 202 230 206 226L252.0000000000001 180H68L114 226C118 230 120 234 120 240C120 250 112 260 100 260C94 260 90 258 86 254L6 174C2 170 0 166 0 160S2 150 6 146L86 66C90 62 94 60 100 60C112 60 120 68 120 80C120 86 118 90 114 94L68 140H252L206 94C202 90 200 86 200 80C200 68 208 60 220 60C226 60 230 62 234 66L314 146C318 150 320 154 320 160S318 170 314 174L314 174z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});PH.defaultProps={size:g6.IconSize.STANDARD},PH.displayName="Blueprint5.Icon.ArrowsHorizontal";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),PV=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"arrows-vertical",ref:t},e),C.createElement("path",{d:n?"M300 140C294 140 290 138 286 134L220 68V332L286 266C290 262 294 260 300 260C312 260 320 268 320 280C320 286 318 290 314 294L214 394C210 398 206 400 200 400S190 398 186 394L86 294C82 290 80 286 80 280C80 268 88 260 100 260C106 260 110 262 114 266L180 332V68.0000000000001L114 134.0000000000001C110 138 106 140 100 140C88 140 80 132 80 120C80 114 82 110 86 106L186 6C190 2 194 0 200 0S210 2 214 6L314 106C318 110 320 114 320 120C320 130 312 140 300 140L300 140z":"M240 120C234 120 230 118 226 114L180 68V252L226 206C230 202 234 200 240 200C252 200 260 208 260 220C260 226 258 230 254 234L174 314C170 318 166 320 160 320S150 318 146 314L66 234C62 230 60 226 60 220C60 208 70 200 80 200C86 200 90 202 94 206L140 252V68L94 114C90 118 86 120 80 120C70 120 60 112 60 100C60 94 62 90 66 86L146 6C150 2 154 0 160 0S170 2 174 6L254 86C258 90 260 94 260 100C260 112 252 120 240 120L240 120z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});PV.defaultProps={size:g6.IconSize.STANDARD},PV.displayName="Blueprint5.Icon.ArrowsVertical";var PU=({element:e,elements:t})=>(0,b.jsx)(ym,{content:(0,b.jsxs)(yG,{children:[(0,b.jsx)(yK,{shouldDismissPopover:!1,icon:(0,b.jsx)(PH,{}),text:uM("toolbar.flipHorizontally"),onClick:()=>{t.forEach(e=>{e.set({flipX:!e.flipX})})}}),(0,b.jsx)(yK,{shouldDismissPopover:!1,text:uM("toolbar.flipVertically"),icon:(0,b.jsx)(PV,{}),onClick:()=>{t.forEach(e=>{e.set({flipY:!e.flipY})})}})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{text:uM("toolbar.flip"),minimal:!0})}),C=v("8NFma");let PG=async e=>{let t=await fetch(lM(),{method:"POST",body:JSON.stringify({url:e})});return 200!==t.status?(alert(uM("error.removeBackground")),e):(await t.json()).url},Pq=R(({isOpen:e,onClose:t,element:n})=>{let[r,i]=h(C).useState(n.src);h(C).useEffect(()=>{i(n.src)},[n.src]);let[o,a]=h(C).useState(!1),l=async()=>{a(!0);try{i(await PG(n.src))}catch(e){console.error(e)}a(!1)},s=r!==n.src;return(0,b.jsxs)(yU,{onClose:t,title:uM("toolbar.removeBackgroundTitle"),isOpen:e,style:{width:"80%",maxWidth:"700px"},children:[(0,b.jsx)("div",{className:dt.DIALOG_BODY,children:(0,b.jsx)("img",{src:r,style:{width:"100%",maxHeight:"400px",objectFit:"contain"}})}),(0,b.jsx)("div",{className:dt.DIALOG_FOOTER,style:{position:"relative"},children:(0,b.jsxs)("div",{className:dt.DIALOG_FOOTER_ACTIONS,children:[!s&&(0,b.jsx)(mc,{onClick:l,loading:o,children:uM("toolbar.removeBackground")}),s&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(mc,{onClick:()=>{i(n.src),t()},loading:o,children:uM("toolbar.cancelRemoveBackground")}),(0,b.jsx)(mc,{onClick:()=>{n.set({src:r}),t()},loading:o,intent:"primary",children:uM("toolbar.confirmRemoveBackground")})]})]})})]})}),PW=R(({element:e,store:t,elements:n})=>e.contentEditable?e.clipSrc?(0,b.jsx)(mc,{text:uM("toolbar.removeClip"),minimal:!0,onClickCapture:e=>{n.forEach(e=>{e.set({clipSrc:""})})}}):(0,b.jsx)(mc,{minimal:!0,text:uM("toolbar.clip"),onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("image-clip")}}):null),P$=R(({element:e,store:t})=>!e.contentEditable||e.stretchEnabled?null:(0,b.jsx)(yw,{content:uM("toolbar.crop"),position:"bottom",children:(0,b.jsx)(mc,{minimal:!0,icon:(0,b.jsx)(PF,{}),onClickCapture:t=>{t.stopPropagation(),e.toggleCropMode(!0)}})}));R(({element:e,store:t})=>e.clipSrc?(0,b.jsx)(mc,{text:uM("toolbar.removeClip"),minimal:!0,onClickCapture:t=>{e.set({clipSrc:""})}}):null);let PK={ImageFlip:PU,ImageFilters:OD,ImageFitToBackground:({element:e})=>(0,b.jsx)(mc,{text:uM("toolbar.fitToBackground"),minimal:!0,onClick:async()=>{let{page:t}=e,n=t.computedWidth+2*t.bleed,r=t.computedHeight+2*t.bleed,i=await l6(e.src),o=e.stretchEnabled?{cropX:0,cropY:0,cropWidth:1,cropHeight:1}:l7({width:n,height:r},i);e.set({x:-t.bleed,y:-t.bleed,width:n,height:r,rotation:0,...o})}}),ImageCrop:P$,ImageClip:PW,ImageRemoveBackground:({element:e})=>{let[t,n]=h(C).useState(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(mc,{text:uM("toolbar.removeBackground"),minimal:!0,onClick:e=>{n(!0)}}),(0,b.jsx)(Pq,{isOpen:t,onClose:()=>{n(!1)},element:e})]})},ImageAnimations:Pr},PY=R(({store:e,components:t})=>{let n=e.selectedElements[0],r=n._cropModeEnabled,i=h(C).useRef({});h(C).useEffect(()=>{r&&(i.current={x:n.x,y:n.y,width:n.width,height:n.height,cropX:n.cropX,cropY:n.cropY,cropWidth:n.cropWidth,cropHeight:n.cropHeight})},[r]);let o=yz({type:"image",usedItems:["ImageFlip","ImageFilters","ImageFitToBackground","ImageClip","ImageCrop",iI.animationsEnabled&&"ImageAnimations",iI.removeBackgroundEnabled&&"ImageRemoveBackground"],components:t});return(0,b.jsxs)(b.Fragment,{children:[!r&&(0,b.jsx)(yF,{items:o,itemRender:r=>{let i=t[r]||PK[r];return(0,b.jsx)(i,{element:n,store:e,elements:e.selectedElements},r)}}),r&&(0,b.jsxs)(yj.Group,{children:[(0,b.jsx)(mc,{text:uM("toolbar.cropDone"),minimal:!0,icon:(0,b.jsx)(PB,{}),onClickCapture:e=>{n.toggleCropMode(!1)}}),(0,b.jsx)(mc,{text:uM("toolbar.cropCancel"),minimal:!0,icon:(0,b.jsx)(Oz,{}),onClickCapture:e=>{n.set({...i.current}),n.toggleCropMode(!1)}})]})]})});v("8NFma");let PX=(e,t)=>Array.from(e.keys()).find(e=>or(e,t)),PZ=(e,t)=>{let n=PX(e,t);return e.get(n||"")||t},PQ={SvgFlip:PU,SvgFilters:OD,SvgColors:R(({element:e,elements:t,store:n})=>{let r=oo(e.src);return(0,b.jsx)(b.Fragment,{children:!e.maskSrc&&r.slice(0,5).map(t=>(0,b.jsx)(OT,{value:PZ(e.colorsReplace,t),style:{marginLeft:"5px"},onChange:n=>{let r=PX(e.colorsReplace,t)||t;e.replaceColor(r,n)},store:n,gradientEnabled:!0},t))})}),SvgAnimations:Pr},PJ=R(({store:e,hideSvgEffects:t,components:n})=>{let r=e.selectedElements,i=yz({type:"svg",usedItems:["SvgFlip",!t&&"SvgFilters","SvgColors",iI.animationsEnabled&&"SvgAnimations"].filter(e=>!!e),components:n});return(0,b.jsx)(yF,{items:i,itemRender:t=>{let i=n[t]||PQ[t];return(0,b.jsx)(i,{elements:r,element:r[0],store:e},t)}})});v("8NFma");var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),P0=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"settings",ref:t},e),C.createElement("path",{d:n?"M80 380C80 391 71 400 60 400S40 391 40 380V280H80V380zM40 20C40 9 49 0 60 0S80 9 80 20V140H40V20zM220 380C220 391 211 400 200 400S180 391 180 380V220H220V380zM360 380C360 391 351 400 340 400S320 391 320 380V320H360V380zM180 20C180 9 189 0 200 0S220 9 220 20V80H180V20zM360 300H320C309 300 300 291 300 280V220C300 209 309 200 320 200H360C371 200 380 209 380 220V280C380 291 371 300 360 300zM320 20C320 9 329 0 340 0S360 9 360 20V180H320V20zM80 260H40C29 260 20 251 20 240V180C20 169 29 160 40 160H80C91 160 100 169 100 180V240C100 251 91 260 80 260zM220 200H180C169 200 160 191 160 180V120C160 109 169 100 180 100H220C231 100 240 109 240 120V180C240 191 231 200 220 200z":"M60 300C60 311 51 320 40 320S20 311 20 300V240H60V300zM60 220H20C9 220 0 211 0 200V160C0 149 9 140 20 140H60C71 140 80 149 80 160V200C80 211 71 220 60 220zM300 300C300 311 291 320 280 320S260 311 260 300V260H300V300zM180 300C180 311 171 320 160 320S140 311 140 300V180H180V300zM20 20C20 9 29 0 40 0S60 9 60 20V120H20V20zM300 240H260C249 240 240 231 240 220V180C240 169 249 160 260 160H300C311 160 320 169 320 180V220C320 231 311 240 300 240zM260 20C260 9 269 0 280 0S300 9 300 20V140H260V20zM180 160H140C129 160 120 151 120 140V100C120 89 129 80 140 80H180C191 80 200 89 200 100V140C200 151 191 160 180 160zM140 20C140 9 149 0 160 0S180 9 180 20V60H140V20z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});P0.defaultProps={size:g6.IconSize.STANDARD},P0.displayName="Blueprint5.Icon.Settings";let P1=R(({store:e,elements:t})=>{let n=n=>{e.history.transaction(()=>{t.forEach(e=>{e.set(n)})})},r=n=>{e.history.transaction(()=>{t.forEach(e=>{let{middleLeft:t,middleRight:r}=aq(e),{x:i,y:o,rotation:a}=aW(t,r,n);e.set({x:i,y:o,rotation:a,height:n})})})};return(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{style:{padding:"15px",paddingTop:"15px",width:"230px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.lineSize")}),(0,b.jsx)("div",{children:(0,b.jsx)(OL,{value:t[0].height,onValueChange:e=>{r(e)},style:{width:"50px"},min:1,max:100,buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:t[0].height,onChange:e=>{r(e)},min:1,max:100,labelRenderer:!1}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px",paddingTop:"15px"},children:[(0,b.jsx)(mc,{onClick:()=>{n({dash:[]})},active:0===t[0].dash.length,children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{n({dash:[4,1]})},active:4===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{n({dash:[2,1]})},active:2===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{n({dash:[1,1]})},active:1===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(P0,{}),minimal:!0})})}),P2=R(({elements:e,store:t})=>(0,b.jsx)(OT,{value:e[0].color,style:{marginRight:"5px"},gradientEnabled:!1,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({color:n})})}),store:t})),P3=(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 16 8"})})}),P4=(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 8 3 L 1 8 L 8 13",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),P8=(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 8 3 L 1 8 L 8 13 Z",fill:"currentColor",strokeLinejoin:"round",strokeLinecap:"round"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),P6=(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 3 L 1 13",strokeLinejoin:"round",strokeLinecap:"round"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),P5={"":P3,arrow:P4,triangle:P8,bar:P6,square:(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 4 L 9 4 L 9 12 L 1 12 Z",fill:"currentColor",strokeLinejoin:"round",strokeLinecap:"round"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),circle:(0,b.jsx)("span",{"aria-hidden":"true",className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,b.jsx)("circle",{cx:"4",cy:"8",r:"4",fill:"currentColor"}),(0,b.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})})},P9=({type:e,active:t,onClick:n,flipped:r})=>{let i=P5[e];return(0,b.jsx)(mc,{icon:r?(0,b.jsx)("span",{style:{transform:"scaleX(-1)"},children:i}):i,minimal:!0,onClick:n,active:t})},P7=R(({elements:e,store:t,property:n})=>{let r="endHead"===n,i=P5[e[0][n]],o=r?(0,b.jsx)("span",{style:{transform:"scaleX(-1)"},children:i}):i,a=r=>{t.history.transaction(()=>{e.forEach(e=>{e.set({[n]:r})})})};return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{style:{width:"150px",padding:"10px"},children:[(0,b.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["","arrow","triangle"].map(t=>(0,b.jsx)(P9,{type:t,active:e[0][n]===t,onClick:()=>{a(t)},flipped:r},t))}),(0,b.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:["bar","square","circle"].map(t=>(0,b.jsx)(P9,{type:t,active:e[0][n]===t,onClick:()=>{a(t)},flipped:r},t))})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:o,minimal:!0})})})}),Te={LineSettings:P1,LineColor:P2,LineHeads:R(({elements:e,store:t})=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P7,{elements:e,store:t,property:"startHead"}),(0,b.jsx)(P7,{elements:e,store:t,property:"endHead"})]})),LineAnimations:Pr},Tt=R(({store:e,components:t})=>{let n=e.selectedElements[0],r=yz({type:"line",usedItems:["LineColor","LineSettings","LineHeads",iI.animationsEnabled&&"LineAnimations"].filter(e=>!!e),components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Te[r];return(0,b.jsx)(i,{element:n,store:e,elements:e.selectedElements},r)}})});var C=v("8NFma"),uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),Tn=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"cut",ref:t},e),C.createElement("path",{d:n?"M320 360C320 360 334.4 385.6 320 400L214.2 275L239.8 244.2L320 360zM321.6 160C310.6 160 300.2 157.6 290.8 153.6L86.2 400C72.2 385.6 86.2 360 86.2 360L175.2 228.8L111.4 153.4C101.8 157.6 91.2 160 80 160C35.8 160 0 124.2000000000001 0 80C0 35.8 35.8 0 80 0S160 35.8 160 80C160 93 156.6 105.2 151 116L201.8 189.4L251.6 116C246.2 105.2000000000001 242.8 93 242.8 80C242.8 35.8 278 0 321.2000000000001 0C364.6000000000001 0 399.6000000000001 35.8 399.6000000000001 80C400 124.2000000000001 364.8 160 321.6 160zM80 40C58 40 40 58 40 80C40 102 58 120 80 120S120 102 120 80C120 58 102 40 80 40zM321.6 40C300 40 282.4 58 282.4 80C282.4 102 300 120 321.6 120C343.2 120 360.8 102 360.8 80C360.8 58 343.2 40 321.6 40z":"M260 280C260 280 274.2000000000001 305.8 260 320L173.2 218.6L194.2 192.2L260 280zM261.4 120C253 120 245 118.2 237.8 114.8L66.2 320C52.4 305.8 66.2 280 66.2 280L139.8 179.6L84.4 114.8C76.8 118.2 68.6 120 60 120C26.8 120 0 93.2 0 60S26.8 0 60 0S120 26.8 120 60C120 69.2 117.8 77.8 114.2 85.4L162 149.2L208.6 85.4C205 77.6 202.8 69 202.8 60.0000000000001C202.8 26.8 229.0000000000001 1e-13 261.4 1e-13C293.8 1e-13 320 26.8 320 60.0000000000001S293.8 120 261.4 120zM60 40C49 40 40 49 40 60C40 71 49 80 60 80S80 71 80 60C80 49 71 40 60 40zM261.4 40C250.6 40 241.8 49 241.8 60C241.8 71 250.6 80 261.4 80S281 71 281 60C281 49 272.2 40 261.4 40z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});Tn.defaultProps={size:g6.IconSize.STANDARD},Tn.displayName="Blueprint5.Icon.Cut";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),Tr=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"volume-up",ref:t},e),C.createElement("path",{d:n?"M180 331.4C174.4 331.4 169.4 329.2 165.8 325.6L111.8 271.4H20C9 271.4 0 262.4 0 251.4V131.4C0 120.4 9 111.4 20 111.4H111.8L166 57.2C169.6 53.6 174.6 51.4 180.2000000000001 51.4C191.2000000000001 51.4 200.2000000000001 60.4 200.2000000000001 71.4V311.4C200 322.4 191 331.4 180 331.4zM346.2 362.6L313.8 338.6C342.8 296.8 360 246.2 360 191.4C360 136.6 342.8 86 313.8 44L346.2 20C380 68.6 400 127.6 400 191.4C400 255 380 314 346.2 362.6zM278.4 312.8L246.4 289.2C267.4 262.2000000000001 280 228.2 280 191.4C280 154.6 267.4 120.6 246.4 93.6L278.4 70C304.2000000000001 103.6 320 145.6 320 191.4C320 237 304.4000000000001 279 278.4 312.8z":"M140 282.8C134.4 282.8 129.4 280.6 125.8 277L71.8 222.8H20C9 222.8 0 213.8 0 202.8V122.8C0 111.8 9 102.8 20 102.8H71.8L126 48.6C129.6 45 134.6 42.8 140.2 42.8C151.2 42.8 160.2 51.8 160.2 62.8V262.8C160 273.8 151 282.8 140 282.8zM274.8 302.6L243.2 278.2C266.2 245.6 280 205.8 280 162.8C280 119.6 266.2 79.8 243 47.2L274.6 22.8C303 62.2 319.8 110.4 319.8 162.8C320 215 303 263.2 274.8 302.6zM179.6 229.6C192.4 210.4 200 187.4 200 162.8S192.4 115 179.6 96L211.4 71.6C229.4 97.4 240 128.8 240 162.8C240 196.8 229.4 228.2 211.4 254L179.6 229.6z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});Tr.defaultProps={size:g6.IconSize.STANDARD},Tr.displayName="Blueprint5.Icon.VolumeUp";let Ti=R(({store:e,components:t,element:n})=>{let r=h(C).useRef(null),[i,o]=h(C).useState([]);h(C).useEffect(()=>{o([])},[n.src]);let a=async()=>{if(!n.src||i.length)return;let{width:e,height:t}=await sn(n.src),{src:a}=n,l=r.current.offsetHeight,s=Math.ceil(r.current.offsetWidth/(e/t*l)),u=await sr(a),c=document.createElement("video");c.crossOrigin="anonymous",c.src=a;let d=document.createElement("canvas");d.width=480;try{await new Promise((e,t)=>{c.addEventListener("loadeddata",()=>{let t=c.videoWidth/c.videoHeight;d.height=480/t,e()}),c.addEventListener("error",t)}),o([]);for(let e=0;e<s;e++){let t=e*u/s,n=await so(c,d,t);o(e=>e.concat(n))}}catch(e){console.error("Error generating previews:",e)}},l=(e,t)=>{e.preventDefault();let i=e=>{e.preventDefault();let{clientX:i}=e,{left:o,width:a}=r.current.getBoundingClientRect(),{src:l}=n,s=(i-o)/a;"start"===t?n.set({startTime:Math.min(n.endTime,Math.max(0,s))}):"end"===t&&n.set({endTime:Math.min(1,Math.max(n.startTime,s))})};window.addEventListener("mousemove",i),window.addEventListener("mouseup",()=>{window.removeEventListener("mousemove",i)})};return(0,b.jsx)(ym,{position:"bottom",onOpened:a,content:(0,b.jsx)(yj,{style:{boxShadow:"none",backgroundColor:"transparent",width:"calc(100vw - 300px)"},children:(0,b.jsxs)(yT,{children:[(0,b.jsx)(bq,{style:{width:"80px"},value:parseFloat((n.duration*(n.endTime-n.startTime)/1e3).toFixed(2)),minorStepSize:.01,stepSize:.1,buttonPosition:"none",readOnly:!0}),(0,b.jsxs)("div",{style:{width:"calc(100vw - 420px)",height:"30px",display:"flex",position:"relative",overflow:"hidden",marginLeft:"10px"},ref:r,children:[i.map((e,t)=>(0,b.jsx)("img",{src:e,style:{width:"auto",height:"100%",objectFit:"cover"}},t)),(0,b.jsx)("div",{style:{position:"absolute",top:"0",left:0,width:100*n.startTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),(0,b.jsx)("div",{style:{position:"absolute",top:"0",right:"0%",width:100-100*n.endTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),(0,b.jsx)("div",{style:{position:"absolute",top:"0",left:100*n.startTime+"%",width:"10px",height:"30px",borderRadius:"0px",backgroundColor:"rgb(0, 161, 255, 0.9)",cursor:"ew-resize"},onMouseDown:e=>{l(e,"start")}}),(0,b.jsx)("div",{style:{position:"absolute",top:"0",right:100-100*n.endTime+"%",width:"10px",height:"30px",borderRadius:"0px",backgroundColor:"rgb(0, 161, 255, 0.9)",cursor:"ew-resize"},onMouseDown:e=>{l(e,"end")}})]})]})}),children:(0,b.jsx)(mc,{icon:(0,b.jsx)(Tn,{}),minimal:!0,children:"Trim"})})}),To=(e,t,n)=>Math.max(t,Math.min(n,e)),Ta={VideoTrim:Ti,VideoAnimations:Pr,VideoVolume:R(({element:e})=>{let t=Math.round(100*e.volume),n=t=>{e.set({volume:t/100})};return(0,b.jsx)(ym,{position:"bottom",content:(0,b.jsx)("div",{style:{padding:"10px",width:"250px"},children:(0,b.jsxs)("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[(0,b.jsx)("div",{style:{paddingTop:"7px",paddingLeft:"10px",width:"calc(100% - 80px)"},children:(0,b.jsx)(b2,{value:t,onChange:e=>{n(e)},min:0,max:100,labelStepSize:50,showTrackFill:!1,labelRenderer:!1})}),(0,b.jsx)(bq,{value:t,onValueChange:e=>{n(To(e,0,100))},buttonPosition:"none",style:{width:"50px",padding:"0 5px",marginLeft:"10px"},min:0,max:100})]})}),children:(0,b.jsx)(mc,{icon:(0,b.jsx)(Tr,{}),minimal:!0})})}),VideoClip:R(({element:e,store:t})=>e.contentEditable?e.clipSrc?(0,b.jsx)(mc,{text:uM("toolbar.removeClip"),minimal:!0,onClickCapture:t=>{e.set({clipSrc:""})}}):(0,b.jsx)(mc,{minimal:!0,text:uM("toolbar.clip"),onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("image-clip")}}):null)},Tl=R(({store:e,components:t})=>{let n=e.selectedElements,r=yz({type:"video",usedItems:["VideoTrim","VideoVolume","VideoClip",iI.animationsEnabled&&"VideoAnimations"].filter(e=>!!e),components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Ta[r];return(0,b.jsx)(i,{elements:n,element:n[0],store:e},r)}})});v("8NFma");var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),Ts=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"disable",ref:t},e),C.createElement("path",{d:n?"M200 400C89.6 400 0 310.4 0 200C0 89.6 89.6 0 200 0S400 89.6 400 200C400 310.4 310.4 400 200 400zM40 200C40 288.4 111.6 360 200 360C237 360 271 347.4 298 326.2L73.8 102C52.6 129 40 163 40 200zM200 40C163 40 129 52.6 102 73.8L326.2 298C347.4000000000001 271 360 237 360 200C360 111.6 288.4 40 200 40z":"M159.8 320.2C71.4 320.2 -0.2 248.6 -0.2 160.2S71.4 0.2 159.8 0.2S319.8 71.8 319.8 160.2S248.2 320.2 159.8 320.2zM39.8 160.2C39.8 226.4 93.6 280.2 159.8 280.2C185.8 280.2 209.6 271.8 229.2 257.8L62.2 90.8C48.2 110.4 39.8 134.2 39.8 160.2zM159.8 40.2C133.8 40.2 110 48.6 90.4 62.6L257.4 229.6C271.4 210 279.8 186.2 279.8 160.2C279.8 93.8 226.2 40.2 159.8 40.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});Ts.defaultProps={size:g6.IconSize.STANDARD},Ts.displayName="Blueprint5.Icon.Disable";var Tu={};Tu=function(e){return EM({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor"},child:[{tag:"path",attr:{d:"M0 0h20v5H0V0zm0 7h20v4H0V7zm0 6h20v3H0v-3zm0 5h20v2H0v-2z"}}]})(e)};let Tc=R(({elements:e,store:t})=>(0,b.jsx)(OT,{value:e[0].fill,style:{marginRight:"5px"},gradientEnabled:!0,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({fill:n})})}),store:t})),Td=R(({store:e,elements:t,element:n})=>{let r=n=>{e.history.transaction(()=>{t.forEach(e=>{e.set(n)})})};return(0,b.jsx)(ym,{content:(0,b.jsxs)("div",{style:{padding:"15px",paddingTop:"15px",width:"270px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"15px"},children:[(0,b.jsx)(mc,{onClick:()=>{r({strokeWidth:0})},active:0===t[0].strokeWidth,style:{width:"44px",height:"34px"},icon:(0,b.jsx)(Ts,{size:20})}),(0,b.jsx)(mc,{onClick:()=>{r({dash:[],strokeWidth:t[0].strokeWidth||10})},active:t[0].strokeWidth&&0===t[0].dash.length,children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{r({dash:[4,1],strokeWidth:t[0].strokeWidth||10})},active:t[0].strokeWidth&&4===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{r({dash:[2,1],strokeWidth:t[0].strokeWidth||10})},active:t[0].strokeWidth&&2===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})})}),(0,b.jsx)(mc,{onClick:()=>{r({dash:[1,1],strokeWidth:t[0].strokeWidth||10})},active:t[0].strokeWidth&&1===t[0].dash[0],children:(0,b.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.strokeWidth")}),(0,b.jsx)("div",{children:(0,b.jsx)(OL,{value:t[0].strokeWidth,onValueChange:e=>{r({strokeWidth:e})},style:{width:"50px"},min:0,max:Math.round(Math.min(n.width,n.height)/2),buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:t[0].strokeWidth,onChange:e=>{r({strokeWidth:e})},min:0,max:Math.round(Math.min(n.width,n.height)/2),labelRenderer:!1}),"rect"===n.subType&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"15px",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.cornerRadius")}),(0,b.jsx)("div",{children:(0,b.jsx)(OL,{value:t[0].cornerRadius,onValueChange:e=>{r({cornerRadius:e})},style:{width:"50px"},min:0,max:Math.round(Math.max(n.width,n.height)/2),buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:t[0].cornerRadius,onChange:e=>{r({cornerRadius:e})},min:0,max:Math.round(Math.max(n.width,n.height)/2),labelRenderer:!1})]})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(h(Tu),{}),minimal:!0})})}),Th={FigureFill:Tc,FigureStroke:R(({elements:e,store:t})=>e.find(e=>e.strokeWidth)?(0,b.jsx)(OT,{value:e[0].stroke,style:{marginRight:"5px"},gradientEnabled:!1,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({stroke:n})})}),store:t}):null),FigureSettings:Td,FigureAnimations:Pr,FigureFilters:OM},Tf=R(({store:e,components:t})=>{let n=e.selectedElements[0],r=yz({type:"figure",usedItems:["FigureFill","FigureStroke","FigureSettings","FigureFilters",iI.animationsEnabled&&"FigureAnimations"].filter(e=>!!e),components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Th[r];return(0,b.jsx)(i,{element:n,store:e,elements:e.selectedElements},r)}})});v("8NFma");let Tp={GifFilters:OD,GifAnimations:Pr},Tg=R(({store:e,components:t})=>{let n=e.selectedElements,r=yz({type:"gif",usedItems:["GifFilters",iI.animationsEnabled&&"GifAnimations"].filter(e=>!!e),components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Tp[r];return(0,b.jsx)(i,{elements:n,element:n[0],store:e},r)}})});v("8NFma");let Tm={ManyAnimations:Pr},Tv=R(({store:e,components:t})=>{let n=e.selectedElements,r=yz({type:"many",usedItems:[iI.animationsEnabled&&"ManyAnimations"],components:t});return(0,b.jsx)(yF,{items:r,itemRender:r=>{let i=t[r]||Tm[r];return(0,b.jsx)(i,{elements:n,element:n[0],store:e},r)}})});var C=v("8NFma"),uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),Ty=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"time",ref:t},e),C.createElement("path",{d:n?"M220 208.2V320C220 331 211 340 200 340S180 331 180 320V200C180 194.4 182.2 189.4 185.8 185.8L245.8 125.8C249.4 122.2 254.4 120 260 120C271 120 280 129 280 140C280 145.6 277.8 150.6 274.2000000000001 154.2L220 208.2zM200 400C89.6 400 0 310.4 0 200C0 89.6 89.6 0 200 0S400 89.6 400 200C400 310.4 310.4 400 200 400zM200 40C111.6 40 40 111.6 40 200S111.6 360 200 360S360 288.4 360 200S288.4 40 200 40z":"M160 320C71.6 320 0 248.4 0 160S71.6 0 160 0S320 71.6 320 160S248.4 320 160 320zM160 40C93.8 40 40 93.8 40 160S93.8 280 160 280S280 226.2 280 160S226.2 40 160 40zM180 168.2V240C180 251 171 260 160 260S140 251 140 240V160C140 154.4 142.2 149.4 145.8 145.8L185.8 105.8C189.4 102.2 194.4 100 200 100C211 100 220 109 220 120C220 125.6 217.8 130.6 214.2 134.2L180 168.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});Ty.defaultProps={size:g6.IconSize.STANDARD},Ty.displayName="Blueprint5.Icon.Time";let Tb=({value:e,onValueChange:t,...n})=>{let[r,i]=h(C).useState(e.toString());return h(C).useEffect(()=>{i(e.toString())},[e]),(0,b.jsx)(bq,{value:r,onValueChange:(e,n)=>{i(n),Number.isNaN(e)||t(e)},...n})},Tx=R(({store:e})=>e.activePage?(0,b.jsx)(OT,{value:e.activePage.background||"white",onChange:t=>{e.activePage.set({background:t})},store:e,gradientEnabled:!0}):null),Tw={PageDuration:R(({store:e})=>{if(!e.activePage)return null;let{duration:t}=e.activePage;return(0,b.jsx)(ym,{position:"bottom",content:(0,b.jsxs)("div",{style:{padding:"15px",paddingTop:"15px",width:"230px"},children:[(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[(0,b.jsx)("div",{children:uM("toolbar.duration")}),(0,b.jsx)("div",{children:(0,b.jsx)(Tb,{value:t/1e3,onValueChange:t=>{e.activePage.set({duration:1e3*t})},style:{width:"50px"},min:0,buttonPosition:"none"})})]}),(0,b.jsx)(b2,{value:Math.min(t/1e3,50),onChange:t=>{e.activePage.set({duration:1e3*t})},min:0,max:50,showTrackFill:!1,labelRenderer:!1})]}),children:(0,b.jsxs)(mc,{icon:(0,b.jsx)(Ty,{}),minimal:!0,children:[(e.activePage.duration/1e3).toFixed(1),"s"]})})}),PageBackground:Tx},TC=R(({store:e,components:t})=>{let n=yz({type:"page",usedItems:["PageBackground",iI.animationsEnabled&&"PageDuration"],components:t});return(0,b.jsx)(yF,{items:n,itemRender:n=>{let r=t[n]||Tw[n];return(0,b.jsx)(r,{store:e},n)}})});var C=v("8NFma"),uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),T_=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"document",ref:t},e),C.createElement("path",{d:n?"M239.6 400H79.6C68.6 400 59.6 391 59.6 380V20C59.6 9 68.6 0 79.6 0H339.6C350.6 0 359.6 9 359.6 20V280L239.6 400zM319.6 40H99.6V360H219.6V260H319.6V40z":"M180 320H60C49 320 40 311 40 300V20C40 9 49 0 60 0H260C271 0 280 9 280 20V220L180 320zM240 40H80V280H160V200H240V40z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});T_.defaultProps={size:g6.IconSize.STANDARD},T_.displayName="Blueprint5.Icon.Document";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),TS=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"import",ref:t},e),C.createElement("path",{d:n?"M185.8 85.8C189.4 82.2 194.4 80 200 80S210.6 82.2 214.2 85.8L314.2000000000001 185.8C317.8 189.4 320 194.4 320 200C320 211 311 220 300 220C294.4000000000001 220 289.4000000000001 217.8 285.8 214.2L220 148.2V380C220 391 211 400 200 400S180 391 180 380V148.2L114.2 214.2C110.6 217.8 105.6 220 100 220C89 220 80 211 80 200C80 194.4 82.2 189.4 85.8 185.8L185.8 85.8zM380 120C369 120 360 111 360 100V40H40V100C40 111 31 120 20 120S0 111 0 100V20C0 9 9 0 20 0H380C391 0 400 9 400 20V100C400 111 391 120 380 120z":"M145.8 85.8C149.4 82.2 154.4 80 160 80S170.6 82.2 174.2 85.8L254.2 165.8C257.8 169.4 260 174.4 260 180C260 191 251 200 240 200C234.4 200 229.4 197.8 225.8 194.2L180 148.2V300C180 311 171 320 160 320S140 311 140 300V148.2L94.2 194.2C90.6 197.8 85.6 200 80 200C69 200 60 191 60 180C60 174.4 62.2 169.4 65.8 165.8L145.8 85.8zM300 100C289 100 280 91 280 80V40H40V80C40 91 31 100 20 100S0 91 0 80V20C0 9 9 0 20 0H300C311 0 320 9 320 20V80C320 91 311 100 300 100z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});TS.defaultProps={size:g6.IconSize.STANDARD},TS.displayName="Blueprint5.Icon.Import";var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),TE=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"media",ref:t},e),C.createElement("path",{d:n?"M300 220C322 220 340 238 340 260C340 282 322 300 300 300S260 282 260 260C260 238 278 220 300 220zM380 360H20C9 360 0 351 0 340V60C0 49 9 40 20 40H380C391 40 400 49 400 60V340C400 351 391 360 380 360zM360 100L240 200L200 160L120 260L40 100V320H360V100z":"M239.8 180.2C250.8 180.2 259.8 189.2 259.8 200.2S250.8 220.2 239.8 220.2S219.8 211.2 219.8 200.2S228.8 180.2 239.8 180.2zM299.8 280.2H19.8C8.8 280.2 -0.2 271.2 -0.2 260.2V60.2C-0.2 49.2 8.8 40.2 19.8 40.2H299.8C310.8 40.2 319.8 49.2 319.8 60.2V260.2C319.8 271.2 310.8 280.2 299.8 280.2zM279.8 100.2L179.8 160.2L159.8 120.2L99.8 200.2L39.8 100.2V240.2H279.8V100.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});TE.defaultProps={size:g6.IconSize.STANDARD},TE.displayName="Blueprint5.Icon.Media";let Tk=R(({store:e})=>{let[t,n]=h(C).useState(!1);return(0,b.jsx)(ym,{content:(0,b.jsxs)(yG,{children:[(0,b.jsx)(yK,{icon:(0,b.jsx)(TE,{}),text:uM("toolbar.saveAsImage"),onClick:async()=>{e.pages.forEach(t=>{e.saveAsImage({pageId:t.id})})}}),(0,b.jsx)(yK,{icon:(0,b.jsx)(T_,{}),text:uM("toolbar.saveAsPDF"),onClick:async()=>{n(!0),await e.saveAsPDF(),n(!1)}})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(TS,{}),text:uM("toolbar.download"),minimal:!0,loading:t})})});v("8NFma");let TO=R(({store:e})=>{let{lock:t,locked:n,disabled:r}=bO({store:e}),i=n?(0,b.jsx)(bm,{}):(0,b.jsx)(bv,{}),o=n?uM("toolbar.lockedDescription"):uM("toolbar.unlockedDescription");return(0,b.jsx)(yw,{content:o,disabled:r,position:"bottom",children:(0,b.jsx)(mc,{minimal:!0,disabled:r,icon:i,onClick:()=>t()})})});v("8NFma");var TP={};TP=function(e){return EM({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M17.66 8L12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8zM6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14H6z"}}]})(e)};let TT=R(({store:e})=>{let t=e.selectedShapes.length>0,n=t=>{t=Math.max(0,Math.min(t,100)),e.selectedShapes.forEach(e=>{e.set({opacity:t/100})})},r=Math.round(e.selectedShapes[0]?.opacity*100);return(0,b.jsx)(ym,{disabled:!t,minimal:!1,content:(0,b.jsxs)("div",{style:{padding:"10px 20px"},children:[(0,b.jsx)("div",{style:{textAlign:"center"},children:uM("toolbar.transparency")}),(0,b.jsxs)("div",{style:{display:"flex"},children:[(0,b.jsx)("div",{style:{paddingTop:"8px",paddingRight:"20px"},children:(0,b.jsx)(b2,{value:r,labelRenderer:!1,onChange:n,min:0,max:100})}),(0,b.jsx)(bq,{value:r,onValueChange:n,min:0,max:100,buttonPosition:"none",style:{width:"50px"},selectAllOnFocus:!0})]})]}),position:da.BOTTOM,children:(0,b.jsx)(yw,{content:uM("toolbar.transparency"),disabled:!t,position:da.BOTTOM,children:(0,b.jsx)(mc,{minimal:!0,disabled:!t,children:(0,b.jsx)(h(TP),{className:"bp5-icon",style:{fontSize:"20px"}})})})})});v("8NFma");var uq=v("gztBd"),C=v("8NFma"),g6=v("leH9B"),TA=C.forwardRef(function(e,t){var n=e.size>=g6.IconSize.LARGE,r=n?g6.IconSize.LARGE:g6.IconSize.STANDARD,i="".concat(-1*r/.05/2);return C.createElement(mt,(0,uq.__assign)({iconName:"cog",ref:t},e),C.createElement("path",{d:n?"M380 240H333.8C331 249.2 327.2000000000001 257.8 322.6 266L356.6 300C364.4000000000001 307.8 364.4000000000001 320.4 356.6 328.2L328.4000000000001 356.4C320.6 364.2 308.0000000000001 364.2 300.2000000000001 356.4L266.2000000000001 322.4C258.0000000000001 326.8 249.4000000000001 330.6 240.2000000000001 333.4V380C240.2000000000001 391 231.2000000000001 400 220.2000000000001 400H180C169 400 160 391 160 380V333.4C150.4 330.6 141.2 326.6 132.6 321.8L100 354.4C92.6 361.8 80.4 361.8 72.8 354.4L45.6 327.2C38.2 319.6 38.2 307.4 45.6 300L78 267.6C73.2 258.8 69.2 249.8 66.2 240H20C9 240 0 231 0 220V180C0 169 9 160 20 160H66.2C69 150.8 72.8 142.2 77.4 134L43.4 100C35.6 92.2 35.6 79.6 43.4 71.8L71.6 43.6C79.4 35.8 92 35.8 99.8 43.6L133.8 77.6C142 73.2 150.6 69.4 159.8 66.6V20C159.8 9 168.8 0 179.8 0H219.8C230.8 0 239.8 9 239.8 20V66.6C249.4 69.4 258.6 73.6 267.2 78.4L300 45.6C307.4 38.2 319.6 38.2 327.2 45.6L354.4 72.8C361.8 80.2 361.8 92.4 354.4 100L322 132.4C326.8 141 331 150.2000000000001 334 160H380C391 160 400 169 400 180V220C400 231 391 240 380 240zM200 120C155.8 120 120 155.8 120 200C120 244.2 155.8 280 200 280S280 244.2 280 200C280 155.8 244.2 120 200 120z":"M303.8 192.2H266.8C264.6 199.6 261.4 206.4 257.8 213L285 240.2C291.2 246.4000000000001 291.2 256.6 285 262.8L262.4000000000001 285.4C256.2 291.6 246 291.6 239.8000000000001 285.4L212.6000000000001 258.2C206 261.6 199.2 264.8 191.8 267V304.2C191.8 313 184.6 320.2 175.8 320.2H143.8C135 320.2 127.8 313 127.8 304.2V267C120 264.6 112.8 261.4 105.8 257.6L79.8 283.6C73.8 289.6 64 289.6 58 283.6L36.4 261.8C30.4 255.8 30.4 246 36.4 240L62.4 214C58.4 207.2 55.2 200 52.8 192.2H15.8C7 192.2 -0.2 185 -0.2 176.2V144.2C-0.2 135.4 7 128.2 15.8 128.2H52.8C55 120.8 58.2 114 61.8 107.4L34.6 80.2000000000001C28.4 74 28.4 63.8 34.6 57.6L57.2 35.0000000000001C63.4 28.8000000000001 73.6 28.8000000000001 79.8 35.0000000000001L107 62.2000000000001C113.6 58.6000000000001 120.4 55.6000000000001 127.8 53.4000000000001V16.2000000000001C127.8 7.4000000000001 135 0.2 143.8 0.2H175.8C184.6 0.2 191.8000000000001 7.4 191.8000000000001 16.2000000000001V53.4000000000001C199.6000000000001 55.8000000000001 206.8000000000001 59.0000000000001 213.8 62.8000000000001L239.8000000000001 36.8000000000001C245.8000000000001 30.8000000000001 255.6 30.8000000000001 261.6 36.8000000000001L283.4000000000001 58.6000000000001C289.4000000000001 64.6000000000001 289.4000000000001 74.4 283.4000000000001 80.4000000000001L257.4000000000001 106.4000000000001C261.2 113.4000000000001 264.6 120.6000000000001 267 128.4000000000001H304C312.8 128.4000000000001 320 135.6000000000001 320 144.4000000000001V176.4000000000001C319.8 185 312.6 192.2 303.8 192.2zM159.8 100.2C126.6 100.2 99.8 127 99.8 160.2S126.6 220.2 159.8 220.2S219.8 193.4 219.8 160.2S193 100.2 159.8 100.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")"),style:{transformOrigin:"center"}}))});TA.defaultProps={size:g6.IconSize.STANDARD},TA.displayName="Blueprint5.Icon.Cog";let Tj=R(({store:e})=>{let t=e.selectedElements.length>0,n=e.selectedElements[0]||{},r=t=>{e.selectedElements.forEach(e=>{e.set(t)})};return(0,b.jsx)(ym,{disabled:!t,minimal:!1,content:(0,b.jsxs)("div",{style:{padding:"15px",paddingTop:"25px",width:"220px"},children:[(0,b.jsx)(Oj,{checked:n.selectable,label:uM("toolbar.selectable"),onChange:e=>{r({selectable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.draggable,label:uM("toolbar.draggable"),onChange:e=>{r({draggable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.removable,label:uM("toolbar.removable"),onChange:e=>{r({removable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.resizable,label:uM("toolbar.resizable"),onChange:e=>{r({resizable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.contentEditable,label:uM("toolbar.contentEditable"),onChange:e=>{r({contentEditable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.styleEditable,label:uM("toolbar.styleEditable"),onChange:e=>{r({styleEditable:e.target.checked})},alignIndicator:dn.RIGHT}),(0,b.jsx)(Oj,{checked:n.alwaysOnTop,label:uM("toolbar.alwaysOnTop"),onChange:e=>{r({alwaysOnTop:e.target.checked})},alignIndicator:dn.RIGHT,style:{marginTop:"20px"}}),(0,b.jsx)(Oj,{checked:n.showInExport,label:uM("toolbar.showInExport"),onChange:e=>{r({showInExport:e.target.checked})},alignIndicator:dn.RIGHT,style:{marginTop:"20px"}})]}),position:da.BOTTOM,children:(0,b.jsx)(mc,{icon:(0,b.jsx)(TA,{}),minimal:!0,disabled:!t})})});v("8NFma");let TN=R(({store:e})=>{let{disabled:t,elementToCopy:n,setElementToCopy:r}=bb(e);return(0,b.jsx)(yw,{content:uM("toolbar.copyStyle"),disabled:t,children:(0,b.jsx)(mc,{icon:TR,active:!!n,intent:n?"primary":"none",minimal:!0,disabled:t,onClick:()=>{r(e.selectedElements[0])}})})}),TR=(0,b.jsx)("span",{className:"bp5-icon",children:(0,b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,b.jsx)("rect",{width:"16",height:"6",x:"2",y:"2",rx:"2"}),(0,b.jsx)("path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2"}),(0,b.jsx)("rect",{width:"4",height:"6",x:"8",y:"16",rx:"1"})]})}),TL={text:PS,image:PY,svg:PJ,many:Tv,line:Tt,video:Tl,figure:Tf,gif:Tg,page:TC},TI=aS("div")`
262
262
  white-space: nowrap;
263
263
 
264
264
  /* Add special style for a button with text inside, to make sure it has good with */
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { StoreType } from '../model/store';
3
+ export { ImageRemoveBackground } from './image-remove-background-button';
3
4
  type Props = {
4
5
  store: StoreType;
5
6
  components?: any;
@@ -1 +1 @@
1
- var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ImageToolbar=exports.ImageRemoveClip=exports.ImageCrop=exports.ImageClip=exports.ImageFitToBackground=void 0;const t=e(require("react")),o=require("mobx-react-lite"),r=require("@blueprintjs/core"),a=require("./element-container"),l=require("@blueprintjs/icons"),n=e(require("./filters-picker")),i=require("./animations-picker"),c=e(require("./flip-button")),m=require("../utils/flags"),u=require("./image-remove-background-button"),p=require("../utils/image"),s=require("../utils/l10n");exports.ImageFitToBackground=({element:e})=>t.default.createElement(r.Button,{text:(0,s.t)("toolbar.fitToBackground"),minimal:!0,onClick:async()=>{const{page:t}=e,o=t.computedWidth+2*t.bleed,r=t.computedHeight+2*t.bleed,a=await(0,p.getImageSize)(e.src),l=e.stretchEnabled?(0,p.getCrop)({width:o,height:r},a):{cropX:0,cropY:0,cropWidth:1,cropHeight:1};e.set(Object.assign({x:-t.bleed,y:-t.bleed,width:o,height:r,rotation:0},l))}}),exports.ImageClip=(0,o.observer)((({element:e,store:o,elements:a})=>e.contentEditable?e.clipSrc?t.default.createElement(r.Button,{text:(0,s.t)("toolbar.removeClip"),minimal:!0,onClickCapture:e=>{a.forEach((e=>{e.set({clipSrc:""})}))}}):t.default.createElement(r.Button,{minimal:!0,text:(0,s.t)("toolbar.clip"),onClickCapture:e=>{e.stopPropagation(),o.openSidePanel("image-clip")}}):null)),exports.ImageCrop=(0,o.observer)((({element:e,store:o})=>e.contentEditable?e.stretchEnabled?null:t.default.createElement(r.Tooltip,{content:(0,s.t)("toolbar.crop"),position:"bottom"},t.default.createElement(r.Button,{minimal:!0,icon:t.default.createElement(l.Crop,null),onClickCapture:t=>{t.stopPropagation(),e.toggleCropMode(!0)}})):null)),exports.ImageRemoveClip=(0,o.observer)((({element:e,store:o})=>e.clipSrc?t.default.createElement(r.Button,{text:(0,s.t)("toolbar.removeClip"),minimal:!0,onClickCapture:t=>{e.set({clipSrc:""})}}):null));const g={ImageFlip:c.default,ImageFilters:n.default,ImageFitToBackground:exports.ImageFitToBackground,ImageCrop:exports.ImageCrop,ImageClip:exports.ImageClip,ImageRemoveBackground:u.ImageRemoveBackground,ImageAnimations:i.AnimationsPicker};exports.ImageToolbar=(0,o.observer)((({store:e,components:o})=>{const n=e.selectedElements[0],i=n._cropModeEnabled,c=t.default.useRef({});t.default.useEffect((()=>{i&&(c.current={x:n.x,y:n.y,width:n.width,height:n.height,cropX:n.cropX,cropY:n.cropY,cropWidth:n.cropWidth,cropHeight:n.cropHeight})}),[i]);const u=["ImageFlip","ImageFilters","ImageFitToBackground","ImageClip","ImageCrop",m.flags.animationsEnabled&&"ImageAnimations",m.flags.removeBackgroundEnabled&&"ImageRemoveBackground"],p=(0,a.extendToolbar)({type:"image",usedItems:u,components:o});return t.default.createElement(t.default.Fragment,null,!i&&t.default.createElement(a.ElementContainer,{items:p,itemRender:r=>{const a=o[r]||g[r];return t.default.createElement(a,{element:n,store:e,key:r,elements:e.selectedElements})}}),i&&t.default.createElement(r.Navbar.Group,null,t.default.createElement(r.Button,{text:(0,s.t)("toolbar.cropDone"),minimal:!0,icon:t.default.createElement(l.Tick,null),onClickCapture:e=>{n.toggleCropMode(!1)}}),t.default.createElement(r.Button,{text:(0,s.t)("toolbar.cropCancel"),minimal:!0,icon:t.default.createElement(l.Cross,null),onClickCapture:e=>{n.set(Object.assign({},c.current)),n.toggleCropMode(!1)}})))})),exports.default=exports.ImageToolbar;
1
+ var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ImageToolbar=exports.ImageRemoveClip=exports.ImageCrop=exports.ImageClip=exports.ImageFitToBackground=exports.ImageRemoveBackground=void 0;const t=e(require("react")),o=require("mobx-react-lite"),r=require("@blueprintjs/core"),a=require("./element-container"),l=require("@blueprintjs/icons"),n=e(require("./filters-picker")),i=require("./animations-picker"),m=e(require("./flip-button")),c=require("../utils/flags"),u=require("./image-remove-background-button");var p=require("./image-remove-background-button");Object.defineProperty(exports,"ImageRemoveBackground",{enumerable:!0,get:function(){return p.ImageRemoveBackground}});const s=require("../utils/image"),g=require("../utils/l10n");exports.ImageFitToBackground=({element:e})=>t.default.createElement(r.Button,{text:(0,g.t)("toolbar.fitToBackground"),minimal:!0,onClick:async()=>{const{page:t}=e,o=t.computedWidth+2*t.bleed,r=t.computedHeight+2*t.bleed,a=await(0,s.getImageSize)(e.src),l=e.stretchEnabled?{cropX:0,cropY:0,cropWidth:1,cropHeight:1}:(0,s.getCrop)({width:o,height:r},a);e.set(Object.assign({x:-t.bleed,y:-t.bleed,width:o,height:r,rotation:0},l))}}),exports.ImageClip=(0,o.observer)((({element:e,store:o,elements:a})=>e.contentEditable?e.clipSrc?t.default.createElement(r.Button,{text:(0,g.t)("toolbar.removeClip"),minimal:!0,onClickCapture:e=>{a.forEach((e=>{e.set({clipSrc:""})}))}}):t.default.createElement(r.Button,{minimal:!0,text:(0,g.t)("toolbar.clip"),onClickCapture:e=>{e.stopPropagation(),o.openSidePanel("image-clip")}}):null)),exports.ImageCrop=(0,o.observer)((({element:e,store:o})=>e.contentEditable?e.stretchEnabled?null:t.default.createElement(r.Tooltip,{content:(0,g.t)("toolbar.crop"),position:"bottom"},t.default.createElement(r.Button,{minimal:!0,icon:t.default.createElement(l.Crop,null),onClickCapture:t=>{t.stopPropagation(),e.toggleCropMode(!0)}})):null)),exports.ImageRemoveClip=(0,o.observer)((({element:e,store:o})=>e.clipSrc?t.default.createElement(r.Button,{text:(0,g.t)("toolbar.removeClip"),minimal:!0,onClickCapture:t=>{e.set({clipSrc:""})}}):null));const d={ImageFlip:m.default,ImageFilters:n.default,ImageFitToBackground:exports.ImageFitToBackground,ImageCrop:exports.ImageCrop,ImageClip:exports.ImageClip,ImageRemoveBackground:u.ImageRemoveBackground,ImageAnimations:i.AnimationsPicker};exports.ImageToolbar=(0,o.observer)((({store:e,components:o})=>{const n=e.selectedElements[0],i=n._cropModeEnabled,m=t.default.useRef({});t.default.useEffect((()=>{i&&(m.current={x:n.x,y:n.y,width:n.width,height:n.height,cropX:n.cropX,cropY:n.cropY,cropWidth:n.cropWidth,cropHeight:n.cropHeight})}),[i]);const u=["ImageFlip","ImageFilters","ImageFitToBackground","ImageClip","ImageCrop",c.flags.animationsEnabled&&"ImageAnimations",c.flags.removeBackgroundEnabled&&"ImageRemoveBackground"],p=(0,a.extendToolbar)({type:"image",usedItems:u,components:o});return t.default.createElement(t.default.Fragment,null,!i&&t.default.createElement(a.ElementContainer,{items:p,itemRender:r=>{const a=o[r]||d[r];return t.default.createElement(a,{element:n,store:e,key:r,elements:e.selectedElements})}}),i&&t.default.createElement(r.Navbar.Group,null,t.default.createElement(r.Button,{text:(0,g.t)("toolbar.cropDone"),minimal:!0,icon:t.default.createElement(l.Tick,null),onClickCapture:e=>{n.toggleCropMode(!1)}}),t.default.createElement(r.Button,{text:(0,g.t)("toolbar.cropCancel"),minimal:!0,icon:t.default.createElement(l.Cross,null),onClickCapture:e=>{n.set(Object.assign({},m.current)),n.toggleCropMode(!1)}})))})),exports.default=exports.ImageToolbar;
@@ -1 +1 @@
1
- var e,t=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var o in e){Object.prototype.hasOwnProperty.call(e,o)&&(t[t.length]=o)}return t},e(t)},function(n){if(n&&n.__esModule){return n}var r={};if(null!=n){for(var i=e(n),a=0;a<i.length;a++){"default"!==i[a]&&t(r,n,i[a])}}return o(r,n),r});Object.defineProperty(exports,"__esModule",{value:!0}),exports.__=exports.getKey=exports.isCreditVisible=exports.___=void 0,exports.isKeyPaid=w,exports.validateKey=async function(e,t){u=e,await w(e)&&!t||c()};const r=n(require("mobx")),i=require("./api"),a=require("./flags"),s=r.observable({value:!1}),l=r.observable({value:"v1"});exports.___=()=>l.value,exports.isCreditVisible=()=>s.value;const c=r.action((()=>{s.value=!0}));let u="";exports.getKey=()=>u||"";const d=5,p=3e3,g="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",v="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",f="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",b="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let _=window.location.origin;const m=navigator.userAgent.indexOf("Headless")>-1,h=navigator.userAgent.indexOf("Electron")>-1;"file://"===_&&m&&(_="headless"),"file://"===_&&h&&(_="electron");const y=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${_}" here: https://polotno.com/cabinet`;let P=fetch;async function w(e){for(let o=0;o<d;o++){try{const t=await P((0,i.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host,skdVersion:"2.22.1"})});if(l.value=t.headers.get("x-api-version"),!e){return console.warn(g),!1}if(200!==t.status){await new Promise((e=>setTimeout(e,p)));continue}const o=await t.json();return o.is_valid||console.warn(v),o.is_paid||console.log(b,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),o.is_domain_valid||console.log(y,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,a.useRemoveBackground)(o.remove_background_enabled),o.is_paid||!1}catch(t){await new Promise((e=>setTimeout(e,p)))}}return console.error(f),!0}exports.__=e=>{P=e};
1
+ var e,t=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var o in e){Object.prototype.hasOwnProperty.call(e,o)&&(t[t.length]=o)}return t},e(t)},function(n){if(n&&n.__esModule){return n}var r={};if(null!=n){for(var i=e(n),a=0;a<i.length;a++){"default"!==i[a]&&t(r,n,i[a])}}return o(r,n),r});Object.defineProperty(exports,"__esModule",{value:!0}),exports.__=exports.getKey=exports.isCreditVisible=exports.___=void 0,exports.isKeyPaid=w,exports.validateKey=async function(e,t){u=e,await w(e)&&!t||c()};const r=n(require("mobx")),i=require("./api"),a=require("./flags"),s=r.observable({value:!1}),l=r.observable({value:"v1"});exports.___=()=>l.value,exports.isCreditVisible=()=>s.value;const c=r.action((()=>{s.value=!0}));let u="";exports.getKey=()=>u||"";const d=5,p=3e3,g="Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet",v="Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet",f="Can not validate Polotno API key. Please report to anton@polotno.com immediately.",b="%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/";let _=window.location.origin;const m=navigator.userAgent.indexOf("Headless")>-1,h=navigator.userAgent.indexOf("Electron")>-1;"file://"===_&&m&&(_="headless"),"file://"===_&&h&&(_="electron");const y=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${_}" here: https://polotno.com/cabinet`;let P=fetch;async function w(e){for(let o=0;o<d;o++){try{const t=await P((0,i.getAPI)()+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host,skdVersion:"2.22.2"})});if(l.value=t.headers.get("x-api-version"),!e){return console.warn(g),!1}if(200!==t.status){await new Promise((e=>setTimeout(e,p)));continue}const o=await t.json();return o.is_valid||console.warn(v),o.is_paid||console.log(b,"background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),o.is_domain_valid||console.log(y,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,a.useRemoveBackground)(o.remove_background_enabled),o.is_paid||!1}catch(t){await new Promise((e=>setTimeout(e,p)))}}return console.error(f),!0}exports.__=e=>{P=e};