@emailmaker/emailmaker 1.1.27 → 1.1.30

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.
Files changed (109) hide show
  1. package/{emailmaker-core.06547314.js → emailmaker-core.2378a16e.js} +1 -1
  2. package/emailmaker-esm.js +4 -4
  3. package/emailmaker.d.ts +9 -3
  4. package/emailmaker.js +12 -12
  5. package/iframe/js/amp.BLBsfH3J.js +1 -0
  6. package/iframe/js/iframe-eblock.js +1 -1
  7. package/iframe/js/iframe.js +1 -1
  8. package/iframe/js/rules.CNqvmp_P.js +1 -1
  9. package/package.json +1 -1
  10. package/runtime/@ant-design/cssinjs/index.js +1 -1
  11. package/runtime/@ant-design/icons/index.js +1 -1
  12. package/runtime/THIRD_PARTY_LICENSES.txt +536 -665
  13. package/runtime/antd/index.js +1 -1
  14. package/runtime/dayjs/index.js +1 -1
  15. package/runtime/react-router-dom/index.js +1 -1
  16. package/singlepage_headless_plugin.html +1 -1
  17. package/static/core/1a531120.js +1 -0
  18. package/static/core/1c4f1288.js +1 -0
  19. package/static/core/24359c2b2.js +1 -0
  20. package/static/core/25d26369.js +506 -0
  21. package/static/core/2a386d94.js +1 -0
  22. package/static/core/2c8c1708.js +1 -0
  23. package/static/core/{d5fdc4a4.js → 3509b8fe.js} +1 -1
  24. package/static/core/3c4d8253.js +3 -0
  25. package/static/core/4030e367.js +1 -0
  26. package/static/core/{4da0e58b.js → 4685dd44.js} +2 -2
  27. package/static/core/4a9d6b60.js +20 -0
  28. package/static/core/4d479101.js +1 -0
  29. package/static/core/4d7a8040.js +51 -0
  30. package/static/core/{ca5b168d.js → 50b3488f.js} +4 -4
  31. package/static/core/558afaa1.js +1 -0
  32. package/static/core/5ef557ea.js +895 -0
  33. package/static/core/{8bfabb4b.js → 6301b88d.js} +3 -3
  34. package/static/core/6684fd2f.js +1 -0
  35. package/static/core/69624945.js +1 -0
  36. package/static/core/69be5772.js +4 -0
  37. package/static/core/816e810f.js +1 -0
  38. package/static/core/81b54c02.js +1 -0
  39. package/static/core/872f2250.js +1 -0
  40. package/static/core/8d43cba9.js +1 -0
  41. package/static/core/{3ba2a2df.js → 91634ef3.js} +1 -1
  42. package/static/core/94c870c4.js +1 -0
  43. package/static/core/a7e4541a2.js +1 -0
  44. package/static/core/b15cf28a.js +1 -0
  45. package/static/core/b17207dd.js +1 -0
  46. package/static/core/b7559974.js +1 -0
  47. package/static/core/b8fdbfee.js +1 -0
  48. package/static/core/c229e862.js +1 -0
  49. package/static/core/{b949d092.js → ca58f6cf.js} +2 -2
  50. package/static/core/dd3de504.js +1 -0
  51. package/static/core/{2834aa992.js → e462ce36.js} +1 -1
  52. package/static/core/e4ba0190.js +1 -0
  53. package/static/core/e52ae9f3.js +1 -0
  54. package/static/core/ed6c0f8c.js +78 -0
  55. package/static/core/f7436c59.js +1 -0
  56. package/static/esm/{e2baef14.js → cce60606.js} +1 -1
  57. package/static/esm/{b9d66884.js → fd91741d.js} +1 -1
  58. package/static/runtime/DownloadOutlined-C-5Yi5xA.js +76 -0
  59. package/static/runtime/dayjs.min-7qDGpCH7.js +1 -0
  60. package/static/runtime/defineProperty-DxTQfsxO.js +1 -0
  61. package/static/runtime/dist-C0p5hVla.js +2 -0
  62. package/static/runtime/es-DhckSY88.js +315 -0
  63. package/static/runtime/es-jkBfKdP4.js +2 -0
  64. package/static/runtime/es-rvjSIqny.js +1 -0
  65. package/two_step_headless_plugin.html +1 -1
  66. package/ui-kit/index.js +2041 -1934
  67. package/iframe/js/amp.BbapYQ7c.js +0 -1
  68. package/static/core/17465e1c.js +0 -1
  69. package/static/core/18a6d849.js +0 -1
  70. package/static/core/22b69a93.js +0 -1
  71. package/static/core/265a0618.js +0 -51
  72. package/static/core/3534defe.js +0 -1
  73. package/static/core/3cb2fef0.js +0 -1
  74. package/static/core/3dfe5446.js +0 -1
  75. package/static/core/4cddd021.js +0 -1
  76. package/static/core/59092da8.js +0 -1
  77. package/static/core/5dd75b49.js +0 -1
  78. package/static/core/6722afef.js +0 -3
  79. package/static/core/6c2b8cb5.js +0 -471
  80. package/static/core/74011820.js +0 -1
  81. package/static/core/79109d5b.js +0 -78
  82. package/static/core/7aa95ea1.js +0 -1
  83. package/static/core/7eebfbce.js +0 -1
  84. package/static/core/837725bd.js +0 -1
  85. package/static/core/85496899.js +0 -1
  86. package/static/core/92ad1565.js +0 -596
  87. package/static/core/94e76300.js +0 -1
  88. package/static/core/986fd329.js +0 -1
  89. package/static/core/a3e9b2eb.js +0 -20
  90. package/static/core/b33fb533.js +0 -1
  91. package/static/core/bb856264.js +0 -1
  92. package/static/core/c00287f4.js +0 -1
  93. package/static/core/cab85799.js +0 -1
  94. package/static/core/cb2faa14.js +0 -1
  95. package/static/core/d80716fa.js +0 -1
  96. package/static/core/e46bb831.js +0 -1
  97. package/static/core/e7ac5f93.js +0 -1
  98. package/static/core/eba78550.js +0 -1
  99. package/static/core/ed4a83c82.js +0 -1
  100. package/static/core/f6e0d03e.js +0 -1
  101. package/static/core/f89f369f.js +0 -833
  102. package/static/runtime/DownloadOutlined-Czug__JA.js +0 -1
  103. package/static/runtime/dayjs.min-BktkwxcQ.js +0 -1
  104. package/static/runtime/dist-B1ZrbBVP.js +0 -2
  105. package/static/runtime/es-Dt0MDtMm.js +0 -5
  106. package/static/runtime/es-LbCQ86AJ.js +0 -444
  107. package/static/runtime/es-n8SS20ln.js +0 -55
  108. /package/iframe/{iframe-eblock.06547314.html → iframe-eblock.2378a16e.html} +0 -0
  109. /package/iframe/{iframe.06547314.html → iframe.2378a16e.html} +0 -0
@@ -1,596 +0,0 @@
1
- __emailmaker__.define(`static/core/92ad1565.js`,[`require`,`exports`,`module`,`static/core/354bf8a9.js`,`static/core/f6e0d03e.js`,`static/core/85496899.js`,`static/core/22b69a93.js`,`react`,`react-dom`,`react/jsx-runtime`,`antd`,`react-dom/client`,`classnames`,`@ant-design/cssinjs`,`@ant-design/icons`],function(e,t,n){let r=e("./354bf8a9.js"),i=e("./f6e0d03e.js"),a=e("./85496899.js"),o=e("./22b69a93.js"),s=e("react");s=r.l(s);let c=e("react-dom");c=r.l(c);let l=e("react/jsx-runtime"),u=e("antd"),d=e("react-dom/client"),f=e("classnames");f=r.l(f);let p=e("@ant-design/cssinjs"),m=e("@ant-design/icons");m=r.l(m);function h(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){if(e){if(typeof e==`string`)return h(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function _(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function x(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x=function(){return!!e})()}function S(e,t){if(t&&(i.i(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return _(e)}function C(e){var t=x();return function(){var n,r=b(e);if(t){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return S(this,n)}}function w(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function T(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,i.r(r.key),r)}}function E(e,t,n){return t&&T(e.prototype,t),n&&T(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}r.i(),r.n();function D(e,t,n){return t=b(t),S(e,x()?Reflect.construct(t,n||[],b(e).constructor):t.apply(e,n))}var O={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z`}}]},name:`check-circle`,theme:`filled`};function k(e){if(Array.isArray(e))return e}function A(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function j(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M(e,t){return k(e)||A(e,t)||g(e,t)||j()}function N(e,t){if(e==null)return{};var n,r,i=a.t(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var P=Math.round;function F(e,t){let n=e.replace(/^[^(]*\((.*)/,`$1`).replace(/\).*/,``).match(/\d*\.?\d+%?/g)||[],r=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)r[e]=t(r[e]||0,n[e]||``,e);return n[3]?r[3]=n[3].includes(`%`)?r[3]/100:r[3]:r[3]=1,r}var I=(e,t,n)=>n===0?e:e/100;function L(e,t){let n=t||255;return e>n?n:e<0?0:e}var R=class e{constructor(t){i.n(this,`isValid`,!0),i.n(this,`r`,0),i.n(this,`g`,0),i.n(this,`b`,0),i.n(this,`a`,1),i.n(this,`_h`,void 0),i.n(this,`_s`,void 0),i.n(this,`_l`,void 0),i.n(this,`_v`,void 0),i.n(this,`_max`,void 0),i.n(this,`_min`,void 0),i.n(this,`_brightness`,void 0);function n(e){return e[0]in t&&e[1]in t&&e[2]in t}if(t)if(typeof t==`string`){let e=t.trim();function n(t){return e.startsWith(t)}/^#?[A-F\d]{3,8}$/i.test(e)?this.fromHexString(e):n(`rgb`)?this.fromRgbString(e):n(`hsl`)?this.fromHslString(e):(n(`hsv`)||n(`hsb`))&&this.fromHsvString(e)}else if(t instanceof e)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n(`rgb`))this.r=L(t.r),this.g=L(t.g),this.b=L(t.b),this.a=typeof t.a==`number`?L(t.a,1):1;else if(n(`hsl`))this.fromHsl(t);else if(n(`hsv`))this.fromHsv(t);else throw Error(`@ant-design/fast-color: unsupported input `+JSON.stringify(t))}setR(e){return this._sc(`r`,e)}setG(e){return this._sc(`g`,e)}setB(e){return this._sc(`b`,e)}setA(e){return this._sc(`a`,e,1)}setHue(e){let t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let t=e(this.r),n=e(this.g),r=e(this.b);return .2126*t+.7152*n+.0722*r}getHue(){if(this._h===void 0){let e=this.getMax()-this.getMin();e===0?this._h=0:this._h=P(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(this._s===void 0){let e=this.getMax()-this.getMin();e===0?this._s=0:this._s=e/this.getMax()}return this._s}getLightness(){return this._l===void 0&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return this._v===void 0&&(this._v=this.getMax()/255),this._v}getBrightness(){return this._brightness===void 0&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){let t=this.getHue(),n=this.getSaturation(),r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(e=10){let t=this.getHue(),n=this.getSaturation(),r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){let n=this._c(e),r=t/100,i=e=>(n[e]-this[e])*r+this[e],a={r:P(i(`r`)),g:P(i(`g`)),b:P(i(`b`)),a:P(i(`a`)*100)/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){let t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>P((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r(`r`),g:r(`g`),b:r(`b`),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e=`#`,t=(this.r||0).toString(16);e+=t.length===2?t:`0`+t;let n=(this.g||0).toString(16);e+=n.length===2?n:`0`+n;let r=(this.b||0).toString(16);if(e+=r.length===2?r:`0`+r,typeof this.a==`number`&&this.a>=0&&this.a<1){let t=P(this.a*255).toString(16);e+=t.length===2?t:`0`+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){let e=this.getHue(),t=P(this.getSaturation()*100),n=P(this.getLightness()*100);return this.a===1?`hsl(${e},${t}%,${n}%)`:`hsla(${e},${t}%,${n}%,${this.a})`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${this.a})`}toString(){return this.toRgbString()}_sc(e,t,n){let r=this.clone();return r[e]=L(t,n),r}_c(e){return new this.constructor(e)}getMax(){return this._max===void 0&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return this._min===void 0&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){let t=e.replace(`#`,``);function n(e,n){return parseInt(t[e]+t[n||e],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a=typeof r==`number`?r:1,t<=0){let e=P(n*255);this.r=e,this.g=e,this.b=e}let i=0,a=0,o=0,s=e/60,c=(1-Math.abs(2*n-1))*t,l=c*(1-Math.abs(s%2-1));s>=0&&s<1?(i=c,a=l):s>=1&&s<2?(i=l,a=c):s>=2&&s<3?(a=c,o=l):s>=3&&s<4?(a=l,o=c):s>=4&&s<5?(i=l,o=c):s>=5&&s<6&&(i=c,o=l);let u=n-c/2;this.r=P((i+u)*255),this.g=P((a+u)*255),this.b=P((o+u)*255)}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a=typeof r==`number`?r:1;let i=P(n*255);if(this.r=i,this.g=i,this.b=i,t<=0)return;let a=e/60,o=Math.floor(a),s=a-o,c=P(n*(1-t)*255),l=P(n*(1-t*s)*255),u=P(n*(1-t*(1-s))*255);switch(o){case 0:this.g=u,this.b=c;break;case 1:this.r=l,this.b=c;break;case 2:this.r=c,this.b=u;break;case 3:this.r=c,this.g=l;break;case 4:this.r=u,this.g=c;break;default:this.g=c,this.b=l;break}}fromHsvString(e){let t=F(e,I);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){let t=F(e,I);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){let t=F(e,(e,t)=>t.includes(`%`)?P(e/100*255):e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}},z=2,ee=.16,B=.05,te=.05,ne=.15,re=5,ie=4,ae=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function oe(e,t,n){var r=Math.round(e.h)>=60&&Math.round(e.h)<=240?n?Math.round(e.h)-z*t:Math.round(e.h)+z*t:n?Math.round(e.h)+z*t:Math.round(e.h)-z*t;return r<0?r+=360:r>=360&&(r-=360),r}function se(e,t,n){if(e.h===0&&e.s===0)return e.s;var r=n?e.s-ee*t:t===ie?e.s+ee:e.s+B*t;return r>1&&(r=1),n&&t===re&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function ce(e,t,n){var r=n?e.v+te*t:e.v-ne*t;return r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function le(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=new R(e),i=r.toHsv(),a=re;a>0;--a){var o=new R({h:oe(i,a,!0),s:se(i,a,!0),v:ce(i,a,!0)});n.push(o)}n.push(r);for(var s=1;s<=ie;s+=1){var c=new R({h:oe(i,s),s:se(i,s),v:ce(i,s)});n.push(c)}return t.theme===`dark`?ae.map(function(e){var r=e.index,i=e.amount;return new R(t.backgroundColor||`#141414`).mix(n[r],i).toHexString()}):n.map(function(e){return e.toHexString()})}var ue={red:`#F5222D`,volcano:`#FA541C`,orange:`#FA8C16`,gold:`#FAAD14`,yellow:`#FADB14`,lime:`#A0D911`,green:`#52C41A`,cyan:`#13C2C2`,blue:`#1677FF`,geekblue:`#2F54EB`,purple:`#722ED1`,magenta:`#EB2F96`,grey:`#666666`},de=[`#fff1f0`,`#ffccc7`,`#ffa39e`,`#ff7875`,`#ff4d4f`,`#f5222d`,`#cf1322`,`#a8071a`,`#820014`,`#5c0011`];de.primary=de[5];var fe=[`#fff2e8`,`#ffd8bf`,`#ffbb96`,`#ff9c6e`,`#ff7a45`,`#fa541c`,`#d4380d`,`#ad2102`,`#871400`,`#610b00`];fe.primary=fe[5];var pe=[`#fff7e6`,`#ffe7ba`,`#ffd591`,`#ffc069`,`#ffa940`,`#fa8c16`,`#d46b08`,`#ad4e00`,`#873800`,`#612500`];pe.primary=pe[5];var me=[`#fffbe6`,`#fff1b8`,`#ffe58f`,`#ffd666`,`#ffc53d`,`#faad14`,`#d48806`,`#ad6800`,`#874d00`,`#613400`];me.primary=me[5];var he=[`#feffe6`,`#ffffb8`,`#fffb8f`,`#fff566`,`#ffec3d`,`#fadb14`,`#d4b106`,`#ad8b00`,`#876800`,`#614700`];he.primary=he[5];var ge=[`#fcffe6`,`#f4ffb8`,`#eaff8f`,`#d3f261`,`#bae637`,`#a0d911`,`#7cb305`,`#5b8c00`,`#3f6600`,`#254000`];ge.primary=ge[5];var _e=[`#f6ffed`,`#d9f7be`,`#b7eb8f`,`#95de64`,`#73d13d`,`#52c41a`,`#389e0d`,`#237804`,`#135200`,`#092b00`];_e.primary=_e[5];var ve=[`#e6fffb`,`#b5f5ec`,`#87e8de`,`#5cdbd3`,`#36cfc9`,`#13c2c2`,`#08979c`,`#006d75`,`#00474f`,`#002329`];ve.primary=ve[5];var ye=[`#e6f4ff`,`#bae0ff`,`#91caff`,`#69b1ff`,`#4096ff`,`#1677ff`,`#0958d9`,`#003eb3`,`#002c8c`,`#001d66`];ye.primary=ye[5];var be=[`#f0f5ff`,`#d6e4ff`,`#adc6ff`,`#85a5ff`,`#597ef7`,`#2f54eb`,`#1d39c4`,`#10239e`,`#061178`,`#030852`];be.primary=be[5];var xe=[`#f9f0ff`,`#efdbff`,`#d3adf7`,`#b37feb`,`#9254de`,`#722ed1`,`#531dab`,`#391085`,`#22075e`,`#120338`];xe.primary=xe[5];var Se=[`#fff0f6`,`#ffd6e7`,`#ffadd2`,`#ff85c0`,`#f759ab`,`#eb2f96`,`#c41d7f`,`#9e1068`,`#780650`,`#520339`];Se.primary=Se[5];var Ce=[`#a6a6a6`,`#999999`,`#8c8c8c`,`#808080`,`#737373`,`#666666`,`#404040`,`#1a1a1a`,`#000000`,`#000000`];Ce.primary=Ce[5];var we={red:de,volcano:fe,orange:pe,gold:me,yellow:he,lime:ge,green:_e,cyan:ve,blue:ye,geekblue:be,purple:xe,magenta:Se,grey:Ce},Te=[`#2a1215`,`#431418`,`#58181c`,`#791a1f`,`#a61d24`,`#d32029`,`#e84749`,`#f37370`,`#f89f9a`,`#fac8c3`];Te.primary=Te[5];var Ee=[`#2b1611`,`#441d12`,`#592716`,`#7c3118`,`#aa3e19`,`#d84a1b`,`#e87040`,`#f3956a`,`#f8b692`,`#fad4bc`];Ee.primary=Ee[5];var De=[`#2b1d11`,`#442a11`,`#593815`,`#7c4a15`,`#aa6215`,`#d87a16`,`#e89a3c`,`#f3b765`,`#f8cf8d`,`#fae3b7`];De.primary=De[5];var Oe=[`#2b2111`,`#443111`,`#594214`,`#7c5914`,`#aa7714`,`#d89614`,`#e8b339`,`#f3cc62`,`#f8df8b`,`#faedb5`];Oe.primary=Oe[5];var ke=[`#2b2611`,`#443b11`,`#595014`,`#7c6e14`,`#aa9514`,`#d8bd14`,`#e8d639`,`#f3ea62`,`#f8f48b`,`#fafab5`];ke.primary=ke[5];var Ae=[`#1f2611`,`#2e3c10`,`#3e4f13`,`#536d13`,`#6f9412`,`#8bbb11`,`#a9d134`,`#c9e75d`,`#e4f88b`,`#f0fab5`];Ae.primary=Ae[5];var je=[`#162312`,`#1d3712`,`#274916`,`#306317`,`#3c8618`,`#49aa19`,`#6abe39`,`#8fd460`,`#b2e58b`,`#d5f2bb`];je.primary=je[5];var Me=[`#112123`,`#113536`,`#144848`,`#146262`,`#138585`,`#13a8a8`,`#33bcb7`,`#58d1c9`,`#84e2d8`,`#b2f1e8`];Me.primary=Me[5];var Ne=[`#111a2c`,`#112545`,`#15325b`,`#15417e`,`#1554ad`,`#1668dc`,`#3c89e8`,`#65a9f3`,`#8dc5f8`,`#b7dcfa`];Ne.primary=Ne[5];var Pe=[`#131629`,`#161d40`,`#1c2755`,`#203175`,`#263ea0`,`#2b4acb`,`#5273e0`,`#7f9ef3`,`#a8c1f8`,`#d2e0fa`];Pe.primary=Pe[5];var Fe=[`#1a1325`,`#24163a`,`#301c4d`,`#3e2069`,`#51258f`,`#642ab5`,`#854eca`,`#ab7ae0`,`#cda8f0`,`#ebd7fa`];Fe.primary=Fe[5];var Ie=[`#291321`,`#40162f`,`#551c3b`,`#75204f`,`#a02669`,`#cb2b83`,`#e0529c`,`#f37fb7`,`#f8a8cc`,`#fad2e3`];Ie.primary=Ie[5];var Le=[`#151515`,`#1f1f1f`,`#2d2d2d`,`#393939`,`#494949`,`#5a5a5a`,`#6a6a6a`,`#7b7b7b`,`#888888`,`#969696`];Le.primary=Le[5];var Re=(0,s.createContext)({});function ze(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function Be(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var Ve=`data-rc-order`,He=`data-rc-priority`,Ue=`rc-util-key`,We=new Map;function Ge(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).mark;return e?e.startsWith(`data-`)?e:`data-${e}`:Ue}function Ke(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function qe(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function Je(e){return Array.from((We.get(e)||e).children).filter(function(e){return e.tagName===`STYLE`})}function Ye(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!ze())return null;var n=t.csp,r=t.prepend,i=t.priority,a=i===void 0?0:i,o=qe(r),s=o===`prependQueue`,c=document.createElement(`style`);c.setAttribute(Ve,o),s&&a&&c.setAttribute(He,`${a}`),n!=null&&n.nonce&&(c.nonce=n?.nonce),c.innerHTML=e;var l=Ke(t),u=l.firstChild;if(r){if(s){var d=(t.styles||Je(l)).filter(function(e){return[`prepend`,`prependQueue`].includes(e.getAttribute(Ve))?a>=Number(e.getAttribute(He)||0):!1});if(d.length)return l.insertBefore(c,d[d.length-1].nextSibling),c}l.insertBefore(c,u)}else l.appendChild(c);return c}function Xe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=Ke(t);return(t.styles||Je(n)).find(function(n){return n.getAttribute(Ge(t))===e})}function Ze(e,t){var n=We.get(e);if(!n||!Be(document,n)){var r=Ye(``,t),i=r.parentNode;We.set(e,i),e.removeChild(r)}}function Qe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=Ke(n),a=Je(r),o=i.t(i.t({},n),{},{styles:a});Ze(r,o);var s=Xe(t,o);if(s){var c;return(c=o.csp)!=null&&c.nonce&&s.nonce!==o.csp?.nonce&&(s.nonce=o.csp?.nonce),s.innerHTML!==e&&(s.innerHTML=e),s}var l=Ye(e,o);return l.setAttribute(Ge(o),t),l}function $e(e){var t;return e==null||(t=e.getRootNode)==null?void 0:t.call(e)}function et(e){return $e(e)instanceof ShadowRoot}function tt(e){return et(e)?$e(e):null}var nt={},rt=[],it=function(e){rt.push(e)};function at(e,t){}function ot(e,t){}function st(){nt={}}function ct(e,t,n){!t&&!nt[n]&&(e(!1,n),nt[n]=!0)}function lt(e,t){ct(at,e,t)}function ut(e,t){ct(ot,e,t)}lt.preMessage=it,lt.resetWarned=st,lt.noteOnce=ut;function dt(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function ft(e,t){lt(e,`[@ant-design/icons] ${t}`)}function pt(e){return i.i(e)===`object`&&typeof e.name==`string`&&typeof e.theme==`string`&&(i.i(e.icon)===`object`||typeof e.icon==`function`)}function mt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case`class`:t.className=r,delete t.class;break;default:delete t[n],t[dt(n)]=r}return t},{})}function ht(e,t,n){return n?s.default.createElement(e.tag,i.t(i.t({key:t},mt(e.attrs)),n),(e.children||[]).map(function(n,r){return ht(n,`${t}-${e.tag}-${r}`)})):s.default.createElement(e.tag,i.t({key:t},mt(e.attrs)),(e.children||[]).map(function(n,r){return ht(n,`${t}-${e.tag}-${r}`)}))}function gt(e){return le(e)[0]}function _t(e){return e?Array.isArray(e)?e:[e]:[]}var vt=`
3
- .anticon {
4
- display: inline-flex;
5
- align-items: center;
6
- color: inherit;
7
- font-style: normal;
8
- line-height: 0;
9
- text-align: center;
10
- text-transform: none;
11
- vertical-align: -0.125em;
12
- text-rendering: optimizeLegibility;
13
- -webkit-font-smoothing: antialiased;
14
- -moz-osx-font-smoothing: grayscale;
15
- }
16
-
17
- .anticon > * {
18
- line-height: 1;
19
- }
20
-
21
- .anticon svg {
22
- display: inline-block;
23
- }
24
-
25
- .anticon::before {
26
- display: none;
27
- }
28
-
29
- .anticon .anticon-icon {
30
- display: block;
31
- }
32
-
33
- .anticon[tabindex] {
34
- cursor: pointer;
35
- }
36
-
37
- .anticon-spin::before,
38
- .anticon-spin {
39
- display: inline-block;
40
- -webkit-animation: loadingCircle 1s infinite linear;
41
- animation: loadingCircle 1s infinite linear;
42
- }
43
-
44
- @-webkit-keyframes loadingCircle {
45
- 100% {
46
- -webkit-transform: rotate(360deg);
47
- transform: rotate(360deg);
48
- }
49
- }
50
-
51
- @keyframes loadingCircle {
52
- 100% {
53
- -webkit-transform: rotate(360deg);
54
- transform: rotate(360deg);
55
- }
56
- }
57
- `,yt=function(e){var t=(0,s.useContext)(Re),n=t.csp,r=t.prefixCls,i=t.layer,a=vt;r&&(a=a.replace(/anticon/g,r)),i&&(a=`@layer ${i} {
58
- ${a}
59
- }`),(0,s.useEffect)(function(){var t=e.current,r=tt(t);Qe(a,`@ant-design-icons`,{prepend:!i,csp:n,attachTo:r})},[])},bt=[`icon`,`className`,`onClick`,`style`,`primaryColor`,`secondaryColor`],xt={primaryColor:`#333`,secondaryColor:`#E6E6E6`,calculated:!1};function St(e){var t=e.primaryColor,n=e.secondaryColor;xt.primaryColor=t,xt.secondaryColor=n||gt(t),xt.calculated=!!n}function Ct(){return i.t({},xt)}var wt=function(e){var t=e.icon,n=e.className,r=e.onClick,a=e.style,o=e.primaryColor,c=e.secondaryColor,l=N(e,bt),u=s.useRef(),d=xt;if(o&&(d={primaryColor:o,secondaryColor:c||gt(o)}),yt(u),ft(pt(t),`icon should be icon definiton, but got ${t}`),!pt(t))return null;var f=t;return f&&typeof f.icon==`function`&&(f=i.t(i.t({},f),{},{icon:f.icon(d.primaryColor,d.secondaryColor)})),ht(f.icon,`svg-${f.name}`,i.t(i.t({className:n,onClick:r,style:a,"data-icon":f.name,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`},l),{},{ref:u}))};wt.displayName=`IconReact`,wt.getTwoToneColors=Ct,wt.setTwoToneColors=St;function Tt(e){var t=M(_t(e),2),n=t[0],r=t[1];return wt.setTwoToneColors({primaryColor:n,secondaryColor:r})}function Et(){var e=wt.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var Dt=[`className`,`icon`,`spin`,`rotate`,`tabIndex`,`onClick`,`twoToneColor`];Tt(ye.primary);var Ot=s.forwardRef(function(e,t){var n=e.className,r=e.icon,o=e.spin,c=e.rotate,l=e.tabIndex,u=e.onClick,d=e.twoToneColor,p=N(e,Dt),m=s.useContext(Re),h=m.prefixCls,g=h===void 0?`anticon`:h,_=m.rootClassName,v=(0,f.default)(_,g,i.n(i.n({},`${g}-${r.name}`,!!r.name),`${g}-spin`,!!o||r.name===`loading`),n),y=l;y===void 0&&u&&(y=-1);var b=c?{msTransform:`rotate(${c}deg)`,transform:`rotate(${c}deg)`}:void 0,x=M(_t(d),2),S=x[0],C=x[1];return s.createElement(`span`,a.n({role:`img`,"aria-label":r.name},p,{ref:t,tabIndex:y,onClick:u,className:v}),s.createElement(wt,{icon:r,primaryColor:S,secondaryColor:C,style:b}))});Ot.displayName=`AntdIcon`,Ot.getTwoToneColor=Et,Ot.setTwoToneColor=Tt;var kt=s.forwardRef(function(e,t){return s.createElement(Ot,a.n({},e,{ref:t,icon:O}))}),At={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z`}}]},name:`close-circle`,theme:`filled`},jt=s.forwardRef(function(e,t){return s.createElement(Ot,a.n({},e,{ref:t,icon:At}))}),Mt={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z`}}]},name:`close`,theme:`outlined`},Nt=s.forwardRef(function(e,t){return s.createElement(Ot,a.n({},e,{ref:t,icon:Mt}))}),Pt={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z`}}]},name:`exclamation-circle`,theme:`filled`},Ft=s.forwardRef(function(e,t){return s.createElement(Ot,a.n({},e,{ref:t,icon:Pt}))}),It={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z`}}]},name:`info-circle`,theme:`filled`},Lt=s.forwardRef(function(e,t){return s.createElement(Ot,a.n({},e,{ref:t,icon:It}))});function Rt(e){return e instanceof HTMLElement||e instanceof SVGElement}function zt(e){return e&&i.i(e)===`object`&&Rt(e.nativeElement)?e.nativeElement:Rt(e)?e:null}function Bt(e){return zt(e)||(e instanceof s.default.Component?c.default.findDOMNode?.call(c.default,e):null)}var Vt=r.a((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.server_context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case u:case d:return e;default:switch(e&&=e.$$typeof,e){case c:case s:case l:case p:case f:case o:return e;default:return m}}case n:return m}}}e.ForwardRef=l,e.isMemo=function(e){return m(e)===f}})),Ht=r.a(((e,t)=>{t.exports=Vt()}))(),Ut=Symbol.for(`react.element`),Wt=Symbol.for(`react.transitional.element`),Gt=Symbol.for(`react.fragment`);function Kt(e){return e&&i.i(e)===`object`&&(e.$$typeof===Ut||e.$$typeof===Wt)&&e.type===Gt}var qt=Number(s.version.split(`.`)[0]),Jt=function(e,t){typeof e==`function`?e(t):i.i(e)===`object`&&e&&`current`in e&&(e.current=t)},Yt=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(Boolean);return r.length<=1?r[0]:function(e){t.forEach(function(t){Jt(t,e)})}},Xt=function(e){var t,n;if(!e)return!1;if(Zt(e)&&qt>=19)return!0;var r=(0,Ht.isMemo)(e)?e.type.type:e.type;return!(typeof r==`function`&&!((t=r.prototype)!=null&&t.render)&&r.$$typeof!==Ht.ForwardRef||typeof e==`function`&&!((n=e.prototype)!=null&&n.render)&&e.$$typeof!==Ht.ForwardRef)};function Zt(e){return(0,s.isValidElement)(e)&&!Kt(e)}var Qt=function(e){if(e&&Zt(e)){var t=e;return t.props.propertyIsEnumerable(`ref`)?t.props.ref:t.ref}return null},$t=s.createContext({}),en=function(e){y(n,e);var t=C(n);function n(){return w(this,n),t.apply(this,arguments)}return E(n,[{key:`render`,value:function(){return this.props.children}}]),n}(s.Component);function tn(e){var t=s.useRef();return t.current=e,s.useCallback(function(){for(var e,n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.current)?.call.apply(e,[t].concat(r))},[])}ze()?s.useLayoutEffect:s.useEffect;function nn(e){var t=s.useRef(!1),n=M(s.useState(e),2),r=n[0],i=n[1];s.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function a(e,n){n&&t.current||i(e)}return[r,a]}function rn(e){var t=M(s.useReducer(function(e){return e+1},0),2)[1],n=s.useRef(e);return[tn(function(){return n.current}),tn(function(e){n.current=typeof e==`function`?e(n.current):e,t()})]}var an=`none`,on=`appear`,sn=`enter`,cn=`leave`,ln=`none`,un=`prepare`,dn=`start`,fn=`active`,pn=`prepared`;function mn(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit${e}`]=`webkit${t}`,n[`Moz${e}`]=`moz${t}`,n[`ms${e}`]=`MS${t}`,n[`O${e}`]=`o${t.toLowerCase()}`,n}function hn(e,t){var n={animationend:mn(`Animation`,`AnimationEnd`),transitionend:mn(`Transition`,`TransitionEnd`)};return e&&(`AnimationEvent`in t||delete n.animationend.animation,`TransitionEvent`in t||delete n.transitionend.transition),n}var gn=hn(ze(),typeof window<`u`?window:{}),_n={};ze()&&(_n=document.createElement(`div`).style);var vn={};function yn(e){if(vn[e])return vn[e];var t=gn[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var a=n[i];if(Object.prototype.hasOwnProperty.call(t,a)&&a in _n)return vn[e]=t[a],vn[e]}return``}var bn=yn(`animationend`),xn=yn(`transitionend`),Sn=!!(bn&&xn),Cn=bn||`animationend`,wn=xn||`transitionend`;function Tn(e,t){return e?i.i(e)===`object`?e[t.replace(/-\w/g,function(e){return e[1].toUpperCase()})]:`${e}-${t}`:null}var En=(function(e){var t=(0,s.useRef)();function n(t){t&&(t.removeEventListener(wn,e),t.removeEventListener(Cn,e))}function r(r){t.current&&t.current!==r&&n(t.current),r&&r!==t.current&&(r.addEventListener(wn,e),r.addEventListener(Cn,e),t.current=r)}return s.useEffect(function(){return function(){n(t.current)}},[]),[r,n]}),Dn=ze()?s.useLayoutEffect:s.useEffect,On=function(e){return+setTimeout(e,16)},kn=function(e){return clearTimeout(e)};typeof window<`u`&&`requestAnimationFrame`in window&&(On=function(e){return window.requestAnimationFrame(e)},kn=function(e){return window.cancelAnimationFrame(e)});var An=0,jn=new Map;function Mn(e){jn.delete(e)}var Nn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;An+=1;var n=An;function r(t){if(t===0)Mn(n),e();else{var i=On(function(){r(t-1)});jn.set(n,i)}}return r(t),n};Nn.cancel=function(e){var t=jn.get(e);return Mn(e),kn(t)};var Pn=(function(){var e=s.useRef(null);function t(){Nn.cancel(e.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var a=Nn(function(){i<=1?r({isCanceled:function(){return a!==e.current}}):n(r,i-1)});e.current=a}return s.useEffect(function(){return function(){t()}},[]),[n,t]}),Fn=[un,dn,fn,`end`],In=[un,pn];function Ln(e){return e===`active`||e===`end`}var Rn=(function(e,t,n){var r=M(nn(ln),2),i=r[0],a=r[1],o=M(Pn(),2),c=o[0],l=o[1];function u(){a(un,!0)}var d=t?In:Fn;return Dn(function(){if(i!==`none`&&i!==`end`){var e=d[d.indexOf(i)+1],t=n(i);t===!1?a(e,!0):e&&c(function(n){function r(){n.isCanceled()||a(e,!0)}t===!0?r():Promise.resolve(t).then(r)})}},[e,i]),s.useEffect(function(){return function(){l()}},[]),[u,i]});function zn(e,t,n,r){var a=r.motionEnter,o=a===void 0?!0:a,c=r.motionAppear,l=c===void 0?!0:c,u=r.motionLeave,d=u===void 0?!0:u,f=r.motionDeadline,p=r.motionLeaveImmediately,m=r.onAppearPrepare,h=r.onEnterPrepare,g=r.onLeavePrepare,_=r.onAppearStart,v=r.onEnterStart,y=r.onLeaveStart,b=r.onAppearActive,x=r.onEnterActive,S=r.onLeaveActive,C=r.onAppearEnd,w=r.onEnterEnd,T=r.onLeaveEnd,E=r.onVisibleChanged,D=M(nn(),2),O=D[0],k=D[1],A=M(rn(an),2),j=A[0],N=A[1],P=M(nn(null),2),F=P[0],I=P[1],L=j(),R=(0,s.useRef)(!1),z=(0,s.useRef)(null);function ee(){return n()}var B=(0,s.useRef)(!1);function te(){N(an),I(null,!0)}var ne=tn(function(e){var t=j();if(t!==`none`){var n=ee();if(!(e&&!e.deadline&&e.target!==n)){var r=B.current,i;t===`appear`&&r?i=C?.(n,e):t===`enter`&&r?i=w?.(n,e):t===`leave`&&r&&(i=T?.(n,e)),r&&i!==!1&&te()}}}),re=M(En(ne),1)[0],ie=function(e){switch(e){case on:return i.n(i.n(i.n({},un,m),dn,_),fn,b);case sn:return i.n(i.n(i.n({},un,h),dn,v),fn,x);case cn:return i.n(i.n(i.n({},un,g),dn,y),fn,S);default:return{}}},ae=s.useMemo(function(){return ie(L)},[L]),oe=M(Rn(L,!e,function(e){if(e===`prepare`){var t=ae[un];return t?t(ee()):!1}return ce in ae&&I(ae[ce]?.call(ae,ee(),null)||null),ce===`active`&&L!==`none`&&(re(ee()),f>0&&(clearTimeout(z.current),z.current=setTimeout(function(){ne({deadline:!0})},f))),ce===`prepared`&&te(),!0}),2),se=oe[0],ce=oe[1];B.current=Ln(ce);var le=(0,s.useRef)(null);Dn(function(){if(!(R.current&&le.current===t)){k(t);var n=R.current;R.current=!0;var r;!n&&t&&l&&(r=on),n&&t&&o&&(r=sn),(n&&!t&&d||!n&&p&&!t&&d)&&(r=cn);var i=ie(r);r&&(e||i.prepare)?(N(r),se()):N(an),le.current=t}},[t]),(0,s.useEffect)(function(){(L===`appear`&&!l||L===`enter`&&!o||L===`leave`&&!d)&&N(an)},[l,o,d]),(0,s.useEffect)(function(){return function(){R.current=!1,clearTimeout(z.current)}},[]);var ue=s.useRef(!1);(0,s.useEffect)(function(){O&&(ue.current=!0),O!==void 0&&L===`none`&&((ue.current||O)&&E?.(O),ue.current=!0)},[O,L]);var de=F;return ae.prepare&&ce===`start`&&(de=i.t({transition:`none`},de)),[L,ce,de,O??t]}function Bn(e){var t=e;i.i(e)===`object`&&(t=e.transitionSupport);function n(e,n){return!!(e.motionName&&t&&n!==!1)}var r=s.forwardRef(function(e,t){var r=e.visible,a=r===void 0?!0:r,o=e.removeOnLeave,c=o===void 0?!0:o,l=e.forceRender,u=e.children,d=e.motionName,p=e.leavedClassName,m=e.eventProps,h=s.useContext($t).motion,g=n(e,h),_=(0,s.useRef)(),v=(0,s.useRef)();function y(){try{return _.current instanceof HTMLElement?_.current:Bt(v.current)}catch{return null}}var b=M(zn(g,a,y,e),4),x=b[0],S=b[1],C=b[2],w=b[3],T=s.useRef(w);w&&(T.current=!0);var E=s.useCallback(function(e){_.current=e,Jt(t,e)},[t]),D,O=i.t(i.t({},m),{},{visible:a});if(!u)D=null;else if(x===`none`)D=w?u(i.t({},O),E):!c&&T.current&&p?u(i.t(i.t({},O),{},{className:p}),E):l||!c&&!p?u(i.t(i.t({},O),{},{style:{display:`none`}}),E):null;else{var k;S===`prepare`?k=`prepare`:Ln(S)?k=`active`:S===`start`&&(k=`start`);var A=Tn(d,`${x}-${k}`);D=u(i.t(i.t({},O),{},{className:(0,f.default)(Tn(d,x),i.n(i.n({},A,A&&k),d,typeof d==`string`)),style:C}),E)}return s.isValidElement(D)&&Xt(D)&&(Qt(D)||(D=s.cloneElement(D,{ref:E}))),s.createElement(en,{ref:v},D)});return r.displayName=`CSSMotion`,r}var Vn=Bn(Sn),Hn=`keep`,Un=`remove`,Wn=`removed`;function Gn(e){var t=e&&i.i(e)===`object`&&`key`in e?e:{key:e};return i.t(i.t({},t),{},{key:String(t.key)})}function Kn(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(Gn)}function qn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,a=t.length,o=Kn(e),s=Kn(t);o.forEach(function(e){for(var t=!1,o=r;o<a;o+=1){var c=s[o];if(c.key===e.key){r<o&&(n=n.concat(s.slice(r,o).map(function(e){return i.t(i.t({},e),{},{status:`add`})})),r=o),n.push(i.t(i.t({},c),{},{status:Hn})),r+=1,t=!0;break}}t||n.push(i.t(i.t({},e),{},{status:Un}))}),r<a&&(n=n.concat(s.slice(r).map(function(e){return i.t(i.t({},e),{},{status:`add`})})));var c={};return n.forEach(function(e){var t=e.key;c[t]=(c[t]||0)+1}),Object.keys(c).filter(function(e){return c[e]>1}).forEach(function(e){n=n.filter(function(t){var n=t.key,r=t.status;return n!==e||r!==`remove`}),n.forEach(function(t){t.key===e&&(t.status=Hn)})}),n}var Jn=[`component`,`children`,`onVisibleChanged`,`onAllRemoved`],Yn=[`status`],Xn=[`eventProps`,`visible`,`children`,`motionName`,`motionAppear`,`motionEnter`,`motionLeave`,`motionLeaveImmediately`,`motionDeadline`,`removeOnLeave`,`leavedClassName`,`onAppearPrepare`,`onAppearStart`,`onAppearActive`,`onAppearEnd`,`onEnterStart`,`onEnterActive`,`onEnterEnd`,`onLeaveStart`,`onLeaveActive`,`onLeaveEnd`];function Zn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vn,n=function(e){y(r,e);var n=C(r);function r(){var e;w(this,r);for(var t=arguments.length,a=Array(t),o=0;o<t;o++)a[o]=arguments[o];return e=n.call.apply(n,[this].concat(a)),i.n(_(e),`state`,{keyEntities:[]}),i.n(_(e),`removeKey`,function(t){e.setState(function(e){return{keyEntities:e.keyEntities.map(function(e){return e.key===t?i.t(i.t({},e),{},{status:Wn}):e})}},function(){e.state.keyEntities.filter(function(e){return e.status!==`removed`}).length===0&&e.props.onAllRemoved&&e.props.onAllRemoved()})}),e}return E(r,[{key:`render`,value:function(){var e=this,n=this.state.keyEntities,r=this.props,o=r.component,c=r.children,l=r.onVisibleChanged;r.onAllRemoved;var u=N(r,Jn),d=o||s.Fragment,f={};return Xn.forEach(function(e){f[e]=u[e],delete u[e]}),delete u.keys,s.createElement(d,u,n.map(function(n,r){var o=n.status,u=N(n,Yn),d=o===`add`||o===`keep`;return s.createElement(t,a.n({},f,{key:u.key,visible:d,eventProps:u,onVisibleChanged:function(t){l?.(t,{key:u.key}),t||e.removeKey(u.key)}}),function(e,t){return c(i.t(i.t({},e),{},{index:r}),t)})}))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.keys,r=t.keyEntities;return{keyEntities:qn(r,Kn(n)).filter(function(e){var t=r.find(function(t){var n=t.key;return e.key===n});return!(t&&t.status===`removed`&&e.status===`remove`)})}}}]),r}(s.Component);return i.n(n,`defaultProps`,{component:`div`}),n}Zn(Sn);var V=Vn,Qn=`accept acceptCharset accessKey action allowFullScreen allowTransparency
60
- alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
61
- charSet checked classID className colSpan cols content contentEditable contextMenu
62
- controls coords crossOrigin data dateTime default defer dir disabled download draggable
63
- encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
64
- headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
65
- is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
66
- mediaGroup method min minLength multiple muted name noValidate nonce open
67
- optimum pattern placeholder poster preload radioGroup readOnly rel required
68
- reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
69
- shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
70
- summary tabIndex target title type useMap value width wmode wrap onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
71
- onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
72
- onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
73
- onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
74
- onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
75
- onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
76
- onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`.split(/[\s\n]+/),$n=`aria-`,er=`data-`;function tr(e,t){return e.indexOf(t)===0}function nr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=t===!1?{aria:!0,data:!0,attr:!0}:t===!0?{aria:!0}:i.t({},t),r={};return Object.keys(e).forEach(function(t){(n.aria&&(t===`role`||tr(t,$n))||n.data&&tr(t,er)||n.attr&&Qn.includes(t))&&(r[t]=e[t])}),r}var rr=(e,t,n)=>s.default.isValidElement(e)?s.default.cloneElement(e,typeof n==`function`?n(e.props||{}):n):t,ir=`anticon`,ar=s.createContext({getPrefixCls:(e,t)=>t||(e?`ant-${e}`:`ant`),iconPrefixCls:ir}),{Consumer:or}=ar,sr={};function cr(e){let t=s.useContext(ar),{getPrefixCls:n,direction:r,getPopupContainer:i}=t,a=t[e];return Object.assign(Object.assign({classNames:sr,styles:sr},a),{getPrefixCls:n,direction:r,getPopupContainer:i})}var lr=E(function e(){w(this,e)}),ur=`CALC_UNIT`,dr=new RegExp(ur,`g`);function fr(e){return typeof e==`number`?`${e}${ur}`:e}var pr=function(e){y(n,e);var t=C(n);function n(e,r){var a;w(this,n),a=t.call(this),i.n(_(a),`result`,``),i.n(_(a),`unitlessCssVar`,void 0),i.n(_(a),`lowPriority`,void 0);var o=i.i(e);return a.unitlessCssVar=r,e instanceof n?a.result=`(${e.result})`:o===`number`?a.result=fr(e):o===`string`&&(a.result=e),a}return E(n,[{key:`add`,value:function(e){return e instanceof n?this.result=`${this.result} + ${e.getResult()}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} + ${fr(e)}`),this.lowPriority=!0,this}},{key:`sub`,value:function(e){return e instanceof n?this.result=`${this.result} - ${e.getResult()}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} - ${fr(e)}`),this.lowPriority=!0,this}},{key:`mul`,value:function(e){return this.lowPriority&&(this.result=`(${this.result})`),e instanceof n?this.result=`${this.result} * ${e.getResult(!0)}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} * ${e}`),this.lowPriority=!1,this}},{key:`div`,value:function(e){return this.lowPriority&&(this.result=`(${this.result})`),e instanceof n?this.result=`${this.result} / ${e.getResult(!0)}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} / ${e}`),this.lowPriority=!1,this}},{key:`getResult`,value:function(e){return this.lowPriority||e?`(${this.result})`:this.result}},{key:`equal`,value:function(e){var t=this,n=(e||{}).unit,r=!0;return typeof n==`boolean`?r=n:Array.from(this.unitlessCssVar).some(function(e){return t.result.includes(e)})&&(r=!1),this.result=this.result.replace(dr,r?`px`:``),this.lowPriority===void 0?this.result:`calc(${this.result})`}}]),n}(lr),mr=function(e){y(n,e);var t=C(n);function n(e){var r;return w(this,n),r=t.call(this),i.n(_(r),`result`,0),e instanceof n?r.result=e.result:typeof e==`number`&&(r.result=e),r}return E(n,[{key:`add`,value:function(e){return e instanceof n?this.result+=e.result:typeof e==`number`&&(this.result+=e),this}},{key:`sub`,value:function(e){return e instanceof n?this.result-=e.result:typeof e==`number`&&(this.result-=e),this}},{key:`mul`,value:function(e){return e instanceof n?this.result*=e.result:typeof e==`number`&&(this.result*=e),this}},{key:`div`,value:function(e){return e instanceof n?this.result/=e.result:typeof e==`number`&&(this.result/=e),this}},{key:`equal`,value:function(){return this.result}}]),n}(lr),hr=function(e,t){var n=e===`css`?pr:mr;return function(e){return new n(e,t)}},gr=function(e,t){return`${[t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,`$1-$2`).replace(/([a-z])([A-Z])/g,`$1-$2`)].filter(Boolean).join(`-`)}`};function _r(e,t,n,r){var a=i.t({},t[e]);r!=null&&r.deprecatedTokens&&r.deprecatedTokens.forEach(function(e){var t=M(e,2),n=t[0],r=t[1];(a!=null&&a[n]||a!=null&&a[r])&&(a[r]??(a[r]=a?.[n]))});var o=i.t(i.t({},n),a);return Object.keys(o).forEach(function(e){o[e]===t[e]&&delete o[e]}),o}var vr=typeof CSSINJS_STATISTIC<`u`,yr=!0;function br(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!vr)return Object.assign.apply(Object,[{}].concat(t));yr=!1;var r={};return t.forEach(function(e){i.i(e)===`object`&&Object.keys(e).forEach(function(t){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){return e[t]}})})}),yr=!0,r}var xr={};function Sr(){}var Cr=function(e){var t,n=e,r=Sr;return vr&&typeof Proxy<`u`&&(t=new Set,n=new Proxy(e,{get:function(e,n){if(yr){var r;(r=t)==null||r.add(n)}return e[n]}}),r=function(e,n){xr[e]={global:Array.from(t),component:i.t(i.t({},xr[e]?.component),n)}}),{token:n,keys:t,flush:r}};function wr(e,t,n){return typeof n==`function`?n(br(t,t[e]??{})):n??{}}function Tr(e){return e===`js`?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return`max(${t.map(function(e){return(0,p.unit)(e)}).join(`,`)})`},min:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return`min(${t.map(function(e){return(0,p.unit)(e)}).join(`,`)})`}}}var Er=1e3*60*10,Dr=new(function(){function e(){w(this,e),i.n(this,`map`,new Map),i.n(this,`objectIDMap`,new WeakMap),i.n(this,`nextID`,0),i.n(this,`lastAccessBeat`,new Map),i.n(this,`accessBeat`,0)}return E(e,[{key:`set`,value:function(e,t){this.clear();var n=this.getCompositeKey(e);this.map.set(n,t),this.lastAccessBeat.set(n,Date.now())}},{key:`get`,value:function(e){var t=this.getCompositeKey(e),n=this.map.get(t);return this.lastAccessBeat.set(t,Date.now()),this.accessBeat+=1,n}},{key:`getCompositeKey`,value:function(e){var t=this;return e.map(function(e){return e&&i.i(e)===`object`?`obj_${t.getObjectID(e)}`:`${i.i(e)}_${e}`}).join(`|`)}},{key:`getObjectID`,value:function(e){if(this.objectIDMap.has(e))return this.objectIDMap.get(e);var t=this.nextID;return this.objectIDMap.set(e,t),this.nextID+=1,t}},{key:`clear`,value:function(){var e=this;if(this.accessBeat>1e4){var t=Date.now();this.lastAccessBeat.forEach(function(n,r){t-n>Er&&(e.map.delete(r),e.lastAccessBeat.delete(r))}),this.accessBeat=0}}}]),e}());function Or(e,t){return s.default.useMemo(function(){var n=Dr.get(t);if(n)return n;var r=e();return Dr.set(t,r),r},t)}var kr=function(){return{}};function Ar(e){var t=e.useCSP,n=t===void 0?kr:t,r=e.useToken,a=e.usePrefix,o=e.getResetStyles,c=e.getCommonStyle,l=e.getCompUnitless;function u(e,t,n,r){var a=Array.isArray(e)?e[0]:e;function o(e){return`${String(a)}${e.slice(0,1).toUpperCase()}${e.slice(1)}`}var s=r?.unitless||{},c=i.t(i.t({},typeof l==`function`?l(e):{}),{},i.n({},o(`zIndexPopup`),!0));Object.keys(s).forEach(function(e){c[o(e)]=s[e]});var u=i.t(i.t({},r),{},{unitless:c,prefixToken:o}),p=f(e,t,n,u),m=d(a,n,u);return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=M(p(e,t),2)[1],r=M(m(t),2);return[r[0],n,r[1]]}}function d(e,t,n){var i=n.unitless,a=n.injectStyle,o=a===void 0?!0:a,c=n.prefixToken,l=n.ignore,u=function(a){var o=a.rootCls,s=a.cssVar,u=s===void 0?{}:s,d=r().realToken;return(0,p.useCSSVarRegister)({path:[e],prefix:u.prefix,key:u.key,unitless:i,ignore:l,token:d,scope:o},function(){var r=wr(e,d,t),i=_r(e,d,r,{deprecatedTokens:n?.deprecatedTokens});return Object.keys(r).forEach(function(e){i[c(e)]=i[e],delete i[e]}),i}),null};return function(t){var n=r().cssVar;return[function(r){return o&&n?s.default.createElement(s.default.Fragment,null,s.default.createElement(u,{rootCls:t,cssVar:n,component:e}),r):r},n?.key]}}function f(t,s,l){var u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},d=Array.isArray(t)?t:[t,t],f=M(d,1)[0],m=d.join(`-`),h=e.layer||{name:`antd`};return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,d=r(),g=d.theme,_=d.realToken,v=d.hashId,y=d.token,b=d.cssVar,x=a(),S=x.rootPrefixCls,C=x.iconPrefixCls,w=n(),T=b?`css`:`js`,E=Or(function(){var e=new Set;return b&&Object.keys(u.unitless||{}).forEach(function(t){e.add((0,p.token2CSSVar)(t,b.prefix)),e.add((0,p.token2CSSVar)(t,gr(f,b.prefix)))}),hr(T,e)},[T,f,b?.prefix]),D=Tr(T),O=D.max,k=D.min,A={theme:g,token:y,hashId:v,nonce:function(){return w.nonce},clientOnly:u.clientOnly,layer:h,order:u.order||-999};return typeof o==`function`&&(0,p.useStyleRegister)(i.t(i.t({},A),{},{clientOnly:!1,path:[`Shared`,S]}),function(){return o(y,{prefix:{rootPrefixCls:S,iconPrefixCls:C},csp:w})}),[(0,p.useStyleRegister)(i.t(i.t({},A),{},{path:[m,e,C]}),function(){if(u.injectStyle===!1)return[];var n=Cr(y),r=n.token,a=n.flush,o=wr(f,_,l),d=`.${e}`,m=_r(f,_,o,{deprecatedTokens:u.deprecatedTokens});b&&o&&i.i(o)===`object`&&Object.keys(o).forEach(function(e){o[e]=`var(${(0,p.token2CSSVar)(e,gr(f,b.prefix))})`});var h=br(r,{componentCls:d,prefixCls:e,iconCls:`.${C}`,antCls:`.${S}`,calc:E,max:O,min:k},b?o:m),g=s(h,{hashId:v,prefixCls:e,rootPrefixCls:S,iconPrefixCls:C});a(f,m);var x=typeof c==`function`?c(h,e,t,u.resetFont):null;return[u.resetStyle===!1?null:x,g]}),v]}}function m(e,t,n){var r=f(e,t,n,i.t({resetStyle:!1,order:-998},arguments.length>3&&arguments[3]!==void 0?arguments[3]:{}));return function(e){var t=e.prefixCls,n=e.rootCls;return r(t,n===void 0?t:n),null}}return{genStyleHooks:u,genSubStyleComponent:m,genComponentStyleHook:f}}function jr(e){return(e+8)/e}function Mr(e){let t=Array.from({length:10}).map((t,n)=>{let r=n-1,i=e*Math.E**(r/5);return Math.floor((n>1?Math.floor(i):Math.ceil(i))/2)*2});return t[1]=e,t.map(e=>({size:e,lineHeight:jr(e)}))}var Nr=`5.29.3`,Pr={blue:`#1677FF`,purple:`#722ED1`,cyan:`#13C2C2`,green:`#52C41A`,magenta:`#EB2F96`,pink:`#EB2F96`,red:`#F5222D`,orange:`#FA8C16`,yellow:`#FADB14`,volcano:`#FA541C`,geekblue:`#2F54EB`,gold:`#FAAD14`,lime:`#A0D911`},Fr=Object.assign(Object.assign({},Pr),{colorPrimary:`#1677ff`,colorSuccess:`#52c41a`,colorWarning:`#faad14`,colorError:`#ff4d4f`,colorInfo:`#1677ff`,colorLink:``,colorTextBase:``,colorBgBase:``,fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
77
- 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
78
- 'Noto Color Emoji'`,fontFamilyCode:`'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,fontSize:14,lineWidth:1,lineType:`solid`,motionUnit:.1,motionBase:0,motionEaseOutCirc:`cubic-bezier(0.08, 0.82, 0.17, 1)`,motionEaseInOutCirc:`cubic-bezier(0.78, 0.14, 0.15, 0.86)`,motionEaseOut:`cubic-bezier(0.215, 0.61, 0.355, 1)`,motionEaseInOut:`cubic-bezier(0.645, 0.045, 0.355, 1)`,motionEaseOutBack:`cubic-bezier(0.12, 0.4, 0.29, 1.46)`,motionEaseInBack:`cubic-bezier(0.71, -0.46, 0.88, 0.6)`,motionEaseInQuint:`cubic-bezier(0.755, 0.05, 0.855, 0.06)`,motionEaseOutQuint:`cubic-bezier(0.23, 1, 0.32, 1)`,borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});function Ir(e,{generateColorPalettes:t,generateNeutralColorPalettes:n}){let{colorSuccess:r,colorWarning:i,colorError:a,colorInfo:o,colorPrimary:s,colorBgBase:c,colorTextBase:l}=e,u=t(s),d=t(r),f=t(i),p=t(a),m=t(o),h=n(c,l),g=t(e.colorLink||e.colorInfo),_=new R(p[1]).mix(new R(p[3]),50).toHexString();return Object.assign(Object.assign({},h),{colorPrimaryBg:u[1],colorPrimaryBgHover:u[2],colorPrimaryBorder:u[3],colorPrimaryBorderHover:u[4],colorPrimaryHover:u[5],colorPrimary:u[6],colorPrimaryActive:u[7],colorPrimaryTextHover:u[8],colorPrimaryText:u[9],colorPrimaryTextActive:u[10],colorSuccessBg:d[1],colorSuccessBgHover:d[2],colorSuccessBorder:d[3],colorSuccessBorderHover:d[4],colorSuccessHover:d[4],colorSuccess:d[6],colorSuccessActive:d[7],colorSuccessTextHover:d[8],colorSuccessText:d[9],colorSuccessTextActive:d[10],colorErrorBg:p[1],colorErrorBgHover:p[2],colorErrorBgFilledHover:_,colorErrorBgActive:p[3],colorErrorBorder:p[3],colorErrorBorderHover:p[4],colorErrorHover:p[5],colorError:p[6],colorErrorActive:p[7],colorErrorTextHover:p[8],colorErrorText:p[9],colorErrorTextActive:p[10],colorWarningBg:f[1],colorWarningBgHover:f[2],colorWarningBorder:f[3],colorWarningBorderHover:f[4],colorWarningHover:f[4],colorWarning:f[6],colorWarningActive:f[7],colorWarningTextHover:f[8],colorWarningText:f[9],colorWarningTextActive:f[10],colorInfoBg:m[1],colorInfoBgHover:m[2],colorInfoBorder:m[3],colorInfoBorderHover:m[4],colorInfoHover:m[4],colorInfo:m[6],colorInfoActive:m[7],colorInfoTextHover:m[8],colorInfoText:m[9],colorInfoTextActive:m[10],colorLinkHover:g[4],colorLink:g[6],colorLinkActive:g[7],colorBgMask:new R(`#000`).setA(.45).toRgbString(),colorWhite:`#fff`})}var Lr=e=>{let t=e,n=e,r=e,i=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?i=4:e>=8&&(i=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:i}};function Rr(e){let{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:i}=e;return Object.assign({motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+t*2).toFixed(1)}s`,motionDurationSlow:`${(n+t*3).toFixed(1)}s`,lineWidthBold:i+1},Lr(r))}var zr=e=>{let{controlHeight:t}=e;return{controlHeightSM:t*.75,controlHeightXS:t*.5,controlHeightLG:t*1.25}},Br=e=>{let t=Mr(e),n=t.map(e=>e.size),r=t.map(e=>e.lineHeight),i=n[1],a=n[0],o=n[2],s=r[1],c=r[0],l=r[2];return{fontSizeSM:a,fontSize:i,fontSizeLG:o,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:s,lineHeightLG:l,lineHeightSM:c,fontHeight:Math.round(s*i),fontHeightLG:Math.round(l*o),fontHeightSM:Math.round(c*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function Vr(e){let{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}var Hr=(e,t)=>new R(e).setA(t).toRgbString(),Ur=(e,t)=>new R(e).darken(t).toHexString(),Wr=e=>{let t=le(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},Gr=(e,t)=>{let n=e||`#fff`,r=t||`#000`;return{colorBgBase:n,colorTextBase:r,colorText:Hr(r,.88),colorTextSecondary:Hr(r,.65),colorTextTertiary:Hr(r,.45),colorTextQuaternary:Hr(r,.25),colorFill:Hr(r,.15),colorFillSecondary:Hr(r,.06),colorFillTertiary:Hr(r,.04),colorFillQuaternary:Hr(r,.02),colorBgSolid:Hr(r,1),colorBgSolidHover:Hr(r,.75),colorBgSolidActive:Hr(r,.95),colorBgLayout:Ur(n,4),colorBgContainer:Ur(n,0),colorBgElevated:Ur(n,0),colorBgSpotlight:Hr(r,.85),colorBgBlur:`transparent`,colorBorder:Ur(n,15),colorBorderSecondary:Ur(n,6)}};function Kr(e){ue.pink=ue.magenta,we.pink=we.magenta;let t=Object.keys(Pr).map(t=>{let n=e[t]===ue[t]?we[t]:le(e[t]);return Array.from({length:10},()=>1).reduce((e,r,i)=>(e[`${t}-${i+1}`]=n[i],e[`${t}${i+1}`]=n[i],e),{})}).reduce((e,t)=>(e=Object.assign(Object.assign({},e),t),e),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),Ir(e,{generateColorPalettes:Wr,generateNeutralColorPalettes:Gr})),Br(e.fontSize)),Vr(e)),zr(e)),Rr(e))}var qr=(0,p.createTheme)(Kr),Jr={token:Fr,override:{override:Fr},hashed:!0},Yr=s.default.createContext(Jr);function Xr(e){return e>=0&&e<=255}function Zr(e,t){let{r:n,g:r,b:i,a}=new R(e).toRgb();if(a<1)return e;let{r:o,g:s,b:c}=new R(t).toRgb();for(let e=.01;e<=1;e+=.01){let t=Math.round((n-o*(1-e))/e),a=Math.round((r-s*(1-e))/e),l=Math.round((i-c*(1-e))/e);if(Xr(t)&&Xr(a)&&Xr(l))return new R({r:t,g:a,b:l,a:Math.round(e*100)/100}).toRgbString()}return new R({r:n,g:r,b:i,a:1}).toRgbString()}var Qr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function $r(e){let{override:t}=e,n=Qr(e,[`override`]),r=Object.assign({},t);Object.keys(Fr).forEach(e=>{delete r[e]});let i=Object.assign(Object.assign({},n),r),a=1200,o=1600;return i.motion===!1&&(i.motionDurationFast=`0s`,i.motionDurationMid=`0s`,i.motionDurationSlow=`0s`),Object.assign(Object.assign(Object.assign({},i),{colorFillContent:i.colorFillSecondary,colorFillContentHover:i.colorFill,colorFillAlter:i.colorFillQuaternary,colorBgContainerDisabled:i.colorFillTertiary,colorBorderBg:i.colorBgContainer,colorSplit:Zr(i.colorBorderSecondary,i.colorBgContainer),colorTextPlaceholder:i.colorTextQuaternary,colorTextDisabled:i.colorTextQuaternary,colorTextHeading:i.colorText,colorTextLabel:i.colorTextSecondary,colorTextDescription:i.colorTextTertiary,colorTextLightSolid:i.colorWhite,colorHighlight:i.colorError,colorBgTextHover:i.colorFillSecondary,colorBgTextActive:i.colorFill,colorIcon:i.colorTextTertiary,colorIconHover:i.colorText,colorErrorOutline:Zr(i.colorErrorBg,i.colorBgContainer),colorWarningOutline:Zr(i.colorWarningBg,i.colorBgContainer),fontSizeIcon:i.fontSizeSM,lineWidthFocus:i.lineWidth*3,lineWidth:i.lineWidth,controlOutlineWidth:i.lineWidth*2,controlInteractiveSize:i.controlHeight/2,controlItemBgHover:i.colorFillTertiary,controlItemBgActive:i.colorPrimaryBg,controlItemBgActiveHover:i.colorPrimaryBgHover,controlItemBgActiveDisabled:i.colorFill,controlTmpOutline:i.colorFillQuaternary,controlOutline:Zr(i.colorPrimaryBg,i.colorBgContainer),lineType:i.lineType,borderRadius:i.borderRadius,borderRadiusXS:i.borderRadiusXS,borderRadiusSM:i.borderRadiusSM,borderRadiusLG:i.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:`none`,linkHoverDecoration:`none`,linkFocusDecoration:`none`,controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:i.sizeXXS,paddingXS:i.sizeXS,paddingSM:i.sizeSM,padding:i.size,paddingMD:i.sizeMD,paddingLG:i.sizeLG,paddingXL:i.sizeXL,paddingContentHorizontalLG:i.sizeLG,paddingContentVerticalLG:i.sizeMS,paddingContentHorizontal:i.sizeMS,paddingContentVertical:i.sizeSM,paddingContentHorizontalSM:i.size,paddingContentVerticalSM:i.sizeXS,marginXXS:i.sizeXXS,marginXS:i.sizeXS,marginSM:i.sizeSM,margin:i.size,marginMD:i.sizeMD,marginLG:i.sizeLG,marginXL:i.sizeXL,marginXXL:i.sizeXXL,boxShadow:`
79
- 0 6px 16px 0 rgba(0, 0, 0, 0.08),
80
- 0 3px 6px -4px rgba(0, 0, 0, 0.12),
81
- 0 9px 28px 8px rgba(0, 0, 0, 0.05)
82
- `,boxShadowSecondary:`
83
- 0 6px 16px 0 rgba(0, 0, 0, 0.08),
84
- 0 3px 6px -4px rgba(0, 0, 0, 0.12),
85
- 0 9px 28px 8px rgba(0, 0, 0, 0.05)
86
- `,boxShadowTertiary:`
87
- 0 1px 2px 0 rgba(0, 0, 0, 0.03),
88
- 0 1px 6px -1px rgba(0, 0, 0, 0.02),
89
- 0 2px 4px 0 rgba(0, 0, 0, 0.02)
90
- `,screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:a-1,screenXL:a,screenXLMin:a,screenXLMax:o-1,screenXXL:o,screenXXLMin:o,boxShadowPopoverArrow:`2px 2px 5px rgba(0, 0, 0, 0.05)`,boxShadowCard:`
91
- 0 1px 2px -2px ${new R(`rgba(0, 0, 0, 0.16)`).toRgbString()},
92
- 0 3px 6px 0 ${new R(`rgba(0, 0, 0, 0.12)`).toRgbString()},
93
- 0 5px 12px 4px ${new R(`rgba(0, 0, 0, 0.09)`).toRgbString()}
94
- `,boxShadowDrawerRight:`
95
- -6px 0 16px 0 rgba(0, 0, 0, 0.08),
96
- -3px 0 6px -4px rgba(0, 0, 0, 0.12),
97
- -9px 0 28px 8px rgba(0, 0, 0, 0.05)
98
- `,boxShadowDrawerLeft:`
99
- 6px 0 16px 0 rgba(0, 0, 0, 0.08),
100
- 3px 0 6px -4px rgba(0, 0, 0, 0.12),
101
- 9px 0 28px 8px rgba(0, 0, 0, 0.05)
102
- `,boxShadowDrawerUp:`
103
- 0 6px 16px 0 rgba(0, 0, 0, 0.08),
104
- 0 3px 6px -4px rgba(0, 0, 0, 0.12),
105
- 0 9px 28px 8px rgba(0, 0, 0, 0.05)
106
- `,boxShadowDrawerDown:`
107
- 0 -6px 16px 0 rgba(0, 0, 0, 0.08),
108
- 0 -3px 6px -4px rgba(0, 0, 0, 0.12),
109
- 0 -9px 28px 8px rgba(0, 0, 0, 0.05)
110
- `,boxShadowTabsOverflowLeft:`inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowRight:`inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowTop:`inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowBottom:`inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)`}),r)}var ei=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},ti={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},ni={motionBase:!0,motionUnit:!0},ri={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},ii=(e,t,n)=>{let r=n.getDerivativeToken(e),{override:i}=t,a=ei(t,[`override`]),o=Object.assign(Object.assign({},r),{override:i});return o=$r(o),a&&Object.entries(a).forEach(([e,t])=>{let{theme:n}=t,r=ei(t,[`theme`]),i=r;n&&(i=ii(Object.assign(Object.assign({},o),r),{override:r},n)),o[e]=i}),o};function ai(){let{token:e,hashed:t,theme:n,override:r,cssVar:i}=s.default.useContext(Yr),a=`${Nr}-${t||``}`,o=n||qr,[c,l,u]=(0,p.useCacheToken)(o,[Fr,e],{salt:a,override:r,getComputedToken:ii,formatToken:$r,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:ti,ignore:ni,preserve:ri}});return[o,u,t?l:``,c,i]}var{genStyleHooks:oi,genComponentStyleHook:si,genSubStyleComponent:ci}=Ar({usePrefix:()=>{let{getPrefixCls:e,iconPrefixCls:t}=(0,s.useContext)(ar);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{let[e,t,n,r,i]=ai();return{theme:e,realToken:t,hashId:n,token:r,cssVar:i}},useCSP:()=>{let{csp:e}=(0,s.useContext)(ar);return e??{}},getResetStyles:(e,t)=>{let n=o.r(e);return[n,{"&":n},o.n(t?.prefix.iconPrefixCls??ir)]},getCommonStyle:o.t,getCompUnitless:()=>ti}),li=(e,t,n,r,i)=>({background:e,border:`${(0,p.unit)(r.lineWidth)} ${r.lineType} ${t}`,[`${i}-icon`]:{color:n}}),ui=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:i,fontSize:a,fontSizeLG:s,lineHeight:c,borderRadiusLG:l,motionEaseInOutCirc:u,withDescriptionIconSize:d,colorText:f,colorTextHeading:p,withDescriptionPadding:m,defaultPadding:h}=e;return{[t]:Object.assign(Object.assign({},o.i(e)),{position:`relative`,display:`flex`,alignItems:`center`,padding:h,wordWrap:`break-word`,borderRadius:l,[`&${t}-rtl`]:{direction:`rtl`},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:`none`,fontSize:a,lineHeight:c},"&-message":{color:p},[`&${t}-motion-leave`]:{overflow:`hidden`,opacity:1,transition:`max-height ${n} ${u}, opacity ${n} ${u},
111
- padding-top ${n} ${u}, padding-bottom ${n} ${u},
112
- margin-bottom ${n} ${u}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:`0 !important`,paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:`flex-start`,padding:m,[`${t}-icon`]:{marginInlineEnd:i,fontSize:d,lineHeight:0},[`${t}-message`]:{display:`block`,marginBottom:r,color:p,fontSize:s},[`${t}-description`]:{display:`block`,color:f}},[`${t}-banner`]:{marginBottom:0,border:`0 !important`,borderRadius:0}}},di=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:i,colorWarning:a,colorWarningBorder:o,colorWarningBg:s,colorError:c,colorErrorBorder:l,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":li(i,r,n,e,t),"&-info":li(p,f,d,e,t),"&-warning":li(s,o,a,e,t),"&-error":Object.assign(Object.assign({},li(u,l,c,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},fi=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:i,fontSizeIcon:a,colorIcon:o,colorIconHover:s}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:`hidden`,fontSize:a,lineHeight:(0,p.unit)(a),backgroundColor:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,[`${n}-close`]:{color:o,transition:`color ${r}`,"&:hover":{color:s}}},"&-close-text":{color:o,transition:`color ${r}`,"&:hover":{color:s}}}}},pi=oi(`Alert`,e=>[ui(e),di(e),fi(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),mi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},hi={success:kt,info:Lt,error:jt,warning:Ft},gi=e=>{let{icon:t,prefixCls:n,type:r}=e,i=hi[r]||null;return t?rr(t,s.createElement(`span`,{className:`${n}-icon`},t),()=>({className:(0,f.default)(`${n}-icon`,t.props.className)})):s.createElement(i,{className:`${n}-icon`})},_i=e=>{let{isClosable:t,prefixCls:n,closeIcon:r,handleClose:i,ariaProps:a}=e,o=r===!0||r===void 0?s.createElement(Nt,null):r;return t?s.createElement(`button`,Object.assign({type:`button`,onClick:i,className:`${n}-close-icon`,tabIndex:0},a),o):null},vi=s.forwardRef((e,t)=>{let{description:n,prefixCls:r,message:i,banner:a,className:o,rootClassName:c,style:l,onMouseEnter:u,onMouseLeave:d,onClick:p,afterClose:m,showIcon:h,closable:g,closeText:_,closeIcon:v,action:y,id:b}=e,x=mi(e,[`description`,`prefixCls`,`message`,`banner`,`className`,`rootClassName`,`style`,`onMouseEnter`,`onMouseLeave`,`onClick`,`afterClose`,`showIcon`,`closable`,`closeText`,`closeIcon`,`action`,`id`]),[S,C]=s.useState(!1),w=s.useRef(null);s.useImperativeHandle(t,()=>({nativeElement:w.current}));let{getPrefixCls:T,direction:E,closable:D,closeIcon:O,className:k,style:A}=cr(`alert`),j=T(`alert`,r),[M,N,P]=pi(j),F=t=>{var n;C(!0),(n=e.onClose)==null||n.call(e,t)},I=s.useMemo(()=>e.type===void 0?a?`warning`:`info`:e.type,[e.type,a]),L=s.useMemo(()=>typeof g==`object`&&g.closeIcon||_?!0:typeof g==`boolean`?g:v!==!1&&v!=null?!0:!!D,[_,v,g,D]),R=a&&h===void 0?!0:h,z=(0,f.default)(j,`${j}-${I}`,{[`${j}-with-description`]:!!n,[`${j}-no-icon`]:!R,[`${j}-banner`]:!!a,[`${j}-rtl`]:E===`rtl`},k,o,c,P,N),ee=nr(x,{aria:!0,data:!0}),B=s.useMemo(()=>typeof g==`object`&&g.closeIcon?g.closeIcon:_||(v===void 0?typeof D==`object`&&D.closeIcon?D.closeIcon:O:v),[v,g,D,_,O]),te=s.useMemo(()=>{let e=g??D;if(typeof e==`object`){let{closeIcon:t}=e;return mi(e,[`closeIcon`])}return{}},[g,D]);return M(s.createElement(V,{visible:!S,motionName:`${j}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:m},({className:t,style:r},a)=>s.createElement(`div`,Object.assign({id:b,ref:Yt(w,a),"data-show":!S,className:(0,f.default)(z,t),style:Object.assign(Object.assign(Object.assign({},A),l),r),onMouseEnter:u,onMouseLeave:d,onClick:p,role:`alert`},ee),R?s.createElement(gi,{description:n,icon:e.icon,prefixCls:j,type:I}):null,s.createElement(`div`,{className:`${j}-content`},i?s.createElement(`div`,{className:`${j}-message`},i):null,n?s.createElement(`div`,{className:`${j}-description`},n):null),y?s.createElement(`div`,{className:`${j}-action`},y):null,s.createElement(_i,{isClosable:L,prefixCls:j,closeIcon:B,handleClose:F,ariaProps:te}))))}),yi=function(e){function t(){var e;return w(this,t),e=D(this,t,arguments),e.state={error:void 0,info:{componentStack:``}},e}return y(t,e),E(t,[{key:`componentDidCatch`,value:function(e,t){this.setState({error:e,info:t})}},{key:`render`,value:function(){let{message:e,description:t,id:n,children:r}=this.props,{error:i,info:a}=this.state,o=a?.componentStack||null,c=e===void 0?(i||``).toString():e,l=t===void 0?o:t;return i?s.createElement(vi,{id:n,type:`error`,message:c,description:s.createElement(`pre`,{style:{fontSize:`0.9em`,overflowX:`auto`}},l)}):r}}])}(s.Component);function bi(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var xi=r.o((()=>{})),Si=r.s({default:()=>wi}),Ci,wi,Ti=r.o((()=>{xi(),Ci=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,wi=bi(function(e){return Ci.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})}));function Ei(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Di(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if(typeof e==`string`)return Ei(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ei(e,t):void 0}}(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
113
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Oi(e){return Oi=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Oi(e)}function ki(e){var t=function(e,t){if(Oi(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oi(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return Oi(t)==`symbol`?t:t+``}function Ai(e,t,n){return(t=ki(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ji(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ji(Object(n),!0).forEach(function(t){Ai(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ji(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ni={},Pi=[];function Fi(e,t){}function Ii(e,t){}function Li(e,t,n){t||Ni[n]||(e(!1,n),Ni[n]=!0)}function Ri(e,t){Li(Fi,e,t)}function zi(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=new Set;return function e(t,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=r.has(t);if(Ri(!o,`Warning: There may be circular references`),o)return!1;if(t===i)return!0;if(n&&a>1)return!1;r.add(t);var s=a+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var c=0;c<t.length;c++)if(!e(t[c],i[c],s))return!1;return!0}if(t&&i&&Oi(t)===`object`&&Oi(i)===`object`){var l=Object.keys(t);return l.length===Object.keys(i).length&&l.every(function(n){return e(t[n],i[n],s)})}return!1}(e,t)}function Bi(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Vi(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,ki(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}Ri.preMessage=function(e){Pi.push(e)},Ri.resetWarned=function(){Ni={}},Ri.noteOnce=function(e,t){Li(Ii,e,t)};function Hi(e){return e.join(`%`)}var Ui=function(){function e(t){Bi(this,e),Ai(this,`instanceId`,void 0),Ai(this,`cache`,new Map),Ai(this,`extracted`,new Set),this.instanceId=t}return Vi(e,[{key:`get`,value:function(e){return this.opGet(Hi(e))}},{key:`opGet`,value:function(e){return this.cache.get(e)||null}},{key:`update`,value:function(e,t){return this.opUpdate(Hi(e),t)}},{key:`opUpdate`,value:function(e,t){var n=t(this.cache.get(e));n===null?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),Wi=[`children`],Gi=`data-css-hash`,Ki=`__cssinjs_instance__`;function qi(){var e=Math.random().toString(12).slice(2);if(typeof document<`u`&&document.head&&document.body){var t=document.body.querySelectorAll(`style[${Gi}]`)||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[Ki]=t[Ki]||e,t[Ki]===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll(`style[${Gi}]`)).forEach(function(t){var n,i=t.getAttribute(Gi);r[i]?t[Ki]===e&&((n=t.parentNode)==null||n.removeChild(t)):r[i]=!0})}return new Ui(e)}var Ji=s.createContext({hashPriority:`low`,cache:qi(),defaultCache:!0}),Yi=function(e){var t,n,r,i,a=e.children,o=function(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Wi),c=s.useContext(Ji),l=(t=function(){var e=Mi({},c);Object.keys(o).forEach(function(t){var n=o[t];o[t]!==void 0&&(e[t]=n)});var t=o.cache;return e.cache=e.cache||qi(),e.defaultCache=!t&&c.defaultCache,e},n=[c,o],r=function(e,t){return!zi(e[0],t[0],!0)||!zi(e[1],t[1],!0)},`value`in(i=s.useRef({})).current&&!r(i.current.condition,n)||(i.current.value=t(),i.current.condition=n),i.current.value);return s.createElement(Ji.Provider,{value:l},a)},Xi=function(){function e(){Bi(this,e),Ai(this,`cache`,void 0),Ai(this,`keys`,void 0),Ai(this,`cacheCallTimes`,void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Vi(e,[{key:`size`,value:function(){return this.keys.length}},{key:`internalGet`,value:function(e){var t,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r={map:this.cache};return e.forEach(function(e){var t;r=r?(t=r)==null||(t=t.map)==null?void 0:t.get(e):void 0}),(t=r)!=null&&t.value&&n&&(r.value[1]=this.cacheCallTimes++),r?.value}},{key:`get`,value:function(e){return this.internalGet(e,!0)?.[0]}},{key:`has`,value:function(e){return!!this.internalGet(e)}},{key:`set`,value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var i=Di(this.keys.reduce(function(e,t){var n=Di(e,2)[1];return r.internalGet(t)[1]<n?[t,r.internalGet(t)[1]]:e},[this.keys[0],this.cacheCallTimes]),1)[0];this.delete(i)}this.keys.push(t)}var a=this.cache;t.forEach(function(e,i){if(i===t.length-1)a.set(e,{value:[n,r.cacheCallTimes++]});else{var o=a.get(e);o?o.map||=new Map:a.set(e,{map:new Map}),a=a.get(e).map}})}},{key:`deleteByPath`,value:function(e,t){var n=e.get(t[0]);if(t.length===1)return n.map?e.set(t[0],{map:n.map}):e.delete(t[0]),n.value?.[0];var r=this.deleteByPath(n.map,t.slice(1));return n.map&&n.map.size!==0||n.value||e.delete(t[0]),r}},{key:`delete`,value:function(e){if(this.has(e))return this.keys=this.keys.filter(function(t){return!function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,e)}),this.deleteByPath(this.cache,e)}}]),e}();function Zi(e,t,n){if(arguments.length>4&&arguments[4]!==void 0&&arguments[4])return e;var r=Mi(Mi({},arguments.length>3&&arguments[3]!==void 0?arguments[3]:{}),{},Ai(Ai({},`data-token-hash`,t),Gi,n));return`<style ${Object.keys(r).map(function(e){var t=r[e];return t?`${e}="${t}"`:null}).filter(function(e){return e}).join(` `)}>${e}</style>`}Ai(Xi,`MAX_CACHE_SIZE`,20),Ai(Xi,`MAX_CACHE_OFFSET`,5),new Xi,typeof window<`u`&&window.document&&window.document.createElement?s.useLayoutEffect:s.useEffect,Mi({},s).useInsertionEffect,Mi({},s).useInsertionEffect;var Qi=`comm`,$i=`rule`,ea=`decl`,ta=Math.abs,na=String.fromCharCode;function ra(e){return e.trim()}function ia(e,t,n){return e.replace(t,n)}function aa(e,t,n){return e.indexOf(t,n)}function oa(e,t){return 0|e.charCodeAt(t)}function sa(e,t,n){return e.slice(t,n)}function ca(e){return e.length}function la(e,t){return t.push(e),e}var ua=1,da=1,fa=0,pa=0,ma=0,ha=``;function ga(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:ua,column:da,length:o,return:``,siblings:s}}function _a(){return ma=pa>0?oa(ha,--pa):0,da--,ma===10&&(da=1,ua--),ma}function va(){return ma=pa<fa?oa(ha,pa++):0,da++,ma===10&&(da=1,ua++),ma}function H(){return oa(ha,pa)}function ya(){return pa}function ba(e,t){return sa(ha,e,t)}function xa(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Sa(e){return ra(ba(pa-1,Ta(e===91?e+2:e===40?e+1:e)))}function Ca(e){for(;(ma=H())&&ma<33;)va();return xa(e)>2||xa(ma)>3?``:` `}function wa(e,t){for(;--t&&va()&&!(ma<48||ma>102||ma>57&&ma<65||ma>70&&ma<97););return ba(e,ya()+(t<6&&H()==32&&va()==32))}function Ta(e){for(;va();)switch(ma){case e:return pa;case 34:case 39:e!==34&&e!==39&&Ta(ma);break;case 40:e===41&&Ta(e);break;case 92:va()}return pa}function Ea(e,t){for(;va()&&e+ma!==57&&(e+ma!==84||H()!==47););return`/*`+ba(t,pa-1)+`*`+na(e===47?e:va())}function Da(e){for(;!xa(H());)va();return ba(e,pa)}function Oa(e){return function(e){return ha=``,e}(ka(``,null,null,null,[``],e=function(e){return ua=da=1,fa=ca(ha=e),pa=0,[]}(e),0,[0],e))}function ka(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=va()){case 40:if(m!=108&&oa(C,d-1)==58){aa(C+=ia(Sa(v),`&`,`&\f`),`&\f`,ta(l?s[l-1]:0))!=-1&&(_=-1);break}case 34:case 39:case 91:C+=Sa(v);break;case 9:case 10:case 13:case 32:C+=Ca(m);break;case 92:C+=wa(ya()-1,7);continue;case 47:switch(H()){case 42:case 47:la(ja(Ea(va(),ya()),t,n,c),c),xa(m||1)!=5&&xa(H()||1)!=5||!ca(C)||sa(C,-1,void 0)===` `||(C+=` `);break;default:C+=`/`}break;case 123*h:s[l++]=ca(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=ia(C,/\f/g,``)),p>0&&(ca(C)-d||h===0&&m===47)&&la(p>32?Ma(C+`;`,r,n,d-1,c):Ma(ia(C,` `,``)+`;`,r,n,d-2,c),c);break;case 59:C+=`;`;default:if(la(S=Aa(C,t,n,l,u,i,s,y,b=[],x=[],d,a),a),v===123)if(u===0)ka(C,t,S,S,b,a,d,s,x);else{switch(f){case 99:if(oa(C,3)===110)break;case 108:if(oa(C,2)===97)break;default:u=0;case 100:case 109:case 115:}u?ka(e,S,S,r&&la(Aa(e,S,S,0,0,i,s,y,i,b=[],d,x),x),i,x,d,s,r?b:x):ka(C,S,S,S,[``],x,0,s,x)}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+ca(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&_a()==125)continue}switch(C+=na(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(ca(C)-1)*_,_=1;break;case 64:H()===45&&(C+=Sa(va())),f=H(),u=d=ca(y=C+=Da(ya())),v++;break;case 45:m===45&&ca(C)==2&&(h=0)}}return a}function Aa(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=function(e){return e.length}(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=sa(e,f+1,f=ta(g=o[h])),b=e;v<m;++v)(b=ra(g>0?p[v]+` `+y:ia(y,/&\f/g,p[v])))&&(c[_++]=b);return ga(e,t,n,i===0?$i:s,c,l,u,d)}function ja(e,t,n,r){return ga(e,t,n,Qi,na(ma),sa(e,2,-2),0,r)}function Ma(e,t,n,r,i){return ga(e,t,n,ea,sa(e,0,r),sa(e,r+1,-1),r,i)}function Na(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function Pa(e,t,n,r){switch(e.type){case`@layer`:if(e.children.length)break;case`@import`:case`@namespace`:case ea:return e.return=e.return||e.value;case Qi:return``;case`@keyframes`:return e.return=e.value+`{`+Na(e.children,r)+`}`;case $i:if(!ca(e.value=e.props.join(`,`)))return``}return ca(n=Na(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Fa(e){return e.notSplit=!0,e}Ai(Ai(Ai({},`style`,function(e,t,n){var r=Di(e,6),i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=(n||{}).plain;if(c)return null;var d=i,f={"data-rc-order":`prependQueue`,"data-rc-priority":`${l}`};return d=Zi(i,a,o,f,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var n=Zi(function(e){return Na(Oa(e),Pa).replace(/\{%%%\:[^;];}/g,`;`)}(s[e]),a,`_effect-${e}`,f,u);e.startsWith(`@layer`)?d=n+d:d+=n}}),[l,o,d]}),`token`,function(e,t,n){var r=Di(e,5),i=r[2],a=r[3],o=r[4],s=(n||{}).plain;if(!a)return null;var c=i._tokenKey;return[-999,c,Zi(a,o,c,{"data-rc-order":`prependQueue`,"data-rc-priority":`-999`},s)]}),`cssVar`,function(e,t,n){var r=Di(e,4),i=r[1],a=r[2],o=r[3],s=(n||{}).plain;return i?[-999,a,Zi(i,o,a,{"data-rc-order":`prependQueue`,"data-rc-priority":`-999`},s)]:null}),Fa([`borderTop`,`borderBottom`]),Fa([`borderTop`]),Fa([`borderBottom`]),Fa([`borderLeft`,`borderRight`]),Fa([`borderLeft`]),Fa([`borderRight`]);var Ia={defaultMerge:Symbol(`deepmerge-ts: default merge`),skip:Symbol(`deepmerge-ts: skip`)};function La(e,t){return t}function Ra(e,t){return e.filter(e=>e!==void 0)}var za;function Ba(e){return typeof e!=`object`||!e?0:Array.isArray(e)?2:function(e){if(!Ua.includes(Object.prototype.toString.call(e)))return!1;let{constructor:t}=e;if(t===void 0)return!0;let n=t.prototype;return!(typeof n!=`object`||!n||!Ua.includes(Object.prototype.toString.call(n))||!n.hasOwnProperty(`isPrototypeOf`))}(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Va(e,t){return typeof e==`object`&&Object.prototype.propertyIsEnumerable.call(e,t)}function Ha(e){let t=0,n=e[0]?.[Symbol.iterator]();return{[Symbol.iterator]:()=>({next(){for(;;){if(n===void 0)return{done:!0,value:void 0};let r=n.next();if(!0!==r.done)return{done:!1,value:r.value};t+=1,n=e[t]?.[Symbol.iterator]()}}})}}(function(e){e[e.NOT=0]=`NOT`,e[e.RECORD=1]=`RECORD`,e[e.ARRAY=2]=`ARRAY`,e[e.SET=3]=`SET`,e[e.MAP=4]=`MAP`,e[e.OTHER=5]=`OTHER`})(za||={});var Ua=[`[object Object]`,`[object Module]`],Wa={mergeRecords:function(e,t,n){let r={};for(let i of function(e){let t=new Set;for(let n of e)for(let e of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(e);return t}(e)){let a=[];for(let t of e)Va(t,i)&&a.push(t[i]);if(a.length===0)continue;let o=Ka(a,t,t.metaDataUpdater(n,{key:i,parents:e}));o!==Ia.skip&&(i===`__proto__`?Object.defineProperty(r,i,{value:o,configurable:!0,enumerable:!0,writable:!0}):r[i]=o)}return r},mergeArrays:function(e){return e.flat()},mergeSets:function(e){return new Set(Ha(e))},mergeMaps:function(e){return new Map(Ha(e))},mergeOthers:function(e){return e.at(-1)}};function Ga(...e){return function(e,t){let n=function(e,t){return{defaultMergeFunctions:Wa,mergeFunctions:{...Wa,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(Wa,e)).map(([e,t])=>!1===t?[e,Wa.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??La,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:!1===e.filterValues?void 0:e.filterValues??Ra,actions:Ia}}(e,r);function r(...e){return Ka(e,n,t)}return r}({})(...e)}function Ka(e,t,n){let r=t.filterValues?.(e,n)??e;if(r.length===0)return;if(r.length===1)return qa(r,t,n);let i=Ba(r[0]);if(i!==0&&i!==5){for(let e=1;e<r.length;e++)if(Ba(r[e])!==i)return qa(r,t,n)}switch(i){case 1:return function(e,t,n){let r=t.mergeFunctions.mergeRecords(e,t,n);return r===Ia.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):r}(r,t,n);case 2:return function(e,t,n){let r=t.mergeFunctions.mergeArrays(e,t,n);return r===Ia.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):r}(r,t,n);case 3:return function(e,t,n){let r=t.mergeFunctions.mergeSets(e,t,n);return r===Ia.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):r}(r,t,n);case 4:return function(e,t,n){let r=t.mergeFunctions.mergeMaps(e,t,n);return r===Ia.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):r}(r,t,n);default:return qa(r,t,n)}}function qa(e,t,n){let r=t.mergeFunctions.mergeOthers(e,t,n);return r===Ia.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}var Ja=`my_files`,Ya=`gif`,Xa=`stock_images`,Za=`icons`,Qa=`ai`,$a=`image_codes`,eo=`editor`,to=`Trash`,no=`light`,ro=`dark`,io=`system`,ao=`(prefers-color-scheme: dark)`,oo=!1,so=`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+`,co=[`jpg`,`jpeg`,`png`,`bmp`,`webp`,`svg`,`ico`,`tiff`,`tif`],lo=[`jpg`,`jpeg`,`png`,`bmp`,`webp`,`svg`,`ico`,`tiff`,`tif`,`gif`],uo={keywords:``,color:``,orientation:``};u.Spin.setDefaultIndicator((0,l.jsx)(()=>(0,l.jsx)(m.LoadingOutlined,{style:{fontSize:48,height:`100%`},spin:!0}),{}));var fo={hashed:!1,algorithm:u.theme.defaultAlgorithm,token:{colorLink:`#1677ff`,colorInfo:`#722ed1`,colorTextBase:`#000000`,colorBgLayout:`#f0f2f5`,borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,colorDarken1:`rgba(0, 0, 0, 0.08)`,colorFillSecondaryDarken:`rgba(0, 0, 0, 0.1)`,formControlHeight:34,borderWidth:1,borderColorHover:`#C5C5C5`,formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:`63.92%`,colorSecondaryL:`50%`,colorSecondaryBgH:273,colorSecondaryBgS:`100%`,colorSecondaryBgL:`93%`,appZoom:1},components:{Progress:{colorFillSecondary:`#ffffff`},Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},po={hashed:!1,algorithm:u.theme.darkAlgorithm,token:{colorBgBase:`#1F1F1F`,colorInfo:`#9254de`,colorLink:`#1890ff`,colorLinkHover:`#69c0ff`,wireframe:!1,borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,borderWidth:1,colorDarken1:`rgba(0, 0, 0, 0.9)`,colorFillSecondaryDarken:`rgba(255, 255, 255, 0.16)`,formControlHeight:34,borderColorHover:`rgba(255, 255, 255, 0.3)`,formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},components:{Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},mo=({externalTheme:e=no,children:t,customThemeToken:n})=>{let r=matchMedia(ao).matches?ro:no,i=e===io?r:e,[a,o]=(0,s.useState)(i),[c,d]=(0,s.useState)(a===`light`?fo:po);return(0,s.useEffect)(()=>{o(i)},[i]),(0,s.useEffect)(()=>{let e=a===`light`?fo:po,t=n?Ga(e.token,n):e.token;d(Object.assign(Object.assign({},e),{token:t}))},[d,a,n]),(0,l.jsx)(`div`,{id:`file-manager-element-id`,style:{height:`100%`},children:(0,l.jsx)(u.ConfigProvider,{theme:c,children:(0,l.jsx)(Yi,{transformers:[],children:(0,l.jsx)(u.App,{style:{height:`100%`},children:t})})})})},ho=!1,go=()=>{if(ho)return;window.addEventListener(`error`,e=>!(!e.message||!e.message.includes(`ResizeObserver loop completed with undelivered notifications`))&&(e.stopImmediatePropagation(),e.preventDefault(),!0),!0);let e=window.onerror;window.onerror=(t,n,r,i,a)=>!(typeof t!=`string`||!t.includes(`ResizeObserver loop completed with undelivered notifications`))||!!e&&e(t,n,r,i,a),window.addEventListener(`unhandledrejection`,e=>{var t;(t=e.reason?.message)!=null&&t.includes(`ResizeObserver loop completed with undelivered notifications`)&&e.preventDefault()});let t=console.error;if(console.error=(...e)=>{(e[0]?.toString()||``).includes(`ResizeObserver loop completed with undelivered notifications`)||t.apply(console,e)},typeof window<`u`){let e=()=>{try{[`webpackHotUpdate`,`__webpack_require__`,`__webpack_hash__`].forEach(e=>{if(window[e]){let e=window.__webpack_require__;e&&typeof e==`object`&&e&&`cache`in e}})}catch{}};e(),setTimeout(e,1e3)}ho=!0},_o=e=>{if(!e)return`image/png`;let t=e.toLowerCase();return t.includes(`jpeg`)||t.includes(`jpg`)||t.includes(`pjpeg`)?`image/jpeg`:t.includes(`png`)?`image/png`:t.includes(`gif`)?`image/gif`:t.includes(`webp`)?`image/webp`:t.includes(`svg`)?`image/svg+xml`:`image/png`},vo=e=>{if(!e.startsWith(`data:`))return null;let t=e.match(/^data:([^;,]+)/);return t?t[1]:null},yo=(e,t=`image/png`)=>{let n=t;if(typeof e==`string`&&e.startsWith(`data:`)){let t=vo(e);t&&t.startsWith(`image/`)&&(n=t)}return _o(n)},bo=e=>{let t=_o(e).split(`/`)[1];return t===`svg+xml`?`svg`:t||`png`};function xo(e){switch(e.trim().split(`.`).pop()?.toLowerCase()){case`svg`:return`image/svg+xml`;case`png`:return`image/png`;case`jpg`:case`jpeg`:return`image/jpeg`;case`gif`:return`image/gif`;case`webp`:return`image/webp`;default:return}}function So(e){var t;if(((t=e.type)?.startsWith)?.call(t,`image/`))return!0;let n=(e.name??``).trim();if(xo(n))return!0;let r=(e.type??``).toLowerCase();return!!r.includes(`svg`)||(r===`text/xml`||r===`application/xml`||r===`text/plain`)&&n.toLowerCase().endsWith(`.svg`)}var Co=/^data:(.+?);base64,(.+)$/i,wo=e=>{let t=(e=>{if(typeof globalThis.atob!=`function`)throw Error(`Base64 decoding is not supported in the current environment.`);return globalThis.atob(e)})(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r},To=(e,t)=>{let n=wo(e.replace(/\s/g,``)),r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),new Blob([r],{type:t})},Eo=(e,t=`application/octet-stream`)=>{if(e instanceof Blob)return e;if(typeof e==`string`){let n=e.trim(),r=n.match(Co);if(r){let[,e,t]=r;return To(t,e)}return To(n,t)}throw Error(`Unsupported data type. Expected Blob or base64 string.`)},Do={а:`a`,б:`b`,в:`v`,г:`g`,д:`d`,е:`e`,ё:`yo`,ж:`zh`,з:`z`,и:`i`,й:`y`,к:`k`,л:`l`,м:`m`,н:`n`,о:`o`,п:`p`,р:`r`,с:`s`,т:`t`,у:`u`,ф:`f`,х:`h`,ц:`ts`,ч:`ch`,ш:`sh`,щ:`sch`,ъ:``,ы:`y`,ь:``,э:`e`,ю:`yu`,я:`ya`,А:`A`,Б:`B`,В:`V`,Г:`G`,Д:`D`,Е:`E`,Ё:`Yo`,Ж:`Zh`,З:`Z`,И:`I`,Й:`Y`,К:`K`,Л:`L`,М:`M`,Н:`N`,О:`O`,П:`P`,Р:`R`,С:`S`,Т:`T`,У:`U`,Ф:`F`,Х:`H`,Ц:`Ts`,Ч:`Ch`,Ш:`Sh`,Щ:`Sch`,Ъ:``,Ы:`Y`,Ь:``,Э:`E`,Ю:`Yu`,Я:`Ya`},Oo=/[<>:"/\\|?*()#\x00-\x1f]/g,ko=/[\u2010-\u2015\u2212\uFE63\uFF0D]/g,Ao=/[\u00D7\u2715\u2716\u2A2F]/g,jo=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,Mo=/[\u00AD\u200B-\u200D\u2060\uFEFF]/g,No=/[\u2018\u2019\u201A\u201B\u00AB\u00BB\u201C\u201D\u201E\u201F'"`]/g,Po=/[\u2022\u2044]/g,Fo={transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0};function Io(e,t){let n=e;return t.transliterate&&(n=n.normalize(`NFC`).split(``).map(e=>Do[e]??e).join(``)),n=n.normalize(`NFKC`),n=function(e){return e.replace(/\u2026/g,`...`).replace(ko,`-`).replace(Ao,`x`).replace(jo,` `).replace(Mo,``).replace(No,``).replace(Po,`-`).replace(/\u00B7/g,`-`).replace(/\u00A9/g,`c`).replace(/\u00AE/g,`r`).replace(/\u2122/g,`tm`).replace(/\./g,`-`)}(n),t.removeForbiddenChars&&(n=n.replace(Oo,`_`)),t.replaceSpaces&&(n=n.replace(/\s+/g,`_`)),t.toLowerCase&&(n=n.toLowerCase()),n=n.replace(/_{2,}/g,`_`),n=n.replace(/^_+|_+$/g,``),n.length>255&&(n=n.substring(0,255)),n}function Lo(e,t){let n=Object.assign(Object.assign({},Fo),t?.fileNameProcessing),r=e.lastIndexOf(`.`),i,a;return r>0?(i=e.substring(0,r),a=e.substring(r).toLowerCase()):(i=e,a=``),(Io(i,n)||`unnamed_file`)+a}function Ro(e,t){return Io(e,Object.assign(Object.assign({},Fo),t?.folderNameProcessing))||`unnamed_folder`}function zo(e){return!0===e?.dedupeUploadNamesOnClient}var Bo=e=>typeof e==`string`,Vo=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},Ho=e=>e==null?``:``+e,Uo=/###/g,Wo=e=>e&&e.indexOf(`###`)>-1?e.replace(Uo,`.`):e,Go=e=>!e||Bo(e),Ko=(e,t,n)=>{let r=Bo(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(Go(e))return{};let t=Wo(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return Go(e)?{}:{obj:e,k:Wo(r[i])}},qo=(e,t,n)=>{let{obj:r,k:i}=Ko(e,t,Object);if(r!==void 0||t.length===1)return void(r[i]=n);let a=t[t.length-1],o=t.slice(0,t.length-1),s=Ko(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=Ko(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},Jo=(e,t)=>{let{obj:n,k:r}=Ko(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Yo=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?Bo(e[r])||e[r]instanceof String||Bo(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Yo(e[r],t[r],n):e[r]=t[r]);return e},Xo=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),Zo={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Qo=e=>Bo(e)?e.replace(/[&<>"'\/]/g,e=>Zo[e]):e,$o=[` `,`,`,`?`,`!`,`;`],es=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),ts=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},ns=e=>e?.replace(`_`,`-`),rs={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},is=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||rs,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(Bo(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t||=this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}},as=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},os=class extends as{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Bo(n)&&i?o.push(...n.split(i)):o.push(n)));let s=Jo(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),!s&&a&&Bo(n)?ts(this.data?.[e]?.[t],n,i):s}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),qo(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(Bo(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=Jo(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Yo(s,n,i):s={...s,...n},qo(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},ss={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},cs=Symbol(`i18next/PATH_KEY`);function ls(e,t){let{[cs]:n}=e(function(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===cs?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(t?.keySeparator??`.`)}var us={},ds=e=>!Bo(e)&&typeof e!=`boolean`&&typeof e!=`number`,fs=class e extends as{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=is.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};return e==null?!1:this.resolve(e,n)?.res!==void 0}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t||=``,n||=``;let r=$o.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=es.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a})(e,n,r));if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Bo(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Bo(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=ls(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]);let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=i.count!==void 0&&!Bo(i.count),b=e.hasDefaultValue(i),x=y?this.pluralResolver.getSuffix(d,i.count,i):``,S=i.ordinal&&y?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,C=y&&!i.ordinal&&i.count===0,w=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${x}`]||i[`defaultValue${S}`]||i.defaultValue,T=m;v&&!m&&b&&(T=w);let E=ds(T),D=Object.prototype.toString.apply(T);if(!(v&&T&&E&&[`[object Number]`,`[object Function]`,`[object RegExp]`].indexOf(D)<0)||Bo(_)&&Array.isArray(T))if(v&&Bo(_)&&Array.isArray(m))m=m.join(_),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&b&&(e=!0,m=w),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=b&&w!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?w:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=b&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||w)})}):n(e,s,w))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}else{if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,T,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(T),t=e?[]:{},n=e?g:h;for(let e in T)if(Object.prototype.hasOwnProperty.call(T,e)){let r=`${n}${o}${e}`;t[e]=b&&!m?this.translate(r,{...i,defaultValue:ds(w)?w[e]:void 0,joinArrays:!1,ns:c}):this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=T[e])}m=t}}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=Bo(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!Bo(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=Bo(a)?[a]:a;return e!=null&&o?.length&&!1!==n.applyPostProcessor&&(e=ss.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return Bo(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Bo(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(Bo(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,us[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(o)||(us[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return!(e===void 0||!this.options.returnNull&&e===null||!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Bo(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},ps=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=is.create(`languageUtils`)}getScriptPartFromCode(e){if(!(e=ns(e))||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2?null:(t.pop(),t[t.length-1].toLowerCase()===`x`?null:this.formatLanguageCode(t.join(`-`)))}getLanguagePartFromCode(e){if(!(e=ns(e))||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Bo(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf(`-`)<0&&r.indexOf(`-`)<0?void 0:e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1?e:void 0)}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Bo(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Bo(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Bo(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},ms={zero:0,one:1,two:2,few:3,many:4,other:5},hs={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},gs=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=is.create(`pluralResolver`),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=ns(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(!Intl)return this.logger.error(`No Intl support, please use an Intl polyfill!`),hs;if(!e.match(/-|_/))return hs;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>ms[e]-ms[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},_s=(e,t,n,r=`.`,i=!0)=>{let a=((e,t,n)=>{let r=Jo(e,n);return r===void 0?Jo(t,n):r})(e,t,n);return!a&&i&&Bo(n)&&(a=ts(e,n,r),a===void 0&&(a=ts(t,n,r))),a},vs=e=>e.replace(/\$/g,`$$$$`),ys=class{constructor(e={}){this.logger=is.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Qo:t,this.escapeValue=n===void 0||n,this.useRawValueToEscape=r!==void 0&&r,this.prefix=i?Xo(i):a||`{{`,this.suffix=o?Xo(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?Xo(d):f||Xo(`$t(`),this.nestingSuffix=p?Xo(p):m||Xo(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_!==void 0&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=_s(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(_s(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>vs(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?vs(this.escape(e)):vs(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Bo(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else{if(u){a=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``}else Bo(a)||this.useRawValueToEscape||(a=Ho(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!Bo(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Bo(i))return i;Bo(i)||(i=Ho(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},bs=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e(ns(r),i),t[o]=s),s(n)}},xs=e=>(t,n,r)=>e(ns(n),r)(t),Ss=class{constructor(e={}){this.logger=is.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?bs:xs;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=bs(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}},Cs=class extends as{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=is.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{((e,t,n)=>{let{obj:r,k:i}=Ko(e,t,Object);r[i]=r[i]||[],r[i].push(n)})(n.loaded,[i],a),((e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),n.pendingCount!==0||n.done||(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*i,a)},i):a(o,s)},s=this.backend[n].bind(this.backend);if(s.length!==2)return s(e,t,o);try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Bo(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Bo(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(n!=null&&n!==``){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)}},ws=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Bo(e[1])&&(t.defaultValue=e[1]),Bo(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ts=e=>(Bo(e.ns)&&(e.ns=[e.ns]),Bo(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Bo(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),Es=()=>{},Ds=class e extends as{constructor(e={},t){var n;if(super(),this.options=Ts(e),this.services={},this.logger=is,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{typeof n[e]==`function`&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(Bo(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=ws();this.options={...n,...this.options,...Ts(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);let r=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?is.init(r(this.modules.logger),this.options):is.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Ss;let t=new ps(this.options);this.store=new os(this.options.resources,this.options);let i=this.services;i.logger=is,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new gs(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new ys(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Cs(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new fs(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=Es,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=Vo(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=Es){let n=t,r=Bo(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=Vo();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=Es,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&ss.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=Vo();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{e||t||!this.services.languageDetector||(t=[]);let n=Bo(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Bo(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o=this.options.keySeparator||`.`,s;return a.keyPrefix&&Array.isArray(e)?s=e.map(e=>(typeof e==`function`&&(e=ls(e,{...this.options,...t})),`${a.keyPrefix}${o}${e}`)):(typeof e==`function`&&(e=ls(e,{...this.options,...t})),s=a.keyPrefix?`${a.keyPrefix}${o}${e}`:e),this.t(s,a)};return Bo(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!this.hasResourceBundle(n,e)||!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(n,e)||r&&!a(i,e))}loadNamespaces(e,t){let n=Vo();return this.options.ns?(Bo(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=Vo();Bo(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=this.services?.languageUtils||new ps(ws());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`).indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){return new e(t,n)}cloneInstance(t={},n=Es){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);return t.debug===void 0&&t.prefix===void 0||(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new os(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),a.translator=new fs(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}},U=Ds.createInstance();U.createInstance=Ds.createInstance,U.createInstance,U.dir,U.init,U.loadResources,U.reloadResources,U.use,U.changeLanguage,U.getFixedT,U.t,U.exists,U.setDefaultNamespace,U.hasLoadedNamespace,U.loadNamespaces,U.loadLanguages;var Os=typeof globalThis<`u`?globalThis:typeof window<`u`?window:r.r===void 0?typeof self<`u`?self:{}:r.r;function ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function As(e){if(Object.prototype.hasOwnProperty.call(e,`__esModule`))return e;var t=e.default;if(typeof t==`function`){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var js={},Ms=(e,t,n,r)=>{Is(n)&&js[n]||(Is(n)&&(js[n]=new Date),((e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);Is(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn&&e.services.logger.warn(...i)})(e,t,n,r))},Ns=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},Ps=(e,t,n)=>{e.loadNamespaces(t,Ns(e,n))},Fs=(e,t,n,r)=>{if(Is(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ps(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Ns(e,r))},Is=e=>typeof e==`string`,Ls=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Rs={"&amp;":`&`,"&#38;":`&`,"&lt;":`<`,"&#60;":`<`,"&gt;":`>`,"&#62;":`>`,"&apos;":`'`,"&#39;":`'`,"&quot;":`"`,"&#34;":`"`,"&nbsp;":` `,"&#160;":` `,"&copy;":`©`,"&#169;":`©`,"&reg;":`®`,"&#174;":`®`,"&hellip;":`…`,"&#8230;":`…`,"&#x2F;":`/`,"&#47;":`/`},zs=e=>Rs[e],Bs={bindI18n:`languageChanged`,bindI18nStore:``,transEmptyNodeValue:``,transSupportBasicHtmlNodes:!0,transWrapTextNodes:``,transKeepBasicHtmlNodesFor:[`br`,`strong`,`i`,`p`],useSuspense:!0,unescape:e=>e.replace(Ls,zs)},Vs,Hs={type:`3rdParty`,init(e){((e={})=>{Bs={...Bs,...e}})(e.options.react),(e=>{Vs=e})(e)}},Us=(0,s.createContext)(),Ws=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},Gs=(e,t,n,r)=>e.getFixedT(t,n,r),Ks=(e,t={})=>{let{i18n:n}=t,{i18n:r,defaultNS:i}=(0,s.useContext)(Us)||{},a=n||r||Vs;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Ws),!a){Ms(a,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next`);let e=(e,t)=>{return Is(t)?t:typeof(n=t)==`object`&&n!==null&&Is(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var n},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}a.options.react?.wait&&Ms(a,`DEPRECATED_OPTION`,`useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.`);let o={...Bs,...a.options.react,...t},{useSuspense:c,keyPrefix:l}=o,u=i||a.options?.defaultNS;u=Is(u)?[u]:u||[`translation`],a.reportNamespaces.addUsedNamespaces?.(u);let d=(a.isInitialized||a.initializedStoreOnce)&&u.every(e=>((e,t,n={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):(Ms(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0))(e,a,o)),f=((e,t,n,r)=>(0,s.useCallback)(Gs(e,t,n,r),[e,t,n,r]))(a,t.lng||null,o.nsMode===`fallback`?u:u[0],l),p=()=>f,m=()=>Gs(a,t.lng||null,o.nsMode===`fallback`?u:u[0],l),[h,g]=(0,s.useState)(p),_=u.join();t.lng&&(_=`${t.lng}${_}`);let v=((e,t)=>{let n=(0,s.useRef)();return(0,s.useEffect)(()=>{n.current=e},[e,t]),n.current})(_),y=(0,s.useRef)(!0);(0,s.useEffect)(()=>{let{bindI18n:e,bindI18nStore:n}=o;y.current=!0,d||c||(t.lng?Fs(a,t.lng,u,()=>{y.current&&g(m)}):Ps(a,u,()=>{y.current&&g(m)})),d&&v&&v!==_&&y.current&&g(m);let r=()=>{y.current&&g(m)};return e&&a?.on(e,r),n&&a?.store.on(n,r),()=>{y.current=!1,a&&e&&e?.split(` `).forEach(e=>a.off(e,r)),n&&a&&n.split(` `).forEach(e=>a.store.off(e,r))}},[a,_]),(0,s.useEffect)(()=>{y.current&&d&&g(p)},[a,l,d]);let b=[h,a,d];if(b.t=h,b.i18n=a,b.ready=d,d||!d&&!c)return b;throw new Promise(e=>{t.lng?Fs(a,t.lng,u,()=>e()):Ps(a,u,()=>e())})};function qs({i18n:e,defaultNS:t,children:n}){let r=(0,s.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,s.createElement)(Us.Provider,{value:r},n)}var Js={};function Ys(e){return Ys=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ys(e)}function Xs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Zs(r.key),r)}}function Zs(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return typeof t==`symbol`?t:String(t)}function Qs(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ec(e,t,`get`))}function $s(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError(`attempted to set read only private field`);t.value=n}}(e,ec(e,t,`set`),n),n}function ec(e,t,n){if(!t.has(e))throw TypeError(`attempted to `+n+` private field on non-instance`);return t.get(e)}function tc(e,t,n){(function(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)})(e,t),t.set(e,n)}var nc=function(e){if(!e)return[];Array.isArray(e)||(e=[e]);for(var t={},n=0;n<e.length;++n){var r=e[n];if(r&&Ys(r)===`object`&&(r=String(r)),typeof r!=`string`){var i=`Locales should be strings, ${JSON.stringify(r)} isn't.`;throw TypeError(i)}var a=r.split(`-`);if(!a.every(function(e){return/[a-z0-9]+/i.test(e)})){var o=`The locale ${JSON.stringify(r)} is not a structurally valid BCP 47 language tag.`;throw RangeError(o)}var s=a[0].toLowerCase();a[0]={in:`id`,iw:`he`,ji:`yi`}[s]??s,t[a.join(`-`)]=!0}return Object.keys(t)};function rc(e){switch(Ys(e)){case`number`:return e;case`bigint`:throw TypeError(`Cannot convert a BigInt value to a number`);default:return Number(e)}}var ic,ac,oc,sc=As(Object.freeze({__proto__:null,default:function(e,t,n,r){var i=function(e){do{if(t(e))return e;e=e.replace(/-?[^-]*$/,``)}while(e);return null},a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=function(){function u(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)})(this,u),tc(this,a,{writable:!0,value:void 0}),tc(this,o,{writable:!0,value:void 0}),tc(this,s,{writable:!0,value:void 0}),tc(this,c,{writable:!0,value:void 0}),tc(this,l,{writable:!0,value:void 0}),$s(this,a,function(t){for(var n=nc(t),r=0;r<n.length;++r){var a=i(n[r]);if(a)return a}var o=new e().resolvedOptions().locale;return i(o)}(n)),$s(this,s,t(Qs(this,a))),$s(this,o,r(Qs(this,a))),$s(this,c,function(e){var t=Object.prototype.hasOwnProperty.call(e,`type`)&&e.type;if(!t)return`cardinal`;if(t===`cardinal`||t===`ordinal`)return t;throw RangeError(`Not a valid plural type: `+JSON.stringify(t))}(d)),$s(this,l,new e(`en`,d))}var d,f,p;return d=u,p=[{key:`supportedLocalesOf`,value:function(e){return nc(e).filter(i)}}],(f=[{key:`resolvedOptions`,value:function(){var e=Qs(this,l).resolvedOptions(),t=e.minimumIntegerDigits,r=e.minimumFractionDigits,i=e.maximumFractionDigits,o=e.minimumSignificantDigits,s=e.maximumSignificantDigits,u=e.roundingPriority,d={locale:Qs(this,a),type:Qs(this,c),minimumIntegerDigits:t,minimumFractionDigits:r,maximumFractionDigits:i};return typeof o==`number`&&(d.minimumSignificantDigits=o,d.maximumSignificantDigits=s),d.pluralCategories=n(Qs(this,a),Qs(this,c)===`ordinal`).slice(0),d.roundingPriority=u||`auto`,d}},{key:`select`,value:function(e){if(!(this instanceof u))throw TypeError(`select() called on incompatible ${this}`);if(typeof e!=`number`&&(e=Number(e)),!isFinite(e))return`other`;var t=Qs(this,l).format(Math.abs(e));return Qs(this,s).call(this,t,Qs(this,c)===`ordinal`)}},{key:`selectRange`,value:function(e,t){if(!(this instanceof u))throw TypeError(`selectRange() called on incompatible ${this}`);if(e===void 0)throw TypeError(`start is undefined`);if(t===void 0)throw TypeError(`end is undefined`);var n=rc(e),r=rc(t);if(!isFinite(n))throw RangeError(`start must be finite`);if(!isFinite(r))throw RangeError(`end must be finite`);return Qs(this,o).call(this,this.select(n),this.select(r))}}])&&Xs(d.prototype,f),p&&Xs(d,p),Object.defineProperty(d,"prototype",{writable:!1}),u}();return typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(u.prototype,Symbol.toStringTag,{value:`Intl.PluralRules`,writable:!1,configurable:!0}),Object.defineProperty(u,"prototype",{writable:!1}),u}}));(function(){if(oc)return Js;oc=1;var e=function(){if(ac)return ic;function e(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}function t(e,t){return t.forEach(function(t){t&&typeof t!=`string`&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}ac=1;var n=e(sc);function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i={exports:{}};(function(e){var t=function(e,t){return t?`other`:e==1?`one`:`other`},n=function(e,t){return t?`other`:e==0||e==1?`one`:`other`},r=function(e,t){return t?`other`:e>=0&&e<=1?`one`:`other`},i=function(e,t){var n=!String(e).split(`.`)[1];return t?`other`:e==1&&n?`one`:`other`},a=function(e,t){return`other`},o=function(e,t){return t?`other`:e==1?`one`:e==2?`two`:`other`};(function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),e.exports=n})(0,{af:t,ak:n,am:r,an:t,ar:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e&&n[0].slice(-2);return t?`other`:e==0?`zero`:e==1?`one`:e==2?`two`:r>=3&&r<=10?`few`:r>=11&&r<=99?`many`:`other`},ars:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e&&n[0].slice(-2);return t?`other`:e==0?`zero`:e==1?`one`:e==2?`two`:r>=3&&r<=10?`few`:r>=11&&r<=99?`many`:`other`},as:function(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?`one`:e==2||e==3?`two`:e==4?`few`:e==6?`many`:`other`:e>=0&&e<=1?`one`:`other`},asa:t,ast:i,az:function(e,t){var n=String(e).split(`.`)[0],r=n.slice(-1),i=n.slice(-2),a=n.slice(-3);return t?r==1||r==2||r==5||r==7||r==8||i==20||i==50||i==70||i==80?`one`:r==3||r==4||a==100||a==200||a==300||a==400||a==500||a==600||a==700||a==800||a==900?`few`:n==0||r==6||i==40||i==60||i==90?`many`:`other`:e==1?`one`:`other`},bal:function(e,t){return e==1?`one`:`other`},be:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e,i=r&&n[0].slice(-1),a=r&&n[0].slice(-2);return t?i!=2&&i!=3||a==12||a==13?`other`:`few`:i==1&&a!=11?`one`:i>=2&&i<=4&&(a<12||a>14)?`few`:r&&i==0||i>=5&&i<=9||a>=11&&a<=14?`many`:`other`},bem:t,bez:t,bg:t,bho:n,bm:a,bn:function(e,t){return t?e==1||e==5||e==7||e==8||e==9||e==10?`one`:e==2||e==3?`two`:e==4?`few`:e==6?`many`:`other`:e>=0&&e<=1?`one`:`other`},bo:a,br:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e,i=r&&n[0].slice(-1),a=r&&n[0].slice(-2),o=r&&n[0].slice(-6);return t?`other`:i==1&&a!=11&&a!=71&&a!=91?`one`:i==2&&a!=12&&a!=72&&a!=92?`two`:(i==3||i==4||i==9)&&(a<10||a>19)&&(a<70||a>79)&&(a<90||a>99)?`few`:e!=0&&r&&o==0?`many`:`other`},brx:t,bs:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-1),s=r.slice(-2),c=i.slice(-1),l=i.slice(-2);return t?`other`:a&&o==1&&s!=11||c==1&&l!=11?`one`:a&&o>=2&&o<=4&&(s<12||s>14)||c>=2&&c<=4&&(l<12||l>14)?`few`:`other`},ca:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-6);return t?e==1||e==3?`one`:e==2?`two`:e==4?`few`:`other`:e==1&&i?`one`:r!=0&&a==0&&i?`many`:`other`},ce:t,ceb:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-1),s=i.slice(-1);return t?`other`:a&&(r==1||r==2||r==3)||a&&o!=4&&o!=6&&o!=9||!a&&s!=4&&s!=6&&s!=9?`one`:`other`},cgg:t,chr:t,ckb:t,cs:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1];return t?`other`:e==1&&i?`one`:r>=2&&r<=4&&i?`few`:i?`other`:`many`},cy:function(e,t){return t?e==0||e==7||e==8||e==9?`zero`:e==1?`one`:e==2?`two`:e==3||e==4?`few`:e==5||e==6?`many`:`other`:e==0?`zero`:e==1?`one`:e==2?`two`:e==3?`few`:e==6?`many`:`other`},da:function(e,t){var n=String(e).split(`.`),r=n[0],i=Number(n[0])==e;return t||e!=1&&(i||r!=0&&r!=1)?`other`:`one`},de:i,doi:r,dsb:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-2),s=i.slice(-2);return t?`other`:a&&o==1||s==1?`one`:a&&o==2||s==2?`two`:a&&(o==3||o==4)||s==3||s==4?`few`:`other`},dv:t,dz:a,ee:t,el:t,en:function(e,t){var n=String(e).split(`.`),r=!n[1],i=Number(n[0])==e,a=i&&n[0].slice(-1),o=i&&n[0].slice(-2);return t?a==1&&o!=11?`one`:a==2&&o!=12?`two`:a==3&&o!=13?`few`:`other`:e==1&&r?`one`:`other`},eo:t,es:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-6);return t?`other`:e==1?`one`:r!=0&&a==0&&i?`many`:`other`},et:i,eu:t,fa:r,ff:function(e,t){return t?`other`:e>=0&&e<2?`one`:`other`},fi:i,fil:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-1),s=i.slice(-1);return t?e==1?`one`:`other`:a&&(r==1||r==2||r==3)||a&&o!=4&&o!=6&&o!=9||!a&&s!=4&&s!=6&&s!=9?`one`:`other`},fo:t,fr:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-6);return t?e==1?`one`:`other`:e>=0&&e<2?`one`:r!=0&&a==0&&i?`many`:`other`},fur:t,fy:i,ga:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e;return t?e==1?`one`:`other`:e==1?`one`:e==2?`two`:r&&e>=3&&e<=6?`few`:r&&e>=7&&e<=10?`many`:`other`},gd:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e;return t?e==1||e==11?`one`:e==2||e==12?`two`:e==3||e==13?`few`:`other`:e==1||e==11?`one`:e==2||e==12?`two`:r&&e>=3&&e<=10||r&&e>=13&&e<=19?`few`:`other`},gl:i,gsw:t,gu:function(e,t){return t?e==1?`one`:e==2||e==3?`two`:e==4?`few`:e==6?`many`:`other`:e>=0&&e<=1?`one`:`other`},guw:n,gv:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-1),o=r.slice(-2);return t?`other`:i&&a==1?`one`:i&&a==2?`two`:!i||o!=0&&o!=20&&o!=40&&o!=60&&o!=80?i?`other`:`many`:`few`},ha:t,haw:t,he:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1];return t?`other`:r==1&&i||r==0&&!i?`one`:r==2&&i?`two`:`other`},hi:function(e,t){return t?e==1?`one`:e==2||e==3?`two`:e==4?`few`:e==6?`many`:`other`:e>=0&&e<=1?`one`:`other`},hnj:a,hr:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-1),s=r.slice(-2),c=i.slice(-1),l=i.slice(-2);return t?`other`:a&&o==1&&s!=11||c==1&&l!=11?`one`:a&&o>=2&&o<=4&&(s<12||s>14)||c>=2&&c<=4&&(l<12||l>14)?`few`:`other`},hsb:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-2),s=i.slice(-2);return t?`other`:a&&o==1||s==1?`one`:a&&o==2||s==2?`two`:a&&(o==3||o==4)||s==3||s==4?`few`:`other`},hu:function(e,t){return t?e==1||e==5?`one`:`other`:e==1?`one`:`other`},hy:function(e,t){return t?e==1?`one`:`other`:e>=0&&e<2?`one`:`other`},ia:i,id:a,ig:a,ii:a,io:i,is:function(e,t){var n=String(e).split(`.`),r=n[0],i=(n[1]||``).replace(/0+$/,``),a=Number(n[0])==e,o=r.slice(-1),s=r.slice(-2);return t?`other`:a&&o==1&&s!=11||i%10==1&&i%100!=11?`one`:`other`},it:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-6);return t?e==11||e==8||e==80||e==800?`many`:`other`:e==1&&i?`one`:r!=0&&a==0&&i?`many`:`other`},iu:o,ja:a,jbo:a,jgo:t,jmc:t,jv:a,jw:a,ka:function(e,t){var n=String(e).split(`.`)[0],r=n.slice(-2);return t?n==1?`one`:n==0||r>=2&&r<=20||r==40||r==60||r==80?`many`:`other`:e==1?`one`:`other`},kab:function(e,t){return t?`other`:e>=0&&e<2?`one`:`other`},kaj:t,kcg:t,kde:a,kea:a,kk:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e,i=r&&n[0].slice(-1);return t?i==6||i==9||r&&i==0&&e!=0?`many`:`other`:e==1?`one`:`other`},kkj:t,kl:t,km:a,kn:r,ko:a,ks:t,ksb:t,ksh:function(e,t){return t?`other`:e==0?`zero`:e==1?`one`:`other`},ku:t,kw:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e,i=r&&n[0].slice(-2),a=r&&n[0].slice(-3),o=r&&n[0].slice(-5),s=r&&n[0].slice(-6);return t?r&&e>=1&&e<=4||i>=1&&i<=4||i>=21&&i<=24||i>=41&&i<=44||i>=61&&i<=64||i>=81&&i<=84?`one`:e==5||i==5?`many`:`other`:e==0?`zero`:e==1?`one`:i==2||i==22||i==42||i==62||i==82||r&&a==0&&(o>=1e3&&o<=2e4||o==4e4||o==6e4||o==8e4)||e!=0&&s==1e5?`two`:i==3||i==23||i==43||i==63||i==83?`few`:e==1||i!=1&&i!=21&&i!=41&&i!=61&&i!=81?`other`:`many`},ky:t,lag:function(e,t){var n=String(e).split(`.`)[0];return t?`other`:e==0?`zero`:n!=0&&n!=1||e==0?`other`:`one`},lb:t,lg:t,lij:function(e,t){var n=String(e).split(`.`),r=!n[1],i=Number(n[0])==e;return t?e==11||e==8||i&&e>=80&&e<=89||i&&e>=800&&e<=899?`many`:`other`:e==1&&r?`one`:`other`},lkt:a,ln:n,lo:function(e,t){return t&&e==1?`one`:`other`},lt:function(e,t){var n=String(e).split(`.`),r=n[1]||``,i=Number(n[0])==e,a=i&&n[0].slice(-1),o=i&&n[0].slice(-2);return t?`other`:a==1&&(o<11||o>19)?`one`:a>=2&&a<=9&&(o<11||o>19)?`few`:r==0?`other`:`many`},lv:function(e,t){var n=String(e).split(`.`),r=n[1]||``,i=r.length,a=Number(n[0])==e,o=a&&n[0].slice(-1),s=a&&n[0].slice(-2),c=r.slice(-2),l=r.slice(-1);return t?`other`:a&&o==0||s>=11&&s<=19||i==2&&c>=11&&c<=19?`zero`:o==1&&s!=11||i==2&&l==1&&c!=11||i!=2&&l==1?`one`:`other`},mas:t,mg:n,mgo:t,mk:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-1),s=r.slice(-2),c=i.slice(-1),l=i.slice(-2);return t?o==1&&s!=11?`one`:o==2&&s!=12?`two`:o!=7&&o!=8||s==17||s==18?`other`:`many`:a&&o==1&&s!=11||c==1&&l!=11?`one`:`other`},ml:t,mn:t,mo:function(e,t){var n=String(e).split(`.`),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?e==1?`one`:`other`:e==1&&r?`one`:!r||e==0||e!=1&&i>=1&&i<=19?`few`:`other`},mr:function(e,t){return t?e==1?`one`:e==2||e==3?`two`:e==4?`few`:`other`:e==1?`one`:`other`},ms:function(e,t){return t&&e==1?`one`:`other`},mt:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e&&n[0].slice(-2);return t?`other`:e==1?`one`:e==2?`two`:e==0||r>=3&&r<=10?`few`:r>=11&&r<=19?`many`:`other`},my:a,nah:t,naq:o,nb:t,nd:t,ne:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?`one`:`other`:e==1?`one`:`other`},nl:i,nn:t,nnh:t,no:t,nqo:a,nr:t,nso:n,ny:t,nyn:t,om:t,or:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e;return t?e==1||e==5||r&&e>=7&&e<=9?`one`:e==2||e==3?`two`:e==4?`few`:e==6?`many`:`other`:e==1?`one`:`other`},os:t,osa:a,pa:n,pap:t,pcm:r,pl:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-1),o=r.slice(-2);return t?`other`:e==1&&i?`one`:i&&a>=2&&a<=4&&(o<12||o>14)?`few`:i&&r!=1&&(a==0||a==1)||i&&a>=5&&a<=9||i&&o>=12&&o<=14?`many`:`other`},prg:function(e,t){var n=String(e).split(`.`),r=n[1]||``,i=r.length,a=Number(n[0])==e,o=a&&n[0].slice(-1),s=a&&n[0].slice(-2),c=r.slice(-2),l=r.slice(-1);return t?`other`:a&&o==0||s>=11&&s<=19||i==2&&c>=11&&c<=19?`zero`:o==1&&s!=11||i==2&&l==1&&c!=11||i!=2&&l==1?`one`:`other`},ps:t,pt:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-6);return t?`other`:r==0||r==1?`one`:r!=0&&a==0&&i?`many`:`other`},pt_PT:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-6);return t?`other`:e==1&&i?`one`:r!=0&&a==0&&i?`many`:`other`},rm:t,ro:function(e,t){var n=String(e).split(`.`),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?e==1?`one`:`other`:e==1&&r?`one`:!r||e==0||e!=1&&i>=1&&i<=19?`few`:`other`},rof:t,ru:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-1),o=r.slice(-2);return t?`other`:i&&a==1&&o!=11?`one`:i&&a>=2&&a<=4&&(o<12||o>14)?`few`:i&&a==0||i&&a>=5&&a<=9||i&&o>=11&&o<=14?`many`:`other`},rwk:t,sah:a,saq:t,sat:o,sc:function(e,t){var n=!String(e).split(`.`)[1];return t?e==11||e==8||e==80||e==800?`many`:`other`:e==1&&n?`one`:`other`},scn:function(e,t){var n=!String(e).split(`.`)[1];return t?e==11||e==8||e==80||e==800?`many`:`other`:e==1&&n?`one`:`other`},sd:t,sdh:t,se:o,seh:t,ses:a,sg:a,sh:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-1),s=r.slice(-2),c=i.slice(-1),l=i.slice(-2);return t?`other`:a&&o==1&&s!=11||c==1&&l!=11?`one`:a&&o>=2&&o<=4&&(s<12||s>14)||c>=2&&c<=4&&(l<12||l>14)?`few`:`other`},shi:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e;return t?`other`:e>=0&&e<=1?`one`:r&&e>=2&&e<=10?`few`:`other`},si:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``;return t?`other`:e==0||e==1||r==0&&i==1?`one`:`other`},sk:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1];return t?`other`:e==1&&i?`one`:r>=2&&r<=4&&i?`few`:i?`other`:`many`},sl:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-2);return t?`other`:i&&a==1?`one`:i&&a==2?`two`:i&&(a==3||a==4)||!i?`few`:`other`},sma:o,smi:o,smj:o,smn:o,sms:o,sn:t,so:t,sq:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e,i=r&&n[0].slice(-1),a=r&&n[0].slice(-2);return t?e==1?`one`:i==4&&a!=14?`many`:`other`:e==1?`one`:`other`},sr:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-1),s=r.slice(-2),c=i.slice(-1),l=i.slice(-2);return t?`other`:a&&o==1&&s!=11||c==1&&l!=11?`one`:a&&o>=2&&o<=4&&(s<12||s>14)||c>=2&&c<=4&&(l<12||l>14)?`few`:`other`},ss:t,ssy:t,st:t,su:a,sv:function(e,t){var n=String(e).split(`.`),r=!n[1],i=Number(n[0])==e,a=i&&n[0].slice(-1),o=i&&n[0].slice(-2);return t?a!=1&&a!=2||o==11||o==12?`other`:`one`:e==1&&r?`one`:`other`},sw:i,syr:t,ta:t,te:t,teo:t,th:a,ti:n,tig:t,tk:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e&&n[0].slice(-1);return t?r==6||r==9||e==10?`few`:`other`:e==1?`one`:`other`},tl:function(e,t){var n=String(e).split(`.`),r=n[0],i=n[1]||``,a=!n[1],o=r.slice(-1),s=i.slice(-1);return t?e==1?`one`:`other`:a&&(r==1||r==2||r==3)||a&&o!=4&&o!=6&&o!=9||!a&&s!=4&&s!=6&&s!=9?`one`:`other`},tn:t,to:a,tpi:a,tr:t,ts:t,tzm:function(e,t){var n=String(e).split(`.`),r=Number(n[0])==e;return t?`other`:e==0||e==1||r&&e>=11&&e<=99?`one`:`other`},ug:t,uk:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=Number(n[0])==e,o=a&&n[0].slice(-1),s=a&&n[0].slice(-2),c=r.slice(-1),l=r.slice(-2);return t?o==3&&s!=13?`few`:`other`:i&&c==1&&l!=11?`one`:i&&c>=2&&c<=4&&(l<12||l>14)?`few`:i&&c==0||i&&c>=5&&c<=9||i&&l>=11&&l<=14?`many`:`other`},und:a,ur:i,uz:t,ve:t,vec:function(e,t){var n=String(e).split(`.`),r=n[0],i=!n[1],a=r.slice(-6);return t?e==11||e==8||e==80||e==800?`many`:`other`:e==1&&i?`one`:r!=0&&a==0&&i?`many`:`other`},vi:function(e,t){return t&&e==1?`one`:`other`},vo:t,vun:t,wa:n,wae:t,wo:a,xh:t,xog:t,yi:i,yo:a,yue:a,zh:a,zu:r})})(i);var a=r(i.exports),o=t({__proto__:null,default:a},[i.exports]),s={exports:{}};(function(e){var t=`zero`,n=`one`,r=`two`,i=`few`,a=`many`,o=`other`,s={cardinal:[n,o],ordinal:[o]},c={cardinal:[n,o],ordinal:[n,o]},l={cardinal:[o],ordinal:[o]},u={cardinal:[n,r,o],ordinal:[o]};(function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),e.exports=n})(0,{af:s,ak:s,am:s,an:s,ar:{cardinal:[t,n,r,i,a,o],ordinal:[o]},ars:{cardinal:[t,n,r,i,a,o],ordinal:[o]},as:{cardinal:[n,o],ordinal:[n,r,i,a,o]},asa:s,ast:s,az:{cardinal:[n,o],ordinal:[n,i,a,o]},bal:c,be:{cardinal:[n,i,a,o],ordinal:[i,o]},bem:s,bez:s,bg:s,bho:s,bm:l,bn:{cardinal:[n,o],ordinal:[n,r,i,a,o]},bo:l,br:{cardinal:[n,r,i,a,o],ordinal:[o]},brx:s,bs:{cardinal:[n,i,o],ordinal:[o]},ca:{cardinal:[n,a,o],ordinal:[n,r,i,o]},ce:s,ceb:s,cgg:s,chr:s,ckb:s,cs:{cardinal:[n,i,a,o],ordinal:[o]},cy:{cardinal:[t,n,r,i,a,o],ordinal:[t,n,r,i,a,o]},da:s,de:s,doi:s,dsb:{cardinal:[n,r,i,o],ordinal:[o]},dv:s,dz:l,ee:s,el:s,en:{cardinal:[n,o],ordinal:[n,r,i,o]},eo:s,es:{cardinal:[n,a,o],ordinal:[o]},et:s,eu:s,fa:s,ff:s,fi:s,fil:c,fo:s,fr:{cardinal:[n,a,o],ordinal:[n,o]},fur:s,fy:s,ga:{cardinal:[n,r,i,a,o],ordinal:[n,o]},gd:{cardinal:[n,r,i,o],ordinal:[n,r,i,o]},gl:s,gsw:s,gu:{cardinal:[n,o],ordinal:[n,r,i,a,o]},guw:s,gv:{cardinal:[n,r,i,a,o],ordinal:[o]},ha:s,haw:s,he:u,hi:{cardinal:[n,o],ordinal:[n,r,i,a,o]},hnj:l,hr:{cardinal:[n,i,o],ordinal:[o]},hsb:{cardinal:[n,r,i,o],ordinal:[o]},hu:c,hy:c,ia:s,id:l,ig:l,ii:l,io:s,is:s,it:{cardinal:[n,a,o],ordinal:[a,o]},iu:u,ja:l,jbo:l,jgo:s,jmc:s,jv:l,jw:l,ka:{cardinal:[n,o],ordinal:[n,a,o]},kab:s,kaj:s,kcg:s,kde:l,kea:l,kk:{cardinal:[n,o],ordinal:[a,o]},kkj:s,kl:s,km:l,kn:s,ko:l,ks:s,ksb:s,ksh:{cardinal:[t,n,o],ordinal:[o]},ku:s,kw:{cardinal:[t,n,r,i,a,o],ordinal:[n,a,o]},ky:s,lag:{cardinal:[t,n,o],ordinal:[o]},lb:s,lg:s,lij:{cardinal:[n,o],ordinal:[a,o]},lkt:l,ln:s,lo:{cardinal:[o],ordinal:[n,o]},lt:{cardinal:[n,i,a,o],ordinal:[o]},lv:{cardinal:[t,n,o],ordinal:[o]},mas:s,mg:s,mgo:s,mk:{cardinal:[n,o],ordinal:[n,r,a,o]},ml:s,mn:s,mo:{cardinal:[n,i,o],ordinal:[n,o]},mr:{cardinal:[n,o],ordinal:[n,r,i,o]},ms:{cardinal:[o],ordinal:[n,o]},mt:{cardinal:[n,r,i,a,o],ordinal:[o]},my:l,nah:s,naq:u,nb:s,nd:s,ne:c,nl:s,nn:s,nnh:s,no:s,nqo:l,nr:s,nso:s,ny:s,nyn:s,om:s,or:{cardinal:[n,o],ordinal:[n,r,i,a,o]},os:s,osa:l,pa:s,pap:s,pcm:s,pl:{cardinal:[n,i,a,o],ordinal:[o]},prg:{cardinal:[t,n,o],ordinal:[o]},ps:s,pt:{cardinal:[n,a,o],ordinal:[o]},pt_PT:{cardinal:[n,a,o],ordinal:[o]},rm:s,ro:{cardinal:[n,i,o],ordinal:[n,o]},rof:s,ru:{cardinal:[n,i,a,o],ordinal:[o]},rwk:s,sah:l,saq:s,sat:u,sc:{cardinal:[n,o],ordinal:[a,o]},scn:{cardinal:[n,o],ordinal:[a,o]},sd:s,sdh:s,se:u,seh:s,ses:l,sg:l,sh:{cardinal:[n,i,o],ordinal:[o]},shi:{cardinal:[n,i,o],ordinal:[o]},si:s,sk:{cardinal:[n,i,a,o],ordinal:[o]},sl:{cardinal:[n,r,i,o],ordinal:[o]},sma:u,smi:u,smj:u,smn:u,sms:u,sn:s,so:s,sq:{cardinal:[n,o],ordinal:[n,a,o]},sr:{cardinal:[n,i,o],ordinal:[o]},ss:s,ssy:s,st:s,su:l,sv:c,sw:s,syr:s,ta:s,te:s,teo:s,th:l,ti:s,tig:s,tk:{cardinal:[n,o],ordinal:[i,o]},tl:c,tn:s,to:l,tpi:l,tr:s,ts:s,tzm:s,ug:s,uk:{cardinal:[n,i,a,o],ordinal:[i,o]},und:l,ur:s,uz:s,ve:s,vec:{cardinal:[n,a,o],ordinal:[a,o]},vi:{cardinal:[o],ordinal:[n,o]},vo:s,vun:s,wa:s,wae:s,wo:l,xh:s,xog:s,yi:s,yo:l,yue:l,zh:l,zu:s})})(s);var c=r(s.exports),l=t({__proto__:null,default:c},[s.exports]),u={exports:{}};(function(e){var t,n=function(e,t){return`other`},r=function(e,t){return e===`other`&&t===`one`?`one`:`other`},i=function(e,t){return t||`other`};t={af:n,ak:r,am:i,an:n,ar:function(e,t){return t===`few`?`few`:t===`many`?`many`:e===`zero`&&t===`one`||e===`zero`&&t===`two`?`zero`:`other`},as:i,az:i,be:i,bg:n,bn:i,bs:i,ca:n,cs:i,cy:i,da:i,de:i,el:i,en:n,es:n,et:n,eu:n,fa:r,fi:n,fil:i,fr:i,ga:i,gl:i,gsw:i,gu:i,he:n,hi:i,hr:i,hu:i,hy:i,ia:n,id:n,io:n,is:i,it:i,ja:n,ka:function(e,t){return e||`other`},kk:i,km:n,kn:i,ko:n,ky:i,lij:i,lo:n,lt:i,lv:function(e,t){return t===`one`?`one`:`other`},mk:n,ml:i,mn:i,mr:i,ms:n,my:n,nb:n,ne:i,nl:i,no:n,or:r,pa:i,pcm:n,pl:i,ps:i,pt:i,ro:function(e,t){return t===`few`||t===`one`?`few`:`other`},ru:i,sc:i,scn:i,sd:r,si:function(e,t){return e===`one`&&t===`one`?`one`:`other`},sk:i,sl:function(e,t){return t===`few`||t===`one`?`few`:t===`two`?`two`:`other`},sq:i,sr:i,sv:n,sw:i,ta:i,te:i,th:n,tk:i,tr:i,ug:i,uk:i,ur:n,uz:i,vi:n,yue:n,zh:n,zu:i},Object.defineProperty(t,"__esModule",{value:!0}),e.exports=t})(u);var d=r(u.exports),f=a||o,p=c||l,m=d||t({__proto__:null,default:d},[u.exports]),h=function(e){return e===`pt-PT`?`pt_PT`:e};return ic=n.default(Intl.NumberFormat,function(e){return f[h(e)]},function(e,t){return p[h(e)][t?`ordinal`:`cardinal`]},function(e){return m[h(e)]})}();function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e);if(typeof Intl>`u`)Os===void 0?typeof window<`u`?window.Intl={PluralRules:n.default}:Js.Intl={PluralRules:n.default}:Os.Intl={PluralRules:n.default},n.default.polyfill=!0;else if(Intl.PluralRules&&Intl.PluralRules.prototype.selectRange){var r=[`en`,`es`,`ru`,`zh`];Intl.PluralRules.supportedLocalesOf(r).length<r.length&&(Intl.PluralRules=n.default,n.default.polyfill=!0)}else Intl.PluralRules=n.default,n.default.polyfill=!0})();var cc={Folder:`Folder`,Folders:`Folders`,Files:`Files`,File:`File`,"Select the destination folder":`Select the destination folder`,"Filter by type":`Filter by type`,"All types":`All types`,"File name":`File name`,Size:`Size`,Date:`Date`,Actions:`Actions`,Delete:`Delete`,Move:`Move`,Copy:`Copy`,Refresh:`Refresh`,"Add folder":`Add folder`,"Add file":`Add file`,"Add file by URL":`Add file by URL`,"Please select an image file":`Please select an image file`,"File deleted":`File deleted`,"Error when deleting a file":`Error when deleting a file`,"Folder deleted":`Folder deleted`,"Error when deleting a folder":`Error when deleting a folder`,"Delete folder":`Delete folder`,"Are you sure you want to delete this folder? This action will also delete all files and subfolders.":`Are you sure you want to delete this folder? This action will also delete all files and subfolders.`,"File moved":`File moved`,"Error when moving a file":`Error when moving a file`,"has been successfully uploaded":`has been successfully uploaded`,"Failed to download file":`Failed to download file`,"Failed to load JSON data":`Failed to load JSON data`,"Invalid file URL":`Invalid file URL`,"Unable to validate file URL":`Unable to validate file URL`,"Error when uploading a file":`Error when uploading a file`,"successfully uploaded":`successfully uploaded`,"Error when downloading a file by URL":`Error when downloading a file by URL`,"Error loading files":`Error loading files`,"File Manager not configured":`File Manager not configured`,"Type to search...":`Type to search...`,"Failed to create folder":`Failed to create folder`,Cancel:`Cancel`,Submit:`Submit`,months:{january:`January`,february:`February`,march:`March`,april:`April`,may:`May`,june:`June`,july:`July`,august:`August`,september:`September`,october:`October`,november:`November`,december:`December`},files:`files`,"No available folders":`No available folders`,"My files":`My files`,GIF:`GIF`,"Stock images":`Stock images`,"QR & Barcode":`QR & Barcode`,"QR code":`QR code`,Barcode:`Barcode`,"Text or URL":`Text or URL`,"Code color":`Code color`,"Background color":`Background color`,"Add to My files":`Add to My files`,"Transparent background":`Transparent background`,"Barcode generation failed":`Could not generate this barcode. Use characters supported by CODE128.`,"Validation error":`Validation error`,"Enter text or URL to preview":`Enter text or a URL to encode.`,Preview:`Preview`,"QR transparent background hint":`A transparent PNG may blend into dark email themes; a white background is often easier for scanners.`,"QR image size px":`QR image size`,"Barcode bar height px":`Barcode bar height`,Icons:`Icons`,AI:`AI`,"AI image generation":`AI image generation`,"Search GIFs":`Search GIFs`,"That`s all we could find.":"That`s all we could find.","Search image":`Search image`,All:`All`,Landscape:`Landscape`,Portrait:`Portrait`,Squarish:`Squarish`,Black:`Black`,"Black and White":`Black and White`,White:`White`,Orange:`Orange`,Red:`Red`,Purple:`Purple`,Magenta:`Magenta`,Green:`Green`,Teal:`Teal`,Blue:`Blue`,"Photo by":`Photo by`,on:`on`,selected:`selected`,Deselected:`Deselected`,"Select all":`Select all`,Rename:`Rename`,"Rename file":`Rename file {{currentFileName}}`,"Selected files":`Selected files: {{count}}`,selected_files_one:`Selected {{count}} file`,selected_files_other:`Selected {{count}} files`,Edit:`Edit`,"Move to":`Move to`,"New folder":`New folder`,"Image search...":`Image search...`,"Search icons":`Search icons`,"By name":`By name`,"By size":`By size`,"By date":`By date`,List:`List`,Grid:`Grid`,Main:`Main`,"total pages":`Total {{total}} items`,Name:`Name`,Untitled:`Untitled`,Dimensions:`Dimensions`,error:`error`,created:`created`,"API-endpoint for file upload is not configured":`API-endpoint for file upload is not configured`,"The URL must point to an image":`The URL must point to an image`,"Image upload...":`Image upload...`,Unknown:`Unknown`,"Error downloading file by URL":`Error downloading file by URL`,"File not found":`File not found`,"File renamed to":`File renamed to `,"Failed to rename the file":`Failed to rename the file`,"Folder renamed to":`Folder renamed to`,"Rename folder":`Rename folder`,"New folder name":`New folder name`,"Enter a new folder name":`Enter a new folder name`,"Please drag and drop image files only":`Please drag and drop image files only`,"Upload file by URL":`Upload file by URL`,"Upload file":`Upload file`,"Creating a new folder":`Creating a new folder`,Create:`Create`,"Folder name":`Folder name`,"Enter the name of the folder":`Enter the name of the folder`,"Enter the name":`Enter the name`,"A folder will be created inside:":`A folder will be created inside:`,"selected folder":`selected folder`,"The folder will be created in the root directory":`The folder will be created in the root directory`,"Failed to load folders":`Failed to load folders`,"Folder name cannot be empty":`Folder name cannot be empty`,"Folder creation provider is not configured":`Folder creation provider is not configured`,"Folder created":`Folder created`,"Folder rename is disabled by config":`Folder rename is disabled by config`,"Folder rename provider is not configured":`Folder rename provider is not configured`,"Unexpected response when renaming folder":`Unexpected response when renaming folder`,"Folder renamed":`Folder renamed`,"Failed to rename folder":`Failed to rename folder`,"Failed to load folder items count":`Failed to load folder items count`,"Failed to load subfolders":`Failed to load subfolders`,Download:`Download`,"image URL":`image URL`,"Enter the URL of the image":`Enter the URL of the image`,"URL too long":`URL is too long`,"Only http and https URLs are supported":`Only http and https URLs are supported`,"Private and local URLs are not allowed":`Private and local URLs are not allowed`,"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":`Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP`,"New file name":`New file name`,"Enter a new file name":`Enter a new file name`,"Copy to folder":`Copy to folder`,Added:`Added {{date}}`,"File uploaded successfully":`File {{fileName}} uploaded successfully`,"Successfully uploaded":`Successfully uploaded {{successCount}} of {{count}} file`,"Successfully uploaded files":`Successfully uploaded {{successCount}} of {{count}} files`,Uploaded:`Uploaded: {{names}}`,uploads_success_summary:`Uploaded {{successCount}} of {{totalCount}} files`,Failed:`Failed: {{names}}`,uploads_fail_summary:`Failed to upload {{failCount}} of {{totalCount}} files`,"File with this name already exists.":`File with this name already exists.`,"File not found or no longer available.":`File not found or no longer available.`,"You don't have permission to access this file.":`You don't have permission to access this file.`,"File is too large to upload.":`File is too large to upload.`,"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":`File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.`,"Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":`Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}`,"This file type is not allowed.":`This file type is not allowed.`,"File name is not valid.":`File name is not valid.`,"File name is not valid. Allowed characters: {{allowedChars}}":`File name is not valid. Allowed characters: {{allowedChars}}`,"Failed to read the file.":`Failed to read the file.`,"Failed to write the file.":`Failed to write the file.`,"The file appears to be corrupted.":`The file appears to be corrupted.`,"File integrity check failed.":`File integrity check failed.`,"Folder not found or no longer available.":`Folder not found or no longer available.`,"Folder with this name already exists.":`Folder with this name already exists.`,"A folder with that name already exists. Please enter a different folder name.":`A folder with that name already exists. Please enter a different folder name.`,"You don't have permission to access this folder.":`You don't have permission to access this folder.`,"Folder name is not valid.":`Folder name is not valid.`,"Folder name is not valid. Allowed characters: {{allowedChars}}":`Folder name is not valid. Allowed characters: {{allowedChars}}`,"Failed to read the folder contents.":`Failed to read the folder contents.`,"Failed to write to the folder.":`Failed to write to the folder.`,"Folder storage quota exceeded.":`Folder storage quota exceeded.`,"Folder is not empty.":`Folder is not empty.`,"Server error while processing the folder.":`Server error while processing the folder.`,"Folder operation took too long.":`Folder operation took too long.`,"Network error. Please check your connection and try again.":`Network error. Please check your connection and try again.`,"The operation took too long. Please try again.":`The operation took too long. Please try again.`,"Server error. Please try again later.":`Server error. Please try again later.`,"Service is temporarily unavailable. Please try again later.":`Service is temporarily unavailable. Please try again later.`,"Too many requests. Please try again a bit later.":`Too many requests. Please try again a bit later.`,"Authentication failed. Please sign in again.":`Authentication failed. Please sign in again.`,"You are not allowed to perform this action.":`You are not allowed to perform this action.`,"Some of the provided data is invalid.":`Some of the provided data is invalid.`,"This operation is not supported.":`This operation is not supported.`,"Request payload is too large.":`Request payload is too large.`,"This media type is not supported.":`This media type is not supported.`,"You have exceeded the upload quota.":`You have exceeded the upload quota.`,"Network error while uploading the file.":`Network error while uploading the file.`,"File upload took too long.":`File upload took too long.`,"Server error while uploading the file.":`Server error while uploading the file.`,"The specified URL is not valid.":`The specified URL is not valid.`,"The specified URL is not reachable.":`The specified URL is not reachable.`,"Content type at the URL is not allowed.":`Content type at the URL is not allowed.`,"Failed to download file from the URL.":`Failed to download file from the URL.`,"Network error while downloading the file.":`Network error while downloading the file.`,"File download took too long.":`File download took too long.`,"Server error while downloading the file.":`Server error while downloading the file.`,"Some items could not be processed.":`Some items could not be processed.`,"Failed to process all items in the batch.":`Failed to process all items in the batch.`,"Some items in the batch are in a conflicting state.":`Some items in the batch are in a conflicting state.`,"Some items in the batch did not pass validation.":`Some items in the batch did not pass validation.`,"AI service returned an invalid response.":`AI service returned an invalid response.`,"Failed to generate image using AI.":`Failed to generate image using AI.`,"You have reached the AI image generation limit.":`You have reached the AI image generation limit.`,"Error in external integration.":`Error in external integration.`,"Error in a third-party service.":`Error in a third-party service.`,"An unknown error occurred.":`An unknown error occurred.`,"Renaming is not allowed for this item.":`Renaming is not allowed for this item.`,"Moving is not allowed for this item.":`Moving is not allowed for this item.`,"Copying is not allowed for this item.":`Copying is not allowed for this item.`,"Deleting is not allowed for this item.":`Deleting is not allowed for this item.`,"Cannot move an item into itself.":`Cannot move an item into itself.`,"Cannot move an item into its descendant folder.":`Cannot move an item into its descendant folder.`,"Cannot copy an item into itself.":`Cannot copy an item into itself.`,"Configuration error occurred.":`Configuration error occurred.`,"Storage quota exceeded. Please free up space.":`Storage quota exceeded. Please free up space.`,"File is locked by another process or user.":`File is locked by another process or user.`,"File version conflict. Please refresh and try again.":`File version conflict. Please refresh and try again.`,"Batch operation exceeds the maximum number of items allowed.":`Batch operation exceeds the maximum number of items allowed.`,Moved:`Moved: {{names}}`,move_success_summary:`Moved {{successCount}} of {{totalCount}} items`,move_fail_summary:`Failed to move {{failCount}} of {{totalCount}} items`,Copied:`Copied: {{names}}`,copy_success_summary:`Copied {{successCount}} of {{totalCount}} items`,copy_fail_summary:`Failed to copy {{failCount}} of {{totalCount}} items`,"Failed to upload":`Failed to upload {{failCount}} of {{count}} file`,"Failed to upload files":`Failed to upload {{failCount}} of {{count}} files`,"No folders yet":`No folders yet`,"Drag files to upload":`Drag files to upload`,"Drop files here to upload":`Drop files here to upload`,"Newest first":`Newest first`,"Oldest first":`Oldest first`,"Largest first":`Largest first`,"Smallest first":`Smallest first`,"A-Z":`A-Z`,"Z-A":`Z-A`,"By type":`By type`,"Evaluating the task":`Evaluating the task`,"Something went wrong, please try again":`Something went wrong, please try again`,"Sort by":`Sort by`,"preview text":`The image preview is trying to load ...`,"Use this variant":`Use this variant`,"Confirm deletion":`Confirm deletion`,"Are you sure you want to delete the selected items?":`Are you sure you want to delete the selected items?`,"Move to Trash":`Move to Trash`,"Are you sure you want to move the selected items to the Trash?":`Are you sure you want to move the selected items to the Trash?`,"Permanently delete":`Permanently delete`,"Delete permanently":`Delete permanently`,"Are you sure you want to permanently delete the selected items? This action cannot be undone.":`Are you sure you want to permanently delete the selected items? This action cannot be undone.`,Clear:`Clear`,"Clear Trash":`Clear Trash`,"Are you sure you want to permanently delete all items from Trash?":`Are you sure you want to permanently delete all items from Trash?`,"Trash cleared successfully":`Trash cleared successfully`,"{{count}} items permanently deleted":`{{count}} items permanently deleted`,"Trash partially cleared":`Trash partially cleared`,"{{succeeded}} items deleted, {{failed}} items failed":`{{succeeded}} items deleted, {{failed}} items failed`,"Failed to clear trash":`Failed to clear trash`,"Error clearing trash":`Error clearing trash`,"Deleting items...":`Deleting items...`,delete_files_permanent_one:`This action will permanently delete {{count}} file`,delete_files_permanent_other:`This action will permanently delete {{count}} files`,delete_folder_permanent:`This action will permanently delete the folder '{{name}}' and all its contents, including {{count}} items.`,delete_mixed_permanent:`This action will permanently delete {{total}} selected items, including {{folders}} folders and all {{images}} images within them.`,permanent_delete_warning:`Deleting files that were used in emails will cause problems with displaying images in old emails. Are you sure you want to permanently delete the selection?`,move_files_to_trash_one:`This will move {{count}} file to the Trash.`,move_files_to_trash_other:`This will move {{count}} files to the Trash.`,move_folder_to_trash:`This will move the folder '{{name}}' and all its contents ({{count}} items) to the Trash.`,move_mixed_to_trash:`This will move {{total}} selected items to the Trash, including {{folders}} folders and {{images}} images.`,delete_count_confirm_trash_one:`Move {{count}} file to Trash?`,delete_count_confirm_trash_other:`Move {{count}} files to Trash?`,delete_count_confirm_permanent_one:`Permanently delete {{count}} file?`,delete_count_confirm_permanent_other:`Permanently delete {{count}} files?`,delete_count_confirm_one:`Delete {{count}} file?`,delete_count_confirm_other:`Delete {{count}} files?`,item:`item`,items:`items`,Trash:`Deleted`,Choose:`Choose`,Stock:`Stock`,"Select an image from our library":`Select an image from our library`,"AI generation":`AI generation`,"Creating an image on demand":`Creating an image on demand`,"Search file or folder":`Search file or folder`,"Click here to select a file":`Click here to select a file`,"Create folder":`Create folder`,Done:`Done`,"Move here":`Move here`,"Copy here":`Copy here`,"File URL":`File URL`,"There's nothing here":`There's nothing here`,"Try using a different search query.":`Try using a different search query.`,"Millions of free stock images":`Millions of free stock images`,"Enter a search query and we'll find the perfect image for you":`Enter a search query and we'll find the perfect image for you`,"Millions of icons":`Millions of icons`,"Lucide icons":`Lucide icons`,"Thousands of icons":`Thousands of icons`,"Enter a search query and we'll find the perfect icon for you":`Enter a search query and we'll find the perfect icon for you`,"Enter your query and we will find the right one for you":`Enter your query and we will find the right one for you`,"Over 350,000 live images":`Over 350,000 live images`,"The folder will be created in the root directory.":`The folder will be created in the root directory.`,undo:`UNDO`,moved_to_trash_one:`Moved {{count}} item to Trash`,moved_to_trash_other:`Moved {{count}} items to Trash`,restored_items_one:`Restored {{count}} item`,restored_items_other:`Restored {{count}} items`,Type:`Type`,"Generate image":`Generate image`,"For example:":`For example:`,"A beautiful image of a sunset over a calm ocean.":`A beautiful image of a sunset over a calm ocean.`,Insert:`Insert`,Error:`Error`,"Upload progress":`Upload {{completed}}/{{total}}`,"Uploading files":`Uploading {{completed}}/{{total}} files`,"Uploaded files":`Uploaded {{success}} of {{total}} files`,"Upload error files":`Upload error {{errorCount}} files`,"Applies to all {{count}} files":`(applies to all {{count}} files)`,"Some files failed to upload":`Some files failed to upload. Please check file size and format.`,upload_error_hint_invalid_name:`Rename the file: use only letters, numbers, hyphens and underscores.`,upload_error_hint_size:`Reduce the file size or choose a different file.`,upload_error_hint_format:`Use an allowed format: JPG, PNG, or GIF.`,upload_error_hint_exists:`A file with this name already exists in the folder. Rename the file.`,"Images generated successfully":`Images generated successfully`,"Trash is empty":`Trash is empty`,"Deleted files will be displayed here":`Deleted files will be displayed here`,"Supported files:":`Supported files:`,"Stroke width":`Stroke thickness`,Color1:`Color`,Color2:`Color2`,Color3:`Color3`,"Global search":`Global search`,"Family search":`Family search`,"Choose for template":`Choose for template`,Back:`Back`,"Editing: {{name}}":`Editing: {{name}}`,"Editing image":`Editing image`,Save:`Save`,"Loading editor...":`Loading editor...`,"Error loading image":`Error loading image`,"Error saving image":`Error saving image`,"Error initializing editor":`Error initializing editor`,"Close File Manager":`Close File Manager`,"Are you sure you want to close? Unsaved changes will be lost.":`Are you sure you want to close? Unsaved changes will be lost.`,"Are you sure you want to close the file manager?":`Are you sure you want to close the file manager?`,Close:`Close`,KB:`KB`,"No files":`No files`,"Folder is empty or files not found":`Folder is empty or files not found`,"Search files...":`Search files...`,Success:`Success`,"Image updated successfully":`Image updated successfully`,"Failed to save changes":`Failed to save changes: {{error}}`,"Unknown error":`Unknown error`,"Select destination folder":`Select destination folder`,"Error moving":`Error moving`,"Error deleting":`Error deleting`,"Error copying":`Error copying`,"Error renaming":`Error renaming`,"Failed to refresh folder tree":`Failed to refresh folder tree`,"Failed to refresh file list":`Failed to refresh file list`,"Errors occurred while moving":`Errors occurred while moving`,"Errors occurred while copying":`Errors occurred while copying`,"(error)":`(error)`,"(circular reference)":`(circular reference)`,"File too large. Maximum size: {{size}}":`File too large. Maximum size: {{size}}`,"File too small. Minimum size: {{size}}":`File too small. Minimum size: {{size}}`,"Unsupported file type":`Unsupported file type`,"Unsupported file type: {{type}}":`Unsupported file type: {{type}}`,unknown:`unknown`,"Failed to load files":`Failed to load files`,"Failed to load files in folder":`Could not load folder contents ({{folderName}})`,"Failed to load subfolders in folder":`Could not load subfolders in "{{folderName}}"`,"Failed to load folder items count in folder":`Could not get item count for "{{folderName}}"`,"DataProvider for folder deletion is not configured":`DataProvider for folder deletion is not configured`,"DataProvider for file upload is not configured":`DataProvider for file upload is not configured`,"Error uploading file {{fileName}}":`Error uploading file {{fileName}}`,"Error uploading file":`Error uploading file`,"Cannot upload files to Trash":`Cannot upload files to Trash`,"Please fill in all fields":`Please fill in all fields`,"Upload by URL is not supported":`Upload by URL is not supported`,"File name is too long. Maximum {{max}} characters":`File name is too long. Maximum {{max}} characters`,"File name contains invalid characters":`File name contains invalid characters`,"Large file may take a long time to upload":`Large file may take a long time to upload`,"File unavailable: {{status}} {{statusText}}":`File unavailable: {{status}} {{statusText}}`,"File too large: {{size}}":`File too large: {{size}}`,"Unsupported file type: {{contentType}}":`Unsupported file type: {{contentType}}`,"Invalid server response: folder ID is missing":`Invalid server response: folder ID is missing`,"Error: folder cannot be its own parent":`Error: folder cannot be its own parent`,"Upload to Trash is forbidden":`Upload to Trash is forbidden`,"renameFolder is not implemented in dataProviders":`renameFolder is not implemented in dataProviders`,"renameFile is not implemented in dataProviders":`renameFile is not implemented in dataProviders`,Deleted:`Deleted`,Clean:`Clean`,"Circular dependency detected: folder cannot be its own parent":`Circular dependency detected: folder cannot be its own parent`,"Save as copy and choose":`Save as copy and choose`,"Save and choose":`Save and choose`,pixie:{"added drawing":`Added Drawing`,"added frame":`Added Frame`,"added image":`Added Image`,"added shape":`Added Shape`,"added sticker":`Added Sticker`,"added text":`Added Text`,"applied filters":`Applied Filters`,apply:`Apply`,background:`Background`,"background color":`Background color`,beach:`Beach`,"brush color":`Brush Color`,"brush size":`Brush Size`,"brush type":`Brush Type`,bubbles:`Bubbles`,Cancel:`Cancel`,"changed style":`Changed Style`,"Circle Brush":`Circle Brush`,close:`Close`,color:`Color`,corners:`Corners`,crop:`Crop`,Custom:`Custom`,"deleted object":`Deleted object`,"Diamond Brush":`Diamond Brush`,doodles:`Doodles`,draw:`Draw`,emoticons:`Emoticons`,"Eraser Brush":`Eraser Brush`,filter:`Filter`,font:`Font`,"font size":`Font Size`,frame:`Frame`,gradient:`Gradient`,height:`Height`,history:`History`,"H Line Brush":`H Line Brush`,image:`Image`,initial:`Initial`,landmarks:`Landmarks`,"loaded state":`Loaded State`,"loading canvas":`Loading Canvas`,"loading image":`Loading Image`,"loading state":`Loading State`,"maintain aspect ratio":`Maintain aspect ratio`,merge:`Merge`,"merged objects":`Merged Objects`,"new text":`New Text`,objects:`Objects`,opacity:`Opacity`,outline:`Outline`,"outline color":`Outline Color`,"Pencil Brush":`Pencil Brush`,"processing image":`Processing Image`,quality:`Quality`,radius:`Radius`,"replace image":`Replace Image`,"replaced background image":`Replaced Background Image`,resize:`Resize`,"resized image":`Resized Image`,"rounded corner":`Rounded Corner`,save:`Save`,shadow:`Shadow`,"shadow color":`Shadow Color`,shapes:`Shapes`,"Spray Brush":`Spray Brush`,square:`Square`,"Square Brush":`Square Brush`,stickers:`Stickers`,text:`Text`,texture:`Texture`,transportation:`Transportation`,"V Line Brush":`V Line Brush`,width:`Width`,grayscale:`Grayscale`,"black & White":`Black & White`,sharpen:`Sharpen`,invert:`Invert`,vintage:`Vintage`,polaroid:`Polaroid`,kodachrome:`Kodachrome`,technicolor:`Technicolor`,brownie:`Brownie`,sepia:`Sepia`,"remove Color":`Remove Color`,brightness:`Brightness`,gamma:`Gamma`,noise:`Noise`,pixelate:`Pixelate`,blur:`Blur`,emboss:`Emboss`,"blend Color":`Blend Color`,distance:`Distance`,red:`Red`,green:`Green`,blue:`Blue`,blocksize:`Blocksize`,alpha:`Alpha`,add:`Add`,multiply:`Multiply`,subtract:`Subtract`,diff:`Diff`,screen:`Screen`,lighten:`Lighten`,darken:`Darken`,"select an option...":`Select an option...`}},lc={Files:`Файлы`,selected:`выбрано`,Deselected:`Отменить выбор`,Refresh:`Обновить`,"Select all":`Выбрать все`,Rename:`Переименовать`,"Rename file":`Переименовать файл {{currentFileName}}`,"Select the destination folder":`Выберите папку назначения`,"Selected files:":`Выбрано файлов:`,"Selected files":`Выбрано файлов: {{count}}`,selected_files_one:`Выбран {{count}} файл`,selected_files_few:`Выбрано {{count}} файла`,selected_files_many:`Выбрано {{count}} файлов`,selected_files_other:`Выбрано {{count}} файлов`,Copy:`Дублировать`,Edit:`Изменить`,Move:`Переместить`,"Move to":`Переместить`,Delete:`Удалить`,"New folder":`Новая папка`,"Image search...":`Поиск изображений...`,"Search icons":`Найти иконки`,"By name":`По имени`,"By size":`По размеру`,"By date":`По дате`,List:`Список`,Grid:`Плитки`,Main:`Главная`,Folders:`Папки`,"total pages":`Всего {{total}} элементов`,Name:`Имя`,Untitled:`Без названия`,Size:`Размер`,Dimensions:`Размер`,Date:`Дата`,error:`ошибка`,Folder:`Папка`,created:`создана`,"Failed to create folder":`Не удалось создать папку`,"File deleted":`Файл удален`,"Files deleted":`Файлы удалены`,"Error when deleting a file":`Ошибка при удалении файла`,"Folder deleted":`Папка удалена`,"Error when deleting a folder":`Ошибка при удалении папки`,"Delete folder":`Удалить папку`,"Are you sure you want to delete this folder? This action will also delete all files and subfolders.":`Вы уверены, что хотите удалить эту папку? Это действие также удалит все файлы и подпапки.`,"API-endpoint for file upload is not configured":`API-endpoint для загрузки файлов не настроен`,"Please select an image file":`Пожалуйста, выберите файл изображения`,File:`Файл`,"has been successfully uploaded":`успешно загружен`,"The URL must point to an image":`URL должен указывать на изображение`,"Image upload...":`Загрузка изображения...`,Unknown:`Неизвестно`,"Error downloading file by URL":`Ошибка загрузки файла по URL`,"successfully uploaded":`успешно загружен`,"Error when downloading a file by URL":`Ошибка при загрузке файла по URL`,"Error when uploading a file":`Ошибка при загрузке файла`,"Error loading files":`Ошибка загрузки файлов`,"File not found":`Файл не найден`,"File renamed to":`Файл переименован на `,"Failed to rename the file":`Не удалось переименовать файл`,"Folder renamed to":`Папка переименована на`,"Rename folder":`Переименовать папку`,"New folder name":`Новое название папки`,"Enter a new folder name":`Введите новое название папки`,"Please drag and drop image files only":`Пожалуйста, перетащите только файлы изображений`,"Upload file by URL":`Загрузить файл по URL`,"Upload file":`Загрузить файл`,"Creating a new folder":`Создание новой папки`,Create:`Создать`,Cancel:`Отмена`,"Folder name":`Название папки`,"Enter the name of the folder":`Введите название папки`,"Enter the name":`Введите название`,"A folder will be created inside:":`Папка будет создана внутри:`,"selected folder":`выбранной папки`,"The folder will be created in the root directory":`Папка будет создана в корневом каталоге`,"Failed to load folders":`Не удалось загрузить папки`,"Folder name cannot be empty":`Название папки не может быть пустым`,"Folder creation provider is not configured":`Провайдер создания папок не настроен`,"Folder created":`Папка создана`,"Folder rename is disabled by config":`Переименование папок отключено конфигурацией`,"Folder rename provider is not configured":`Провайдер переименования папок не настроен`,"Unexpected response when renaming folder":`Неожиданный ответ при переименовании папки`,"Folder renamed":`Папка переименована`,"Failed to rename folder":`Не удалось переименовать папку`,"Failed to load folder items count":`Не удалось получить количество файлов в папке`,"Failed to load subfolders":`Не удалось загрузить подпапки`,Download:`Загрузить`,"image URL":`URL изображения`,"Enter the URL of the image":`Введите URL изображения`,"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":`Поддерживаемые форматы: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP`,"New file name":`Новое имя файла`,"Enter a new file name":`Введите новое имя файла`,"Copy to folder":`Копировать в папку`,Added:`Добавлено {{date}}`,"File uploaded successfully":`Файл {{fileName}} успешно загружен`,"Successfully uploaded":`Успешно загружено {{successCount}} из {{count}} файла`,"Successfully uploaded files":`Успешно загружено {{successCount}} из {{count}} файлов`,uploads_success_summary:`Загружено {{successCount}} из {{totalCount}} файлов`,uploads_fail_summary:`Не удалось загрузить {{failCount}} из {{totalCount}} файлов`,"File with this name already exists.":`Файл с таким именем уже существует.`,"File not found or no longer available.":`Файл не найден или уже был удалён.`,"You don't have permission to access this file.":`У вас нет прав доступа к этому файлу.`,"File is too large to upload.":`Файл слишком большой для загрузки.`,"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":`Файл слишком большой ({{fileSize}}). Максимально допустимый размер — {{maxSize}}.`,"Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":`Превышено максимальное количество файлов. Допустимо: {{allowed}}, выбрано: {{received}}`,"This file type is not allowed.":`Этот тип файла не поддерживается.`,"File name is not valid.":`Недопустимое имя файла.`,"File name is not valid. Allowed characters: {{allowedChars}}":`Недопустимое имя файла. Допустимые символы: {{allowedChars}}`,"Failed to read the file.":`Не удалось прочитать файл.`,"Failed to write the file.":`Не удалось записать файл.`,"The file appears to be corrupted.":`Файл повреждён или имеет неверный формат.`,"File integrity check failed.":`Проверка целостности файла завершилась неудачно.`,"Folder not found or no longer available.":`Папка не найдена или уже была удалена.`,"Folder with this name already exists.":`Папка с таким именем уже существует.`,"A folder with that name already exists. Please enter a different folder name.":`Папка с таким именем уже существует. Введите другое имя папки.`,"You don't have permission to access this folder.":`У вас нет прав доступа к этой папке.`,"Folder name is not valid.":`Недопустимое имя папки.`,"Folder name is not valid. Allowed characters: {{allowedChars}}":`Не удалось создать папку. Допустимые символы в названии папки: {{allowedChars}}`,"Failed to read the folder contents.":`Не удалось прочитать содержимое папки.`,"Failed to write to the folder.":`Не удалось выполнить операцию с папкой.`,"Folder storage quota exceeded.":`Превышена квота хранения для папки.`,"Folder is not empty.":`Папка не пуста.`,"Server error while processing the folder.":`Ошибка сервера при обработке папки.`,"Folder operation took too long.":`Операция с папкой выполнялась слишком долго.`,"Network error. Please check your connection and try again.":`Ошибка сети. Проверьте подключение к интернету и повторите попытку.`,"The operation took too long. Please try again.":`Операция выполнялась слишком долго. Попробуйте ещё раз.`,"Server error. Please try again later.":`Ошибка на сервере. Повторите попытку позже.`,"Service is temporarily unavailable. Please try again later.":`Сервис временно недоступен. Повторите попытку позже.`,"Too many requests. Please try again a bit later.":`Слишком много запросов. Попробуйте ещё раз немного позже.`,"Authentication failed. Please sign in again.":`Не удалось пройти аутентификацию. Пожалуйста, войдите снова.`,"You are not allowed to perform this action.":`У вас нет прав для выполнения этого действия.`,"Some of the provided data is invalid.":`Некоторые из переданных данных некорректны.`,"This operation is not supported.":`Эта операция не поддерживается.`,"Request payload is too large.":`Тело запроса слишком большое.`,"This media type is not supported.":`Этот тип данных не поддерживается.`,"You have exceeded the upload quota.":`Превышена квота на загрузку файлов.`,"Network error while uploading the file.":`Сетевая ошибка при загрузке файла.`,"File upload took too long.":`Загрузка файла выполнялась слишком долго.`,"Server error while uploading the file.":`Ошибка сервера при загрузке файла.`,"The specified URL is not valid.":`Указан некорректный URL.`,"The specified URL is not reachable.":`Указанный URL недоступен.`,"Content type at the URL is not allowed.":`Тип содержимого по указанному URL не поддерживается.`,"Failed to download file from the URL.":`Не удалось скачать файл по указанному URL.`,"Network error while downloading the file.":`Сетевая ошибка при скачивании файла.`,"File download took too long.":`Скачивание файла выполнялось слишком долго.`,"Server error while downloading the file.":`Ошибка сервера при скачивании файла.`,"Some items could not be processed.":`Не все элементы были обработаны успешно.`,"Failed to process all items in the batch.":`Не удалось обработать ни один элемент в пакетной операции.`,"Some items in the batch are in a conflicting state.":`Некоторые элементы в пакетной операции находятся в конфликтующем состоянии.`,"Some items in the batch did not pass validation.":`Некоторые элементы в пакетной операции не прошли валидацию.`,"AI service returned an invalid response.":`Сервис AI вернул некорректный ответ.`,"Failed to generate image using AI.":`Не удалось создать изображение с помощью AI.`,"You have reached the AI image generation limit.":`Достигнут лимит генерации изображений AI.`,"Error in external integration.":`Ошибка во внешней интеграции.`,"Error in a third-party service.":`Ошибка во внешнем сервисе.`,"An unknown error occurred.":`Произошла неизвестная ошибка.`,"Renaming is not allowed for this item.":`Переименование не разрешено для этого элемента.`,"Moving is not allowed for this item.":`Перемещение не разрешено для этого элемента.`,"Copying is not allowed for this item.":`Копирование не разрешено для этого элемента.`,"Deleting is not allowed for this item.":`Удаление не разрешено для этого элемента.`,"Cannot move an item into itself.":`Нельзя переместить элемент в самого себя.`,"Cannot move an item into its descendant folder.":`Нельзя переместить элемент в дочернюю папку.`,"Cannot copy an item into itself.":`Нельзя скопировать элемент в самого себя.`,"Configuration error occurred.":`Произошла ошибка конфигурации.`,"Storage quota exceeded. Please free up space.":`Превышена квота хранилища. Освободите место.`,"File is locked by another process or user.":`Файл заблокирован другим процессом или пользователем.`,"File version conflict. Please refresh and try again.":`Конфликт версий файла. Обновите страницу и попробуйте снова.`,"Batch operation exceeds the maximum number of items allowed.":`Пакетная операция превышает максимально допустимое количество элементов.`,Moved:`Перемещены: {{names}}`,move_success_summary:`Перемещено {{successCount}} из {{totalCount}} объектов`,move_fail_summary:`Не удалось переместить {{failCount}} из {{totalCount}} объектов`,Copied:`Скопированы: {{names}}`,copy_success_summary:`Скопировано {{successCount}} из {{totalCount}} объектов`,copy_fail_summary:`Не удалось скопировать {{failCount}} из {{totalCount}} объектов`,Uploaded:`Загружены: {{names}}`,Failed:`Не удалось: {{names}}`,"Failed to upload":`Не удалось загрузить {{failCount}} из {{count}} файла`,"Failed to upload files":`Не удалось загрузить {{failCount}} из {{count}} файлов`,months:{january:`января`,february:`февраля`,march:`марта`,april:`апреля`,may:`мая`,june:`июня`,july:`июля`,august:`августа`,september:`сентября`,october:`октября`,november:`ноября`,december:`декабря`},files:`файлов`,"No available folders":`Нет доступных папок`,"My files":`Мои файлы`,GIF:`GIF`,"Stock images":`Стоковые изображения`,"QR & Barcode":`QR и штрихкод`,"QR code":`QR-код`,Barcode:`Штрихкод`,"Text or URL":`Текст или ссылка`,"Code color":`Цвет кода`,"Background color":`Цвет фона`,"Add to My files":`Добавить в Мои файлы`,"Transparent background":`Прозрачный фон`,"Barcode generation failed":`Не удалось построить штрихкод. Используйте символы, поддерживаемые CODE128.`,"Validation error":`Ошибка валидации`,"Enter text or URL to preview":`Введите текст или URL для предпросмотра.`,Preview:`Предпросмотр`,"QR transparent background hint":`Прозрачный PNG может сливаться с тёмной темой письма; белый фон часто надёжнее для сканеров.`,"QR image size px":`Размер QR`,"Barcode bar height px":`Высота штрихов`,Icons:`Иконки`,AI:`AI`,"AI image generation":`AI генерация изображений`,"Search GIFs":`Найти GIF`,"That`s all we could find.":`Это все, что мы смогли найти.`,"Search image":`Найти изображение`,All:`Все`,Landscape:`Горизонтальные`,Portrait:`Вертикальные`,Squarish:`Квадратные`,Black:`Черный`,"Black and White":`Черно-белый`,White:`Белый`,Orange:`Оранжевый`,Red:`Красный`,Purple:`Фиолетовый`,Magenta:`Пурпурный`,Green:`Зеленый`,Teal:`Бирюзовый`,Blue:`Синий`,"Photo by":`Фото`,on:`на`,"File Manager":`Файловый менеджер`,"File Manager not configured":`Файловый менеджер не настроен`,"Filter by type":`Фильтр по типу`,"All types":`Все типы`,"File name":`Имя файла`,Actions:`Действия`,"Add file":`Добавить файл`,"Add folder":`Добавить папку`,"Add file by URL":`Добавить файл по URL`,"File moved":`Файл перемещён`,"Files moved":`Файлы перемещены`,"Error when moving a file":`Ошибка при перемещении файла`,"Files copied":`Файлы скопированы`,"Failed to download file":`Не удалось скачать файл`,"Failed to load JSON data":`Не удалось загрузить данные JSON`,"Invalid file URL":`Некорректный URL файла`,"Unable to validate file URL":`Не удалось проверить файл по URL`,"Type to search...":`Введите для поиска...`,Submit:`Отправить`,"No folders yet":`Папок пока нет`,"Drag files to upload":`Перетащите файлы для загрузки`,"Drop files here to upload":`Отпустите файлы здесь, чтобы загрузить их`,"Newest first":`Сначала новые`,"Oldest first":`Сначала старые`,"Largest first":`Сначала большие`,"Smallest first":`Сначала маленькие`,"A-Z":`По алфавиту А-Я`,"Z-A":`По алфавиту Я-А`,"By type":`По типу`,"Evaluating the task":`Оценка задания`,"Something went wrong, please try again":`Что-то пошло не так, пожалуйста, попробуйте еще раз`,"Sort by":`Сортировать по`,"preview text":`Изображение загружается ...`,"Use this variant":`Использовать этот вариант`,"Confirm deletion":`Подтвердить удаление`,"Are you sure you want to delete the selected items?":`Вы уверены, что хотите удалить выбранные элементы?`,"Move to Trash":`Переместить в корзину`,"Are you sure you want to move the selected items to the Trash?":`Вы уверены, что хотите переместить выбранные элементы в корзину?`,"Permanently delete":`Полное удаление`,"Delete permanently":`Удалить безвозвратно`,"Are you sure you want to permanently delete the selected items? This action cannot be undone.":`Вы уверены, что хотите безвозвратно удалить выбранные элементы? Это действие нельзя отменить.`,Clear:`Очистить`,"Clear Trash":`Очистить корзину`,"Are you sure you want to permanently delete all items from Trash?":`Вы уверены, что хотите безвозвратно удалить все элементы из корзины?`,"Trash cleared successfully":`Корзина успешно очищена`,"{{count}} items permanently deleted":`{{count}} элементов безвозвратно удалено`,"Trash partially cleared":`Корзина частично очищена`,"{{succeeded}} items deleted, {{failed}} items failed":`{{succeeded}} элементов удалено, {{failed}} не удалось удалить`,"Failed to clear trash":`Не удалось очистить корзину`,"Error clearing trash":`Ошибка при очистке корзины`,"Deleting items...":`Удаление элементов...`,delete_files_permanent_one:`Это действие безвозвратно удалит {{count}} файл`,delete_files_permanent_few:`Это действие безвозвратно удалит {{count}} файла`,delete_files_permanent_many:`Это действие безвозвратно удалит {{count}} файлов`,delete_files_permanent_other:`Это действие безвозвратно удалит {{count}} файлов`,delete_folder_permanent:`Это действие безвозвратно удалит папку «{{name}}» и всё её содержимое, включая {{count}} элементов.`,delete_mixed_permanent:`Это действие безвозвратно удалит {{total}} выбранных элементов, включая {{folders}} папок и все {{images}} изображений внутри них.`,permanent_delete_warning:`Удаление файлов, которые были использованы в письмах, приведет к проблемам с отображением картинок в старых письмах. Вы уверены, что хотите полностью удалить выбранное?`,move_files_to_trash_one:`Это действие переместит в корзину {{count}} файл.`,move_files_to_trash_few:`Это действие переместит в корзину {{count}} файла.`,move_files_to_trash_many:`Это действие переместит в корзину {{count}} файлов.`,move_files_to_trash_other:`Это действие переместит в корзину {{count}} файлов.`,move_folder_to_trash:`Это действие переместит в корзину папку «{{name}}» и всё её содержимое ({{count}} элементов).`,move_mixed_to_trash:`Это действие переместит в корзину {{total}} выбранных элементов, включая {{folders}} папок и {{images}} изображений.`,delete_count_confirm_trash_one:`Переместить в корзину {{count}} файл?`,delete_count_confirm_trash_few:`Переместить в корзину {{count}} файла?`,delete_count_confirm_trash_many:`Переместить в корзину {{count}} файлов?`,delete_count_confirm_trash_other:`Переместить в корзину {{count}} файлов?`,delete_count_confirm_permanent_one:`Удалить навсегда {{count}} файл?`,delete_count_confirm_permanent_few:`Удалить навсегда {{count}} файла?`,delete_count_confirm_permanent_many:`Удалить навсегда {{count}} файлов?`,delete_count_confirm_permanent_other:`Удалить навсегда {{count}} файлов?`,delete_count_confirm_one:`Удалить {{count}} файл?`,delete_count_confirm_few:`Удалить {{count}} файла?`,delete_count_confirm_many:`Удалить {{count}} файлов?`,delete_count_confirm_other:`Удалить {{count}} файлов?`,item:`файл`,items:`файлов`,Trash:`Корзина`,Choose:`Выбрать`,Stock:`Фотосток`,"Select an image from our library":`Выберите изображение из нашей библиотеки`,"AI generation":`AI генерация`,"Creating an image on demand":`Создание изображения по запросу`,"Search file or folder":`Найти файл или папку`,"Click here to select a file":`Нажмите здесь, чтобы выбрать файл`,"Supported files:":`Поддерживаемые файлы:`,"Create folder":`Создать папку`,Done:`Готово`,"Move here":`Переместить сюда`,"Copy here":`Копировать сюда`,"File URL":`URL файла`,"There's nothing here":`Здесь ничего нет`,"Try using a different search query.":`Попробуйте использовать другой поисковый запрос.`,"Millions of free stock images":`Миллионы бесплатных стоковых изображений`,"Enter a search query and we'll find the perfect image for you":`Введите поисковый запрос, и мы найдем для вас идеальное изображение`,"Millions of icons":`Миллионы иконок`,"Lucide icons":`Иконки Lucide`,"Thousands of icons":`Тысячи иконок`,"Enter a search query and we'll find the perfect icon for you":`Введите поисковый запрос, и мы найдем для вас идеальную иконку`,"Enter your query and we will find the right one for you":`Введите запрос и мы найдем для вас подходящее`,"Over 350,000 live images":`Более 350 000 живых изображений`,"The folder will be created in the root directory.":`Папка будет создана в корневом каталоге.`,undo:`ОТМЕНА`,moved_to_trash_one:`Перемещён {{count}} элемент в корзину`,moved_to_trash_few:`Перемещено {{count}} элемента в корзину`,moved_to_trash_many:`Перемещено {{count}} элементов в корзину`,moved_to_trash_other:`Перемещено {{count}} элементов в корзину`,restored_items_one:`Восстановлён {{count}} элемент`,restored_items_few:`Восстановлено {{count}} элемента`,restored_items_many:`Восстановлено {{count}} элементов`,restored_items_other:`Восстановлено {{count}} элементов`,Type:`Тип`,"Generate image":`Cгенерировать изображение`,"A beautiful image of a sunset over a calm ocean.":`Красивое изображение заката над спокойным океаном.`,"For example:":`Например:`,Insert:`Вставить`,Error:`Ошибка`,"Upload progress":`Загрузка {{completed}}/{{total}}`,"Uploading files":`Загрузка {{completed}}/{{total}} файлов`,"Uploaded files":`Загружено {{success}} из {{total}} файлов`,"Upload error files":`Ошибка загрузки {{errorCount}} файлов`,"Applies to all {{count}} files":`(применительно ко всем {{count}} файлам)`,"Some files failed to upload":`Некоторые файлы не удалось загрузить. Проверьте размер и формат файлов.`,upload_error_hint_invalid_name:`Переименуйте файл: используйте только буквы, цифры, дефис и подчёркивание.`,upload_error_hint_size:`Уменьшите размер файла или выберите другой.`,upload_error_hint_format:`Используйте допустимый формат: JPG, PNG или GIF.`,upload_error_hint_exists:`Файл с таким именем уже есть в папке. Переименуйте файл.`,"Images generated successfully":`Изображения успешно сгенерированы`,"Trash is empty":`Корзина пуста`,"Deleted files will be displayed here":`Здесь будут отображаться удаленные файлы`,"Stroke width":`Толщина`,Style:`Стиль`,Color1:`Цвет`,Color2:`Цвет 2`,Color3:`Цвет 3`,"Global search":`Глобальный поиск`,"Family search":`Поиск по семейству`,"Choose for template":`Выбрать для загрузки в шаблон`,Back:`Назад`,"Editing: {{name}}":`Редактирование: {{name}}`,"Editing image":`Редактирование изображения`,Save:`Сохранить`,"Loading editor...":`Загрузка редактора…`,"Error loading image":`Ошибка загрузки изображения`,"Error saving image":`Ошибка при сохранении изображения`,"Error initializing editor":`Ошибка инициализации редактора`,"Close File Manager":`Закрыть файловый менеджер`,"Are you sure you want to close? Unsaved changes will be lost.":`Вы уверены, что хотите закрыть? Несохраненные изменения будут потеряны.`,"Are you sure you want to close the file manager?":`Вы уверены, что хотите закрыть файловый менеджер?`,Close:`Закрыть`,KB:`КБ`,"No files":`Нет файлов`,"Folder is empty or files not found":`Папка пуста или файлы не найдены`,"Search files...":`Поиск файлов...`,Success:`Успех`,"Image updated successfully":`Изображение успешно обновлено`,"Failed to save changes":`Не удалось сохранить изменения: {{error}}`,"Unknown error":`Неизвестная ошибка`,"Select destination folder":`Выберите папку назначения`,"Error moving":`Ошибка при перемещении`,"Error deleting":`Ошибка при удалении`,"Error copying":`Ошибка при копировании`,"Error renaming":`Ошибка при переименовании`,"Failed to refresh folder tree":`Не удалось обновить дерево папок`,"Failed to refresh file list":`Не удалось обновить список файлов`,"Errors occurred while moving":`При перемещении произошли ошибки`,"Errors occurred while copying":`При копировании произошли ошибки`,"(error)":`(ошибка)`,"(circular reference)":`(циклическая ссылка)`,"File too large. Maximum size: {{size}}":`Файл слишком большой. Максимальный размер: {{size}}`,"File too small. Minimum size: {{size}}":`Файл слишком маленький. Минимальный размер: {{size}}`,"Unsupported file type":`Неподдерживаемый тип файла`,"Unsupported file type: {{type}}":`Неподдерживаемый тип файла: {{type}}`,unknown:`неизвестный`,"Failed to load files":`Не удалось загрузить файлы`,"Failed to load files in folder":`Не удалось загрузить содержимое папки «{{folderName}}»`,"Failed to load subfolders in folder":`Не удалось загрузить подпапки в «{{folderName}}»`,"Failed to load folder items count in folder":`Не удалось получить число элементов в «{{folderName}}»`,"DataProvider for folder deletion is not configured":`DataProvider для удаления папок не настроен`,"DataProvider for file upload is not configured":`DataProvider для загрузки файлов не настроен`,"Error uploading file {{fileName}}":`Ошибка при загрузке файла {{fileName}}`,"Error uploading file":`Ошибка при загрузке файла`,"Cannot upload files to Trash":`Нельзя загружать файлы в корзину`,"Please fill in all fields":`Заполните все поля`,"URL too long":`URL слишком длинный`,"Only http and https URLs are supported":`Поддерживаются только URL с протоколом http и https`,"Private and local URLs are not allowed":`Локальные и приватные URL запрещены`,"Upload by URL is not supported":`Загрузка по URL не поддерживается`,"File name is too long. Maximum {{max}} characters":`Имя файла слишком длинное. Максимум {{max}} символов`,"File name contains invalid characters":`Имя файла содержит недопустимые символы`,"Large file may take a long time to upload":`Большой файл может загружаться долго`,"File unavailable: {{status}} {{statusText}}":`Файл недоступен: {{status}} {{statusText}}`,"File too large: {{size}}":`Файл слишком большой: {{size}}`,"Unsupported file type: {{contentType}}":`Неподдерживаемый тип файла: {{contentType}}`,"Invalid server response: folder ID is missing":`Некорректный ответ от сервера: отсутствует ID папки`,"Error: folder cannot be its own parent":`Ошибка: папка не может быть родителем самой себя`,"Upload to Trash is forbidden":`Загрузка в корзину запрещена`,"renameFolder is not implemented in dataProviders":`renameFolder не реализован в dataProviders`,"renameFile is not implemented in dataProviders":`renameFile не реализован в dataProviders`,Deleted:`Удаленные файлы`,Clean:`Очистить`,"Circular dependency detected: folder cannot be its own parent":`Обнаружена циклическая зависимость: папка не может быть родителем самой себя`,"Save as copy and choose":`Сохранить как копию и выбрать`,"Save and choose":`Сохранить и выбрать`,pixie:{"added drawing":`Добавление рисунка`,"added frame":`Добавление рамки`,"added image":`Добавление изображения`,"added shape":`Добавление фигуры`,"added sticker":`Добавление стикера`,"added text":`Добавление текста`,"applied filters":`Применение фильтр`,apply:`Применить`,background:`Фон`,"background color":`Фоновый цвет`,beach:`Пляж`,"brush color":`Цвет кисти`,"brush size":`Размер кисти`,"brush type":`Тип кисти`,bubbles:`Пузырьки`,Cancel:`Отмена`,"changed style":`Изменение стиля`,"Circle Brush":`Круги`,close:`Закрыть`,color:`Цвет`,corners:`Углы`,crop:`Обрезать`,Custom:`Пользовательский`,"deleted object":`Удаление объекта`,"Diamond Brush":`Алмаз`,doodles:`Цветные`,draw:`Рисунок`,emoticons:`Смайлики`,"Eraser Brush":`Ластик`,filter:`Фильтр`,font:`Шрифт`,"font size":`Размер шрифта`,frame:`Рамка`,gradient:`Градиент`,height:`Высота`,history:`История`,"H Line Brush":`Н-образная`,image:`Изображение`,initial:`Начальный`,landmarks:`Достопримечательности`,"loaded state":`Загрузка состояния`,"loading canvas":`Загрузка`,"loading image":`Загрузка`,"loading state":`Загрузка`,"maintain aspect ratio":`Maintain aspect ratio`,merge:`Объединение`,"merged objects":`Объединение объектов`,"new text":`Новая надпись`,objects:`Объект`,opacity:`Прозрачность`,outline:`Контур`,"outline color":`Цвет контура`,"Pencil Brush":`Карандаш`,"processing image":`Загрузка`,quality:`Качество`,radius:`Радиус`,"replace image":`Replace Image`,"replaced background image":`Удаление фонового изображения`,resize:`Размер`,"resized image":`Изменение размера`,"rounded corner":`Загругление углов`,save:`Сохранить`,shadow:`Тень`,"shadow color":`Цвет тени`,shapes:`Фигуры`,"Spray Brush":`Спрей`,square:`Квардрат`,"Square Brush":`Квардрат`,stickers:`Стикеры`,text:`Надпись`,texture:`Текстура`,transportation:`Транспорт`,"V Line Brush":`V-образная`,width:`Ширина`,grayscale:`Оттенки серого`,"black & White":`Черно-белый`,sharpen:`Резкость`,invert:`Инверсия`,vintage:`Винтаж`,polaroid:`Полароид`,kodachrome:`Кодахром`,technicolor:`Техниколор`,brownie:`Коричневый`,sepia:`Сепия`,"remove Color":`Удалить цвет`,brightness:`Яркость`,gamma:`Гамма`,noise:`Шум`,pixelate:`Пиксельизация`,blur:`Размытие`,emboss:`Тиснение`,"blend Color":`Смешать цвет`,distance:`Расстояние`,red:`Красный`,green:`Зеленый`,blue:`Синий`,blocksize:`Размер блока`,alpha:`Альфа`,add:`Добавить`,multiply:`Умножить`,subtract:`Вычесть`,diff:`Разница`,screen:`Экран`,lighten:`Осветлить`,darken:`Затемнить`,"select an option...":`Выберите опцию...`}},uc={Files:`Файли`,selected:`обрано`,Deselected:`Скасувати вибір`,Refresh:`Оновити`,"Select all":`Вибрати все`,Rename:`Перейменувати`,"Rename file":`Перейменувати файл {{currentFileName}}`,"Select the destination folder":`Виберіть папку призначення`,"Selected files:":`Обрано файлів:`,"Selected files":`Обрано файлів: {{count}}`,selected_files_one:`Обрано {{count}} файл`,selected_files_few:`Обрано {{count}} файли`,selected_files_many:`Обрано {{count}} файлів`,selected_files_other:`Обрано {{count}} файлів`,Copy:`Дублювати`,Edit:`Змінити`,Move:`Перемістити`,"Move to":`Перемістити`,Delete:`Видалити`,"New folder":`Нова папка`,"Image search...":`Пошук зображень...`,"Search icons":`Знайти іконки`,"By name":`За назвою`,"By size":`За розміром`,"By date":`За датою`,List:`Список`,Grid:`Плитки`,Main:`Головна`,Folders:`Папки`,"total pages":`Всього {{total}} елементів`,Name:`Назва`,Untitled:`Без назви`,Size:`Розмір`,"Stroke width":`Товщина обведення`,Dimensions:`Розмір`,Date:`Дата`,error:`помилка`,Folder:`Папка`,created:`створена`,"Failed to create folder":`Не вдалося створити папку`,"File deleted":`Файл видалено`,"Error when deleting a file":`Помилка при видаленні файлу`,"Folder deleted":`Папку видалено`,"Error when deleting a folder":`Помилка при видаленні папки`,"Delete folder":`Видалити папку`,"Are you sure you want to delete this folder? This action will also delete all files and subfolders.":`Ви впевнені, що хочете видалити цю папку? Ця дія також видалить усі файли та підпапки.`,"API-endpoint for file upload is not configured":`API-endpoint для завантаження файлів не налаштовано`,"Please select an image file":`Будь ласка, виберіть файл зображення`,File:`Файл`,"has been successfully uploaded":`успішно завантажено`,"The URL must point to an image":`URL повинен вказувати на зображення`,"Image upload...":`Завантаження зображення...`,Unknown:`Невідомо`,"Error downloading file by URL":`Помилка завантаження файлу за URL`,"successfully uploaded":`успішно завантажено`,"Error when downloading a file by URL":`Помилка при завантаженні файлу за URL`,"Error when uploading a file":`Помилка при завантаженні файлу`,"Error loading files":`Помилка завантаження файлів`,"File not found":`Файл не знайдено`,"File renamed to":`Файл перейменовано на `,"Failed to rename the file":`Не вдалося перейменувати файл`,"Folder renamed to":`Папку перейменовано на`,"Rename folder":`Перейменувати папку`,"New folder name":`Нова назва папки`,"Enter a new folder name":`Введіть нову назву папки`,"Please drag and drop image files only":`Будь ласка, перетягуйте лише файли зображень`,"Upload file by URL":`Завантажити файл за URL`,"Upload file":`Завантажити файл`,"Creating a new folder":`Створення нової папки`,Create:`Створити`,Cancel:`Скасувати`,"Folder name":`Назва папки`,"Enter the name of the folder":`Введіть назву папки`,"Enter the name":`Введіть назву`,"A folder will be created inside:":`Папка буде створена всередині:`,"selected folder":`обраної папки`,"The folder will be created in the root directory":`Папка буде створена в кореневому каталозі`,"Failed to load folders":`Не вдалося завантажити папки`,"Folder name cannot be empty":`Назва папки не може бути порожньою`,"Folder creation provider is not configured":`Постачальник створення папок не налаштований`,"Folder created":`Папку створено`,"Folder rename is disabled by config":`Перейменування папок вимкнено в налаштуваннях`,"Folder rename provider is not configured":`Постачальник перейменування папок не налаштований`,"Unexpected response when renaming folder":`Неочікувана відповідь під час перейменування папки`,"Folder renamed":`Папку перейменовано`,"Failed to rename folder":`Не вдалося перейменувати папку`,"Failed to load folder items count":`Не вдалося отримати кількість елементів у папці`,"Failed to load subfolders":`Не вдалося завантажити підпапки`,Download:`Завантажити`,"image URL":`URL зображення`,"Enter the URL of the image":`Введіть URL зображення`,"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":`Підтримувані формати: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP`,"New file name":`Нова назва файлу`,"Enter a new file name":`Введіть нову назву файлу`,"Copy to folder":`Копіювати в папку`,Added:`Додано {{date}}`,"File uploaded successfully":`Файл {{fileName}} успішно завантажено`,"Successfully uploaded":`Успішно завантажено {{successCount}} з {{count}} файлу`,"Successfully uploaded files":`Успішно завантажено {{successCount}} з {{count}} файлів`,uploads_success_summary:`Завантажено {{successCount}} з {{totalCount}} файлів`,uploads_fail_summary:`Не вдалося завантажити {{failCount}} з {{totalCount}} файлів`,"File with this name already exists.":`Файл з такою назвою вже існує.`,"File not found or no longer available.":`Файл не знайдено або його вже видалено.`,"You don't have permission to access this file.":`У вас немає прав доступу до цього файлу.`,"File is too large to upload.":`Файл занадто великий для завантаження.`,"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":`Файл занадто великий ({{fileSize}}). Дозволений максимальний розмір — {{maxSize}}.`,"Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":`Перевищено максимальну кількість файлів. Дозволено: {{allowed}}, обрано: {{received}}`,"This file type is not allowed.":`Цей тип файлу не підтримується.`,"File name is not valid.":`Неприпустима назва файлу.`,"File name is not valid. Allowed characters: {{allowedChars}}":`Неприпустима назва файлу. Допустимі символи: {{allowedChars}}`,"Failed to read the file.":`Не вдалося прочитати файл.`,"Failed to write the file.":`Не вдалося записати файл.`,"The file appears to be corrupted.":`Файл пошкоджений або має неправильний формат.`,"File integrity check failed.":`Перевірка цілісності файлу завершилась невдало.`,"Folder not found or no longer available.":`Папку не знайдено або її вже видалено.`,"Folder with this name already exists.":`Папка з такою назвою вже існує.`,"A folder with that name already exists. Please enter a different folder name.":`Папка з такою назвою вже існує. Введіть інше ім'я папки.`,"You don't have permission to access this folder.":`У вас немає прав доступу до цієї папки.`,"Folder name is not valid.":`Неприпустима назва папки.`,"Folder name is not valid. Allowed characters: {{allowedChars}}":`Не вдалося створити папку. Допустимі символи в назві папки: {{allowedChars}}`,"Failed to read the folder contents.":`Не вдалося прочитати вміст папки.`,"Failed to write to the folder.":`Не вдалося виконати операцію з папкою.`,"Folder storage quota exceeded.":`Перевищено квоту зберігання для папки.`,"Folder is not empty.":`Папка не порожня.`,"Server error while processing the folder.":`Помилка сервера під час обробки папки.`,"Folder operation took too long.":`Операція з папкою зайняла надто багато часу.`,"Network error. Please check your connection and try again.":`Помилка мережі. Перевірте підключення до інтернету та повторіть спробу.`,"The operation took too long. Please try again.":`Операція виконувалася надто довго. Спробуйте ще раз.`,"Server error. Please try again later.":`Помилка на сервері. Повторіть спробу пізніше.`,"Service is temporarily unavailable. Please try again later.":`Сервіс тимчасово недоступний. Повторіть спробу пізніше.`,"Too many requests. Please try again a bit later.":`Занадто багато запитів. Спробуйте ще раз пізніше.`,"Authentication failed. Please sign in again.":`Не вдалося пройти автентифікацію. Будь ласка, увійдіть знову.`,"You are not allowed to perform this action.":`У вас немає прав для виконання цієї дії.`,"Some of the provided data is invalid.":`Деякі з переданих даних є некоректними.`,"This operation is not supported.":`Ця операція не підтримується.`,"Request payload is too large.":`Тіло запиту занадто велике.`,"This media type is not supported.":`Цей тип даних не підтримується.`,"You have exceeded the upload quota.":`Перевищено квоту на завантаження файлів.`,"Network error while uploading the file.":`Помилка мережі під час завантаження файлу.`,"File upload took too long.":`Завантаження файлу тривало надто довго.`,"Server error while uploading the file.":`Помилка сервера під час завантаження файлу.`,"The specified URL is not valid.":`Вказано некоректну URL-адресу.`,"The specified URL is not reachable.":`Вказана URL-адреса недоступна.`,"Content type at the URL is not allowed.":`Тип вмісту за вказаною URL-адресою не підтримується.`,"Failed to download file from the URL.":`Не вдалося завантажити файл за вказаною URL-адресою.`,"Network error while downloading the file.":`Помилка мережі під час завантаження файлу.`,"File download took too long.":`Завантаження файлу тривало надто довго.`,"Server error while downloading the file.":`Помилка сервера під час завантаження файлу.`,"Some items could not be processed.":`Не всі елементи були оброблені успішно.`,"Failed to process all items in the batch.":`Не вдалося обробити жоден елемент у пакетній операції.`,"Some items in the batch are in a conflicting state.":`Деякі елементи в пакетній операції перебувають у конфліктному стані.`,"Some items in the batch did not pass validation.":`Деякі елементи в пакетній операції не пройшли валідацію.`,"AI service returned an invalid response.":`Сервіс ШІ повернув некоректну відповідь.`,"Failed to generate image using AI.":`Не вдалося створити зображення за допомогою ШІ.`,"You have reached the AI image generation limit.":`Досягнуто ліміту генерації зображень ШІ.`,"Error in external integration.":`Помилка у зовнішній інтеграції.`,"Error in a third-party service.":`Помилка у зовнішньому сервісі.`,"An unknown error occurred.":`Сталася невідома помилка.`,"Renaming is not allowed for this item.":`Перейменування не дозволено для цього елемента.`,"Moving is not allowed for this item.":`Переміщення не дозволено для цього елемента.`,"Copying is not allowed for this item.":`Копіювання не дозволено для цього елемента.`,"Deleting is not allowed for this item.":`Видалення не дозволено для цього елемента.`,"Cannot move an item into itself.":`Не можна перемістити елемент у самого себе.`,"Cannot move an item into its descendant folder.":`Не можна перемістити елемент у дочірню папку.`,"Cannot copy an item into itself.":`Не можна скопіювати елемент у самого себе.`,"Configuration error occurred.":`Сталася помилка конфігурації.`,"Storage quota exceeded. Please free up space.":`Перевищено квоту сховища. Звільніть місце.`,"File is locked by another process or user.":`Файл заблоковано іншим процесом або користувачем.`,"File version conflict. Please refresh and try again.":`Конфлікт версій файлу. Оновіть сторінку та спробуйте ще раз.`,"Batch operation exceeds the maximum number of items allowed.":`Пакетна операція перевищує максимально допустиму кількість елементів.`,Moved:`Переміщено: {{names}}`,move_success_summary:`Переміщено {{successCount}} з {{totalCount}} елементів`,move_fail_summary:`Не вдалося перемістити {{failCount}} з {{totalCount}} елементів`,Copied:`Скопійовано: {{names}}`,copy_success_summary:`Скопійовано {{successCount}} з {{totalCount}} елементів`,copy_fail_summary:`Не вдалося скопіювати {{failCount}} з {{totalCount}} елементів`,Uploaded:`Завантажено: {{names}}`,Failed:`Не вдалося завантажити: {{names}}`,"Failed to upload":`Не вдалося завантажити {{failCount}} з {{count}} файлу`,"Failed to upload files":`Не вдалося завантажити {{failCount}} з {{count}} файлів`,months:{january:`січня`,february:`лютого`,march:`березня`,april:`квітня`,may:`травня`,june:`червня`,july:`липня`,august:`серпня`,september:`вересня`,october:`жовтня`,november:`листопада`,december:`грудня`},files:`файлів`,"No available folders":`Немає доступних папок`,"My files":`Мої файли`,GIF:`GIF`,"Stock images":`Стокові зображення`,"QR & Barcode":`QR та штрихкод`,"QR code":`QR-код`,Barcode:`Штрихкод`,"Text or URL":`Текст або посилання`,"Code color":`Колір коду`,"Background color":`Колір фону`,"Add to My files":`Додати в Мої файли`,"Transparent background":`Прозорий фон`,"Barcode generation failed":`Не вдалося побудувати штрихкод. Використовуйте символи, підтримувані CODE128.`,"Validation error":`Помилка валідації`,"Enter text or URL to preview":`Введіть текст або URL для попереднього перегляду.`,Preview:`Попередній перегляд`,"QR transparent background hint":`Прозорий PNG може зливатися з темною темою листа; білий фон частіше надійніший для сканерів.`,"QR image size px":`Розмір QR`,"Barcode bar height px":`Висота штрихів`,AI:`AI`,"AI image generation":`AI генерація зображень`,"Search GIFs":`Знайти GIF`,"That`s all we could find.":`Це все, що ми змогли знайти.`,"Search image":`Знайти зображення`,All:`Всі`,Landscape:`Горизонтальні`,Portrait:`Вертикальні`,Squarish:`Квадратні`,Black:`Чорний`,"Black and White":`Чорно-білий`,White:`Білий`,Orange:`Помаранчевий`,Red:`Червоний`,Purple:`Фіолетовий`,Magenta:`Пурпурний`,Green:`Зелений`,Teal:`Бірюзовий`,Blue:`Синій`,"Photo by":`Фото`,on:`на`,"File Manager":`Файловий менеджер`,"File Manager not configured":`Файловий менеджер не налаштовано`,"Filter by type":`Фільтр за типом`,"All types":`Всі типи`,"File name":`Назва файлу`,Actions:`Дії`,"Add file":`Додати файл`,"Add folder":`Додати папку`,"Add file by URL":`Додати файл за URL`,"File moved":`Файл переміщено`,"Error when moving a file":`Помилка при переміщенні файлу`,"Failed to download file":`Не вдалося завантажити файл`,"Failed to load JSON data":`Не вдалося завантажити дані JSON`,"Invalid file URL":`Некоректний URL файлу`,"Unable to validate file URL":`Не вдалося перевірити файл за URL`,"Type to search...":`Введіть для пошуку...`,Submit:`Надіслати`,"No folders yet":`Папок поки немає`,"Drag files to upload":`Перетягніть файли для завантаження`,"Drop files here to upload":`Відпустіть файли тут, щоб завантажити їх`,"Newest first":`Спочатку нові`,"Oldest first":`Спочатку старі`,"Largest first":`Спочатку великі`,"Smallest first":`Спочатку маленькі`,"A-Z":`За алфавітом А-Я`,"Z-A":`За алфавітом Я-А`,"By type":`За типом`,"Evaluating the task":`Оцінка завдання`,"Something went wrong, please try again":`Щось пішло не так, будь ласка, спробуйте ще раз`,"Sort by":`Сортувати за`,"preview text":`Зображення завантажується ...`,"Use this variant":`Використати цей варіант`,"Confirm deletion":`Підтвердити видалення`,"Are you sure you want to delete the selected items?":`Ви впевнені, що хочете видалити обрані елементи?`,"Move to Trash":`Перемістити в кошик`,"Are you sure you want to move the selected items to the Trash?":`Ви впевнені, що хочете перемістити обрані елементи в кошик?`,"Permanently delete":`Повне видалення`,"Delete permanently":`Видалити безповоротно`,"Are you sure you want to permanently delete the selected items? This action cannot be undone.":`Ви впевнені, що хочете безповоротно видалити обрані елементи? Цю дію не можна скасувати.`,Clear:`Очистити`,"Clear Trash":`Очистити кошик`,"Are you sure you want to permanently delete all items from Trash?":`Ви впевнені, що хочете безповоротно видалити всі елементи з кошика?`,"Trash cleared successfully":`Кошик успішно очищено`,"{{count}} items permanently deleted":`{{count}} елементів безповоротно видалено`,"Trash partially cleared":`Кошик частково очищено`,"{{succeeded}} items deleted, {{failed}} items failed":`{{succeeded}} елементів видалено, {{failed}} не вдалося видалити`,"Failed to clear trash":`Не вдалося очистити кошик`,"Error clearing trash":`Помилка при очищенні кошика`,"Deleting items...":`Видалення елементів...`,delete_files_permanent_one:`Ця дія безповоротно видалить {{count}} файл`,delete_files_permanent_few:`Ця дія безповоротно видалить {{count}} файли`,delete_files_permanent_many:`Ця дія безповоротно видалить {{count}} файлів`,delete_files_permanent_other:`Ця дія безповоротно видалить {{count}} файлів`,delete_folder_permanent:`Ця дія безповоротно видалить папку «{{name}}» і все її вміст, включаючи {{count}} елементів.`,delete_mixed_permanent:`Ця дія безповоротно видалить {{total}} обраних елементів, включаючи {{folders}} папок і всі {{images}} зображень всередині них.`,permanent_delete_warning:`Видалення файлів, які були використані в листах, призведе до проблем з відображенням зображень у старих листах. Ви впевнені, що хочете повністю видалити обране?`,move_files_to_trash_one:`Ця дія перемістить у кошик {{count}} файл.`,move_files_to_trash_few:`Ця дія перемістить у кошик {{count}} файли.`,move_files_to_trash_many:`Ця дія перемістить у кошик {{count}} файлів.`,move_files_to_trash_other:`Ця дія перемістить у кошик {{count}} файлів.`,move_folder_to_trash:`Ця дія перемістить у кошик папку «{{name}}» і все її вміст ({{count}} елементів).`,move_mixed_to_trash:`Ця дія перемістить у кошик {{total}} обраних елементів, включаючи {{folders}} папок і {{images}} зображень.`,delete_count_confirm_trash_one:`Перемістити в кошик {{count}} файл?`,delete_count_confirm_trash_few:`Перемістити в кошик {{count}} файли?`,delete_count_confirm_trash_many:`Перемістити в кошик {{count}} файлів?`,delete_count_confirm_trash_other:`Перемістити в кошик {{count}} файлів?`,delete_count_confirm_permanent_one:`Видалити назавжди {{count}} файл?`,delete_count_confirm_permanent_few:`Видалити назавжди {{count}} файли?`,delete_count_confirm_permanent_many:`Видалити назавжди {{count}} файлів?`,delete_count_confirm_permanent_other:`Видалити назавжди {{count}} файлів?`,delete_count_confirm_one:`Видалити {{count}} файл?`,delete_count_confirm_few:`Видалити {{count}} файли?`,delete_count_confirm_many:`Видалити {{count}} файлів?`,delete_count_confirm_other:`Видалити {{count}} файлів?`,item:`файл`,items:`файлів`,Trash:`Видалені`,Choose:`Обрати`,Stock:`Фотосток`,"Select an image from our library":`Виберіть зображення з нашої бібліотеки`,"AI generation":`AI генерація`,"Creating an image on demand":`Створення зображення на замовлення`,"Search file or folder":`Знайти файл або папку`,"Click here to select a file":`Натисніть тут, щоб вибрати файл`,"Supported files:":`Підтримувані файли:`,"Create folder":`Створити папку`,Done:`Готово`,"Move here":`Перемістити сюди`,"Copy here":`Копіювати сюди`,"File URL":`URL файлу`,"There's nothing here":`Тут нічого немає`,"Try using a different search query.":`Спробуйте використовувати інший пошуковий запит.`,"Millions of free stock images":`Мільйони безкоштовних стокових зображень`,"Enter a search query and we'll find the perfect image for you":`Введіть пошуковий запит, і ми знайдемо для вас ідеальне зображення`,"Millions of icons":`Мільйони іконок`,"Lucide icons":`Іконки Lucide`,"Thousands of icons":`Тисячі іконок`,"Enter a search query and we'll find the perfect icon for you":`Введіть пошуковий запит, і ми знайдемо для вас ідеальну іконку`,"Enter your query and we will find the right one for you":`Введіть запит і ми знайдемо для вас відповідне`,"Over 350,000 live images":`Понад 350 000 живих зображень`,"The folder will be created in the root directory.":`Папка буде створена в кореневому каталозі.`,undo:`СКАСУВАТИ`,moved_to_trash_one:`Переміщено {{count}} елемент у кошик`,moved_to_trash_few:`Переміщено {{count}} елементи у кошик`,moved_to_trash_many:`Переміщено {{count}} елементів у кошик`,moved_to_trash_other:`Переміщено {{count}} елементів у кошик`,restored_items_one:`Відновлено {{count}} елемент`,restored_items_few:`Відновлено {{count}} елементи`,restored_items_many:`Відновлено {{count}} елементів`,restored_items_other:`Відновлено {{count}} елементів`,Type:`Тип`,"Generate image":`Створити зображення`,"A beautiful image of a sunset over a calm ocean.":`Красиве зображення заходу сонця над спокійним океаном.`,"For example:":`Наприклад:`,Insert:`Вставити`,Error:`Помилка`,"Upload progress":`Завантаження {{completed}}/{{total}}`,"Uploading files":`Завантаження {{completed}}/{{total}} файлів`,"Uploaded files":`Завантажено {{success}} з {{total}} файлів`,"Upload error files":`Помилка завантаження {{errorCount}} файлів`,"Applies to all {{count}} files":`(стосується всіх {{count}} файлів)`,"Some files failed to upload":`Деякі файли не вдалося завантажити. Перевірте розмір та формат файлів.`,upload_error_hint_invalid_name:`Перейменуйте файл: використовуйте лише літери, цифри, дефіс та підкреслення.`,upload_error_hint_size:`Зменшіть розмір файлу або оберіть інший.`,upload_error_hint_format:`Оберіть дозволений формат: JPG, PNG або GIF.`,upload_error_hint_exists:`Файл з такою назвою вже є в папці. Перейменуйте файл.`,"Images generated successfully":`Зображення успішно створено`,"Choose for template":`Вибрати для завантаження в шаблон`,"Trash is empty":`Кошик порожній`,"Deleted files will be displayed here":`Тут будуть відображатися видалені файли`,"Editing: {{name}}":`Редагування: {{name}}`,"Editing image":`Редагування зображення`,Save:`Зберегти`,"Loading editor...":`Завантаження редактора…`,"Error loading image":`Помилка завантаження зображення`,"Error saving image":`Помилка при збереженні зображення`,"Error initializing editor":`Помилка ініціалізації редактора`,"Close File Manager":`Закрити файловий менеджер`,"Are you sure you want to close? Unsaved changes will be lost.":`Ви впевнені, що хочете закрити? Незбережені зміни будуть втрачені.`,"Are you sure you want to close the file manager?":`Ви впевнені, що хочете закрити файловий менеджер?`,Close:`Закрити`,KB:`КБ`,"No files":`Немає файлів`,"Folder is empty or files not found":`Папка порожня або файли не знайдені`,"Search files...":`Пошук файлів...`,Success:`Успіх`,"Image updated successfully":`Зображення успішно оновлено`,"Failed to save changes":`Не вдалося зберегти зміни: {{error}}`,"Unknown error":`Невідома помилка`,"Select destination folder":`Виберіть папку призначення`,"Error moving":`Помилка при переміщенні`,"Error deleting":`Помилка при видаленні`,"Error copying":`Помилка при копіюванні`,"Error renaming":`Помилка при перейменуванні`,"Failed to refresh folder tree":`Не вдалося оновити дерево папок`,"Failed to refresh file list":`Не вдалося оновити список файлів`,"Errors occurred while moving":`Під час переміщення виникли помилки`,"Errors occurred while copying":`Під час копіювання виникли помилки`,"(error)":`(помилка)`,"(circular reference)":`(циклічне посилання)`,"File too large. Maximum size: {{size}}":`Файл занадто великий. Максимальний розмір: {{size}}`,"File too small. Minimum size: {{size}}":`Файл занадто маленький. Мінімальний розмір: {{size}}`,"Unsupported file type":`Непідтримуваний тип файлу`,"Unsupported file type: {{type}}":`Непідтримуваний тип файлу: {{type}}`,unknown:`невідомий`,"Failed to load files":`Не вдалося завантажити файли`,"Failed to load files in folder":`Не вдалося завантажити вміст папки «{{folderName}}»`,"Failed to load subfolders in folder":`Не вдалося завантажити підпапки в «{{folderName}}»`,"Failed to load folder items count in folder":`Не вдалося отримати кількість елементів у «{{folderName}}»`,"DataProvider for folder deletion is not configured":`DataProvider для видалення папок не налаштовано`,"DataProvider for file upload is not configured":`DataProvider для завантаження файлів не налаштовано`,"Error uploading file {{fileName}}":`Помилка при завантаженні файлу {{fileName}}`,"Error uploading file":`Помилка при завантаженні файлу`,"Cannot upload files to Trash":`Не можна завантажувати файли в кошик`,"Please fill in all fields":`Заповніть усі поля`,"URL too long":`URL занадто довгий`,"Only http and https URLs are supported":`Підтримуються лише URL з протоколом http та https`,"Private and local URLs are not allowed":`Локальні та приватні URL заборонені`,"Upload by URL is not supported":`Завантаження за URL не підтримується`,"File name is too long. Maximum {{max}} characters":`Ім'я файлу занадто довге. Максимум {{max}} символів`,"File name contains invalid characters":`Ім'я файлу містить неприпустимі символи`,"Large file may take a long time to upload":`Великий файл може завантажуватися довго`,"File unavailable: {{status}} {{statusText}}":`Файл недоступний: {{status}} {{statusText}}`,"File too large: {{size}}":`Файл занадто великий: {{size}}`,"Unsupported file type: {{contentType}}":`Непідтримуваний тип файлу: {{contentType}}`,"Invalid server response: folder ID is missing":`Некорректна відповідь сервера: відсутній ID папки`,"Error: folder cannot be its own parent":`Помилка: папка не може бути батьком самої себе`,"Upload to Trash is forbidden":`Завантаження в кошик заборонено`,"renameFolder is not implemented in dataProviders":`renameFolder не реалізовано в dataProviders`,"renameFile is not implemented in dataProviders":`renameFile не реалізовано в dataProviders`,Clean:`Очистити`,"Circular dependency detected: folder cannot be its own parent":`Виявлено циклічну залежність: папка не може бути батьком самої себе`,"Save as copy and choose":`Зберегти як копію і вибрати`,"Save and choose":`Зберегти і вибрати`,pixie:{"added drawing":`Додавання малюнка`,"added frame":`Додавання рамки`,"added image":`Додавання зображення`,"added shape":`Додавання фігури`,"added sticker":`Додавання стікера`,"added text":`Додавання тексту`,"applied filters":`Застосування фільтр`,apply:`Застосувати`,background:`Фон`,"background color":`Фоновий колір`,beach:`Пляж`,"brush color":`Колір кисті`,"brush size":`Розмір кисті`,"brush type":`Тип кисті`,bubbles:`Пузирці`,Cancel:`Скасувати`,"changed style":`Зміна стилю`,"Circle Brush":`Кола`,close:`Закрити`,color:`Колір`,corners:`Кути`,crop:`Обрізати`,Custom:`Користувацький`,"deleted object":`Видалення об'єкта`,"Diamond Brush":`Алмаз`,doodles:`Кольорові`,draw:`Малюнок`,emoticons:`Смайлики`,"Eraser Brush":`Гумка`,filter:`Фільтр`,font:`Шрифт`,"font size":`Розмір шрифту`,frame:`Рамка`,gradient:`Градієнт`,height:`Висота`,history:`Історія`,"H Line Brush":`Н-подібна`,image:`Зображення`,initial:`Початковий`,landmarks:`Пам'ятки`,"loaded state":`Завантаження стану`,"loading canvas":`Завантаження`,"loading image":`Завантаження`,"loading state":`Завантаження`,"maintain aspect ratio":`Maintain aspect ratio`,merge:`Об'єднання`,"merged objects":`Об'єднання об'єктів`,"new text":`Новий напис`,objects:`Об'єкт`,opacity:`Прозорість`,outline:`Контур`,"outline color":`Колір контуру`,"Pencil Brush":`Олівець`,"processing image":`Завантаження`,quality:`Якість`,radius:`Радіус`,"replace image":`Replace Image`,"replaced background image":`Видалення фонового зображення`,resize:`Розмір`,"resized image":`Зміна розміру`,"rounded corner":`Заокруглення кутів`,save:`Зберегти`,shadow:`Тінь`,"shadow color":`Колір тіні`,shapes:`Фігури`,"Spray Brush":`Спрей`,square:`Квадрат`,"Square Brush":`Квадрат`,stickers:`Стікери`,text:`Напис`,texture:`Текстура`,transportation:`Транспорт`,"V Line Brush":`V-подібна`,width:`Ширина`,grayscale:`Відтінки сірого`,"black & White":`Чорно-білий`,sharpen:`Різкість`,invert:`Інверсія`,vintage:`Вінтаж`,polaroid:`Полароїд`,kodachrome:`Кодахром`,technicolor:`Техніколор`,brownie:`Коричневий`,sepia:`Сепія`,"remove Color":`Видалити колір`,brightness:`Яскравість`,gamma:`Гамма`,noise:`Шум`,pixelate:`Пікселізація`,blur:`Розмиття`,emboss:`Тиснення`,"blend Color":`Змішати колір`,distance:`Відстань`,red:`Червоний`,green:`Зелений`,blue:`Синій`,blocksize:`Розмір блоку`,alpha:`Альфа`,add:`Додати`,multiply:`Помножити`,subtract:`Відняти`,diff:`Різниця`,screen:`Екран`,lighten:`Освітлити`,darken:`Затемнити`,"select an option...":`Виберіть опцію...`}},dc={Files:`Arquivos`,selected:`selecionado(s)`,Deselected:`Desmarcar`,Refresh:`Atualizar`,"Select all":`Selecionar tudo`,Rename:`Renomear`,"Rename file":`Renomear arquivo {{currentFileName}}`,"Select the destination folder":`Selecionar a pasta de destino`,"Selected files:":`Arquivos selecionados:`,"Selected files":`Arquivos selecionados: {{count}}`,selected_files_one:`{{count}} arquivo selecionado`,selected_files_few:`{{count}} arquivos selecionados`,selected_files_many:`{{count}} arquivos selecionados`,selected_files_other:`{{count}} arquivos selecionados`,Copy:`Duplicar`,Edit:`Editar`,Move:`Mover`,"Move to":`Mover para`,Delete:`Excluir`,"New folder":`Nova pasta`,"Image search...":`Busca de imagens...`,"Search icons":`Encontrar ícones`,"By name":`Por nome`,"By size":`Por tamanho`,"By date":`Por data`,List:`Lista`,Grid:`Grade`,Main:`Principal`,Folders:`Pastas`,"total pages":`Total de {{total}} itens`,Name:`Nome`,Untitled:`Sem título`,Size:`Tamanho`,"Stroke width":`Espessura do traço`,Dimensions:`Dimensões`,Date:`Data`,error:`erro`,Folder:`Pasta`,created:`criada`,"Failed to create folder":`Falha ao criar pasta`,"File deleted":`Arquivo excluído`,"Error when deleting a file":`Erro ao excluir arquivo`,"Folder deleted":`Pasta excluída`,"Error when deleting a folder":`Erro ao excluir pasta`,"Delete folder":`Excluir pasta`,"Are you sure you want to delete this folder? This action will also delete all files and subfolders.":`Tem certeza que deseja excluir esta pasta? Esta ação também excluirá todos os arquivos e subpastas.`,"API-endpoint for file upload is not configured":`Endpoint da API para upload de arquivos não está configurado`,"Please select an image file":`Por favor, selecione um arquivo de imagem`,File:`Arquivo`,"has been successfully uploaded":`foi carregado com sucesso`,"The URL must point to an image":`A URL deve apontar para uma imagem`,"Image upload...":`Carregando imagem...`,Unknown:`Desconhecido`,"Error downloading file by URL":`Erro ao baixar arquivo por URL`,"successfully uploaded":`carregado com sucesso`,"Error when downloading a file by URL":`Erro ao baixar arquivo por URL`,"Error when uploading a file":`Erro ao enviar arquivo`,"Error loading files":`Erro ao carregar arquivos`,"File not found":`Arquivo não encontrado`,"File renamed to":`Arquivo renomeado para`,"Failed to rename the file":`Falha ao renomear o arquivo`,"Folder renamed to":`Pasta renomeada para`,"Rename folder":`Renomear pasta`,"New folder name":`Novo nome da pasta`,"Enter a new folder name":`Digite um novo nome para a pasta`,"Please drag and drop image files only":`Por favor, arraste e solte apenas arquivos de imagem`,"Upload file by URL":`Carregar arquivo por URL`,"Upload file":`Carregar arquivo`,"Creating a new folder":`Criando uma nova pasta`,Create:`Criar`,Cancel:`Cancelar`,"Folder name":`Nome da pasta`,"Enter the name of the folder":`Digite o nome da pasta`,"Enter the name":`Digite o nome`,"A folder will be created inside:":`A pasta será criada dentro de:`,"selected folder":`pasta selecionada`,"The folder will be created in the root directory":`A pasta será criada no diretório raiz`,"Failed to load folders":`Não foi possível carregar as pastas`,"Folder name cannot be empty":`O nome da pasta não pode estar vazio`,"Folder creation provider is not configured":`O provedor de criação de pastas não está configurado`,"Folder created":`Pasta criada`,"Folder rename is disabled by config":`Renomear pastas está desabilitado pela configuração`,"Folder rename provider is not configured":`O provedor de renomeação de pastas não está configurado`,"Unexpected response when renaming folder":`Resposta inesperada ao renomear a pasta`,"Folder renamed":`Pasta renomeada`,"Failed to rename folder":`Não foi possível renomear a pasta`,"Failed to load folder items count":`Não foi possível obter a contagem de itens da pasta`,"Failed to load subfolders":`Não foi possível carregar as subpastas`,Download:`Baixar`,"image URL":`URL da imagem`,"Enter the URL of the image":`Digite a URL da imagem`,"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":`Formatos suportados: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP`,"New file name":`Novo nome do arquivo`,"Enter a new file name":`Digite um novo nome para o arquivo`,"Copy to folder":`Copiar para pasta`,Added:`Adicionado em {{date}}`,"File uploaded successfully":`Arquivo {{fileName}} carregado com sucesso`,"Successfully uploaded":`{{successCount}} de {{count}} arquivo carregado com sucesso`,"Successfully uploaded files":`{{successCount}} de {{count}} arquivos carregados com sucesso`,uploads_success_summary:`Enviados {{successCount}} de {{totalCount}} arquivos`,uploads_fail_summary:`Falhou ao enviar {{failCount}} de {{totalCount}} arquivos`,"File with this name already exists.":`Já existe um arquivo com esse nome.`,"File not found or no longer available.":`O arquivo não foi encontrado ou já foi excluído.`,"You don't have permission to access this file.":`Você não tem permissão para acessar este arquivo.`,"File is too large to upload.":`O arquivo é grande demais para ser enviado.`,"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":`O arquivo é grande demais ({{fileSize}}). Tamanho máximo permitido: {{maxSize}}.`,"Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":`Número máximo de arquivos excedido. Permitido: {{allowed}}, recebido: {{received}}`,"This file type is not allowed.":`Este tipo de arquivo não é permitido.`,"File name is not valid.":`O nome do arquivo não é válido.`,"File name is not valid. Allowed characters: {{allowedChars}}":`O nome do arquivo não é válido. Caracteres permitidos: {{allowedChars}}`,"Failed to read the file.":`Não foi possível ler o arquivo.`,"Failed to write the file.":`Não foi possível gravar o arquivo.`,"The file appears to be corrupted.":`O arquivo parece estar corrompido.`,"File integrity check failed.":`A verificação de integridade do arquivo falhou.`,"Folder not found or no longer available.":`A pasta não foi encontrada ou já foi excluída.`,"Folder with this name already exists.":`Já existe uma pasta com esse nome.`,"A folder with that name already exists. Please enter a different folder name.":`Já existe uma pasta com esse nome. Digite um nome diferente para a pasta.`,"You don't have permission to access this folder.":`Você não tem permissão para acessar esta pasta.`,"Folder name is not valid.":`O nome da pasta não é válido.`,"Folder name is not valid. Allowed characters: {{allowedChars}}":`Não foi possível criar a pasta. Caracteres permitidos no nome: {{allowedChars}}`,"Failed to read the folder contents.":`Não foi possível ler o conteúdo da pasta.`,"Failed to write to the folder.":`Não foi possível gravar na pasta.`,"Folder storage quota exceeded.":`A cota de armazenamento da pasta foi excedida.`,"Folder is not empty.":`A pasta não está vazia.`,"Server error while processing the folder.":`Erro do servidor ao processar a pasta.`,"Folder operation took too long.":`A operação com a pasta demorou demais.`,"Network error. Please check your connection and try again.":`Erro de rede. Verifique sua conexão e tente novamente.`,"The operation took too long. Please try again.":`A operação demorou demais. Tente novamente.`,"Server error. Please try again later.":`Erro no servidor. Tente novamente mais tarde.`,"Service is temporarily unavailable. Please try again later.":`O serviço está temporariamente indisponível. Tente novamente mais tarde.`,"Too many requests. Please try again a bit later.":`Muitas solicitações. Tente novamente mais tarde.`,"Authentication failed. Please sign in again.":`Falha na autenticação. Faça login novamente.`,"You are not allowed to perform this action.":`Você não tem permissão para executar esta ação.`,"Some of the provided data is invalid.":`Alguns dos dados fornecidos são inválidos.`,"This operation is not supported.":`Esta operação não é suportada.`,"Request payload is too large.":`O corpo da requisição é grande demais.`,"This media type is not supported.":`Este tipo de mídia não é suportado.`,"You have exceeded the upload quota.":`Você excedeu a cota de upload de arquivos.`,"Network error while uploading the file.":`Erro de rede ao enviar o arquivo.`,"File upload took too long.":`O envio do arquivo demorou demais.`,"Server error while uploading the file.":`Erro do servidor ao enviar o arquivo.`,"The specified URL is not valid.":`A URL especificada não é válida.`,"The specified URL is not reachable.":`A URL especificada não está acessível.`,"Content type at the URL is not allowed.":`O tipo de conteúdo na URL não é permitido.`,"Failed to download file from the URL.":`Não foi possível baixar o arquivo da URL.`,"Network error while downloading the file.":`Erro de rede ao baixar o arquivo.`,"File download took too long.":`O download do arquivo demorou demais.`,"Server error while downloading the file.":`Erro do servidor ao baixar o arquivo.`,"Some items could not be processed.":`Nem todos os itens foram processados com sucesso.`,"Failed to process all items in the batch.":`Nenhum item do lote pôde ser processado.`,"Some items in the batch are in a conflicting state.":`Alguns itens do lote estão em estado de conflito.`,"Some items in the batch did not pass validation.":`Alguns itens do lote não passaram na validação.`,"AI service returned an invalid response.":`O serviço de IA retornou uma resposta inválida.`,"Failed to generate image using AI.":`Falha ao gerar imagem usando IA.`,"You have reached the AI image generation limit.":`Você atingiu o limite de geração de imagens por IA.`,"Error in external integration.":`Erro em uma integração externa.`,"Error in a third-party service.":`Erro em um serviço de terceiros.`,"An unknown error occurred.":`Ocorreu um erro desconhecido.`,"Renaming is not allowed for this item.":`Renomear não é permitido para este item.`,"Moving is not allowed for this item.":`Mover não é permitido para este item.`,"Copying is not allowed for this item.":`Copiar não é permitido para este item.`,"Deleting is not allowed for this item.":`Excluir não é permitido para este item.`,"Cannot move an item into itself.":`Não é possível mover um item para dentro de si mesmo.`,"Cannot move an item into its descendant folder.":`Não é possível mover um item para sua pasta descendente.`,"Cannot copy an item into itself.":`Não é possível copiar um item para dentro de si mesmo.`,"Configuration error occurred.":`Ocorreu um erro de configuração.`,"Storage quota exceeded. Please free up space.":`Cota de armazenamento excedida. Libere espaço.`,"File is locked by another process or user.":`O arquivo está bloqueado por outro processo ou usuário.`,"File version conflict. Please refresh and try again.":`Conflito de versão do arquivo. Atualize a página e tente novamente.`,"Batch operation exceeds the maximum number of items allowed.":`A operação em lote excede o número máximo de itens permitidos.`,Moved:`Movidos: {{names}}`,move_success_summary:`Movidos {{successCount}} de {{totalCount}} itens`,move_fail_summary:`Falhou ao mover {{failCount}} de {{totalCount}} itens`,Copied:`Copiados: {{names}}`,copy_success_summary:`Copiados {{successCount}} de {{totalCount}} itens`,copy_fail_summary:`Falhou ao copiar {{failCount}} de {{totalCount}} itens`,Uploaded:`Arquivos enviados: {{names}}`,Failed:`Falha ao enviar: {{names}}`,"Failed to upload":`Falha ao carregar {{failCount}} de {{count}} arquivo`,"Failed to upload files":`Falha ao carregar {{failCount}} de {{count}} arquivos`,months:{january:`janeiro`,february:`fevereiro`,march:`março`,april:`abril`,may:`maio`,june:`junho`,july:`julho`,august:`agosto`,september:`setembro`,october:`outubro`,november:`novembro`,december:`dezembro`},files:`arquivos`,"No available folders":`Nenhuma pasta disponível`,"My files":`Meus arquivos`,GIF:`GIF`,"Stock images":`Imagens de stock`,"QR & Barcode":`QR e código de barras`,"QR code":`Código QR`,Barcode:`Código de barras`,"Text or URL":`Texto ou URL`,"Code color":`Cor do código`,"Background color":`Cor de fundo`,"Add to My files":`Adicionar aos Meus arquivos`,"Transparent background":`Fundo transparente`,"Barcode generation failed":`Não foi possível gerar o código de barras. Use caracteres compatíveis com CODE128.`,"Validation error":`Erro de validação`,"Enter text or URL to preview":`Digite texto ou um URL para pré-visualizar.`,Preview:`Pré-visualização`,"QR transparent background hint":`PNG transparente pode se misturar a temas escuros do e-mail; fundo branco costuma ser mais confiável para leitores.`,"QR image size px":`Tamanho do QR`,"Barcode bar height px":`Altura das barras`,AI:`IA`,"AI image generation":`Geração de imagens por IA`,"Search GIFs":`Buscar GIFs`,"That`s all we could find.":`Isso é tudo que conseguimos encontrar.`,"Search image":`Buscar imagem`,All:`Todos`,Landscape:`Paisagem`,Portrait:`Retrato`,Squarish:`Quadrados`,Black:`Preto`,"Black and White":`Preto e branco`,White:`Branco`,Orange:`Laranja`,Red:`Vermelho`,Purple:`Roxo`,Magenta:`Magenta`,Green:`Verde`,Teal:`Verde-azulado`,Blue:`Azul`,"Photo by":`Foto por`,on:`em`,"File Manager":`Gerenciador de arquivos`,"File Manager not configured":`Gerenciador de arquivos não configurado`,"Filter by type":`Filtrar por tipo`,"All types":`Todos os tipos`,"File name":`Nome do arquivo`,Actions:`Ações`,"Add file":`Adicionar arquivo`,"Add folder":`Adicionar pasta`,"Add file by URL":`Adicionar arquivo por URL`,"File moved":`Arquivo movido`,"Error when moving a file":`Erro ao mover arquivo`,"Failed to download file":`Não foi possível baixar o arquivo`,"Failed to load JSON data":`Não foi possível carregar os dados JSON`,"Invalid file URL":`URL de arquivo inválida`,"Unable to validate file URL":`Não foi possível validar a URL do arquivo`,"Type to search...":`Digite para buscar...`,Submit:`Enviar`,"No folders yet":`Nenhuma pasta ainda`,"Drag files to upload":`Arraste arquivos para carregar`,"Drop files here to upload":`Solte os arquivos aqui para carregá-los`,"Newest first":`Mais recentes primeiro`,"Oldest first":`Mais antigos primeiro`,"Largest first":`Maiores primeiro`,"Smallest first":`Menores primeiro`,"A-Z":`A-Z`,"Z-A":`Z-A`,"By type":`Por tipo`,"Evaluating the task":`Avaliando a tarefa`,"Something went wrong, please try again":`Algo deu errado, por favor tente novamente`,"Sort by":`Ordenar por`,"preview text":`Carregando imagem...`,"Use this variant":`Usar esta variante`,"Confirm deletion":`Confirmar exclusão`,"Are you sure you want to delete the selected items?":`Tem certeza que deseja excluir os itens selecionados?`,"Move to Trash":`Mover para lixeira`,"Are you sure you want to move the selected items to the Trash?":`Tem certeza que deseja mover os itens selecionados para a lixeira?`,"Permanently delete":`Exclusão permanente`,"Delete permanently":`Excluir permanentemente`,"Are you sure you want to permanently delete the selected items? This action cannot be undone.":`Tem certeza que deseja excluir permanentemente os itens selecionados? Esta ação não pode ser desfeita.`,Clear:`Limpar`,"Clear Trash":`Limpar lixeira`,"Are you sure you want to permanently delete all items from Trash?":`Tem certeza que deseja excluir permanentemente todos os itens da lixeira?`,"Trash cleared successfully":`Lixeira limpa com sucesso`,"{{count}} items permanently deleted":`{{count}} itens excluídos permanentemente`,"Trash partially cleared":`Lixeira parcialmente limpa`,"{{succeeded}} items deleted, {{failed}} items failed":`{{succeeded}} itens excluídos, {{failed}} falharam`,"Failed to clear trash":`Falha ao limpar lixeira`,"Error clearing trash":`Erro ao limpar lixeira`,"Deleting items...":`Excluindo itens...`,delete_files_permanent_one:`Esta ação excluirá permanentemente {{count}} arquivo`,delete_files_permanent_few:`Esta ação excluirá permanentemente {{count}} arquivos`,delete_files_permanent_many:`Esta ação excluirá permanentemente {{count}} arquivos`,delete_files_permanent_other:`Esta ação excluirá permanentemente {{count}} arquivos`,delete_folder_permanent:`Esta ação excluirá permanentemente a pasta «{{name}}» e todo seu conteúdo, incluindo {{count}} itens.`,delete_mixed_permanent:`Esta ação excluirá permanentemente {{total}} itens selecionados, incluindo {{folders}} pastas e todas as {{images}} imagens dentro delas.`,permanent_delete_warning:`Excluir arquivos que foram usados em e-mails causará problemas na exibição de imagens em e-mails antigos. Tem certeza de que deseja excluir permanentemente a seleção?`,move_files_to_trash_one:`Esta ação moverá {{count}} arquivo para a lixeira.`,move_files_to_trash_few:`Esta ação moverá {{count}} arquivos para a lixeira.`,move_files_to_trash_many:`Esta ação moverá {{count}} arquivos para a lixeira.`,move_files_to_trash_other:`Esta ação moverá {{count}} arquivos para a lixeira.`,move_folder_to_trash:`Esta ação moverá a pasta «{{name}}» e todo seu conteúdo ({{count}} itens) para a lixeira.`,move_mixed_to_trash:`Esta ação moverá {{total}} itens selecionados para a lixeira, incluindo {{folders}} pastas e {{images}} imagens.`,delete_count_confirm_trash_one:`Mover {{count}} arquivo para a lixeira?`,delete_count_confirm_trash_few:`Mover {{count}} arquivos para a lixeira?`,delete_count_confirm_trash_many:`Mover {{count}} arquivos para a lixeira?`,delete_count_confirm_trash_other:`Mover {{count}} arquivos para a lixeira?`,delete_count_confirm_permanent_one:`Excluir permanentemente {{count}} arquivo?`,delete_count_confirm_permanent_few:`Excluir permanentemente {{count}} arquivos?`,delete_count_confirm_permanent_many:`Excluir permanentemente {{count}} arquivos?`,delete_count_confirm_permanent_other:`Excluir permanentemente {{count}} arquivos?`,delete_count_confirm_one:`Excluir {{count}} arquivo?`,delete_count_confirm_few:`Excluir {{count}} arquivos?`,delete_count_confirm_many:`Excluir {{count}} arquivos?`,delete_count_confirm_other:`Excluir {{count}} arquivos?`,item:`arquivo`,items:`arquivos`,Trash:`Lixeira`,Choose:`Escolher`,Stock:`Banco de imagens`,"Select an image from our library":`Selecione uma imagem da nossa biblioteca`,"AI generation":`Geração por IA`,"Creating an image on demand":`Criando uma imagem sob demanda`,"Search file or folder":`Buscar arquivo ou pasta`,"Click here to select a file":`Clique aqui para selecionar um arquivo`,"Supported files:":`Arquivos suportados:`,"Create folder":`Criar pasta`,Done:`Concluído`,"Move here":`Mover aqui`,"Copy here":`Copiar aqui`,"File URL":`URL do arquivo`,"There's nothing here":`Não há nada aqui`,"Try using a different search query.":`Tente usar uma consulta de pesquisa diferente.`,"Millions of free stock images":`Milhões de imagens de stock gratuitas`,"Enter a search query and we'll find the perfect image for you":`Digite uma consulta de busca e encontraremos a imagem perfeita para você`,"Millions of icons":`Milhões de ícones`,"Lucide icons":`Ícones Lucide`,"Thousands of icons":`Milhares de ícones`,"Enter a search query and we'll find the perfect icon for you":`Digite uma consulta de busca e encontraremos o ícone perfeito para você`,"Enter your query and we will find the right one for you":`Digite sua consulta e nós encontraremos a ideal para você`,"Over 350,000 live images":`Mais de 350.000 imagens ao vivo`,"The folder will be created in the root directory.":`A pasta será criada no diretório raiz.`,undo:`DESFAZER`,moved_to_trash_one:`{{count}} item movido para a lixeira`,moved_to_trash_few:`{{count}} itens movidos para a lixeira`,moved_to_trash_many:`{{count}} itens movidos para a lixeira`,moved_to_trash_other:`{{count}} itens movidos para a lixeira`,restored_items_one:`{{count}} item restaurado`,restored_items_few:`{{count}} itens restaurados`,restored_items_many:`{{count}} itens restaurados`,restored_items_other:`{{count}} itens restaurados`,Type:`Tipo`,"Generate image":`Gerar imagem`,"A beautiful image of a sunset over a calm ocean.":`Uma imagem bonita de um pôr do sol sobre um oceano tranquilo.`,"For example:":`Por exemplo:`,Insert:`Inserir`,Error:`Erro`,"Upload progress":`Enviando {{completed}}/{{total}}`,"Uploading files":`Enviando {{completed}}/{{total}} arquivos`,"Uploaded files":`Enviados {{success}} de {{total}} arquivos`,"Upload error files":`Erro ao enviar {{errorCount}} arquivos`,"Applies to all {{count}} files":`(aplica-se a todos os {{count}} arquivos)`,"Some files failed to upload":`Alguns arquivos não puderam ser enviados. Verifique o tamanho e o formato dos arquivos.`,upload_error_hint_invalid_name:`Renomeie o arquivo: use apenas letras, números, hífens e sublinhados.`,upload_error_hint_size:`Reduza o tamanho do arquivo ou escolha outro.`,upload_error_hint_format:`Use um formato permitido: JPG, PNG ou GIF.`,upload_error_hint_exists:`Já existe um arquivo com este nome na pasta. Renomeie o arquivo.`,"Images generated successfully":`Imagens geradas com sucesso`,"Choose for template":`Selecionar para carregar no modelo`,"Trash is empty":`A lixeira está vazia`,"Deleted files will be displayed here":`Os arquivos excluídos serão exibidos aqui`,"Editing: {{name}}":`Editando: {{name}}`,"Editing image":`Editando imagem`,Save:`Salvar`,"Loading editor...":`Carregando editor...`,"Error loading image":`Erro ao carregar a imagem`,"Error saving image":`Erro ao salvar a imagem`,"Error initializing editor":`Erro ao inicializar o editor`,"Close File Manager":`Fechar gerenciador de arquivos`,"Are you sure you want to close? Unsaved changes will be lost.":`Tem certeza de que deseja fechar? As alterações não salvas serão perdidas.`,"Are you sure you want to close the file manager?":`Tem certeza de que deseja fechar o gerenciador de arquivos?`,Close:`Fechar`,KB:`KB`,"No files":`Nenhum arquivo`,"Folder is empty or files not found":`A pasta está vazia ou os arquivos não foram encontrados`,"Search files...":`Buscar arquivos...`,Success:`Sucesso`,"Image updated successfully":`Imagem atualizada com sucesso`,"Failed to save changes":`Falha ao salvar alterações: {{error}}`,"Unknown error":`Erro desconhecido`,"Select destination folder":`Selecione a pasta de destino`,"Error moving":`Erro ao mover`,"Error deleting":`Erro ao excluir`,"Error copying":`Erro ao copiar`,"Error renaming":`Erro ao renomear`,"Failed to refresh folder tree":`Falha ao atualizar a árvore de pastas`,"Failed to refresh file list":`Falha ao atualizar a lista de arquivos`,"Errors occurred while moving":`Ocorreram erros ao mover`,"Errors occurred while copying":`Ocorreram erros ao copiar`,"(error)":`(erro)`,"(circular reference)":`(referência circular)`,"File too large. Maximum size: {{size}}":`Arquivo muito grande. Tamanho máximo: {{size}}`,"File too small. Minimum size: {{size}}":`Arquivo muito pequeno. Tamanho mínimo: {{size}}`,"Unsupported file type":`Tipo de arquivo não suportado`,"Unsupported file type: {{type}}":`Tipo de arquivo não suportado: {{type}}`,unknown:`desconhecido`,"Failed to load files":`Falha ao carregar arquivos`,"Failed to load files in folder":`Não foi possível carregar o conteúdo da pasta ({{folderName}})`,"Failed to load subfolders in folder":`Não foi possível carregar subpastas em "{{folderName}}"`,"Failed to load folder items count in folder":`Não foi possível obter a contagem de itens em "{{folderName}}"`,"DataProvider for folder deletion is not configured":`DataProvider para exclusão de pastas não está configurado`,"DataProvider for file upload is not configured":`DataProvider para upload de arquivos não está configurado`,"Error uploading file {{fileName}}":`Erro ao carregar o arquivo {{fileName}}`,"Error uploading file":`Erro ao carregar o arquivo`,"Cannot upload files to Trash":`Não é possível carregar arquivos para a lixeira`,"Please fill in all fields":`Por favor, preencha todos os campos`,"URL too long":`URL muito longa`,"Only http and https URLs are supported":`Apenas URLs com protocolo http e https são suportadas`,"Private and local URLs are not allowed":`URLs locais e privadas não são permitidas`,"Upload by URL is not supported":`Upload por URL não é suportado`,"File name is too long. Maximum {{max}} characters":`O nome do arquivo é muito longo. Máximo de {{max}} caracteres`,"File name contains invalid characters":`O nome do arquivo contém caracteres inválidos`,"Large file may take a long time to upload":`Um arquivo grande pode demorar muito para ser carregado`,"File unavailable: {{status}} {{statusText}}":`Arquivo indisponível: {{status}} {{statusText}}`,"File too large: {{size}}":`Arquivo muito grande: {{size}}`,"Unsupported file type: {{contentType}}":`Tipo de arquivo não suportado: {{contentType}}`,"Invalid server response: folder ID is missing":`Resposta do servidor inválida: ID da pasta ausente`,"Error: folder cannot be its own parent":`Erro: a pasta não pode ser seu próprio pai`,"Upload to Trash is forbidden":`Enviar para a lixeira é proibido`,"renameFolder is not implemented in dataProviders":`renameFolder não está implementado em dataProviders`,"renameFile is not implemented in dataProviders":`renameFile não está implementado em dataProviders`,Clean:`Limpar`,"Circular dependency detected: folder cannot be its own parent":`Dependência circular detectada: a pasta não pode ser seu próprio pai`,"Save as copy and choose":`Salvar como cópia e escolher`,"Save and choose":`Salvar e escolher`,pixie:{"added drawing":`Desenho adicionado`,"added frame":`Moldura adicionada`,"added image":`Imagem adicionada`,"added shape":`Forma adicionada`,"added sticker":`Adesivo adicionado`,"added text":`Texto adicionado`,"applied filters":`Filtros aplicados`,apply:`Aplicar`,background:`Fundo`,"background color":`Cor de fundo`,beach:`Praia`,"brush color":`Cor do pincel`,"brush size":`Tamanho do pincel`,"brush type":`Tipo de pincel`,bubbles:`Bolhas`,Cancel:`Cancelar`,"changed style":`Estilo alterado`,"Circle Brush":`Círculo`,close:`Fechar`,color:`Cor`,corners:`Cantos`,crop:`Cortar`,Custom:`Personalizado`,"deleted object":`Objeto excluído`,"Diamond Brush":`Diamante`,doodles:`Rabiscos`,draw:`Desenhar`,emoticons:`Emoticons`,"Eraser Brush":`Borracha`,filter:`Filtro`,font:`Fonte`,"font size":`Tamanho da fonte`,frame:`Moldura`,gradient:`Gradiente`,height:`Altura`,history:`Histórico`,"H Line Brush":`Linha H`,image:`Imagem`,initial:`Inicial`,landmarks:`Pontos turísticos`,"loaded state":`Estado carregado`,"loading canvas":`Carregando tela`,"loading image":`Carregando imagem`,"loading state":`Carregando estado`,"maintain aspect ratio":`Manter proporção`,merge:`Mesclar`,"merged objects":`Objetos mesclados`,"new text":`Novo texto`,objects:`Objetos`,opacity:`Opacidade`,outline:`Contorno`,"outline color":`Cor do contorno`,"Pencil Brush":`Lápis`,"processing image":`Processando imagem`,quality:`Qualidade`,radius:`Raio`,"replace image":`Substituir imagem`,"replaced background image":`Imagem de fundo substituída`,resize:`Redimensionar`,"resized image":`Imagem redimensionada`,"rounded corner":`Canto arredondado`,save:`Salvar`,shadow:`Sombra`,"shadow color":`Cor da sombra`,shapes:`Formas`,"Spray Brush":`Spray`,square:`Quadrado`,"Square Brush":`Quadrado`,stickers:`Adesivos`,text:`Texto`,texture:`Textura`,transportation:`Transporte`,"V Line Brush":`Linha V`,width:`Largura`,grayscale:`Tons de cinza`,"black & White":`Preto e branco`,sharpen:`Nitidez`,invert:`Inverter`,vintage:`Vintage`,polaroid:`Polaroid`,kodachrome:`Kodachrome`,technicolor:`Technicolor`,brownie:`Sépia quente`,sepia:`Sépia`,"remove Color":`Remover cor`,brightness:`Brilho`,gamma:`Gamma`,noise:`Ruído`,pixelate:`Pixelar`,blur:`Desfocar`,emboss:`Relevo`,"blend Color":`Misturar cor`,distance:`Distância`,red:`Vermelho`,green:`Verde`,blue:`Azul`,blocksize:`Tamanho do bloco`,alpha:`Alfa`,add:`Adicionar`,multiply:`Multiplicar`,subtract:`Subtrair`,diff:`Diferença`,screen:`Tela`,lighten:`Clarear`,darken:`Escurecer`,"select an option...":`Selecione uma opção...`}},fc={en:{translation:cc},ru:{translation:lc},es:{translation:{Files:`Archivos`,selected:`seleccionado(s)`,Deselected:`Deseleccionar`,Refresh:`Actualizar`,"Select all":`Seleccionar todo`,Rename:`Renombrar`,"Rename file":`Renombrar archivo {{currentFileName}}`,"Select the destination folder":`Seleccionar la carpeta de destino`,"Selected files:":`Archivos seleccionados:`,"Selected files":`Archivos seleccionados: {{count}}`,selected_files_one:`{{count}} archivo seleccionado`,selected_files_few:`{{count}} archivos seleccionados`,selected_files_many:`{{count}} archivos seleccionados`,selected_files_other:`{{count}} archivos seleccionados`,Copy:`Duplicar`,Edit:`Editar`,Move:`Mover`,"Move to":`Mover a`,Delete:`Eliminar`,"New folder":`Nueva carpeta`,"Image search...":`Búsqueda de imágenes...`,"Search icons":`Buscar iconos`,"By name":`Por nombre`,"By size":`Por tamaño`,"By date":`Por fecha`,List:`Lista`,Grid:`Cuadrícula`,Main:`Principal`,Folders:`Carpetas`,"total pages":`{{total}} elementos en total`,Name:`Nombre`,Untitled:`Sin título`,Size:`Tamaño`,"Stroke width":`Grosor del trazo`,Dimensions:`Dimensiones`,Date:`Fecha`,error:`error`,Folder:`Carpeta`,created:`creada`,"Failed to create folder":`Error al crear la carpeta`,"File deleted":`Archivo eliminado`,"Error when deleting a file":`Error al eliminar el archivo`,"Folder deleted":`Carpeta eliminada`,"Error when deleting a folder":`Error al eliminar la carpeta`,"Delete folder":`Eliminar carpeta`,"Are you sure you want to delete this folder? This action will also delete all files and subfolders.":`¿Está seguro de que desea eliminar esta carpeta? Esta acción también eliminará todos los archivos y subcarpetas.`,"API-endpoint for file upload is not configured":`El endpoint API para la carga de archivos no está configurado`,"Please select an image file":`Por favor, seleccione un archivo de imagen`,File:`Archivo`,"has been successfully uploaded":`se ha cargado exitosamente`,"The URL must point to an image":`La URL debe apuntar a una imagen`,"Image upload...":`Cargando imagen...`,Unknown:`Desconocido`,"Error downloading file by URL":`Error al descargar el archivo por URL`,"successfully uploaded":`cargado exitosamente`,"Error when downloading a file by URL":`Error al descargar un archivo por URL`,"Error when uploading a file":`Error al cargar el archivo`,"Error loading files":`Error al cargar archivos`,"File not found":`Archivo no encontrado`,"File renamed to":`Archivo renombrado a`,"Failed to rename the file":`Error al renombrar el archivo`,"Folder renamed to":`Carpeta renombrada a`,"Rename folder":`Renombrar carpeta`,"New folder name":`Nuevo nombre de la carpeta`,"Enter a new folder name":`Ingrese un nuevo nombre para la carpeta`,"Please drag and drop image files only":`Por favor, arrastre y suelte solo archivos de imagen`,"Upload file by URL":`Cargar archivo por URL`,"Upload file":`Cargar archivo`,"Creating a new folder":`Creando una nueva carpeta`,Create:`Crear`,Cancel:`Cancelar`,"Folder name":`Nombre de la carpeta`,"Enter the name of the folder":`Ingrese el nombre de la carpeta`,"Enter the name":`Ingrese el nombre`,"A folder will be created inside:":`La carpeta se creará dentro de:`,"selected folder":`carpeta seleccionada`,"The folder will be created in the root directory":`La carpeta se creará en el directorio raíz`,"Failed to load folders":`No se pudieron cargar las carpetas`,"Folder name cannot be empty":`El nombre de la carpeta no puede estar vacío`,"Folder creation provider is not configured":`El proveedor de creación de carpetas no está configurado`,"Folder created":`Carpeta creada`,"Folder rename is disabled by config":`El renombrado de carpetas está deshabilitado por la configuración`,"Folder rename provider is not configured":`El proveedor para renombrar carpetas no está configurado`,"Unexpected response when renaming folder":`Respuesta inesperada al renombrar la carpeta`,"Folder renamed":`Carpeta renombrada`,"Failed to rename folder":`No se pudo renombrar la carpeta`,"Failed to load folder items count":`No se pudo obtener la cantidad de elementos de la carpeta`,"Failed to load subfolders":`No se pudieron cargar las subcarpetas`,Download:`Descargar`,"image URL":`URL de la imagen`,"Enter the URL of the image":`Ingrese la URL de la imagen`,"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":`Formatos admitidos: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP`,"New file name":`Nuevo nombre del archivo`,"Enter a new file name":`Ingrese un nuevo nombre para el archivo`,"Copy to folder":`Copiar a carpeta`,Added:`Añadido el {{date}}`,"File uploaded successfully":`Archivo {{fileName}} cargado exitosamente`,"Successfully uploaded":`{{successCount}} de {{count}} archivo cargado exitosamente`,"Successfully uploaded files":`{{successCount}} de {{count}} archivos cargados exitosamente`,uploads_success_summary:`Se cargaron {{successCount}} de {{totalCount}} archivos`,uploads_fail_summary:`No se pudieron cargar {{failCount}} de {{totalCount}} archivos`,"File with this name already exists.":`Ya existe un archivo con este nombre.`,"File not found or no longer available.":`El archivo no se encontró o ya fue eliminado.`,"You don't have permission to access this file.":`No tiene permisos para acceder a este archivo.`,"File is too large to upload.":`El archivo es demasiado grande para subir.`,"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":`El archivo es demasiado grande ({{fileSize}}). Tamaño máximo permitido: {{maxSize}}.`,"Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":`Se ha superado el número máximo de archivos. Permitido: {{allowed}}, recibido: {{received}}`,"This file type is not allowed.":`Este tipo de archivo no está permitido.`,"File name is not valid.":`El nombre del archivo no es válido.`,"File name is not valid. Allowed characters: {{allowedChars}}":`El nombre del archivo no es válido. Caracteres permitidos: {{allowedChars}}`,"Failed to read the file.":`No se pudo leer el archivo.`,"Failed to write the file.":`No se pudo escribir el archivo.`,"The file appears to be corrupted.":`El archivo parece estar dañado.`,"File integrity check failed.":`La verificación de integridad del archivo falló.`,"Folder not found or no longer available.":`La carpeta no se encontró o ya fue eliminada.`,"Folder with this name already exists.":`Ya existe una carpeta con este nombre.`,"A folder with that name already exists. Please enter a different folder name.":`Ya existe una carpeta con ese nombre. Introduzca un nombre de carpeta diferente.`,"You don't have permission to access this folder.":`No tiene permisos para acceder a esta carpeta.`,"Folder name is not valid.":`El nombre de la carpeta no es válido.`,"Folder name is not valid. Allowed characters: {{allowedChars}}":`No se pudo crear la carpeta. Caracteres permitidos en el nombre: {{allowedChars}}`,"Failed to read the folder contents.":`No se pudo leer el contenido de la carpeta.`,"Failed to write to the folder.":`No se pudo escribir en la carpeta.`,"Folder storage quota exceeded.":`Se superó la cuota de almacenamiento de la carpeta.`,"Folder is not empty.":`La carpeta no está vacía.`,"Server error while processing the folder.":`Error del servidor al procesar la carpeta.`,"Folder operation took too long.":`La operación con la carpeta tardó demasiado.`,"Network error. Please check your connection and try again.":`Error de red. Compruebe su conexión e inténtelo de nuevo.`,"The operation took too long. Please try again.":`La operación tardó demasiado. Inténtelo de nuevo.`,"Server error. Please try again later.":`Error del servidor. Inténtelo de nuevo más tarde.`,"Service is temporarily unavailable. Please try again later.":`El servicio no está disponible temporalmente. Inténtelo de nuevo más tarde.`,"Too many requests. Please try again a bit later.":`Demasiadas solicitudes. Inténtelo de nuevo más tarde.`,"Authentication failed. Please sign in again.":`Error de autenticación. Inicie sesión de nuevo.`,"You are not allowed to perform this action.":`No tiene permisos para realizar esta acción.`,"Some of the provided data is invalid.":`Algunos de los datos proporcionados no son válidos.`,"This operation is not supported.":`Esta operación no está soportada.`,"Request payload is too large.":`El cuerpo de la solicitud es demasiado grande.`,"This media type is not supported.":`Este tipo de contenido no está soportado.`,"You have exceeded the upload quota.":`Se ha superado la cuota de subida de archivos.`,"Network error while uploading the file.":`Error de red al subir el archivo.`,"File upload took too long.":`La subida del archivo tardó demasiado.`,"Server error while uploading the file.":`Error del servidor al subir el archivo.`,"The specified URL is not valid.":`La URL especificada no es válida.`,"The specified URL is not reachable.":`La URL especificada no es accesible.`,"Content type at the URL is not allowed.":`El tipo de contenido en la URL no está permitido.`,"Failed to download file from the URL.":`No se pudo descargar el archivo desde la URL.`,"Network error while downloading the file.":`Error de red al descargar el archivo.`,"File download took too long.":`La descarga del archivo tardó demasiado.`,"Server error while downloading the file.":`Error del servidor al descargar el archivo.`,"Some items could not be processed.":`No todos los elementos se procesaron correctamente.`,"Failed to process all items in the batch.":`No se pudo procesar ningún elemento del lote.`,"Some items in the batch are in a conflicting state.":`Algunos elementos del lote están en estado de conflicto.`,"Some items in the batch did not pass validation.":`Algunos elementos del lote no pasaron la validación.`,"AI service returned an invalid response.":`El servicio de IA devolvió una respuesta no válida.`,"Failed to generate image using AI.":`No se pudo generar la imagen usando IA.`,"You have reached the AI image generation limit.":`Se alcanzó el límite de generación de imágenes con IA.`,"Error in external integration.":`Error en la integración externa.`,"Error in a third-party service.":`Error en un servicio de terceros.`,"An unknown error occurred.":`Se ha producido un error desconocido.`,"Renaming is not allowed for this item.":`No se permite renombrar este elemento.`,"Moving is not allowed for this item.":`No se permite mover este elemento.`,"Copying is not allowed for this item.":`No se permite copiar este elemento.`,"Deleting is not allowed for this item.":`No se permite eliminar este elemento.`,"Cannot move an item into itself.":`No se puede mover un elemento dentro de sí mismo.`,"Cannot move an item into its descendant folder.":`No se puede mover un elemento a su carpeta descendiente.`,"Cannot copy an item into itself.":`No se puede copiar un elemento dentro de sí mismo.`,"Configuration error occurred.":`Se produjo un error de configuración.`,"Storage quota exceeded. Please free up space.":`Se superó la cuota de almacenamiento. Libere espacio.`,"File is locked by another process or user.":`El archivo está bloqueado por otro proceso o usuario.`,"File version conflict. Please refresh and try again.":`Conflicto de versión del archivo. Actualice la página e inténtelo de nuevo.`,"Batch operation exceeds the maximum number of items allowed.":`La operación por lotes excede el número máximo de elementos permitidos.`,Moved:`Movidos: {{names}}`,move_success_summary:`Se movieron {{successCount}} de {{totalCount}} elementos`,move_fail_summary:`No se pudieron mover {{failCount}} de {{totalCount}} elementos`,Copied:`Copiados: {{names}}`,copy_success_summary:`Se copiaron {{successCount}} de {{totalCount}} elementos`,copy_fail_summary:`No se pudieron copiar {{failCount}} de {{totalCount}} elementos`,Uploaded:`Archivos cargados: {{names}}`,Failed:`No se pudieron cargar: {{names}}`,"Failed to upload":`Error al cargar {{failCount}} de {{count}} archivo`,"Failed to upload files":`Error al cargar {{failCount}} de {{count}} archivos`,months:{january:`enero`,february:`febrero`,march:`marzo`,april:`abril`,may:`mayo`,june:`junio`,july:`julio`,august:`agosto`,september:`septiembre`,october:`octubre`,november:`noviembre`,december:`diciembre`},files:`archivos`,"No available folders":`No hay carpetas disponibles`,"My files":`Mis archivos`,GIF:`GIF`,"Stock images":`Imágenes de stock`,"QR & Barcode":`QR y código de barras`,"QR code":`Código QR`,Barcode:`Código de barras`,"Text or URL":`Texto o URL`,"Code color":`Color del código`,"Background color":`Color de fondo`,"Add to My files":`Añadir a Mis archivos`,"Transparent background":`Fondo transparente`,"Barcode generation failed":`No se pudo generar el código de barras. Use caracteres compatibles con CODE128.`,"Validation error":`Error de validación`,"Enter text or URL to preview":`Introduzca texto o una URL para la vista previa.`,Preview:`Vista previa`,"QR transparent background hint":`Un PNG transparente puede fundirse con temas oscuros del correo; un fondo blanco suele escanearse mejor.`,"QR image size px":`Tamaño del QR`,"Barcode bar height px":`Altura de barras`,AI:`IA`,"AI image generation":`Generación de imágenes con IA`,"Search GIFs":`Buscar GIFs`,"That`s all we could find.":`Es todo lo que pudimos encontrar.`,"Search image":`Buscar imagen`,All:`Todos`,Landscape:`Horizontal`,Portrait:`Vertical`,Squarish:`Cuadrado`,Black:`Negro`,"Black and White":`Blanco y negro`,White:`Blanco`,Orange:`Naranja`,Red:`Rojo`,Purple:`Morado`,Magenta:`Magenta`,Green:`Verde`,Teal:`Verde azulado`,Blue:`Azul`,"Photo by":`Foto de`,on:`en`,"File Manager":`Administrador de archivos`,"File Manager not configured":`Administrador de archivos no configurado`,"Filter by type":`Filtrar por tipo`,"All types":`Todos los tipos`,"File name":`Nombre del archivo`,Actions:`Acciones`,"Add file":`Añadir archivo`,"Add folder":`Añadir carpeta`,"Add file by URL":`Añadir archivo por URL`,"File moved":`Archivo movido`,"Error when moving a file":`Error al mover el archivo`,"Failed to download file":`No se pudo descargar el archivo`,"Failed to load JSON data":`No se pudieron cargar los datos JSON`,"Invalid file URL":`URL de archivo inválida`,"Unable to validate file URL":`No se pudo validar la URL del archivo`,"Type to search...":`Escriba para buscar...`,Submit:`Enviar`,"No folders yet":`Aún no hay carpetas`,"Drag files to upload":`Arrastre archivos para cargarlos`,"Drop files here to upload":`Suelte los archivos aquí para cargarlos`,"Newest first":`Los más nuevos primero`,"Oldest first":`Los más antiguos primero`,"Largest first":`Los más grandes primero`,"Smallest first":`Los más pequeños primero`,"A-Z":`A-Z`,"Z-A":`Z-A`,"By type":`Por tipo`,"Evaluating the task":`Evaluando la tarea`,"Something went wrong, please try again":`Algo salió mal, por favor intente nuevamente`,"Sort by":`Ordenar por`,"preview text":`Cargando imagen...`,"Use this variant":`Usar esta variante`,"Confirm deletion":`Confirmar eliminación`,"Are you sure you want to delete the selected items?":`¿Está seguro de que desea eliminar los elementos seleccionados?`,"Move to Trash":`Mover a la papelera`,"Are you sure you want to move the selected items to the Trash?":`¿Está seguro de que desea mover los elementos seleccionados a la papelera?`,"Permanently delete":`Eliminación permanente`,"Delete permanently":`Eliminar permanentemente`,"Are you sure you want to permanently delete the selected items? This action cannot be undone.":`¿Está seguro de que desea eliminar permanentemente los elementos seleccionados? Esta acción no se puede deshacer.`,Clear:`Limpiar`,"Clear Trash":`Vaciar papelera`,"Are you sure you want to permanently delete all items from Trash?":`¿Está seguro de que desea eliminar permanentemente todos los elementos de la papelera?`,"Trash cleared successfully":`Papelera vaciada con éxito`,"{{count}} items permanently deleted":`{{count}} elementos eliminados permanentemente`,"Trash partially cleared":`Papelera parcialmente vaciada`,"{{succeeded}} items deleted, {{failed}} items failed":`{{succeeded}} elementos eliminados, {{failed}} fallaron`,"Failed to clear trash":`Error al vaciar papelera`,"Error clearing trash":`Error al vaciar papelera`,"Deleting items...":`Eliminando elementos...`,delete_files_permanent_one:`Esta acción eliminará permanentemente {{count}} archivo`,delete_files_permanent_few:`Esta acción eliminará permanentemente {{count}} archivos`,delete_files_permanent_many:`Esta acción eliminará permanentemente {{count}} archivos`,delete_files_permanent_other:`Esta acción eliminará permanentemente {{count}} archivos`,delete_folder_permanent:`Esta acción eliminará permanentemente la carpeta «{{name}}» y todo su contenido, incluyendo {{count}} elementos.`,delete_mixed_permanent:`Esta acción eliminará permanentemente {{total}} elementos seleccionados, incluyendo {{folders}} carpetas y todas las {{images}} imágenes dentro de ellas.`,permanent_delete_warning:`Eliminar archivos que se usaron en correos provocará problemas para mostrar imágenes en correos antiguos. ¿Está seguro de que desea eliminar permanentemente la selección?`,move_files_to_trash_one:`Esta acción moverá {{count}} archivo a la papelera.`,move_files_to_trash_few:`Esta acción moverá {{count}} archivos a la papelera.`,move_files_to_trash_many:`Esta acción moverá {{count}} archivos a la papelera.`,move_files_to_trash_other:`Esta acción moverá {{count}} archivos a la papelera.`,move_folder_to_trash:`Esta acción moverá la carpeta «{{name}}» y todo su contenido ({{count}} elementos) a la papelera.`,move_mixed_to_trash:`Esta acción moverá {{total}} elementos seleccionados a la papelera, incluyendo {{folders}} carpetas y {{images}} imágenes.`,delete_count_confirm_trash_one:`¿Mover {{count}} archivo a la papelera?`,delete_count_confirm_trash_few:`¿Mover {{count}} archivos a la papelera?`,delete_count_confirm_trash_many:`¿Mover {{count}} archivos a la papelera?`,delete_count_confirm_trash_other:`¿Mover {{count}} archivos a la papelera?`,delete_count_confirm_permanent_one:`¿Eliminar permanentemente {{count}} archivo?`,delete_count_confirm_permanent_few:`¿Eliminar permanentemente {{count}} archivos?`,delete_count_confirm_permanent_many:`¿Eliminar permanentemente {{count}} archivos?`,delete_count_confirm_permanent_other:`¿Eliminar permanentemente {{count}} archivos?`,delete_count_confirm_one:`¿Eliminar {{count}} archivo?`,delete_count_confirm_few:`¿Eliminar {{count}} archivos?`,delete_count_confirm_many:`¿Eliminar {{count}} archivos?`,delete_count_confirm_other:`¿Eliminar {{count}} archivos?`,item:`archivo`,items:`archivos`,Trash:`Papelera`,Choose:`Elegir`,Stock:`Banco de imágenes`,"Select an image from our library":`Seleccione una imagen de nuestra biblioteca`,"AI generation":`Generación con IA`,"Creating an image on demand":`Creando una imagen bajo demanda`,"Search file or folder":`Buscar archivo o carpeta`,"Click here to select a file":`Haz clic aquí para seleccionar un archivo`,"Supported files:":`Archivos admitidos:`,"Create folder":`Crear carpeta`,Done:`Hecho`,"Move here":`Mover aquí`,"Copy here":`Copiar aquí`,"File URL":`URL del archivo`,"There's nothing here":`Aquí no hay nada`,"Try using a different search query.":`Prueba a utilizar una consulta de búsqueda diferente.`,"Millions of free stock images":`Millones de imágenes de stock gratuitas`,"Enter a search query and we'll find the perfect image for you":`Ingrese una consulta de búsqueda y encontraremos la imagen perfecta para usted`,"Millions of icons":`Millones de iconos`,"Lucide icons":`Iconos Lucide`,"Thousands of icons":`Miles de iconos`,"Enter a search query and we'll find the perfect icon for you":`Ingrese una consulta de búsqueda y encontraremos el ícono perfecto para usted`,"Enter your query and we will find the right one for you":`Ingrese su consulta y nosotros encontraremos la adecuada para usted`,"Over 350,000 live images":`Más de 350,000 imágenes en vivo`,"The folder will be created in the root directory.":`La carpeta se creará en el directorio raíz.`,undo:`DESHACER`,moved_to_trash_one:`{{count}} elemento movido a la papelera`,moved_to_trash_few:`{{count}} elementos movidos a la papelera`,moved_to_trash_many:`{{count}} elementos movidos a la papelera`,moved_to_trash_other:`{{count}} elementos movidos a la papelera`,restored_items_one:`{{count}} elemento restaurado`,restored_items_few:`{{count}} elementos restaurados`,restored_items_many:`{{count}} elementos restaurados`,restored_items_other:`{{count}} elementos restaurados`,Type:`Tipo`,"Generate image":`Generar imagen`,"A beautiful image of a sunset over a calm ocean.":`Una imagen hermosa de un atardecer sobre un océano tranquilo.`,"For example:":`Por ejemplo:`,Insert:`Insertar`,Error:`Error`,"Upload progress":`Cargando {{completed}}/{{total}}`,"Uploading files":`Cargando {{completed}}/{{total}} archivos`,"Uploaded files":`Cargados {{success}} de {{total}} archivos`,"Upload error files":`Error al cargar {{errorCount}} archivos`,"Applies to all {{count}} files":`(se aplica a todos los {{count}} archivos)`,"Some files failed to upload":`Algunos archivos no se pudieron cargar. Verifique el tamaño y el formato de los archivos.`,upload_error_hint_invalid_name:`Renombre el archivo: use solo letras, números, guiones y guiones bajos.`,upload_error_hint_size:`Reduzca el tamaño del archivo o elija otro.`,upload_error_hint_format:`Use un formato permitido: JPG, PNG o GIF.`,upload_error_hint_exists:`Ya existe un archivo con este nombre en la carpeta. Renombre el archivo.`,"Images generated successfully":`Imágenes generadas correctamente`,"Choose for template":`Seleccionar para cargar en la plantilla`,"Trash is empty":`La papelera está vacía`,"Deleted files will be displayed here":`Los archivos eliminados se mostrarán aquí`,"Editing: {{name}}":`Editando: {{name}}`,"Editing image":`Editando imagen`,Save:`Guardar`,"Loading editor...":`Cargando editor...`,"Error loading image":`Error al cargar la imagen`,"Error saving image":`Error al guardar la imagen`,"Error initializing editor":`Error al inicializar el editor`,"Close File Manager":`Cerrar administrador de archivos`,"Are you sure you want to close? Unsaved changes will be lost.":`¿Está seguro de que desea cerrar? Los cambios no guardados se perderán.`,"Are you sure you want to close the file manager?":`¿Está seguro de que desea cerrar el administrador de archivos?`,Close:`Cerrar`,KB:`KB`,"No files":`No hay archivos`,"Folder is empty or files not found":`La carpeta está vacía o no se encontraron archivos`,"Search files...":`Buscar archivos...`,Success:`Éxito`,"Image updated successfully":`Imagen actualizada exitosamente`,"Failed to save changes":`Error al guardar los cambios: {{error}}`,"Unknown error":`Error desconocido`,"Select destination folder":`Seleccione la carpeta de destino`,"Error moving":`Error al mover`,"Error deleting":`Error al eliminar`,"Error copying":`Error al copiar`,"Error renaming":`Error al renombrar`,"Failed to refresh folder tree":`Error al actualizar el árbol de carpetas`,"Failed to refresh file list":`Error al actualizar la lista de archivos`,"Errors occurred while moving":`Ocurrieron errores al mover`,"Errors occurred while copying":`Ocurrieron errores al copiar`,"(error)":`(error)`,"(circular reference)":`(referencia circular)`,"File too large. Maximum size: {{size}}":`El archivo es demasiado grande. Tamaño máximo: {{size}}`,"File too small. Minimum size: {{size}}":`El archivo es demasiado pequeño. Tamaño mínimo: {{size}}`,"Unsupported file type":`Tipo de archivo no admitido`,"Unsupported file type: {{type}}":`Tipo de archivo no admitido: {{type}}`,unknown:`desconocido`,"Failed to load files":`Error al cargar archivos`,"Failed to load files in folder":`No se pudo cargar el contenido de la carpeta ({{folderName}})`,"Failed to load subfolders in folder":`No se pudieron cargar las subcarpetas en "{{folderName}}"`,"Failed to load folder items count in folder":`No se pudo obtener el recuento de elementos en "{{folderName}}"`,"DataProvider for folder deletion is not configured":`DataProvider para eliminar carpetas no está configurado`,"DataProvider for file upload is not configured":`DataProvider para cargar archivos no está configurado`,"Error uploading file {{fileName}}":`Error al cargar el archivo {{fileName}}`,"Error uploading file":`Error al cargar el archivo`,"Cannot upload files to Trash":`No se pueden cargar archivos a la papelera`,"Please fill in all fields":`Por favor, complete todos los campos`,"URL too long":`La URL es demasiado larga`,"Only http and https URLs are supported":`Solo se admiten URLs con protocolo http y https`,"Private and local URLs are not allowed":`No se permiten URLs locales ni privadas`,"Upload by URL is not supported":`La carga por URL no está admitida`,"File name is too long. Maximum {{max}} characters":`El nombre del archivo es demasiado largo. Máximo {{max}} caracteres`,"File name contains invalid characters":`El nombre del archivo contiene caracteres no válidos`,"Large file may take a long time to upload":`Un archivo grande puede tardar mucho en cargarse`,"File unavailable: {{status}} {{statusText}}":`Archivo no disponible: {{status}} {{statusText}}`,"File too large: {{size}}":`Archivo demasiado grande: {{size}}`,"Unsupported file type: {{contentType}}":`Tipo de archivo no admitido: {{contentType}}`,"Invalid server response: folder ID is missing":`Respuesta del servidor inválida: falta el ID de la carpeta`,"Error: folder cannot be its own parent":`Error: la carpeta no puede ser su propio padre`,"Upload to Trash is forbidden":`Cargar a la papelera está prohibido`,"renameFolder is not implemented in dataProviders":`renameFolder no está implementado en dataProviders`,"renameFile is not implemented in dataProviders":`renameFile no está implementado en dataProviders`,Clean:`Limpiar`,"Circular dependency detected: folder cannot be its own parent":`Dependencia circular detectada: la carpeta no puede ser su propio padre`,"Save as copy and choose":`Guardar como copia y elegir`,"Save and choose":`Guardar y elegir`,pixie:{"added drawing":`Dibujo añadido`,"added frame":`Marco añadido`,"added image":`Imagen añadida`,"added shape":`Forma añadida`,"added sticker":`Pegatina añadida`,"added text":`Texto añadido`,"applied filters":`Filtros aplicados`,apply:`Aplicar`,background:`Fondo`,"background color":`Color de fondo`,beach:`Playa`,"brush color":`Color del pincel`,"brush size":`Tamaño del pincel`,"brush type":`Tipo de pincel`,bubbles:`Burbujas`,Cancel:`Cancelar`,"changed style":`Estilo cambiado`,"Circle Brush":`Círculo`,close:`Cerrar`,color:`Color`,corners:`Esquinas`,crop:`Recortar`,Custom:`Personalizado`,"deleted object":`Objeto eliminado`,"Diamond Brush":`Diamante`,doodles:`Garabatos`,draw:`Dibujar`,emoticons:`Emoticonos`,"Eraser Brush":`Borrador`,filter:`Filtro`,font:`Fuente`,"font size":`Tamaño de fuente`,frame:`Marco`,gradient:`Gradiente`,height:`Alto`,history:`Historial`,"H Line Brush":`Línea H`,image:`Imagen`,initial:`Inicial`,landmarks:`Monumentos`,"loaded state":`Estado cargado`,"loading canvas":`Cargando lienzo`,"loading image":`Cargando imagen`,"loading state":`Cargando estado`,"maintain aspect ratio":`Mantener proporción`,merge:`Fusionar`,"merged objects":`Objetos fusionados`,"new text":`Nuevo texto`,objects:`Objetos`,opacity:`Opacidad`,outline:`Contorno`,"outline color":`Color del contorno`,"Pencil Brush":`Lápiz`,"processing image":`Procesando imagen`,quality:`Calidad`,radius:`Radio`,"replace image":`Reemplazar imagen`,"replaced background image":`Imagen de fondo reemplazada`,resize:`Redimensionar`,"resized image":`Imagen redimensionada`,"rounded corner":`Esquina redondeada`,save:`Guardar`,shadow:`Sombra`,"shadow color":`Color de la sombra`,shapes:`Formas`,"Spray Brush":`Spray`,square:`Cuadrado`,"Square Brush":`Cuadrado`,stickers:`Pegatinas`,text:`Texto`,texture:`Textura`,transportation:`Transporte`,"V Line Brush":`Línea V`,width:`Ancho`,grayscale:`Escala de grises`,"black & White":`Blanco y negro`,sharpen:`Enfocar`,invert:`Invertir`,vintage:`Vintage`,polaroid:`Polaroid`,kodachrome:`Kodachrome`,technicolor:`Technicolor`,brownie:`Sepia cálido`,sepia:`Sepia`,"remove Color":`Eliminar color`,brightness:`Brillo`,gamma:`Gamma`,noise:`Ruido`,pixelate:`Pixelar`,blur:`Desenfocar`,emboss:`Relieve`,"blend Color":`Mezclar color`,distance:`Distancia`,red:`Rojo`,green:`Verde`,blue:`Azul`,blocksize:`Tamaño de bloque`,alpha:`Alfa`,add:`Añadir`,multiply:`Multiplicar`,subtract:`Restar`,diff:`Diferencia`,screen:`Pantalla`,lighten:`Aclarar`,darken:`Oscurecer`,"select an option...":`Seleccione una opción...`}}},uk:{translation:uc},"pt-br":{translation:dc},pt:{translation:dc},br:{translation:dc},"pt-BR":{translation:dc}};U.use(Hs).init({resources:fc,lng:`en`,fallbackLng:`en`,interpolation:{escapeValue:!1}}),Object.values({images:[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`,`image/bmp`,`image/tiff`],documents:[`application/pdf`,`text/plain`,`application/msword`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],archives:[`application/zip`,`application/x-rar-compressed`,`application/x-7z-compressed`],videos:[`video/mp4`,`video/avi`,`video/quicktime`,`video/x-msvideo`],audio:[`audio/mpeg`,`audio/wav`,`audio/ogg`]}).flat();var pc=e=>{if(e===0)return`0 Bytes`;let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/1024**t).toFixed(2))+` `+[`Bytes`,`KB`,`MB`,`GB`][t]},mc=e=>{if(!e||e<=0)return``;let t=1048576;return e<t?`${Math.round(e/1024)} Kb`:`${(e/t).toFixed(2)} Mb`},hc=e=>{if(e==null)return``;if(typeof e==`number`)return mc(e);let t=String(e).trim();if(!t)return``;let n=Number(t);return Number.isNaN(n)?t:mc(n)},gc=(e,t)=>{let n=t.filter(e=>typeof e==`string`),r=new Set(n.map(e=>e.toLowerCase())),i=typeof e==`string`?e:String(e??``);if(!r.has(i.toLowerCase()))return i;let a=i.lastIndexOf(`.`),o=a>0?i.slice(0,a):i,s=a>0?i.slice(a):``,c,l=1;do c=`${o}_${l}${s}`,l++;while(r.has(c.toLowerCase()));return c};async function _c(e,t,n,r,i){if(!i||!e?.getFiles)return t;try{let i=[],{files:a}=await e.getFiles({folderId:r?void 0:n??void 0,noFolder:r,itemType:`all`,page:1,limit:1e4});if(i=(a||[]).map(e=>e.name).filter(e=>!!e),!r&&e?.getFolders){let t=(await e.getFolders({parentId:n??null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);i=[...i,...t]}return gc(t,i)}catch{return t}}var vc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`m6 9 6 6 6-6`}));vc.displayName=`ChevronDown`;var yc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M12 20.472a6 6 0 1 0 5.58-10.262m-11.16 0a6 6 0 1 0 7.16 3.58M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0Z`}));yc.displayName=`Colors`;var bc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M16 16v2.8c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C14.48 22 13.92 22 12.8 22H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 20.48 2 19.92 2 18.8v-7.6c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 8 4.08 8 5.2 8H8m3.2 8h7.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 14.48 22 13.92 22 12.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2h-7.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C8 3.52 8 4.08 8 5.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C9.52 16 10.08 16 11.2 16Z`}));bc.displayName=`Copy04`;var xc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M10 6h4.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C18 7.52 18 8.08 18 9.2V14M2 6h4m12 12v4m4-4H9.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C6 16.48 6 15.92 6 14.8V2`}));xc.displayName=`Crop02`;var Sc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0-7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z`}));Sc.displayName=`DotsVertical`;var Cc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7 3 3m0 0 3-3m-3 3v-6`}));Cc.displayName=`FolderDownload`;var wc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7h6`}));wc.displayName=`FolderMinus`;var Tc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6`}));Tc.displayName=`FolderPlus`;var Ec=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm13.5 10.5L14 16m1-2.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z`}));Ec.displayName=`FolderSearch`;var Dc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z`}));Dc.displayName=`Grid01`;var Oc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21Z`}));Oc.displayName=`Image03`;var kc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7`}));kc.displayName=`Link01`;var Ac=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`}));Ac.displayName=`List`;var jc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z`}),s.createElement(`path`,{d:`M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z`}));jc.displayName=`PlaySquare`;var Mc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M12 8v8m-4-4h8m6 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z`}));Mc.displayName=`PlusCircle`;var Nc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M6.5 6.5h.01m10.99 0h.01M6.5 17.5h.01M13 13h.01m4.49 4.5h.01M17 21h4v-4m-7-.5V21m7-7h-4.5m-.9-4h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10Zm-11 0h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10Zm0 11h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21Z`}));Nc.displayName=`QrCode02`;var Pc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M20.453 12.893A8.5 8.5 0 0 1 4.638 16.25l-.25-.433m-.842-4.71A8.5 8.5 0 0 1 19.361 7.75l.25.433M3.493 18.066l.732-2.732 2.732.732m10.085-8.132 2.732.732.732-2.732`}));Pc.displayName=`RefreshCw05`;var Fc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M14 22H6.8m0 0c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2M6.8 22h.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C12 19.72 12 18.88 12 17.2v-.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C9.72 12 8.88 12 7.2 12h-.4c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 14.28 2 15.12 2 16.8v.4m0 0V10m8-8h4m8 8v4m-4 8c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C22 19.395 22 18.93 22 18m0-12c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.122-2.122C19.395 2 18.93 2 18 2M6 2c-.93 0-1.395 0-1.776.102a3 3 0 0 0-2.122 2.122C2 4.605 2 5.07 2 6`}));Fc.displayName=`Scale01`;var Ic=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z`}));Ic.displayName=`SearchMd`;var Lc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M4.5 22v-5m0-10V2M2 4.5h5m-5 15h5M13 3l-1.734 4.509c-.282.733-.423 1.1-.643 1.408a3 3 0 0 1-.706.707c-.308.219-.675.36-1.408.642L4 12l4.509 1.734c.733.282 1.1.423 1.408.643.273.194.512.433.707.706.219.308.36.675.642 1.408L13 21l1.734-4.509c.282-.733.423-1.1.643-1.408.194-.273.433-.512.706-.707.308-.219.675-.36 1.408-.642L22 12l-4.509-1.734c-.733-.282-1.1-.423-1.408-.642a3 3 0 0 1-.706-.707c-.22-.308-.36-.675-.643-1.408L13 3Z`}));Lc.displayName=`Stars02`;var Rc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M13 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v3.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 17 4.08 17 5.2 17H13m4-10h1.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 8.52 22 9.08 22 10.2v3.6c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C20.48 17 19.92 17 18.8 17H17m0 4V3m2.5 0h-5m5 18h-5`}));Rc.displayName=`TextInput`;var zc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M7 22V11m-5 2v7a2 2 0 0 0 2 2h13.426a3 3 0 0 0 2.965-2.544l1.077-7A3 3 0 0 0 18.503 9H15a1 1 0 0 1-1-1V4.466A2.466 2.466 0 0 0 11.534 2a.822.822 0 0 0-.75.488l-3.52 7.918A1 1 0 0 1 6.35 11H4a2 2 0 0 0-2 2Z`}));zc.displayName=`ThumbsUp`;var Bc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6m5 4.5v5m4-5v5`}));Bc.displayName=`Trash03`;var Vc=({size:e=24,color:t=`currentColor`,...n})=>s.createElement(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,stroke:t,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...n},s.createElement(`path`,{d:`M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6`}));Vc.displayName=`Trash04`;var Hc=()=>(0,l.jsx)(`svg`,{viewBox:`0 0 12 12`,focusable:`false`,"data-icon":`mixed-view`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z`})}),Uc=()=>(0,l.jsx)(`svg`,{viewBox:`0 0 12 12`,focusable:`false`,"data-icon":`landscape-view`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M1 3h10v6H1V3zm1 1v4h8V4H2z`})}),Wc=()=>(0,l.jsx)(`svg`,{viewBox:`0 0 12 12`,focusable:`false`,"data-icon":`portrait-view`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M3 1h6v10H3V1zm1 1v8h4V2H4z`})}),Gc=()=>(0,l.jsx)(`svg`,{viewBox:`0 0 12 12`,focusable:`false`,"data-icon":`square-view`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M1 1h10v10H1V1zm1 1v8h8V2H2z`})}),Kc=()=>(0,l.jsxs)(`svg`,{viewBox:`0 0 12 12`,focusable:`false`,"data-icon":`ai-icon`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,l.jsx)(`path`,{d:`M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z`}),(0,l.jsx)(`path`,{d:`M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z`}),(0,l.jsx)(`path`,{d:`M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z`}),(0,l.jsx)(`path`,{d:`M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z`})]}),qc=()=>(0,l.jsx)(`svg`,{viewBox:`0 0 12 12`,focusable:`false`,"data-icon":`light-mode`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M6 7.81819C6.50303 7.81819 6.93182 7.64092 7.28637 7.28637C7.64092 6.93182 7.81819 6.50303 7.81819 6C7.81819 5.49697 7.64092 5.06818 7.28637 4.71363C6.93182 4.35908 6.50303 4.18181 6 4.18181C5.49697 4.18181 5.06818 4.35908 4.71363 4.71363C4.35908 5.06818 4.18181 5.49697 4.18181 6C4.18181 6.50303 4.35908 6.93182 4.71363 7.28637C5.06818 7.64092 5.49697 7.81819 6 7.81819ZM6 8.72727C5.24545 8.72727 4.60227 8.46136 4.07045 7.92955C3.53864 7.39773 3.27273 6.75455 3.27273 6C3.27273 5.24545 3.53864 4.60227 4.07045 4.07045C4.60227 3.53864 5.24545 3.27273 6 3.27273C6.75455 3.27273 7.39773 3.53864 7.92955 4.07045C8.46136 4.60227 8.72727 5.24545 8.72727 6C8.72727 6.75455 8.46136 7.39773 7.92955 7.92955C7.39773 8.46136 6.75455 8.72727 6 8.72727ZM2.18182 6.45454H0V5.54546H2.18182V6.45454ZM12 6.45454H9.81818V5.54546H12V6.45454ZM5.54546 2.18182V0H6.45454V2.18182H5.54546ZM5.54546 12V9.81818H6.45454V12H5.54546ZM3 3.6091L1.63182 2.28637L2.28181 1.61819L3.5909 2.98182L3 3.6091ZM9.72727 10.3727L8.39546 9.00454L9.0091 8.38182L10.3682 9.71363L9.72727 10.3727ZM8.38182 2.9909L9.71363 1.63182L10.3818 2.27273L9.02727 3.6L8.38182 2.9909ZM1.62727 9.71819L2.98636 8.38636L3.61818 9.0091L2.28637 10.3682L1.62727 9.71819Z`})}),Jc=()=>(0,l.jsx)(`svg`,{viewBox:`0 0 12 12`,focusable:`false`,"data-icon":`dark-mode`,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M6 11C4.61111 11 3.43056 10.5139 2.45833 9.54167C1.48611 8.56944 1 7.38889 1 6C1 4.61111 1.48611 3.43056 2.45833 2.45833C3.43056 1.48611 4.61111 1 6 1C6.09259 1 6.1875 1.00309 6.28472 1.00926C6.38194 1.01543 6.49382 1.02469 6.62036 1.03704C6.2716 1.32408 5.99769 1.68442 5.79861 2.11806C5.59954 2.55169 5.5 3.01234 5.5 3.5C5.5 4.33333 5.79167 5.04167 6.375 5.625C6.95833 6.20833 7.66667 6.5 8.5 6.5C8.99074 6.5 9.45216 6.40509 9.88426 6.21528C10.3164 6.02546 10.6759 5.76544 10.963 5.43519C10.9753 5.54939 10.9846 5.65047 10.9907 5.73843C10.9969 5.82639 11 5.91358 11 6C11 7.38889 10.5139 8.56944 9.54167 9.54167C8.56944 10.5139 7.38889 11 6 11ZM6 10.0741C6.94444 10.0741 7.77469 9.7909 8.49075 9.22454C9.20681 8.65818 9.67594 7.97376 9.89815 7.17129C9.68211 7.25463 9.45474 7.3179 9.21606 7.36111C8.97737 7.40431 8.73869 7.42592 8.5 7.42592C7.41242 7.42592 6.4862 7.0435 5.72135 6.27865C4.9565 5.5138 4.57408 4.58758 4.57408 3.5C4.57408 3.29012 4.59414 3.06944 4.63426 2.83796C4.67438 2.60648 4.74229 2.35185 4.83797 2.07407C3.99229 2.3395 3.29552 2.83487 2.74768 3.56018C2.19984 4.28549 1.92592 5.09876 1.92592 6C1.92592 7.12963 2.32252 8.09105 3.11574 8.88426C3.90895 9.67748 4.87037 10.0741 6 10.0741Z`})}),Yc=()=>(0,l.jsxs)(`svg`,{width:`64`,height:`64`,viewBox:`0 0 64 64`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`path`,{opacity:`0.5`,d:`M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z`,fill:`#91CAFF`}),(0,l.jsx)(`path`,{d:`M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z`,fill:`#2884FF`}),(0,l.jsx)(`path`,{d:`M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z`,stroke:`#2884FF`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),Xc=()=>(0,l.jsxs)(`svg`,{width:`64`,height:`64`,viewBox:`0 0 64 64`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`path`,{opacity:`0.5`,d:`M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z`,fill:`#91CAFF`}),(0,l.jsx)(`path`,{d:`M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z`,stroke:`currentColor`}),(0,l.jsx)(`path`,{d:`M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),Zc=()=>(0,l.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,l.jsx)(`path`,{d:`M10.8337 5.83333L9.90404 3.9741C9.6365 3.439 9.50271 3.17144 9.30313 2.97597C9.12664 2.80311 8.91393 2.67164 8.68039 2.59109C8.4163 2.5 8.11716 2.5 7.5189 2.5H4.33366C3.40024 2.5 2.93353 2.5 2.57701 2.68166C2.2634 2.84144 2.00844 3.09641 1.84865 3.41002C1.66699 3.76654 1.66699 4.23325 1.66699 5.16667V5.83333M1.66699 5.83333H14.3337C15.7338 5.83333 16.4339 5.83333 16.9686 6.10582C17.439 6.3455 17.8215 6.72795 18.0612 7.19836C18.3337 7.73314 18.3337 8.4332 18.3337 9.83333V13.5C18.3337 14.9001 18.3337 15.6002 18.0612 16.135C17.8215 16.6054 17.439 16.9878 16.9686 17.2275C16.4339 17.5 15.7338 17.5 14.3337 17.5H5.66699C4.26686 17.5 3.5668 17.5 3.03202 17.2275C2.56161 16.9878 2.17916 16.6054 1.93948 16.135C1.66699 15.6002 1.66699 14.9001 1.66699 13.5V5.83333Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Qc=()=>(0,l.jsx)(`svg`,{width:`48`,height:`49`,viewBox:`0 0 48 49`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,l.jsx)(`path`,{d:`M32 24.5L24 16.5M24 16.5L16 24.5M24 16.5V34.9C24 37.6814 24 39.0721 25.101 40.6292C25.8326 41.6638 27.9388 42.9406 29.1944 43.1108C31.0842 43.3668 31.8019 42.9924 33.2371 42.2437C39.6333 38.9071 44 32.2135 44 24.5C44 13.4543 35.0457 4.5 24 4.5C12.9543 4.5 4 13.4543 4 24.5C4 31.9028 8.02199 38.3663 14 41.8244`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,strokeLinejoin:`round`})}),$c=()=>(0,l.jsxs)(`svg`,{width:`56`,height:`56`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{width:`56`,height:`56`,rx:`24`,fill:`#8946FB`}),(0,l.jsx)(`path`,{d:`M28 36.4722C29.0615 37.4223 30.4633 38 32 38C35.3137 38 38 35.3137 38 32C38 29.2331 36.1271 26.9036 33.5798 26.2102M22.4202 26.2102C19.8729 26.9036 18 29.2331 18 32C18 35.3137 20.6863 38 24 38C27.3137 38 30 35.3137 30 32C30 31.2195 29.851 30.4738 29.5798 29.7898M34 24C34 27.3137 31.3137 30 28 30C24.6863 30 22 27.3137 22 24C22 20.6863 24.6863 18 28 18C31.3137 18 34 20.6863 34 24Z`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),el=()=>(0,l.jsxs)(`svg`,{width:`56`,height:`56`,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`rect`,{width:`56`,height:`56`,rx:`24`,fill:`#7ED846`}),(0,l.jsx)(`path`,{d:`M20.5 38V33M20.5 23V18M18 20.5H23M18 35.5H23M29 19L27.2658 23.5089C26.9838 24.2421 26.8428 24.6087 26.6235 24.9171C26.4292 25.1904 26.1904 25.4292 25.9171 25.6235C25.6087 25.8428 25.2421 25.9838 24.5089 26.2658L20 28L24.5089 29.7342C25.2421 30.0162 25.6087 30.1572 25.9171 30.3765C26.1904 30.5708 26.4292 30.8096 26.6235 31.0829C26.8428 31.3913 26.9838 31.7579 27.2658 32.4911L29 37L30.7342 32.4911C31.0162 31.7579 31.1572 31.3913 31.3765 31.0829C31.5708 30.8096 31.8096 30.5708 32.0829 30.3765C32.3913 30.1572 32.7579 30.0162 33.4911 29.7342L38 28L33.4911 26.2658C32.7579 25.9838 32.3913 25.8428 32.0829 25.6235C31.8096 25.4292 31.5708 25.1904 31.3765 24.9171C31.1572 24.6087 31.0162 24.2421 30.7342 23.5089L29 19Z`,stroke:`white`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),tl=()=>(0,l.jsxs)(`svg`,{width:`48`,height:`49`,viewBox:`0 0 48 49`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,l.jsx)(`path`,{d:`M19 18.4307C19 17.4761 19 16.9988 19.1995 16.7324C19.3733 16.5001 19.6394 16.3549 19.9288 16.3342C20.2608 16.3105 20.6622 16.5686 21.4652 17.0848L30.9064 23.1541C31.6032 23.602 31.9516 23.826 32.0719 24.1108C32.177 24.3596 32.177 24.6404 32.0719 24.8892C31.9516 25.174 31.6032 25.398 30.9064 25.8459L21.4652 31.9152C20.6622 32.4314 20.2608 32.6895 19.9288 32.6658C19.6394 32.6451 19.3733 32.4998 19.1995 32.2676C19 32.0012 19 31.5239 19 30.5693V18.4307Z`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,l.jsx)(`path`,{d:`M6 16.1C6 12.7397 6 11.0595 6.65396 9.77606C7.2292 8.64708 8.14708 7.7292 9.27606 7.15396C10.5595 6.5 12.2397 6.5 15.6 6.5H32.4C35.7603 6.5 37.4405 6.5 38.7239 7.15396C39.8529 7.7292 40.7708 8.64708 41.346 9.77606C42 11.0595 42 12.7397 42 16.1V32.9C42 36.2603 42 37.9405 41.346 39.2239C40.7708 40.3529 39.8529 41.2708 38.7239 41.846C37.4405 42.5 35.7603 42.5 32.4 42.5H15.6C12.2397 42.5 10.5595 42.5 9.27606 41.846C8.14708 41.2708 7.2292 40.3529 6.65396 39.2239C6 37.9405 6 36.2603 6 32.9V16.1Z`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),nl=()=>(0,l.jsx)(`svg`,{width:`48`,height:`49`,viewBox:`0 0 48 49`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,l.jsx)(`path`,{d:`M24 41.4444C26.123 43.3446 28.9266 44.5 32 44.5C38.6274 44.5 44 39.1274 44 32.5C44 26.9662 40.2541 22.3072 35.1596 20.9203M12.8404 20.9203C7.74587 22.3072 4 26.9661 4 32.5C4 39.1274 9.37258 44.5 16 44.5C22.6274 44.5 28 39.1274 28 32.5C28 30.939 27.7019 29.4476 27.1596 28.0797M36 16.5C36 23.1274 30.6274 28.5 24 28.5C17.3726 28.5 12 23.1274 12 16.5C12 9.87258 17.3726 4.5 24 4.5C30.6274 4.5 36 9.87258 36 16.5Z`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,strokeLinejoin:`round`})}),rl=e=>(0,l.jsx)(m.default,Object.assign({component:Hc},e)),il=e=>(0,l.jsx)(m.default,Object.assign({component:Uc},e)),al=e=>(0,l.jsx)(m.default,Object.assign({component:Wc},e)),ol=e=>(0,l.jsx)(m.default,Object.assign({component:Gc},e)),sl=e=>(0,l.jsx)(m.default,Object.assign({component:Kc},e)),cl=e=>(0,l.jsx)(m.default,Object.assign({component:qc},e)),ll=e=>(0,l.jsx)(m.default,Object.assign({component:Jc},e)),ul=e=>(0,l.jsx)(m.default,Object.assign({component:Yc},e)),dl=e=>(0,l.jsx)(m.default,Object.assign({component:Xc},e)),fl=e=>(0,l.jsx)(m.default,Object.assign({component:Zc},e)),pl=e=>(0,l.jsx)(m.default,Object.assign({component:Qc},e)),ml=e=>(0,l.jsx)(m.default,Object.assign({component:$c},e)),hl=e=>(0,l.jsx)(m.default,Object.assign({component:el},e)),gl=e=>(0,l.jsx)(m.default,Object.assign({component:tl},e)),_l=e=>(0,l.jsx)(m.default,Object.assign({component:nl},e)),vl=(0,s.createContext)({state:{},actions:{},options:{}}),yl=()=>(0,s.useContext)(vl),bl=({children:e,options:t})=>{let[n,r]=(0,s.useState)([]),[i,a]=(0,s.useState)([]),[o,c]=(0,s.useState)(null),[d,f]=(0,s.useState)(t.searchQuery||``),[p,m]=(0,s.useState)(t.sortBySize||`name`),{config:h}=t,g=(0,s.useCallback)(e=>{if(e===Ya){let e=!1!==h?.features?.enableGif,t=!h?.enabledTabs||h.enabledTabs.includes(`gif`);return e&&t}if(e===Xa){let e=!1!==h?.features?.enableStockImages,t=!h?.enabledTabs||h.enabledTabs.includes(`stock`);return e&&t}if(e===Za){let e=!1!==h?.features?.enableIconStock,t=!h?.enabledTabs||h.enabledTabs.includes(`icons`);return e&&t}if(e===$a){let e=!1!==h?.features?.enableQrBarcodeTab,t=!h?.enabledTabs||h.enabledTabs.includes(`codes`);return e&&t}return!0},[h?.enabledTabs,h?.features?.enableGif,h?.features?.enableIconStock,h?.features?.enableStockImages,h?.features?.enableQrBarcodeTab]),[_,v]=(0,s.useState)(`date`),[y,b]=(0,s.useState)(`desc`),[x,S]=(0,s.useState)([{id:`folders`,name:`Папки`}]),[C,w]=(0,s.useState)(``),[T,E]=(0,s.useState)(!1),[D,O]=(0,s.useState)(Ja);(0,s.useEffect)(()=>{h!=null&&h.activeLibraryItem&&O&&O(g(h.activeLibraryItem)?h.activeLibraryItem:Ja)},[h?.activeLibraryItem,g,O]),(0,s.useEffect)(()=>{g(D)||O(Ja)},[D,g]);let[k,A]=(0,s.useState)({current:1,pageSize:20,total:0}),[j]=u.Form.useForm(),[M]=u.Form.useForm(),[N]=u.Form.useForm(),[P]=u.Form.useForm(),[F]=u.Form.useForm(),[I]=u.Form.useForm(),[L,R]=(0,s.useState)(!1),[z,ee]=(0,s.useState)(!1),[B,te]=(0,s.useState)(!1),[ne,re]=(0,s.useState)(!1),[ie,ae]=(0,s.useState)(!1),[oe,se]=(0,s.useState)(!1),[ce,le]=(0,s.useState)(!1),[ue,de]=(0,s.useState)(null),[fe,pe]=(0,s.useState)(null),[me,he]=(0,s.useState)(null),ge=(e,t)=>{S(n=>n.map(n=>n.id===e?Object.assign(Object.assign({},n),{name:t}):n))},_e=(0,s.useCallback)(e=>{A(t=>Object.assign(Object.assign({},t),e))},[A]),ve=(0,s.useMemo)(()=>{var e;return{folders:n,files:i,selectedFolder:o,searchTerm:d,sortField:p,sortBy:_,sortOrder:y,pathHistory:x,currentMenuFile:C,loading:T,pagination:k,isModalVisible:L,isUrlModalVisible:z,isRenameModalVisible:B,isMoveModalVisible:ne,isRenameFolderModalVisible:ie,isCopyModalVisible:oe,isDeleteConfirmVisible:ce,form:j,urlForm:M,renameForm:N,moveForm:P,renameFolderForm:F,copyForm:I,fileToRename:ue,folderToRename:fe,activeLibraryItem:D,multiSelect:(e=h?.multiSelect)==null||e,undoDeletion:me}},[D,h?.multiSelect,I,C,ue,i,n,j,oe,ce,L,ne,ie,B,z,T,P,k,x,F,N,d,o,_,p,y,me,M,fe]),ye=(0,s.useMemo)(()=>({setFolders:r,setFiles:a,setSelectedFolder:c,setSearchTerm:f,setSortField:m,setSortBy:v,setSortOrder:b,setPathHistory:S,setLoading:E,setPagination:_e,setIsModalVisible:R,setIsUrlModalVisible:ee,setIsRenameModalVisible:te,setIsMoveModalVisible:re,setIsRenameFolderModalVisible:ae,setIsCopyModalVisible:se,setIsDeleteConfirmVisible:le,setFileToRename:de,setFolderToRename:pe,setUndoDeletion:he,updatePathHistoryOnFolderRename:ge,setActiveLibraryItem:e=>O(g(e)?e:Ja),setCurrentMenuFile:w}),[_e,g]),be=(0,s.useMemo)(()=>({state:ve,actions:ye,options:t}),[ye,t,ve]);return(0,l.jsx)(vl.Provider,{value:be,children:e})},xl=()=>{let{options:e}=yl(),{customIcons:t}=e,n=s.default.useCallback((e,n,r)=>{let i=t?.[e];return i?s.default.createElement(i,r):s.default.createElement(n,r)},[t]);return s.default.useMemo(()=>({RootFolderIcon:e=>n(`rootFolder`,m.FolderOutlined,e),FolderIcon:e=>n(`folder`,ul,e),FolderOpenIcon:e=>n(`folderOpen`,m.FolderOpenOutlined,e),AddFolderIcon:e=>n(`addFolder`,m.FolderAddOutlined,e),FileIcon:e=>n(`file`,m.FileOutlined,e),UploadIcon:e=>n(`upload`,m.UploadOutlined,e),UploadByUrlIcon:e=>n(`uploadByUrl`,m.LinkOutlined,e),ExpandArrowIcon:e=>n(`expandArrow`,m.RightOutlined,e),CollapseArrowIcon:e=>n(`collapseArrow`,m.DownOutlined,e),ExpandFolderIcon:e=>n(`expandArrow`,Tc,e),CollapseFolderIcon:e=>n(`collapseArrow`,wc,e),FolderPreviewIcon:e=>n(`folderPreview`,dl,e),EmptyFolderIcon:e=>n(`folderPreview`,fl,e),GridViewIcon:e=>n(`gridView`,m.AppstoreOutlined,e),ListViewIcon:e=>n(`listView`,m.BarsOutlined,e),DropZoneFileIcon:e=>n(`folderPreview`,pl,e),BigStockIcon:e=>n(`folderPreview`,ml,e),BigAIIcon:e=>n(`folderPreview`,hl,e),GifPlayIcon:e=>n(`folderPreview`,gl,e),StockBigIcon:e=>n(`folderPreview`,_l,e),MixedViewIcon:e=>n(`mixedView`,rl,e),LandscapeViewIcon:e=>n(`landscapeView`,il,e),PortraitViewIcon:e=>n(`portraitView`,al,e),SquareViewIcon:e=>n(`squareView`,ol,e),LightModeIcon:e=>n(`lightMode`,cl,e),DarkModeIcon:e=>n(`darkMode`,ll,e),AiIcon_2:e=>n(`aiIcon_2`,sl,e),NoFilesIcon:e=>n(`noFiles`,Ec,e),ThumbsUpIcon:e=>n(`thumbsUp`,zc,e),getCustomIcon:n}),[n])},Sl=`noFilesContainer`,Cl=`noFilesImage`,wl=`noFilesTitle`,Tl=`noFilesDescription`,El=()=>{let{t:e}=Ks(),{NoFilesIcon:t}=xl();return(0,l.jsxs)(`div`,{className:Sl,children:[(0,l.jsx)(t,{className:Cl,size:48,strokeWidth:1.4}),(0,l.jsx)(`h2`,{className:wl,children:e(`There's nothing here`)}),(0,l.jsx)(`div`,{className:Tl,children:e(`Try using a different search query.`)})]})},Dl,Ol={exports:{}},kl=Ol.exports,Al=(Dl||(Dl=1,function(e,t){(function(){var n,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=`__lodash_placeholder__`,o=32,s=128,c=256,l=1/0,u=9007199254740991,d=NaN,f=4294967295,p=[[`ary`,s],[`bind`,1],[`bindKey`,2],[`curry`,8],[`curryRight`,16],[`flip`,512],[`partial`,o],[`partialRight`,64],[`rearg`,c]],m=`[object Arguments]`,h=`[object Array]`,g=`[object Boolean]`,_=`[object Date]`,v=`[object Error]`,y=`[object Function]`,b=`[object GeneratorFunction]`,x=`[object Map]`,S=`[object Number]`,C=`[object Object]`,w=`[object Promise]`,T=`[object RegExp]`,E=`[object Set]`,D=`[object String]`,O=`[object Symbol]`,k=`[object WeakMap]`,A=`[object ArrayBuffer]`,j=`[object DataView]`,M=`[object Float32Array]`,N=`[object Float64Array]`,P=`[object Int8Array]`,F=`[object Int16Array]`,I=`[object Int32Array]`,L=`[object Uint8Array]`,R=`[object Uint8ClampedArray]`,z=`[object Uint16Array]`,ee=`[object Uint32Array]`,B=/\b__p \+= '';/g,te=/\b(__p \+=) '' \+/g,ne=/(__e\(.*?\)|\b__t\)) \+\n'';/g,re=/&(?:amp|lt|gt|quot|#39);/g,ie=/[&<>"']/g,ae=RegExp(re.source),oe=RegExp(ie.source),se=/<%-([\s\S]+?)%>/g,ce=/<%([\s\S]+?)%>/g,le=/<%=([\s\S]+?)%>/g,ue=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,de=/^\w*$/,fe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pe=/[\\^$.*+?()[\]{}|]/g,me=RegExp(pe.source),he=/^\s+/,ge=/\s/,_e=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ve=/\{\n\/\* \[wrapped with (.+)\] \*/,ye=/,? & /,be=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xe=/[()=,{}\[\]\/\s]/,Se=/\\(\\)?/g,Ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,we=/\w*$/,Te=/^[-+]0x[0-9a-f]+$/i,Ee=/^0b[01]+$/i,De=/^\[object .+?Constructor\]$/,Oe=/^0o[0-7]+$/i,ke=/^(?:0|[1-9]\d*)$/,Ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,je=/($^)/,Me=/['\n\r\u2028\u2029\\]/g,Ne=`\\ud800-\\udfff`,Pe=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Fe=`\\u2700-\\u27bf`,Ie=`a-z\\xdf-\\xf6\\xf8-\\xff`,Le=`A-Z\\xc0-\\xd6\\xd8-\\xde`,Re=`\\ufe0e\\ufe0f`,ze=`\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,Be=`['’]`,Ve=`[`+Ne+`]`,He=`[`+ze+`]`,Ue=`[`+Pe+`]`,We=`\\d+`,Ge=`[`+Fe+`]`,Ke=`[`+Ie+`]`,qe=`[^`+Ne+ze+We+Fe+Ie+Le+`]`,Je=`\\ud83c[\\udffb-\\udfff]`,Ye=`[^`+Ne+`]`,Xe=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Ze=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Qe=`[`+Le+`]`,$e=`\\u200d`,et=`(?:`+Ke+`|`+qe+`)`,tt=`(?:`+Qe+`|`+qe+`)`,nt=`(?:['’](?:d|ll|m|re|s|t|ve))?`,rt=`(?:['’](?:D|LL|M|RE|S|T|VE))?`,it=`(?:`+Ue+`|`+Je+`)?`,at=`[`+Re+`]?`,ot=at+it+`(?:`+$e+`(?:`+[Ye,Xe,Ze].join(`|`)+`)`+at+it+`)*`,st=`(?:`+[Ge,Xe,Ze].join(`|`)+`)`+ot,ct=`(?:`+[Ye+Ue+`?`,Ue,Xe,Ze,Ve].join(`|`)+`)`,lt=RegExp(Be,`g`),ut=RegExp(Ue,`g`),dt=RegExp(Je+`(?=`+Je+`)|`+ct+ot,`g`),ft=RegExp([Qe+`?`+Ke+`+`+nt+`(?=`+[He,Qe,`$`].join(`|`)+`)`,tt+`+`+rt+`(?=`+[He,Qe+et,`$`].join(`|`)+`)`,Qe+`?`+et+`+`+nt,Qe+`+`+rt,`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,We,st].join(`|`),`g`),pt=RegExp(`[`+$e+Ne+Pe+Re+`]`),mt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ht=`Array.Buffer.DataView.Date.Error.Float32Array.Float64Array.Function.Int8Array.Int16Array.Int32Array.Map.Math.Object.Promise.RegExp.Set.String.Symbol.TypeError.Uint8Array.Uint8ClampedArray.Uint16Array.Uint32Array.WeakMap._.clearTimeout.isFinite.parseInt.setTimeout`.split(`.`),gt=-1,_t={};_t[M]=_t[N]=_t[P]=_t[F]=_t[I]=_t[L]=_t[R]=_t[z]=_t[ee]=!0,_t[m]=_t[h]=_t[A]=_t[g]=_t[j]=_t[_]=_t[v]=_t[y]=_t[x]=_t[S]=_t[C]=_t[T]=_t[E]=_t[D]=_t[k]=!1;var vt={};vt[m]=vt[h]=vt[A]=vt[j]=vt[g]=vt[_]=vt[M]=vt[N]=vt[P]=vt[F]=vt[I]=vt[x]=vt[S]=vt[C]=vt[T]=vt[E]=vt[D]=vt[O]=vt[L]=vt[R]=vt[z]=vt[ee]=!0,vt[v]=vt[y]=vt[k]=!1;var yt={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},bt=parseFloat,xt=parseInt,St=typeof Os==`object`&&Os&&Os.Object===Object&&Os,Ct=typeof self==`object`&&self&&self.Object===Object&&self,wt=St||Ct||Function(`return this`)(),Tt=t&&!t.nodeType&&t,Et=Tt&&e&&!e.nodeType&&e,Dt=Et&&Et.exports===Tt,Ot=Dt&&St.process,kt=function(){try{return Et&&Et.require&&Et.require(`util`).types||Ot&&Ot.binding&&Ot.binding(`util`)}catch{}}(),At=kt&&kt.isArrayBuffer,jt=kt&&kt.isDate,Mt=kt&&kt.isMap,Nt=kt&&kt.isRegExp,Pt=kt&&kt.isSet,Ft=kt&&kt.isTypedArray;function It(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Lt(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function Rt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function zt(e,t){for(var n=e==null?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Bt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Vt(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Ht(e,t){return!(e==null||!e.length)&&Qt(e,t,0)>-1}function Ut(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Wt(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Gt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Kt(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function qt(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Jt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Yt=nn(`length`);function Xt(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Zt(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Qt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Zt(e,en,n)}function $t(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function en(e){return e!=e}function tn(e,t){var n=e==null?0:e.length;return n?on(e,t)/n:d}function nn(e){return function(t){return t==null?n:t[e]}}function rn(e){return function(t){return e==null?n:e[t]}}function an(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function on(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function sn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function cn(e){return e&&e.slice(0,Tn(e)+1).replace(he,``)}function ln(e){return function(t){return e(t)}}function un(e,t){return Wt(t,function(t){return e[t]})}function dn(e,t){return e.has(t)}function fn(e,t){for(var n=-1,r=e.length;++n<r&&Qt(t,e[n],0)>-1;);return n}function pn(e,t){for(var n=e.length;n--&&Qt(t,e[n],0)>-1;);return n}var mn=rn({À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`}),hn=rn({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`});function gn(e){return`\\`+yt[e]}function _n(e){return pt.test(e)}function vn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function yn(e,t){return function(n){return e(t(n))}}function bn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function xn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Sn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Cn(e){return _n(e)?function(e){for(var t=dt.lastIndex=0;dt.test(e);)++t;return t}(e):Yt(e)}function wn(e){return _n(e)?function(e){return e.match(dt)||[]}(e):function(e){return e.split(``)}(e)}function Tn(e){for(var t=e.length;t--&&ge.test(e.charAt(t)););return t}var En=rn({"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&quot;":`"`,"&#39;":`'`}),Dn=function e(t){var ge,Ne=(t=t==null?wt:Dn.defaults(wt.Object(),t,Dn.pick(wt,ht))).Array,Pe=t.Date,Fe=t.Error,Ie=t.Function,Le=t.Math,Re=t.Object,ze=t.RegExp,Be=t.String,Ve=t.TypeError,He=Ne.prototype,Ue=Ie.prototype,We=Re.prototype,Ge=t[`__core-js_shared__`],Ke=Ue.toString,qe=We.hasOwnProperty,Je=0,Ye=(ge=/[^.]+$/.exec(Ge&&Ge.keys&&Ge.keys.IE_PROTO||``))?`Symbol(src)_1.`+ge:``,Xe=We.toString,Ze=Ke.call(Re),Qe=wt._,$e=ze(`^`+Ke.call(qe).replace(pe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),et=Dt?t.Buffer:n,tt=t.Symbol,nt=t.Uint8Array,rt=et?et.allocUnsafe:n,it=yn(Re.getPrototypeOf,Re),at=Re.create,ot=We.propertyIsEnumerable,st=He.splice,ct=tt?tt.isConcatSpreadable:n,dt=tt?tt.iterator:n,pt=tt?tt.toStringTag:n,yt=function(){try{var e=xa(Re,`defineProperty`);return e({},``,{}),e}catch{}}(),St=t.clearTimeout!==wt.clearTimeout&&t.clearTimeout,Ct=Pe&&Pe.now!==wt.Date.now&&Pe.now,Tt=t.setTimeout!==wt.setTimeout&&t.setTimeout,Et=Le.ceil,Ot=Le.floor,kt=Re.getOwnPropertySymbols,Yt=et?et.isBuffer:n,rn=t.isFinite,On=He.join,kn=yn(Re.keys,Re),An=Le.max,jn=Le.min,Mn=Pe.now,Nn=t.parseInt,Pn=Le.random,Fn=He.reverse,In=xa(t,`DataView`),Ln=xa(t,`Map`),Rn=xa(t,`Promise`),zn=xa(t,`Set`),Bn=xa(t,`WeakMap`),Vn=xa(Re,`create`),Hn=Bn&&new Bn,Un={},Wn=qa(In),Gn=qa(Ln),Kn=qa(Rn),qn=qa(zn),Jn=qa(Bn),Yn=tt?tt.prototype:n,Xn=Yn?Yn.valueOf:n,Zn=Yn?Yn.toString:n;function V(e){if(ds(e)&&!es(e)&&!(e instanceof tr)){if(e instanceof er)return e;if(qe.call(e,`__wrapped__`))return Ja(e)}return new er(e)}var Qn=function(){function e(){}return function(t){if(!us(t))return{};if(at)return at(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function $n(){}function er(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function tr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function nr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function rr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ir(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ar(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ir;++t<n;)this.add(e[t])}function or(e){var t=this.__data__=new rr(e);this.size=t.size}function sr(e,t){var n=es(e),r=!n&&$o(e),i=!n&&!r&&is(e),a=!n&&!r&&!i&&ys(e),o=n||r||i||a,s=o?sn(e.length,Be):[],c=s.length;for(var l in e)!t&&!qe.call(e,l)||o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Oa(l,c))||s.push(l);return s}function cr(e){var t=e.length;return t?e[ai(0,t-1)]:n}function lr(e,t){return Wa(Bi(e),vr(t,0,e.length))}function ur(e){return Wa(Bi(e))}function dr(e,t,r){(r!==n&&!Xo(e[t],r)||r===n&&!(t in e))&&gr(e,t,r)}function fr(e,t,r){var i=e[t];qe.call(e,t)&&Xo(i,r)&&(r!==n||t in e)||gr(e,t,r)}function pr(e,t){for(var n=e.length;n--;)if(Xo(e[n][0],t))return n;return-1}function mr(e,t,n,r){return Cr(e,function(e,i,a){t(r,e,n(e),a)}),r}function hr(e,t){return e&&Vi(t,Bs(t),e)}function gr(e,t,n){t==`__proto__`&&yt?yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function _r(e,t){for(var r=-1,i=t.length,a=Ne(i),o=e==null;++r<i;)a[r]=o?n:Fs(e,t[r]);return a}function vr(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function yr(e,t,r,i,a,o){var s,c=1&t,l=2&t,u=4&t;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!us(e))return e;var d=es(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&qe.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}(e),!c)return Bi(e,s)}else{var f=wa(e),p=f==y||f==b;if(is(e))return Pi(e,c);if(f==C||f==m||p&&!a){if(s=l||p?{}:Ea(e),!c)return l?function(e,t){return Vi(e,Ca(e),t)}(e,function(e,t){return e&&Vi(t,Vs(t),e)}(s,e)):function(e,t){return Vi(e,Sa(e),t)}(e,hr(s,e))}else{if(!vt[f])return a?e:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case A:return Fi(e);case g:case _:return new i(+e);case j:return function(e,t){var n=t?Fi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case N:case P:case F:case I:case L:case R:case z:case ee:return Ii(e,n);case x:return new i;case S:case D:return new i(e);case T:return function(e){var t=new e.constructor(e.source,we.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new i;case O:return r=e,Xn?Re(Xn.call(r)):{}}}(e,f,c)}}o||=new or;var h=o.get(e);if(h)return h;o.set(e,s),gs(e)?e.forEach(function(n){s.add(yr(n,t,r,n,e,o))}):fs(e)&&e.forEach(function(n,i){s.set(i,yr(n,t,r,i,e,o))});var v=d?n:(u?l?ha:ma:l?Vs:Bs)(e);return Rt(v||e,function(n,i){v&&(n=e[i=n]),fr(s,i,yr(n,t,r,i,e,o))}),s}function br(e,t,r){var i=r.length;if(e==null)return!i;for(e=Re(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function xr(e,t,i){if(typeof e!=`function`)throw new Ve(r);return Ba(function(){e.apply(n,i)},t)}function Sr(e,t,n,r){var i=-1,a=Ht,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=Wt(t,ln(n))),r?(a=Ut,o=!1):t.length>=200&&(a=dn,o=!1,t=new ar(t));e:for(;++i<s;){var u=e[i],d=n==null?u:n(u);if(u=r||u!==0?u:0,o&&d==d){for(var f=l;f--;)if(t[f]===d)continue e;c.push(u)}else a(t,d,r)||c.push(u)}return c}V.templateSettings={escape:se,evaluate:ce,interpolate:le,variable:``,imports:{_:V}},V.prototype=$n.prototype,V.prototype.constructor=V,er.prototype=Qn($n.prototype),er.prototype.constructor=er,tr.prototype=Qn($n.prototype),tr.prototype.constructor=tr,nr.prototype.clear=function(){this.__data__=Vn?Vn(null):{},this.size=0},nr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t},nr.prototype.get=function(e){var t=this.__data__;if(Vn){var r=t[e];return r===i?n:r}return qe.call(t,e)?t[e]:n},nr.prototype.has=function(e){var t=this.__data__;return Vn?t[e]!==n:qe.call(t,e)},nr.prototype.set=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=Vn&&t===n?i:t,this},rr.prototype.clear=function(){this.__data__=[],this.size=0},rr.prototype.delete=function(e){var t=this.__data__,n=pr(t,e);return!(n<0||(n==t.length-1?t.pop():st.call(t,n,1),--this.size,0))},rr.prototype.get=function(e){var t=this.__data__,r=pr(t,e);return r<0?n:t[r][1]},rr.prototype.has=function(e){return pr(this.__data__,e)>-1},rr.prototype.set=function(e,t){var n=this.__data__,r=pr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ir.prototype.clear=function(){this.size=0,this.__data__={hash:new nr,map:new(Ln||rr),string:new nr}},ir.prototype.delete=function(e){var t=ya(this,e).delete(e);return this.size-=+!!t,t},ir.prototype.get=function(e){return ya(this,e).get(e)},ir.prototype.has=function(e){return ya(this,e).has(e)},ir.prototype.set=function(e,t){var n=ya(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ar.prototype.add=ar.prototype.push=function(e){return this.__data__.set(e,i),this},ar.prototype.has=function(e){return this.__data__.has(e)},or.prototype.clear=function(){this.__data__=new rr,this.size=0},or.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},or.prototype.get=function(e){return this.__data__.get(e)},or.prototype.has=function(e){return this.__data__.has(e)},or.prototype.set=function(e,t){var n=this.__data__;if(n instanceof rr){var r=n.__data__;if(!Ln||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ir(r)}return n.set(e,t),this.size=n.size,this};var Cr=Wi(jr),wr=Wi(Mr,!0);function Tr(e,t){var n=!0;return Cr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function Er(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s==s&&!vs(s):r(s,c)))var c=s,l=o}return l}function Dr(e,t){var n=[];return Cr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function Or(e,t,n,r,i){var a=-1,o=e.length;for(n||=Da,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?Or(s,t-1,n,r,i):Gt(i,s):r||(i[i.length]=s)}return i}var kr=Gi(),Ar=Gi(!0);function jr(e,t){return e&&kr(e,t,Bs)}function Mr(e,t){return e&&Ar(e,t,Bs)}function Nr(e,t){return Vt(t,function(t){return ss(e[t])})}function Pr(e,t){for(var r=0,i=(t=Ai(t,e)).length;e!=null&&r<i;)e=e[Ka(t[r++])];return r&&r==i?e:n}function Fr(e,t,n){var r=t(e);return es(e)?r:Gt(r,n(e))}function Ir(e){return e==null?e===n?`[object Undefined]`:`[object Null]`:pt&&pt in Re(e)?function(e){var t=qe.call(e,pt),r=e[pt];try{e[pt]=n;var i=!0}catch{}var a=Xe.call(e);return i&&(t?e[pt]=r:delete e[pt]),a}(e):function(e){return Xe.call(e)}(e)}function Lr(e,t){return e>t}function Rr(e,t){return e!=null&&qe.call(e,t)}function zr(e,t){return e!=null&&t in Re(e)}function Br(e,t,r){for(var i=r?Ut:Ht,a=e[0].length,o=e.length,s=o,c=Ne(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Wt(d,ln(t))),l=jn(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new ar(s&&d):n}d=e[0];var f=-1,p=c[0];e:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?dn(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?dn(g,h):i(e[s],h,r)))continue e}p&&p.push(h),u.push(m)}}return u}function Vr(e,t,r){var i=(e=La(e,t=Ai(t,e)))==null?e:e[Ka(ao(t))];return i==null?n:It(i,e,r)}function Hr(e){return ds(e)&&Ir(e)==m}function Ur(e,t,r,i,a){return e===t||(e==null||t==null||!ds(e)&&!ds(t)?e!=e&&t!=t:function(e,t,r,i,a,o){var s=es(e),c=es(t),l=s?h:wa(e),u=c?h:wa(t),d=(l=l==m?C:l)==C,f=(u=u==m?C:u)==C,p=l==u;if(p&&is(e)){if(!is(t))return!1;s=!0,d=!1}if(p&&!d)return o||=new or,s||ys(e)?fa(e,t,r,i,a,o):function(e,t,n,r,i,a,o){switch(n){case j:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!a(new nt(e),new nt(t)));case g:case _:case S:return Xo(+e,+t);case v:return e.name==t.name&&e.message==t.message;case T:case D:return e==t+``;case x:var s=vn;case E:var c=1&r;if(s||=xn,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var u=fa(s(e),s(t),r,i,a,o);return o.delete(e),u;case O:if(Xn)return Xn.call(e)==Xn.call(t)}return!1}(e,t,l,r,i,a,o);if(!(1&r)){var y=d&&qe.call(e,`__wrapped__`),b=f&&qe.call(t,`__wrapped__`);if(y||b){var w=y?e.value():e,k=b?t.value():t;return o||=new or,a(w,k,r,i,o)}}return!!p&&(o||=new or,function(e,t,r,i,a,o){var s=1&r,c=ma(e),l=c.length;if(l!=ma(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:qe.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var h=s;++u<l;){var g=e[d=c[u]],_=t[d];if(i)var v=s?i(_,g,d,t,e,o):i(g,_,d,e,t,o);if(!(v===n?g===_||a(g,_,r,i,o):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=t.constructor;y==b||!(`constructor`in e)||!(`constructor`in t)||typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,r,i,a,o))}(e,t,r,i,Ur,a))}function Wr(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=Re(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){var l=(c=r[a])[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new or;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?Ur(d,u,3,i,f):p))return!1}}return!0}function Gr(e){return!(!us(e)||(t=e,Ye&&Ye in t))&&(ss(e)?$e:De).test(qa(e));var t}function Kr(e){return typeof e==`function`?e:e==null?fc:typeof e==`object`?es(e)?Qr(e[0],e[1]):Zr(e):xc(e)}function qr(e){if(!Na(e))return kn(e);var t=[];for(var n in Re(e))qe.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Jr(e){if(!us(e))return function(e){var t=[];if(e!=null)for(var n in Re(e))t.push(n);return t}(e);var t=Na(e),n=[];for(var r in e)(r!=`constructor`||!t&&qe.call(e,r))&&n.push(r);return n}function Yr(e,t){return e<t}function Xr(e,t){var n=-1,r=ns(e)?Ne(e.length):[];return Cr(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Zr(e){var t=ba(e);return t.length==1&&t[0][2]?Fa(t[0][0],t[0][1]):function(n){return n===e||Wr(n,e,t)}}function Qr(e,t){return Aa(e)&&Pa(t)?Fa(Ka(e),t):function(r){var i=Fs(r,e);return i===n&&i===t?Is(r,e):Ur(t,i,3)}}function $r(e,t,r,i,a){e!==t&&kr(t,function(o,s){if(a||=new or,us(o))(function(e,t,r,i,a,o,s){var c=Ra(e,r),l=Ra(t,r),u=s.get(l);if(u)dr(e,r,u);else{var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=es(l),m=!p&&is(l),h=!p&&!m&&ys(l);d=l,p||m||h?es(c)?d=c:rs(c)?d=Bi(c):m?(f=!1,d=Pi(l,!0)):h?(f=!1,d=Ii(l,!0)):d=[]:ms(l)||$o(l)?(d=c,$o(c)?d=Ds(c):us(c)&&!ss(c)||(d=Ea(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),dr(e,r,d)}})(e,t,s,r,$r,i,a);else{var c=i?i(Ra(e,s),o,s+``,e,t,a):n;c===n&&(c=o),dr(e,s,c)}},Vs)}function ei(e,t){var r=e.length;if(r)return Oa(t+=t<0?r:0,r)?e[t]:n}function ti(e,t,n){t=t.length?Wt(t,function(e){return es(e)?function(t){return Pr(t,e.length===1?e[0]:e)}:e}):[fc];var r=-1;return t=Wt(t,ln(H())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Xr(e,function(e,n,i){return{criteria:Wt(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Li(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}(e,t,n)})}function ni(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Pr(e,o);n(s,o)&&ui(a,Ai(o,e),s)}return a}function ri(e,t,n,r){var i=r?$t:Qt,a=-1,o=t.length,s=e;for(e===t&&(t=Bi(t)),n&&(s=Wt(e,ln(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&st.call(s,c,1),st.call(e,c,1);return e}function ii(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;Oa(i)?st.call(e,i,1):Si(e,i)}}return e}function ai(e,t){return e+Ot(Pn()*(t-e+1))}function oi(e,t){var n=``;if(!e||t<1||t>u)return n;do t%2&&(n+=e),(t=Ot(t/2))&&(e+=e);while(t);return n}function si(e,t){return Va(Ia(e,t,fc),e+``)}function ci(e){return cr(Ys(e))}function li(e,t){var n=Ys(e);return Wa(n,vr(t,0,n.length))}function ui(e,t,r,i){if(!us(e))return e;for(var a=-1,o=(t=Ai(t,e)).length,s=o-1,c=e;c!=null&&++a<o;){var l=Ka(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];(u=i?i(d,l,c):n)===n&&(u=us(d)?d:Oa(t[a+1])?[]:{})}fr(c,l,u),c=c[l]}return e}var di=Hn?function(e,t){return Hn.set(e,t),e}:fc,fi=yt?function(e,t){return yt(e,`toString`,{configurable:!0,enumerable:!1,value:lc(t),writable:!0})}:fc;function pi(e){return Wa(Ys(e))}function mi(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Ne(i);++r<i;)a[r]=e[r+t];return a}function hi(e,t){var n;return Cr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function gi(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t==t&&i<=2147483647){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!vs(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return _i(e,t,fc,n)}function _i(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;for(var s=(t=r(t))!=t,c=t===null,l=vs(t),u=t===n;a<o;){var d=Ot((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f==f,g=vs(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):!m&&!g&&(i?f<=t:f<t);_?a=d+1:o=d}return jn(o,4294967294)}function vi(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!Xo(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function yi(e){return typeof e==`number`?e:vs(e)?d:+e}function bi(e){if(typeof e==`string`)return e;if(es(e))return Wt(e,bi)+``;if(vs(e))return Zn?Zn.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function xi(e,t,n){var r=-1,i=Ht,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=Ut;else if(a>=200){var l=t?null:oa(e);if(l)return xn(l);o=!1,i=dn,c=new ar}else c=t?[]:s;e:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d==d){for(var f=c.length;f--;)if(c[f]===d)continue e;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}function Si(e,t){return(e=La(e,t=Ai(t,e)))==null||delete e[Ka(ao(t))]}function Ci(e,t,n,r){return ui(e,t,n(Pr(e,t)),r)}function wi(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?mi(e,r?0:a,r?a+1:i):mi(e,r?a+1:0,r?i:a)}function Ti(e,t){var n=e;return n instanceof tr&&(n=n.value()),Kt(t,function(e,t){return t.func.apply(t.thisArg,Gt([e],t.args))},n)}function Ei(e,t,n){var r=e.length;if(r<2)return r?xi(e[0]):[];for(var i=-1,a=Ne(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Sr(a[i]||o,e[s],t,n));return xi(Or(a,1),t,n)}function Di(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function Oi(e){return rs(e)?e:[]}function ki(e){return typeof e==`function`?e:fc}function Ai(e,t){return es(e)?e:Aa(e,t)?[e]:Ga(U(e))}var ji=si;function Mi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:mi(e,t,r)}var Ni=St||function(e){return wt.clearTimeout(e)};function Pi(e,t){if(t)return e.slice();var n=e.length,r=rt?rt(n):new e.constructor(n);return e.copy(r),r}function Fi(e){var t=new e.constructor(e.byteLength);return new nt(t).set(new nt(e)),t}function Ii(e,t){var n=t?Fi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Li(e,t){if(e!==t){var r=e!==n,i=e===null,a=e==e,o=vs(e),s=t!==n,c=t===null,l=t==t,u=vs(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function Ri(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=An(a-o,0),u=Ne(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function zi(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=An(a-s,0),d=Ne(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function Bi(e,t){var n=-1,r=e.length;for(t||=Ne(r);++n<r;)t[n]=e[n];return t}function Vi(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?gr(r,c,l):fr(r,c,l)}return r}function Hi(e,t){return function(n,r){var i=es(n)?Lt:mr,a=t?t():{};return i(n,e,H(r,2),a)}}function Ui(e){return si(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&ka(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=Re(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function Wi(e,t){return function(n,r){if(n==null)return n;if(!ns(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Re(n);(t?a--:++a<i)&&!1!==r(o[a],a,o););return n}}function Gi(e){return function(t,n,r){for(var i=-1,a=Re(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(!1===n(a[c],c,a))break}return t}}function Ki(e){return function(t){var r=_n(t=U(t))?wn(t):n,i=r?r[0]:t.charAt(0),a=r?Mi(r,1).join(``):t.slice(1);return i[e]()+a}}function qi(e){return function(t){return Kt(oc(Qs(t).replace(lt,``)),e,``)}}function Ji(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Qn(e.prototype),r=e.apply(n,t);return us(r)?r:n}}function Yi(e){return function(t,r,i){var a=Re(t);if(!ns(t)){var o=H(r,3);t=Bs(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function Xi(e){return pa(function(t){var i=t.length,a=i,o=er.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if(typeof s!=`function`)throw new Ve(r);if(o&&!c&&_a(s)==`wrapper`)var c=new er([],!0)}for(a=c?a:i;++a<i;){var l=_a(s=t[a]),u=l==`wrapper`?ga(s):n;c=u&&ja(u[0])&&u[1]==424&&!u[4].length&&u[9]==1?c[_a(u[0])].apply(c,u[3]):s.length==1&&ja(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&e.length==1&&es(n))return c.plant(n).value();for(var r=0,a=i?t[r].apply(this,e):n;++r<i;)a=t[r].call(this,a);return a}})}function Zi(e,t,r,i,a,o,c,l,u,d){var f=t&s,p=1&t,m=2&t,h=24&t,g=512&t,_=m?n:Ji(e);return function s(){for(var v=arguments.length,y=Ne(v),b=v;b--;)y[b]=arguments[b];if(h)var x=va(s),S=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(y,x);if(i&&(y=Ri(y,i,a,h)),o&&(y=zi(y,o,c,h)),v-=S,h&&v<d){var C=bn(y,x);return ia(e,t,Zi,s.placeholder,r,y,C,l,u,d-v)}var w=p?r:this,T=m?w[e]:e;return v=y.length,l?y=function(e,t){for(var r=e.length,i=jn(t.length,r),a=Bi(e);i--;){var o=t[i];e[i]=Oa(o,r)?a[o]:n}return e}(y,l):g&&v>1&&y.reverse(),f&&u<v&&(y.length=u),this&&this!==wt&&this instanceof s&&(T=_||Ji(T)),T.apply(w,y)}}function Qi(e,t){return function(n,r){return function(e,t,n,r){return jr(e,function(e,i,a){t(r,n(e),i,a)}),r}(n,e,t(r),{})}}function $i(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=bi(r),i=bi(i)):(r=yi(r),i=yi(i)),a=e(r,i)}return a}}function ea(e){return pa(function(t){return t=Wt(t,ln(H())),si(function(n){var r=this;return e(t,function(e){return It(e,r,n)})})})}function ta(e,t){var r=(t=t===n?` `:bi(t)).length;if(r<2)return r?oi(t,e):t;var i=oi(t,Et(e/Cn(t)));return _n(t)?Mi(wn(i),0,e).join(``):i.slice(0,e)}function na(e){return function(t,r,i){return i&&typeof i!=`number`&&ka(t,r,i)&&(r=i=n),t=Cs(t),r===n?(r=t,t=0):r=Cs(r),function(e,t,n,r){for(var i=-1,a=An(Et((t-e)/(n||1)),0),o=Ne(a);a--;)o[r?a:++i]=e,e+=n;return o}(t,r,i=i===n?t<r?1:-1:Cs(i),e)}}function ra(e){return function(t,n){return typeof t==`string`&&typeof n==`string`||(t=Es(t),n=Es(n)),e(t,n)}}function ia(e,t,r,i,a,s,c,l,u,d){var f=8&t;t|=f?o:64,4&(t&=~(f?64:o))||(t&=-4);var p=[e,t,a,f?s:n,f?c:n,f?n:s,f?n:c,l,u,d],m=r.apply(n,p);return ja(e)&&za(m,p),m.placeholder=i,Ha(m,e,t)}function aa(e){var t=Le[e];return function(e,n){if(e=Es(e),(n=n==null?0:jn(ws(n),292))&&rn(e)){var r=(U(e)+`e`).split(`e`);return+((r=(U(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`))[0]+`e`+(+r[1]-n))}return t(e)}}var oa=zn&&1/xn(new zn([,-0]))[1]==l?function(e){return new zn(e)}:_c;function sa(e){return function(t){var n=wa(t);return n==x?vn(t):n==E?Sn(t):function(e,t){return Wt(t,function(t){return[t,e[t]]})}(t,e(t))}}function ca(e,t,i,l,u,d,f,p){var m=2&t;if(!m&&typeof e!=`function`)throw new Ve(r);var h=l?l.length:0;if(h||(t&=-97,l=u=n),f=f===n?f:An(ws(f),0),p=p===n?p:ws(p),h-=u?u.length:0,64&t){var g=l,_=u;l=u=n}var v=m?n:ga(e),y=[e,t,i,l,u,g,_,d,f,p];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,l=r==s&&n==8||r==s&&n==c&&e[7].length<=t[8]||r==384&&t[7].length<=t[8]&&n==8;if(!o&&!l)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var d=e[3];e[3]=d?Ri(d,u,t[4]):u,e[4]=d?bn(e[3],a):t[4]}(u=t[5])&&(d=e[5],e[5]=d?zi(d,u,t[6]):u,e[6]=d?bn(e[5],a):t[6]),(u=t[7])&&(e[7]=u),r&s&&(e[8]=e[8]==null?t[8]:jn(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i}(y,v),e=y[0],t=y[1],i=y[2],l=y[3],u=y[4],!(p=y[9]=y[9]===n?m?0:e.length:An(y[9]-h,0))&&24&t&&(t&=-25),t&&t!=1)b=t==8||t==16?function(e,t,r){var i=Ji(e);return function a(){for(var o=arguments.length,s=Ne(o),c=o,l=va(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:bn(s,l);return(o-=u.length)<r?ia(e,t,Zi,a.placeholder,n,s,u,n,n,r-o):It(this&&this!==wt&&this instanceof a?i:e,this,s)}}(e,t,p):t!=o&&t!=33||u.length?Zi.apply(n,y):function(e,t,n,r){var i=1&t,a=Ji(e);return function t(){for(var o=-1,s=arguments.length,c=-1,l=r.length,u=Ne(l+s),d=this&&this!==wt&&this instanceof t?a:e;++c<l;)u[c]=r[c];for(;s--;)u[c++]=arguments[++o];return It(d,i?n:this,u)}}(e,t,i,l);else var b=function(e,t,n){var r=1&t,i=Ji(e);return function t(){return(this&&this!==wt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,i);return Ha((v?di:za)(b,y),e,t)}function la(e,t,r,i){return e===n||Xo(e,We[r])&&!qe.call(i,r)?t:e}function ua(e,t,r,i,a,o){return us(e)&&us(t)&&(o.set(t,e),$r(e,t,n,ua,o),o.delete(t)),e}function da(e){return ms(e)?n:e}function fa(e,t,r,i,a,o){var s=1&r,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=2&r?new ar:n;for(o.set(e,t),o.set(t,e);++f<c;){var h=e[f],g=t[f];if(i)var _=s?i(g,h,f,t,e,o):i(h,g,f,e,t,o);if(_!==n){if(_)continue;p=!1;break}if(m){if(!Jt(t,function(e,t){if(!dn(m,t)&&(h===e||a(h,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(h!==g&&!a(h,g,r,i,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function pa(e){return Va(Ia(e,n,eo),e+``)}function ma(e){return Fr(e,Bs,Sa)}function ha(e){return Fr(e,Vs,Ca)}var ga=Hn?function(e){return Hn.get(e)}:_c;function _a(e){for(var t=e.name+``,n=Un[t],r=qe.call(Un,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function va(e){return(qe.call(V,`placeholder`)?V:e).placeholder}function H(){var e=V.iteratee||pc;return e=e===pc?Kr:e,arguments.length?e(arguments[0],arguments[1]):e}function ya(e,t){var n,r,i=e.__data__;return((r=typeof(n=t))==`string`||r==`number`||r==`symbol`||r==`boolean`?n!==`__proto__`:n===null)?i[typeof t==`string`?`string`:`hash`]:i.map}function ba(e){for(var t=Bs(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Pa(i)]}return t}function xa(e,t){var r=function(e,t){return e==null?n:e[t]}(e,t);return Gr(r)?r:n}var Sa=kt?function(e){return e==null?[]:(e=Re(e),Vt(kt(e),function(t){return ot.call(e,t)}))}:wc,Ca=kt?function(e){for(var t=[];e;)Gt(t,Sa(e)),e=it(e);return t}:wc,wa=Ir;function Ta(e,t,n){for(var r=-1,i=(t=Ai(t,e)).length,a=!1;++r<i;){var o=Ka(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=e==null?0:e.length)&&ls(i)&&Oa(o,i)&&(es(e)||$o(e))}function Ea(e){return typeof e.constructor!=`function`||Na(e)?{}:Qn(it(e))}function Da(e){return es(e)||$o(e)||!!(ct&&e&&e[ct])}function Oa(e,t){var n=typeof e;return!!(t??=u)&&(n==`number`||n!=`symbol`&&ke.test(e))&&e>-1&&e%1==0&&e<t}function ka(e,t,n){if(!us(n))return!1;var r=typeof t;return!!(r==`number`?ns(n)&&Oa(t,n.length):r==`string`&&t in n)&&Xo(n[t],e)}function Aa(e,t){if(es(e))return!1;var n=typeof e;return!(n!=`number`&&n!=`symbol`&&n!=`boolean`&&e!=null&&!vs(e))||de.test(e)||!ue.test(e)||t!=null&&e in Re(t)}function ja(e){var t=_a(e),n=V[t];if(typeof n!=`function`||!(t in tr.prototype))return!1;if(e===n)return!0;var r=ga(n);return!!r&&e===r[0]}(In&&wa(new In(new ArrayBuffer(1)))!=j||Ln&&wa(new Ln)!=x||Rn&&wa(Rn.resolve())!=w||zn&&wa(new zn)!=E||Bn&&wa(new Bn)!=k)&&(wa=function(e){var t=Ir(e),r=t==C?e.constructor:n,i=r?qa(r):``;if(i)switch(i){case Wn:return j;case Gn:return x;case Kn:return w;case qn:return E;case Jn:return k}return t});var Ma=Ge?ss:Tc;function Na(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||We)}function Pa(e){return e==e&&!us(e)}function Fa(e,t){return function(r){return r!=null&&r[e]===t&&(t!==n||e in Re(r))}}function Ia(e,t,r){return t=An(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=An(n.length-t,0),o=Ne(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Ne(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),It(e,this,s)}}function La(e,t){return t.length<2?e:Pr(e,mi(t,0,-1))}function Ra(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}var za=Ua(di),Ba=Tt||function(e,t){return wt.setTimeout(e,t)},Va=Ua(fi);function Ha(e,t,n){var r=t+``;return Va(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(_e,`{
114
- /* [wrapped with `+t+`] */
115
- `)}(r,function(e,t){return Rt(p,function(n){var r=`_.`+n[0];t&n[1]&&!Ht(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ve);return t?t[1].split(ye):[]}(r),n)))}function Ua(e){var t=0,r=0;return function(){var i=Mn(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Wa(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=ai(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var Ga=function(e){var t=Wo(e,function(e){return n.size===500&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(fe,function(e,n,r,i){t.push(r?i.replace(Se,`$1`):n||e)}),t});function Ka(e){if(typeof e==`string`||vs(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function qa(e){if(e!=null){try{return Ke.call(e)}catch{}try{return e+``}catch{}}return``}function Ja(e){if(e instanceof tr)return e.clone();var t=new er(e.__wrapped__,e.__chain__);return t.__actions__=Bi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ya=si(function(e,t){return rs(e)?Sr(e,Or(t,1,rs,!0)):[]}),Xa=si(function(e,t){var r=ao(t);return rs(r)&&(r=n),rs(e)?Sr(e,Or(t,1,rs,!0),H(r,2)):[]}),Za=si(function(e,t){var r=ao(t);return rs(r)&&(r=n),rs(e)?Sr(e,Or(t,1,rs,!0),n,r):[]});function Qa(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:ws(n);return i<0&&(i=An(r+i,0)),Zt(e,H(t,3),i)}function $a(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=ws(r),a=r<0?An(i+a,0):jn(a,i-1)),Zt(e,H(t,3),a,!0)}function eo(e){return e!=null&&e.length?Or(e,1):[]}function to(e){return e&&e.length?e[0]:n}var no=si(function(e){var t=Wt(e,Oi);return t.length&&t[0]===e[0]?Br(t):[]}),ro=si(function(e){var t=ao(e),r=Wt(e,Oi);return t===ao(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Br(r,H(t,2)):[]}),io=si(function(e){var t=ao(e),r=Wt(e,Oi);return(t=typeof t==`function`?t:n)&&r.pop(),r.length&&r[0]===e[0]?Br(r,n,t):[]});function ao(e){var t=e==null?0:e.length;return t?e[t-1]:n}var oo=si(so);function so(e,t){return e&&e.length&&t&&t.length?ri(e,t):e}var co=pa(function(e,t){var n=e==null?0:e.length,r=_r(e,t);return ii(e,Wt(t,function(e){return Oa(e,n)?+e:e}).sort(Li)),r});function lo(e){return e==null?e:Fn.call(e)}var uo=si(function(e){return xi(Or(e,1,rs,!0))}),fo=si(function(e){var t=ao(e);return rs(t)&&(t=n),xi(Or(e,1,rs,!0),H(t,2))}),po=si(function(e){var t=ao(e);return t=typeof t==`function`?t:n,xi(Or(e,1,rs,!0),n,t)});function mo(e){if(!e||!e.length)return[];var t=0;return e=Vt(e,function(e){if(rs(e))return t=An(e.length,t),!0}),sn(t,function(t){return Wt(e,nn(t))})}function ho(e,t){if(!e||!e.length)return[];var r=mo(e);return t==null?r:Wt(r,function(e){return It(t,n,e)})}var go=si(function(e,t){return rs(e)?Sr(e,t):[]}),_o=si(function(e){return Ei(Vt(e,rs))}),vo=si(function(e){var t=ao(e);return rs(t)&&(t=n),Ei(Vt(e,rs),H(t,2))}),yo=si(function(e){var t=ao(e);return t=typeof t==`function`?t:n,Ei(Vt(e,rs),n,t)}),bo=si(mo),xo=si(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r==`function`?(e.pop(),r):n,ho(e,r)});function So(e){var t=V(e);return t.__chain__=!0,t}function Co(e,t){return t(e)}var wo=pa(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return _r(t,e)};return!(t>1||this.__actions__.length)&&i instanceof tr&&Oa(r)?((i=i.slice(r,+r+ +!!t)).__actions__.push({func:Co,args:[a],thisArg:n}),new er(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(a)}),To=Hi(function(e,t,n){qe.call(e,n)?++e[n]:gr(e,n,1)}),Eo=Yi(Qa),Do=Yi($a);function Oo(e,t){return(es(e)?Rt:Cr)(e,H(t,3))}function ko(e,t){return(es(e)?zt:wr)(e,H(t,3))}var Ao=Hi(function(e,t,n){qe.call(e,n)?e[n].push(t):gr(e,n,[t])}),jo=si(function(e,t,n){var r=-1,i=typeof t==`function`,a=ns(e)?Ne(e.length):[];return Cr(e,function(e){a[++r]=i?It(t,e,n):Vr(e,t,n)}),a}),Mo=Hi(function(e,t,n){gr(e,n,t)});function No(e,t){return(es(e)?Wt:Xr)(e,H(t,3))}var Po=Hi(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]}),Fo=si(function(e,t){if(e==null)return[];var n=t.length;return n>1&&ka(e,t[0],t[1])?t=[]:n>2&&ka(t[0],t[1],t[2])&&(t=[t[0]]),ti(e,Or(t,1),[])}),Io=Ct||function(){return wt.Date.now()};function Lo(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,ca(e,s,n,n,n,n,t)}function Ro(e,t){var i;if(typeof t!=`function`)throw new Ve(r);return e=ws(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var zo=si(function(e,t,n){var r=1;if(n.length){var i=bn(n,va(zo));r|=o}return ca(e,r,t,n,i)}),Bo=si(function(e,t,n){var r=3;if(n.length){var i=bn(n,va(Bo));r|=o}return ca(t,r,e,n,i)});function Vo(e,t,i){var a,o,s,c,l,u,d=0,f=!1,p=!1,m=!0;if(typeof e!=`function`)throw new Ve(r);function h(t){var r=a,i=o;return a=o=n,d=t,c=e.apply(i,r)}function g(e){var r=e-u;return u===n||r>=t||r<0||p&&e-d>=s}function _(){var e=Io();if(g(e))return v(e);l=Ba(_,function(e){var n=t-(e-u);return p?jn(n,s-(e-d)):n}(e))}function v(e){return l=n,m&&a?h(e):(a=o=n,c)}function y(){var e=Io(),r=g(e);if(a=arguments,o=this,u=e,r){if(l===n)return function(e){return d=e,l=Ba(_,t),f?h(e):c}(u);if(p)return Ni(l),l=Ba(_,t),h(u)}return l===n&&(l=Ba(_,t)),c}return t=Es(t)||0,us(i)&&(f=!!i.leading,s=(p=`maxWait`in i)?An(Es(i.maxWait)||0,t):s,m=`trailing`in i?!!i.trailing:m),y.cancel=function(){l!==n&&Ni(l),d=0,a=u=o=l=n},y.flush=function(){return l===n?c:v(Io())},y}var Ho=si(function(e,t){return xr(e,1,t)}),Uo=si(function(e,t,n){return xr(e,Es(t)||0,n)});function Wo(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw new Ve(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Wo.Cache||ir),n}function Go(e){if(typeof e!=`function`)throw new Ve(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Wo.Cache=ir;var Ko=ji(function(e,t){var n=(t=t.length==1&&es(t[0])?Wt(t[0],ln(H())):Wt(Or(t,1),ln(H()))).length;return si(function(r){for(var i=-1,a=jn(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return It(e,this,r)})}),qo=si(function(e,t){return ca(e,o,n,t,bn(t,va(qo)))}),Jo=si(function(e,t){return ca(e,64,n,t,bn(t,va(Jo)))}),Yo=pa(function(e,t){return ca(e,c,n,n,n,t)});function Xo(e,t){return e===t||e!=e&&t!=t}var Zo=ra(Lr),Qo=ra(function(e,t){return e>=t}),$o=Hr(function(){return arguments}())?Hr:function(e){return ds(e)&&qe.call(e,`callee`)&&!ot.call(e,`callee`)},es=Ne.isArray,ts=At?ln(At):function(e){return ds(e)&&Ir(e)==A};function ns(e){return e!=null&&ls(e.length)&&!ss(e)}function rs(e){return ds(e)&&ns(e)}var is=Yt||Tc,as=jt?ln(jt):function(e){return ds(e)&&Ir(e)==_};function os(e){if(!ds(e))return!1;var t=Ir(e);return t==v||t==`[object DOMException]`||typeof e.message==`string`&&typeof e.name==`string`&&!ms(e)}function ss(e){if(!us(e))return!1;var t=Ir(e);return t==y||t==b||t==`[object AsyncFunction]`||t==`[object Proxy]`}function cs(e){return typeof e==`number`&&e==ws(e)}function ls(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=u}function us(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function ds(e){return typeof e==`object`&&!!e}var fs=Mt?ln(Mt):function(e){return ds(e)&&wa(e)==x};function ps(e){return typeof e==`number`||ds(e)&&Ir(e)==S}function ms(e){if(!ds(e)||Ir(e)!=C)return!1;var t=it(e);if(t===null)return!0;var n=qe.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Ke.call(n)==Ze}var hs=Nt?ln(Nt):function(e){return ds(e)&&Ir(e)==T},gs=Pt?ln(Pt):function(e){return ds(e)&&wa(e)==E};function _s(e){return typeof e==`string`||!es(e)&&ds(e)&&Ir(e)==D}function vs(e){return typeof e==`symbol`||ds(e)&&Ir(e)==O}var ys=Ft?ln(Ft):function(e){return ds(e)&&ls(e.length)&&!!_t[Ir(e)]},bs=ra(Yr),xs=ra(function(e,t){return e<=t});function Ss(e){if(!e)return[];if(ns(e))return _s(e)?wn(e):Bi(e);if(dt&&e[dt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[dt]());var t=wa(e);return(t==x?vn:t==E?xn:Ys)(e)}function Cs(e){return e?(e=Es(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:e===0?e:0}function ws(e){var t=Cs(e),n=t%1;return t==t?n?t-n:t:0}function Ts(e){return e?vr(ws(e),0,f):0}function Es(e){if(typeof e==`number`)return e;if(vs(e))return d;if(us(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=us(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=cn(e);var n=Ee.test(e);return n||Oe.test(e)?xt(e.slice(2),n?2:8):Te.test(e)?d:+e}function Ds(e){return Vi(e,Vs(e))}function U(e){return e==null?``:bi(e)}var Os=Ui(function(e,t){if(Na(t)||ns(t))Vi(t,Bs(t),e);else for(var n in t)qe.call(t,n)&&fr(e,n,t[n])}),ks=Ui(function(e,t){Vi(t,Vs(t),e)}),As=Ui(function(e,t,n,r){Vi(t,Vs(t),e,r)}),js=Ui(function(e,t,n,r){Vi(t,Bs(t),e,r)}),Ms=pa(_r),Ns=si(function(e,t){e=Re(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&ka(t[0],t[1],a)&&(i=1);++r<i;)for(var o=t[r],s=Vs(o),c=-1,l=s.length;++c<l;){var u=s[c],d=e[u];(d===n||Xo(d,We[u])&&!qe.call(e,u))&&(e[u]=o[u])}return e}),Ps=si(function(e){return e.push(n,ua),It(Us,n,e)});function Fs(e,t,r){var i=e==null?n:Pr(e,t);return i===n?r:i}function Is(e,t){return e!=null&&Ta(e,t,zr)}var Ls=Qi(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=Xe.call(t)),e[t]=n},lc(fc)),Rs=Qi(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=Xe.call(t)),qe.call(e,t)?e[t].push(n):e[t]=[n]},H),zs=si(Vr);function Bs(e){return ns(e)?sr(e):qr(e)}function Vs(e){return ns(e)?sr(e,!0):Jr(e)}var Hs=Ui(function(e,t,n){$r(e,t,n)}),Us=Ui(function(e,t,n,r){$r(e,t,n,r)}),Ws=pa(function(e,t){var n={};if(e==null)return n;var r=!1;t=Wt(t,function(t){return t=Ai(t,e),r||=t.length>1,t}),Vi(e,ha(e),n),r&&(n=yr(n,7,da));for(var i=t.length;i--;)Si(n,t[i]);return n}),Gs=pa(function(e,t){return e==null?{}:function(e,t){return ni(e,t,function(t,n){return Is(e,n)})}(e,t)});function Ks(e,t){if(e==null)return{};var n=Wt(ha(e),function(e){return[e]});return t=H(t),ni(e,n,function(e,n){return t(e,n[0])})}var qs=sa(Bs),Js=sa(Vs);function Ys(e){return e==null?[]:un(e,Bs(e))}var Xs=qi(function(e,t,n){return t=t.toLowerCase(),e+(n?Zs(t):t)});function Zs(e){return ac(U(e).toLowerCase())}function Qs(e){return(e=U(e))&&e.replace(Ae,mn).replace(ut,``)}var $s=qi(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),ec=qi(function(e,t,n){return e+(n?` `:``)+t.toLowerCase()}),tc=Ki(`toLowerCase`),nc=qi(function(e,t,n){return e+(n?`_`:``)+t.toLowerCase()}),rc=qi(function(e,t,n){return e+(n?` `:``)+ac(t)}),ic=qi(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),ac=Ki(`toUpperCase`);function oc(e,t,r){return e=U(e),(t=r?n:t)===n?function(e){return mt.test(e)}(e)?function(e){return e.match(ft)||[]}(e):function(e){return e.match(be)||[]}(e):e.match(t)||[]}var sc=si(function(e,t){try{return It(e,n,t)}catch(e){return os(e)?e:new Fe(e)}}),cc=pa(function(e,t){return Rt(t,function(t){t=Ka(t),gr(e,t,zo(e[t],e))}),e});function lc(e){return function(){return e}}var uc=Xi(),dc=Xi(!0);function fc(e){return e}function pc(e){return Kr(typeof e==`function`?e:yr(e,1))}var mc=si(function(e,t){return function(n){return Vr(n,e,t)}}),hc=si(function(e,t){return function(n){return Vr(e,n,t)}});function gc(e,t,n){var r=Bs(t),i=Nr(t,r);n!=null||us(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Nr(t,Bs(t)));var a=!(us(n)&&`chain`in n&&!n.chain),o=ss(e);return Rt(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=Bi(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Gt([this.value()],arguments))})}),e}function _c(){}var vc=ea(Wt),yc=ea(Bt),bc=ea(Jt);function xc(e){return Aa(e)?nn(Ka(e)):function(e){return function(t){return Pr(t,e)}}(e)}var Sc=na(),Cc=na(!0);function wc(){return[]}function Tc(){return!1}var Ec,Dc=$i(function(e,t){return e+t},0),Oc=aa(`ceil`),kc=$i(function(e,t){return e/t},1),Ac=aa(`floor`),jc=$i(function(e,t){return e*t},1),Mc=aa(`round`),Nc=$i(function(e,t){return e-t},0);return V.after=function(e,t){if(typeof t!=`function`)throw new Ve(r);return e=ws(e),function(){if(--e<1)return t.apply(this,arguments)}},V.ary=Lo,V.assign=Os,V.assignIn=ks,V.assignInWith=As,V.assignWith=js,V.at=Ms,V.before=Ro,V.bind=zo,V.bindAll=cc,V.bindKey=Bo,V.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return es(e)?e:[e]},V.chain=So,V.chunk=function(e,t,r){t=(r?ka(e,t,r):t===n)?1:An(ws(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=Ne(Et(i/t));a<i;)s[o++]=mi(e,a,a+=t);return s},V.compact=function(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i},V.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Ne(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Gt(es(n)?Bi(n):[n],Or(t,1))},V.cond=function(e){var t=e==null?0:e.length,n=H();return e=t?Wt(e,function(e){if(typeof e[1]!=`function`)throw new Ve(r);return[n(e[0]),e[1]]}):[],si(function(n){for(var r=-1;++r<t;){var i=e[r];if(It(i[0],this,n))return It(i[1],this,n)}})},V.conforms=function(e){return function(e){var t=Bs(e);return function(n){return br(n,e,t)}}(yr(e,1))},V.constant=lc,V.countBy=To,V.create=function(e,t){var n=Qn(e);return t==null?n:hr(n,t)},V.curry=function e(t,r,i){var a=ca(t,8,n,n,n,n,n,r=i?n:r);return a.placeholder=e.placeholder,a},V.curryRight=function e(t,r,i){var a=ca(t,16,n,n,n,n,n,r=i?n:r);return a.placeholder=e.placeholder,a},V.debounce=Vo,V.defaults=Ns,V.defaultsDeep=Ps,V.defer=Ho,V.delay=Uo,V.difference=Ya,V.differenceBy=Xa,V.differenceWith=Za,V.drop=function(e,t,r){var i=e==null?0:e.length;return i?mi(e,(t=r||t===n?1:ws(t))<0?0:t,i):[]},V.dropRight=function(e,t,r){var i=e==null?0:e.length;return i?mi(e,0,(t=i-(t=r||t===n?1:ws(t)))<0?0:t):[]},V.dropRightWhile=function(e,t){return e&&e.length?wi(e,H(t,3),!0,!0):[]},V.dropWhile=function(e,t){return e&&e.length?wi(e,H(t,3),!0):[]},V.fill=function(e,t,r,i){var a=e==null?0:e.length;return a?(r&&typeof r!=`number`&&ka(e,t,r)&&(r=0,i=a),function(e,t,r,i){var a=e.length;for((r=ws(r))<0&&(r=-r>a?0:a+r),(i=i===n||i>a?a:ws(i))<0&&(i+=a),i=r>i?0:Ts(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},V.filter=function(e,t){return(es(e)?Vt:Dr)(e,H(t,3))},V.flatMap=function(e,t){return Or(No(e,t),1)},V.flatMapDeep=function(e,t){return Or(No(e,t),l)},V.flatMapDepth=function(e,t,r){return r=r===n?1:ws(r),Or(No(e,t),r)},V.flatten=eo,V.flattenDeep=function(e){return e!=null&&e.length?Or(e,l):[]},V.flattenDepth=function(e,t){return e!=null&&e.length?Or(e,t=t===n?1:ws(t)):[]},V.flip=function(e){return ca(e,512)},V.flow=uc,V.flowRight=dc,V.fromPairs=function(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},V.functions=function(e){return e==null?[]:Nr(e,Bs(e))},V.functionsIn=function(e){return e==null?[]:Nr(e,Vs(e))},V.groupBy=Ao,V.initial=function(e){return e!=null&&e.length?mi(e,0,-1):[]},V.intersection=no,V.intersectionBy=ro,V.intersectionWith=io,V.invert=Ls,V.invertBy=Rs,V.invokeMap=jo,V.iteratee=pc,V.keyBy=Mo,V.keys=Bs,V.keysIn=Vs,V.map=No,V.mapKeys=function(e,t){var n={};return t=H(t,3),jr(e,function(e,r,i){gr(n,t(e,r,i),e)}),n},V.mapValues=function(e,t){var n={};return t=H(t,3),jr(e,function(e,r,i){gr(n,r,t(e,r,i))}),n},V.matches=function(e){return Zr(yr(e,1))},V.matchesProperty=function(e,t){return Qr(e,yr(t,1))},V.memoize=Wo,V.merge=Hs,V.mergeWith=Us,V.method=mc,V.methodOf=hc,V.mixin=gc,V.negate=Go,V.nthArg=function(e){return e=ws(e),si(function(t){return ei(t,e)})},V.omit=Ws,V.omitBy=function(e,t){return Ks(e,Go(H(t)))},V.once=function(e){return Ro(2,e)},V.orderBy=function(e,t,r,i){return e==null?[]:(es(t)||(t=t==null?[]:[t]),es(r=i?n:r)||(r=r==null?[]:[r]),ti(e,t,r))},V.over=vc,V.overArgs=Ko,V.overEvery=yc,V.overSome=bc,V.partial=qo,V.partialRight=Jo,V.partition=Po,V.pick=Gs,V.pickBy=Ks,V.property=xc,V.propertyOf=function(e){return function(t){return e==null?n:Pr(e,t)}},V.pull=oo,V.pullAll=so,V.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?ri(e,t,H(n,2)):e},V.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?ri(e,t,n,r):e},V.pullAt=co,V.range=Sc,V.rangeRight=Cc,V.rearg=Yo,V.reject=function(e,t){return(es(e)?Vt:Dr)(e,Go(H(t,3)))},V.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],a=e.length;for(t=H(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return ii(e,i),n},V.rest=function(e,t){if(typeof e!=`function`)throw new Ve(r);return si(e,t=t===n?t:ws(t))},V.reverse=lo,V.sampleSize=function(e,t,r){return t=(r?ka(e,t,r):t===n)?1:ws(t),(es(e)?lr:li)(e,t)},V.set=function(e,t,n){return e==null?e:ui(e,t,n)},V.setWith=function(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:ui(e,t,r,i)},V.shuffle=function(e){return(es(e)?ur:pi)(e)},V.slice=function(e,t,r){var i=e==null?0:e.length;return i?(r&&typeof r!=`number`&&ka(e,t,r)?(t=0,r=i):(t=t==null?0:ws(t),r=r===n?i:ws(r)),mi(e,t,r)):[]},V.sortBy=Fo,V.sortedUniq=function(e){return e&&e.length?vi(e):[]},V.sortedUniqBy=function(e,t){return e&&e.length?vi(e,H(t,2)):[]},V.split=function(e,t,r){return r&&typeof r!=`number`&&ka(e,t,r)&&(t=r=n),(r=r===n?f:r>>>0)?(e=U(e))&&(typeof t==`string`||t!=null&&!hs(t))&&!(t=bi(t))&&_n(e)?Mi(wn(e),0,r):e.split(t,r):[]},V.spread=function(e,t){if(typeof e!=`function`)throw new Ve(r);return t=t==null?0:An(ws(t),0),si(function(n){var r=n[t],i=Mi(n,0,t);return r&&Gt(i,r),It(e,this,i)})},V.tail=function(e){var t=e==null?0:e.length;return t?mi(e,1,t):[]},V.take=function(e,t,r){return e&&e.length?mi(e,0,(t=r||t===n?1:ws(t))<0?0:t):[]},V.takeRight=function(e,t,r){var i=e==null?0:e.length;return i?mi(e,(t=i-(t=r||t===n?1:ws(t)))<0?0:t,i):[]},V.takeRightWhile=function(e,t){return e&&e.length?wi(e,H(t,3),!1,!0):[]},V.takeWhile=function(e,t){return e&&e.length?wi(e,H(t,3)):[]},V.tap=function(e,t){return t(e),e},V.throttle=function(e,t,n){var i=!0,a=!0;if(typeof e!=`function`)throw new Ve(r);return us(n)&&(i=`leading`in n?!!n.leading:i,a=`trailing`in n?!!n.trailing:a),Vo(e,t,{leading:i,maxWait:t,trailing:a})},V.thru=Co,V.toArray=Ss,V.toPairs=qs,V.toPairsIn=Js,V.toPath=function(e){return es(e)?Wt(e,Ka):vs(e)?[e]:Bi(Ga(U(e)))},V.toPlainObject=Ds,V.transform=function(e,t,n){var r=es(e),i=r||is(e)||ys(e);if(t=H(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:us(e)&&ss(a)?Qn(it(e)):{}}return(i?Rt:jr)(e,function(e,r,i){return t(n,e,r,i)}),n},V.unary=function(e){return Lo(e,1)},V.union=uo,V.unionBy=fo,V.unionWith=po,V.uniq=function(e){return e&&e.length?xi(e):[]},V.uniqBy=function(e,t){return e&&e.length?xi(e,H(t,2)):[]},V.uniqWith=function(e,t){return t=typeof t==`function`?t:n,e&&e.length?xi(e,n,t):[]},V.unset=function(e,t){return e==null||Si(e,t)},V.unzip=mo,V.unzipWith=ho,V.update=function(e,t,n){return e==null?e:Ci(e,t,ki(n))},V.updateWith=function(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:Ci(e,t,ki(r),i)},V.values=Ys,V.valuesIn=function(e){return e==null?[]:un(e,Vs(e))},V.without=go,V.words=oc,V.wrap=function(e,t){return qo(ki(t),e)},V.xor=_o,V.xorBy=vo,V.xorWith=yo,V.zip=bo,V.zipObject=function(e,t){return Di(e||[],t||[],fr)},V.zipObjectDeep=function(e,t){return Di(e||[],t||[],ui)},V.zipWith=xo,V.entries=qs,V.entriesIn=Js,V.extend=ks,V.extendWith=As,gc(V,V),V.add=Dc,V.attempt=sc,V.camelCase=Xs,V.capitalize=Zs,V.ceil=Oc,V.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=Es(r))==r?r:0),t!==n&&(t=(t=Es(t))==t?t:0),vr(Es(e),t,r)},V.clone=function(e){return yr(e,4)},V.cloneDeep=function(e){return yr(e,5)},V.cloneDeepWith=function(e,t){return yr(e,5,t=typeof t==`function`?t:n)},V.cloneWith=function(e,t){return yr(e,4,t=typeof t==`function`?t:n)},V.conformsTo=function(e,t){return t==null||br(e,t,Bs(t))},V.deburr=Qs,V.defaultTo=function(e,t){return e==null||e!=e?t:e},V.divide=kc,V.endsWith=function(e,t,r){e=U(e),t=bi(t);var i=e.length,a=r=r===n?i:vr(ws(r),0,i);return(r-=t.length)>=0&&e.slice(r,a)==t},V.eq=Xo,V.escape=function(e){return(e=U(e))&&oe.test(e)?e.replace(ie,hn):e},V.escapeRegExp=function(e){return(e=U(e))&&me.test(e)?e.replace(pe,`\\$&`):e},V.every=function(e,t,r){var i=es(e)?Bt:Tr;return r&&ka(e,t,r)&&(t=n),i(e,H(t,3))},V.find=Eo,V.findIndex=Qa,V.findKey=function(e,t){return Xt(e,H(t,3),jr)},V.findLast=Do,V.findLastIndex=$a,V.findLastKey=function(e,t){return Xt(e,H(t,3),Mr)},V.floor=Ac,V.forEach=Oo,V.forEachRight=ko,V.forIn=function(e,t){return e==null?e:kr(e,H(t,3),Vs)},V.forInRight=function(e,t){return e==null?e:Ar(e,H(t,3),Vs)},V.forOwn=function(e,t){return e&&jr(e,H(t,3))},V.forOwnRight=function(e,t){return e&&Mr(e,H(t,3))},V.get=Fs,V.gt=Zo,V.gte=Qo,V.has=function(e,t){return e!=null&&Ta(e,t,Rr)},V.hasIn=Is,V.head=to,V.identity=fc,V.includes=function(e,t,n,r){e=ns(e)?e:Ys(e),n=n&&!r?ws(n):0;var i=e.length;return n<0&&(n=An(i+n,0)),_s(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Qt(e,t,n)>-1},V.indexOf=function(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:ws(n);return i<0&&(i=An(r+i,0)),Qt(e,t,i)},V.inRange=function(e,t,r){return t=Cs(t),r===n?(r=t,t=0):r=Cs(r),function(e,t,n){return e>=jn(t,n)&&e<An(t,n)}(e=Es(e),t,r)},V.invoke=zs,V.isArguments=$o,V.isArray=es,V.isArrayBuffer=ts,V.isArrayLike=ns,V.isArrayLikeObject=rs,V.isBoolean=function(e){return!0===e||!1===e||ds(e)&&Ir(e)==g},V.isBuffer=is,V.isDate=as,V.isElement=function(e){return ds(e)&&e.nodeType===1&&!ms(e)},V.isEmpty=function(e){if(e==null)return!0;if(ns(e)&&(es(e)||typeof e==`string`||typeof e.splice==`function`||is(e)||ys(e)||$o(e)))return!e.length;var t=wa(e);if(t==x||t==E)return!e.size;if(Na(e))return!qr(e).length;for(var n in e)if(qe.call(e,n))return!1;return!0},V.isEqual=function(e,t){return Ur(e,t)},V.isEqualWith=function(e,t,r){var i=(r=typeof r==`function`?r:n)?r(e,t):n;return i===n?Ur(e,t,n,r):!!i},V.isError=os,V.isFinite=function(e){return typeof e==`number`&&rn(e)},V.isFunction=ss,V.isInteger=cs,V.isLength=ls,V.isMap=fs,V.isMatch=function(e,t){return e===t||Wr(e,t,ba(t))},V.isMatchWith=function(e,t,r){return r=typeof r==`function`?r:n,Wr(e,t,ba(t),r)},V.isNaN=function(e){return ps(e)&&e!=+e},V.isNative=function(e){if(Ma(e))throw new Fe(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return Gr(e)},V.isNil=function(e){return e==null},V.isNull=function(e){return e===null},V.isNumber=ps,V.isObject=us,V.isObjectLike=ds,V.isPlainObject=ms,V.isRegExp=hs,V.isSafeInteger=function(e){return cs(e)&&e>=-9007199254740991&&e<=u},V.isSet=gs,V.isString=_s,V.isSymbol=vs,V.isTypedArray=ys,V.isUndefined=function(e){return e===n},V.isWeakMap=function(e){return ds(e)&&wa(e)==k},V.isWeakSet=function(e){return ds(e)&&Ir(e)==`[object WeakSet]`},V.join=function(e,t){return e==null?``:On.call(e,t)},V.kebabCase=$s,V.last=ao,V.lastIndexOf=function(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=(a=ws(r))<0?An(i+a,0):jn(a,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,a):Zt(e,en,a,!0)},V.lowerCase=ec,V.lowerFirst=tc,V.lt=bs,V.lte=xs,V.max=function(e){return e&&e.length?Er(e,fc,Lr):n},V.maxBy=function(e,t){return e&&e.length?Er(e,H(t,2),Lr):n},V.mean=function(e){return tn(e,fc)},V.meanBy=function(e,t){return tn(e,H(t,2))},V.min=function(e){return e&&e.length?Er(e,fc,Yr):n},V.minBy=function(e,t){return e&&e.length?Er(e,H(t,2),Yr):n},V.stubArray=wc,V.stubFalse=Tc,V.stubObject=function(){return{}},V.stubString=function(){return``},V.stubTrue=function(){return!0},V.multiply=jc,V.nth=function(e,t){return e&&e.length?ei(e,ws(t)):n},V.noConflict=function(){return wt._===this&&(wt._=Qe),this},V.noop=_c,V.now=Io,V.pad=function(e,t,n){e=U(e);var r=(t=ws(t))?Cn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return ta(Ot(i),n)+e+ta(Et(i),n)},V.padEnd=function(e,t,n){e=U(e);var r=(t=ws(t))?Cn(e):0;return t&&r<t?e+ta(t-r,n):e},V.padStart=function(e,t,n){e=U(e);var r=(t=ws(t))?Cn(e):0;return t&&r<t?ta(t-r,n)+e:e},V.parseInt=function(e,t,n){return n||t==null?t=0:t&&=+t,Nn(U(e).replace(he,``),t||0)},V.random=function(e,t,r){if(r&&typeof r!=`boolean`&&ka(e,t,r)&&(t=r=n),r===n&&(typeof t==`boolean`?(r=t,t=n):typeof e==`boolean`&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Cs(e),t===n?(t=e,e=0):t=Cs(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var a=Pn();return jn(e+a*(t-e+bt(`1e-`+((a+``).length-1))),t)}return ai(e,t)},V.reduce=function(e,t,n){var r=es(e)?Kt:an,i=arguments.length<3;return r(e,H(t,4),n,i,Cr)},V.reduceRight=function(e,t,n){var r=es(e)?qt:an,i=arguments.length<3;return r(e,H(t,4),n,i,wr)},V.repeat=function(e,t,r){return t=(r?ka(e,t,r):t===n)?1:ws(t),oi(U(e),t)},V.replace=function(){var e=arguments,t=U(e[0]);return e.length<3?t:t.replace(e[1],e[2])},V.result=function(e,t,r){var i=-1,a=(t=Ai(t,e)).length;for(a||(a=1,e=n);++i<a;){var o=e==null?n:e[Ka(t[i])];o===n&&(i=a,o=r),e=ss(o)?o.call(e):o}return e},V.round=Mc,V.runInContext=e,V.sample=function(e){return(es(e)?cr:ci)(e)},V.size=function(e){if(e==null)return 0;if(ns(e))return _s(e)?Cn(e):e.length;var t=wa(e);return t==x||t==E?e.size:qr(e).length},V.snakeCase=nc,V.some=function(e,t,r){var i=es(e)?Jt:hi;return r&&ka(e,t,r)&&(t=n),i(e,H(t,3))},V.sortedIndex=function(e,t){return gi(e,t)},V.sortedIndexBy=function(e,t,n){return _i(e,t,H(n,2))},V.sortedIndexOf=function(e,t){var n=e==null?0:e.length;if(n){var r=gi(e,t);if(r<n&&Xo(e[r],t))return r}return-1},V.sortedLastIndex=function(e,t){return gi(e,t,!0)},V.sortedLastIndexBy=function(e,t,n){return _i(e,t,H(n,2),!0)},V.sortedLastIndexOf=function(e,t){if(e!=null&&e.length){var n=gi(e,t,!0)-1;if(Xo(e[n],t))return n}return-1},V.startCase=rc,V.startsWith=function(e,t,n){return e=U(e),n=n==null?0:vr(ws(n),0,e.length),t=bi(t),e.slice(n,n+t.length)==t},V.subtract=Nc,V.sum=function(e){return e&&e.length?on(e,fc):0},V.sumBy=function(e,t){return e&&e.length?on(e,H(t,2)):0},V.template=function(e,t,r){var i=V.templateSettings;r&&ka(e,t,r)&&(t=n),e=U(e),t=As({},t,i,la);var a,o,s=As({},t.imports,i.imports,la),c=Bs(s),l=un(s,c),u=0,d=t.interpolate||je,f=`__p += '`,p=ze((t.escape||je).source+`|`+d.source+`|`+(d===le?Ce:je).source+`|`+(t.evaluate||je).source+`|$`,`g`),m=`//# sourceURL=`+(qe.call(t,`sourceURL`)?(t.sourceURL+``).replace(/\s/g,` `):`lodash.templateSources[`+ ++gt+`]`)+`
116
- `;e.replace(p,function(t,n,r,i,s,c){return r||=i,f+=e.slice(u,c).replace(Me,gn),n&&(a=!0,f+=`' +
117
- __e(`+n+`) +
118
- '`),s&&(o=!0,f+=`';
119
- `+s+`;
120
- __p += '`),r&&(f+=`' +
121
- ((__t = (`+r+`)) == null ? '' : __t) +
122
- '`),u=c+t.length,t}),f+=`';
123
- `;var h=qe.call(t,`variable`)&&t.variable;if(h){if(xe.test(h))throw new Fe("Invalid `variable` option passed into `_.template`")}else f=`with (obj) {
124
- `+f+`
125
- }
126
- `;f=(o?f.replace(B,``):f).replace(te,`$1`).replace(ne,`$1;`),f=`function(`+(h||`obj`)+`) {
127
- `+(h?``:`obj || (obj = {});
128
- `)+`var __t, __p = ''`+(a?`, __e = _.escape`:``)+(o?`, __j = Array.prototype.join;
129
- function print() { __p += __j.call(arguments, '') }
130
- `:`;
131
- `)+f+`return __p
132
- }`;var g=sc(function(){return Ie(c,m+`return `+f).apply(n,l)});if(g.source=f,os(g))throw g;return g},V.times=function(e,t){if((e=ws(e))<1||e>u)return[];var n=f,r=jn(e,f);t=H(t),e-=f;for(var i=sn(r,t);++n<e;)t(n);return i},V.toFinite=Cs,V.toInteger=ws,V.toLength=Ts,V.toLower=function(e){return U(e).toLowerCase()},V.toNumber=Es,V.toSafeInteger=function(e){return e?vr(ws(e),-9007199254740991,u):e===0?e:0},V.toString=U,V.toUpper=function(e){return U(e).toUpperCase()},V.trim=function(e,t,r){if((e=U(e))&&(r||t===n))return cn(e);if(!e||!(t=bi(t)))return e;var i=wn(e),a=wn(t);return Mi(i,fn(i,a),pn(i,a)+1).join(``)},V.trimEnd=function(e,t,r){if((e=U(e))&&(r||t===n))return e.slice(0,Tn(e)+1);if(!e||!(t=bi(t)))return e;var i=wn(e);return Mi(i,0,pn(i,wn(t))+1).join(``)},V.trimStart=function(e,t,r){if((e=U(e))&&(r||t===n))return e.replace(he,``);if(!e||!(t=bi(t)))return e;var i=wn(e);return Mi(i,fn(i,wn(t))).join(``)},V.truncate=function(e,t){var r=30,i=`...`;if(us(t)){var a=`separator`in t?t.separator:a;r=`length`in t?ws(t.length):r,i=`omission`in t?bi(t.omission):i}var o=(e=U(e)).length;if(_n(e)){var s=wn(e);o=s.length}if(r>=o)return e;var c=r-Cn(i);if(c<1)return i;var l=s?Mi(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),hs(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=ze(a.source,U(we.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(bi(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i},V.unescape=function(e){return(e=U(e))&&ae.test(e)?e.replace(re,En):e},V.uniqueId=function(e){var t=++Je;return U(e)+t},V.upperCase=ic,V.upperFirst=ac,V.each=Oo,V.eachRight=ko,V.first=to,gc(V,(Ec={},jr(V,function(e,t){qe.call(V.prototype,t)||(Ec[t]=e)}),Ec),{chain:!1}),V.VERSION=`4.17.21`,Rt([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){V[e].placeholder=V}),Rt([`drop`,`take`],function(e,t){tr.prototype[e]=function(r){r=r===n?1:An(ws(r),0);var i=this.__filtered__&&!t?new tr(this):this.clone();return i.__filtered__?i.__takeCount__=jn(r,i.__takeCount__):i.__views__.push({size:jn(r,f),type:e+(i.__dir__<0?`Right`:``)}),i},tr.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),Rt([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==1||n==3;tr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:H(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Rt([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);tr.prototype[e]=function(){return this[n](1).value()[0]}}),Rt([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);tr.prototype[e]=function(){return this.__filtered__?new tr(this):this[n](1)}}),tr.prototype.compact=function(){return this.filter(fc)},tr.prototype.find=function(e){return this.filter(e).head()},tr.prototype.findLast=function(e){return this.reverse().find(e)},tr.prototype.invokeMap=si(function(e,t){return typeof e==`function`?new tr(this):this.map(function(n){return Vr(n,e,t)})}),tr.prototype.reject=function(e){return this.filter(Go(H(e)))},tr.prototype.slice=function(e,t){e=ws(e);var r=this;return r.__filtered__&&(e>0||t<0)?new tr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ws(t))<0?r.dropRight(-t):r.take(t-e)),r)},tr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},tr.prototype.toArray=function(){return this.take(f)},jr(tr.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=V[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(V.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof tr,l=s[0],u=c||es(t),d=function(e){var t=a.apply(V,Gt([e],s));return i&&f?t[0]:t};u&&r&&typeof l==`function`&&l.length!=1&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,m=o&&!f,h=c&&!p;if(!o&&u){t=h?t:new tr(this);var g=e.apply(t,s);return g.__actions__.push({func:Co,args:[d],thisArg:n}),new er(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),Rt([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=He[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);V.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(es(i)?i:[],e)}return this[n](function(n){return t.apply(es(n)?n:[],e)})}}),jr(tr.prototype,function(e,t){var n=V[t];if(n){var r=n.name+``;qe.call(Un,r)||(Un[r]=[]),Un[r].push({name:t,func:n})}}),Un[Zi(n,2).name]=[{name:`wrapper`,func:n}],tr.prototype.clone=function(){var e=new tr(this.__wrapped__);return e.__actions__=Bi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Bi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Bi(this.__views__),e},tr.prototype.reverse=function(){if(this.__filtered__){var e=new tr(this);e.__dir__=-1,e.__filtered__=!0}else (e=this.clone()).__dir__*=-1;return e},tr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=es(e),r=t<0,i=n?e.length:0,a=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=jn(t,e+o);break;case`takeRight`:e=An(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=jn(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Ti(e,this.__actions__);var m=[];e:for(;c--&&f<p;){for(var h=-1,g=e[l+=t];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==2)g=b;else if(!b){if(y==1)continue e;break e}}m[f++]=g}return m},V.prototype.at=wo,V.prototype.chain=function(){return So(this)},V.prototype.commit=function(){return new er(this.value(),this.__chain__)},V.prototype.next=function(){this.__values__===n&&(this.__values__=Ss(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},V.prototype.plant=function(e){for(var t,r=this;r instanceof $n;){var i=Ja(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t},V.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof tr){var t=e;return this.__actions__.length&&(t=new tr(this)),(t=t.reverse()).__actions__.push({func:Co,args:[lo],thisArg:n}),new er(t,this.__chain__)}return this.thru(lo)},V.prototype.toJSON=V.prototype.valueOf=V.prototype.value=function(){return Ti(this.__wrapped__,this.__actions__)},V.prototype.first=V.prototype.head,dt&&(V.prototype[dt]=function(){return this}),V}();Et?((Et.exports=Dn)._=Dn,Tt._=Dn):wt._=Dn}).call(kl)}(Ol,Ol.exports)),Ol.exports),jl=e=>e.parentId===null||e.parentId===`null`||!e.parentId,Ml=async(e,t,n)=>{if(t?.itemType===`file`)return e;let r=[];if(!n)return e;{let e=await n({parentId:t.folderId});r=Array.isArray(e)?e:[]}let i=((e,t)=>{let n=Array.isArray(e)?e:[];return(r=t.folderId)&&r!==`root`&&r!==`folders`&&r!==`null`&&r!==null?n.filter(e=>e.parentId===t.folderId):n.filter(jl);var r})(r,t);if((t?.search)?.trim()){let e=t.search.trim().toLowerCase();i=i.filter(t=>t.name?.toLowerCase().includes(e))}if(i.length===0)return e;let a=i.map(e=>({id:e.id,name:e.name,size:void 0,date:`-`,isFolder:!0,folderId:e.parentId||``,type:``,selected:!1,extension:``,childCount:e.childCount}));if(t?.itemType===`folder`)return a;let o=e.filter(e=>!e.isFolder);return[...a,...o]},Nl=e=>{let{state:t,actions:n,options:r}=yl(),{searchTerm:i,sortBy:a,sortOrder:o,selectedFolder:c,pagination:l,pathHistory:u}=t,{setSearchTerm:d,setSortBy:f,setSortOrder:p,setPagination:m}=n,h=e||n.fetchFiles,g=(0,s.useRef)(null),_=(0,s.useRef)(Al.debounce(e=>{let t=JSON.stringify(e);g.current!==t&&(g.current=t,h?.(e))},150)).current,v=(0,s.useCallback)(()=>{let e=c||``;return e?[...Array.isArray(u)?u:[]].reverse().find(t=>t.id===e)?.name:void 0},[c,u]),y=(0,s.useCallback)(()=>{let e=r?.config?.disablePagination;return{folderId:c||``,folderName:v(),search:i?.trim()||void 0,page:e?void 0:l.current,limit:e?void 0:l.pageSize,sortBy:a,sortOrder:o,itemType:`all`}},[c,v,i,l.current,l.pageSize,a,o,r?.config?.disablePagination]),b=(0,s.useCallback)(e=>{d&&d(e),m&&m({current:1,pageSize:l.pageSize,total:0}),h&&h({folderId:c||``,folderName:v(),search:e?.trim()||void 0,page:r?.config?.disablePagination?void 0:1,limit:r?.config?.disablePagination?void 0:l.pageSize,sortBy:a,sortOrder:o,itemType:`all`})},[d,m,l.pageSize,h,c,v,a,o,r?.config?.disablePagination]),x=(0,s.useCallback)((e,t)=>{f?.(e),p?.(t),h&&_({folderId:c||``,folderName:v(),search:i?.trim()||void 0,page:r?.config?.disablePagination?void 0:l.current,limit:r?.config?.disablePagination?void 0:l.pageSize,sortBy:e,sortOrder:t,itemType:`all`})},[f,p,_,c,v,i,l.current,l.pageSize,r?.config?.disablePagination]),S=(0,s.useCallback)((e,t)=>{var n;(n=r?.config)!=null&&n.disablePagination||(m&&m({current:e,pageSize:t||l.pageSize,total:l.total}),h&&_({folderId:c||``,folderName:v(),search:i?.trim()||void 0,page:e,limit:t||l.pageSize,sortBy:a,sortOrder:o,itemType:`all`}))},[m,l.pageSize,l.total,_,c,v,i,a,o,r?.config?.disablePagination]);return(0,s.useEffect)(()=>{if(h){let e=y();_(Object.assign(Object.assign({},e),{page:1}))}},[c]),(0,s.useEffect)(()=>{h&&_(y())},[]),(0,s.useEffect)(()=>()=>{var e;(e=_.cancel)==null||e.call(_)},[_]),{state:{searchTerm:i||``,sortBy:a||`name`,sortOrder:o||`asc`},actions:{setSearchTerm:d||(()=>{}),setSortBy:f||(()=>{}),setSortOrder:p||(()=>{}),handleSearch:b,handleSort:x,handlePaginationChange:S,getCurrentQueryParams:y}}},Pl=new Map;function Fl(e){let t=`id`in e&&e.id!==void 0?String(e.id):`unknown`,n=`data`in e?e.data:void 0;return`${e.type}:${t}:${function(e){if(e==null)return``;try{return JSON.stringify(e,Object.keys(e).sort())}catch{return String(e)}}(n)}`}var Il=()=>{let{notification:e}=u.App.useApp(),{options:t}=yl(),n=(0,s.useCallback)(async e=>{let n;if(t.handleNotify){try{n=await t.handleNotify(e)}catch{}if(!1===n)return!1;typeof n==`object`&&n&&(e=n)}if(e.type===`error`&&t.handleError){try{n=await t.handleError(e)}catch{}if(!1===n)return!1;typeof n==`object`&&n&&(e=n)}if(e.type===`success`&&t.handleSuccess){try{n=await t.handleSuccess(e)}catch{}if(n)return!1}return n},[t]),r=(0,s.useCallback)(async function(r,i=!1){var a;try{r.visibility===void 0&&(r.visibility=!i);let o=await n(r);typeof o==`object`&&(r=o);let s=t.config?.notificationDedupeTtlMs??12e3,c=r.type===`error`&&!0===r.notificationDedupe;if(c&&function(e,t){if(t<=0)return;let n=Fl(e),r=Date.now(),i=Pl.get(n);i!==void 0&&r-i<t&&(e.visibility=!1)}(r,s),!(!1!==r.visibility&&!1!==o&&!1!==t.config?.showNotifications))return r;let l=e[r.type];typeof l==`function`&&(l(r),c&&(a=r,s<=0||Pl.set(Fl(a),Date.now())))}catch{}return r},[e,n,t.config?.notificationDedupeTtlMs,t.config?.showNotifications]);return(0,s.useMemo)(()=>({error:(e,t=!1)=>r(Object.assign(Object.assign({},e),{type:`error`}),t),success:(e,t=!1)=>r(Object.assign(Object.assign({},e),{type:`success`}),t),warning:(e,t=!1)=>r(Object.assign(Object.assign({},e),{type:`warning`}),t),notify:r}),[r])},Ll={FileNotFound:`File not found or no longer available.`,FileAlreadyExists:`File with this name already exists.`,FileInvalidName:`File name is not valid. Allowed characters: {{allowedChars}}`,FileAccessDenied:`You don't have permission to access this file.`,FileReadError:`Failed to read the file.`,FileWriteError:`Failed to write the file.`,FileTooLarge:`File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.`,FileTypeNotAllowed:`This file type is not allowed.`,FileCorrupted:`The file appears to be corrupted.`,FileChecksumMismatch:`File integrity check failed.`,FileStorageQuotaExceeded:`Storage quota exceeded. Please free up space.`,FileLocked:`File is locked by another process or user.`,FileVersionConflict:`File version conflict. Please refresh and try again.`,FolderNotFound:`Folder not found or no longer available.`,FolderAlreadyExists:`Folder with this name already exists.`,FolderInvalidName:`Folder name is not valid. Allowed characters: {{allowedChars}}`,FolderAccessDenied:`You don't have permission to access this folder.`,FolderReadError:`Failed to read the folder contents.`,FolderWriteError:`Failed to write to the folder.`,FolderQuotaExceeded:`Folder storage quota exceeded.`,FolderNotEmpty:`Folder is not empty.`,FolderBackendError:`Server error while processing the folder.`,FolderTimeout:`Folder operation took too long.`,RenameNotAllowed:`Renaming is not allowed for this item.`,MoveNotAllowed:`Moving is not allowed for this item.`,CopyNotAllowed:`Copying is not allowed for this item.`,DeleteNotAllowed:`Deleting is not allowed for this item.`,MoveIntoSelf:`Cannot move an item into itself.`,MoveIntoDescendant:`Cannot move an item into its descendant folder.`,CopyIntoSelf:`Cannot copy an item into itself.`,UnsupportedOperation:`This operation is not supported.`,ConfigError:`Configuration error occurred.`,FileUploadQuotaExceeded:`You have exceeded the upload quota.`,FileUploadNetworkError:`Network error while uploading the file.`,FileUploadTimeout:`File upload took too long.`,FileUploadBackendError:`Server error while uploading the file.`,UploadUrlInvalid:`The specified URL is not valid.`,UploadUrlNotReachable:`The specified URL is not reachable.`,UploadUrlContentTypeNotAllowed:`Content type at the URL is not allowed.`,UploadUrlDownloadFailed:`Failed to download file from the URL.`,FileLookupFailed:`Failed to find existing file by URL.`,FileProxyFailed:`Failed to load file through proxy.`,FileProxyNotConfigured:`File proxy is not configured.`,FileDownloadNetworkError:`Network error while downloading the file.`,FileDownloadTimeout:`File download took too long.`,FileDownloadBackendError:`Server error while downloading the file.`,BatchPartialFailure:`Some items could not be processed.`,BatchAllFailed:`Failed to process all items in the batch.`,BatchConflict:`Some items in the batch are in a conflicting state.`,BatchValidationFailed:`Some items in the batch did not pass validation.`,BatchItemLimitExceeded:`Batch operation exceeds the maximum number of items allowed.`,ValidationError:`Some of the provided data is invalid.`,PayloadTooLarge:`File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.`,UnsupportedMediaType:`This media type is not supported.`,NetworkError:`Network error. Please check your connection and try again.`,BackendError:`Server error. Please try again later.`,Timeout:`The operation took too long. Please try again.`,AuthenticationFailed:`Authentication failed. Please sign in again.`,AuthorizationFailed:`You are not allowed to perform this action.`,RateLimitExceeded:`Too many requests. Please try again a bit later.`,ServiceUnavailable:`Service is temporarily unavailable. Please try again later.`,AIResponseInvalid:`AI service returned an invalid response.`,AIImageGenerationFailed:`Failed to generate image using AI.`,AIImageGenerationLimitExceeded:`You have reached the AI image generation limit.`,IntegrationError:`Error in external integration.`,ThirdPartyError:`Error in a third-party service.`,UnknownError:`An unknown error occurred.`},Rl={FileTooLarge:`File is too large to upload.`,PayloadTooLarge:`File is too large to upload.`},zl=(e,t,n)=>{if(!e)return;let r=Ll[e];if(!r)return;let i=n?.fileSize??``,a=n?.maxSize??``;if((e===`FileTooLarge`||e===`PayloadTooLarge`)&&!(i&&a)){let n=Rl[e];return n?t(n):t(r,{fileSize:`?`,maxSize:`?`})}return t(r,{allowedChars:n?.allowedChars??`a-z A-Z 0-9 . _ -`,fileSize:i,maxSize:a})},Bl=e=>{if(!e||typeof e!=`string`)return;let t=e.toLowerCase();return(t.includes(`maximum number of files`)||t.includes(`number of files exceeded`))&&(t.includes(`allowed`)||t.includes(`received`))?`BatchItemLimitExceeded`:t.includes(`exceeds`)||t.includes(`maximum`)||t.includes(`too large`)||t.includes(`size limit`)||t.includes(`object size`)||t.includes(`размер`)||t.includes(`превышен`)?`PayloadTooLarge`:t.includes(`403`)||t.includes(`forbidden`)||t.includes(`access denied`)||t.includes(`доступ запрещён`)?`AuthorizationFailed`:t.includes(`404`)||t.includes(`not found`)||t.includes(`не найден`)?`UploadUrlNotReachable`:t.includes(`already exists`)||t.includes(`уже существует`)||t.includes(`дубликат`)?`FileAlreadyExists`:t.includes(`invalid`)&&(t.includes(`name`)||t.includes(`имя`)||t.includes(`назва`))?`FileInvalidName`:t.includes(`type`)&&(t.includes(`not allowed`)||t.includes(`не поддерживается`))?`FileTypeNotAllowed`:void 0},Vl=e=>{if(!e)return{message:`Unknown error`,raw:e};if(typeof e==`string`)return{message:e};if(e instanceof Error){let t=e;return{message:t.message??e.message,code:t.code,status:t.status??t.httpStatus,stack:t.stack??e.stack,raw:t.raw??e}}if(typeof e==`object`){let t=e,n=t.data??t,r=n?.data??n,i=t.message??n?.message??t.error??t.reason,a=t.status??t.httpStatus??r?.status??n?.status,o=t.code??n?.code,s=t.stack,c=t.raw??e,l=t.fileSize??r?.fileSize??n?.fileSize,u=t.maxSize??r?.maxSize??n?.maxSize;if(i||o||a||s||c)return Object.assign(Object.assign({message:i,code:o,status:a,stack:s,raw:c},l!=null&&{fileSize:l}),u!=null&&{maxSize:u})}return{message:String(e),raw:e}},Hl=(e,t,n)=>{let r=Vl(e),i=r?.code;if(i===`FileTooLarge`&&n?.fileSize!=null&&n?.maxSize!=null)return t(`File too large ({{size}}). Maximum allowed size: {{maxSize}}`,{size:pc(n.fileSize),maxSize:pc(n.maxSize)});if((i===`BatchItemLimitExceeded`||i===`exceeded_max_files`)&&r?.message){let{allowed:e,received:n}=function(e){let t=e.match(/Allowed:\s*(\d+)/i),n=e.match(/received:\s*(\d+)/i);return{allowed:t?parseInt(t[1],10):void 0,received:n?parseInt(n[1],10):void 0}}(r.message);if(e!=null&&n!=null)return t(`Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}`,{allowed:e,received:n})}return r?.message&&r.message!==`Unknown error`?r.message:zl(i,t,n?.fileSize!=null&&n?.maxSize!=null?{fileSize:pc(n.fileSize),maxSize:pc(n.maxSize)}:void 0)??t(`Error uploading file`)},Ul=e=>Vl(e)?.code===`path_folder_not_found`,Wl=[`file_get_contents`,`open stream`,`failed to open stream`,`http request failed`,`curl_error`],Gl=(e,t,n)=>{if(!e)return t(`Error when downloading a file by URL`);let r=zl((e=>{let t=Bl(e);if(t===`AuthorizationFailed`){let t=(e||``).toLowerCase();if(t.includes(`download`)||t.includes(`url`)||t.includes(`file_get_contents`)||t.includes(`failed to download`))return`UploadUrlNotReachable`}return t})(e?.message)??e?.code,t,n);if(r)return r;let i=e?.message&&typeof e.message==`string`?e.message.trim():null;return i&&function(e){if(!e||e.length>200)return!1;let t=e.toLowerCase();return!Wl.some(e=>t.includes(e))}(i)?i:t(`Failed to download file from the URL.`)},Kl=e=>Array.isArray(e)?e.filter(e=>e?.id&&e.id!==`folders`).map(e=>e.name).filter(Boolean).join(`/`):``,ql=e=>{let t=e.trim();if(!t)return``;let n=t.toLowerCase(),r=[n.indexOf(` and `),n.indexOf(` or `),t.indexOf(`,`),t.indexOf(`;`),n.indexOf(`. `)].filter(e=>e>=0);if(r.length===0)return t;let i=Math.min(...r);return t.slice(0,i).trim()||t},Jl=(e,t)=>{let n=(e=>{if(e&&typeof e==`object`){let t=e,n=t.data?.data?.path_folder??t.data?.path_folder;if(typeof n==`string`&&n.trim())return ql(n)||null}let t=Vl(e)?.message;if(!t)return null;let n=t.toLowerCase();for(let e of[`не существует:`,`not exists:`,`not exist:`,`not found:`]){let r=n.indexOf(e);if(r>=0)return ql(t.slice(r+e.length).trim())||null}for(let e of[`not exists `,`not exist `,`not found `]){let r=n.indexOf(e);if(r>=0)return ql(t.slice(r+e.length).trim())||null}return null})(e);return n?(e=>{let t=e.split(`/`).filter(Boolean);return t.length<=1?``:(t.pop(),t.join(`/`))})(n):Kl(t)},Yl=async e=>{let{options:t,pathFolder:n,dataProviders:r}=e;if(r?.clearCache)return void await r.clearCache(n||null);let i=t?.apiEndpoints?.clearCache;if(!i)return;let a=i.includes(`?`),o=i;n&&n.length>0&&(o=`${i}${a?`&`:`?`}path_folder=${encodeURIComponent(n)}`);let s=await fetch(o,{method:`POST`});if(!s.ok)throw Error(`Cache clear failed: ${s.status}`)},Xl=()=>{let{state:e,actions:t,options:n}=yl(),{t:r}=Ks(),i=Il(),{folders:a,selectedFolder:o,pathHistory:c,form:l,loading:u,isModalVisible:d}=e,{setFolders:f,setLoading:p,setIsModalVisible:h}=t,{dataProviders:g,config:_}=n,v=(0,s.useCallback)(e=>(Array.isArray(e)?e:[]).filter(e=>e&&e.id&&e.name).map(e=>({id:e.id,name:e.name,parentId:e.folderId?e.folderId:null})),[]),y=(0,s.useCallback)(async(e=!1)=>{p?.(!0);try{let e=[],t=_?.folderTreeLoading===`lazy`;if(!g?.getFolders){if(g?.getFiles){let e=async n=>{let{files:r}=await g.getFiles({itemType:`folder`,folderId:n??void 0}),i=v(r);if(t)return i;let a=await Promise.all(i.map(t=>e(t.id)));return[...i,...a.flat()]},n=await e(null);f&&f(e=>{let r=Array.isArray(e)?e:[];if(!t){let e=n;return e.filter(e=>e.id===e.parentId).length,e}let i=[...r.filter(e=>e.parentId),...n];return i.filter(e=>e.id===e.parentId).length,i});return}return}{let n=!t;e=await g.getFolders({parentId:null,deep:n})}let n=Array.isArray(e)?e:[];f?.(n),n.filter(e=>e.id===e.parentId).length}catch(t){let a=Vl(t);if(!e&&(a?.status===404||a?.code===`FileNotFound`)){let e=Jl(t,c||[]);try{await Yl({options:n,pathFolder:e,dataProviders:n?.dataProviders}),await y(!0);return}catch{}}let o=zl(a?.code,r);i.error({id:`FOLDERS_FETCH_FAILED`,message:o??r(`Failed to load folders`),description:r(`Folders`),placement:`bottomRight`,innerException:t,notificationDedupe:!0,data:{reason:t instanceof Error?t.message:String(t),folderId:null,folderName:r(`Folders`)}})}finally{p?.(!1)}},[g?.getFiles,g?.getFolders,f,p,_?.folderTreeLoading,v,i,r,c,n]),b=(0,s.useCallback)(()=>y(),[y]),x=(0,s.useCallback)(async e=>{try{let t,n;if(g?.getFolders){t=await g.getFolders({parentId:e,deep:!1});let r=Array.isArray(a)?a:[],i=new Set(t.map(e=>e.id)),o=r.filter(t=>t.parentId!==e||i.has(t.id));n=[...o,...t.filter(e=>!o.some(t=>t.id===e.id))]}else{if(!g?.getFiles)return[];{let{files:r}=await g.getFiles({itemType:`folder`,folderId:e??void 0});t=v(r);let i=Array.isArray(a)?a:[],o=new Set(t.map(e=>e.id)),s=i.filter(t=>t.parentId!==e||o.has(t.id));n=[...s,...t.filter(e=>!s.some(t=>t.id===e.id))]}}let r=n,i=0;for(;i!==r.length;){i=r.length;let e=new Set(r.map(e=>e.id));r=r.filter(t=>!t.parentId||e.has(t.parentId))}return f?.(r),t}catch{return[]}},[g,a,f,v]),S=(0,s.useCallback)(()=>{let e=_?.defaultFolderName??r(`New folder`);l.setFieldsValue({folderName:e}),h?.(!0)},[l,h,r,_?.defaultFolderName]),C=(0,s.useCallback)(async(e,n)=>{let i=[...(Array.isArray(a)?a:[]).filter(t=>t.id!==e.id),e];if(f?.(i),e.parentId&&(await x(e.parentId),await new Promise(e=>setTimeout(e,50))),!n?.preserveSelection&&t.setSelectedFolder&&t.setSelectedFolder(e.id),!n?.preserveSelection&&t.setPathHistory){let n=Array.isArray(i)?i:[],a=(e,t=new Set)=>{if(t.has(e))return[];let r=n.find(t=>t.id===e);if(!r)return[];let i=new Set(t);return i.add(e),r.parentId?[...a(r.parentId,i),{id:r.id,name:r.name}]:[{id:r.id,name:r.name}]},o=a(e.id),s=[{id:`folders`,name:r(`Folders`)},...o];t.setPathHistory(s)}},[a,f,t,e.pathHistory,x,r]),w=(0,s.useCallback)(async e=>{try{if(g?.getFolders){let t=await g.getFolders();return(Array.isArray(t)?t:[]).some(t=>t.id===e)}if(g?.getFiles){let t=new Set,n=async r=>{let{files:i}=await g.getFiles({itemType:`folder`,folderId:r??void 0}),a=v(i);for(let r of a)if(!t.has(r.id)&&(t.add(r.id),r.id===e||await n(r.id)))return!0;return!1};return await n(null)}}catch{}return!1},[g?.getFolders,g?.getFiles,v]),T=(0,s.useCallback)(async e=>{let t,n,s=null;try{let u=await(e?e.validateFields():l.validateFields());if(t=u.folderName.trim(),!t){let e=u.targetFolder||(o&&o!==`folders`?o:null);i.warning({id:`FOLDER_OPERATION_VALIDATION_FAILED`,message:r(`Folder name cannot be empty`),placement:`bottomRight`,data:{folderName:t,folderId:e??null,reason:`emptyName`,is_force_create:!!u.is_force_create}});return}n=Ro(t,_);let d=u.targetFolder;if(d)s=d===`folders`?null:d;else if(o&&o!==`folders`)s=o;else if(Array.isArray(c)&&c.length>1){let e=c[c.length-1];s=e?.id&&e.id!==`folders`?e.id:null}if(zo(_)&&g?.getFolders)try{if((await g.getFolders({parentId:s,deep:!1})||[]).map(e=>e.name?.toLowerCase()).filter(Boolean).includes(t.trim().toLowerCase()))return void i.error({id:`FOLDER_ALREADY_EXISTS`,message:r(`A folder with that name already exists. Please enter a different folder name.`),placement:`bottomRight`,data:{folderName:t,folderId:s}})}catch{}let p;if(!g?.createFolder)return void i.error({id:`FOLDER_CREATE_PROVIDER_NOT_CONFIGURED`,message:r(`Folder creation provider is not configured`),placement:`bottomRight`,data:{folderName:n,folderId:s??null,is_force_create:!!u.is_force_create}});p=await g.createFolder({name:n,parentId:s,is_force_create:!!u.is_force_create}),(e=>{if(!e||!e.id)throw Error(r(`Invalid server response: folder ID is missing`));if(e.id===e.parentId&&e.parentId)throw Error(r(`Error: folder cannot be its own parent`))})(p);let m={id:p.id,name:p.name,parentId:s??null,childCount:p.childCount},v=[...(Array.isArray(a)?a:[]).filter(e=>e.id!==m.id),m];if(f?.(v),i.success({id:`FOLDER_CREATE_SUCCESS`,message:r(`Folder created`),placement:`bottomRight`,data:{itemIds:[m.id],folderId:m.parentId??null,folderName:m.name}}),e||h==null||h(!1),(async()=>{try{await C(m,{preserveSelection:!!e}),await b(),await new Promise(e=>setTimeout(e,200)),await w(p.id)}catch{}})(),e)return p}catch(e){let a=zl(Vl(e)?.code,r);i.error({id:`FOLDER_CREATE_FAILED`,message:a??r(`Failed to create folder`),placement:`bottomRight`,innerException:e,data:{folderName:n||t,folderId:s??null,reason:e instanceof Error?e.message:String(e)}})}},[l,o,g,C,b,w,h,i,r,a,f,_,c]),E=(0,s.useCallback)(()=>{h?.(!1)},[h]),D=(0,s.useCallback)((e,t=new Set)=>{let n=Array.isArray(a)?a:[];return e.map(e=>{if(t.has(e.id))return{key:e.id,label:e.name+` `+r(`(error)`),icon:s.createElement(m.FolderOutlined,{style:{color:`red`}})};let i=new Set(t);i.add(e.id);let a=n.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:a.length>0?D(a,i):void 0}})},[a]),O=(0,s.useCallback)(()=>{let e=Array.isArray(a)?a:[],t={key:`folders`,label:r(`Folders`),children:[]};return t.children=D(e.filter(e=>e.parentId===null||!e.parentId)),[t]},[a,r,D]),k=(0,s.useCallback)(async(e,o)=>{let s;try{let c=o.trim(),l=a?.find(t=>t.id===e);if(!c)return void i.warning({id:`FOLDER_OPERATION_VALIDATION_FAILED`,message:r(`Folder name cannot be empty`),placement:`bottomRight`,data:{folderId:e,folderName:o,reason:`emptyName`}});if(s=Ro(c,_),!1===_?.features?.enableRenameFolder)return void i.error({id:`FOLDER_RENAME_DISABLED_BY_CONFIG`,message:r(`Folder rename is disabled by config`),placement:`bottomRight`,data:{itemId:e,itemName:l?.name??s}});if(!n.dataProviders?.renameFolder)return void i.error({id:`FOLDER_RENAME_FAILED`,message:r(`Folder rename provider is not configured`),placement:`bottomRight`,data:{itemId:e,itemName:s,error:{message:`providerNotConfigured`}}});let u=await n.dataProviders.renameFolder(e,s);if(!u?.id)return void i.error({id:`FOLDER_RENAME_FAILED`,message:r(`Unexpected response when renaming folder`),placement:`bottomRight`,data:{itemId:e,itemName:s,error:{message:`invalidResponse`}}});await b(),e!==u.id&&t.setSelectedFolder&&t.setSelectedFolder(u.id),i.success({id:`FOLDER_RENAME_SUCCESS`,message:r(`Folder renamed`),placement:`bottomRight`,data:{itemId:u.id,itemName:u.name,folderId:u.parentId??null}})}catch(t){i.error({id:`FOLDER_RENAME_FAILED`,message:r(`Failed to rename folder`),placement:`bottomRight`,innerException:t,data:{itemId:e,itemName:s||o,error:{message:t instanceof Error?t.message:String(t)}}})}},[b,a,n.dataProviders?.renameFolder,_?.features?.enableRenameFolder,_,t.setSelectedFolder,i,r]);return{state:{folders:a,isCreatingFolder:d,loading:u},actions:{fetchFolders:b,fetchChildFolders:x,handleCreateFolder:S,handleModalOk:T,handleModalCancel:E,generateMenuItems:O,renameFolder:k}}},Zl=()=>{let{options:e,actions:t}=yl(),{dataProviders:n,config:r}=e,{setUndoDeletion:i}=t,{t:a}=Ks(),o=Il();return{deleteItems:(0,s.useCallback)(async({items:e,selectedFolder:t,getItemNameById:s,showNotifications:c=!1})=>{let l=0,u=0,d=[],f=async t=>{if(n?.deleteItems)try{let r=await n.deleteItems(e.map(e=>e.id),{permanent:t}),i=r.detailed;if(i){let e=i.filter(e=>e.success),t=i.filter(e=>!e.success),n=t.filter(e=>Ul(e.innerException??e.error)),r=t.filter(e=>!Ul(e.innerException??e.error));l+=e.length+n.length,u+=r.length,r.forEach(e=>{let t=(e=>e.requestId??e.id)(e),n=Vl(e.innerException??e.error);d.push({itemId:t,itemName:s(t),error:n})});return}if(r.success)l+=e.length;else{let t=r.error;if(Ul(t))l+=e.length;else if(t){u+=e.length;let n=Vl(t);d.push({error:n})}else u+=e.length}return}catch(t){if(Ul(t))l+=e.length;else{u+=e.length;let n=Vl(t);d.push({error:n})}}},p=r?.enableTrashFolder&&t===`Trash`;return r?.enableTrashFolder&&!p?await f(!1):await f(!0),l>0&&r!=null&&r.enableTrashFolder&&!p&&i?.({itemIds:e.map(e=>e.id),sourceFolderId:t||`folders`}),c&&(l>0&&o.success({id:`FILES_DELETE_SUCCESS`,message:a(`Files deleted`),placement:`bottomRight`,data:{successCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:t||null}}),u>0&&o.error({id:`FILES_DELETE_ERROR`,message:a(`Error when deleting a file`),placement:`bottomRight`,data:{failCount:u,totalCount:e.length,itemIds:e.map(e=>e.id),itemNames:e.map(e=>s(e.id)),folderId:t||null,errors:d}})),{successCount:l,failCount:u,errorDetails:d}},[n,r,i,a,o])}},Ql=class e extends Error{constructor(t,n,r,i){super(t),this.code=n,this.status=r,this.details=i,this.name=`FileManagerApiError`,Error.captureStackTrace&&Error.captureStackTrace(this,e)}},$l=/^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i,eu=/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;function tu(e,t){let n=e.trim();if(!n)throw new Ql(t(`Enter the URL of the image`),`UploadUrlInvalid`);if(n.length>8192)throw new Ql(t(`URL too long`),`UploadUrlInvalid`);let r;try{r=new URL(n)}catch{throw new Ql(t(`The specified URL is not valid.`),`UploadUrlInvalid`)}let i=r.protocol.toLowerCase();if(i!==`http:`&&i!==`https:`)throw new Ql(t(`Only http and https URLs are supported`),`UploadUrlInvalid`);let a=r.hostname.toLowerCase();if($l.test(a)&&(typeof window>`u`||!$l.test(window.location.hostname.toLowerCase()))||eu.test(a))throw new Ql(t(`Private and local URLs are not allowed`),`UploadUrlInvalid`)}function nu(e,t){return new Promise(function(n,r){let i;return ru(e).then(function(e){try{return i=e,n(new Blob([t.slice(0,2),i,t.slice(2)],{type:`image/jpeg`}))}catch(e){return r(e)}},r)})}var ru=e=>new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`load`,({target:{result:e}})=>{let r=new DataView(e),i=0;if(r.getUint16(i)!==65496)return n(`not a valid JPEG`);for(i+=2;;){let a=r.getUint16(i);if(a===65498)break;let o=r.getUint16(i+2);if(a===65505&&r.getUint32(i+4)===1165519206){let a=i+10,s;switch(r.getUint16(a)){case 18761:s=!0;break;case 19789:s=!1;break;default:return n(`TIFF header contains invalid endian`)}if(r.getUint16(a+2,s)!==42)return n(`TIFF header contains invalid version`);let c=r.getUint32(a+4,s),l=a+c+2+12*r.getUint16(a+c,s);for(let e=a+c+2;e<l;e+=12)if(r.getUint16(e,s)==274){if(r.getUint16(e+2,s)!==3)return n(`Orientation data type is invalid`);if(r.getUint32(e+4,s)!==1)return n(`Orientation data count is invalid`);r.setUint16(e+8,1,s);break}return t(e.slice(i,i+2+o))}i+=2+o}return t(new Blob)}),r.readAsArrayBuffer(e)}),iu={},au={get exports(){return iu},set exports(e){iu=e}};(function(){var e,t,n={};au.exports=n,n.parse=function(e,t){for(var r=n.bin.readUshort,i=n.bin.readUint,a=0,o={},s=new Uint8Array(e),c=s.length-4;i(s,c)!=101010256;)c--;a=c,a+=4;var l=r(s,a+=4);r(s,a+=2);var u=i(s,a+=2),d=i(s,a+=4);a+=4,a=d;for(var f=0;f<l;f++){i(s,a),a+=4,a+=4,a+=4,i(s,a+=4),u=i(s,a+=4);var p=i(s,a+=4),m=r(s,a+=4),h=r(s,a+2),g=r(s,a+4);a+=6;var _=i(s,a+=8);a+=4,a+=m+h+g,n._readLocal(s,_,o,u,p,t)}return o},n._readLocal=function(e,t,r,i,a,o){var s=n.bin.readUshort,c=n.bin.readUint;c(e,t),s(e,t+=4),s(e,t+=2);var l=s(e,t+=2);c(e,t+=2),c(e,t+=4),t+=4;var u=s(e,t+=8),d=s(e,t+=2);t+=2;var f=n.bin.readUTF8(e,t,u);if(t+=u,t+=d,o)r[f]={size:a,csize:i};else{var p=new Uint8Array(e.buffer,t);if(l==0)r[f]=new Uint8Array(p.buffer.slice(t,t+i));else{if(l!=8)throw`unknown compression method: `+l;var m=new Uint8Array(a);n.inflateRaw(p,m),r[f]=m}}},n.inflateRaw=function(e,t){return n.F.inflate(e,t)},n.inflate=function(e,t){return e[0],e[1],n.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},n.deflate=function(e,t){t??={level:6};var r=0,i=new Uint8Array(50+Math.floor(1.1*e.length));i[r]=120,i[r+1]=156,r+=2,r=n.F.deflateRaw(e,i,r,t.level);var a=n.adler(e,0,e.length);return i[r+0]=a>>>24&255,i[r+1]=a>>>16&255,i[r+2]=a>>>8&255,i[r+3]=a>>>0&255,new Uint8Array(i.buffer,0,r+4)},n.deflateRaw=function(e,t){t??={level:6};var r=new Uint8Array(50+Math.floor(1.1*e.length)),i=n.F.deflateRaw(e,r,i,t.level);return new Uint8Array(r.buffer,0,i)},n.encode=function(e,t){t??=!1;var r=0,i=n.bin.writeUint,a=n.bin.writeUshort,o={};for(var s in e){var c=!n._noNeed(s)&&!t,l=e[s],u=n.crc.crc(l,0,l.length);o[s]={cpr:c,usize:l.length,crc:u,file:c?n.deflateRaw(l):l}}for(var s in o)r+=o[s].file.length+30+46+2*n.bin.sizeUTF8(s);r+=22;var d=new Uint8Array(r),f=0,p=[];for(var s in o){var m=o[s];p.push(f),f=n._writeHeader(d,f,s,m,0)}var h=0,g=f;for(var s in o)m=o[s],p.push(f),f=n._writeHeader(d,f,s,m,1,p[h++]);var _=f-g;return i(d,f,101010256),f+=4,a(d,f+=4,h),a(d,f+=2,h),i(d,f+=2,_),i(d,f+=4,g),f+=4,f+=2,d.buffer},n._noNeed=function(e){var t=e.split(`.`).pop().toLowerCase();return`png,jpg,jpeg,zip`.indexOf(t)!=-1},n._writeHeader=function(e,t,r,i,a,o){var s=n.bin.writeUint,c=n.bin.writeUshort,l=i.file;return s(e,t,a==0?67324752:33639248),t+=4,a==1&&(t+=2),c(e,t,20),c(e,t+=2,0),c(e,t+=2,i.cpr?8:0),s(e,t+=2,0),s(e,t+=4,i.crc),s(e,t+=4,l.length),s(e,t+=4,i.usize),c(e,t+=4,n.bin.sizeUTF8(r)),c(e,t+=2,0),t+=2,a==1&&(t+=2,t+=2,s(e,t+=6,o),t+=4),t+=n.bin.writeUTF8(e,t,r),a==0&&(e.set(l,t),t+=l.length),t},n.crc={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,r=0;r<8;r++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update:function(e,t,r,i){for(var a=0;a<i;a++)e=n.crc.table[255&(e^t[r+a])]^e>>>8;return e},crc:function(e,t,r){return 4294967295^n.crc.update(4294967295,e,t,r)}},n.adler=function(e,t,n){for(var r=1,i=0,a=t,o=t+n;a<o;){for(var s=Math.min(a+5552,o);a<s;)i+=r+=e[a++];r%=65521,i%=65521}return i<<16|r},n.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255,e[t+2]=n>>16&255,e[t+3]=n>>24&255},readASCII:function(e,t,n){for(var r=``,i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},pad:function(e){return e.length<2?`0`+e:e},readUTF8:function(e,t,r){for(var i,a=``,o=0;o<r;o++)a+=`%`+n.bin.pad(e[t+o].toString(16));try{i=decodeURIComponent(a)}catch{return n.bin.readASCII(e,t,r)}return i},writeUTF8:function(e,t,n){for(var r=n.length,i=0,a=0;a<r;a++){var o=n.charCodeAt(a);if(4294967168&o)if(4294965248&o)if(4294901760&o){if(4292870144&o)throw`e`;e[t+i]=240|o>>18,e[t+i+1]=128|o>>12&63,e[t+i+2]=128|o>>6&63,e[t+i+3]=128|63&o,i+=4}else e[t+i]=224|o>>12,e[t+i+1]=128|o>>6&63,e[t+i+2]=128|63&o,i+=3;else e[t+i]=192|o>>6,e[t+i+1]=128|63&o,i+=2;else e[t+i]=o,i++}return i},sizeUTF8:function(e){for(var t=e.length,n=0,r=0;r<t;r++){var i=e.charCodeAt(r);if(4294967168&i)if(4294965248&i)if(4294901760&i){if(4292870144&i)throw`e`;n+=4}else n+=3;else n+=2;else n++}return n}},n.F={},n.F.deflateRaw=function(e,t,r,i){var a=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][i],o=n.F.U,s=n.F._goodIndex;n.F._hash;var c=n.F._putsE,l=0,u=r<<3,d=0,f=e.length;if(i==0){for(;l<f;)c(t,u,+(l+(w=Math.min(65535,f-l))==f)),u=n.F._copyExact(e,l,w,t,u+8),l+=w;return u>>>3}var p=o.lits,m=o.strt,h=o.prev,g=0,_=0,v=0,y=0,b=0,x=0;for(f>2&&(m[x=n.F._hash(e,0)]=0),l=0;l<f;l++){if(b=x,l+1<f-2){x=n.F._hash(e,l+1);var S=l+1&32767;h[S]=m[x],m[x]=S}if(d<=l){(g>14e3||_>26697)&&f-l>100&&(d<l&&(p[g]=l-d,g+=2,d=l),u=n.F._writeBlock(+(l==f-1||d==f),p,g,y,e,v,l-v,t,u),g=_=y=0,v=l);var C=0;l<f-2&&(C=n.F._bestMatch(e,l,h,b,Math.min(a[2],f-l),a[3]));var w=C>>>16,T=65535&C;if(C!=0){T=65535&C;var E=s(w=C>>>16,o.of0);o.lhst[257+E]++;var D=s(T,o.df0);o.dhst[D]++,y+=o.exb[E]+o.dxb[D],p[g]=w<<23|l-d,p[g+1]=T<<16|E<<8|D,g+=2,d=l+w}else o.lhst[e[l]]++;_++}}for(v==l&&e.length!=0||(d<l&&(p[g]=l-d,g+=2,d=l),u=n.F._writeBlock(1,p,g,y,e,v,l-v,t,u),g=0,_=0,g=_=y=0,v=l);7&u;)u++;return u>>>3},n.F._bestMatch=function(e,t,r,i,a,o){var s=32767&t,c=r[s],l=s-c+32768&32767;if(c==s||i!=n.F._hash(e,t-l))return 0;for(var u=0,d=0,f=Math.min(32767,t);l<=f&&--o!=0&&c!=s;){if(u==0||e[t+u]==e[t+u-l]){var p=n.F._howLong(e,t,l);if(p>u){if(d=l,(u=p)>=a)break;l+2<p&&(p=l+2);for(var m=0,h=0;h<p-2;h++){var g=t-l+h+32768&32767,_=g-r[g]+32768&32767;_>m&&(m=_,c=g)}}}l+=(s=c)-(c=r[s])+32768&32767}return u<<16|d},n.F._howLong=function(e,t,n){if(e[t]!=e[t-n]||e[t+1]!=e[t+1-n]||e[t+2]!=e[t+2-n])return 0;var r=t,i=Math.min(e.length,t+258);for(t+=3;t<i&&e[t]==e[t-n];)t++;return t-r},n.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},n.saved=0,n.F._writeBlock=function(e,t,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y=n.F.U,b=n.F._putsF,x=n.F._putsE;y.lhst[256]++,d=(u=n.F.getTrees())[0],f=u[1],p=u[2],m=u[3],h=u[4],g=u[5],_=u[6],v=u[7];var S=32+(l+3&7?8-(l+3&7):0)+(s<<3),C=i+n.F.contSize(y.fltree,y.lhst)+n.F.contSize(y.fdtree,y.dhst),w=i+n.F.contSize(y.ltree,y.lhst)+n.F.contSize(y.dtree,y.dhst);w+=14+3*g+n.F.contSize(y.itree,y.ihst)+(2*y.ihst[16]+3*y.ihst[17]+7*y.ihst[18]);for(var T=0;T<286;T++)y.lhst[T]=0;for(T=0;T<30;T++)y.dhst[T]=0;for(T=0;T<19;T++)y.ihst[T]=0;var E=S<C&&S<w?0:C<w?1:2;if(b(c,l,e),b(c,l+1,E),l+=3,E==0){for(;7&l;)l++;l=n.F._copyExact(a,o,s,c,l)}else{var D,O;if(E==1&&(D=y.fltree,O=y.fdtree),E==2){n.F.makeCodes(y.ltree,d),n.F.revCodes(y.ltree,d),n.F.makeCodes(y.dtree,f),n.F.revCodes(y.dtree,f),n.F.makeCodes(y.itree,p),n.F.revCodes(y.itree,p),D=y.ltree,O=y.dtree,x(c,l,m-257),x(c,l+=5,h-1),x(c,l+=5,g-4),l+=4;for(var k=0;k<g;k++)x(c,l+3*k,y.itree[1+(y.ordr[k]<<1)]);l+=3*g,l=n.F._codeTiny(_,y.itree,c,l),l=n.F._codeTiny(v,y.itree,c,l)}for(var A=o,j=0;j<r;j+=2){for(var M=t[j],N=M>>>23,P=A+(8388607&M);A<P;)l=n.F._writeLit(a[A++],D,c,l);if(N!=0){var F=t[j+1],I=F>>16,L=F>>8&255,R=255&F;x(c,l=n.F._writeLit(257+L,D,c,l),N-y.of0[L]),l+=y.exb[L],b(c,l=n.F._writeLit(R,O,c,l),I-y.df0[R]),l+=y.dxb[R],A+=N}}l=n.F._writeLit(256,D,c,l)}return l},n.F._copyExact=function(e,t,n,r,i){var a=i>>>3;return r[a]=n,r[a+1]=n>>>8,r[a+2]=255-r[a],r[a+3]=255-r[a+1],a+=4,r.set(new Uint8Array(e.buffer,t,n),a),i+(n+4<<3)},n.F.getTrees=function(){for(var e=n.F.U,t=n.F._hufTree(e.lhst,e.ltree,15),r=n.F._hufTree(e.dhst,e.dtree,15),i=[],a=n.F._lenCodes(e.ltree,i),o=[],s=n.F._lenCodes(e.dtree,o),c=0;c<i.length;c+=2)e.ihst[i[c]]++;for(c=0;c<o.length;c+=2)e.ihst[o[c]]++;for(var l=n.F._hufTree(e.ihst,e.itree,7),u=19;u>4&&e.itree[1+(e.ordr[u-1]<<1)]==0;)u--;return[t,r,l,a,s,u,i,o]},n.F.getSecond=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(e[n+1]);return t},n.F.nonZero=function(e){for(var t=``,n=0;n<e.length;n+=2)e[n+1]!=0&&(t+=(n>>1)+`,`);return t},n.F.contSize=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[1+(r<<1)];return n},n.F._codeTiny=function(e,t,r,i){for(var a=0;a<e.length;a+=2){var o=e[a],s=e[a+1];i=n.F._writeLit(o,t,r,i);var c=o==16?2:o==17?3:7;o>15&&(n.F._putsE(r,i,s,c),i+=c)}return i},n.F._lenCodes=function(e,t){for(var n=e.length;n!=2&&e[n-1]==0;)n-=2;for(var r=0;r<n;r+=2){var i=e[r+1],a=r+3<n?e[r+3]:-1,o=r+5<n?e[r+5]:-1,s=r==0?-1:e[r-1];if(i==0&&a==i&&o==i){for(var c=r+5;c+2<n&&e[c+2]==i;)c+=2;(l=Math.min(c+1-r>>>1,138))<11?t.push(17,l-3):t.push(18,l-11),r+=2*l-2}else if(i==s&&a==i&&o==i){for(c=r+5;c+2<n&&e[c+2]==i;)c+=2;var l=Math.min(c+1-r>>>1,6);t.push(16,l-3),r+=2*l-2}else t.push(i,0)}return n>>>1},n.F._hufTree=function(e,t,r){var i=[],a=e.length,o=t.length,s=0;for(s=0;s<o;s+=2)t[s]=0,t[s+1]=0;for(s=0;s<a;s++)e[s]!=0&&i.push({lit:s,f:e[s]});var c=i.length,l=i.slice(0);if(c==0)return 0;if(c==1){var u=i[0].lit;return l=+(u==0),t[1+(u<<1)]=1,t[1+(l<<1)]=1,1}i.sort(function(e,t){return e.f-t.f});var d=i[0],f=i[1],p=0,m=1,h=2;for(i[0]={lit:-1,f:d.f+f.f,l:d,r:f,d:0};m!=c-1;)d=p!=m&&(h==c||i[p].f<i[h].f)?i[p++]:i[h++],f=p!=m&&(h==c||i[p].f<i[h].f)?i[p++]:i[h++],i[m++]={lit:-1,f:d.f+f.f,l:d,r:f};var g=n.F.setDepth(i[m-1],0);for(g>r&&(n.F.restrictDepth(l,r,g),g=r),s=0;s<c;s++)t[1+(l[s].lit<<1)]=l[s].d;return g},n.F.setDepth=function(e,t){return e.lit==-1?Math.max(n.F.setDepth(e.l,t+1),n.F.setDepth(e.r,t+1)):(e.d=t,t)},n.F.restrictDepth=function(e,t,n){var r=0,i=1<<n-t,a=0;for(e.sort(function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d}),r=0;r<e.length&&e[r].d>t;r++){var o=e[r].d;e[r].d=t,a+=i-(1<<n-o)}for(a>>>=n-t;a>0;)(o=e[r].d)<t?(e[r].d++,a-=1<<t-o-1):r++;for(;r>=0;r--)e[r].d==t&&a<0&&(e[r].d--,a++)},n.F._goodIndex=function(e,t){var n=0;return t[16|n]<=e&&(n|=16),t[8|n]<=e&&(n|=8),t[4|n]<=e&&(n|=4),t[2|n]<=e&&(n|=2),t[1|n]<=e&&(n|=1),n},n.F._writeLit=function(e,t,r,i){return n.F._putsF(r,i,t[e<<1]),i+t[1+(e<<1)]},n.F.inflate=function(e,t){var r=Uint8Array;if(e[0]==3&&e[1]==0)return t||new r(0);var i=n.F,a=i._bitsF,o=i._bitsE,s=i._decodeTiny,c=i.makeCodes,l=i.codes2map,u=i._get17,d=i.U,f=t==null;f&&(t=new r(e.length>>>2<<3));for(var p,m,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=0,C=0;h==0;)if(h=a(e,C,1),g=a(e,C+1,2),C+=3,g!=0){if(f&&(t=n.F._check(t,S+(1<<17))),g==1&&(p=d.flmap,m=d.fdmap,b=511,x=31),g==2){_=o(e,C,5)+257,v=o(e,C+5,5)+1,y=o(e,C+10,4)+4,C+=14;for(var w=0;w<38;w+=2)d.itree[w]=0,d.itree[w+1]=0;var T=1;for(w=0;w<y;w++){var E=o(e,C+3*w,3);d.itree[1+(d.ordr[w]<<1)]=E,E>T&&(T=E)}C+=3*y,c(d.itree,T),l(d.itree,T,d.imap),p=d.lmap,m=d.dmap,C=s(d.imap,(1<<T)-1,_+v,e,C,d.ttree);var D=i._copyOut(d.ttree,0,_,d.ltree);b=(1<<D)-1;var O=i._copyOut(d.ttree,_,v,d.dtree);x=(1<<O)-1,c(d.ltree,D),l(d.ltree,D,p),c(d.dtree,O),l(d.dtree,O,m)}for(;;){var k=p[u(e,C)&b];C+=15&k;var A=k>>>4;if(!(A>>>8))t[S++]=A;else{if(A==256)break;var j=S+A-254;if(A>264){var M=d.ldef[A-257];j=S+(M>>>3)+o(e,C,7&M),C+=7&M}var N=m[u(e,C)&x];C+=15&N;var P=N>>>4,F=d.ddef[P],I=(F>>>4)+a(e,C,15&F);for(C+=15&F,f&&(t=n.F._check(t,S+(1<<17)));S<j;)t[S]=t[S++-I],t[S]=t[S++-I],t[S]=t[S++-I],t[S]=t[S++-I];S=j}}}else{7&C&&(C+=8-(7&C));var L=4+(C>>>3),R=e[L-4]|e[L-3]<<8;f&&(t=n.F._check(t,S+R)),t.set(new r(e.buffer,e.byteOffset+L,R),S),C=L+R<<3,S+=R}return t.length==S?t:t.slice(0,S)},n.F._check=function(e,t){var n=e.length;if(t<=n)return e;var r=new Uint8Array(Math.max(n<<1,t));return r.set(e,0),r},n.F._decodeTiny=function(e,t,r,i,a,o){for(var s=n.F._bitsE,c=n.F._get17,l=0;l<r;){var u=e[c(i,a)&t];a+=15&u;var d=u>>>4;if(d<=15)o[l]=d,l++;else{var f=0,p=0;d==16?(p=3+s(i,a,2),a+=2,f=o[l-1]):d==17?(p=3+s(i,a,3),a+=3):d==18&&(p=11+s(i,a,7),a+=7);for(var m=l+p;l<m;)o[l]=f,l++}}return a},n.F._copyOut=function(e,t,n,r){for(var i=0,a=0,o=r.length>>>1;a<n;){var s=e[a+t];r[a<<1]=0,r[1+(a<<1)]=s,s>i&&(i=s),a++}for(;a<o;)r[a<<1]=0,r[1+(a<<1)]=0,a++;return i},n.F.makeCodes=function(e,t){for(var r,i,a,o,s=n.F.U,c=e.length,l=s.bl_count,u=0;u<=t;u++)l[u]=0;for(u=1;u<c;u+=2)l[e[u]]++;var d=s.next_code;for(r=0,l[0]=0,i=1;i<=t;i++)r=r+l[i-1]<<1,d[i]=r;for(a=0;a<c;a+=2)(o=e[a+1])!=0&&(e[a]=d[o],d[o]++)},n.F.codes2map=function(e,t,r){for(var i=e.length,a=n.F.U.rev15,o=0;o<i;o+=2)if(e[o+1]!=0)for(var s=o>>1,c=e[o+1],l=s<<4|c,u=t-c,d=e[o]<<u,f=d+(1<<u);d!=f;)r[a[d]>>>15-t]=l,d++},n.F.revCodes=function(e,t){for(var r=n.F.U.rev15,i=15-t,a=0;a<e.length;a+=2)e[a]=r[e[a]<<t-e[a+1]]>>>i},n.F._putsE=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},n.F._putsF=function(e,t,n){n<<=7&t;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},n.F._bitsE=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},n.F._bitsF=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},n.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},n.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},n.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=n.F.U,t=0;t<32768;t++){var r=t;r=(4278255360&(r=(4042322160&(r=(3435973836&(r=(2863311530&r)>>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8,e.rev15[t]=(r>>>16|r<<16)>>>17}function i(e,t,n){for(;t--!=0;)e.push(0,n)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),n.F.makeCodes(e.fltree,9),n.F.codes2map(e.fltree,9,e.flmap),n.F.revCodes(e.fltree,9),i(e.fdtree,32,5),n.F.makeCodes(e.fdtree,5),n.F.codes2map(e.fdtree,5,e.fdmap),n.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}()})();var ou=function(e,t){return t.forEach(function(t){t&&typeof t!=`string`&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}({__proto__:null,default:iu},[iu]),su=function(){var e={nextZero(e,t){for(;e[t]!=0;)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,n){e[t]=n>>8&255,e[t+1]=255&n},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=255&n},readASCII(e,t,n){let r=``;for(let i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},writeASCII(e,t,n){for(let r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},readBytes(e,t,n){let r=[];for(let i=0;i<n;i++)r.push(e[t+i]);return r},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,n,r){let i,a=``;for(let i=0;i<r;i++)a+=`%${e.pad(t[n+i].toString(16))}`;try{i=decodeURIComponent(a)}catch{return e.readASCII(t,n,r)}return i}};function t(t,n,r,i){let o=n*r,s=a(i),c=Math.ceil(n*s/8),l=new Uint8Array(4*o),u=new Uint32Array(l.buffer),{ctype:d}=i,{depth:f}=i,p=e.readUshort;if(d==6){let e=o<<2;if(f==8)for(var m=0;m<e;m+=4)l[m]=t[m],l[m+1]=t[m+1],l[m+2]=t[m+2],l[m+3]=t[m+3];if(f==16)for(m=0;m<e;m++)l[m]=t[m<<1]}else if(d==2){let e=i.tabs.tRNS;if(e==null){if(f==8)for(m=0;m<o;m++){var h=3*m;u[m]=255<<24|t[h+2]<<16|t[h+1]<<8|t[h]}if(f==16)for(m=0;m<o;m++)h=6*m,u[m]=255<<24|t[h+4]<<16|t[h+2]<<8|t[h]}else{var g=e[0];let n=e[1],r=e[2];if(f==8)for(m=0;m<o;m++){var _=m<<2;h=3*m,u[m]=255<<24|t[h+2]<<16|t[h+1]<<8|t[h],t[h]==g&&t[h+1]==n&&t[h+2]==r&&(l[_+3]=0)}if(f==16)for(m=0;m<o;m++)_=m<<2,h=6*m,u[m]=255<<24|t[h+4]<<16|t[h+2]<<8|t[h],p(t,h)==g&&p(t,h+2)==n&&p(t,h+4)==r&&(l[_+3]=0)}}else if(d==3){let e=i.tabs.PLTE,a=i.tabs.tRNS,s=a?a.length:0;if(f==1)for(var v=0;v<r;v++){var y=v*c,b=v*n;for(m=0;m<n;m++){_=b+m<<2;var x=3*(S=t[y+(m>>3)]>>7-(7&m)&1);l[_]=e[x],l[_+1]=e[x+1],l[_+2]=e[x+2],l[_+3]=S<s?a[S]:255}}if(f==2)for(v=0;v<r;v++)for(y=v*c,b=v*n,m=0;m<n;m++)_=b+m<<2,x=3*(S=t[y+(m>>2)]>>6-((3&m)<<1)&3),l[_]=e[x],l[_+1]=e[x+1],l[_+2]=e[x+2],l[_+3]=S<s?a[S]:255;if(f==4)for(v=0;v<r;v++)for(y=v*c,b=v*n,m=0;m<n;m++)_=b+m<<2,x=3*(S=t[y+(m>>1)]>>4-((1&m)<<2)&15),l[_]=e[x],l[_+1]=e[x+1],l[_+2]=e[x+2],l[_+3]=S<s?a[S]:255;if(f==8)for(m=0;m<o;m++){var S;_=m<<2,x=3*(S=t[m]),l[_]=e[x],l[_+1]=e[x+1],l[_+2]=e[x+2],l[_+3]=S<s?a[S]:255}}else if(d==4){if(f==8)for(m=0;m<o;m++){_=m<<2;var C=t[w=m<<1];l[_]=C,l[_+1]=C,l[_+2]=C,l[_+3]=t[w+1]}if(f==16)for(m=0;m<o;m++){var w;_=m<<2,C=t[w=m<<2],l[_]=C,l[_+1]=C,l[_+2]=C,l[_+3]=t[w+2]}}else if(d==0)for(g=i.tabs.tRNS?i.tabs.tRNS:-1,v=0;v<r;v++){let e=v*c,r=v*n;if(f==1)for(var T=0;T<n;T++){var E=(C=255*(t[e+(T>>>3)]>>>7-(7&T)&1))==255*g?0:255;u[r+T]=E<<24|C<<16|C<<8|C}else if(f==2)for(T=0;T<n;T++)E=(C=85*(t[e+(T>>>2)]>>>6-((3&T)<<1)&3))==85*g?0:255,u[r+T]=E<<24|C<<16|C<<8|C;else if(f==4)for(T=0;T<n;T++)E=(C=17*(t[e+(T>>>1)]>>>4-((1&T)<<2)&15))==17*g?0:255,u[r+T]=E<<24|C<<16|C<<8|C;else if(f==8)for(T=0;T<n;T++)E=(C=t[e+T])==g?0:255,u[r+T]=E<<24|C<<16|C<<8|C;else if(f==16)for(T=0;T<n;T++)C=t[e+(T<<1)],E=p(t,e+(T<<1))==g?0:255,u[r+T]=E<<24|C<<16|C<<8|C}return l}function n(e,t,n,s){let c=a(e),l=Math.ceil(n*c/8),u=new Uint8Array((l+1+e.interlace)*s);return t=e.tabs.CgBI?i(t,u):r(t,u),e.interlace==0?t=o(t,e,0,n,s):e.interlace==1&&(t=function(e,t){let n=t.width,r=t.height,i=a(t),s=i>>3,c=Math.ceil(n*i/8),l=new Uint8Array(r*c),u=0,d=[0,0,4,0,2,0,1],f=[0,4,0,2,0,1,0],p=[8,8,8,4,4,2,2],m=[8,8,4,4,2,2,1],h=0;for(;h<7;){let a=p[h],_=m[h],v=0,y=0,b=d[h];for(;b<r;)b+=a,y++;let x=f[h];for(;x<n;)x+=_,v++;let S=Math.ceil(v*i/8);o(e,t,u,v,y);let C=0,w=d[h];for(;w<r;){let t=f[h],r=u+C*S<<3;for(;t<n;){var g;if(i==1&&(g=(g=e[r>>3])>>7-(7&r)&1,l[w*c+(t>>3)]|=g<<7-(7&t)),i==2&&(g=(g=e[r>>3])>>6-(7&r)&3,l[w*c+(t>>2)]|=g<<6-((3&t)<<1)),i==4&&(g=(g=e[r>>3])>>4-(7&r)&15,l[w*c+(t>>1)]|=g<<4-((1&t)<<2)),i>=8){let n=w*c+t*s;for(let t=0;t<s;t++)l[n+t]=e[(r>>3)+t]}r+=i,t+=_}C++,w+=a}v*y!=0&&(u+=y*(1+S)),h+=1}return l}(t,e)),t}function r(e,t){return i(new Uint8Array(e.buffer,2,e.length-6),t)}var i=function(){let e={H:{}};return e.H.N=function(t,n){let r=Uint8Array,i,a,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0;if(t[0]==3&&t[1]==0)return n||new r(0);let h=e.H,g=h.b,_=h.e,v=h.R,y=h.n,b=h.A,x=h.Z,S=h.m,C=n==null;for(C&&(n=new r(t.length>>>2<<5));o==0;)if(o=g(t,m,1),s=g(t,m+1,2),m+=3,s!=0){if(C&&(n=e.H.W(n,p+(1<<17))),s==1&&(i=S.J,a=S.h,d=511,f=31),s==2){c=_(t,m,5)+257,l=_(t,m+5,5)+1,u=_(t,m+10,4)+4,m+=14;let e=1;for(var w=0;w<38;w+=2)S.Q[w]=0,S.Q[w+1]=0;for(w=0;w<u;w++){let n=_(t,m+3*w,3);S.Q[1+(S.X[w]<<1)]=n,n>e&&(e=n)}m+=3*u,y(S.Q,e),b(S.Q,e,S.u),i=S.w,a=S.d,m=v(S.u,(1<<e)-1,c+l,t,m,S.v);let n=h.V(S.v,0,c,S.C);d=(1<<n)-1;let r=h.V(S.v,c,l,S.D);f=(1<<r)-1,y(S.C,n),b(S.C,n,i),y(S.D,r),b(S.D,r,a)}for(;;){let e=i[x(t,m)&d];m+=15&e;let r=e>>>4;if(!(r>>>8))n[p++]=r;else{if(r==256)break;{let e=p+r-254;if(r>264){let n=S.q[r-257];e=p+(n>>>3)+_(t,m,7&n),m+=7&n}let i=a[x(t,m)&f];m+=15&i;let o=i>>>4,s=S.c[o],c=(s>>>4)+g(t,m,15&s);for(m+=15&s;p<e;)n[p]=n[p++-c],n[p]=n[p++-c],n[p]=n[p++-c],n[p]=n[p++-c];p=e}}}}else{7&m&&(m+=8-(7&m));let i=4+(m>>>3),a=t[i-4]|t[i-3]<<8;C&&(n=e.H.W(n,p+a)),n.set(new r(t.buffer,t.byteOffset+i,a),p),m=i+a<<3,p+=a}return n.length==p?n:n.slice(0,p)},e.H.W=function(e,t){let n=e.length;if(t<=n)return e;let r=new Uint8Array(n<<1);return r.set(e,0),r},e.H.R=function(t,n,r,i,a,o){let s=e.H.e,c=e.H.Z,l=0;for(;l<r;){let e=t[c(i,a)&n];a+=15&e;let r=e>>>4;if(r<=15)o[l]=r,l++;else{let e=0,t=0;r==16?(t=3+s(i,a,2),a+=2,e=o[l-1]):r==17?(t=3+s(i,a,3),a+=3):r==18&&(t=11+s(i,a,7),a+=7);let n=l+t;for(;l<n;)o[l]=e,l++}}return a},e.H.V=function(e,t,n,r){let i=0,a=0,o=r.length>>>1;for(;a<n;){let n=e[a+t];r[a<<1]=0,r[1+(a<<1)]=n,n>i&&(i=n),a++}for(;a<o;)r[a<<1]=0,r[1+(a<<1)]=0,a++;return i},e.H.n=function(t,n){let r=e.H.m,i=t.length,a,o,s,c,l=r.j;for(var u=0;u<=n;u++)l[u]=0;for(u=1;u<i;u+=2)l[t[u]]++;let d=r.K;for(a=0,l[0]=0,o=1;o<=n;o++)a=a+l[o-1]<<1,d[o]=a;for(s=0;s<i;s+=2)c=t[s+1],c!=0&&(t[s]=d[c],d[c]++)},e.H.A=function(t,n,r){let i=t.length,a=e.H.m.r;for(let e=0;e<i;e+=2)if(t[e+1]!=0){let i=e>>1,o=t[e+1],s=i<<4|o,c=n-o,l=t[e]<<c,u=l+(1<<c);for(;l!=u;)r[a[l]>>>15-n]=s,l++}},e.H.l=function(t,n){let r=e.H.m.r,i=15-n;for(let e=0;e<t.length;e+=2)t[e]=r[t[e]<<n-t[e+1]]>>>i},e.H.M=function(e,t,n){n<<=7&t;let r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},e.H.I=function(e,t,n){n<<=7&t;let r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},e.H.e=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},e.H.b=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){let e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){let t=e.H.m;for(var n=0;n<32768;n++){let e=n;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[n]=(e>>>16|e<<16)>>>17}function r(e,t,n){for(;t--!=0;)e.push(0,n)}for(n=0;n<32;n++)t.q[n]=t.S[n]<<3|t.T[n],t.c[n]=t.p[n]<<4|t.z[n];r(t._,144,8),r(t._,112,9),r(t._,24,7),r(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),r(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),r(t.Q,19,0),r(t.C,286,0),r(t.D,30,0),r(t.v,320,0)}(),e.H.N}();function a(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function o(e,t,n,r,i){let o=a(t),c=Math.ceil(r*o/8),l,u;o=Math.ceil(o/8);let d=e[n],f=0;if(d>1&&(e[n]=[0,0,1][d-2]),d==3)for(f=o;f<c;f++)e[f+1]=e[f+1]+(e[f+1-o]>>>1)&255;for(let t=0;t<i;t++)if(l=n+t*c,u=l+t+1,d=e[u-1],f=0,d==0)for(;f<c;f++)e[l+f]=e[u+f];else if(d==1){for(;f<o;f++)e[l+f]=e[u+f];for(;f<c;f++)e[l+f]=e[u+f]+e[l+f-o]}else if(d==2)for(;f<c;f++)e[l+f]=e[u+f]+e[l+f-c];else if(d==3){for(;f<o;f++)e[l+f]=e[u+f]+(e[l+f-c]>>>1);for(;f<c;f++)e[l+f]=e[u+f]+(e[l+f-c]+e[l+f-o]>>>1)}else{for(;f<o;f++)e[l+f]=e[u+f]+s(0,e[l+f-c],0);for(;f<c;f++)e[l+f]=e[u+f]+s(e[l+f-o],e[l+f-c],e[l+f-o-c])}return e}function s(e,t,n){let r=e+t-n,i=r-e,a=r-t,o=r-n;return i*i<=a*a&&i*i<=o*o?e:a*a<=o*o?t:n}function c(t,n,r){r.width=e.readUint(t,n),n+=4,r.height=e.readUint(t,n),n+=4,r.depth=t[n],n++,r.ctype=t[n],n++,r.compress=t[n],n++,r.filter=t[n],n++,r.interlace=t[n],n++}function l(e,t,n,r,i,a,o,s,c){let l=Math.min(t,i),u=Math.min(n,a),d=0,f=0;for(let n=0;n<u;n++)for(let a=0;a<l;a++)if(o>=0&&s>=0?(d=n*t+a<<2,f=(s+n)*i+o+a<<2):(d=(-s+n)*t-o+a<<2,f=n*i+a<<2),c==0)r[f]=e[d],r[f+1]=e[d+1],r[f+2]=e[d+2],r[f+3]=e[d+3];else if(c==1){var p=e[d+3]*(1/255),m=e[d]*p,h=e[d+1]*p,g=e[d+2]*p,_=r[f+3]*(1/255),v=r[f]*_,y=r[f+1]*_,b=r[f+2]*_;let t=1-p,n=p+_*t,i=n==0?0:1/n;r[f+3]=255*n,r[f+0]=(m+v*t)*i,r[f+1]=(h+y*t)*i,r[f+2]=(g+b*t)*i}else if(c==2)p=e[d+3],m=e[d],h=e[d+1],g=e[d+2],_=r[f+3],v=r[f],y=r[f+1],b=r[f+2],p==_&&m==v&&h==y&&g==b?(r[f]=0,r[f+1]=0,r[f+2]=0,r[f+3]=0):(r[f]=m,r[f+1]=h,r[f+2]=g,r[f+3]=p);else if(c==3){if(p=e[d+3],m=e[d],h=e[d+1],g=e[d+2],_=r[f+3],v=r[f],y=r[f+1],b=r[f+2],p==_&&m==v&&h==y&&g==b)continue;if(p<220&&_>20)return!1}return!0}return{decode:function(t){let a=new Uint8Array(t),o=8,s=e,l=s.readUshort,u=s.readUint,d={tabs:{},frames:[]},f=new Uint8Array(a.length),p,m=0,h=0,g=[137,80,78,71,13,10,26,10];for(var _=0;_<8;_++)if(a[_]!=g[_])throw`The input is not a PNG file!`;for(;o<a.length;){let e=s.readUint(a,o);o+=4;let t=s.readASCII(a,o,4);if(o+=4,t==`IHDR`)c(a,o,d);else if(t==`iCCP`){for(var v=o;a[v]!=0;)v++;s.readASCII(a,o,v-o),a[v+1];let n=a.slice(v+2,o+e),c=null;try{c=r(n)}catch{c=i(n)}d.tabs[t]=c}else if(t==`CgBI`)d.tabs[t]=a.slice(o,o+4);else if(t==`IDAT`){for(_=0;_<e;_++)f[m+_]=a[o+_];m+=e}else if(t==`acTL`)d.tabs[t]={num_frames:u(a,o),num_plays:u(a,o+4)},p=new Uint8Array(a.length);else if(t==`fcTL`){h!=0&&((w=d.frames[d.frames.length-1]).data=n(d,p.slice(0,h),w.rect.width,w.rect.height),h=0);let e={x:u(a,o+12),y:u(a,o+16),width:u(a,o+4),height:u(a,o+8)},t=l(a,o+22);t=l(a,o+20)/(t==0?100:t);let r={rect:e,delay:Math.round(1e3*t),dispose:a[o+24],blend:a[o+25]};d.frames.push(r)}else if(t==`fdAT`){for(_=0;_<e-4;_++)p[h+_]=a[o+_+4];h+=e-4}else if(t==`pHYs`)d.tabs[t]=[s.readUint(a,o),s.readUint(a,o+4),a[o+8]];else if(t==`cHRM`)for(d.tabs[t]=[],_=0;_<8;_++)d.tabs[t].push(s.readUint(a,o+4*_));else if(t==`tEXt`||t==`zTXt`){d.tabs[t]??(d.tabs[t]={});var y=s.nextZero(a,o),b=s.readASCII(a,o,y-o),x=o+e-y-1;if(t==`tEXt`)C=s.readASCII(a,y+1,x);else{var S=r(a.slice(y+2,y+2+x));C=s.readUTF8(S,0,S.length)}d.tabs[t][b]=C}else if(t==`iTXt`){d.tabs[t]??(d.tabs[t]={}),y=0,v=o,y=s.nextZero(a,v),b=s.readASCII(a,v,y-v);let n=a[v=y+1];var C;a[v+1],v+=2,y=s.nextZero(a,v),s.readASCII(a,v,y-v),v=y+1,y=s.nextZero(a,v),s.readUTF8(a,v,y-v),x=e-((v=y+1)-o),n==0?C=s.readUTF8(a,v,x):(S=r(a.slice(v,v+x)),C=s.readUTF8(S,0,S.length)),d.tabs[t][b]=C}else if(t==`PLTE`)d.tabs[t]=s.readBytes(a,o,e);else if(t==`hIST`){let e=d.tabs.PLTE.length/3;for(d.tabs[t]=[],_=0;_<e;_++)d.tabs[t].push(l(a,o+2*_))}else if(t==`tRNS`)d.ctype==3?d.tabs[t]=s.readBytes(a,o,e):d.ctype==0?d.tabs[t]=l(a,o):d.ctype==2&&(d.tabs[t]=[l(a,o),l(a,o+2),l(a,o+4)]);else if(t==`gAMA`)d.tabs[t]=s.readUint(a,o)/1e5;else if(t==`sRGB`)d.tabs[t]=a[o];else if(t==`bKGD`)d.ctype==0||d.ctype==4?d.tabs[t]=[l(a,o)]:d.ctype==2||d.ctype==6?d.tabs[t]=[l(a,o),l(a,o+2),l(a,o+4)]:d.ctype==3&&(d.tabs[t]=a[o]);else if(t==`IEND`)break;o+=e,s.readUint(a,o),o+=4}var w;return h!=0&&((w=d.frames[d.frames.length-1]).data=n(d,p.slice(0,h),w.rect.width,w.rect.height)),d.data=n(d,f,d.width,d.height),delete d.compress,delete d.interlace,delete d.filter,d},toRGBA8:function(e){let n=e.width,r=e.height;if(e.tabs.acTL==null)return[t(e.data,n,r,e).buffer];let i=[];e.frames[0].data??(e.frames[0].data=e.data);let a=n*r*4,o=new Uint8Array(a),s=new Uint8Array(a),c=new Uint8Array(a);for(let d=0;d<e.frames.length;d++){let f=e.frames[d],p=f.rect.x,m=f.rect.y,h=f.rect.width,g=f.rect.height,_=t(f.data,h,g,e);if(d!=0)for(var u=0;u<a;u++)c[u]=o[u];if(f.blend==0?l(_,h,g,o,n,r,p,m,0):f.blend==1&&l(_,h,g,o,n,r,p,m,1),i.push(o.buffer.slice(0)),f.dispose!=0){if(f.dispose==1)l(s,h,g,o,n,r,p,m,0);else if(f.dispose==2)for(u=0;u<a;u++)o[u]=c[u]}}return i},_paeth:s,_copyTile:l,_bin:e}}();(function(){let{_copyTile:e}=su,{_bin:t}=su,n=su._paeth;var r={table:function(){let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)1&n?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e}(),update(e,t,n,i){for(let a=0;a<i;a++)e=r.table[255&(e^t[n+a])]^e>>>8;return e},crc:(e,t,n)=>4294967295^r.update(4294967295,e,t,n)};function i(e,t,n,r){t[n]+=e[0]*r>>4,t[n+1]+=e[1]*r>>4,t[n+2]+=e[2]*r>>4,t[n+3]+=e[3]*r>>4}function a(e){return Math.max(0,Math.min(255,e))}function o(e,t){let n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return n*n+r*r+i*i+a*a}function s(e,t,n,r,s,c,l){l??=1;let u=r.length,d=[];for(var f=0;f<u;f++){let e=r[f];d.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(f=0;f<u;f++){let e=4294967295;for(var p=0,m=0;m<u;m++){var h=o(d[f],d[m]);m!=f&&h<e&&(e=h,p=m)}}let g=new Uint32Array(s.buffer),_=new Int16Array(t*n*4),v=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(f=0;f<v.length;f++)v[f]=255*((v[f]+.5)/16-.5);for(let s=0;s<n;s++)for(let b=0;b<t;b++){var y;f=4*(s*t+b),l==2?(h=v[4*(3&s)+(3&b)],y=[a(e[f]+h),a(e[f+1]+h),a(e[f+2]+h),a(e[f+3]+h)]):y=[a(e[f]+_[f]),a(e[f+1]+_[f+1]),a(e[f+2]+_[f+2]),a(e[f+3]+_[f+3])],p=0;let x=16777215;for(m=0;m<u;m++){let e=o(y,d[m]);e<x&&(x=e,p=m)}let S=d[p],C=[y[0]-S[0],y[1]-S[1],y[2]-S[2],y[3]-S[3]];l==1&&(b!=t-1&&i(C,_,f+4,7),s!=n-1&&(b!=0&&i(C,_,f+4*t-4,3),i(C,_,f+4*t,5),b!=t-1&&i(C,_,f+4*t+4,1))),c[f>>2]=p,g[f>>2]=r[p]}}function c(e,n,i,a,o){o??={};let{crc:s}=r,c=t.writeUint,l=t.writeUshort,u=t.writeASCII,d=8,f=e.frames.length>1,p,m=!1,h=33+(f?20:0);if(o.sRGB!=null&&(h+=13),o.pHYs!=null&&(h+=21),o.iCCP!=null&&(p=pako.deflate(o.iCCP),h+=21+p.length+4),e.ctype==3){for(var g=e.plte.length,_=0;_<g;_++)e.plte[_]>>>24!=255&&(m=!0);h+=8+3*g+4+(m?8+1*g+4:0)}for(var v=0;v<e.frames.length;v++)f&&(h+=38),h+=(S=e.frames[v]).cimg.length+12,v!=0&&(h+=4);h+=12;let y=new Uint8Array(h),b=[137,80,78,71,13,10,26,10];for(_=0;_<8;_++)y[_]=b[_];if(c(y,d,13),d+=4,u(y,d,`IHDR`),d+=4,c(y,d,n),d+=4,c(y,d,i),d+=4,y[d]=e.depth,d++,y[d]=e.ctype,d++,y[d]=0,d++,y[d]=0,d++,y[d]=0,d++,c(y,d,s(y,d-17,17)),d+=4,o.sRGB!=null&&(c(y,d,1),d+=4,u(y,d,`sRGB`),d+=4,y[d]=o.sRGB,d++,c(y,d,s(y,d-5,5)),d+=4),o.iCCP!=null){let e=13+p.length;c(y,d,e),d+=4,u(y,d,`iCCP`),d+=4,u(y,d,`ICC profile`),d+=11,d+=2,y.set(p,d),d+=p.length,c(y,d,s(y,d-(e+4),e+4)),d+=4}if(o.pHYs!=null&&(c(y,d,9),d+=4,u(y,d,`pHYs`),d+=4,c(y,d,o.pHYs[0]),d+=4,c(y,d,o.pHYs[1]),d+=4,y[d]=o.pHYs[2],d++,c(y,d,s(y,d-13,13)),d+=4),f&&(c(y,d,8),d+=4,u(y,d,`acTL`),d+=4,c(y,d,e.frames.length),d+=4,c(y,d,o.loop==null?0:o.loop),d+=4,c(y,d,s(y,d-12,12)),d+=4),e.ctype==3){for(c(y,d,3*(g=e.plte.length)),d+=4,u(y,d,`PLTE`),d+=4,_=0;_<g;_++){let t=3*_,n=e.plte[_],r=255&n,i=n>>>8&255,a=n>>>16&255;y[d+t+0]=r,y[d+t+1]=i,y[d+t+2]=a}if(d+=3*g,c(y,d,s(y,d-3*g-4,3*g+4)),d+=4,m){for(c(y,d,g),d+=4,u(y,d,`tRNS`),d+=4,_=0;_<g;_++)y[d+_]=e.plte[_]>>>24&255;d+=g,c(y,d,s(y,d-g-4,g+4)),d+=4}}let x=0;for(v=0;v<e.frames.length;v++){var S=e.frames[v];f&&(c(y,d,26),d+=4,u(y,d,`fcTL`),d+=4,c(y,d,x++),d+=4,c(y,d,S.rect.width),d+=4,c(y,d,S.rect.height),d+=4,c(y,d,S.rect.x),d+=4,c(y,d,S.rect.y),d+=4,l(y,d,a[v]),d+=2,l(y,d,1e3),d+=2,y[d]=S.dispose,d++,y[d]=S.blend,d++,c(y,d,s(y,d-30,30)),d+=4);let t=S.cimg;c(y,d,(g=t.length)+(v==0?0:4)),d+=4;let n=d;u(y,d,v==0?`IDAT`:`fdAT`),d+=4,v!=0&&(c(y,d,x++),d+=4),y.set(t,d),d+=g,c(y,d,s(y,n,d-n)),d+=4}return c(y,d,0),d+=4,u(y,d,`IEND`),d+=4,c(y,d,s(y,d-4,4)),d+=4,y.buffer}function l(e,t,n){for(let r=0;r<e.frames.length;r++){let i=e.frames[r];i.rect.width;let a=i.rect.height,o=new Uint8Array(a*i.bpl+a);i.cimg=p(i.img,a,i.bpp,i.bpl,o,t,n)}}function u(t,n,r,i,a){let o=a[0],c=a[1],l=a[2],u=a[3],p=a[4],m=a[5],g=6,_=8,v=255;for(var y=0;y<t.length;y++){let e=new Uint8Array(t[y]);for(var b=e.length,x=0;x<b;x+=4)v&=e[x+3]}let S=v!=255,C=function(t,n,r,i,a,o){let s=[];for(var c=0;c<t.length;c++){let d=new Uint8Array(t[c]),p=new Uint32Array(d.buffer);var l;let h=0,g=0,_=n,v=r,y=+!!i;if(c!=0){let b=o||i||c==1||s[c-2].dispose!=0?1:2,x=0,S=1e9;for(let e=0;e<b;e++){var u=new Uint8Array(t[c-1-e]);let i=new Uint32Array(t[c-1-e]),o=n,s=r,l=-1,d=-1;for(let e=0;e<r;e++)for(let t=0;t<n;t++)p[m=e*n+t]!=i[m]&&(t<o&&(o=t),t>l&&(l=t),e<s&&(s=e),e>d&&(d=e));l==-1&&(o=s=l=d=0),a&&(!(1&~o)&&o--,!(1&~s)&&s--);let f=(l-o+1)*(d-s+1);f<S&&(S=f,x=e,h=o,g=s,_=l-o+1,v=d-s+1)}u=new Uint8Array(t[c-1-x]),x==1&&(s[c-1].dispose=2),l=new Uint8Array(_*v*4),e(u,n,r,l,_,v,-h,-g,0),y=+!!e(d,n,r,l,_,v,-h,-g,3),y==1?f(d,n,r,l,{x:h,y:g,width:_,height:v}):e(d,n,r,l,_,v,-h,-g,0)}else l=d.slice(0);s.push({rect:{x:h,y:g,width:_,height:v},img:l,blend:y,dispose:0})}if(i)for(c=0;c<s.length;c++){if((h=s[c]).blend==1)continue;let e=h.rect,i=s[c-1].rect,o=Math.min(e.x,i.x),l=Math.min(e.y,i.y),u={x:o,y:l,width:Math.max(e.x+e.width,i.x+i.width)-o,height:Math.max(e.y+e.height,i.y+i.height)-l};s[c-1].dispose=1,c-1!=0&&d(t,n,r,s,c-1,u,a),d(t,n,r,s,c,u,a)}let p=0;if(t.length!=1)for(var m=0;m<s.length;m++){var h;p+=(h=s[m]).rect.width*h.rect.height}return s}(t,n,r,o,c,l),w={},T=[],E=[];if(i!=0){let e=[];for(x=0;x<C.length;x++)e.push(C[x].img.buffer);let t=h(function(e){let t=0;for(var n=0;n<e.length;n++)t+=e[n].byteLength;let r=new Uint8Array(t),i=0;for(n=0;n<e.length;n++){let t=new Uint8Array(e[n]),a=t.length;for(let e=0;e<a;e+=4){let n=t[e],a=t[e+1],o=t[e+2],s=t[e+3];s==0&&(n=a=o=0),r[i+e]=n,r[i+e+1]=a,r[i+e+2]=o,r[i+e+3]=s}i+=a}return r.buffer}(e),i);for(x=0;x<t.plte.length;x++)T.push(t.plte[x].est.rgba);let n=0;for(x=0;x<C.length;x++){let e=(O=C[x]).img.length;var D=new Uint8Array(t.inds.buffer,n>>2,e>>2);E.push(D);let r=new Uint8Array(t.abuf,n,e);m&&s(O.img,O.rect.width,O.rect.height,T,r,D),O.img.set(r),n+=e}}else for(y=0;y<C.length;y++){var O=C[y];let e=new Uint32Array(O.img.buffer);var k=O.rect.width;for(b=e.length,D=new Uint8Array(b),E.push(D),x=0;x<b;x++){let t=e[x];if(x!=0&&t==e[x-1])D[x]=D[x-1];else if(x>k&&t==e[x-k])D[x]=D[x-k];else{let e=w[t];if(e==null&&(w[t]=e=T.length,T.push(t),T.length>=300))break;D[x]=e}}}let A=T.length;for(A<=256&&p==0&&(_=A<=2?1:A<=4?2:A<=16?4:8,_=Math.max(_,u)),y=0;y<C.length;y++){(O=C[y]).rect.x,O.rect.y,k=O.rect.width;let e=O.rect.height,t=O.img;new Uint32Array(t.buffer);let n=4*k,r=4;if(A<=256&&p==0){n=Math.ceil(_*k/8);var j=new Uint8Array(n*e);let i=E[y];for(let t=0;t<e;t++){x=t*n;let e=t*k;if(_==8)for(var M=0;M<k;M++)j[x+M]=i[e+M];else if(_==4)for(M=0;M<k;M++)j[x+(M>>1)]|=i[e+M]<<4-4*(1&M);else if(_==2)for(M=0;M<k;M++)j[x+(M>>2)]|=i[e+M]<<6-2*(3&M);else if(_==1)for(M=0;M<k;M++)j[x+(M>>3)]|=i[e+M]<<7-1*(7&M)}t=j,g=3,r=1}else if(S==0&&C.length==1){j=new Uint8Array(k*e*3);let i=k*e;for(x=0;x<i;x++){let e=3*x,n=4*x;j[e]=t[n],j[e+1]=t[n+1],j[e+2]=t[n+2]}t=j,g=2,r=3,n=3*k}O.img=t,O.bpl=n,O.bpp=r}return{ctype:g,depth:_,plte:T,frames:C}}function d(t,n,r,i,a,o,s){let c=Uint8Array,l=Uint32Array,u=new c(t[a-1]),d=new l(t[a-1]),p=a+1<t.length?new c(t[a+1]):null,m=new c(t[a]),h=new l(m.buffer),g=n,_=r,v=-1,y=-1;for(let e=0;e<o.height;e++)for(let t=0;t<o.width;t++){let r=o.x+t,s=o.y+e,c=s*n+r,l=h[c];l==0||i[a-1].dispose==0&&d[c]==l&&(p==null||p[4*c+3]!=0)||(r<g&&(g=r),r>v&&(v=r),s<_&&(_=s),s>y&&(y=s))}v==-1&&(g=_=v=y=0),s&&(!(1&~g)&&g--,!(1&~_)&&_--),o={x:g,y:_,width:v-g+1,height:y-_+1};let b=i[a];b.rect=o,b.blend=1,b.img=new Uint8Array(o.width*o.height*4),i[a-1].dispose==0?(e(u,n,r,b.img,o.width,o.height,-o.x,-o.y,0),f(m,n,r,b.img,o)):e(m,n,r,b.img,o.width,o.height,-o.x,-o.y,0)}function f(t,n,r,i,a){e(t,n,r,i,a.width,a.height,-a.x,-a.y,2)}function p(e,t,n,r,i,a,o){let s=[],c,l=[0,1,2,3,4];a==-1?(t*r>5e5||n==1)&&(l=[0]):l=[a],o&&(c={level:0});let u=ou;for(var d=0;d<l.length;d++){for(let a=0;a<t;a++)m(i,e,a,r,n,l[d]);s.push(u.deflate(i,c))}let f,p=1e9;for(d=0;d<s.length;d++)s[d].length<p&&(f=d,p=s[d].length);return s[f]}function m(e,t,r,i,a,o){let s=r*i,c=s+r;if(e[c]=o,c++,o==0)if(i<500)for(var l=0;l<i;l++)e[c+l]=t[s+l];else e.set(new Uint8Array(t.buffer,s,i),c);else if(o==1){for(l=0;l<a;l++)e[c+l]=t[s+l];for(l=a;l<i;l++)e[c+l]=t[s+l]-t[s+l-a]+256&255}else if(r==0){for(l=0;l<a;l++)e[c+l]=t[s+l];if(o==2)for(l=a;l<i;l++)e[c+l]=t[s+l];if(o==3)for(l=a;l<i;l++)e[c+l]=t[s+l]-(t[s+l-a]>>1)+256&255;if(o==4)for(l=a;l<i;l++)e[c+l]=t[s+l]-n(t[s+l-a],0,0)+256&255}else{if(o==2)for(l=0;l<i;l++)e[c+l]=t[s+l]+256-t[s+l-i]&255;if(o==3){for(l=0;l<a;l++)e[c+l]=t[s+l]+256-(t[s+l-i]>>1)&255;for(l=a;l<i;l++)e[c+l]=t[s+l]+256-(t[s+l-i]+t[s+l-a]>>1)&255}if(o==4){for(l=0;l<a;l++)e[c+l]=t[s+l]+256-n(0,t[s+l-i],0)&255;for(l=a;l<i;l++)e[c+l]=t[s+l]+256-n(t[s+l-a],t[s+l-i],t[s+l-a-i])&255}}}function h(e,t){let n=new Uint8Array(e),r=n.slice(0),i=new Uint32Array(r.buffer),a=g(r,t),o=a[0],s=a[1],c=n.length,l=new Uint8Array(c>>2),u;if(n.length<2e7)for(var d=0;d<c;d+=4)u=_(o,f=n[d]*(1/255),p=n[d+1]*(1/255),m=n[d+2]*(1/255),h=n[d+3]*(1/255)),l[d>>2]=u.ind,i[d>>2]=u.est.rgba;else for(d=0;d<c;d+=4){var f=n[d]*(1/255),p=n[d+1]*(1/255),m=n[d+2]*(1/255),h=n[d+3]*(1/255);for(u=o;u.left;)u=v(u.est,f,p,m,h)<=0?u.left:u.right;l[d>>2]=u.ind,i[d>>2]=u.est.rgba}return{abuf:r.buffer,inds:l,plte:s}}function g(e,t,n){n??=1e-4;let r=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=x(e,i.i0,i.i1),i.est=S(i.bst);let a=[i];for(;a.length<t;){let t=0,i=0;for(var o=0;o<a.length;o++)a[o].est.L>t&&(t=a[o].est.L,i=o);if(t<n)break;let s=a[i],c=y(e,r,s.i0,s.i1,s.est.e,s.est.eMq255);if(s.i0>=c||s.i1<=c){s.est.L=0;continue}let l={i0:s.i0,i1:c,bst:null,est:null,tdst:0,left:null,right:null};l.bst=x(e,l.i0,l.i1),l.est=S(l.bst);let u={i0:c,i1:s.i1,bst:null,est:null,tdst:0,left:null,right:null};for(u.bst={R:[],m:[],N:s.bst.N-l.bst.N},o=0;o<16;o++)u.bst.R[o]=s.bst.R[o]-l.bst.R[o];for(o=0;o<4;o++)u.bst.m[o]=s.bst.m[o]-l.bst.m[o];u.est=S(u.bst),s.left=l,s.right=u,a[i]=l,a.push(u)}for(a.sort((e,t)=>t.bst.N-e.bst.N),o=0;o<a.length;o++)a[o].ind=o;return[i,a]}function _(e,t,n,r,i){if(e.left==null)return e.tdst=function(e,t,n,r,i){let a=t-e[0],o=n-e[1],s=r-e[2],c=i-e[3];return a*a+o*o+s*s+c*c}(e.est.q,t,n,r,i),e;let a=v(e.est,t,n,r,i),o=e.left,s=e.right;a>0&&(o=e.right,s=e.left);let c=_(o,t,n,r,i);if(c.tdst<=a*a)return c;let l=_(s,t,n,r,i);return l.tdst<c.tdst?l:c}function v(e,t,n,r,i){let{e:a}=e;return a[0]*t+a[1]*n+a[2]*r+a[3]*i-e.eMq}function y(e,t,n,r,i,a){for(r-=4;n<r;){for(;b(e,n,i)<=a;)n+=4;for(;b(e,r,i)>a;)r-=4;if(n>=r)break;let o=t[n>>2];t[n>>2]=t[r>>2],t[r>>2]=o,n+=4,r-=4}for(;b(e,n,i)>a;)n-=4;return n+4}function b(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]+e[t+3]*n[3]}function x(e,t,n){let r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],a=n-t>>2;for(let a=t;a<n;a+=4){let t=e[a]*(1/255),n=e[a+1]*(1/255),o=e[a+2]*(1/255),s=e[a+3]*(1/255);i[0]+=t,i[1]+=n,i[2]+=o,i[3]+=s,r[0]+=t*t,r[1]+=t*n,r[2]+=t*o,r[3]+=t*s,r[5]+=n*n,r[6]+=n*o,r[7]+=n*s,r[10]+=o*o,r[11]+=o*s,r[15]+=s*s}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m:i,N:a}}function S(e){let{R:t}=e,{m:n}=e,{N:r}=e,i=n[0],a=n[1],o=n[2],s=n[3],c=r==0?0:1/r,l=[t[0]-i*i*c,t[1]-i*a*c,t[2]-i*o*c,t[3]-i*s*c,t[4]-a*i*c,t[5]-a*a*c,t[6]-a*o*c,t[7]-a*s*c,t[8]-o*i*c,t[9]-o*a*c,t[10]-o*o*c,t[11]-o*s*c,t[12]-s*i*c,t[13]-s*a*c,t[14]-s*o*c,t[15]-s*s*c],u=l,d=C,f=[Math.random(),Math.random(),Math.random(),Math.random()],p=0,m=0;if(r!=0)for(let e=0;e<16&&(f=d.multVec(u,f),m=Math.sqrt(d.dot(f,f)),f=d.sml(1/m,f),!(e!=0&&Math.abs(m-p)<1e-9));e++)p=m;let h=[i*c,a*c,o*c,s*c];return{Cov:l,q:h,e:f,L:p,eMq255:d.dot(d.sml(255,h),f),eMq:d.dot(f,h),rgba:(Math.round(255*h[3])<<24|Math.round(255*h[2])<<16|Math.round(255*h[1])<<8|Math.round(255*h[0]))>>>0}}var C={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};su.encode=function(e,t,n,r,i,a,o){r??=0,o??=!1;let s=u(e,t,n,r,[!1,!1,!1,0,o,!1]);return l(s,-1),c(s,t,n,i,a)},su.encodeLL=function(e,t,n,r,i,a,o,s){let u={ctype:0+(r==1?0:2)+(i==0?0:4),depth:a,frames:[]},d=(r+i)*a,f=d*t;for(let r=0;r<e.length;r++)u.frames.push({rect:{x:0,y:0,width:t,height:n},img:new Uint8Array(e[r]),blend:0,dispose:1,bpp:Math.ceil(d/8),bpl:Math.ceil(f/8)});return l(u,0,!0),c(u,t,n,o,s)},su.encode.compress=u,su.encode.dither=s,su.quantize=h,su.quantize.getKDtree=g,su.quantize.getNearest=_})();var cu={toArrayBuffer(e,t){let n=e.width,r=e.height,i=n<<2,a=e.getContext(`2d`).getImageData(0,0,n,r),o=new Uint32Array(a.data.buffer),s=(32*n+31)/32<<2,c=s*r,l=122+c,u=new ArrayBuffer(l),d=new DataView(u),f=1<<20,p,m,h,g,_=f,v=0,y=0,b=0;function x(e){d.setUint16(y,e,!0),y+=2}function S(e){d.setUint32(y,e,!0),y+=4}function C(e){y+=e}x(19778),S(l),C(4),S(122),S(108),S(n),S(-r>>>0),x(1),x(32),S(3),S(c),S(2835),S(2835),C(8),S(16711680),S(65280),S(255),S(4278190080),S(1466527264),function e(){for(;v<r&&_>0;){for(g=122+v*s,p=0;p<i;)_--,m=o[b++],h=m>>>24,d.setUint32(g+p,m<<8|h),p+=4;v++}b<o.length?(_=f,setTimeout(e,cu._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:`image/bmp`}))})},_dly:9},lu={CHROME:`CHROME`,FIREFOX:`FIREFOX`,DESKTOP_SAFARI:`DESKTOP_SAFARI`,IE:`IE`,IOS:`IOS`,ETC:`ETC`},uu={[lu.CHROME]:16384,[lu.FIREFOX]:11180,[lu.DESKTOP_SAFARI]:16384,[lu.IE]:8192,[lu.IOS]:4096,[lu.ETC]:8192},du=typeof window<`u`,fu=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope,pu=du&&window.cordova&&window.cordova.require&&window.cordova.require(`cordova/modulemapper`),mu=(du||fu)&&(pu&&pu.getOriginalSymbol(window,`File`)||typeof File<`u`&&File),hu=(du||fu)&&(pu&&pu.getOriginalSymbol(window,`FileReader`)||typeof FileReader<`u`&&FileReader);function gu(e,t,n=Date.now()){return new Promise(r=>{let i=e.split(`,`),a=i[0].match(/:(.*?);/)[1],o=globalThis.atob(i[1]),s=o.length,c=new Uint8Array(s);for(;s--;)c[s]=o.charCodeAt(s);let l=new Blob([c],{type:a});l.name=t,l.lastModified=n,r(l)})}function _u(e){return new Promise((t,n)=>{let r=new hu;r.onload=()=>t(r.result),r.onerror=e=>n(e),r.readAsDataURL(e)})}function vu(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t(r),r.onerror=e=>n(e),r.src=e})}function yu(){if(yu.cachedResult!==void 0)return yu.cachedResult;let e=lu.ETC,{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=lu.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=lu.IOS:/Safari/i.test(t)?e=lu.DESKTOP_SAFARI:/Firefox/i.test(t)?e=lu.FIREFOX:(/MSIE/i.test(t)||!!document.documentMode==1)&&(e=lu.IE),yu.cachedResult=e,yu.cachedResult}function bu(e,t){let n=uu[yu()],r=e,i=t,a=r*i,o=r>i?i/r:r/i;for(;a>n*n;){let e=(n+r)/2,t=(n+i)/2;e<t?(i=t,r=t*o):(i=e*o,r=e),a=r*i}return{width:r,height:i}}function xu(e,t){let n,r;try{if(n=new OffscreenCanvas(e,t),r=n.getContext(`2d`),r===null)throw Error(`getContext of OffscreenCanvas returns null`)}catch{n=document.createElement(`canvas`),r=n.getContext(`2d`)}return n.width=e,n.height=t,[n,r]}function Su(e,t){let{width:n,height:r}=bu(e.width,e.height),[i,a]=xu(n,r);return t&&/jpe?g/.test(t)&&(a.fillStyle=`white`,a.fillRect(0,0,i.width,i.height)),a.drawImage(e,0,0,i.width,i.height),i}function Cu(){return Cu.cachedResult!==void 0||(Cu.cachedResult=[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&typeof document<`u`&&`ontouchend`in document),Cu.cachedResult}function wu(e,t={}){return new Promise(function(n,r){let i,a;var o=function(){try{return a=Su(i,t.fileType||e.type),n([i,a])}catch(e){return r(e)}},s=function(t){try{var n=function(e){try{throw e}catch(e){return r(e)}};try{let t;return _u(e).then(function(e){try{return t=e,vu(t).then(function(e){try{return i=e,function(){try{return o()}catch(e){return r(e)}}()}catch(e){return n(e)}},n)}catch(e){return n(e)}},n)}catch(e){n(e)}}catch(e){return r(e)}};try{if(Cu()||[lu.DESKTOP_SAFARI,lu.MOBILE_SAFARI].includes(yu()))throw Error(`Skip createImageBitmap on IOS and Safari`);return createImageBitmap(e).then(function(e){try{return i=e,o()}catch{return s()}},s)}catch{s()}})}function Tu(e,t,n,r,i=1){return new Promise(function(a,o){let s;if(t===`image/png`){let a,o,c;return a=e.getContext(`2d`),{data:o}=a.getImageData(0,0,e.width,e.height),c=su.encode([o.buffer],e.width,e.height,4096*i),s=new Blob([c],{type:t}),s.name=n,s.lastModified=r,u.call(this)}{if(t===`image/bmp`)return new Promise(t=>cu.toBlob(e,t)).then(function(e){try{return s=e,s.name=n,s.lastModified=r,l.call(this)}catch(e){return o(e)}}.bind(this),o);{if(typeof OffscreenCanvas==`function`&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:i}).then(function(e){try{return s=e,s.name=n,s.lastModified=r,c.call(this)}catch(e){return o(e)}}.bind(this),o);{let a;return a=e.toDataURL(t,i),gu(a,n,r).then(function(e){try{return s=e,c.call(this)}catch(e){return o(e)}}.bind(this),o)}function c(){return l.call(this)}}function l(){return u.call(this)}}function u(){return a(s)}})}function Eu(e){e.width=0,e.height=0}function Du(){return new Promise(function(e,t){let n,r,i,a;return Du.cachedResult===void 0?gu(`data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==`,`test.jpg`,Date.now()).then(function(o){try{return n=o,wu(n).then(function(o){try{return r=o[1],Tu(r,n.type,n.name,n.lastModified).then(function(n){try{return i=n,Eu(r),wu(i).then(function(n){try{return a=n[0],Du.cachedResult=a.width===1&&a.height===2,e(Du.cachedResult)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t):e(Du.cachedResult)})}function Ou(e){return new Promise((t,n)=>{let r=new hu;r.onload=e=>{let n=new DataView(e.target.result);if(n.getUint16(0,!1)!=65496)return t(-2);let r=n.byteLength,i=2;for(;i<r;){if(n.getUint16(i+2,!1)<=8)return t(-1);let e=n.getUint16(i,!1);if(i+=2,e==65505){if(n.getUint32(i+=2,!1)!=1165519206)return t(-1);let e=n.getUint16(i+=6,!1)==18761;i+=n.getUint32(i+4,e);let r=n.getUint16(i,e);i+=2;for(let a=0;a<r;a++)if(n.getUint16(i+12*a,e)==274)return t(n.getUint16(i+12*a+8,e))}else{if(65280&~e)break;i+=n.getUint16(i,!1)}}return t(-1)},r.onerror=e=>n(e),r.readAsArrayBuffer(e)})}function ku(e,t){let{width:n}=e,{height:r}=e,{maxWidthOrHeight:i}=t,a,o=e;return isFinite(i)&&(n>i||r>i)&&([o,a]=xu(n,r),n>r?(o.width=i,o.height=r/n*i):(o.width=n/r*i,o.height=i),a.drawImage(e,0,0,o.width,o.height),Eu(e)),o}function Au(e,t){let{width:n}=e,{height:r}=e,[i,a]=xu(n,r);switch(t>4&&t<9?(i.width=r,i.height=n):(i.width=n,i.height=r),t){case 2:a.transform(-1,0,0,1,n,0);break;case 3:a.transform(-1,0,0,-1,n,r);break;case 4:a.transform(1,0,0,-1,0,r);break;case 5:a.transform(0,1,1,0,0,0);break;case 6:a.transform(0,1,-1,0,r,0);break;case 7:a.transform(0,-1,-1,0,r,n);break;case 8:a.transform(0,-1,1,0,0,n)}return a.drawImage(e,0,0,n,r),Eu(e),i}function ju(e,t,n=0){return new Promise(function(r,i){let a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;function T(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;a+=e,t.onProgress(Math.min(a,100))}function E(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;a=Math.min(Math.max(e,a),100),t.onProgress(a)}return a=n,o=t.maxIteration||10,s=1024*t.maxSizeMB*1024,T(),wu(e,t).then(function(n){try{return[,c]=n,T(),l=ku(c,t),T(),new Promise(function(n,r){var i;if(!(i=t.exifOrientation))return Ou(e).then(function(e){try{return i=e,a.call(this)}catch(e){return r(e)}}.bind(this),r);function a(){return n(i)}return a.call(this)}).then(function(n){try{return u=n,T(),Du().then(function(n){try{return d=n?l:Au(l,u),T(),f=t.initialQuality||1,p=t.fileType||e.type,Tu(d,p,e.name,e.lastModified,f).then(function(n){try{{if(m=n,T(),h=m.size>s,g=m.size>e.size,!h&&!g)return E(100),r(m);var a;function u(){if(o--&&(y>s||y>_)){let t,n;return t=w?.95*C.width:C.width,n=w?.95*C.height:C.height,[x,S]=xu(t,n),S.drawImage(C,0,0,t,n),f*=p===`image/png`?.85:.95,Tu(x,p,e.name,e.lastModified,f).then(function(e){try{return b=e,Eu(C),C=x,y=b.size,E(Math.min(99,Math.floor((v-y)/(v-s)*100))),u}catch(e){return i(e)}},i)}return[1]}return _=e.size,v=m.size,y=v,C=d,w=!t.alwaysKeepResolution&&h,(a=function(e){for(;e;){if(e.then)return void e.then(a,i);try{if(e.pop){if(e.length)return e.pop()?D.call(this):e;e=u}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(u);function D(){return Eu(C),Eu(x),Eu(l),Eu(d),Eu(c),E(100),r(b)}}}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)})}var Mu;function Nu(e,t){return new Promise((n,r)=>{Mu||=function(e){let t=[];return t.push(e),URL.createObjectURL(new Blob(t))}(`
133
- let scriptImported = false
134
- self.addEventListener('message', async (e) => {
135
- const { file, id, imageCompressionLibUrl, options } = e.data
136
- options.onProgress = (progress) => self.postMessage({ progress, id })
137
- try {
138
- if (!scriptImported) {
139
- // console.log('[worker] importScripts', imageCompressionLibUrl)
140
- self.importScripts(imageCompressionLibUrl)
141
- scriptImported = true
142
- }
143
- // console.log('[worker] self', self)
144
- const compressedFile = await imageCompression(file, options)
145
- self.postMessage({ file: compressedFile, id })
146
- } catch (e) {
147
- // console.error('[worker] error', e)
148
- self.postMessage({ error: e.message + '\\n' + e.stack, id })
149
- }
150
- })
151
- `);let i=new Worker(Mu);i.addEventListener(`message`,function(e){if(t.signal&&t.signal.aborted)i.terminate();else if(e.data.progress===void 0){if(e.data.error)return r(Error(e.data.error)),void i.terminate();n(e.data.file),i.terminate()}else t.onProgress(e.data.progress)}),i.addEventListener(`error`,r),t.signal&&t.signal.addEventListener(`abort`,()=>{r(t.signal.reason),i.terminate()}),i.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}function Pu(e,t){return new Promise(function(n,r){let i,a,o,s,c,l;if(i={...t},o=0,{onProgress:s}=i,i.maxSizeMB=i.maxSizeMB||1/0,c=typeof i.useWebWorker!=`boolean`||i.useWebWorker,delete i.useWebWorker,i.onProgress=e=>{o=e,typeof s==`function`&&s(o)},!(e instanceof Blob||e instanceof mu))return r(Error(`The file given is not an instance of Blob or File`));if(!/^image/.test(e.type))return r(Error(`The file given is not an image`));if(l=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope,!c||typeof Worker!=`function`||l)return ju(e,i).then(function(e){try{return a=e,f.call(this)}catch(e){return r(e)}}.bind(this),r);var u=function(){try{return f.call(this)}catch(e){return r(e)}}.bind(this),d=function(t){try{return ju(e,i).then(function(e){try{return a=e,u()}catch(e){return r(e)}},r)}catch(e){return r(e)}};try{return i.libURL=i.libURL||`https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js`,Nu(e,i).then(function(e){try{return a=e,u()}catch{return d()}},d)}catch{d()}function f(){try{a.name=e.name,a.lastModified=e.lastModified}catch{}try{i.preserveExif&&e.type===`image/jpeg`&&(!i.fileType||i.fileType&&i.fileType===e.type)&&(a=nu(e,a))}catch{}return n(a)}})}function Fu(e,t){if(e?.extension){let t=e.extension.toLowerCase(),n={jpg:{extension:`jpeg`,mimeType:`image/jpeg`,format:`jpeg`,pixieFormat:`jpeg`},jpeg:{extension:`jpeg`,mimeType:`image/jpeg`,format:`jpeg`,pixieFormat:`jpeg`},png:{extension:`png`,mimeType:`image/png`,format:`png`,pixieFormat:`png`},gif:{extension:`gif`,mimeType:`image/gif`,format:`gif`,pixieFormat:`png`},webp:{extension:`webp`,mimeType:`image/webp`,format:`webp`,pixieFormat:`png`},svg:{extension:`svg`,mimeType:`image/svg+xml`,format:`svg`,pixieFormat:`svg`}};if(n[t])return n[t]}if(e?.type){let t=_o(e.type),n={"image/jpeg":{extension:`jpeg`,mimeType:`image/jpeg`,format:`jpeg`,pixieFormat:`jpeg`},"image/png":{extension:`png`,mimeType:`image/png`,format:`png`,pixieFormat:`png`},"image/gif":{extension:`gif`,mimeType:`image/gif`,format:`gif`,pixieFormat:`png`},"image/webp":{extension:`webp`,mimeType:`image/webp`,format:`webp`,pixieFormat:`png`},"image/svg+xml":{extension:`svg`,mimeType:`image/svg+xml`,format:`svg`,pixieFormat:`svg`}};if(n[t])return n[t]}if(e?.name){let t=e.name.split(`.`).pop()?.toLowerCase();if(t){let e={jpg:{extension:`jpeg`,mimeType:`image/jpeg`,format:`jpeg`,pixieFormat:`jpeg`},jpeg:{extension:`jpeg`,mimeType:`image/jpeg`,format:`jpeg`,pixieFormat:`jpeg`},png:{extension:`png`,mimeType:`image/png`,format:`png`,pixieFormat:`png`},gif:{extension:`gif`,mimeType:`image/gif`,format:`gif`,pixieFormat:`png`},webp:{extension:`webp`,mimeType:`image/webp`,format:`webp`,pixieFormat:`png`},svg:{extension:`svg`,mimeType:`image/svg+xml`,format:`svg`,pixieFormat:`svg`}};if(e[t])return e[t]}}if(t){let e=_o(t),n=bo(e),r=`jpeg`;return n===`png`?r=`png`:n===`svg`?r=`svg`:n===`jpeg`&&(r=`jpeg`),{extension:n,mimeType:e,format:n,pixieFormat:r}}return{extension:`jpeg`,mimeType:`image/jpeg`,format:`jpeg`,pixieFormat:`jpeg`}}Pu.getDataUrlFromFile=_u,Pu.getFilefromDataUrl=gu,Pu.loadImage=vu,Pu.drawImageInCanvas=Su,Pu.drawFileInCanvas=wu,Pu.canvasToFile=Tu,Pu.getExifOrientation=Ou,Pu.handleMaxWidthOrHeight=ku,Pu.followExifOrientation=Au,Pu.cleanupCanvasMemory=Eu,Pu.isAutoOrientationInBrowser=Du,Pu.approximateBelowMaximumCanvasSizeOfBrowser=bu,Pu.copyExifWithoutOrientation=nu,Pu.getBrowserName=yu,Pu.version=`2.0.2`;var Iu={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},Lu=[`gif`,`svg`];function Ru(e,t){let{colorHex:n,colorHex2:r,colorHex3:i}=t,a=[`--icon-grad-1: ${n}`,`--icon-grad-2: ${r}`,`--icon-stroke-1: ${n}`,`--icon-stroke-2: ${r}`,`--icon-stroke-3: ${i}`,`--icon-fill-1: ${n}`,`--icon-fill-2: ${r}`,`--icon-fill-3: ${i}`,`color: ${n}`].join(`;`),o=e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};${a}"`):n+=` style="${a}"`,`<svg${n}>`});return o=o.replace(/var\(--icon-color-1\)/g,n).replace(/var\(--icon-color-2\)/g,r).replace(/var\(--icon-color-3\)/g,i).replace(/var\(--icon-fill-1\)/g,n).replace(/var\(--icon-fill-2\)/g,r).replace(/var\(--icon-fill-3\)/g,i).replace(/var\(--icon-stroke-1\)/g,n).replace(/var\(--icon-stroke-2\)/g,r).replace(/var\(--icon-stroke-3\)/g,i).replace(/var\(--icon-grad-1\)/g,n).replace(/var\(--icon-grad-2\)/g,r).replace(/currentColor/g,n),o}function zu(e,t){let n=e.match(/\swidth="([0-9.]+)(px)?"/i),r=e.match(/\sheight="([0-9.]+)(px)?"/i);if(n&&r){let e=parseFloat(n[1]),i=parseFloat(r[1]);if(Number.isFinite(e)&&Number.isFinite(i)&&e>0&&i>0){let n=e/i;return n>=1?{width:t,height:Math.max(1,Math.round(t/n))}:{width:Math.max(1,Math.round(t*n)),height:t}}}let i=e.match(/viewBox="([^"]+)"/i);if(i){let e=i[1].trim().split(/\s+/);if(e.length===4){let n=parseFloat(e[2]),r=parseFloat(e[3]);if(Number.isFinite(n)&&Number.isFinite(r)&&n>0&&r>0){let e=n/r;return e>=1?{width:t,height:Math.max(1,Math.round(t/e))}:{width:Math.max(1,Math.round(t*e)),height:t}}}}return{width:t,height:t}}function Bu(e){if(!e)return null;let t=e.trim();if(t.endsWith(`%`))return null;let n=parseFloat(t.replace(/px$/i,``));return Number.isFinite(n)&&n>0?n:null}function Vu(e,t=2,n=4096){let{width:r,height:i}=function(e){let t=e.match(/<\s*svg\b[\s\S]*?>/i)?.[0]??``,n=t.match(/\bwidth\s*=\s*["']([^"']*)["']/i)?.[1],r=t.match(/\bheight\s*=\s*["']([^"']*)["']/i)?.[1],i=Bu(n),a=Bu(r);if(i!=null&&a!=null)return{width:i,height:a};let o=e.match(/viewBox\s*=\s*["']([^"']+)["']/i)?.[1];if(o){let e=o.trim().split(/[\s,]+/);if(e.length===4){let t=parseFloat(e[2]),n=parseFloat(e[3]);if(Number.isFinite(t)&&Number.isFinite(n)&&t>0&&n>0)return{width:t,height:n}}}return i==null?a==null?{width:300,height:300}:{width:a,height:a}:{width:i,height:i}}(e),a=Math.max(1,Math.round(r*t)),o=Math.max(1,Math.round(i*t)),s=Math.max(64,n),c=Math.max(a,o);if(c>s){let e=s/c;a=Math.max(1,Math.round(a*e)),o=Math.max(1,Math.round(o*e))}return{width:a,height:o}}async function Hu(e,t,n,r,i){let a=i?.canvasScale??2,o=new Blob([e],{type:`image/svg+xml;charset=utf-8`}),s=URL.createObjectURL(o);try{let e=new Image;await new Promise((t,n)=>{e.onload=()=>t(),e.onerror=()=>n(Error(`Failed to load SVG image`)),e.src=s});let r=document.createElement(`canvas`),i=Math.max(1,Math.round(t*a)),o=Math.max(1,Math.round(n*a));r.width=i,r.height=o;let c=r.getContext(`2d`);if(!c)throw Error(`Canvas 2D context is not available`);return c.clearRect(0,0,i,o),c.drawImage(e,0,0,i,o),function(e){return new Promise((t,n)=>{e.toBlob(e=>{e?t(e):n(Error(`canvas.toBlob returned null`))},`image/png`)})}(r)}finally{URL.revokeObjectURL(s)}}async function Uu(e,t,n,r,i){return a=await Hu(e,t,n,0,i),new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>t(n.error??Error(`readAsDataURL failed`)),n.readAsDataURL(a)});var a}function Wu(e,t,n,r){return new File([e],t,{type:n,lastModified:r})}function Gu(e,t){return t&&t!==e.name?Wu(e,t,e.type,e.lastModified):e}async function Ku(e,t={}){let{maxSizeMB:n=Iu.MAX_SIZE_MB,maxWidthOrHeight:r=Iu.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:a,libURL:o,enableCompression:s=!0,convertSvgToPng:c=!1}=t;if(!(e&&e instanceof File))return e;let l=e,u=!1;if(c){let t=(l.type||``).toLowerCase(),n=/\.svg$/i.test(l.name.trim()),i=t.includes(`svg`),o=!1;if(!i&&!n)try{o=function(e){let t=e.trimStart().replace(/^\uFEFF/,``);return!!t.startsWith(`<`)&&/<\s*svg[\s>/]/i.test(t)}(await async function(e,t=24e3){let n=Math.min(t,Math.max(0,e.size));return e.slice(0,n).text()}(l))}catch{o=!1}if(i||n||o)try{l=await async function(e,t={}){let n=t.pixelScale??2,r=t.maxLongEdge??4096,i=await e.text(),{width:a,height:o}=Vu(i,n,r),s=await Hu(i,a,o,0,{canvasScale:1}),c=t.outputFileName??e.name,l=/\.svg$/i.test(c)?c.replace(/\.svg$/i,`.png`):`${c}.png`;return new File([s],l,{type:`image/png`,lastModified:e.lastModified})}(l,{maxLongEdge:r,outputFileName:a??l.name}),u=!0}catch{l=e}}if(u)return l;let d=_o((l.type&&l.type.trim()!==``?l.type:xo(l.name))||i||`image/jpeg`);if(!d.startsWith(`image/`))return Gu(l,a);let f=(p=d)===`image/webp`?`image/jpeg`:p;var p;let m=bo(d),h=bo(f),g=f===d?a??l.name:function(e,t){let n=t.startsWith(`.`)?t.slice(1):t,r=e.lastIndexOf(`.`);return r>0?`${e.substring(0,r)}.${n}`:`${e}.${n}`}(a??l.name,h),_=s&&(v=m,!Lu.includes(v));var v;if(!_&&f===d)return Gu(l,g);try{let t={libURL:o,useWebWorker:!0,fileType:f};_?(t.maxSizeMB=n,t.maxWidthOrHeight=r):(t.maxSizeMB=Math.max(e.size/1048576+1,1),t.initialQuality=1,t.alwaysKeepResolution=!0);let i=await Pu(l,t);return function(e,t,n,r){let i=r??t.name;return e instanceof File?e.type!==n||e.lastModified!==t.lastModified||e.name!==i?Wu(e,i,n,t.lastModified):e:Wu(e,i,n,t.lastModified)}(i,l,_o(i.type||f),g)}catch{try{return Gu(l,g)}catch{return l}}}async function qu(e){let{folderId:t,dataProviders:n,folders:r,pathHistory:i,t:a}=e,o=t==null?``:String(t);if(!o||o===`folders`)return a(`Folders`);if(o===`Trash`)return a(`Trash`);let s=i||[],c=s[s.length-1];if(c?.id===o&&c.name)return c.name;let l=[...s].reverse().find(e=>e.id===o);if(l?.name)return l.name;let u=n?.getItem;if(u)try{let e=await Promise.resolve(u(o));if(e?.name)return e.name}catch{}let d=r?.find(e=>e.id===o);return d?.name?d.name:o}var Ju=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function Yu(e){let t=new URL(e.trim());t.hash=``,t.hostname=t.hostname.toLowerCase(),(t.protocol===`https:`&&t.port===`443`||t.protocol===`http:`&&t.port===`80`)&&(t.port=``);let n=Array.from(t.searchParams.entries()).filter(([e])=>!Ju.test(e)).sort(([e,t],[n,r])=>{let i=e.localeCompare(n);return i===0?t.localeCompare(r):i});return t.search=``,n.forEach(([e,n])=>t.searchParams.append(e,n)),t.toString()}function Xu(e){if(function(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`DirectResourceFetchError`?!(`final`in e)||!1!==e.final:`final`in e&&!0===e.final)}(e)||e instanceof Ql)throw e}async function Zu(e,t,n,r,i){let{fetchWithProxy:a,handleFileProxy:o,handleProxyUrl:s}=t,c=Object.assign({mode:`cors`},i?.fetchInit),l;if(o)try{let t=await Promise.resolve(o(e));if(t)return r(t)}catch(e){Xu(e),l=e}if(s)try{let t=await Promise.resolve(s(e));if(t&&t!==e)return r(await n(t))}catch(e){Xu(e),l=e}if(a)try{let t=await Promise.resolve(a(e,c,{intent:`downloadBlob`}));if(!t.ok)throw Error(`HTTP ${t.status}`);return r(await t.blob())}catch(e){Xu(e),l=e}if(!a)try{return r(await n(e))}catch(e){Xu(e),l=e}throw l instanceof Error?l:Error(`Failed to download file from the URL`)}function Qu(e){return!!e?.startsWith(`image/`)&&e!==`image/gif`}function $u(e,t){if(t===e.name)return e;try{return new File([e],t,{type:e.type,lastModified:e.lastModified})}catch{return e}}function ed(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error??Error(`Failed to read proxied file`)),r.readAsDataURL(e)})}function td(e){try{let t=new URL(e).pathname.split(`/`).pop();return t?decodeURIComponent(t):void 0}catch{return}}function nd(e){return e==null||e===``||e===`folders`?null:e}async function rd(e){let t=await fetch(e,{mode:`cors`});if(!t.ok)throw new Ql(`HTTP ${t.status}`,`UploadUrlDownloadFailed`,t.status);return t.blob()}function id(e,t){if(!(e instanceof Blob)||e.size===0)throw new Ql(t(`Failed to download file from the URL.`),`UploadUrlDownloadFailed`);let n=(e.type?.split(`;`)[0])?.trim()||`image/png`;if(!n.startsWith(`image/`))throw new Ql(t(`Content type at the URL is not allowed.`),`UploadUrlContentTypeNotAllowed`);return{blob:e,mimeType:n}}var ad=()=>{let{state:e,actions:t,options:n}=yl(),{sortBy:r,sortOrder:i}=Nl().state,{actions:{fetchFolders:a}}=Xl(),{t:o}=Ks(),c=Il(),{deleteItems:l}=Zl(),{selectedFolder:u,urlForm:d,pagination:f,files:p,pathHistory:m,folders:h}=e,g=s.default.useRef(null),_=s.default.useRef([]);g.current=f,_.current=Array.isArray(p)?p:[];let v=s.default.useRef(null),{setFiles:y,setLoading:b,setIsUrlModalVisible:x,setActiveLibraryItem:S,setPagination:C,setSelectedFolder:w,setPathHistory:T}=t,{dataProviders:E}=n,D=(0,s.useCallback)(async e=>{if(!E?.getFiles)return[];let t=n?.config?.disablePagination,r=t?void 0:e?.page??1,i=t?void 0:e?.limit??20,{files:a,pagination:o}=await E.getFiles({folderId:e?.folderId===`folders`?void 0:e?.folderId,noFolder:e?.noFolder,search:(e?.search)?.trim()||void 0,sortBy:e?.sortBy,sortOrder:e?.sortOrder,page:r,limit:i,itemType:e?.itemType||`all`});return C&&(n?.config?.disablePagination?C({current:1,pageSize:a.length||1,total:a.length||0}):o&&C({current:o.page,pageSize:o.limit,total:o.total})),a},[E,n?.config?.disablePagination,C]),O=(0,s.useCallback)(async(e,t,r)=>_c(E,e,t,r,zo(n?.config)),[E,n?.config?.dedupeUploadNamesOnClient]),k=(0,s.useCallback)(async(e,t=!1)=>{try{b?.(!0);let t=[];if(!E?.getFiles)return;t=await D(e);let n=e??{folderId:u||``,itemType:`all`};n.itemType!==`file`&&(t=await Ml(t,n,E?.getFolders)),(u||``)!==`Trash`&&(t=t.filter(e=>!(e.isFolder&&e.id===`Trash`))),y?.(t),nd(n.folderId)===nd(u)&&(v.current={selectedFolder:u??null,pathHistory:(Array.isArray(m)?m:[]).map(e=>Object.assign({},e))})}catch(r){if(r?.name===`StaleLoad`)return;let i=Vl(r),s=i?.status===404||i?.code===`FileNotFound`||i?.code===`path_folder_not_found`;if(!t&&s){let t=Jl(r,m||[]);try{await Yl({options:n,pathFolder:t,dataProviders:n?.dataProviders}),await k(e,!0);return}catch{}}if(s&&w&&T){let t=Array.isArray(m)?m:[];if(t.length>1){let n=t.slice(0,-1),r=n[n.length-1]?.id??`folders`;T(n),w(r),await a(),c.success({id:`FOLDER_NOT_FOUND_NAVIGATE`,message:o(`Folder not found`),description:o(`Navigated to parent folder`),placement:`bottomRight`}),await k(Object.assign(Object.assign({},e),{folderId:r}),!1);return}T([{id:`folders`,name:o(`Folders`)}]),w(`folders`),await a(),c.success({id:`FOLDER_NOT_FOUND_NAVIGATE`,message:o(`Folder not found`),description:o(`Navigated to root folder`),placement:`bottomRight`}),await k(Object.assign(Object.assign({},e),{folderId:`folders`}),!1);return}let l=v.current;if(l&&w&&T){let e=Array.isArray(m)?m:[],t=(l.selectedFolder??null)===(u??null),r=function(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id)}(l.pathHistory,e);t&&r||(w(l.selectedFolder),T(l.pathHistory.map(e=>Object.assign({},e))),n.onPathChange&&n.onPathChange(l.pathHistory.map(e=>e.name)))}let d=zl(i?.code,o),f=e??{folderId:u||``,itemType:`all`},p=f.folderId!==void 0&&f.folderId!==``?f.folderId:u||``,g=Array.isArray(m)?m.map(e=>Object.assign({},e)):[],_=f.folderName?.trim(),y=_&&_.length>0?_:await qu({folderId:p,dataProviders:E,folders:Array.isArray(h)?h:[],pathHistory:g,t:o}),b=o(`Failed to load files`),x=o(`Failed to load files in folder`,{folderName:y}),S=d&&d!==b?d:void 0;c.error({id:`FILES_FETCH_FAILED`,message:x,description:S,placement:`bottomRight`,innerException:r,notificationDedupe:!0,data:{params:Object.assign(Object.assign({},f),{folderName:y}),folderName:y}})}finally{b?.(!1)}},[E,y,b,w,T,D,a,u,h,c,o,m,n]),A=(0,s.useCallback)(e=>k(e),[k]),j=(0,s.useCallback)(async(e,t)=>{if(!E?.findFileByUrl)return null;let n=Yu(e);try{return await E.findFileByUrl(n)??null}catch{return null}},[E]),M=(0,s.useCallback)(async(e,t)=>{tu(e,o);let r=Yu(e),i=await j(r,t);if(i)return{kind:`existing`,file:i,normalizedUrl:r};let a,s;try{let e=await Zu(r,{fetchWithProxy:n?.config?.fetchWithProxy,handleFileProxy:n?.config?.handleFileProxy,handleProxyUrl:n?.config?.handleProxyUrl},rd,e=>id(e,o));a=e.blob,s=e.mimeType}catch(e){throw e instanceof Ql||e instanceof Error?e:new Ql(o(`Failed to download file from the URL.`),`UploadUrlDownloadFailed`)}let c=bo(s),l=td(r)||`uploaded-file`,u=l.replace(/\.[^.]+$/,``)||`uploaded-file`;return{kind:`blob`,blob:a,normalizedUrl:r,mimeType:s,extension:c,fileName:Lo(l.includes(`.`)?l:`${u}.${c}`,n?.config)}},[j,n?.config,o]),N=(0,s.useCallback)(async(e,t)=>{tu(e,o);let r=Yu(e);try{let e=await M(r,t);return e.kind===`existing`?e.file:{thumbnail:await ed(e.blob),name:e.fileName,type:e.mimeType,extension:e.extension,size:e.blob.size,sourceUrl:e.normalizedUrl,saveWithoutFolder:!0}}catch(e){let s=e;if(E?.uploadFileByUrl)try{let e=u??``,t=await O(Lo(td(r)||`uploaded-file`,n?.config),e,!1),i=await E.uploadFileByUrl({url:r,folderId:e,name:t,eventSource:`pixie`}),a=id((i?.id&&E.getFileData?await E.getFileData(i.id):void 0)??(i?.url?await rd(i.url):i?.thumbnailUrl?await rd(i.thumbnailUrl):i?.sourceUrl?await rd(i.sourceUrl):void 0),o),s=await ed(a.blob);return Object.assign(Object.assign({},i),{thumbnail:s,type:i.type||a.mimeType,extension:i.extension||bo(a.mimeType),size:i.size??a.blob.size,sourceUrl:i.sourceUrl||r})}catch(e){s=e}let l=Vl(s),d=(i=l?.code,a=`UploadUrlDownloadFailed`,typeof i==`string`?i:a),f=s instanceof Ql?s:new Ql(zl(d,o)??l?.message??o(`Failed to download file from the URL.`),d,l?.status);throw f.notificationShown=!0,await c.error({id:`EDITOR_PROXY_FILE_FAILED`,message:f.message,placement:`bottomRight`,data:{url:r,folderId:u||null,error:l,eventSource:`pixie`},innerException:s},t),f}var i,a},[E,c,n?.config,M,O,u,o]),P=(0,s.useCallback)(async e=>{let t=g.current;try{await l({items:[{id:e,isFolder:_.current.find(t=>t.id===e)?.isFolder}],selectedFolder:u,getItemNameById:e=>e?p.find(t=>t.id===e)?.name:void 0,showNotifications:!0});let n=Object.assign({},t),a=t.current;p.length===1&&(a=n.current>1?n.current-1:1),await A({folderId:u||``,page:a,limit:t.pageSize,sortBy:r,sortOrder:i})}catch(t){let n=t;n!=null&&n.notificationShown||c.error({id:`FILES_DELETE_ERROR`,message:o(`Error when deleting a file`),placement:`bottomRight`,innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:u||null,errors:[{itemId:e,error:Vl(t)}]}})}},[l,A,u,o,c,p,r,i]),F=(0,s.useCallback)(async e=>{try{let t=g.current;if(!E?.deleteFolder)return void c.error({id:`FOLDER_DELETE_ERROR`,message:o(`DataProvider for folder deletion is not configured`),placement:`bottomRight`,data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await E.deleteFolder(e)){let e=Error(`Не удалось удалить папку`);throw e.notificationShown=!1,e}c.success({id:`FOLDER_DELETE_SUCCESS`,message:o(`Folder deleted`),placement:`bottomRight`,data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}}),u===e?await A({page:t.current,limit:t.pageSize,sortBy:r,sortOrder:i}):await A({folderId:u||``,sortBy:r,sortOrder:i,page:t.current,limit:t.pageSize})}catch(t){let n=t;n!=null&&n.notificationShown||c.error({id:`FOLDER_DELETE_ERROR`,message:o(`Error when deleting a folder`),innerException:t,placement:`bottomRight`,data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:Vl(t)}]}})}},[E,u,c,o,A,r,i]),I=(0,s.useCallback)(async(e,t)=>{try{if(E?.getFileData){let t=await E.getFileData(e);if(t)return t;throw Error(o(`Failed to download file`))}{let t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw Error(o(`Error loading image`));return await t.blob()}}catch(n){let r=_.current.find(t=>t.id===e);t||c.error({id:`FILE_DOWNLOAD_FAILED`,message:o(`Failed to download file`),placement:`bottomRight`,description:r?.name||e,innerException:n,notificationDedupe:!1,data:{itemId:e,itemName:r?.name||e,folderId:r?.folderId??null,thumbnail:r?.thumbnail??null}},t)}},[E,c,o]),L=(0,s.useCallback)(async(t,r,i,a)=>{if((a?``:r??(u||``))===`Trash`)throw Error(o(`Upload to Trash is forbidden`));let s=Lo(t.name,n?.config),l=s.split(`.`).pop()||``,d=a?``:r??(u||``),f=t;try{if(So(t)){let e=n?.config?.compressMaxSize??Iu.MAX_SIZE_MB,r=n?.config?.compressMaxWidthOrHeight??2e3,i=n?.config?.compessorUrl??n?.config?.compressorUrl,a=t.type?.trim()||xo(t.name)||t.type;f=await Ku(t,{maxSizeMB:e,maxWidthOrHeight:r,mimeType:a,fileName:s,libURL:i,enableCompression:Qu(a),convertSvgToPng:!0})}else f=$u(t,s)}catch{f=$u(t,s)}let p=f.name,m=zo(n?.config);m&&(p=await O(p,d,a)),m&&(f=$u(f,p));try{if(E?.uploadFiles)try{let n=await E.uploadFiles({items:[{name:p,size:f.size,type:f.type||t.type,folderId:d,data:f,extension:l,noFolder:a}],folderId:d});if(n.success&&n.detailed&&n.detailed.length>0){let r=n.detailed[0];if(!r.success||!r.data){if(!i){let e=r?.error?String(r.error):o(`Failed to upload file`);c.error({id:`FILE_UPLOAD_ITEM_FAILED`,message:e,placement:`bottomRight`,description:s,innerException:r?.error,data:{itemName:s,folderId:d||null,eventSource:`upload`}})}S&&S(Ja);return}{let n=r.data;if(n.id){let r=(n.folderId??d)||void 0;await A({folderId:r??u??``,noFolder:a});let i=e.files.find(e=>e.id===n.id);if(!i)try{i=(await D({folderId:r,noFolder:a,itemType:`all`})).find(e=>e.id===n.id)}catch{}return S&&S(Ja),i||Object.assign(Object.assign({},n),{id:n.id,name:n.name||s,folderId:n.folderId??d??null,type:f.type||t.type,size:f.size,extension:l||s.split(`.`).pop()||``,thumbnail:n.thumbnail??void 0,url:n.url??void 0,thumbnailUrl:n.thumbnailUrl??void 0,isFolder:!1,selected:!1})}}}else if(!n.success){if(!i){let e=n.error?String(n.error):o(`Failed to upload file`);c.error({id:`FILE_UPLOAD_ITEM_FAILED`,message:e,placement:`bottomRight`,description:s,innerException:n.error,data:{itemName:s,folderId:d||null,eventSource:`upload`}})}S&&S(Ja);return}S&&S(Ja);return}catch(e){throw e}if(E?.uploadFile){let e=await E.uploadFile({name:p,size:f.size,type:f.type||t.type,folderId:d,noFolder:a,data:f,extension:l});return S&&S(Ja),e}i||c.error({id:`FILES_UPLOAD_PROVIDER_NOT_CONFIGURED`,message:o(`DataProvider for file upload is not configured`),placement:`bottomRight`});return}catch(e){let t=zl(Vl(e)?.code,o);i||c.error({id:`FILE_UPLOAD_ITEM_FAILED`,message:t??o(`Failed to upload file`),placement:`bottomRight`,description:s,innerException:e,data:{itemName:s,folderId:d||null,error:Vl(e),eventSource:`upload`}});return}},[E,u,S,e.files,A,D,c,o,n?.config]),R=(0,s.useCallback)(async(e,t)=>{if(!E?.getFolders||!E?.createFolder)return e||``;try{let n=await E.getFolders(),r=Array.isArray(n)?n:[],i=(e,t)=>r.find(n=>(n.parentId??null)===(e??null)&&n.name===t),a=e??``;for(let e of t){if(!e)continue;let t=i(a,e);if(!t){let n=await E.createFolder({name:e,parentId:a??null});r.push(n),t=n}a=t.id}return a??(e||``)}catch{return e||``}},[E]),z=(0,s.useCallback)(async(e,t)=>{var n;if(!((n=e.type)?.startsWith)?.call(n,`image/`))return t??null;let r=e?.webkitRelativePath,i=t||``;if(r&&r.includes(`/`)){let e=r.split(`/`);e.pop();let n=e.filter(Boolean);n.length&&(i=await R(t||``,n)||t||``)}return i??t??null},[R]);(0,s.useCallback)(async e=>{var t,n,r,i,a;let{file:o,selectedFolderId:s,uploadFn:c,progressCallbacks:l}=e;if(!((t=o.type)?.startsWith)?.call(t,`image/`))return{success:!0,fileName:o.name,folderId:s??null};let u=await z(o,s)??s??null??s??null,d;(n=l?.onStart)==null||n.call(l,o);try{if(l?.onProgress){let e=0;d=window.setInterval(()=>{var t;e=Math.min(e+10+Math.floor(Date.now()%10),90),(t=l?.onProgress)==null||t.call(l,o.name,e)},200)}let e=await c(o,u??void 0);return l!=null&&l.onProgress&&((r=l?.onProgress)==null||r.call(l,o.name,100)),(i=l?.onComplete)==null||i.call(l,o.name),{success:!0,fileName:o.name,fileId:e?.id,folderId:e?.folderId??u??null}}catch(e){let t=e instanceof Error?e.message:String(e);return(a=l?.onError)==null||a.call(l,o.name,t),{success:!1,fileName:o.name,folderId:u??s??null,error:t}}finally{d!==void 0&&clearInterval(d)}},[z]);let ee=(0,s.useCallback)(async(e,t)=>{var r,i,a;if(e.length===0)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};(r=t?.onStartBatch)==null||r.call(t,e);let s=e=>{let t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(`, `):null},l=[];for(let r=0;r<e.length;r++){let s=e[r];if(!So(s)){let e=await c.warning({id:`FILES_UPLOAD_UNSUPPORTED_TYPE`,message:o(`Unsupported file type`),placement:`bottomRight`,data:{itemName:s.name,fileType:s.type,folderId:u||null}});(i=t?.onError)==null||i.call(t,s.name,e.message);continue}let d=Lo(s.name,n?.config),f=s;try{if(So(s)){let e=n?.config?.compressMaxSize??Iu.MAX_SIZE_MB,t=n?.config?.compressMaxWidthOrHeight??2e3,r=n?.config?.compessorUrl??n?.config?.compressorUrl,i=s.type?.trim()||xo(s.name)||s.type;f=await Ku(s,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:i,fileName:d,libURL:r,enableCompression:Qu(i),convertSvgToPng:!0})}else f=$u(s,d)}catch{f=$u(s,d)}let p=`${Date.now()}-${r}-${Math.random().toString(36).slice(2,8)}`,m=await z(f,u);(a=t?.onStart)==null||a.call(t,f),l.push({file:f,targetFolderId:m,requestId:p,originalFileName:s.name,originalIndex:r})}let d=l.length;if(d===0)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};let f=zo(n?.config),p=new Map;if(f&&E?.getFiles){let e=[...new Set(l.map(e=>e.targetFolderId??u??``).filter(e=>e!=null))];for(let t of e)try{let{files:e}=await E.getFiles({folderId:t===``?``:t??void 0,itemType:`all`,page:1,limit:1e4}),n=(e||[]).map(e=>e.name).filter(e=>!!e);if(E?.getFolders){let e=(await E.getFolders({parentId:t||null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);n=[...n,...e]}p.set(t,n)}catch{}}let m=new Map,h=l.map(e=>{let t=f?((e,t)=>{let n=e??``,r=p.get(n)||[],i=m.get(n);i||(i=new Set(r.map(e=>e.toLowerCase())),m.set(n,i));let a=gc(t,Array.from(i));return i.add(a.toLowerCase()),a})(e.targetFolderId,e.file.name):e.file.name,n=f?$u(e.file,t):e.file;return Object.assign(Object.assign({},e),{resolvedUploadName:t,uploadFile:n})}),g=!t,_=d===1&&g,v=[],y=[],b=[],x=[],C=new Map,w=0,T=0,D=n?.config?.maxFileSize??52428800,O=async(e,n,r,i)=>{var a,s;let{emitProgress:l=!0,emitNotification:d=!0}=i??{};w++,v.push(e),y.push(r??e),await((e,t,n,r)=>c.success({id:`FILE_UPLOAD_ITEM_SUCCESS`,message:`${o(`File`)} ${e} ${o(`has been successfully uploaded`)}`,placement:`bottomRight`,data:{itemId:n,itemName:e,folderId:t??u??null,eventSource:`upload`}},r||!g))(e,n,r,!d),l&&((a=t?.onProgress)==null||a.call(t,e,100),(s=t?.onComplete)==null||s.call(t,e))},k=async(e,n,r,i)=>{var a;let{emitProgress:s=!0,emitNotification:l=!0,fileSize:d,progressCallbackName:f,progressCallbackIndex:p}=i??{};T++;let m=await((e,t,n,r,i)=>{let a=Vl(n),s=i?.fileSize??a?.fileSize,l=i?.maxSize??a?.maxSize??D,d={allowedChars:`a-z A-Z 0-9 . _ -`,fileSize:s==null?void 0:pc(Number(s)),maxSize:l==null?void 0:pc(Number(l))},f=a?.code,p=f===`BatchItemLimitExceeded`||f===`exceeded_max_files`?f:Bl(a?.message)??f,m=p===`BatchItemLimitExceeded`||p===`exceeded_max_files`?Hl(n,o):zl(p,o,d),h=a?.message&&typeof a.message==`string`&&a.message.length>0?a.message:null,_=n instanceof Error?n.message:typeof n==`string`?n:null,v=_&&_!==`[object Object]`?_:null;return c.error({id:`FILE_UPLOAD_ITEM_FAILED`,message:h??m??v??o(`Error uploading file {{fileName}}`,{fileName:e}),placement:`bottomRight`,data:{itemName:e,folderId:t??u??null,error:Vl(n),eventSource:`upload`},innerException:n},r||!g)})(e,n,r,!l,d==null?void 0:{fileSize:d,maxSize:D});s&&((a=t?.onError)==null||a.call(t,f??e,m.message,p)),x.push({itemId:void 0,itemName:e,error:Vl(r)}),b.push({fileName:e,error:m.message})},A;if(!E?.uploadFiles)return c.error({id:`FILES_UPLOAD_PROVIDER_NOT_CONFIGURED`,message:o(`DataProvider for file upload is not configured`),placement:`bottomRight`}),{successCount:0,failCount:d,successes:[],errors:[],totalCount:d};{let e=[];try{t!=null&&t.onProgress&&l.forEach(n=>{let r=0,i=window.setInterval(()=>{var e;r=Math.min(r+10+Math.floor(Date.now()%10),90),(e=t?.onProgress)==null||e.call(t,n.file.name,r)},200);e.push(i)}),A=await E.uploadFiles({items:h.map(e=>({requestId:e.requestId,name:e.resolvedUploadName,size:e.uploadFile.size,type:e.uploadFile.type,folderId:e.targetFolderId??u??null,data:e.uploadFile,extension:e.uploadFile.name.split(`.`).pop()||``})),folderId:u??null}),e.forEach(e=>window.clearInterval(e)),e.length=0;let n=A.detailed??[],r=new Map(n.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(n.length>0)for(let e=0;e<h.length;e++){let t=h[e],i=(t.requestId?r.get(t.requestId):void 0)??n[e];if(i&&i.success){let e=i.data,n=e?.name??t.resolvedUploadName,r=e?.folderId??t.targetFolderId??u??null,a=e?.id;C.set(n,{id:a,name:n,folderId:r,size:e?.size,originalFileName:t.originalFileName,originalIndex:t.originalIndex}),await O(n,r,a,{emitNotification:_})}else{let e=i?.data;await k(e?.name??t.resolvedUploadName,e?.folderId??t.targetFolderId??u??null,i?.error??Error(o(`Error uploading file`)),{emitNotification:_,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}else if(A.success)for(let e of h){let t=e.resolvedUploadName;await O(t,e.targetFolderId??u??null,void 0,{emitNotification:_})}else{let e=A.error??Error(o(`Error uploading file`));for(let t of h){let n=t.resolvedUploadName;await k(n,t.targetFolderId??u??null,e,{emitNotification:_,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}}catch(e){for(let t of h){let n=t.resolvedUploadName;await k(n,t.targetFolderId??u??null,e??Error(o(`Error uploading file`)),{emitNotification:_,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}finally{e.forEach(e=>window.clearInterval(e))}}if(w>0&&(S&&S(Ja),d>1&&g)){let e=s(v),t=e?o(`Uploaded`,{names:e}):o(`uploads_success_summary`,{successCount:w,totalCount:d});c.success({id:`FILES_UPLOAD_BATCH_SUCCESS`,message:t,placement:`bottomRight`,data:{successCount:w,totalCount:d,itemIds:y,itemNames:v,folderId:u??null,eventSource:`upload`}})}if(T>0&&g&&!_){if(d>1){let e=b.map(e=>e.fileName),t=s(e),n=t?o(`Failed`,{names:t}):o(`uploads_fail_summary`,{failCount:T,totalCount:d});c.error({id:`FILES_UPLOAD_BATCH_FAILED`,message:n,placement:`bottomRight`,data:{failCount:T,totalCount:d,itemNames:e,folderId:u??null,errors:x,eventSource:`upload`}})}else if(d===1&&x.length>0&&x[0].error?.code){let e=zl(x[0].error?.code,o),t=b[0]?.fileName??``,n=e??(t?`${o(`Failed to upload files`)}: ${t}`:o(`Failed to upload files`));c.error({id:`FILES_UPLOAD_BATCH_FAILED`,message:n,placement:`bottomRight`,data:{failCount:T,totalCount:d,itemNames:[t],folderId:u??null,errors:x,eventSource:`upload`}})}}return{successCount:w,failCount:T,successes:v,errors:b,totalCount:d,uploadedFiles:C.size>0?C:void 0}},[E,n?.config?.dedupeUploadNamesOnClient,c,z,u,S,o,n?.config]);return{fetchFiles:A,handleDeleteFile:P,handleDeleteFolder:F,handleAddFile:(0,s.useCallback)(async e=>{if(!E?.uploadFiles)return void c.error({id:`FILES_UPLOAD_PROVIDER_NOT_CONFIGURED`,message:o(`DataProvider for file upload is not configured`),placement:`bottomRight`});if(u===`Trash`)return void c.warning({id:`FOLDER_OPERATION_VALIDATION_FAILED`,message:o(`Cannot upload files to Trash`),placement:`bottomRight`,data:{folderId:u||null,reason:`Upload to Trash is not allowed`}});let t=g.current,s=document.createElement(`input`);s.type=`file`,s.accept=`image/*`,s.multiple=!0;try{!(!n?.config?.features||!n.config.features.enableDirectoryUpload)&&(s.webkitdirectory=!0)}catch{}s.onchange=async n=>{var o;let s=n.target.files;if(!s||s.length===0)return;let c=Array.from(s);try{b?.(!0);let{successes:n,errors:s,uploadedFiles:l}=await ee(c,e);(o=e?.onBatchComplete)==null||o.call(e,{files:c,successes:n,errors:s,uploadedFiles:l}),await a(),await A({folderId:u||``,sortBy:r,sortOrder:i,page:t.current,limit:t.pageSize})}catch{}finally{b?.(!1)}},s.click()},[E?.uploadFiles,u,c,o,b,A,a,r,i,ee,n?.config?.features]),handleAddFileByUrl:(0,s.useCallback)(async(e,t,a,s=`uploadByUrl`)=>{let l=g.current,f=!!(e&&String(e).trim()),p,m=e??null;try{if(!t&&u===`Trash`)throw a||c.warning({id:`FOLDER_OPERATION_VALIDATION_FAILED`,message:o(`Cannot upload files to Trash`),placement:`bottomRight`,data:{folderId:u||null,reason:`Upload to Trash is not allowed`}}),new Ql(o(`Cannot upload files to Trash`),`UploadUrlDownloadFailed`);let e,h;if(!m&&d&&(e=await d.validateFields(),m=e?.fileUrl),!m)throw a||c.error({id:`FILES_UPLOAD_URL_VALIDATION_FAILED`,message:o(`Please fill in all fields`),placement:`bottomRight`,data:{url:m??null,folderId:u||null,eventSource:s}}),new Ql(o(`Please fill in all fields`),`UploadUrlInvalid`);if(tu(m,o),m=Yu(m),b?.(!0),m){let e=m.split(`?`)[0].split(`#`)[0].split(`/`);h=e[e.length-1]||`uploaded-file`,h=Lo(h,n?.config)}let g=t?``:u||``,_=!!(E?.uploadFiles||E?.uploadFile),v=!!E?.uploadFileByUrl,y=h;y&&v&&(y=await O(y,g,t));try{let e=await M(m,a);if(e.kind===`existing`)p=e.file;else if(_){let n=new File([e.blob],e.fileName,{type:e.mimeType,lastModified:Date.now()});try{p=await L(n,g,!0,t)}catch(e){throw e.uploadUrlStage=`binaryUpload`,e}if(!p){let e=new Ql(o(`Failed to upload file`),`FileUploadBackendError`);throw e.uploadUrlStage=`binaryUpload`,e}}else{if(!v)throw a||c.error({id:`FILES_UPLOAD_URL_NOT_SUPPORTED`,message:o(`Upload by URL is not supported`),placement:`bottomRight`,data:{url:m,folderId:u||null,eventSource:s}}),new Ql(o(`Upload by URL is not supported`),`UploadUrlDownloadFailed`);p=await E.uploadFileByUrl({url:m,folderId:u||``,noFolder:t,name:y,eventSource:s})}}catch(e){if(e?.uploadUrlStage===`binaryUpload`||!v)throw e;p=await E.uploadFileByUrl({url:m,folderId:u||``,noFolder:t,name:y,eventSource:s})}let C=e?.name||p?.name||`unnamed file`;return p&&c.success({id:`FILE_UPLOAD_ITEM_SUCCESS`,message:`${o(`File`)} ${C} ${o(`successfully uploaded`)}`,placement:`bottomRight`,data:{itemName:C,itemId:p?.id,folderId:u||null,eventSource:s}},a),(e||f)&&(x?.(!1),d?.resetFields()),S&&S(Ja),await A({folderId:u||``,noFolder:t,sortBy:r,sortOrder:i,page:l.current,limit:l.pageSize}),p}catch(e){if(!a){let t=Vl(e),n=t,r=e,i=Number(n?.fileSize),a=Number(n?.maxSize),l=Number.isFinite(i)&&Number.isFinite(a)?{fileSize:i,maxSize:a}:void 0,d=r?.uploadUrlStage===`binaryUpload`?Hl(t,o,l):Gl(t,o);c.error({id:`FILES_UPLOAD_BY_URL_FAILED`,message:d,placement:`bottomRight`,data:{url:m??null,folderId:u||null,error:t,eventSource:s},innerException:e})}throw e}finally{b?.(!1)}},[d,b,E,c,o,x,S,A,u,r,i,O,M,L,n?.config]),handleDroppedFiles:(0,s.useCallback)(async e=>{if(!e.length)return;let t=g.current;u===`Trash`?c.warning({id:`FOLDER_OPERATION_VALIDATION_FAILED`,message:o(`Cannot upload files to Trash`),placement:`bottomRight`,data:{folderId:u||null,reason:`Upload to Trash is not allowed`}}):(await ee(e),await A({folderId:u||``,sortBy:r,sortOrder:i,page:t.current,limit:t.pageSize}))},[A,u,r,i,ee,c,o]),getFileData:I,findFileByUrl:j,resolveFileForEditByUrl:N,uploadFileWithProvider:L}},od=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},sd=e=>e,cd=e=>{let t=(e=>e?od(e):od)(e),n=e=>function(e,t=sd){let n=s.default.useSyncExternalStore(e.subscribe,s.default.useCallback(()=>t(e.getState()),[e,t]),s.default.useCallback(()=>t(e.getInitialState()),[e,t]));return s.default.useDebugValue(n),n}(t,e);return Object.assign(n,t),n};function ld(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var ud=(dd=e=>({selectedFiles:new Set,visibleFileIds:[],anchorId:null,multiSelect:!0,setMultiSelect:t=>{e(e=>{if(e.multiSelect===t)return e;if(t)return{multiSelect:!0};let n=Array.from(e.selectedFiles)[0]??null;return{multiSelect:!1,selectedFiles:n?new Set([n]):new Set,anchorId:n}})},syncVisibleFiles:t=>{let n=Array.isArray(t)?t.map(e=>e.id):[];e(e=>{let t=new Set(n),r=new Set(Array.from(e.selectedFiles).filter(e=>t.has(e))),i=e.anchorId&&t.has(e.anchorId)?e.anchorId:null,a=function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}(e.visibleFileIds,n),o=ld(e.selectedFiles,r),s=e.anchorId===i;return a&&o&&s?e:{visibleFileIds:n,selectedFiles:r,anchorId:i}})},setSelectedFiles:t=>{e(e=>{let n=new Set(e.visibleFileIds),r=new Set(Array.from(t).filter(e=>n.has(e)));return ld(e.selectedFiles,r)?e:{selectedFiles:r,anchorId:Array.from(r)[0]??null}})},clearSelection:()=>{e(e=>e.selectedFiles.size===0&&e.anchorId===null?e:{selectedFiles:new Set,anchorId:null})},selectAllVisible:()=>{e(e=>{let t=new Set(e.visibleFileIds),n=e.visibleFileIds[0]??null;return ld(e.selectedFiles,t)&&e.anchorId===n?e:{selectedFiles:t,anchorId:n}})},toggleFileSelection:(t,n)=>{e(e=>{let r=!1!==e.multiSelect,i=!!n?.shiftKey&&r,a=!!n?.metaKey||!!n?.ctrlKey||!!n?.forceToggle,o=e.visibleFileIds,s=new Set(o);if(o.length>0&&!s.has(t))return e;if(!r){let n=new Set([t]);return ld(e.selectedFiles,n)&&e.anchorId===t?e:{selectedFiles:n,anchorId:t}}if(i&&e.anchorId&&s.has(e.anchorId)){let n=o.indexOf(e.anchorId),r=o.indexOf(t);if(n===-1||r===-1)return e;let[i,s]=n<r?[n,r]:[r,n],c=o.slice(i,s+1),l=a?new Set(e.selectedFiles):new Set;return c.forEach(e=>{l.add(e)}),ld(e.selectedFiles,l)?e:{selectedFiles:l}}if(i&&!e.anchorId){let n=new Set([t]);return ld(e.selectedFiles,n)&&e.anchorId===t?e:{selectedFiles:n,anchorId:t}}if(a){let n=new Set(e.selectedFiles);return n.has(t)?n.delete(t):n.add(t),ld(e.selectedFiles,n)&&e.anchorId===t?e:{selectedFiles:n,anchorId:t}}let c=new Set([t]);return ld(e.selectedFiles,c)&&e.anchorId===t?e:{selectedFiles:c,anchorId:t}})}}),dd?cd(dd):cd),dd,fd=e=>{let{state:t,actions:n,options:r}=yl(),{t:i}=Ks(),a=Xl(),o=Il(),{fetchFolders:c}=a.actions,{renameItem:l}=(()=>{let{options:e}=yl(),{dataProviders:t}=e,{t:n}=Ks();return{renameItem:(0,s.useCallback)(async({itemId:r,newName:i,isFolder:a})=>{try{if(a){if(!t?.renameFolder)throw Error(n(`renameFolder is not implemented in dataProviders`));let a=Ro(i.trim(),e.config),o=await t.renameFolder(r,a);return{success:!0,renamedItem:{id:o.id,name:o.name??a,parentId:o.parentId??null,folderId:o.parentId??null}}}if(!t?.renameFile)throw Error(n(`renameFile is not implemented in dataProviders`));let o=Lo(i,e.config),s=await t.renameFile(r,o);return{success:!0,renamedItem:{id:s?.id??r,name:s?.name??o,folderId:s?.folderId??null,parentId:s?.parentId??s?.folderId??null}}}catch(e){return{success:!1,error:Vl(e)}}},[t,n,e.config])}})(),{files:u,selectedFolder:d,fileToRename:f,renameForm:p,isRenameModalVisible:m,pagination:h}=t,{setFileToRename:g,setIsRenameModalVisible:_}=n,{dataProviders:v,config:y}=r,b=e=>{if(!e)return null;let t=e;return t.folderId??t.parentId??null},x=(e,t)=>({itemId:e?.id??t,itemName:e?.name,folderId:b(e)}),S=(0,s.useCallback)(e=>{let t=u?.find(t=>t.id===e);if(t?.isFolder||e.startsWith(`folder_`)){if(!1===y?.features?.enableRenameFolder)return void o.error({id:`FOLDER_RENAME_DISABLED_BY_CONFIG`,message:i(`Folder rename is disabled by config`),placement:`bottomRight`,data:x(t,e)});if(!v?.renameFolder)throw Error(i(`renameFolder is not implemented in dataProviders`))}else{if(!1===y?.features?.enableRenameFile)return void o.error({id:`FILE_RENAME_DISABLED_BY_CONFIG`,message:i(`File rename is disabled by config`),placement:`bottomRight`,data:x(t,e)});if(!v?.renameFile)throw Error(i(`renameFile is not implemented in dataProviders`))}g?.(e),_?.(!0),t&&p&&p.setFieldsValue({newFileName:t.name})},[u,g,_,p,y?.features?.enableRenameFolder,y?.features?.enableRenameFile,v?.renameFolder,v?.renameFile,o,i]),C=(0,s.useCallback)(()=>{_?.(!1),g?.(null),p?.resetFields()},[_,g,p]),w=(0,s.useCallback)(async()=>{if(!f||!p)return;let t=u?.find(e=>e.id===f);try{let r=await p.validateFields();if(!r?.newFileName)return;let a=t?.isFolder||f.startsWith(`folder_`);if(a){if(!1===y?.features?.enableRenameFolder)return void o.error({id:`FOLDER_RENAME_DISABLED_BY_CONFIG`,message:i(`Folder rename is disabled by config`),placement:`bottomRight`,data:x(t,f)})}else if(!1===y?.features?.enableRenameFile)return void o.error({id:`FILE_RENAME_DISABLED_BY_CONFIG`,message:i(`File rename is disabled by config`),placement:`bottomRight`,data:x(t,f)});let s=await l({itemId:f,newName:r.newFileName,isFolder:a});if(!s.success){let e=zl(s.error?.code,i);o.error({id:`ITEM_RENAME_FAILED`,message:e??s.error?.message??i(`Error renaming`),placement:`bottomRight`,data:Object.assign(Object.assign({},x(t,f)),{error:s.error}),innerException:s.error});return}let u=s.renamedItem;a?(o.success({id:`FOLDER_RENAME_SUCCESS`,message:i(`${i(`Folder renamed to`)} ${u?.name??r.newFileName}`),placement:`bottomRight`,data:{itemId:u?.id??f,itemName:u?.name??r.newFileName,folderId:u?.parentId??u?.folderId??null}}),await c(),u!=null&&u.id&&u.id!==f&&n.setSelectedFolder&&n.setSelectedFolder(u.id)):o.success({id:`FILE_RENAME_SUCCESS`,message:`${i(`File renamed to`)} ${u?.name??r.newFileName}`,placement:`bottomRight`,data:Object.assign(Object.assign({},x(t,f)),{itemName:u?.name??r.newFileName})}),C(),await e({folderId:d||``,page:h.current,limit:h.pageSize})}catch(e){let n=Vl(e),r=zl(n?.code,i);o.error({id:`ITEM_RENAME_FAILED`,message:r??(e instanceof Error?e.message:i(`Error renaming`)),placement:`bottomRight`,data:Object.assign(Object.assign({},x(t,f)),{error:n}),innerException:e})}},[f,p,u,n,C,e,d,i,h,y?.features?.enableRenameFolder,y?.features?.enableRenameFile,o,c,l]);return{state:{isRenamingFile:m||!1,fileToRename:f},actions:{showRenameModal:S,handleRenameCancel:C,handleRenameOk:w}}},pd=e=>{let t=t=>t?e.find(e=>e.id===t)?.name:void 0;return{getItemNameById:t,getItemNamesByIds:e=>e.map(t).filter(e=>!!e),getNamesPreview:e=>e.length>0&&e.length<=5?e.join(`, `):null}},md=(e,t,n,r,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:n,folderId:r??null}),hd=(e,t,n,r,i,a)=>({itemIds:e,itemNames:a&&a.length?a:void 0,failCount:t,totalCount:n,folderId:r??null,errors:i}),gd=()=>{let e=Il(),{t}=Ks(),{state:n,options:r}=yl(),{folders:i,pathHistory:a}=n,{dataProviders:o}=r,{actions:{fetchFolders:c,fetchChildFolders:l}}=Xl();return{refreshFolders:(0,s.useCallback)(async({parentIds:n,selectedFolder:r})=>{try{if(await c(),n&&l)for(let e of n)e&&await l(e)}catch(n){let r=t(`Folders`);e.error({id:`FOLDERS_FETCH_FAILED`,message:t(`Failed to refresh folder tree`),description:r,placement:`bottomRight`,innerException:n,notificationDedupe:!0,data:{folderId:null,folderName:r,reason:n instanceof Error?n.message:String(n)}})}},[e,t,c,l]),refreshFiles:(0,s.useCallback)(async({fetchFiles:n,selectedFolder:r,page:s,limit:c})=>{try{await n({folderId:r||``,page:s,limit:c})}catch(n){let l=await qu({folderId:r||``,dataProviders:o,folders:Array.isArray(i)?i:[],pathHistory:a,t}),u=t(`Failed to load files`),d=n instanceof Error?n.message:String(n);e.error({id:`FILES_FETCH_FAILED`,message:t(`Failed to load files in folder`,{folderName:l}),description:d&&d!==u?d:void 0,placement:`bottomRight`,innerException:n,notificationDedupe:!0,data:{params:{folderId:r||void 0,page:s,limit:c,folderName:l},folderName:l}})}},[e,t,o,i,a])}},_d=e=>{let{state:t,actions:n,options:r}=yl(),{t:i}=Ks(),a=Il(),o=ud(e=>e.selectedFiles),c=ud(e=>e.clearSelection),{files:l,selectedFolder:u,moveForm:d,pagination:f,currentMenuFile:p}=t,{setIsMoveModalVisible:m,setPagination:h}=n,{dataProviders:g}=r,{moveItems:_}=(()=>{let{options:e}=yl(),{dataProviders:t}=e,{t:n}=Ks(),r=Il();return{moveItems:(0,s.useCallback)(async({items:e,targetFolderId:i,getItemNameById:a,showNotifications:o=!1})=>{let s=0,c=0,l=[];if(t?.moveItems)try{let n=await t.moveItems(i===`folders`?``:i,e.map(e=>e.id)),r=n.detailed;if(r){let e=r.filter(e=>e.success),t=r.filter(e=>!e.success);s+=e.length,c+=t.length,t.forEach(e=>{let t=(e=>e.requestId??e.id)(e),n=e.error,r=Vl(n);l.push({itemId:t,itemName:a(t),error:r})})}else if(n.success)s+=e.length;else{let t=n.error;if(t){c+=e.length;let n=Vl(t);l.push({error:n})}else c+=e.length}}catch(t){c+=e.length;let n=Vl(t);l.push({error:n})}else c+=e.length,l.push({error:{message:`Move provider is not configured`}});return o&&(s>0&&r.success({id:`FILES_MOVE_SUCCESS`,message:n(`Files moved`),placement:`bottomRight`,data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:i===`folders`?null:i}}),c>0&&r.error({id:`FILES_MOVE_ERROR`,message:n(`Errors occurred while moving`),placement:`bottomRight`,innerException:l.length?l:void 0,data:{failCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),errors:l.length?l:void 0}})),{successCount:s,failCount:c,errorDetails:l}},[t,r,n])}})(),{refreshFolders:v,refreshFiles:y}=gd(),{getItemNameById:b,getItemNamesByIds:x,getNamesPreview:S}=pd(l),C=(0,s.useCallback)(()=>{m?.(!0)},[m]),w=(0,s.useCallback)(()=>{m?.(!1),d?.resetFields()},[m,d]);return{actions:{showMoveModal:C,handleMoveCancel:w,handleMoveOk:(0,s.useCallback)(async t=>{var n,s;if(!(p?.length||o&&o.size!==0))return;let m=l.length,C=Object.assign({},f),T=Array.from(p?.length?[p]:o),E=T.length,D=0,O=0,k=[],A=T.map(e=>l.find(t=>t.id===e)).filter(e=>!!e),j=A.some(e=>e?.isFolder||e.id.startsWith(`folder_`));try{let o=t;if(t||(o=(await d.validateFields())?.targetFolder),!o)return void a.error({id:`FILES_MOVE_DIRECTORY_NOT_SELECTED`,message:i(`Select destination folder`),placement:`bottomRight`});let l=o===`folders`?null:o,f=l??u,p=!0===r?.config?.dedupeUploadNamesOnClient;if(p&&g?.getFolders)try{let e=await g.getFolders({parentId:l,deep:!1}),t=new Set((e||[]).map(e=>e.name?.toLowerCase()).filter(Boolean));for(let e of A){if(!e.isFolder&&!(n=e.id).startsWith?.call(n,`folder_`))continue;let r=e.name||b(e.id)||``;if(r&&t.has(r.toLowerCase()))return void a.error({id:`FOLDER_ALREADY_EXISTS_MOVE`,message:i(`A folder with that name already exists. Please enter a different folder name.`),placement:`bottomRight`,data:{folderName:r,targetFolderId:o}})}}catch{}if(p&&g?.getFiles&&g?.renameFile)try{let e=[];if(g?.getFiles){let{files:t}=await g.getFiles({folderId:l??void 0,itemType:`all`,page:1,limit:1e4});e=(t||[]).map(e=>e.name).filter(e=>!!e)}if(g?.getFolders){let t=(await g.getFolders({parentId:l,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}let t=new Set(e.map(e=>e?.toLowerCase()).filter(Boolean));for(let e of A){if(e.isFolder||(s=e.id).startsWith?.call(s,`folder_`))continue;let n=e.name||b(e.id)||``;if(!n||!t.has(n.toLowerCase())){t.add(n.toLowerCase());continue}let r=gc(n,Array.from(t));await g.renameFile(e.id,r),t.add(r.toLowerCase())}}catch{}let M=await _({items:A,targetFolderId:o,getItemNameById:b,showNotifications:!1});if(D=M.successCount,O=M.failCount,k.push(...M.errorDetails),D>0){let e=x(T),t=S(e),n=t?i(`Moved`,{names:t}):i(`move_success_summary`,{successCount:D,totalCount:E});a.success({id:`FILES_MOVE_SUCCESS`,message:n,placement:`bottomRight`,data:md(T,D,E,l,e)})}if(O>0){let e=x(T),t=S(e),n;n=E===1&&k.length>0&&k[0].error?.code?zl(k[0].error?.code,i)??(t?i(`Failed`,{names:t}):i(`move_fail_summary`,{failCount:O,totalCount:E})):t?i(`Failed`,{names:t}):i(`move_fail_summary`,{failCount:O,totalCount:E}),a.error({id:`FILES_MOVE_ERROR`,message:n,placement:`bottomRight`,innerException:k.length?k:void 0,data:hd(T,O,E,l,k.length?k:void 0,e)})}w(),c();let N=C.current;if(D>0&&m>0&&D>=m&&C.current>1&&(N=C.current-1),D>0&&C.total>=D){let e=Math.max(0,(C.total??0)-D);h?.({current:N,pageSize:C.pageSize,total:e})}j&&await v({parentIds:void 0,selectedFolder:f}),await y({fetchFiles:e,selectedFolder:u,page:N,limit:C.pageSize})}catch(e){let t=zl(Vl(e).code,i);a.error({id:`FILES_MOVE_ERROR`,innerException:e,message:t??i(`Error moving`),placement:`bottomRight`,data:hd(T,E,E,u||null,[{error:Vl(e)}],x(T))})}},[p,o,d,e,u,f,l,a,h,i,_,c,m,r?.config?.dedupeUploadNamesOnClient,g?.getFiles,g?.renameFile,b])}}},vd=e=>{let{state:t,actions:n,options:r}=yl(),{t:i}=Ks(),a=Il(),o=ud(e=>e.selectedFiles),c=ud(e=>e.clearSelection),{files:l,selectedFolder:u,copyForm:d,pagination:f,currentMenuFile:p}=t,{setIsCopyModalVisible:m}=n,{dataProviders:h}=r,{copyItems:g}=(()=>{let{options:e}=yl(),{dataProviders:t}=e,{t:n}=Ks(),r=Il();return{copyItems:(0,s.useCallback)(async({items:e,targetFolderId:i,getItemNameById:a,showNotifications:o=!1})=>{let s=0,c=0,l=[],u=i===`folders`?``:i;if(t?.copyItems)try{let n=await t.copyItems(u,e.map(e=>({id:e.id,newName:e.newName}))),r=n.detailed;if(r){let e=r.filter(e=>e.success),t=r.filter(e=>!e.success);s+=e.length,c+=t.length,t.forEach(e=>{let t=(e=>e.requestId??e.id)(e),n=e.error,r=Vl(n);l.push({itemId:t,itemName:a(t),error:r})})}else if(n.success)s+=e.length;else{let t=n.error;if(t){c+=e.length;let n=Vl(t);l.push({error:n})}else c+=e.length}}catch(t){c+=e.length;let n=Vl(t);l.push({error:n})}else if(t?.copyItem)for(let n of e)try{let e=n?.isFolder||n.id.startsWith(`folder_`);await t.copyItem({itemId:n.id,targetFolderId:u,isFolder:e,newName:n.newName})?s++:c++}catch(e){c++;let t=Vl(e);l.push({itemId:n.id,itemName:a(n.id),error:t})}else c+=e.length,l.push({error:{message:`Copy provider is not configured`}});return o&&(s>0&&r.success({id:`FILES_COPY_SUCCESS`,message:n(`Files copied`),placement:`bottomRight`,data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:i===`folders`?null:i}}),c>0&&r.error({id:`FILES_COPY_ERROR`,message:n(`Errors occurred while copying`),placement:`bottomRight`,innerException:l.length?l:void 0,data:{failCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),errors:l.length?l:void 0}})),{successCount:s,failCount:c,errorDetails:l}},[t,r,n])}})(),{refreshFolders:_,refreshFiles:v}=gd(),{getItemNameById:y,getItemNamesByIds:b,getNamesPreview:x}=pd(l),S=(0,s.useCallback)(()=>{m?.(!0)},[m]),C=(0,s.useCallback)(()=>{m?.(!1),d?.resetFields()},[m,d]);return{actions:{showCopyModal:S,handleCopyCancel:C,handleCopyOk:(0,s.useCallback)(async t=>{var n;if(!(p?.length||o&&o.size!==0))return;let s=Array.from(p?.length?[p]:o),m=s.length,S=0,w=0,T=[],E=s.map(e=>l.find(t=>t.id===e)).filter(e=>!!e),D=E.some(e=>e?.isFolder||e.id.startsWith(`folder_`));try{let o=t;if(t||(o=(await d.validateFields())?.targetFolder),!o)return void a.error({id:`FILES_COPY_DIRECTORY_NOT_SELECTED`,message:i(`Select destination folder`),placement:`bottomRight`});let l=o===`folders`?null:o,p=l??u,O=E.map(e=>({id:e.id,isFolder:e?.isFolder||e.id.startsWith(`folder_`)})),k=!0===r?.config?.dedupeUploadNamesOnClient;if(k&&h?.getFolders)try{let e=await h.getFolders({parentId:l,deep:!1}),t=new Set((e||[]).map(e=>e.name?.toLowerCase()).filter(Boolean));for(let e of E){if(!e.isFolder&&!(n=e.id).startsWith?.call(n,`folder_`))continue;let r=e.name||y(e.id)||``;if(r&&t.has(r.toLowerCase()))return void a.error({id:`FOLDER_ALREADY_EXISTS_COPY`,message:i(`A folder with that name already exists. Please enter a different folder name.`),placement:`bottomRight`,data:{folderName:r,targetFolderId:o}})}}catch{}if(k&&h?.getFiles)try{let e=[],{files:t}=await h.getFiles({folderId:l??void 0,itemType:`all`,page:1,limit:1e4});if(e=(t||[]).map(e=>e.name).filter(e=>!!e),h?.getFolders){let t=(await h.getFolders({parentId:l,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}let n=[...e];O=E.map(e=>{var t;if(e.isFolder||(t=e.id).startsWith?.call(t,`folder_`))return{id:e.id,isFolder:!0};let r=E.find(t=>t.id===e.id)?.name||y(e.id)||``,i=gc(r,n);return n.push(i),{id:e.id,isFolder:!1,newName:i===r?void 0:i}})}catch{}else O=E.map(e=>({id:e.id,isFolder:e?.isFolder||e.id.startsWith(`folder_`)}));let A=await g({items:O,targetFolderId:o,getItemNameById:y,showNotifications:!1});if(S=A.successCount,w=A.failCount,T.push(...A.errorDetails),S>0){let e=b(s),t=x(e),n=t?i(`Copied`,{names:t}):i(`copy_success_summary`,{successCount:S,totalCount:m});a.success({id:`FILES_COPY_SUCCESS`,message:n,placement:`bottomRight`,data:md(s,S,m,l,e)})}if(w>0){let e=b(s),t=x(e),n;n=m===1&&T.length>0&&T[0].error?.code?zl(T[0].error?.code,i)??(t?i(`Failed`,{names:t}):i(`copy_fail_summary`,{failCount:w,totalCount:m})):t?i(`Failed`,{names:t}):i(`copy_fail_summary`,{failCount:w,totalCount:m}),a.error({id:`FILES_COPY_ERROR`,message:n,placement:`bottomRight`,innerException:T.length?T:void 0,data:hd(s,w,m,l,T.length?T:void 0,e)})}C(),c(),D&&await _({parentIds:void 0,selectedFolder:p}),await v({fetchFiles:e,selectedFolder:u,page:f.current,limit:f.pageSize})}catch(e){let t=zl(Vl(e).code,i);a.error({id:`FILES_COPY_ERROR`,message:t??i(`Error copying`),innerException:e,placement:`bottomRight`,data:hd(s,m,m,u||null,[{error:Vl(e)}],b(s))})}},[p,o,d,e,u,f,l,a,i,g,c,m,r?.config?.dedupeUploadNamesOnClient,h?.getFiles,y])}}},yd=e=>{let t=fd(e),n=_d(e),r=vd(e),i=(e=>{let{state:t,actions:n,options:r}=yl(),{t:i}=Ks(),a=Il(),o=ud(e=>e.selectedFiles),c=ud(e=>e.clearSelection),{files:l,selectedFolder:u,pagination:d,currentMenuFile:f}=t,{setIsDeleteConfirmVisible:p,setUndoDeletion:m,setPagination:h}=n,{config:g}=r,{deleteItems:_}=Zl(),{refreshFolders:v,refreshFiles:y}=gd(),{getItemNameById:b,getItemNamesByIds:x,getNamesPreview:S}=pd(l);return{actions:{showDeleteConfirm:(0,s.useCallback)(()=>{p?.(!0)},[p]),handleDeleteConfirmCancel:(0,s.useCallback)(()=>{p?.(!1)},[p]),handleDeleteConfirmOk:(0,s.useCallback)(async()=>{if(!(f?.length||o&&o.size!==0))return void(p==null||p(!1));let t=l.length,n=Object.assign({},d),r=Array.from(f?[f]:o),s=r.map(e=>l.find(t=>t.id===e)).filter(e=>!!e),C=new Set;s.forEach(e=>{e!=null&&e.isFolder&&C.add((e=>{if(!e)return null;let t=e;return t.folderId??t.parentId??null})(e))});let w=0,T=0,E=[];try{let o=await _({items:s,selectedFolder:u,getItemNameById:b,showNotifications:!1});w=o.successCount,T=o.failCount,E.push(...o.errorDetails);let l=g?.enableTrashFolder&&u===`Trash`;if(w>0&&g!=null&&g.enableTrashFolder&&!l&&m?.({itemIds:r,sourceFolderId:u||`folders`}),w>0){let e=r.length;g?.enableTrashFolder&&!l?await a.success({id:`FILES_DELETE_SUCCESS`,message:i(`moved_to_trash`,{count:w}),placement:`bottomRight`,data:{successCount:w,totalCount:e,itemIds:r,folderId:u||null}}):await a.success({id:`FILES_DELETE_SUCCESS`,message:i(`Files deleted`),placement:`bottomRight`,data:{successCount:w,totalCount:e,itemIds:r,folderId:u||null}})}if(T>0){let e=x(r),t=S(e),n=r.length,o=n===1&&E.length>0&&E[0].error?.code,s=g?.enableTrashFolder&&!l,c=i(s?`При перемещении в корзину произошли ошибки`:`При удалении произошли ошибки`),u=(o?zl(E[0].error?.code,i):void 0)??(t?i(`Failed`,{names:t}):c);a.error({id:`FILES_DELETE_ERROR`,message:u,placement:`bottomRight`,innerException:E.length?E:void 0,data:{failCount:T,isTrashMove:s,totalCount:n,itemNames:e,errors:E.length?E:void 0}})}c(),p?.(!1),await v({parentIds:Array.from(C),selectedFolder:u});let d=n.current;if(w>0&&t>0&&w>=t&&n.current>1&&(d=n.current-1),w>0&&n.total>=w){let e=Math.max(0,(n.total??0)-w);h?.({current:d,pageSize:n.pageSize,total:e})}await y({fetchFiles:e,selectedFolder:u,page:d,limit:n.pageSize})}catch(e){a.error({id:`FILES_DELETE_ERROR`,message:i(`Error deleting`),placement:`bottomRight`,innerException:e,data:{failCount:T,totalCount:s.length}})}},[f,o,p,e,u,d,m,h,l,i,a,_,c,g?.enableTrashFolder])}}})(e);return{state:t.state,actions:Object.assign(Object.assign(Object.assign(Object.assign({},t.actions),n.actions),r.actions),i.actions)}},bd=()=>{let{state:e}=yl(),{files:t,loading:n,isUrlModalVisible:r}=e,i=ad(),a=(()=>{let{state:e}=yl(),t=e.multiSelect,n=ud(e=>e.selectedFiles),r=ud(e=>e.toggleFileSelection),i=ud(e=>e.setMultiSelect);return(0,s.useEffect)(()=>{i(!1!==t)},[t,i]),{state:{selectedFiles:n},actions:{toggleFileSelection:r}}})(),o=yd(i.fetchFiles);return{state:{files:t||[],selectedFiles:a.state.selectedFiles,loading:n||!1,isAddingFileByUrl:r||!1,isRenamingFile:o.state.isRenamingFile,fileToRename:o.state.fileToRename},actions:{fetchFiles:i.fetchFiles,handleDeleteFile:i.handleDeleteFile,handleDeleteFolder:i.handleDeleteFolder,handleAddFile:i.handleAddFile,handleAddFileByUrl:i.handleAddFileByUrl,handleDroppedFiles:i.handleDroppedFiles,uploadFileWithProvider:i.uploadFileWithProvider,toggleFileSelection:a.actions.toggleFileSelection,showRenameModal:o.actions.showRenameModal,handleRenameCancel:o.actions.handleRenameCancel,handleRenameOk:o.actions.handleRenameOk,showMoveModal:o.actions.showMoveModal,handleMoveCancel:o.actions.handleMoveCancel,handleMoveOk:o.actions.handleMoveOk,showCopyModal:o.actions.showCopyModal,handleCopyCancel:o.actions.handleCopyCancel,handleCopyOk:o.actions.handleCopyOk,showDeleteConfirm:o.actions.showDeleteConfirm,handleDeleteConfirmCancel:o.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:o.actions.handleDeleteConfirmOk}}};function xd({maxConcurrent:e=6}={}){let t=(0,s.useRef)(new Map),n=(0,s.useRef)([]),r=(0,s.useRef)(0),i=(0,s.useMemo)(()=>{let i=e=>({status:e.status,shouldLoad:e.status===`loading`||e.status===`loaded`||e.status===`error`}),a=e=>{let t=i(e);e.listeners.forEach(e=>e(t))},o=e=>{n.current.length!==0&&(n.current=n.current.filter(t=>t!==e))},s=(e,n)=>{let r=t.current.get(e);if(!r){let r={id:e,src:n,status:`idle`,listeners:new Set,active:!1};return t.current.set(e,r),r}return r.src!==n&&(o(e),r.src=n,r.status=`idle`),r},c=()=>{for(;r.current<e&&n.current.length>0;){let e=n.current.shift();if(!e)break;let i=t.current.get(e);i&&i.active&&i.status===`queued`&&(i.status=`loading`,r.current+=1,a(i))}},l=(e,t)=>{e.status===`loading`&&(e.status=t,r.current=Math.max(0,r.current-1),a(e),c())};return{getSnapshot:(e,t)=>i(s(e,t)),subscribe:(e,n,r)=>{let a=s(e,n);return a.listeners.add(r),r(i(a)),()=>{let n=t.current.get(e);n&&(n.listeners.delete(r),n.active||n.listeners.size!==0||n.status===`loading`||t.current.delete(e))}},setActive:(e,t,i)=>{let l=s(e,t);l.active=i,i?l.status!==`loaded`&&l.status!==`loading`&&l.status!==`queued`?(l.status=`queued`,a(l),n.current.includes(e)||n.current.push(e),c()):a(l):l.status===`queued`?(o(e),l.status=`idle`,a(l)):l.status===`loading`&&(r.current=Math.max(0,r.current-1),l.status=`idle`,a(l),c())},markLoaded:e=>{let n=t.current.get(e);n&&l(n,`loaded`)},markError:e=>{let n=t.current.get(e);n&&l(n,`error`)},release:e=>{let n=t.current.get(e);n&&(n.active=!1,n.status===`queued`?(o(e),n.status=`idle`):n.status===`loading`&&(r.current=Math.max(0,r.current-1),n.status=`idle`,c()),n.listeners.size===0&&t.current.delete(e))}}},[e]);return(0,s.useEffect)(()=>()=>{n.current=[],t.current.clear(),r.current=0},[]),i}function Sd(e){if(e&&e!==`data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q==`){if(e.startsWith(`data:image/`)){let t=e.split(`,`)[1];return t&&t.length>20?e:void 0}return e.startsWith(`blob:`)?e:e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)?(e=>{if(e&&typeof e==`string`){if(e.startsWith(`data:`)||e.startsWith(`blob:`))return e;try{if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)){let t=new URL(e.startsWith(`/`)?`https://x${e}`:e),n=e.startsWith(`/`)?``:`${t.protocol}//${t.host}`,r=t.pathname.split(`/`).map(e=>{if(!e)return``;try{return encodeURIComponent(decodeURIComponent(e))}catch{return encodeURIComponent(e)}}).join(`/`);return e.startsWith(`/`)?r+(t.search||``)+(t.hash||``):`${n}${r}${t.search}${t.hash}`}}catch{}return e}})(e)??e:void 0}}function Cd(e,t){if(!e)return null;let n=Sd(e.src??void 0);return e.exhausted?Object.assign(Object.assign({},e),{src:null}):n?Object.assign(Object.assign({},e),{src:n}):Object.assign(Object.assign({},e),{src:t??null,changed:!1,reason:`unchanged`})}function wd(e){let{options:t}=yl(),n=t.config?.getProxiedUrl,r=(0,s.useRef)([]),i=(0,s.useRef)(!1),a=(0,s.useRef)(0),o=(0,s.useRef)(null),[c,l]=(0,s.useState)(!1),u=(0,s.useMemo)(()=>{let t=e.map(e=>Sd(e)).filter((e,t,n)=>!!e&&n.indexOf(e)===t);return function(e,t){return e===t||e.length===t.length&&e.every((e,n)=>e===t[n])}(r.current,t)?r.current:(r.current=t,t)},[e]),[d,f]=(0,s.useState)([]),[p,m]=(0,s.useState)(0);(0,s.useEffect)(()=>{let e=!1;if(m(0),i.current=!1,a.current=0,o.current=null,l(!1),u.length!==0)return(async()=>{let t=await Promise.all(u.map(async e=>{if(!n||!(t=e).startsWith(`http://`)&&!t.startsWith(`https://`))return[{originalSrc:e,src:e}];var t;try{let t=await Promise.resolve(n(e)),r=Sd(t?.src);return r?[{originalSrc:e,src:r,stabilityKey:t.stabilityKey,handleChangeSrc:t.handleChangeSrc,handleSuccess:t.handleSuccess,handleError:t.handleError,subscribeToSrcChange:t.subscribeToSrcChange}]:[{originalSrc:e,src:e}]}catch{return[{originalSrc:e,src:e}]}}));if(!e){let e=function(e){let t=new Set;return e.filter(e=>!(!e.src||t.has(e.src)||(t.add(e.src),0)))}(t.flat());f(t=>function(e,t){return e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.originalSrc===r.originalSrc&&e.src===r.src&&e.stabilityKey===r.stabilityKey})}(t,e)?t:e)}})(),()=>{e=!0};f(e=>e.length===0?e:[])},[n,u]);let h=d[p];(0,s.useEffect)(()=>{if(!h?.subscribeToSrcChange)return;let e,t=!1;return Promise.resolve(h.subscribeToSrcChange(e=>{if(t||i.current)return;let n=Cd(e,h.src);n!=null&&n.changed&&n.src&&!t&&f(e=>e.map((e,t)=>t===p?Object.assign(Object.assign({},e),{src:n.src}):e))})).then(n=>{t?n?.():e=n}),()=>{t=!0,e?.()}},[h,p]),(0,s.useEffect)(()=>{if(!h?.handleChangeSrc||i.current)return;let e=`${h.originalSrc}::${h.stabilityKey??``}::${p}`;if(o.current===e)return;o.current=e;let t=!1;return Promise.resolve(h.handleChangeSrc()).then(e=>{let n=Cd(e,h.src);n!=null&&n.changed&&n.src&&!t&&f(e=>e.map((e,t)=>t===p?Object.assign(Object.assign({},e),{src:n.src}):e))}),()=>{t=!0}},[h,p]);let g=(0,s.useCallback)(async()=>{if(!h?.handleChangeSrc)return{src:h?.src??null,changed:!1,exhausted:!1,reason:`unchanged`};if(i.current)return{src:null,changed:!1,exhausted:!0,reason:`exhausted`};let e=Cd(await Promise.resolve(h.handleChangeSrc()),h.src);return e?.changed&&e.src&&e.src!==h.src?(f(t=>t.map((t,n)=>n===p?Object.assign(Object.assign({},t),{src:e.src}):t)),e):e??{src:h.src,changed:!1,exhausted:!1,reason:`unchanged`}},[h,p]),_=(0,s.useCallback)(async()=>{if(i.current)return{src:null,changed:!1,exhausted:!0,reason:`exhausted`};if(!h)return i.current=!0,l(!0),{src:null,changed:!1,exhausted:!0,reason:`exhausted`};let e=(t=d.length,Math.max(8,6*t));var t;if(a.current>=e)return i.current=!0,l(!0),{src:null,changed:!1,exhausted:!0,reason:`exhausted`};a.current+=1;let n=h.handleError?Cd(await Promise.resolve(h.handleError()),h.src):null;return n?.exhausted?(i.current=!0,l(!0),n):n?.changed&&n.src&&n.src!==h.src?(f(e=>e.map((e,t)=>t===p?Object.assign(Object.assign({},e),{src:n.src}):e)),n):p+1>=d.length?(i.current=!0,l(!0),n??{src:null,changed:!1,exhausted:!0,reason:`exhausted`}):(m(e=>e+1),{src:d[p+1]?.src??null,changed:!0,exhausted:!1,reason:`candidate-fallback`})},[h,p,d]),v=(0,s.useCallback)(()=>{var e;i.current||h&&(a.current=0,(e=h.handleSuccess)==null||e.call(h))},[h]);return{src:c||h==null?void 0:h.src,hasNextCandidate:p+1<d.length,handleError:_,handleLoad:v,handleChangeSrc:g}}var Td=/(auto|scroll|overlay)/;function Ed(e,t){let n=Math.max(0,t??e.clientWidth);return Math.max(1,Math.round(n-function(e){if(typeof window>`u`)return 0;let t=window.getComputedStyle(e);return(Number.parseFloat(t.paddingLeft||`0`)||0)+(Number.parseFloat(t.paddingRight||`0`)||0)}(e)))}function Dd(e){if(typeof window>`u`)return!1;let t=window.getComputedStyle(e);return Td.test(t.overflowY)||Td.test(t.overflow)||Td.test(t.overflowX)}function Od(e){if(typeof window>`u`)return e;let t=e;for(;t;){if(Dd(t))return t;t=t.parentElement}return null}function kd(e){if(typeof window>`u`)return[e];let t=Od(e);return t?t===e?[window,e]:[window,t]:[window]}function Ad(e,t,n){return Math.max(0,e.clientHeight),Math.max(0,Math.round(e.getBoundingClientRect().height)),Math.max(1,t)}function jd(e,t){if(e===t){let n=function(e){if(typeof window>`u`)return Math.max(1,e.clientHeight);let t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement?.clientHeight||0,r=Math.max(0,t.top),i=Math.min(n,t.bottom);return Math.max(0,Math.round(i-r))}(t);return{scrollTop:t.scrollTop,viewportHeight:Ad(e,Math.min(t.clientHeight,n||t.clientHeight)),viewportWidth:Ed(t),scrollHeight:e.scrollHeight}}let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Math.max(n.top,r.top),a=Math.min(n.bottom,r.bottom),o=Math.max(n.left,r.left),s=Math.min(n.right,r.right),c=Math.max(0,Math.round(a-i)),l=Math.max(0,Math.round(s-o));return{scrollTop:Math.max(0,Math.round(i-r.top)),viewportHeight:Ad(e,c),viewportWidth:Ed(e,l||t.clientWidth||e.clientWidth),scrollHeight:e.scrollHeight}}function Md(e){if(typeof window>`u`)return{scrollTop:e.scrollTop,viewportHeight:Math.max(1,e.clientHeight),viewportWidth:Ed(e),scrollHeight:e.scrollHeight};let t=Od(e);return t&&function(e){return e.scrollHeight-e.clientHeight>1}(t)?jd(e,t):function(e){let t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement?.clientHeight||0,r=window.innerWidth||document.documentElement?.clientWidth||t.width,i=Math.max(0,t.top),a=Math.min(n,t.bottom),o=Math.max(0,Math.round(a-i));return{scrollTop:Math.max(0,Math.round(-t.top)),viewportHeight:Ad(e,o),viewportWidth:Ed(e,Math.min(Math.round(t.width),r)),scrollHeight:e.scrollHeight}}(e)}function Nd(e,t){let n=(0,s.useRef)(null),r=(0,s.useCallback)(t=>{e(Md(t))},[e]);return(0,s.useEffect)(()=>{n.current&&r(n.current)},[r,...t]),(0,s.useEffect)(()=>{if(!n.current||typeof ResizeObserver>`u`)return;let e=n.current,t=new ResizeObserver(()=>{r(e)});return t.observe(e),()=>t.disconnect()},[r]),(0,s.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{r(e)},i=kd(e);return i.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{i.forEach(e=>{e.removeEventListener(`scroll`,t)})}},[r,...t]),n}var Pd=({onSearch:e,placeholder:t,className:n})=>{let{t:r}=Ks(),[i,a]=(0,s.useState)(``),o=(0,s.useRef)(null),{options:c}=yl(),{config:d}=c,f=t||r(`Search files...`);return(0,s.useEffect)(()=>(o.current=Al.debounce(t=>{e(t)},500),()=>{var e;(e=o.current)==null||e.cancel()}),[e]),(0,l.jsx)(u.Input,{value:i,onChange:e=>{var t;let n=e.target.value;a(n),(t=o.current)==null||t.call(o,n)},placeholder:f,prefix:(0,l.jsx)(Ic,{size:16,strokeWidth:d?.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{a(``),e(``)}})},Fd=[{value:`date-desc`,labelKey:`Newest first`},{value:`date-asc`,labelKey:`Oldest first`},{value:`size-desc`,labelKey:`Largest first`},{value:`size-asc`,labelKey:`Smallest first`},{value:`name-asc`,labelKey:`A-Z`},{value:`name-desc`,labelKey:`Z-A`},{value:`type-asc`,labelKey:`By type`}],W={contentLayout:`contentLayout`,headerContainer:`headerContainer`,actionsContainer:`actionsContainer`,filesContainer:`filesContainer`,filesLoadingOverlay:`filesLoadingOverlay`,emptyStateWrapper:`emptyStateWrapper`,paginationContainer:`paginationContainer`,uploadIcon:`uploadIcon`,tableContainer:`tableContainer`,tableLoadingWrapper:`tableLoadingWrapper`,imagePreview:`imagePreview`,fileManagerTableFolder:`fileManagerTableFolder`,fileManagerTableFolderInner:`fileManagerTableFolderInner`,sortSelect:`sortSelect`,fileNameCol:`fileNameCol`,fileItemCount:`fileItemCount`,fileSize:`fileSize`,fileDate:`fileDate`,tableMenu:`tableMenu`,tableImagePreview:`tableImagePreview`,tableFolderIcon:`tableFolderIcon`,buttonDeselected:`buttonDeselected`,buttonSelectAll:`buttonSelectAll`,gridRow:`gridRow`,gridCard:`gridCard`,selectedRow:`selectedRow`,gridCardSelected:`gridCardSelected`,gridCheckbox:`gridCheckbox`,gridCardContent:`gridCardContent`,gridPreviewContainer:`gridPreviewContainer`,gridPreviewContainerFolder:`gridPreviewContainerFolder`,gridFolderIcon:`gridFolderIcon`,gridFolderIconImage:`gridFolderIconImage`,gridFileName:`gridFileName`,gridFileInfo:`gridFileInfo`,gridFileMenu:`gridFileMenu`,gridFileMenuButton:`gridFileMenuButton`,actionsBox:`actionsBox`,uploadContainer:`uploadContainer`,uploadArea:`uploadArea`,blockText:`blockText`,textTitle:`textTitle`,textDescription:`textDescription`,buttons:`buttons`,btnAi:`btnAi`,btnPhoto:`btnPhoto`,dragOverlay:`dragOverlay`,dragOverlayInner:`dragOverlayInner`,dragCaptureLayer:`dragCaptureLayer`,dragOverlayGlobal:`dragOverlayGlobal`,noFiles:`noFiles`,noFilesIcon:`noFilesIcon`,textTitle_trash:`textTitle_trash`,textDescription_trash:`textDescription_trash`},{Text:Id}=u.Typography,{Option:Ld}=u.Select,Rd=s.default.memo(({files:e,filesById:t,currentSortOption:n,isSmallScreen:r,iconStrokeWidth:i,multiSelectEnabled:a=!0,features:o,viewMode:c,setViewMode:d,handleSearch:f,handleSortOptionChange:p,sortOptions:m,onClearSelection:h,onRename:g,onDelete:_,onCopy:v,onMove:y,onEdit:b,t:x})=>{let S=(0,s.useMemo)(()=>m?.length?Fd.filter(e=>m.includes(e.value)):Fd,[m]),C=(0,s.useMemo)(()=>S.map(e=>e.value).join(`|`)||`all`,[S]),w=ud(e=>e.selectedFiles),T=ud(e=>e.selectedFiles.size),E=ud(e=>e.selectAllVisible),D=e.length>0&&T===e.length,O=(0,s.useMemo)(()=>Array.from(w)[0],[w]),k=(0,s.useMemo)(()=>O?t.get(O):void 0,[t,O]),A=k?.isFolder?!1!==o?.enableRenameFolder:!1!==o?.enableRenameFile,j=(0,s.useMemo)(()=>Array.from(w).every(e=>{let n=t.get(e);return!!n&&(n.isFolder?!1!==o?.enableMoveFolder:!1!==o?.enableMoveItem)}),[o,t,w]),M=(0,s.useMemo)(()=>Array.from(w).every(e=>{let n=t.get(e);return!!n&&(n.isFolder?!1!==o?.enableCopyFolder:!1!==o?.enableCopyItem)}),[o,t,w]),N=(0,s.useMemo)(()=>T===1&&function(e){if(!e||e.isFolder)return!1;let t=e.extension||(e.name&&e.name.includes(`.`)?e.name.split(`.`).pop():void 0)||(e.type?.startsWith(`image/`)?(e.type.split(`/`)[1]?.split(`;`)[0])?.trim():void 0);return!!(t&&co.includes(t.toLowerCase()))}(k),[T,k]);return(0,l.jsxs)(`div`,T>0?{className:`header-container ${W.headerContainer}`,children:[(0,l.jsxs)(Id,{type:`secondary`,className:`selected-text`,children:[(0,l.jsxs)(`div`,{children:[T,` `,x(`selected`)]}),a&&(0,l.jsx)(u.Tooltip,{title:r?x(`Select all`):null,children:(0,l.jsx)(u.Button,{className:W.buttonSelectAll,onClick:E,disabled:D||e.length===0,children:x(`Select all`)})}),(0,l.jsx)(u.Tooltip,{title:r?x(`Deselected`):null,children:(0,l.jsx)(u.Button,{className:W.buttonDeselected,icon:(0,l.jsx)(Fc,{size:16,strokeWidth:i}),onClick:h,children:x(`Deselected`)})})]}),(0,l.jsxs)(u.Space,{children:[N&&!1!==o?.enableEdit&&(0,l.jsx)(u.Tooltip,{title:r?x(`Edit`):null,children:(0,l.jsx)(u.Button,{icon:(0,l.jsx)(xc,{size:16,strokeWidth:i}),onClick:()=>b(k),disabled:!N,children:x(`Edit`)})}),j&&(0,l.jsx)(u.Tooltip,{title:r?x(`Move to`):null,children:(0,l.jsx)(u.Button,{icon:(0,l.jsx)(Cc,{size:16,strokeWidth:i}),onClick:y,children:x(`Move to`)})}),M&&(0,l.jsx)(u.Tooltip,{title:r?x(`Copy`):null,children:(0,l.jsx)(u.Button,{icon:(0,l.jsx)(bc,{size:16,strokeWidth:i}),onClick:v,children:x(`Copy`)})}),T===1&&A&&(0,l.jsx)(u.Tooltip,{title:r?x(`Rename`):null,children:(0,l.jsx)(u.Button,{icon:(0,l.jsx)(Rc,{size:16,strokeWidth:i}),onClick:()=>g(),disabled:T!==1||!A,children:x(`Rename`)})}),!1!==o?.enableDelete&&(0,l.jsx)(u.Tooltip,{title:r?x(`Delete`):null,children:(0,l.jsx)(u.Button,{danger:!0,icon:(0,l.jsx)(Bc,{size:16,strokeWidth:i}),onClick:e=>{e.stopPropagation(),e.preventDefault(),_()},children:x(`Delete`)})})]})]}:{className:W.headerContainer,children:[(0,l.jsx)(`div`,{className:`search-container`,children:(0,l.jsx)(Pd,{placeholder:x(`Search file or folder`),onSearch:f,className:W.searchInput})}),(0,l.jsxs)(`div`,{className:W.actionsBox,children:[(0,l.jsx)(`div`,{className:`sort-container`,children:(0,l.jsx)(u.Select,{value:n,onChange:p,className:W.sortSelect,popupMatchSelectWidth:!1,suffixIcon:(0,l.jsx)(vc,{size:16,strokeWidth:i}),children:S.map(({value:e,labelKey:t})=>(0,l.jsx)(Ld,{value:e,children:x(t)},e))},C)}),(0,l.jsx)(`div`,{className:W.actionsContainer,children:(0,l.jsx)(u.Segmented,{options:[{value:`grid`,icon:(0,l.jsx)(Dc,{size:16,strokeWidth:i})},{value:`table`,icon:(0,l.jsx)(Ac,{size:20,strokeWidth:i})}],value:c,onChange:e=>d(e)})})]})]})});Rd.displayName=`FileContentHeader`;var zd=s.default.memo(({fileId:e,style:t})=>{let n=ud(t=>t.selectedFiles.has(e)),r=ud(e=>e.toggleFileSelection);return(0,l.jsx)(u.Checkbox,{checked:n,style:t,onClick:e=>{e.stopPropagation()},onChange:t=>{let n=t.nativeEvent;r(e,{metaKey:n.metaKey,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,forceToggle:!0})}})});function Bd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}zd.displayName=`FileSelectionCheckbox`;var Vd=s.default.memo(e=>{var{className:t}=e,n=Bd(e,[`className`]);let r=n[`data-row-key`],i=r==null?``:String(r),a=[t,ud(e=>!!i&&e.selectedFiles.has(i))?W.selectedRow:``].filter(Boolean).join(` `);return(0,l.jsx)(`tr`,Object.assign({},n,{className:a}))});Vd.displayName=`SelectableTableRow`;var Hd=s.default.memo(({item:e,variant:t=`table`,t:n,iconStrokeWidth:r,setCurrentMenuFile:i,showMoveModal:a,showCopyModal:o,showRenameModal:c,showDeleteConfirm:d,onEdit:f})=>{let[p,m]=(0,s.useState)(!1),h=(0,s.useMemo)(()=>{if(!p)return[];let t=[];return e.canEdit&&t.push({key:`edit`,label:n(`Edit`),icon:(0,l.jsx)(xc,{size:16,strokeWidth:r})}),e.canMove&&t.push({key:`move`,label:n(`Move to`),icon:(0,l.jsx)(Cc,{size:16,strokeWidth:r})}),e.canCopy&&t.push({key:`copy`,label:n(`Copy`),icon:(0,l.jsx)(bc,{size:16,strokeWidth:r})}),e.canRename&&t.push({key:`rename`,label:n(`Rename`),icon:(0,l.jsx)(Rc,{size:16,strokeWidth:r})}),e.canDelete&&t.push({key:`delete`,label:n(`Delete`),icon:(0,l.jsx)(Bc,{size:16,strokeWidth:r}),style:{color:`#ff4d4f`}}),t},[r,p,e.canCopy,e.canDelete,e.canEdit,e.canMove,e.canRename,n]),g=(0,s.useCallback)(({key:t})=>{switch(e.id&&i?.(e.id),t){case`edit`:f(e.file);break;case`move`:a();break;case`copy`:o();break;case`rename`:c(e.id);break;case`delete`:d?.();break;default:i?.(``)}},[e,f,i,o,d,a,c]);return(0,l.jsx)(u.Dropdown,{arrow:!0,placement:`bottom`,menu:(0,s.useMemo)(()=>({items:h,onClick:g}),[g,h]),trigger:[`hover`],onOpenChange:m,children:t===`grid`?(0,l.jsx)(u.Button,{type:`default`,className:`${W.gridFileMenuButton} gridFileMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,l.jsx)(Sc,{size:16,strokeWidth:r})}):(0,l.jsx)(`span`,{className:`${W.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,l.jsx)(Sc,{size:16,strokeWidth:r})})})});Hd.displayName=`FileItemActionsDropdown`;var Ud=({thumbnailSrc:e,previewSrc:t,lightboxSrc:n,alt:r,className:i,width:a,height:o,preview:c=!1})=>{let d=(0,s.useMemo)(()=>[e,t],[e,t]),f=(0,s.useMemo)(()=>[n,t,e],[n,t,e]),p=wd(d),h=wd(f),{handleError:g,handleLoad:_}=h,v=p.src??so,y=h.src??p.src,b=(0,s.useRef)(!1);(0,s.useEffect)(()=>{b.current=!1},[y]);let x=(0,s.useCallback)(e=>s.default.cloneElement(e,{key:y??so,src:y??so,fallback:void 0,onError:()=>{b.current||(b.current=!0,g().finally(()=>{b.current=!1}).catch(()=>{}))},onLoad:()=>{_()}}),[y,g,_]);return(0,l.jsx)(u.Image,{className:i,src:v,alt:r,width:a,height:o,preview:(0,s.useMemo)(()=>!(!c||!y)&&{src:y,toolbarRender:()=>null,destroyOnHidden:!0,mask:(0,l.jsx)(m.EyeOutlined,{style:{fontSize:`20px`}}),imageRender:x},[c,y,x]),onLoad:p.handleLoad,onError:()=>{p.handleError().catch(()=>{})},fallback:so})},Wd=s.default.memo(({item:e,variant:t=`table`,FolderIcon:n,getFileData:r,className:i,width:a,height:o})=>e.isFolder?(0,l.jsx)(`div`,t===`grid`?{className:W.gridFolderIcon,children:(0,l.jsx)(n,{className:W.gridFolderIconImage})}:{className:W.fileManagerTableFolder,children:(0,l.jsx)(`div`,{className:W.fileManagerTableFolderInner,children:(0,l.jsx)(n,{className:W.tableFolderIcon,style:{width:a??40,height:o??40}})})}):e.thumbnailSrc||e.previewSrc?(0,l.jsx)(Ud,{className:i,thumbnailSrc:e.thumbnailSrc,previewSrc:e.previewSrc,lightboxSrc:e.lightboxSrc,alt:e.file.name,width:a,height:o,preview:!0,file:e.file,getFileData:r}):null);Wd.displayName=`FileItemPreview`;var Gd=[`.ant-image`,`.ant-image-preview-root`,`.ant-image-preview-wrap`,`.ant-image-preview-mask`,`.ant-image-preview-close`,`.ant-image-preview-operations`].join(`,`),Kd=e=>!!e.closest(Gd);function qd(e){if(e.isFolder)return!1;let t=typeof e.name==`string`?e.name:``,n=t?t.split(`.`).pop()?.toLowerCase():void 0,r=e.extension?.toLowerCase()??n;return typeof e.type==`string`&&e.type.startsWith(`image/`)||typeof r==`string`&&lo.includes(r)}var Jd=s.default.memo(({item:e,t,iconStrokeWidth:n,FolderIcon:r,handleItemClick:i,setCurrentMenuFile:a,showMoveModal:o,showCopyModal:c,showRenameModal:d,showDeleteConfirm:f,onEdit:p,onEditorOk:m,getFileData:h,showSelectionCheckbox:g=!0})=>{let _=ud(t=>t.selectedFiles.has(e.id)),v=(0,s.useCallback)(t=>{let n=t.target;n.closest(`.gridFileMenuButton`)||n.closest(`.ant-dropdown-menu`)||Kd(n)||t.detail===1&&(e.isFolder?i(e.file):m&&qd(e.file)&&m(e.file))},[i,e.file,e.isFolder,m]);return(0,l.jsx)(u.Col,{className:W.gridCard_col,style:{padding:0},children:(0,l.jsxs)(u.Card,{hoverable:!0,cover:(0,l.jsx)(`div`,{className:e.isFolder?W.gridPreviewContainerFolder:W.gridPreviewContainer,onClick:e=>{e.stopPropagation(),v(e)},children:(0,l.jsx)(Wd,{item:e,variant:`grid`,FolderIcon:r,getFileData:h,className:W.gridImagePreview})}),className:`${W.gridCard} ${_?W.gridCardSelected:``}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),v(e)},children:[(0,l.jsxs)(`div`,{className:W.gridCardContent,onClick:e=>{e.stopPropagation(),e.preventDefault(),v(e)},children:[(0,l.jsx)(`div`,{className:W.gridFileName,children:e.nameText||t(`Untitled`)}),(0,l.jsx)(`div`,{className:W.gridFileInfo,children:e.gridInfoText})]}),(0,l.jsx)(`div`,{className:W.gridFileMenu,onClick:e=>{e.stopPropagation()},children:(0,l.jsx)(Hd,{item:e,variant:`grid`,t,iconStrokeWidth:n,setCurrentMenuFile:a,showMoveModal:o,showCopyModal:c,showRenameModal:d,showDeleteConfirm:f,onEdit:p})}),g?(0,l.jsx)(`div`,{onClick:e=>{e.stopPropagation()},className:W.gridCheckbox,children:(0,l.jsx)(zd,{fileId:e.id,style:{height:20}})}):null]})})});Jd.displayName=`FileGridItem`;var Yd=s.default.memo(({rows:e,topOffset:t=0,bottomOffset:n=0,t:r,iconStrokeWidth:i,FolderIcon:a,handleItemClick:o,setCurrentMenuFile:s,showMoveModal:c,showCopyModal:d,showRenameModal:f,showDeleteConfirm:p,onEdit:m,onEditorOk:h,getFileData:g,showSelectionCheckbox:_=!0})=>(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(`div`,{style:{paddingTop:t,paddingBottom:n},children:(0,l.jsx)(u.Row,{gutter:[16,16],className:W.gridRow,style:{gap:20,padding:`0 24px 24px`,margin:0},children:e.map(e=>(0,l.jsx)(Jd,{item:e,handleItemClick:o,iconStrokeWidth:i,t:r,FolderIcon:a,setCurrentMenuFile:s,showMoveModal:c,showCopyModal:d,showRenameModal:f,showDeleteConfirm:p,onEdit:m,onEditorOk:h,getFileData:g,showSelectionCheckbox:_},e.id))})})}));Yd.displayName=`FileGridView`;var Xd=s.default.memo(({rows:e,columns:t,topOffset:n=0,bottomOffset:r=0,onRow:i,components:a})=>{let o=(0,s.useMemo)(()=>(0,l.jsx)(`div`,{style:{paddingTop:n,paddingBottom:r},children:(0,l.jsx)(u.ConfigProvider,{renderEmpty:()=>(0,l.jsx)(u.Empty,{image:(0,l.jsx)(l.Fragment,{}),description:``}),children:(0,l.jsx)(u.Table,{dataSource:e,columns:t,rowKey:`id`,pagination:!1,tableLayout:`fixed`,onRow:i,components:a,showHeader:!1})})}),[r,t,a,i,e,n]);return(0,l.jsx)(`div`,{className:W.tableLoadingWrapper,children:o})});Xd.displayName=`FileTableView`;var Zd=s.default.memo(({item:e})=>e.dateText?(0,l.jsx)(u.Tooltip,{title:e.dateText,placement:`bottom`,className:W.fileDate,children:e.dateText}):null);Zd.displayName=`FileItemDate`;var Qd=s.default.memo(({item:e})=>(0,l.jsxs)(`div`,{className:W.fileName,children:[e.nameText,e.isFolder&&(0,l.jsx)(`div`,{className:W.fileItemCount,children:e.folderItemsText})]}));Qd.displayName=`FileItemName`;var $d=`filemanager_view_mode`,ef=class{constructor(){this.rowsById=new Map}reconcile(e,t,n){let r=new Map,i=[];for(let a of e){let e=t.getId(a),o=t.buildSignature(a,n),s=this.rowsById.get(e);if(s&&s.signature===o){r.set(e,s),i.push(s);continue}let c=t.buildRowModel(a,n,{id:e,signature:o});r.set(e,c),i.push(c)}return this.rowsById=r,i}},tf=class{createRenderWindow(e,t){let n=t?.renderStrategy??`full`;if(n!==`windowed`){if(n===`positioned`){let n=t?.positioned?.layout??[],r=t?.positioned?.viewportTop??0,i=t?.positioned?.viewportBottom??2**53-1,a=Math.max(0,t?.positioned?.overscanPx??0),o=Math.max(0,t?.positioned?.containerHeight??0),s=n.filter(e=>e.bottom>=r-a&&e.top<=i+a).map(t=>({row:e[t.index],layout:t})).filter(e=>!!e.row),c=s[0]?.layout.index??-1,l=s[s.length-1]?.layout.index??-1;return{rows:s.map(e=>e.row),startIndex:c,endIndex:l,topOffset:0,bottomOffset:0,totalCount:e.length,containerHeight:o,positionedItems:s}}return{rows:e,startIndex:0,endIndex:e.length>0?e.length-1:-1,topOffset:0,bottomOffset:0,totalCount:e.length}}let r=Math.max(0,t?.windowed?.startIndex??0),i=t?.windowed?.endIndex??e.length-1,a=Math.max(0,t?.windowed?.overscan??0),o=Math.max(1,t?.windowed?.estimatedItemSize??1),s=Math.max(1,t?.windowed?.itemsPerLane??1),c=Math.ceil(e.length/s),l=Math.min(e.length-1,i),u=Math.floor(r/s),d=Math.floor(Math.max(r,l)/s),f=Math.max(0,u-a),p=Math.min(c-1,d+a),m=f*s,h=Math.min(e.length-1,(p+1)*s-1),g=Math.max(0,c-p-1);return{rows:e.slice(m,h+1),startIndex:m,endIndex:h,topOffset:f*o,bottomOffset:g*o,totalCount:e.length}}};function nf({items:e,context:t,adapter:n,options:r}){let i=(0,s.useRef)(null),a=(0,s.useRef)(null);i.current||=new ef,a.current||=new tf;let o=(0,s.useMemo)(()=>i.current.reconcile(e,n,t),[n,t,e]);return{rowModels:o,renderWindow:(0,s.useMemo)(()=>a.current.createRenderWindow(o,r),[r,o])}}function rf({totalCount:e,plan:t}){let[n,r]=(0,s.useState)(null);return{engineOptions:(0,s.useMemo)(()=>{if(!t.enabled)return{renderStrategy:`full`};let r=function(e,t){return Math.max(1,e?.viewportHeight??t)}(n,t.fallbackViewportHeight??800),i=Math.max(1,Math.ceil(r/t.estimatedItemSize)),a=Math.max(1,Math.ceil(e/t.itemsPerLane)),o=Math.min(a-1,Math.max(0,Math.floor((n?.scrollTop??0)/t.estimatedItemSize))),s=o+i-1;return{renderStrategy:`windowed`,windowed:{startIndex:o*t.itemsPerLane,endIndex:Math.min(e-1,(s+1)*t.itemsPerLane-1),overscan:t.overscan,estimatedItemSize:t.estimatedItemSize,itemsPerLane:t.itemsPerLane}}},[t.enabled,t.estimatedItemSize,t.fallbackViewportHeight,t.itemsPerLane,t.overscan,e,n]),handleViewportChange:(0,s.useCallback)(e=>{r(t=>t?.viewportHeight===e.viewportHeight&&t?.viewportWidth===e.viewportWidth&&t?.scrollHeight===e.scrollHeight&&t?.scrollTop===e.scrollTop?t:e)},[])}}function af(e,t){if(typeof e.childCount==`number`)return e.childCount;let n=t[e.id];return n===null?null:n??0}function of(e){let t=e.extension||(e.name&&e.name.includes(`.`)?e.name.split(`.`).pop():void 0)||(e.type?.startsWith(`image/`)?(e.type.split(`/`)[1]?.split(`;`)[0])?.trim():void 0);return!!(t&&co.includes(t.toLowerCase()))}function sf(e,t){if(!e)return``;let n=new Date(e);if(Number.isNaN(n.getTime()))return``;let r=[t(`months.january`),t(`months.february`),t(`months.march`),t(`months.april`),t(`months.may`),t(`months.june`),t(`months.july`),t(`months.august`),t(`months.september`),t(`months.october`),t(`months.november`),t(`months.december`)];return t(`Added`,{date:`${n.getDate()} ${r[n.getMonth()]} ${n.getFullYear()}`})}var cf={getId:e=>e.id,buildSignature:(e,t)=>function(e,t){let n=!!e.isFolder,r=n?af(e,t.folderFileCounts):null,i=n?r===null?`u`:String(r):`0`,a=sf(e.date,t.t),o=!n&&e.size?String(e.size):``,s=e.thumbnailUrl||e.thumbnail,c=e.url&&of(e)?e.url:``,l=t.previewFallbackToFileUrl?c:``,u=[!1!==t.features?.enableEdit,!1!==t.features?.enableMoveFolder,!1!==t.features?.enableMoveItem,!1!==t.features?.enableCopyFolder,!1!==t.features?.enableCopyItem,!1!==t.features?.enableRenameFolder,!1!==t.features?.enableRenameFile,!1!==t.features?.enableDelete].join(`|`),d=[s||``,l,c].join(`::`);return[e.id,e.name,e.folderId,e.type||``,e.extension||``,d,d,e.dimensions||``,o,a,n?`1`:`0`,i,u].join(`::`)}(e,t),buildRowModel:(e,t,n)=>{let r=!!e.isFolder,i=r?af(e,t.folderFileCounts):null,a=r&&i===null?`—`:r?`${i} ${i===1?t.t(`item`):t.t(`items`)}`:``,o=e.dimensions||``,s=!r&&e.size?hc(e.size):``,c=r?t.t(`Folder`):function(e){return e.extension||e.name.split(`.`).pop()?.toLowerCase()||(e.url?(e.url.split(`?`)[0].split(`/`).pop()?.split(`.`).pop())?.toLowerCase():``)||``}(e),l=sf(e.date,t.t),u=r?a:[o,s,c].filter(Boolean).join(` • `),d=e.thumbnailUrl||e.thumbnail,f=e.url&&of(e)?e.url:void 0,p=t.previewFallbackToFileUrl?f:void 0;return{id:n.id,signature:n.signature,item:e,file:e,isFolder:r,nameText:e.name||t.t(`No name`),folderItemsText:a,dimensionsText:o,sizeText:s,typeText:c,dateText:l,gridInfoText:u,thumbnailSrc:d,previewSrc:p,lightboxSrc:f,canEdit:!r&&!1!==t.features?.enableEdit&&of(e),canMove:r?!1!==t.features?.enableMoveFolder:!1!==t.features?.enableMoveItem,canCopy:r?!1!==t.features?.enableCopyFolder:!1!==t.features?.enableCopyItem,canRename:r?!1!==t.features?.enableRenameFolder:!1!==t.features?.enableRenameFile,canDelete:!1!==t.features?.enableDelete}}},lf=s.default.memo(({files:e,searchTerm:t,handleSearch:n,sortBy:r,sortOrder:i,handleSortOptionChange:a,pagination:o,setPagination:c,loading:d,handleItemClick:f,onClearSelection:p,onRename:m,onDelete:h,onCopy:g,onMove:_,showRenameModal:v,showDeleteConfirm:y,showCopyModal:b,showMoveModal:x,onEdit:S,getFileData:C,handleAddFile:w})=>{let{t:T}=Ks(),E=Il(),{DropZoneFileIcon:D,BigStockIcon:O,BigAIIcon:k,FolderIcon:A}=xl(),{options:j,actions:M,state:N}=yl(),{dataProviders:P,config:F}=j,I=F?.disablePagination,{setCurrentMenuFile:L,setActiveLibraryItem:R}=M,z=N?.selectedFolder===`Trash`,ee=!1!==N?.multiSelect,{viewMode:B,setViewMode:te}=(()=>{let[e,t]=(0,s.useState)(()=>{try{return localStorage.getItem($d)||`table`}catch{return`table`}}),n=(0,s.useCallback)(e=>{t(e);try{localStorage.setItem($d,e)}catch{}},[]);return{viewMode:e,setViewMode:n,toggleViewMode:(0,s.useCallback)(()=>{n(e===`table`?`grid`:`table`)},[e,n])}})(),[ne,re]=(0,s.useState)({}),[ie,ae]=(0,s.useState)(!1),oe=(0,s.useRef)(0),se=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1199px)`),t=e=>{ae(e.matches)};t(e);let n=e=>t(e);return typeof e.addEventListener==`function`?(e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)):(e.addListener(n),()=>e.removeListener(n))},[]);let ce=(0,s.useMemo)(()=>F?.features||{},[F?.features]),le=F?.iconStrokeWidth,ue=F?.sortOptions,de=(0,s.useMemo)(()=>ue?.length?new Set(ue):null,[ue]),fe=`${r}-${i}`;(0,s.useEffect)(()=>{if(de&&!de.has(fe)){let e=Fd.find(e=>de.has(e.value))?.value;e&&a(e)}},[de,fe,a]);let pe=(0,s.useMemo)(()=>new Map(e.map(e=>[e.id,e])),[e]),{renderRows:me,renderWindow:he,hasAnyValidDate:ge,handleViewportChange:_e}=function({files:e,folderFileCounts:t,features:n,t:r,viewMode:i,previewFallbackToFileUrl:a}){let o=(0,s.useMemo)(()=>({folderFileCounts:t,features:n,t:r,previewFallbackToFileUrl:a}),[n,t,r,a]),[c,l]=(0,s.useState)(()=>5),u=(0,s.useMemo)(()=>{let t=e.length>150;return i===`table`?{enabled:t,estimatedItemSize:56,overscan:10,itemsPerLane:1,fallbackViewportHeight:800}:{enabled:t,estimatedItemSize:320,overscan:2,itemsPerLane:c,fallbackViewportHeight:800}},[e.length,c,i]),{engineOptions:d,handleViewportChange:f}=rf({totalCount:e.length,plan:u}),{rowModels:p,renderWindow:m}=nf({items:e,context:o,adapter:cf,options:d}),h=(0,s.useMemo)(()=>p.some(e=>!!e.dateText),[p]),g=(0,s.useCallback)(e=>{if(i===`grid`){let t=Math.max(1,Math.floor(e.viewportWidth/240));l(e=>e===t?e:t)}f(e)},[f,i]);return{rowModels:p,renderRows:m.rows,renderWindow:m,hasAnyValidDate:h,handleViewportChange:g}}({files:e,folderFileCounts:ne,features:ce,t:T,viewMode:B,previewFallbackToFileUrl:F?.previewFallbackToFileUrl}),ve=(0,s.useCallback)(async e=>{try{if(P?.getChildrenCount)return await P.getChildrenCount(e===`folders`?void 0:e);if(P?.getFiles){let{files:t,pagination:n}=await P.getFiles({folderId:e===`folders`?void 0:e,itemType:`all`,page:I?void 0:1,limit:I?void 0:1});return I?Array.isArray(t)?t.length:0:n?.total??(Array.isArray(t)?t.length:0)}return 0}catch(t){if(t?.name===`StaleLoad`)return 0;let n=t;if(n?.status===404||n?.code===`FileNotFound`||n?.code===`path_folder_not_found`||n?.data?.code===`path_folder_not_found`||n?.data?.data?.status===404)return 0;let r=await qu({folderId:e,dataProviders:P,folders:Array.isArray(N.folders)?N.folders:[],pathHistory:N.pathHistory,t:T});return E.error({id:`FOLDER_CHILDREN_COUNT_FAILED`,message:T(`Failed to load folder items count in folder`,{folderName:r}),placement:`bottomRight`,innerException:t,notificationDedupe:!0,data:{folderId:e===`folders`?null:e,folderName:r,reason:t instanceof Error?t.message:String(t)}}),null}},[P,I,E,N.folders,N.pathHistory,T]),ye=(0,s.useCallback)(async()=>{let t=oe.current+1;oe.current=t;let n=e.filter(e=>e.isFolder);if(n.length===0)return void re(e=>Object.keys(e).length===0?e:{});let r={},i=n.map(async e=>{typeof e.childCount==`number`?r[e.id]=e.childCount:r[e.id]=await ve(e.id)});await Promise.all(i),oe.current===t&&re(e=>{let t=Object.keys(e),n=Object.keys(r);return t.length===n.length&&t.every(t=>e[t]===r[t])?e:r})},[e,ve]);(0,s.useEffect)(()=>{ye()},[ye]),(0,s.useEffect)(()=>{se.current&&_e(Md(se.current))},[e.length,_e,B]),(0,s.useEffect)(()=>{if(!se.current||typeof ResizeObserver>`u`)return;let e=se.current,t=new ResizeObserver(()=>{_e(Md(e))});return t.observe(e),()=>{t.disconnect()}},[_e]);let be=(0,s.useCallback)(e=>{_e(Md(e))},[_e]);(0,s.useEffect)(()=>{let e=se.current;if(!e)return;let t=()=>{be(e)},n=kd(e);return n.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{n.forEach(e=>{e.removeEventListener(`scroll`,t)})}},[e.length,be,B]);let xe=(0,s.useCallback)((e,t)=>e!==t,[]),Se=(0,s.useMemo)(()=>[...ee?[{key:`selection`,width:46,shouldCellUpdate:xe,render:(e,t)=>(0,l.jsx)(zd,{fileId:t.id})}]:[],{key:`preview`,width:60,shouldCellUpdate:xe,render:(e,t)=>(0,l.jsx)(Wd,{item:t,variant:`table`,FolderIcon:A,getFileData:C,className:`${W.imagePreview} ${W.tableImagePreview}`,width:40,height:40})},{title:T(`Name`),width:`calc(100% - 430px)`,dataIndex:`nameText`,key:`name`,className:W.fileNameCol,shouldCellUpdate:xe,render:(e,t)=>(0,l.jsx)(Qd,{item:t})},{title:T(`Dimensions`),key:`dimensions`,width:100,shouldCellUpdate:xe,render:(e,t)=>t.dimensionsText&&(0,l.jsx)(`div`,{className:W.fileSize,children:t.dimensionsText})},{title:T(`Size`),key:`size`,width:90,shouldCellUpdate:xe,render:(e,t)=>t.sizeText?(0,l.jsx)(`div`,{className:W.fileSize,children:t.sizeText}):null},{title:T(`Type`),key:`type`,width:90,shouldCellUpdate:xe,render:(e,t)=>(0,l.jsx)(`div`,{className:W.fileSize,children:t.typeText})},...ge?[{title:T(`Date`),dataIndex:`dateText`,key:`date`,width:200,shouldCellUpdate:xe,render:(e,t)=>(0,l.jsx)(Zd,{item:t})}]:[],{width:40,title:``,dataIndex:``,key:`x`,onCell:()=>({style:{padding:0}}),shouldCellUpdate:xe,render:(e,t)=>(0,l.jsx)(Hd,{item:t,variant:`table`,t:T,iconStrokeWidth:le,setCurrentMenuFile:L,showMoveModal:x,showCopyModal:b,showRenameModal:v,showDeleteConfirm:y,onEdit:S})}],[A,C,ge,le,ee,S,L,xe,b,y,x,v,T]),Ce=(0,s.useMemo)(()=>({body:{row:Vd}}),[]),we=(0,s.useCallback)(e=>({onClick:t=>{if(t.stopPropagation(),t.preventDefault(),t.detail!==1)return;let n=t.target,r=!!n.closest(`.ant-checkbox-wrapper`),i=!!n.closest(`.tableMenuButton`),a=!!n.closest(`.ant-dropdown-menu`);r||Kd(n)||i||a||(e.isFolder?f(e.file):j.onEditorOk&&qd(e.file)&&j.onEditorOk(e.file))}}),[f,j]),Te=B===`table`?(0,l.jsx)(Xd,{rows:me,columns:Se,topOffset:he.topOffset,bottomOffset:he.bottomOffset,onRow:we,components:Ce}):(0,l.jsx)(Yd,{rows:me,topOffset:he.topOffset,bottomOffset:he.bottomOffset,t:T,iconStrokeWidth:le,FolderIcon:A,handleItemClick:f,setCurrentMenuFile:L,showMoveModal:x,showCopyModal:b,showRenameModal:v,showDeleteConfirm:y,onEdit:S,onEditorOk:j.onEditorOk,getFileData:C,showSelectionCheckbox:ee});t&&!e.length&&(Te=(0,l.jsx)(El,{}));let Ee=(F?.availableImageExtensions)?.map(e=>`.`+e).join(`, `),De=(0,l.jsxs)(`div`,z?{className:`${W.noFiles} ant-layout-sider-light`,children:[(0,l.jsx)(Vc,{size:48,className:W.noFilesIcon}),(0,l.jsx)(`div`,{className:`${W.textTitle_trash} ant-menu-submenu-title`,children:T(`Trash is empty`)}),(0,l.jsx)(`div`,{className:`${W.textDescription_trash} ant-menu-submenu-title`,children:T(`Deleted files will be displayed here`)})]}:{className:W.uploadContainer,children:[(0,l.jsxs)(`div`,{className:`${W.uploadArea} `,onClick:w,children:[(0,l.jsx)(`div`,{className:W.uploadIcon,children:(0,l.jsx)(D,{})}),(0,l.jsx)(`div`,{className:W.textTitle,children:T(`Click here to select a file`)}),(0,l.jsx)(`div`,{className:W.textDescription,children:T(`Supported files:`)+` `+(Ee||`jpeg, .svg, .png`)})]}),(0,l.jsxs)(`div`,{className:W.buttons,children:[(0,l.jsxs)(`button`,{className:W.btnPhoto,onClick:()=>{R&&R(Xa)},children:[(0,l.jsx)(`div`,{className:W.icon,children:(0,l.jsx)(O,{})}),(0,l.jsxs)(`div`,{className:W.blockText,children:[(0,l.jsx)(`div`,{className:W.textTitle,children:T(`Stock`)}),(0,l.jsx)(`div`,{className:W.textDescription,children:T(`Select an image from our library`)})]})]}),(0,l.jsxs)(`button`,{className:W.btnAi,onClick:()=>{R&&R(Qa)},children:[(0,l.jsx)(`div`,{className:W.icon,children:(0,l.jsx)(k,{})}),(0,l.jsxs)(`div`,{className:W.blockText,children:[(0,l.jsx)(`div`,{className:W.textTitle,children:T(`AI generation`)}),(0,l.jsx)(`div`,{className:W.textDescription,children:T(`Creating an image on demand`)})]})]})]})]});return(0,l.jsx)(`div`,{className:`content-layout ${W.contentLayout}`,children:d||e?.length!==0||t?(0,l.jsxs)(`div`,{className:W.tableContainer,children:[(0,l.jsx)(Rd,{files:e,filesById:pe,currentSortOption:fe,isSmallScreen:ie,iconStrokeWidth:le,multiSelectEnabled:ee,features:ce,viewMode:B,setViewMode:te,handleSearch:n,handleSortOptionChange:a,sortOptions:ue,onClearSelection:p,onRename:m,onDelete:h,onCopy:g,onMove:_,onEdit:S,t:T}),(0,l.jsxs)(`div`,{ref:se,className:W.filesContainer,children:[Te,d?(0,l.jsx)(`div`,{className:W.filesLoadingOverlay,"aria-busy":`true`,"aria-live":`polite`,children:(0,l.jsx)(u.Spin,{size:`large`})}):null]}),!I&&o.total>o.pageSize&&(0,l.jsx)(`div`,{className:W.paginationContainer,children:(0,l.jsx)(u.Pagination,{current:o.current,pageSize:o.pageSize,total:o.total,onChange:(e,t)=>c({current:e,pageSize:t,total:o.total}),showSizeChanger:!0,showTotal:e=>T(`total pages`,{total:e})})})]}):(0,l.jsx)(`div`,{className:W.emptyStateWrapper,children:De})})});lf.displayName=`FileContent`;var uf=`folderTree`,df=`emptyFolderContainer`,ff=`folderItemContainer`,pf=`folderLabel`,mf=`folderLabelItem`,hf=`fileCount`,gf=`foldersTitle`,_f=`foldersTitleItem`,vf=`folderMenu`,yf=({selectedFolder:e,onSelect:t,onExpand:n,generateMenuItems:r,fetchChildFolders:i,disabledFolders:a=[],showFileCounts:o=!1,folderFileCounts:c={},className:d=``,expandedKeys:f,setExpandedKeys:p,showTrashFolder:m=!1,mode:h=`navigation`,defaultExpandAll:g=!1})=>{let{t:_}=Ks(),{options:v}=yl(),{config:y}=v,{ExpandArrowIcon:b,CollapseArrowIcon:x,CollapseFolderIcon:S,ExpandFolderIcon:C,EmptyFolderIcon:w}=xl(),T=(0,s.useCallback)(e=>{let t=[],n=e=>{e.forEach(e=>{t.push(e.key),e.children&&n(e.children)})};return n(e),t},[]),[E,D]=(0,s.useState)(()=>g||h===`selection`&&g?T(r()):[]),O=f===void 0?E:f,k=p===void 0?D:p;(0,s.useEffect)(()=>{if(g||h===`selection`&&g){let e=T(r());f===void 0&&D(e)}},[g,h,r,T,f]);let A=(0,s.useCallback)(async e=>{let n=e[0];n&&n!==`empty`&&!n.endsWith(`_input`)&&(t?.(e),await i?.(n===`folders`?null:n))},[t,i]),j=(0,s.useCallback)(async(e,t)=>{if(k(e),n?.(e,t),y?.folderTreeLoading!==`lazy`)return;let r=t?.node?.key||void 0;if(r&&r!==`folders`)try{await i?.(r)}catch{}},[y?.folderTreeLoading,i,n,k]),M=(0,s.useCallback)(()=>{let t=r(),n=e=>e.filter(e=>e.key!==`Trash`).map(e=>Object.assign(Object.assign({},e),{children:e.children?n(e.children):void 0})),i=m?n(t):t,s=t=>{h===`selection`||(O.includes(t)&&e===t?k(O.filter(e=>e!==t)):O.includes(t)||k([...O,t])),A([t])},u=i.length===0||i.length===1&&(!i[0].children||i[0].children.length===0),d=e=>{let t=o?c[e.key]:void 0,n=o&&t===null?null:o&&t!=null?t:0,r=O.includes(e.key),i=a.includes(e.key),u=e.children?.length?(0,l.jsx)(r?S:C,{size:20,strokeWidth:y?.iconStrokeWidth}):(0,l.jsx)(w,{size:20,strokeWidth:y?.iconStrokeWidth}),f=(0,l.jsxs)(`div`,{className:`${ff} folder-item-container`,onClick:()=>!i&&s(e.key),style:{opacity:i?.5:1,cursor:i?`not-allowed`:`pointer`},children:[(0,l.jsxs)(`div`,{className:pf,children:[e.icon===void 0?u:e.icon,(0,l.jsx)(`span`,{className:mf,children:e.label})]}),o&&(0,l.jsx)(`div`,{className:hf,title:n===null?void 0:`${n} ${_(n===1?`item`:`items`)}`,children:n===null?`—`:n})]});return{key:e.key,title:f,children:e.children?.map(d),disabled:i}},f=(0,l.jsx)(`div`,{className:gf,onClick:()=>s(`folders`),children:(0,l.jsxs)(`div`,{className:_f,children:[(0,l.jsx)(O.includes(`folders`)?S:C,{size:20,strokeWidth:y?.iconStrokeWidth}),(0,l.jsx)(`span`,{className:`${mf} folder-label-item`,children:i[0]?.key===`folders`?i[0].label:_(`Folders`)})]})}),p=()=>({key:`Trash`,title:(0,l.jsx)(`div`,{className:gf,onClick:()=>s(`Trash`),children:(0,l.jsxs)(`div`,{className:_f,children:[(0,l.jsx)(Bc,{size:20,strokeWidth:y?.iconStrokeWidth}),(0,l.jsx)(`span`,{className:mf,children:_(`Trash`)})]})}),children:void 0});if(u){if(!m)return[{key:`empty`,title:(0,l.jsx)(`div`,{className:df,children:_(`No folders yet`)}),disabled:!0}];let e=[];return i.length>0&&i[0].key===`folders`&&e.push({key:`folders`,title:f,children:[]}),e.push(p()),e}if(i.length>0&&i[0].key===`folders`){let e=[{key:`folders`,title:f,children:i[0].children?.map(d)}];return m&&e.push(p()),e}return i.map(d)},[r,O,S,y?.iconStrokeWidth,C,_,e,A,o,c,w,a,m,h,k]),N=(0,s.useMemo)(()=>M(),[M]);return(0,l.jsx)(u.Tree,{className:`${uf} ${vf} ${d}`,selectedKeys:e?[e]:[],expandedKeys:O,onSelect:A,onExpand:j,treeData:N,switcherIcon:({expanded:e})=>(0,l.jsx)(e?x:b,{}),showLine:!1})},bf=({style:e={},wrap:t=!1})=>(0,l.jsx)(u.Space,{size:`large`,style:Object.assign({width:`100%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},e),wrap:t,children:(0,l.jsx)(u.Spin,{})}),xf={formFooter:`formFooter`,folderButton:`folderButton`,foldersWrapper:`foldersWrapper`,formItem:`formItem`,folderToolsField:`folderToolsField`,inputButtonOk:`inputButtonOk`,permanentDeleteWarning:`permanentDeleteWarning`,clearTrashProgress:`clearTrashProgress`,progressText:`progressText`,closeIcon:`closeIcon`,modalContentWithLoader:`modalContentWithLoader`,modalLoaderOverlay:`modalLoaderOverlay`},Sf=({folderId:e,activeFormField:t,EmptyFolderIcon:n,targetForm:r,handleModalOk:i,onComplete:a,setIsLoading:o,t:s})=>(0,l.jsx)(u.Form.Item,{className:`form-item form-item-moveto `+(t===e?`form-item_active`:``),name:`folderName`,initialValue:s(`New folder`),rules:[{required:!0,validator:(e,t)=>typeof t==`string`&&t.trim().length===0?Promise.reject(Error(s(`Enter the name of the folder`))):Promise.resolve()}],children:(0,l.jsx)(u.Input,{className:`form-input`,autoFocus:!0,prefix:(0,l.jsx)(n,{style:{marginRight:6}}),suffix:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Tooltip,{placement:`top`,title:`Clean`,children:(0,l.jsx)(u.Button,{icon:(0,l.jsx)(m.CloseOutlined,{style:{fontSize:10}}),className:xf.inputButtonClose,type:`text`,onClick:()=>{r.setFieldsValue({folderName:``})}})}),(0,l.jsx)(u.Button,{className:xf.inputButtonOk,type:`text`,onClick:()=>{o(!0),i(r).then(e=>{a(e?.id)}).finally(()=>o(!1))},children:s(`Create`)})]})})});function Cf({folders:e,selectedFolder:t,EmptyFolderIcon:n,handleCreateFolderModalOk:r,setIsLoading:i,t:a}){let[o,c]=s.default.useState(``),d=s.default.useCallback((e,t)=>s=>(0,l.jsx)(Sf,{folderId:s,activeFormField:o,EmptyFolderIcon:n,targetForm:e,handleModalOk:r,onComplete:t,setIsLoading:i,t:a},s),[n,o,r,i,a]),f=s.default.useCallback(e=>{let{folderId:t,targetForm:n,onTreeSelect:r,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),c(t),n.setFieldsValue({folderName:a(`New folder`),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),r([t]).then(()=>i(t))}}},[a]);return{activeFormField:o,setActiveFormField:c,generateMenuItemsFromFolders:s.default.useCallback(n=>{let{targetForm:r,onTreeSelect:i,onComplete:s,actionButtonText:c}=n,p=d(r,s),m=Array.isArray(e)?e:[],h=(e=null,n=new Set)=>m.filter(t=>{let n=e===null&&!t.parentId,r=t.parentId===e;return n||r}).map(e=>{if(n.has(e.id))return{key:e.id,label:`${e.name} (циклическая ссылка)`};let a=new Set(n);a.add(e.id);let d=h(e.id,a),{handleAddFolder:m,handleSelectFolder:g}=f({folderId:e.id,targetForm:r,onTreeSelect:i,onComplete:s}),_=o===e.id?[{key:`${e.id}_input`,label:p(e.id),icon:null},...d]:d;return{key:e.id,label:(0,l.jsxs)(l.Fragment,{children:[e.name,t!==e.id&&(0,l.jsxs)(`div`,{className:`${xf.folderToolsField} folder-tools-field`,children:[(0,l.jsx)(u.Button,{onClick:m,children:`+`}),(0,l.jsx)(u.Button,{onClick:g,children:c})]})]}),children:_}}),g=h(),{handleAddFolder:_,handleSelectFolder:v}=f({folderId:`folders`,targetForm:r,onTreeSelect:i,onComplete:s}),y=o===`folders`?[{key:`folders_input`,label:p(`folders`),icon:null},...g]:g;return[{key:`folders`,label:(0,l.jsxs)(l.Fragment,{children:[a(`Folders`),t!==`folders`&&t!==null&&(0,l.jsxs)(`div`,{className:`${xf.folderToolsField} folder-tools-field`,children:[(0,l.jsx)(u.Button,{onClick:_,children:`+`}),(0,l.jsx)(u.Button,{onClick:v,children:c})]})]}),children:y}]},[o,d,f,e,t,a])}}var wf=(0,s.memo)(({folderId:e,activeFormField:t,EmptyFolderIcon:n,targetForm:r,handleModalOk:i,onComplete:a,t:o,setIsLoading:c,defaultFolderName:d})=>{let f=(0,s.useCallback)(()=>{c(!0),i(r).then(e=>a(e?.id)).finally(()=>c(!1))},[i,r,a,c]);return(0,l.jsx)(u.Form.Item,{className:`form-item form-item-moveto `+(t===e?`form-item_active`:``),name:`folderName`,initialValue:d,rules:[{required:!0,validator:(e,t)=>typeof t==`string`&&t.trim().length===0?Promise.reject(Error(o(`Enter the name of the folder`))):Promise.resolve()}],children:(0,l.jsx)(u.Input,{className:`form-input`,autoFocus:!0,prefix:(0,l.jsx)(n,{style:{marginRight:6}}),suffix:(0,l.jsx)(u.Button,{className:xf.inputButtonOk,type:`text`,onClick:()=>{c(!0),f()},children:o(`Create`)})})})});wf.displayName=`CustomFolderInput`;var Tf=({isModalVisible:e,handleModalOk:t,handleModalCancel:n,form:r,selectedFolder:i,folders:a,isUrlModalVisible:o,setIsUrlModalVisible:c,handleAddFileByUrl:d,urlForm:f,isRenameModalVisible:p,handleRenameOk:h,handleRenameCancel:g,renameForm:_,fileToRename:v,files:y,isMoveModalVisible:b,handleMoveOk:x,handleMoveCancel:S,moveForm:C,selectedFiles:w,isRenameFolderModalVisible:T,handleRenameFolderOk:E,handleRenameFolderCancel:D,renameFolderForm:O,folderToRename:k,isCopyModalVisible:A,handleCopyOk:j,handleCopyCancel:M,copyForm:N,isDeleteConfirmVisible:P,handleDeleteConfirmOk:F,handleDeleteConfirmCancel:I,isClearTrashConfirmVisible:L,handleClearTrashConfirm:R,handleClearTrashCancel:z,fetchChildFolders:ee})=>{let{t:B}=Ks(),{state:te,actions:ne,options:re}=yl(),{setCurrentMenuFile:ie}=ne,{config:ae}=re,{currentMenuFile:oe}=te,se=u.Form.useWatch(`folderName`,r),{EmptyFolderIcon:ce}=xl(),[le,ue]=(0,s.useState)(!1),de=(0,s.useMemo)(()=>(ae?.defaultFolderName)?.trim()||B(`New folder`),[ae?.defaultFolderName,B]),fe=!se||String(se).trim().length===0,pe=(0,s.useMemo)(()=>Array.isArray(y)?y:[],[y]),me=v?pe.find(e=>e.id===v)?.name:``,he=Array.isArray(a)?a:[],ge=k?he.find(e=>e.id===k)?.name:``,{activeFormField:_e,setActiveFormField:ve,generateMenuItemsFromFolders:ye}=Cf({folders:he,selectedFolder:i,EmptyFolderIcon:ce,handleCreateFolderModalOk:t,setIsLoading:e=>ue(!!e),t:B});(0,s.useEffect)(()=>{if(P){let e=setTimeout(()=>{let e=document.querySelector(`.deleteModal`);if(e){let t=e.querySelector(`.ant-modal-footer`);if(t){let e=t.querySelector(`.ant-btn-primary`);e&&e.focus()}}},100);return()=>clearTimeout(e)}},[P]);let be=(v?pe.find(e=>e.id===v):null)?.isFolder||v?.startsWith(`folder_`),xe=(0,s.useCallback)(async e=>{e.length>0&&(C.setFieldsValue({targetFolder:e[0]}),_e!==e[0].toString()&&ve(``))},[C,_e,ve]),Se=(0,s.useCallback)(async e=>{e.length>0&&(N.setFieldsValue({targetFolder:e[0]}),_e!==e[0].toString()&&ve(``))},[_e,N,ve]),Ce=(0,s.useCallback)(async e=>{ue(!0);try{await x(e)}finally{ue(!1)}},[x]),we=(0,s.useCallback)(async e=>{ue(!0);try{await j(e)}finally{ue(!1)}},[j]),Te=(0,s.useMemo)(()=>{let e=Array.from(w).filter(e=>pe.find(t=>t.id===e)?.isFolder||a.some(t=>t.id===e));return i&&i!==`folders`?e.push(i):i&&i!==`folders`||e.push(`folders`),e},[w,pe,a,i]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Modal,{title:(0,l.jsx)(`div`,{className:`modal-title`,children:B(`Creating a new folder`)}),open:e,onOk:()=>t(),onCancel:n,okText:B(`Create`),cancelText:B(`Cancel`),okButtonProps:{disabled:fe,loading:le},cancelButtonProps:{disabled:le},afterClose:()=>ue(!1),children:(0,l.jsxs)(u.Form,{form:r,layout:`vertical`,children:[(0,l.jsx)(u.Form.Item,{name:`folderName`,label:(0,l.jsx)(`div`,{className:`form-label`,children:B(`Folder name`)}),rules:[{required:!0,validator:(e,t)=>typeof t==`string`&&t.trim().length===0?Promise.reject(Error(B(`Enter the name of the folder`))):Promise.resolve()}],initialValue:de,className:`form-item`,style:{marginBottom:5},children:(0,l.jsx)(u.Input,{autoFocus:!0,className:`form-input`,disabled:le,placeholder:B(`Enter the name`),onPressEnter:async()=>{ue(!0);try{await r.validateFields(),fe||await t()}catch{ue(!1)}}})}),(0,l.jsx)(`div`,{children:i&&i!==`folders`?(0,l.jsxs)(`p`,{className:`fm-note`,children:[B(`A folder will be created inside:`),` `,he.find(e=>e.id===i)?.name||B(`selected folder`),`.`]}):(0,l.jsx)(`p`,{className:`fm-note`,children:B(`The folder will be created in the root directory.`)})})]})}),(0,l.jsx)(u.Modal,{title:(0,l.jsx)(`div`,{className:`modal-title`,children:B(`Upload file by URL`)}),open:o,onOk:async()=>{ue(!0);try{let e=await f.validateFields();await d(String(e.fileUrl??``).trim(),void 0,void 0,`uploadByUrl`)}catch{}finally{ue(!1)}},onCancel:()=>c(!1),okText:B(`Download`),okButtonProps:{loading:le},cancelText:B(`Cancel`),cancelButtonProps:{disabled:le},afterClose:()=>ue(!1),children:(0,l.jsx)(u.Form,{form:f,layout:`vertical`,children:(0,l.jsx)(u.Form.Item,{name:`fileUrl`,label:(0,l.jsx)(`div`,{className:`form-label`,children:B(`File URL`)}),rules:[{required:!0,message:B(`Enter the URL of the image`)},{validator:(e,t)=>{if(!t||!String(t).trim())return Promise.resolve();try{return tu(String(t),B),Promise.resolve()}catch(e){return Promise.reject(Error(e instanceof Error?e.message:B(`The specified URL is not valid.`)))}}}],validateTrigger:`onBlur`,className:`form-item`,children:(0,l.jsx)(u.Input,{className:`form-input`,placeholder:`https://example.com/image.jpg`,autoFocus:!0,disabled:le,onPressEnter:async()=>{ue(!0);try{let e=await f.validateFields();await d(String(e.fileUrl??``).trim(),void 0,void 0,`uploadByUrl`)}catch{}finally{ue(!1)}}})})})}),(0,l.jsx)(u.Modal,{title:(0,l.jsx)(`div`,{className:`modal-title`,children:be?`${B(`Rename folder`)} ${me}`:B(`Rename file`,{currentFileName:me})}),open:p,onOk:h,okText:B(`Rename`),okButtonProps:{loading:le},onCancel:g,cancelText:B(`Cancel`),cancelButtonProps:{disabled:le},afterClose:()=>{ue(!1),ie&&ie(``)},children:(0,l.jsx)(u.Form,{form:_,layout:`vertical`,children:(0,l.jsx)(u.Form.Item,{name:`newFileName`,label:(0,l.jsx)(`div`,{className:`form-label`,children:B(be?`New folder name`:`New file name`)}),rules:[{required:!0,message:B(be?`Enter a new folder name`:`Enter a new file name`)}],className:`form-item`,children:(0,l.jsx)(u.Input,{autoFocus:!0,className:`form-input`,disabled:le,onPressEnter:async()=>{ue(!0);try{await _.validateFields(),h()}catch{ue(!1)}}})})})}),(0,l.jsx)(u.Modal,{title:(0,l.jsx)(`div`,{className:`modal-title`,children:B(`Move to`)}),open:b,onCancel:S,footer:(0,l.jsxs)(`div`,{className:xf.formFooter,children:[(0,l.jsxs)(u.Button,{className:xf.folderButton,onClick:()=>{let e=i??`folders`;ve(e),C.setFieldsValue({folderName:de,targetFolder:e})},loading:le,children:[(0,l.jsx)(Tc,{size:18,strokeWidth:ae?.iconStrokeWidth}),B(`Create folder`)]}),(0,l.jsx)(u.Button,{type:`primary`,className:xf.folderButton,onClick:S,loading:le,children:B(`Done`)})]}),afterClose:()=>{ie&&ie(``),ve(``),ue(!1)},loading:le,children:(0,l.jsxs)(`div`,{className:xf.modalContentWithLoader,children:[le&&(0,l.jsx)(`div`,{className:xf.modalLoaderOverlay,children:(0,l.jsx)(bf,{})}),(0,l.jsx)(u.Form,{form:C,layout:`vertical`,initialValues:{targetFolder:`folders`,folderName:de,is_force_create:!1},children:(0,l.jsxs)(`div`,{className:xf.foldersWrapper,children:[(0,l.jsx)(u.Form.Item,{name:`targetFolder`,rules:[{required:!0,message:B(`Select the destination folder`)}],className:xf.formItem,children:(0,l.jsx)(yf,{onSelect:xe,generateMenuItems:()=>ye({targetForm:C,onTreeSelect:xe,onComplete:Ce,actionButtonText:B(`Move here`)}),fetchChildFolders:ee,disabledFolders:Te,mode:`selection`,className:`folderSelectionTree`,defaultExpandAll:!0})}),(0,l.jsx)(u.Form.Item,{name:`folderName`,style:{display:`none`},rules:[{required:!0,validator:(e,t)=>typeof t==`string`&&t.trim().length===0?Promise.reject(Error(B(`Enter the name of the folder`))):Promise.resolve()}],children:(0,l.jsx)(u.Input,{})}),(0,l.jsx)(u.Form.Item,{name:`is_force_create`,style:{display:`none`},children:(0,l.jsx)(u.Input,{})})]})})]})}),(0,l.jsx)(u.Modal,{title:(0,l.jsx)(`div`,{className:`modal-title`,children:B(`Copy to folder`)}),open:A,onCancel:M,footer:(0,l.jsxs)(`div`,{className:xf.formFooter,children:[(0,l.jsxs)(u.Button,{className:xf.folderButton,onClick:()=>{let e=i??`folders`;ve(e),N.setFieldsValue({folderName:de,targetFolder:e})},loading:le,children:[(0,l.jsx)(Tc,{size:18,strokeWidth:ae?.iconStrokeWidth}),B(`Create folder`)]}),(0,l.jsx)(u.Button,{type:`primary`,className:xf.folderButton,onClick:M,loading:le,children:B(`Done`)})]}),afterClose:()=>{ie&&ie(``),ve(``),ue(!1)},loading:le,children:(0,l.jsxs)(`div`,{className:xf.modalContentWithLoader,children:[le&&(0,l.jsx)(`div`,{className:xf.modalLoaderOverlay,children:(0,l.jsx)(bf,{})}),(0,l.jsx)(u.Form,{form:N,layout:`vertical`,initialValues:{targetFolder:`folders`,folderName:de,is_force_create:!1},children:(0,l.jsxs)(`div`,{className:xf.foldersWrapper,children:[(0,l.jsx)(u.Form.Item,{name:`targetFolder`,rules:[{required:!0,message:B(`Select the destination folder`)}],className:xf.formItem,children:(0,l.jsx)(yf,{onSelect:Se,generateMenuItems:()=>ye({targetForm:N,onTreeSelect:Se,onComplete:we,actionButtonText:B(`Copy here`)}),fetchChildFolders:ee,disabledFolders:Te,mode:`selection`,className:`folderSelectionTree`,defaultExpandAll:!0})}),(0,l.jsx)(u.Form.Item,{name:`folderName`,style:{display:`none`},rules:[{required:!0,validator:(e,t)=>typeof t==`string`&&t.trim().length===0?Promise.reject(Error(B(`Enter the name of the folder`))):Promise.resolve()}],children:(0,l.jsx)(u.Input,{})}),(0,l.jsx)(u.Form.Item,{name:`is_force_create`,style:{display:`none`},children:(0,l.jsx)(u.Input,{})})]})})]})}),(0,l.jsx)(u.Modal,{title:(0,l.jsxs)(`div`,{className:`modal-title`,children:[B(`Rename folder`),` `,ge]}),open:T,onOk:E,onCancel:D,okText:B(`Rename`),cancelText:B(`Cancel`),okButtonProps:{loading:le},cancelButtonProps:{disabled:le},afterClose:()=>{ue(!1),ie&&ie(``)},children:(0,l.jsx)(u.Form,{form:O,layout:`vertical`,children:(0,l.jsx)(u.Form.Item,{name:`newFolderName`,label:(0,l.jsx)(`div`,{className:`form-label`,children:B(`New folder name`)}),rules:[{required:!0,message:B(`Enter a new folder name`)}],className:`form-item`,children:(0,l.jsx)(u.Input,{autoFocus:!0,className:`form-input`,disabled:le,onPressEnter:async()=>{ue(!0);try{await O.validateFields(),E()}catch{ue(!1)}}})})})}),(0,l.jsx)(u.Modal,{className:`${xf.deleteModal} deleteModal`,title:(0,l.jsx)(`div`,{className:`modal-title`,children:B(ae?.enableTrashFolder&&i===`Trash`||!ae?.enableTrashFolder?`Permanently delete`:`Move to Trash`)}),open:!!P,onOk:()=>{ue(!0);try{F&&F()}catch{ue(!1)}},onCancel:()=>I&&I(),okText:ae?.enableTrashFolder&&i===`Trash`?B(`Delete permanently`):ae?.enableTrashFolder?B(`Move to Trash`):B(`Delete`),cancelText:B(`Cancel`),okButtonProps:{danger:!ae?.enableTrashFolder||i===`Trash`,loading:le},cancelButtonProps:{disabled:le},afterClose:()=>{ue(!1),ie&&ie(``)},closeIcon:(0,l.jsx)(m.CloseOutlined,{className:xf.closeIcon}),children:(()=>{let e=(oe?[oe]:Array.from(w||[])).map(e=>pe.find(t=>t.id===e)).filter(e=>!!e),t=e.filter(e=>e.isFolder||e.id.startsWith(`folder_`)),n=e.filter(e=>!(e.isFolder||e.id.startsWith(`folder_`))),r=e.length,a=t.length,o=n.length,s=!!ae?.enableTrashFolder;if(!s||s&&i===`Trash`){let e;if(r===1&&a===1){let n=t[0];e=B(`delete_folder_permanent`,{name:n?.name||``,count:n?.childCount??0})}else e=a===0&&o>0?B(`delete_files_permanent`,{count:o}):B(`delete_mixed_permanent`,{total:r,folders:a,images:o});return(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{children:e}),(0,l.jsx)(`p`,{className:xf.permanentDeleteWarning,children:B(`permanent_delete_warning`)})]})}if(r===1&&a===1){let e=t[0];return(0,l.jsx)(`div`,{children:B(`move_folder_to_trash`,{name:e?.name||``,count:e?.childCount??0})})}return(0,l.jsx)(`div`,a===0&&o>0?{children:B(`move_files_to_trash`,{count:o})}:{children:B(`move_mixed_to_trash`,{total:r,folders:a,images:o})})})()}),(0,l.jsxs)(u.Modal,{className:`${xf.deleteModal} deleteModal`,title:(0,l.jsx)(`div`,{className:`modal-title`,children:B(`Clear Trash`)}),open:!!L,onOk:async()=>{ue(!0),R&&await R(),ue(!1)},onCancel:()=>z&&z(),okText:B(`Delete permanently`),cancelText:B(`Cancel`),okButtonProps:{danger:!0,loading:le},cancelButtonProps:{disabled:le},afterClose:()=>{ue(!1)},closeIcon:(0,l.jsx)(m.CloseOutlined,{className:xf.closeIcon}),children:[(0,l.jsx)(`div`,{children:B(`Are you sure you want to permanently delete all items from Trash?`)}),le&&(0,l.jsxs)(`div`,{className:xf.clearTrashProgress,children:[(0,l.jsx)(u.Progress,{percent:99,status:`active`,showInfo:!1}),(0,l.jsx)(`div`,{className:xf.progressText,children:B(`Deleting items...`)})]})]})]})},Ef={button:`button`,folderActions:`folderActions`,uploadButton:`uploadButton`,foldersContainer:`foldersContainer`,buttonWrapper:`buttonWrapper`,uploadButtonTitle:`uploadButtonTitle`},Df=(0,s.memo)((0,s.forwardRef)(({selectedFolder:e,generateMenuItems:t,onFolderSelect:n,folders:r,fetchChildFolders:i,handleAddFile:a,setIsUrlModalVisible:o,handleCreateFolder:c,activeLibraryItem:d,setActiveLibraryItem:f},p)=>{let h=(0,s.useMemo)(()=>Array.isArray(r)?r:[],[r]),{t:g}=Ks(),_=Il(),[v,y]=(0,s.useState)({}),{options:b,state:x}=yl(),{dataProviders:S,config:C}=b,w=x.pathHistory,T=!1!==C?.features?.enableGif&&(!C?.enabledTabs||C.enabledTabs.includes(`gif`)),E=!1!==C?.features?.enableStockImages&&(!C?.enabledTabs||C.enabledTabs.includes(`stock`)),D=!1!==C?.features?.enableIconStock&&(!C?.enabledTabs||C.enabledTabs.includes(`icons`)),O=!1!==C?.features?.enableQrBarcodeTab&&(!C?.enabledTabs||C.enabledTabs.includes(`codes`)),k=(0,s.useCallback)(e=>{let t=[],n=e=>{e.forEach(e=>{t.push(e.key),e.children&&n(e.children)})};return n(e),t},[]),[A,j]=(0,s.useState)(()=>!0===C?.expandAllFoldersOnInit&&C?.folderTreeLoading!==`lazy`?k(t()):!0===C?.expandRootFolderOnInit?[`folders`]:[]),M=(0,s.useRef)(!1),N=(0,s.useRef)(!1);(0,s.useEffect)(()=>{M.current||C?.folderTreeLoading===`lazy`&&!0===C?.expandRootFolderOnInit&&(M.current=!0,(async()=>{try{await i?.(null)}catch{}})())},[C?.folderTreeLoading,C?.expandRootFolderOnInit,i]),(0,s.useEffect)(()=>{!0===C?.expandRootFolderOnInit&&Array.isArray(h)&&h.length>0&&(N.current||A&&A.length!==0||(N.current=!0,j([`folders`])))},[C?.expandRootFolderOnInit,h,A]),(0,s.useEffect)(()=>{if(!0===C?.expandAllFoldersOnInit&&C?.folderTreeLoading!==`lazy`){j(k(t()));return}!0===C?.expandRootFolderOnInit&&j(e=>e&&e.length>0?[...e]:[`folders`])},[h,t,k,C?.expandAllFoldersOnInit,C?.folderTreeLoading,C?.expandRootFolderOnInit]);let P=C?.disablePagination,F=(0,s.useCallback)(async e=>{try{if(S?.getChildrenCount)return await S.getChildrenCount(e===`folders`?void 0:e);if(S?.getFiles){let{files:t,pagination:n}=await S.getFiles({folderId:e===`folders`?void 0:e,itemType:`all`,page:P?void 0:1,limit:P?void 0:1});return P?Array.isArray(t)?t.length:0:n?.total??(Array.isArray(t)?t.length:0)}return 0}catch(t){if(t?.name===`StaleLoad`)return 0;let n=t;if(n?.status===404||n?.code===`FileNotFound`||n?.code===`path_folder_not_found`||n?.data?.code===`path_folder_not_found`||n?.data?.data?.status===404)return 0;let r=await qu({folderId:e,dataProviders:S,folders:h,pathHistory:w,t:g});return _.error({id:`FOLDER_CHILDREN_COUNT_FAILED`,message:g(`Failed to load folder items count in folder`,{folderName:r}),placement:`bottomRight`,innerException:t,notificationDedupe:!0,data:{folderId:e===`folders`?null:e,folderName:r,reason:t instanceof Error?t.message:String(t)}}),null}},[S,P,_,w,h,g]),I=(0,s.useCallback)(async()=>{if(h.length===0)return;let e={};e.folders=await F(`folders`);let t=h.map(async t=>{typeof t.childCount==`number`?e[t.id]=t.childCount:e[t.id]=await F(t.id)});await Promise.all(t),y(e)},[h,F]),L=(0,s.useCallback)(async e=>{let t=await F(e);y(n=>Object.assign(Object.assign({},n),{[e]:t}))},[F]);(0,s.useImperativeHandle)(p,()=>({refreshFileCounts:I}),[I]),(0,s.useEffect)(()=>{I()},[I]),(0,s.useEffect)(()=>{if(!e||e===`folders`)return;let t=(e,n=new Set)=>{if(n.has(e))return[];let r=h.find(t=>t.id===e);if(!r||!r.parentId)return[];let i=new Set(n);return i.add(e),[...t(r.parentId,i),r.parentId]},n=t(e);n.length>0?j(e=>{let t=new Set(e);return n.forEach(e=>t.add(e)),t.add(`folders`),Array.from(t)}):j(e=>e.includes(`folders`)?e:[...e,`folders`])},[e,h]);let R=(0,s.useCallback)(async()=>{await a(),e?await L(e):await L(`folders`)},[a,e,L]),z=[{key:Ja,label:g(`My files`),icon:(0,l.jsx)(Oc,{size:20,strokeWidth:C?.iconStrokeWidth})},{key:Ya,label:g(`GIF`),icon:(0,l.jsx)(jc,{size:20,strokeWidth:C?.iconStrokeWidth}),disabled:!T},{key:Xa,label:g(`Stock images`),icon:(0,l.jsx)(yc,{size:20,strokeWidth:C?.iconStrokeWidth}),disabled:!E},{key:Za,label:g(`Icons`),icon:(0,l.jsx)(m.LikeOutlined,{size:20}),disabled:!D},{key:$a,label:g(`QR & Barcode`),icon:(0,l.jsx)(Nc,{size:20,strokeWidth:C?.iconStrokeWidth}),disabled:!O},{key:Qa,label:g(`AI`),icon:(0,l.jsx)(Lc,{size:20,strokeWidth:C?.iconStrokeWidth}),disabled:!C?.sseQuery}].filter(e=>!e.disabled),ee=(0,s.useCallback)(async e=>{let t=e[0];t&&t!==`empty`&&(d!==Ja&&f(Ja),n?.(t),await i?.(t))},[n,d,f,i]),B=(0,s.useCallback)(({key:e})=>{f(e)},[f]),te=(0,s.useCallback)(async(e,t)=>{if(j(e),C?.folderTreeLoading!==`lazy`)return;let n=t?.node?.key||void 0;if(n&&n!==`folders`)try{await i?.(n)}catch(e){let t=await qu({folderId:n,dataProviders:S,folders:h,pathHistory:w,t:g});_.error({id:`FOLDER_CHILDREN_FETCH_FAILED`,message:g(`Failed to load subfolders in folder`,{folderName:t}),placement:`bottomRight`,innerException:e,notificationDedupe:!0,data:{folderId:n,folderName:t,reason:e instanceof Error?e.message:String(e)}})}},[C?.folderTreeLoading,S,i,_,w,h,g]);return(0,l.jsxs)(`div`,{className:`sidebar-container`,children:[(0,l.jsxs)(`div`,{className:Ef.buttonWrapper,children:[(0,l.jsx)(u.Button,{type:`primary`,size:`large`,icon:(0,l.jsx)(Mc,{size:24,strokeWidth:C?.iconStrokeWidth}),onClick:R,className:Ef.uploadButton,style:{whiteSpace:`nowrap`},disabled:e===`Trash`,children:(0,l.jsx)(`span`,{className:Ef.uploadButtonTitle,children:g(`Upload file`)})}),(0,l.jsx)(u.Button,{type:`primary`,size:`large`,icon:(0,l.jsx)(kc,{size:24,strokeWidth:C?.iconStrokeWidth}),onClick:()=>o?.(!0),className:Ef.uploadByURLButton,style:{whiteSpace:`nowrap`},disabled:e===`Trash`})]}),(0,l.jsx)(u.Menu,{className:`folder-menu`,items:z,defaultSelectedKeys:[Ja],onSelect:({key:e})=>B({key:e}),selectedKeys:[d]}),(0,l.jsx)(u.Divider,{className:Ef.divider}),(0,l.jsxs)(`div`,{className:Ef.foldersContainer,children:[(0,l.jsx)(yf,{selectedFolder:e,onSelect:ee,onExpand:te,generateMenuItems:t,fetchChildFolders:i,showFileCounts:!0,folderFileCounts:v,expandedKeys:A,setExpandedKeys:j,showTrashFolder:C?.enableTrashFolder}),(0,l.jsx)(`div`,{className:Ef.folderActions,children:(0,l.jsx)(u.Button,{onClick:e=>{e.stopPropagation(),c()},className:Ef.button,icon:(0,l.jsx)(Tc,{size:18,strokeWidth:C?.iconStrokeWidth}),size:`middle`})})]})]})}));Df.displayName=`FolderSidebar`;var Of=Object.defineProperty,kf=(e,t,n)=>(((e,t,n)=>{t in e?Of(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,typeof t==`symbol`?t:t+``,n),n);function Af(e,t){return t===void 0&&(t=15),+parseFloat(Number(e).toPrecision(t))}function jf(e){var t=e.toString().split(/[eE]/),n=(t[0].split(`.`)[1]||``).length-+(t[1]||0);return n>0?n:0}function Mf(e){if(e.toString().indexOf(`e`)===-1)return Number(e.toString().replace(`.`,``));var t=jf(e);return t>0?Af(Number(e)*10**t):Number(e)}function Nf(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t.slice(1).reduce(function(t,n){return e(t,n)},r)}}var Pf=Nf(function(e,t){var n=Mf(e),r=Mf(t),i=jf(e)+jf(t);return n*r/10**i}),Ff=Nf(function(e,t){var n=10**Math.max(jf(e),jf(t));return(Pf(e,n)+Pf(t,n))/n}),If=Nf(function(e,t){var n=10**Math.max(jf(e),jf(t));return(Pf(e,n)-Pf(t,n))/n}),Lf=Nf(function(e,t){return Pf(Mf(e)/Mf(t),Af(10**(jf(t)-jf(e))))}),Rf={strip:Af,plus:Ff,minus:If,times:Pf,divide:Lf,round:function(e,t){var n=10**t,r=Lf(Math.round(Math.abs(Pf(e,n))),n);return e<0&&r!==0&&(r=Pf(r,-1)),r},digitLength:jf,float2Fixed:Mf,enableBoundaryChecking:function(e){e===void 0&&(e=!0)}},zf=Object.prototype.toString;function Bf(e){switch(zf.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:return!0;default:return Xf(e,Error)}}function Vf(e,t){return zf.call(e)===`[object ${t}]`}function Hf(e){return Vf(e,`ErrorEvent`)}function Uf(e){return Vf(e,`DOMError`)}function Wf(e){return Vf(e,`String`)}function Gf(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function Kf(e){return e===null||Gf(e)||typeof e!=`object`&&typeof e!=`function`}function qf(e){return Vf(e,`Object`)}function Jf(e){return typeof Event<`u`&&Xf(e,Event)}function Yf(e){return!(!e||!e.then||typeof e.then!=`function`)}function Xf(e,t){try{return e instanceof t}catch{return!1}}function Zf(e){return!(typeof e!=`object`||!e||!e.__isVue&&!e._isVue)}function Qf(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function $f(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Zf(r)?n.push(`[VueViewModel]`):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function ep(e,t,n=!1){return!!Wf(e)&&(function(e){return Vf(e,`RegExp`)}(t)?t.test(e):!!Wf(t)&&(n?e===t:e.includes(t)))}function tp(e,t=[],n=!1){return t.some(t=>ep(e,t,n))}function np(e,t,n=250,r,i,a,o){if(!(a.exception&&a.exception.values&&o&&Xf(o.originalException,Error)))return;let s=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;s&&(a.exception.values=function(e,t){return e.map(e=>(e.value&&=Qf(e.value,t),e))}(rp(e,t,i,o.originalException,r,a.exception.values,s,0),n))}function rp(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(Xf(r[i],Error)){ip(o,s);let a=e(t,r[i]),l=c.length;ap(a,i,l,s),c=rp(e,t,n,r[i],i,[a,...c],a,l)}return Array.isArray(r.errors)&&r.errors.forEach((r,a)=>{if(Xf(r,Error)){ip(o,s);let l=e(t,r),u=c.length;ap(l,`errors[${a}]`,u,s),c=rp(e,t,n,r,i,[l,...c],l,u)}}),c}function ip(e,t){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,...e.type===`AggregateError`&&{is_exception_group:!0},exception_id:t}}function ap(e,t,n,r){e.mechanism=e.mechanism||{type:`generic`,handled:!0},e.mechanism={...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function op(e){return e&&e.Math==Math?e:void 0}var sp=typeof globalThis==`object`&&op(globalThis)||typeof window==`object`&&op(window)||typeof self==`object`&&op(self)||typeof r.r==`object`&&op(r.r)||function(){return this}()||{};function cp(){return sp}function lp(e,t,n){let r=n||sp,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}var up=cp();function dp(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++<5&&(o=fp(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function fp(e,t){let n=e,r=[],i,a,o,s,c;if(!n||!n.tagName)return``;if(up.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());let l=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(l&&l.length)l.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&Wf(i))for(a=i.split(/\s+/),c=0;c<a.length;c++)r.push(`.${a[c]}`);let u=[`aria-label`,`type`,`name`,`title`,`alt`];for(c=0;c<u.length;c++)o=u[c],s=n.getAttribute(o),s&&r.push(`[${o}="${s}"]`);return r.join(``)}var pp=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,mp=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],hp={};function gp(e){if(!(`console`in sp))return e();let t=sp.console,n={},r=Object.keys(hp);r.forEach(e=>{let r=hp[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}var _p=function(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return pp?mp.forEach(n=>{t[n]=(...t)=>{e&&gp(()=>{sp.console[n](`Sentry Logger [${n}]:`,...t)})}}):mp.forEach(e=>{t[e]=()=>{}}),t}(),vp=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function yp(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function bp(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function xp(e){let t=typeof e==`string`?function(e){let t=vp.exec(e);if(!t)return void gp(()=>{});let[n,r,i=``,a,o=``,s]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return bp({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}(e):bp(e);if(t&&function(e){if(!pp)return!0;let{port:t,projectId:n,protocol:r}=e;return!([`protocol`,`publicKey`,`host`,`projectId`].find(t=>!e[t]&&(_p.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return e===`http`||e===`https`}(r)?t&&isNaN(parseInt(t,10))&&(_p.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(_p.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(_p.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}var Sp=class extends Error{constructor(e,t=`warn`){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}};function Cp(e,t,n){if(!(t in e))return;let r=e[t],i=n(r);typeof i==`function`&&Tp(i,r),e[t]=i}function wp(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{pp&&_p.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Tp(e,t){try{e.prototype=t.prototype=t.prototype||{},wp(e,`__sentry_original__`,t)}catch{}}function Ep(e){return e.__sentry_original__}function Dp(e){if(Bf(e))return{message:e.message,name:e.name,stack:e.stack,...kp(e)};if(Jf(e)){let t={type:e.type,target:Op(e.target),currentTarget:Op(e.currentTarget),...kp(e)};return typeof CustomEvent<`u`&&Xf(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Op(e){try{return function(e){return typeof Element<`u`&&Xf(e,Element)}(e)?dp(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function kp(e){if(typeof e==`object`&&e){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Ap(e){return jp(e,new Map)}function jp(e,t){if(function(e){if(!qf(e))return!1;try{let t=Object.getPrototypeOf(e).constructor.name;return!t||t===`Object`}catch{return!0}}(e)){let n=t.get(e);if(n!==void 0)return n;let r={};t.set(e,r);for(let n of Object.keys(e))typeof e[n]<`u`&&(r[n]=jp(e[n],t));return r}if(Array.isArray(e)){let n=t.get(e);if(n!==void 0)return n;let r=[];return t.set(e,r),e.forEach(e=>{r.push(jp(e,t))}),r}return e}var Mp=/\(error: (.*)\)/,Np=/captureMessage|captureException/;function Pp(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0)=>{let r=[],i=e.split(`
152
- `);for(let e=n;e<i.length;e++){let n=i[e];if(n.length>1024)continue;let a=Mp.test(n)?n.replace(Mp,`$1`):n;if(!a.match(/\S*Error: /)){for(let e of t){let t=e(a);if(t){r.push(t);break}}if(r.length>=50)break}}return function(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||``)&&t.pop(),t.reverse(),Np.test(t[t.length-1].function||``)&&(t.pop(),Np.test(t[t.length-1].function||``)&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||`?`}))}(r)}}function Fp(e){return Array.isArray(e)?Pp(...e):e}var Ip=`<anonymous>`;function Lp(e){try{return e&&typeof e==`function`&&e.name||Ip}catch{return Ip}}var Rp={},zp={};function Bp(e,t){Rp[e]=Rp[e]||[],Rp[e].push(t)}function Vp(e,t){zp[e]||(t(),zp[e]=!0)}function Hp(e,t){let n=e&&Rp[e];if(n)for(let r of n)try{r(t)}catch(t){pp&&_p.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Lp(r)}\nError:`,t)}}function Up(){`console`in sp&&mp.forEach(function(e){e in sp.console&&Cp(sp.console,e,function(t){return hp[e]=t,function(...t){Hp(`console`,{args:t,level:e});let n=hp[e];n&&n.apply(sp.console,t)}})})}function Wp(){let e=sp,t=e.crypto||e.msCrypto,n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,``);t&&t.getRandomValues&&(n=()=>{let e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return`10000000100040008000100000000000`.replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function Gp(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Kp(e){let{message:t,event_id:n}=e;if(t)return t;let r=Gp(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function qp(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=`Error`}function Jp(e,t){let n=Gp(e);if(!n)return;let r=n.mechanism;if(n.mechanism={type:`generic`,handled:!0,...r,...t},t&&`data`in t){let e={...r&&r.data,...t.data};n.mechanism.data=e}}function Yp(e){if(e&&e.__sentry_captured__)return!0;try{wp(e,`__sentry_captured__`,!0)}catch{}return!1}function Xp(e){return Array.isArray(e)?e:[e]}var Zp=sp,Qp,$p,em;function tm(){if(!Zp.document)return;let e=Hp.bind(null,`dom`),t=nm(e,!0);Zp.document.addEventListener(`click`,t,!1),Zp.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Zp[t]&&Zp[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty(`addEventListener`)||(Cp(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this,a=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=a[n]=a[n]||{refCount:0};if(!o.handler){let r=nm(e);o.handler=r,t.call(this,n,r,i)}o.refCount++}catch{}return t.call(this,n,r,i)}}),Cp(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this,i=n.__sentry_instrumentation_handlers__||{},a=i[t];a&&(a.refCount--,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete i[t]),Object.keys(i).length===0&&delete n.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function nm(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return!(e!==`keypress`||t&&t.tagName&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))}(n.type,r))return;wp(n,`_sentryCaptured`,!0),r&&!r._sentryId&&wp(r,`_sentryId`,Wp());let i=n.type===`keypress`?`input`:n.type;(function(e){if(e.type!==$p)return!1;try{if(!e.target||e.target._sentryId!==em)return!1}catch{}return!0})(n)||(e({event:n,name:i,global:t}),$p=n.type,em=r?r._sentryId:void 0),clearTimeout(Qp),Qp=Zp.setTimeout(()=>{em=void 0,$p=void 0},1e3)}}var rm=cp();function im(){if(!(`fetch`in rm))return!1;try{return new Headers,new Request(`http://www.example.com`),new Response,!0}catch{return!1}}function am(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function om(){(function(){if(typeof EdgeRuntime==`string`)return!0;if(!im())return!1;if(am(rm.fetch))return!0;let e=!1,t=rm.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=am(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){pp&&_p.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e})()&&Cp(sp,`fetch`,function(e){return function(...t){let{method:n,url:r}=function(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:cm(t),method:sm(n,`method`)?String(n.method).toUpperCase():`GET`}}let t=e[0];return{url:cm(t),method:sm(t,`method`)?String(t.method).toUpperCase():`GET`}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Hp(`fetch`,{...i}),e.apply(sp,t).then(e=>(Hp(`fetch`,{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Hp(`fetch`,{...i,endTimestamp:Date.now(),error:e}),e})}})}function sm(e,t){return!!e&&typeof e==`object`&&!!e[t]}function cm(e){return typeof e==`string`?e:e?sm(e,`url`)?e.url:e.toString?e.toString():``:``}var lm=null;function um(){lm=sp.onerror,sp.onerror=function(e,t,n,r,i){return Hp(`error`,{column:r,error:i,line:n,msg:e,url:t}),!(!lm||lm.__SENTRY_LOADER__)&&lm.apply(this,arguments)},sp.onerror.__SENTRY_INSTRUMENTED__=!0}var dm=null;function fm(){dm=sp.onunhandledrejection,sp.onunhandledrejection=function(e){return Hp(`unhandledrejection`,e),!(dm&&!dm.__SENTRY_LOADER__)||dm.apply(this,arguments)},sp.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var pm=cp(),mm=sp,hm;function gm(e){let t=`history`;Bp(t,e),Vp(t,_m)}function _m(){if(!function(){let e=pm.chrome,t=e&&e.app&&e.app.runtime,n=`history`in pm&&!!pm.history.pushState&&!!pm.history.replaceState;return!t&&n}())return;let e=mm.onpopstate;function t(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let e=hm,t=String(n);hm=t,Hp(`history`,{from:e,to:t})}return e.apply(this,t)}}mm.onpopstate=function(...t){let n=mm.location.href,r=hm;if(hm=n,Hp(`history`,{from:r,to:n}),e)try{return e.apply(this,t)}catch{}},Cp(mm.history,`pushState`,t),Cp(mm.history,`replaceState`,t)}var vm=sp,ym=`__sentry_xhr_v3__`;function bm(){if(!vm.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;Cp(e,`open`,function(e){return function(...t){let n=Date.now(),r=Wf(t[0])?t[0].toUpperCase():void 0,i=function(e){if(Wf(e))return e;try{return e.toString()}catch{}}(t[1]);if(!r||!i)return e.apply(this,t);this[ym]={method:r,url:i,request_headers:{}},r===`POST`&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let a=()=>{let e=this[ym];if(e&&this.readyState===4){try{e.status_code=this.status}catch{}Hp(`xhr`,{args:[r,i],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return`onreadystatechange`in this&&typeof this.onreadystatechange==`function`?Cp(this,`onreadystatechange`,function(e){return function(...t){return a(),e.apply(this,t)}}):this.addEventListener(`readystatechange`,a),Cp(this,`setRequestHeader`,function(e){return function(...t){let[n,r]=t,i=this[ym];return i&&Wf(n)&&Wf(r)&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}}),e.apply(this,t)}}),Cp(e,`send`,function(e){return function(...t){let n=this[ym];return n?(t[0]!==void 0&&(n.body=t[0]),Hp(`xhr`,{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)):e.apply(this,t)}})}function xm(e,t=100,n=1/0){try{return Cm(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Sm(e,t=3,n=102400){let r=xm(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(r)>n?Sm(e,t-1,n):r}function Cm(e,t,n=1/0,i=1/0,a=function(){let e=typeof WeakSet==`function`,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){let[o,s]=a;if(t==null||[`number`,`boolean`,`string`].includes(typeof t)&&!function(e){return typeof e==`number`&&e!=e}(t))return t;let c=function(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof r.r<`u`&&t===r.r)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Zf(t))return`[VueViewModel]`;if(function(e){return qf(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}(t))return`[SyntheticEvent]`;if(typeof t==`number`&&t!=t)return`[NaN]`;if(typeof t==`function`)return`[Function: ${Lp(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=function(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:`null prototype`}(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!c.startsWith(`[object `))return c;if(t.__sentry_skip_normalization__)return t;let l=typeof t.__sentry_override_normalization_depth__==`number`?t.__sentry_override_normalization_depth__:n;if(l===0)return c.replace(`object `,``);if(o(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return Cm(``,u.toJSON(),l-1,i,a)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=Dp(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=i){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=Cm(e,t,l-1,i,a),f++}return s(t),d}var wm;function Tm(e){return new Dm(t=>{t(e)})}function Em(e){return new Dm((t,n)=>{n(e)})}(function(e){e[e.PENDING=0]=`PENDING`,e[e.RESOLVED=1]=`RESOLVED`,e[e.REJECTED=2]=`REJECTED`})(wm||={});var Dm=class e{constructor(t){e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),this._state=wm.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(e){this._reject(e)}}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(t)try{e(t(n))}catch(e){r(e)}else e(n)},t=>{if(n)try{e(n(t))}catch(e){r(e)}else r(t)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{i?n(r):e(r)})})}__init(){this._resolve=e=>{this._setResult(wm.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(wm.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===wm.PENDING){if(Yf(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===wm.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===wm.RESOLVED&&e[1](this._value),this._state===wm.REJECTED&&e[2](this._value),!0)})}}};function Om(e){let t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(e===void 0||t.length<e))return Em(new Sp(`Not adding Promise because buffer limit was reached.`));let i=r();return t.indexOf(i)===-1&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new Dm((n,r)=>{let i=t.length;if(!i)return n(!0);let a=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{Tm(e).then(()=>{--i||(clearTimeout(a),n(!0))},r)})})}}}function km(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}var Am=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function jm(e){return e===`warn`?`warning`:Am.includes(e)?e:`log`}function Mm(){return Date.now()/1e3}var Nm=function(){let{performance:e}=sp;if(!e||!e.now)return Mm;let t=Date.now()-e.now(),n=e.timeOrigin==null?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function Pm(e,t=[]){return[e,t]}function Fm(e,t){let[n,r]=e;return[n,[...r,t]]}function Im(e,t){let n=e[1];for(let e of n)if(t(e,e[0].type))return!0;return!1}function Lm(e,t){return(t||new TextEncoder).encode(e)}function Rm(e,t){let[n,r]=e,i=JSON.stringify(n);function a(e){typeof i==`string`?i=typeof e==`string`?i+e:[Lm(i,t),e]:i.push(typeof e==`string`?Lm(e,t):e)}for(let e of r){let[t,n]=e;if(a(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)a(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(xm(n))}a(e)}}return typeof i==`string`?i:function(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}(i)}function zm(e,t){let n=typeof e.data==`string`?Lm(e.data,t):e.data;return[Ap({type:`attachment`,length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{let{performance:e}=sp;if(!e||!e.now)return;let t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,a=i<t,o=e.timing&&e.timing.navigationStart,s=typeof o==`number`?Math.abs(o+n-r):t;(a||s<t)&&i<=s&&e.timeOrigin})();var Bm={session:`session`,sessions:`session`,attachment:`attachment`,transaction:`transaction`,event:`error`,client_report:`internal`,user_report:`default`,profile:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,feedback:`feedback`,span:`span`,statsd:`metric_bucket`};function Vm(e){return Bm[e]}function Hm(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Um(e,{statusCode:t,headers:n},r=Date.now()){let i={...e},a=n&&n[`x-sentry-rate-limits`],o=n&&n[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=1e3*(isNaN(o)?60:o);if(n)for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s;else i.all=r+s}else o?i.all=r+function(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):t===429&&(i.all=r+6e4);return i}var Wm=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Gm=`production`;function Km(){return lp(`globalEventProcessors`,()=>[])}function qm(e){Km().push(e)}function Jm(e,t,n,r=0){return new Dm((i,a)=>{let o=e[r];if(t===null||typeof o!=`function`)i(t);else{let s=o({...t},n);Wm&&o.id&&s===null&&_p.log(`Event processor "${o.id}" dropped event`),Yf(s)?s.then(t=>Jm(e,t,n,r+1).then(i)).then(null,a):Jm(e,s,n,r+1).then(i).then(null,a)}})}function Ym(e){let t=Nm(),n={sid:Wp(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Ap({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Xm(n,e),n}function Xm(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Nm(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Wp()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Zm(e,t){let n={};e.status===`ok`&&(n={status:`exited`}),Xm(e,n)}function Qm(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,tags:s,origin:c}=$m(e);return Ap({data:r,op:i,parent_span_id:a,span_id:t,status:o,tags:s,trace_id:n,origin:c})}function $m(e){return function(e){return typeof e.getSpanJSON==`function`}(e)?e.getSpanJSON():typeof e.toJSON==`function`?e.toJSON():{}}function eh(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||Wp(),timestamp:t.timestamp||Mm()},l=n.integrations||e.integrations.map(e=>e.name);(function(e,t){let{environment:n,release:r,dist:i,maxValueLength:a=250}=t;`environment`in e||(e.environment=`environment`in t?n:Gm),e.release===void 0&&r!==void 0&&(e.release=r),e.dist===void 0&&i!==void 0&&(e.dist=i),e.message&&=Qf(e.message,a);let o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=Qf(o.value,a));let s=e.request;s&&s.url&&(s.url=Qf(s.url,a))})(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,l),t.type===void 0&&function(e,t){let n=sp._sentryDebugIds;if(!n)return;let r,i=th.get(t);i?r=i:(r=new Map,th.set(t,r));let a=Object.keys(n).reduce((e,i)=>{let a,o=r.get(i);o?a=o:(a=t(i),r.set(i,a));for(let t=a.length-1;t>=0;t--){let r=a[t];if(r.filename){e[r.filename]=n[i];break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=a[e.filename])})})}catch{}}(c,e.stackParser);let u=function(e,t){if(!t)return e;let n=e?e.clone():new _h;return n.update(t),n}(r,n.captureContext);n.mechanism&&Jp(c,n.mechanism);let d=i&&i.getEventProcessors?i.getEventProcessors():[],f=(gh||=new _h,gh).getScopeData();a&&mh(f,a.getScopeData()),u&&mh(f,u.getScopeData());let p=[...n.attachments||[],...f.attachments];return p.length&&(n.attachments=p),ph(c,f),Jm([...d,...Km(),...f.eventProcessors],c,n).then(e=>(e&&function(e){let t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.keys(t).forEach(e=>{n.push({type:`sourcemap`,code_file:e,debug_id:t[e]})})}(e),typeof o==`number`&&o>0?function(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:xm(e.data,t,n)}}))},...e.user&&{user:xm(e.user,t,n)},...e.contexts&&{contexts:xm(e.contexts,t,n)},...e.extra&&{extra:xm(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=xm(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>{let r=$m(e).data;return r&&(e.data=xm(r,t,n)),e})),r}(e,o,s):e))}var th=new WeakMap;function nh(e,t){return Th().captureEvent(e,t)}function rh(e,t){Th().addBreadcrumb(e,t)}function ih(){return Th().getClient()}function ah(){return Th().getScope()}function oh(e){let t=ih(),n=Eh(),r=ah(),{release:i,environment:a=Gm}=t&&t.getOptions()||{},{userAgent:o}=sp.navigator||{},s=Ym({release:i,environment:a,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession();return c&&c.status===`ok`&&Xm(c,{status:`exited`}),sh(),n.setSession(s),r.setSession(s),s}function sh(){let e=Eh(),t=ah(),n=t.getSession()||e.getSession();n&&Zm(n),ch(),e.setSession(),t.setSession()}function ch(){let e=Eh(),t=ah(),n=ih(),r=t.getSession()||e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function lh(e=!1){e?sh():ch()}function uh(e){return e.transaction}function dh(e,t,n){let r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:a}=n&&n.getUser()||{},o=Ap({environment:r.environment||Gm,release:r.release,user_segment:a,public_key:i,trace_id:e});return t.emit&&t.emit(`createDsc`,o),o}function fh(e){let t=ih();if(!t)return{};let n=dh($m(e).trace_id||``,t,ah()),r=uh(e);if(!r)return n;let i=r&&r._frozenDynamicSamplingContext;if(i)return i;let{sampleRate:a,source:o}=r.metadata;a!=null&&(n.sample_rate=`${a}`);let s=$m(r);return o&&o!==`url`&&(n.transaction=s.description),n.sampled=String(function(e){let{traceFlags:t}=e.spanContext();return!!(1&t)}(r)),t.emit&&t.emit(`createDsc`,n),n}function ph(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;(function(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t,c=Ap(n);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});let l=Ap(r);l&&Object.keys(l).length&&(e.tags={...l,...e.tags});let u=Ap(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});let d=Ap(a);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),o&&(e.level=o),s&&(e.transaction=s)})(e,t),r&&function(e,t){e.contexts={trace:Qm(t),...e.contexts};let n=uh(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:fh(t),...e.sdkProcessingMetadata};let r=$m(n).description;r&&(e.tags={transaction:r,...e.tags})}}(e,r),function(e,t){e.fingerprint=e.fingerprint?Xp(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,n),function(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,i),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,a)}function mh(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,sdkProcessingMetadata:s,breadcrumbs:c,fingerprint:l,eventProcessors:u,attachments:d,propagationContext:f,transactionName:p,span:m}=t;hh(e,`extra`,n),hh(e,`tags`,r),hh(e,`user`,i),hh(e,`contexts`,a),hh(e,`sdkProcessingMetadata`,s),o&&(e.level=o),p&&(e.transactionName=p),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...f}}function hh(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}var gh,_h=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=vh()}static clone(t){return t?t.clone():new e}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},t._user=this._user,t._level=this._level,t._span=this._span,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&Xm(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t;if(n instanceof e){let e=n.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),n.getRequestSession()&&(this._requestSession=n.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(qf(n)){let e=t;this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=vh(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:100;if(n<=0)return this;let r={timestamp:Mm(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){let{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:i,_user:a,_level:o,_fingerprint:s,_eventProcessors:c,_propagationContext:l,_sdkProcessingMetadata:u,_transactionName:d,_span:f}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:i,user:a,level:o,fingerprint:s||[],eventProcessors:c,propagationContext:l,sdkProcessingMetadata:u,transactionName:d,span:f}}applyToEvent(e,t={},n=[]){return ph(e,this.getScopeData()),Jm([...n,...Km(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t&&t.event_id?t.event_id:Wp();if(!this._client)return _p.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n&&n.event_id?n.event_id:Wp();if(!this._client)return _p.warn(`No client configured on scope - will not capture message!`),r;let i=Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=t&&t.event_id?t.event_id:Wp();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(_p.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function vh(){return{traceId:Wp(),spanId:Wp().substring(16)}}var yh=`7.116.0`,bh=parseFloat(yh),xh=100,Sh=class{constructor(e,t,n,r=bh){let i,a;this._version=r,t?i=t:(i=new _h,i.setClient(e)),n?a=n:(a=new _h,a.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=a}isOlderThan(e){return this._version<e}bindClient(e){let t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){let t=this.pushScope(),n;try{n=e(t)}catch(e){throw this.popScope(),e}return Yf(n)?n.then(e=>(this.popScope(),e),e=>{throw this.popScope(),e}):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){let n=this._lastEventId=t&&t.event_id?t.event_id:Wp(),r=Error(`Sentry syntheticException`);return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){let r=this._lastEventId=n&&n.event_id?n.event_id:Wp(),i=Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureEvent(e,t){let n=t&&t.event_id?t.event_id:Wp();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){let{scope:n,client:r}=this.getStackTop();if(!r)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=xh}=r.getOptions&&r.getOptions()||{};if(a<=0)return;let o={timestamp:Mm(),...e},s=i?gp(()=>i(o,t)):o;s!==null&&(r.emit&&r.emit(`beforeAddBreadcrumb`,s,t),n.addBreadcrumb(s,a))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){let{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){let t=wh(this);try{e(this)}finally{wh(t)}}getIntegration(e){let t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Wm&&_p.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){let n=this._callExtensionMethod(`startTransaction`,e,t);return Wm&&!n&&(this.getClient()?_p.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
153
- Sentry.addTracingExtensions();
154
- Sentry.init({...});
155
- `):_p.warn(`Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'`)),n}traceHeaders(){return this._callExtensionMethod(`traceHeaders`)}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let e=this.getStackTop().scope,t=e.getSession();t&&Zm(t),this._sendSessionUpdate(),e.setSession()}startSession(e){let{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=Gm}=n&&n.getOptions()||{},{userAgent:a}=sp.navigator||{},o=Ym({release:r,environment:i,user:t.getUser(),...a&&{userAgent:a},...e}),s=t.getSession&&t.getSession();return s&&s.status===`ok`&&Xm(s,{status:`exited`}),this.endSession(),t.setSession(o),o}shouldSendDefaultPii(){let e=this.getClient(),t=e&&e.getOptions();return!(!t||!t.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e,...t){let n=Ch().__SENTRY__;if(n&&n.extensions&&typeof n.extensions[e]==`function`)return n.extensions[e].apply(this,t);Wm&&_p.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function Ch(){return sp.__SENTRY__=sp.__SENTRY__||{extensions:{},hub:void 0},sp}function wh(e){let t=Ch(),n=Dh(t);return Oh(t,e),n}function Th(){let e=Ch();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Ch()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||Dh(e).isOlderThan(bh))&&Oh(e,new Sh),Dh(e)}(e)}function Eh(){return Th().getIsolationScope()}function Dh(e){return lp(`hub`,()=>new Sh,e)}function Oh(e,t){return e?((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0):!1}function kh(e,t,n,r){let i=Hm(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;(function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])})(e,n&&n.sdk);let o=function(e,t,n,r){let i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:yp(r)},...i&&{trace:Ap({...i})}}}(e,i,r,t);return delete e.sdkProcessingMetadata,Pm(o,[[{type:a},e]])}function Ah(e,t){return function(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join(`&`)}({sentry_key:e.publicKey,sentry_version:`7`,...t&&{sentry_client:`${t.name}/${t.version}`}})}var jh=[];function Mh(e){let t=e.defaultIntegrations||[],n=e.integrations,r;t.forEach(e=>{e.isDefaultInstance=!0}),r=Array.isArray(n)?[...t,...n]:typeof n==`function`?Xp(n(t)):t;let i=function(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.keys(t).map(e=>t[e])}(r),a=function(e,t){for(let n=0;n<e.length;n++)if(!0===t(e[n]))return n;return-1}(i,e=>e.name===`Debug`);if(a!==-1){let[e]=i.splice(a,1);i.push(e)}return i}function Nh(e,t){for(let n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Ph(e,t,n){if(n[t.name])Wm&&_p.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,jh.indexOf(t.name)===-1&&(t.setupOnce(qm,Th),jh.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),e.on&&typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(e.addEventProcessor&&typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}Wm&&_p.log(`Integration installed: ${t.name}`)}}function Fh(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}function Ih(e,t,n,r){let i={sent_at:new Date().toISOString()};return n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(i.dsn=yp(t)),Pm(i,[function(e){let t=function(e){let t=``;for(let n of e){let e=Object.entries(n.tags),r=e.length>0?`|#${e.map(([e,t])=>`${e}:${t}`).join(`,`)}`:``;t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return t}(e);return[{type:`statsd`,length:t.length},t]}(e)])}var Lh=`Not capturing exception because it's already been captured.`,Rh=class{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=xp(e.dsn):Wm&&_p.warn(`No DSN provided, client will not send events.`),this._dsn){let t=function(e,t={}){let n=typeof t==`string`?t:t.tunnel,r=typeof t!=`string`&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${Ah(e,r)}`}(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(Yp(e))return void(Wm&&_p.log(Lh));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let i=n&&n.event_id,a=Gf(e)?e:String(e),o=Kf(e)?this.eventFromMessage(a,t,n):this.eventFromException(e,n);return this._process(o.then(e=>this._captureEvent(e,n,r)).then(e=>{i=e})),i}captureEvent(e,t,n){if(t&&t.originalException&&Yp(t.originalException))return void(Wm&&_p.log(Lh));let r=t&&t.event_id,i=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,i||n).then(e=>{r=e})),r}captureSession(e){typeof e.release==`string`?(this.sendSession(e),Xm(e,{init:!1})):Wm&&_p.warn(`Discarded session because of missing or non-string release`)}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):Tm(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return Wm&&_p.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){let t=this._integrations[e.name];Ph(this,e,this._integrations),t||Nh(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=kh(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=Fm(n,zm(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));let r=this._sendEnvelope(n);r&&r.then(t=>this.emit(`afterSendEvent`,e,t),null)}sendSession(e){let t=function(e,t,n,r){let i=Hm(n);return Pm({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:yp(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){let n=`${e}:${t}`;Wm&&_p.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}captureAggregateMetrics(e){Wm&&_p.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);let t=Ih(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(e=>e(...t))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=function(e,t){let n={};return t.forEach(t=>{t&&Ph(e,t,n)}),n}(this,e),Nh(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let n=!1,r=!1,i=t.exception&&t.exception.values;if(i){r=!0;for(let e of i){let t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(Xm(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Dm(t=>{let n=0,r=setInterval(()=>{this._numProcessing==0?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&this._transport!==void 0}_prepareEvent(e,t,n,r=Eh()){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a.length>0&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),eh(i,e,t,n,this,r).then(e=>{if(e===null)return e;let t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if((!e.contexts||!e.contexts.trace)&&t){let{traceId:r,spanId:i,parentSpanId:a,dsc:o}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:a},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:o||dh(r,this,n),...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{if(Wm){let t=e;t.logLevel===`log`?_p.log(t.message):_p.warn(t)}})}_processEvent(e,t,n){let r=this.getOptions(),{sampleRate:i}=r,a=Bh(e),o=zh(e),s=e.type||`error`,c=`before send for type \`${s}\``;if(o&&typeof i==`number`&&Math.random()>i)return this.recordDroppedEvent(`sample_rate`,`error`,e),Em(new Sp(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,`log`));let l=s===`replay_event`?`replay`:s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,u).then(n=>{if(n===null)throw this.recordDroppedEvent(`event_processor`,l,e),new Sp("An event processor returned `null`, will not send event.",`log`);return t.data&&!0===t.data.__sentry__?n:function(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Yf(e))return e.then(e=>{if(!qf(e)&&e!==null)throw new Sp(n);return e},e=>{throw new Sp(`${t} rejected with ${e}`)});if(!qf(e)&&e!==null)throw new Sp(n);return e}(function(e,t,n){let{beforeSend:r,beforeSendTransaction:i}=e;return zh(t)&&r?r(t,n):Bh(t)&&i?i(t,n):t}(r,n,t),c)}).then(r=>{if(r===null)throw this.recordDroppedEvent(`before_send`,l,e),new Sp(`${c} returned \`null\`, will not send event.`,`log`);let i=n&&n.getSession();!a&&i&&this._updateSessionFromEvent(i,r);let o=r.transaction_info;return a&&o&&r.transaction!==e.transaction&&(r.transaction_info={...o,source:`custom`}),this.sendEvent(r,t),r}).then(null,e=>{throw e instanceof Sp?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Sp(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,e=>{Wm&&_p.error(`Error while sending event:`,e)});Wm&&_p.error(`Transport disabled`)}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{let[n,r]=t.split(`:`);return{reason:n,category:r,quantity:e[t]}})}};function zh(e){return e.type===void 0}function Bh(e){return e.type===`transaction`}function Vh(e,t){!0===t.debug&&(Wm?_p.enable():gp(()=>{})),ah().update(t.initialScope);let n=new e(t);(function(e){let t=Th().getStackTop();t.client=e,t.scope.setClient(e)})(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)}function Hh(e,t,n=Om(e.bufferSize||30)){let r={};function i(i){let a=[];if(Im(i,(t,n)=>{let i=Vm(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)){let r=Uh(t,n);e.recordDroppedEvent(`ratelimit_backoff`,i,r)}else a.push(t)}),a.length===0)return Tm();let o=Pm(i[0],a),s=t=>{Im(o,(n,r)=>{let i=Uh(n,r);e.recordDroppedEvent(t,Vm(r),i)})};return n.add(()=>t({body:Rm(o,e.textEncoder)}).then(e=>(e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&Wm&&_p.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Um(r,e),e),e=>{throw s(`network_error`),e})).then(e=>e,e=>{if(e instanceof Sp)return Wm&&_p.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Tm();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>n.drain(e)}}function Uh(e,t){if(t===`event`||t===`transaction`)return Array.isArray(e)?e[1]:void 0}function Wh(e,t,n=[t],r=`npm`){let i=e._metadata||{};i.sdk||={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:yh})),version:yh},e._metadata=i}var Gh=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Kh=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],qh=`InboundFilters`,Jh=(e={})=>({name:qh,setupOnce(){},processEvent(t,n,r){return function(e,t){return t.ignoreInternal&&function(e){try{return e.exception.values[0].type===`SentryError`}catch{}return!1}(e)?(Wm&&_p.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Kp(e)}`),!0):function(e,t){return!(e.type||!t||!t.length)&&function(e){let t=[],n;e.message&&t.push(e.message);try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),Wm&&t.length===0&&_p.error(`Could not extract message for event ${Kp(e)}`),t}(e).some(e=>tp(e,t))}(e,t.ignoreErrors)?(Wm&&_p.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Kp(e)}`),!0):function(e,t){if(e.type!==`transaction`||!t||!t.length)return!1;let n=e.transaction;return!!n&&tp(n,t)}(e,t.ignoreTransactions)?(Wm&&_p.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Kp(e)}`),!0):function(e,t){if(!t||!t.length)return!1;let n=Yh(e);return!!n&&tp(n,t)}(e,t.denyUrls)?(Wm&&_p.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Kp(e)}.\nUrl: ${Yh(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;let n=Yh(e);return!n||tp(n,t)}(e,t.allowUrls)&&(Wm&&_p.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Kp(e)}.\nUrl: ${Yh(e)}`),!0)}(t,function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Gh],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Kh],ignoreInternal:e.ignoreInternal===void 0||e.ignoreInternal}}(e,r.getOptions()))?null:t}});function Yh(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}(t):null}catch{return Wm&&_p.error(`Cannot extract url for event ${Kp(e)}`),null}}var Xh;Fh(qh,Jh);var Zh=`FunctionToString`,Qh=new WeakMap,$h=()=>({name:Zh,setupOnce(){Xh=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Ep(this),n=Qh.has(ih())&&t!==void 0?t:this;return Xh.apply(n,e)}}catch{}},setup(e){Qh.set(e,!0)}});Fh(Zh,$h);var eg=sp,tg=0;function ng(){return tg>0}function rg(e,t={},n){if(typeof e!=`function`)return e;try{let t=e.__sentry_wrapped__;if(t)return t;if(Ep(e))return e}catch{return e}let r=function(){let r=Array.prototype.slice.call(arguments);try{n&&typeof n==`function`&&n.apply(this,arguments);let i=r.map(e=>rg(e,t));return e.apply(this,i)}catch(e){throw tg++,setTimeout(()=>{tg--}),function(...e){let t=Th();if(e.length===2){let[n,r]=e;return n?t.withScope(()=>(t.getStackTop().scope=n,r(n))):t.withScope(r)}t.withScope(e[0])}(n=>{n.addEventProcessor(e=>(t.mechanism&&(qp(e,void 0),Jp(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),function(e){Th().captureException(e,void 0)}(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}Tp(r,e),wp(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch{}return r}var ig=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;function ag(e,t){let n=sg(e,t),r={type:t&&t.name,value:lg(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function og(e,t){return{exception:{values:[ag(e,t)]}}}function sg(e,t){let n=t.stacktrace||t.stack||``,r=function(e){if(e){if(typeof e.framesToPop==`number`)return e.framesToPop;if(cg.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch{}return[]}var cg=/Minified React error #\d+;/i;function lg(e){let t=e&&e.message;return t?t.error&&typeof t.error.message==`string`?t.error.message:t:`No error message`}function ug(e,t,n,r,i){let a;if(Hf(t)&&t.error)return og(e,t.error);if(Uf(t)||function(e){return Vf(e,`DOMException`)}(t)){let i=t;if(`stack`in t)a=og(e,t);else{let t=i.name||(Uf(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=dg(e,o,n,r),qp(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return Bf(t)?og(e,t):qf(t)||Jf(t)?(a=function(e,t,n,r){let i=ih(),a=i&&i.getOptions().normalizeDepth,o={exception:{values:[{type:Jf(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:fg(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Sm(t,a)}};if(n){let t=sg(e,n);t.length&&(o.exception.values[0].stacktrace={frames:t})}return o}(e,t,n,i),Jp(a,{synthetic:!0}),a):(a=dg(e,t,n,r),qp(a,`${t}`),Jp(a,{synthetic:!0}),a)}function dg(e,t,n,r){let i={};if(r&&n){let r=sg(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}if(Gf(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function fg(e,{isUnhandledRejection:t}){let n=function(e,t=40){let n=Object.keys(Dp(e));if(n.sort(),!n.length)return`[object has no keys]`;if(n[0].length>=t)return Qf(n[0],t);for(let e=n.length;e>0;e--){let r=n.slice(0,e).join(`, `);if(!(r.length>t))return e===n.length?r:Qf(r,t)}return``}(e),r=t?`promise rejection`:`exception`;return Hf(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Jf(e)?`Event \`${function(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}var pg=class extends Rh{constructor(e){Wh(e,`browser`,[`browser`],eg.SENTRY_SDK_SOURCE||`npm`),super(e),e.sendClientReports&&eg.document&&eg.document.addEventListener(`visibilitychange`,()=>{eg.document.visibilityState===`hidden`&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){let i=ug(e,t,n&&n.syntheticException||void 0,r);return Jp(i),i.level=`error`,n&&n.event_id&&(i.event_id=n.event_id),Tm(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return function(e,t,n=`info`,r,i){let a=dg(e,t,r&&r.syntheticException||void 0,i);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Tm(a)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(ig&&_p.warn(`SDK not enabled, will not capture user feedback.`));let t=function(e,{metadata:t,tunnel:n,dsn:r}){return Pm({event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:yp(r)}},[function(e){return[{type:`user_report`},e]}(e)])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n)}_flushOutcomes(){let e=this._clearOutcomes();if(e.length===0)return void(ig&&_p.log(`No outcomes to send`));if(!this._dsn)return void(ig&&_p.log(`No dsn provided, will not send outcomes`));ig&&_p.log(`Sending outcomes:`,e);let t=function(e,t){return Pm(t?{dsn:t}:{},[[{type:`client_report`},{timestamp:Mm(),discarded_events:e}]])}(e,this._options.tunnel&&yp(this._dsn));this._sendEnvelope(t)}},mg;function hg(e,t=function(){if(mg)return mg;if(am(eg.fetch))return mg=eg.fetch.bind(eg);let e=eg.document,t=eg.fetch;if(e&&typeof e.createElement==`function`)try{let n=e.createElement(`iframe`);n.hidden=!0,e.head.appendChild(n);let r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){ig&&_p.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return mg=t.bind(eg)}()){let n=0,r=0;return Hh(e,function(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,o).then(e=>(n-=a,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get(`X-Sentry-Rate-Limits`),"retry-after":e.headers.get(`Retry-After`)}}))}catch(e){return mg=void 0,n-=a,r--,Em(e)}})}function gg(e){return Hh(e,function(t){return new Dm((n,r)=>{let i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{i.readyState===4&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader(`X-Sentry-Rate-Limits`),"retry-after":i.getResponseHeader(`Retry-After`)}})},i.open(`POST`,e.url);for(let t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)})})}var _g=`?`;function vg(e,t,n,r){let i={filename:e,function:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var yg=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bg=/\((\S*)(?::(\d+))(?::(\d+))\)/,xg=[30,e=>{let t=yg.exec(e);if(t){if(t[2]&&t[2].indexOf(`eval`)===0){let e=bg.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}let[e,n]=Dg(t[1]||_g,t[2]);return vg(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Sg=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Cg=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wg=[50,e=>{let t=Sg.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=Cg.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||_g;return[n,e]=Dg(n,e),vg(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Tg=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Eg=Pp(xg,wg,[40,e=>{let t=Tg.exec(e);return t?vg(t[2],t[1]||_g,+t[3],t[4]?+t[4]:void 0):void 0}]),Dg=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?_g:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Og=1024,kg=`Breadcrumbs`,Ag=(e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:kg,setupOnce(){},setup(e){t.console&&function(e){let t=`console`;Bp(t,e),Vp(t,Up)}(function(e){return function(t){if(ih()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:jm(t.level),message:$f(t.args,` `)};if(t.level===`assert`){if(!1!==t.args[0])return;n.message=`Assertion failed: ${$f(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1)}rh(n,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){Bp(`dom`,e),Vp(`dom`,tm)}(function(e,t){return function(n){if(ih()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>Og&&(ig&&_p.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=Og),typeof a==`string`&&(a=[a]);try{let e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=dp(t,{keyAttrs:a,maxStringLength:o}),i=function(e){if(!up.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),rh(s,{event:n.event,name:n.name,global:n.global})}}(e,t.dom)),t.xhr&&function(e){Bp(`xhr`,e),Vp(`xhr`,bm)}(function(e){return function(t){if(ih()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[ym];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i;rh({category:`xhr`,data:{method:a,url:o,status_code:s},type:`http`},{xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r})}}(e)),t.fetch&&function(e){let t=`fetch`;Bp(t,e),Vp(t,om)}(function(e){return function(t){if(ih()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||t.fetchData.method!==`POST`))if(t.error)rh({category:`fetch`,data:t.fetchData,level:`error`,type:`http`},{data:t.error,input:t.args,startTimestamp:n,endTimestamp:r});else{let e=t.response;rh({category:`fetch`,data:{...t.fetchData,status_code:e&&e.status},type:`http`},{input:t.args,response:e,startTimestamp:n,endTimestamp:r})}}}(e)),t.history&&gm(function(e){return function(t){if(ih()!==e)return;let n=t.from,r=t.to,i=km(eg.location.href),a=n?km(n):void 0,o=km(r);(!a||!a.path)&&(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),rh({category:`navigation`,data:{from:n,to:r}})}}(e)),t.sentry&&e.on&&e.on(`beforeSendEvent`,function(e){return function(t){ih()===e&&rh({category:`sentry.`+(t.type===`transaction`?`transaction`:`event`),event_id:t.event_id,level:t.level,message:Kp(t)},{event:t})}}(e))}}};Fh(kg,Ag);var jg=`Dedupe`,Mg=()=>{let e;return{name:jg,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&!(!function(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Pg(e,t)||!Ng(e,t))}(e,t)&&!function(e,t){let n=Fg(t),r=Fg(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&Pg(e,t)&&Ng(e,t))}(e,t))}(t,e))return ig&&_p.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}};function Ng(e,t){let n=Ig(e),r=Ig(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Pg(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join(``)===r.join(``)}catch{return!1}}function Fg(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Ig(e){let t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}Fh(jg,Mg);var Lg=`GlobalHandlers`,Rg=(e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:Lg,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){(function(e){let t=`error`;Bp(t,e),Vp(t,um)})(t=>{let{stackParser:n,attachStacktrace:r}=Vg();if(ih()!==e||ng())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=c===void 0&&Wf(i)?function(e,t,n,r){let i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,a=Hf(e)?e.message:e,o=`Error`,s=a.match(i);return s&&(o=s[1],a=s[2]),zg({exception:{values:[{type:o,value:a}]}},t,n,r)}(i,a,o,s):zg(ug(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,nh(l,{originalException:c,mechanism:{handled:!1,type:`onerror`}})})}(e),Bg(`onerror`)),t.onunhandledrejection&&(function(e){(function(e){let t=`unhandledrejection`;Bp(t,e),Vp(t,fm)})(t=>{let{stackParser:n,attachStacktrace:r}=Vg();if(ih()!==e||ng())return;let i=function(e){if(Kf(e))return e;let t=e;try{if(`reason`in t)return t.reason;if(`detail`in t&&`reason`in t.detail)return t.detail.reason}catch{}return e}(t),a=Kf(i)?function(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):ug(n,i,void 0,r,!0);a.level=`error`,nh(a,{originalException:i,mechanism:{handled:!1,type:`onunhandledrejection`}})})}(e),Bg(`onunhandledrejection`))}}};function zg(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[],l=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=Wf(t)&&t.length>0?t:function(){try{return up.document.location.href}catch{return``}}();return c.length===0&&c.push({colno:l,filename:d,function:`?`,in_app:!0,lineno:u}),e}function Bg(e){ig&&_p.log(`Global Handler attached: ${e}`)}function Vg(){let e=ih();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}Fh(Lg,Rg);var Hg=`HttpContext`,Ug=()=>({name:Hg,setupOnce(){},preprocessEvent(e){if(!eg.navigator&&!eg.location&&!eg.document)return;let t=e.request&&e.request.url||eg.location&&eg.location.href,{referrer:n}=eg.document||{},{userAgent:r}=eg.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}};e.request={...e.request,...t&&{url:t},headers:i}}});Fh(Hg,Ug);var Wg=`LinkedErrors`,Gg=(e={})=>{let t=e.limit||5,n=e.key||`cause`;return{name:Wg,setupOnce(){},preprocessEvent(e,r,i){let a=i.getOptions();np(ag,a.stackParser,a.maxValueLength,n,t,e,r)}}};Fh(Wg,Gg);var Kg=`EventTarget.Window.Node.ApplicationCache.AudioTrackList.BroadcastChannel.ChannelMergerNode.CryptoOperation.EventSource.FileReader.HTMLUnknownElement.IDBDatabase.IDBRequest.IDBTransaction.KeyOperation.MediaController.MessagePort.ModalWindow.Notification.SVGElementInstance.Screen.SharedWorker.TextTrack.TextTrackCue.TextTrackList.WebSocket.WebSocketWorker.Worker.XMLHttpRequest.XMLHttpRequestEventTarget.XMLHttpRequestUpload`.split(`.`),qg=`TryCatch`,Jg=(e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:qg,setupOnce(){t.setTimeout&&Cp(eg,`setTimeout`,Yg),t.setInterval&&Cp(eg,`setInterval`,Yg),t.requestAnimationFrame&&Cp(eg,`requestAnimationFrame`,Xg),t.XMLHttpRequest&&`XMLHttpRequest`in eg&&Cp(XMLHttpRequest.prototype,`send`,Zg);let e=t.eventTarget;e&&(Array.isArray(e)?e:Kg).forEach(Qg)}}};function Yg(e){return function(...t){let n=t[0];return t[0]=rg(n,{mechanism:{data:{function:Lp(e)},handled:!1,type:`instrument`}}),e.apply(this,t)}}function Xg(e){return function(t){return e.apply(this,[rg(t,{mechanism:{data:{function:`requestAnimationFrame`,handler:Lp(e)},handled:!1,type:`instrument`}})])}}function Zg(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&Cp(n,e,function(t){let n={mechanism:{data:{function:e,handler:Lp(t)},handled:!1,type:`instrument`}},r=Ep(t);return r&&(n.mechanism.data.handler=Lp(r)),rg(t,n)})}),e.apply(this,t)}}function Qg(e){let t=eg,n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty(`addEventListener`)||(Cp(n,`addEventListener`,function(t){return function(n,r,i){try{typeof r.handleEvent==`function`&&(r.handleEvent=rg(r.handleEvent,{mechanism:{data:{function:`handleEvent`,handler:Lp(r),target:e},handled:!1,type:`instrument`}}))}catch{}return t.apply(this,[n,rg(r,{mechanism:{data:{function:`addEventListener`,handler:Lp(r),target:e},handled:!1,type:`instrument`}}),i])}}),Cp(n,`removeEventListener`,function(e){return function(t,n,r){let i=n;try{let n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch{}return e.call(this,t,i,r)}}))}Fh(qg,Jg);var $g=[Jh(),$h(),Jg(),Ag(),Rg(),Gg(),Mg(),Ug()];function e_(e={}){e.defaultIntegrations===void 0&&(e.defaultIntegrations=[...$g]),e.release===void 0&&(typeof __SENTRY_RELEASE__==`string`&&(e.release=__SENTRY_RELEASE__),eg.SENTRY_RELEASE&&eg.SENTRY_RELEASE.id&&(e.release=eg.SENTRY_RELEASE.id)),e.autoSessionTracking===void 0&&(e.autoSessionTracking=!0),e.sendClientReports===void 0&&(e.sendClientReports=!0),Vh(pg,{...e,stackParser:Fp(e.stackParser||Eg),integrations:Mh(e),transport:e.transport||(im()?hg:gg)}),e.autoSessionTracking&&function(){if(typeof eg.document>`u`)return void(ig&&_p.warn(`Session tracking in non-browser environment with @sentry/browser is not supported.`));oh({ignoreDuration:!0}),lh(),gm(({from:e,to:t})=>{e!==void 0&&e!==t&&(oh({ignoreDuration:!0}),lh())})}()}var t_=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof r.r<`u`?r.r:typeof self<`u`?self:{};function n_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function r_(e){if(e.__esModule)return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var i_=(e=>(e.INLINE=`inline`,e.OVERLAY=`overlay`,e))(i_||{}),a_=(e=>(e.TOP=`top`,e.BOTTOM=`bottom`,e.HIDDEN=``,e))(a_||{});function G(e,t){return{...t,message:e}}var o_=[{name:`emoticons`,list:`afro-1.afro.agent.alien-1.alien.angel.angry-1.angry-2.angry-3.angry-4.angry-5.angry.arguing.arrogant.asian-1.asian.avatar.baby-1.baby-2.baby.bully.burglar.businessman.cheeky-1.cheeky.clown.confused-1.confused-2.confused-3.confused.creepy.crying-1.crying-2.crying-3.crying.dazed-1.dazed-2.dazed-3.dazed.dead-1.dead-2.dead-3.dead-4.dead-5.dead-6.dead.desperate-1.desperate.detective.dissapointment.doctor.drunk.dumb.emo-1.emo-2.emo.emoticon.evil.faint-1.faint.flirt-1.flirt-2.flirt.flirty.gangster.geek-1.geek.gentleman-1.gentleman-2.gentleman-3.gentleman-4.gentleman.ginger.girl-1.girl.goofy-1.goofy-2.goofy-3.goofy-4.goofy.grubby-1.grubby.happy-1.happy-10.happy-11.happy-12.happy-13.happy-14.happy-15.happy-16.happy-2.happy-3.happy-4.happy-5.happy-6.happy-7.happy-8.happy-9.happy.harry-potter.heisenberg.hipster-1.hipster-2.hipster.in-love-1.in-love-2.in-love-3.in-love-4.in-love-5.in-love-6.in-love.japan.jew.joyful-1.joyful-2.joyful.kiss-1.kiss-2.kiss-3.kiss-4.kiss.laughing-1.laughing-2.laughing-3.laughing.listening.love.manly.miserly-1.miserly.nerd-1.nerd-2.nerd-3.nerd-4.nerd.ninja.pirate-1.pirate-2.pirate.punk-1.punk-2.punk.rapper.relieved.rich-1.rich-2.rich.rockstar.sad-1.sad-2.sad-3.sad-4.sad-5.sad-6.sad.scared-1.scared-2.scared-3.scared.sceptic-1.sceptic-2.sceptic-3.sceptic-4.sceptic-5.sceptic-6.sceptic-7.sceptic.secret.shocked-1.shocked-2.shocked-3.shocked.sick-1.sick-2.sick-3.sick-4.sick.silent.skeleton.smile.smiling-1.smiling.smoked.smug-1.smug-2.smug-3.smug-4.smug-5.smug-6.smug.sporty.stunned.superhero-1.superhero-2.superhero-3.superhero-4.superhero.surprised-1.surprised.thinking.tired-1.tired-2.tired-3.tired.tough-1.tough.trendy.vampire-1.vampire.wink-1.wink-2.wink.winking-1.winking.yawning-1.yawning-2.yawning-3.yawning.yelling.zombie`.split(`.`),type:`svg`,thumbnailUrl:`images/stickers/categories/emoticon.svg`},{name:`doodles`,items:100,type:`svg`,thumbnailUrl:`images/stickers/categories/doodles.svg`},{name:`landmarks`,items:100,type:`svg`,thumbnailUrl:`images/stickers/categories/landmark.svg`,invertPreview:!0},{name:`bubbles`,items:104,type:`png`,thumbnailUrl:`images/stickers/categories/speech-bubble.svg`},{name:`transportation`,items:22,type:`svg`,thumbnailUrl:`images/stickers/categories/transportation.svg`,invertPreview:!0},{name:`beach`,items:22,type:`svg`,thumbnailUrl:`images/stickers/categories/beach.svg`,invertPreview:!0}],s_={emoticons:G(`Emoticons`),doodles:G(`Doodles`),landmarks:G(`Landmarks`),bubbles:G(`Bubbles`),transportation:G(`Transportation`),beach:G(`Beach`)},c_={fill:`#1565C0`,opacity:1,backgroundColor:null,strokeWidth:.05,stroke:`#000`},l_=[1,8,15,20,25],u_=(e=>(e.DARK=`dark`,e.LIGHT=`light`,e))(u_||{}),d_=[{name:u_.LIGHT,colors:{"--be-foreground-base":`0 0 0`,"--be-primary-light":`191 219 254`,"--be-primary":`59 130 246`,"--be-primary-dark":`37 99 235`,"--be-on-primary":`255 255 255`,"--be-danger":`179 38 30`,"--be-on-danger":`255 255 255`,"--be-background":`255 255 255`,"--be-background-alt":`250 250 250`,"--be-paper":`255 255 255`,"--be-disabled-bg-opacity":`12%`,"--be-disabled-fg-opacity":`26%`,"--be-hover-opacity":`4%`,"--be-focus-opacity":`12%`,"--be-selected-opacity":`8%`,"--be-text-main-opacity":`87%`,"--be-text-muted-opacity":`60%`,"--be-divider-opacity":`12%`}},{name:u_.DARK,isDark:!0,colors:{"--be-foreground-base":`255 255 255`,"--be-primary-light":`239 246 255`,"--be-primary":`191 219 254`,"--be-primary-dark":`147 197 253`,"--be-on-primary":`56 30 114`,"--be-danger":`242 184 181`,"--be-on-danger":`96 20 16`,"--be-background":`20 21 23`,"--be-background-alt":`26 27 30`,"--be-paper":`44 46 51`,"--be-disabled-bg-opacity":`12%`,"--be-disabled-fg-opacity":`30%`,"--be-hover-opacity":`8%`,"--be-focus-opacity":`12%`,"--be-selected-opacity":`16%`,"--be-text-main-opacity":`100%`,"--be-text-muted-opacity":`70%`,"--be-divider-opacity":`12%`}}],f_=(e=>(e.FILTER=`filter`,e.RESIZE=`resize`,e.CROP=`crop`,e.DRAW=`draw`,e.TEXT=`text`,e.SHAPES=`shapes`,e.STICKERS=`stickers`,e.FRAME=`frame`,e.CORNERS=`corners`,e.MERGE=`merge`,e))(f_||{});function p_(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=p_(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function K(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=p_(e))&&(r&&(r+=` `),r+=t);return r}var m_=(0,s.forwardRef)((e,t)=>{let{attr:n,size:r,title:i,className:a,color:o,style:s,children:c,viewBox:u,width:d,height:f,...p}=e;return(0,l.jsxs)(`svg`,{"aria-hidden":!i,focusable:!1,xmlns:`http://www.w3.org/2000/svg`,viewBox:u||`0 0 24 24`,...n,...p,className:K(`svg-icon`,a,h_(r)),style:{color:o,...s},ref:t,height:f||`1em`,width:d||`1em`,children:[i&&(0,l.jsx)(`title`,{children:i}),c]})});function h_(e){switch(e){case`2xs`:return`icon-2xs`;case`xs`:return`icon-xs`;case`sm`:return`icon-sm`;case`md`:return`icon-md`;case`lg`:return`icon-lg`;case`xl`:return`icon-xl`;default:return e}}function q(e,t=``,n){return s.default.memo(s.default.forwardRef((r,i)=>(0,l.jsx)(m_,{"data-testid":`${t}Icon`,ref:i,viewBox:n,...r,size:r.size||`md`,children:e})))}function g_(e,t=``){return q(__(e),t)}function __(e){return e?.map&&e.map((e,t)=>s.default.createElement(e.tag,{key:t,...e.attr},__(e.child)))}var v_=q((0,l.jsx)(`path`,{d:`M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z`}),`TuneOutlined`),y_=q((0,l.jsx)(`path`,{d:`M21 15h2v2h-2v-2zm0-4h2v2h-2v-2zm2 8h-2v2c1 0 2-1 2-2zM13 3h2v2h-2V3zm8 4h2v2h-2V7zm0-4v2h2c0-1-1-2-2-2zM1 7h2v2H1V7zm16-4h2v2h-2V3zm0 16h2v2h-2v-2zM3 3C2 3 1 4 1 5h2V3zm6 0h2v2H9V3zM5 3h2v2H5V3zm-4 8v8c0 1.1.9 2 2 2h12V11H1zm2 8 2.5-3.21 1.79 2.15 2.5-3.22L13 19H3z`}),`PhotoSizeSelectLargeOutlined`),b_=q((0,l.jsx)(`path`,{d:`M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z`}),`CropOutlined`),x_=q((0,l.jsx)(`path`,{d:`M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z`}),`TextFieldsOutlined`),S_=q((0,l.jsx)(`path`,{d:`M10.5 4.5c.28 0 .5.22.5.5v2h6v6h2c.28 0 .5.22.5.5s-.22.5-.5.5h-2v6h-2.12c-.68-1.75-2.39-3-4.38-3s-3.7 1.25-4.38 3H4v-2.12c1.75-.68 3-2.39 3-4.38 0-1.99-1.24-3.7-2.99-4.38L4 7h6V5c0-.28.22-.5.5-.5m0-2C9.12 2.5 8 3.62 8 5H4c-1.1 0-1.99.9-1.99 2v3.8h.29c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-.3c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7v.3H17c1.1 0 2-.9 2-2v-4c1.38 0 2.5-1.12 2.5-2.5S20.38 11 19 11V7c0-1.1-.9-2-2-2h-4c0-1.38-1.12-2.5-2.5-2.5z`}),`ExtensionOutlined`),C_=q((0,l.jsx)(`path`,{d:`M10.25 13c0 .69-.56 1.25-1.25 1.25S7.75 13.69 7.75 13s.56-1.25 1.25-1.25 1.25.56 1.25 1.25zM15 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm7 .25c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zM10.66 4.12C12.06 6.44 14.6 8 17.5 8c.46 0 .91-.05 1.34-.12C17.44 5.56 14.9 4 12 4c-.46 0-.91.05-1.34.12zM4.42 9.47c1.71-.97 3.03-2.55 3.66-4.44C6.37 6 5.05 7.58 4.42 9.47zM20 12c0-.78-.12-1.53-.33-2.24-.7.15-1.42.24-2.17.24-3.13 0-5.92-1.44-7.76-3.69C8.69 8.87 6.6 10.88 4 11.86c.01.04 0 .09 0 .14 0 4.41 3.59 8 8 8s8-3.59 8-8z`}),`FaceOutlined`),w_=q((0,l.jsx)(`path`,{d:`M20 4h-4l-4-4-4 4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H4V6h4.52l3.52-3.5L15.52 6H20v14zM6 18h12V8H6v10zm2-8h8v6H8v-6z`}),`FilterFramesOutlined`),T_=q((0,l.jsx)(`path`,{d:`M6.41 21 5 19.59l4.83-4.83c.75-.75 1.17-1.77 1.17-2.83v-5.1L9.41 8.41 8 7l4-4 4 4-1.41 1.41L13 6.83v5.1c0 1.06.42 2.08 1.17 2.83L19 19.59 17.59 21 12 15.41 6.41 21z`}),`MergeOutlined`),E_=q((0,l.jsx)(`path`,{d:`M19 19h2v2h-2v-2zm0-2h2v-2h-2v2zM3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm0-4h2V3H3v2zm4 0h2V3H7v2zm8 16h2v-2h-2v2zm-4 0h2v-2h-2v2zm4 0h2v-2h-2v2zm-8 0h2v-2H7v2zm-4 0h2v-2H3v2zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2V8z`}),`RoundedCornerOutlined`),D_=q((0,l.jsx)(`path`,{d:`M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z`}),`PhotoLibraryOutlined`),O_=q((0,l.jsx)(`path`,{d:`M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z`}),`HistoryOutlined`),k_=q([(0,l.jsx)(`path`,{d:`m2.53 19.65 1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z`},`0`),(0,l.jsx)(`circle`,{cx:`11`,cy:`9`,r:`1`},`1`),(0,l.jsx)(`path`,{d:`M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z`},`2`)],`StyleOutlined`),A_=q((0,l.jsx)(`path`,{d:`M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z`}),`DeleteOutlined`),j_=q((0,l.jsx)(`path`,{d:`M18.85,10.39l1.06-1.06c0.78-0.78,0.78-2.05,0-2.83L18.5,5.09c-0.78-0.78-2.05-0.78-2.83,0l-1.06,1.06L18.85,10.39z M14.61,11.81L7.41,19H6v-1.41l7.19-7.19L14.61,11.81z M13.19,7.56L4,16.76V21h4.24l9.19-9.19L13.19,7.56L13.19,7.56z M19,17.5 c0,2.19-2.54,3.5-5,3.5c-0.55,0-1-0.45-1-1s0.45-1,1-1c1.54,0,3-0.73,3-1.5c0-0.47-0.48-0.87-1.23-1.2l1.48-1.48 C18.32,15.45,19,16.29,19,17.5z M4.58,13.35C3.61,12.79,3,12.06,3,11c0-1.8,1.89-2.63,3.56-3.36C7.59,7.18,9,6.56,9,6 c0-0.41-0.78-1-2-1C5.74,5,5.2,5.61,5.17,5.64C4.82,6.05,4.19,6.1,3.77,5.76C3.36,5.42,3.28,4.81,3.62,4.38C3.73,4.24,4.76,3,7,3 c2.24,0,4,1.32,4,3c0,1.87-1.93,2.72-3.64,3.47C6.42,9.88,5,10.5,5,11c0,0.31,0.43,0.6,1.07,0.86L4.58,13.35z`}),`Draw`),M_=q((0,l.jsx)(`path`,{d:`m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z`}),`HomeOutlined`),N_={[f_.FILTER]:{name:G(`Applied Filters`),icon:v_},[f_.RESIZE]:{name:G(`Resized Image`),icon:y_},[f_.CROP]:{name:G(`Cropped Image`),icon:b_},[f_.DRAW]:{name:G(`Added Drawing`),icon:j_},[f_.TEXT]:{name:G(`Added Text`),icon:x_},[f_.SHAPES]:{name:G(`Added Shape`),icon:S_},[f_.STICKERS]:{name:G(`Added Sticker`),icon:C_},[f_.FRAME]:{name:G(`Added Frame`),icon:w_},[f_.MERGE]:{name:G(`Merged Objects`),icon:T_},[f_.CORNERS]:{name:G(`Rounded Corner`),icon:E_},bgImage:{name:G(`Replaced Background Image`),icon:D_},overlayImage:{name:G(`Added Image`),icon:D_},initial:{name:G(`Initial`),icon:M_},loadedState:{name:G(`Loaded State`),icon:O_},objectStyle:{name:G(`Changed Style`),icon:k_},deletedObject:{name:G(`Deleted object`),icon:A_}},P_=Object.values(f_).map(e=>({name:e,icon:N_[e].icon,action:e===f_.MERGE?e=>{e.tools.merge.apply()}:e})),F_={filter:G(`filter`),resize:G(`resize`),crop:G(`crop`),draw:G(`draw`),text:G(`text`),shapes:G(`shapes`),stickers:G(`stickers`),frame:G(`frame`),corners:G(`corners`),merge:G(`merge`)},I_=q((0,l.jsx)(`path`,{d:`M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z`}),`FileDownloadOutlined`),L_=`3.0.5`,R_={selector:`pixie-editor`,textureSize:4096,activeLanguage:`en`,ui:{visible:!0,mode:i_.INLINE,forceOverlayModeOnMobile:!0,activeTheme:u_.LIGHT,themes:d_,allowEditorClose:!0,menubar:{items:[{type:`undoWidget`,align:`left`},{type:`zoomWidget`,align:`center`,desktopOnly:!0},{type:`button`,icon:O_,align:`right`,desktopOnly:!0,action:e=>{e.togglePanel(`history`)}},{type:`button`,icon:I_,label:G(`Done`),align:`right`,action:e=>{var t;(t=e.state.config.ui)!=null&&t.showExportPanel?e.state.togglePanel(`export`,!0):e.tools.export.save()}}]},nav:{position:a_.BOTTOM,items:[...P_]},openImageDialog:{show:!0,sampleImages:[{url:`images/samples/sample1.jpg`,thumbnail:`images/samples/sample1_thumbnail.jpg`},{url:`images/samples/sample2.jpg`,thumbnail:`images/samples/sample2_thumbnail.jpg`},{url:`images/samples/sample3.jpg`,thumbnail:`images/samples/sample3_thumbnail.jpg`}]},colorPresets:{items:[`rgb(0,0,0)`,`rgb(255, 255, 255)`,`rgb(242, 38, 19)`,`rgb(249, 105, 14)`,`rgb(253, 227, 167)`,`rgb(4, 147, 114)`,`rgb(30, 139, 195)`,`rgb(142, 68, 173)`]}},objectDefaults:{global:{...c_},sticker:{fill:void 0},text:{textAlign:`initial`,underline:!1,linethrough:!1,fontStyle:`normal`,fontFamily:`Times New Roman`,fontWeight:`normal`,stroke:void 0,fontSize:40}},tools:{filter:{items:[`grayscale`,`blackWhite`,`sharpen`,`invert`,`vintage`,`polaroid`,`kodachrome`,`technicolor`,`brownie`,`sepia`,`removeColor`,`brightness`,`gamma`,`noise`,`pixelate`,`blur`,`emboss`,`blendColor`]},zoom:{allowUserZoom:!0,fitImageToScreen:!0},crop:{allowCustomRatio:!0,defaultRatio:`1:1`,presets:[{ratio:null,name:`Custom`},{ratio:`1:1`,name:`Square`},{ratio:`4:3`},{ratio:`16:9`},{ratio:`5:3`},{ratio:`5:4`},{ratio:`6:4`},{ratio:`7:5`},{ratio:`10:8`}]},text:{defaultText:`Double click to edit`,controlsPadding:6,items:[{family:`Roboto`,src:`fonts/open-sans-v27-latin-ext_latin-regular.woff2`},{family:`Fuzzy Bubbles`,src:`fonts/fuzzy-bubbles-v3-latin-700.woff2`,descriptors:{weight:`700`}},{family:`Aleo Bold`,src:`fonts/aleo-v4-latin-ext_latin-700.woff2`,descriptors:{weight:`700`}},{family:`Amatic SC`,src:`fonts/amatic-sc-v16-latin-ext_latin-regular.woff2`},{family:`Corinthia Bold`,src:`fonts/corinthia-v7-latin-ext_latin-700.woff2`},{family:`Bungee Inline`,src:`fonts/bungee-inline-v6-latin-ext_latin-regular.woff2`},{family:`Robot Slab Bold`,src:`fonts/roboto-slab-v16-latin-ext_latin-500.woff2`},{family:`Carter One`,src:`fonts/carter-one-v12-latin-regular.woff2`},{family:`Cody Star`,src:`fonts/codystar-v10-latin-ext_latin-regular.woff2`},{family:`Fira Sans`,src:`fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2`},{family:`Krona One`,src:`fonts/krona-one-v9-latin-ext_latin-regular.woff2`},{family:`Kumar One Outline`,src:`fonts/kumar-one-outline-v8-latin-ext_latin-regular.woff2`},{family:`Lobster Two`,src:`fonts/lobster-two-v13-latin-regular.woff2`},{family:`Molle Italic`,src:`fonts/molle-v11-latin-ext_latin-italic.woff2`},{family:`Monoton`,src:`fonts/monoton-v10-latin-regular.woff2`},{family:`Nixie One`,src:`fonts/nixie-one-v11-latin-regular.woff2`},{family:`Permanent Marker`,src:`fonts/permanent-marker-v10-latin-regular.woff2`},{family:`Sancreek`,src:`fonts/sancreek-v13-latin-ext_latin-regular.woff2`},{family:`Stint Ultra Expanded`,src:`fonts/stint-ultra-expanded-v10-latin-regular.woff2`},{family:`VT323`,src:`fonts/vt323-v12-latin-ext_latin-regular.woff2`},{family:`Trash Hand`,src:`fonts/TrashHand.ttf`}]},draw:{brushSizes:l_,brushTypes:[`PencilBrush`,`EraserBrush`,`SprayBrush`,`CircleBrush`,`DiamondBrush`,`VLineBrush`,`HLineBrush`,`SquareBrush`]},shapes:{items:[{name:`circle`,type:`Circle`},{name:`square`,type:`Rect`,options:{lockUniScaling:!1}},{name:`triangle`,type:`Triangle`},{name:`ellipse`,type:`Ellipse`,options:{lockUniScaling:!1}},{name:`Arrow #1`,type:`Path`,options:{path:`M 294.9 16.4 l 15.7 42.2 c -171.4 70.3 -294 242.3 -289.1 437.4 l 14.7 -1 c 9.1 -0.6 18.1 -1.2 27.1 -1.9 l 14.7 -1 c -4.3 -170.1 102.5 -320 252 -381.3 l 15.7 42.2 c 34.7 -40.5 83.1 -76.6 144.8 -99.8 c -58.1 -26.2 -124.9 -39.6 -195.6 -36.8 z`}},{name:`Arrow #2`,type:`Path`,options:{path:`M 16 248.4 v 14.9 h 447.5 l -93.2 82.5 l 11.9 10.5 l 113.8 -100.2 l -113.6 -100.4 l -11.8 10.5 l 92.9 82.2 z`}},{name:`Arrow #3`,type:`Path`,options:{path:`M 496 256 l -118.6 -66 v 40.8 h -361.4 v 50.4 h 361.4 v 40.8 l 118.6 -66 z`}},{name:`Line`,type:`Path`,options:{path:`M 16 256 h 480`,strokeWidth:10,stroke:`#000`,padding:10}},{name:`Star`,type:`Path`,options:{path:`M 256 406.3 l 148.3 78 l -28.3 -165.2 l 120 -117 l -165.8 -24.1 l -74.2 -150.3 l -74.2 150.3 l -165.8 24.1 l 120 117 l -28.3 165.2 z`}},{name:`Polygon`,type:`Path`,options:{path:`M 256 19.6 l 156.6 57.1 l 83.4 144.3 l -28.9 164.2 l -127.7 107.2 h -166.8 l -127.7 -107.2 l -28.9 -164.2 l 83.4 -144.3 z`}},{name:`Badge`,type:`Path`,options:{path:`M 257.3 16.2 s -148 58.2 -204.4 81.4 c 0 75.7 -16.8 303.5 204.4 398.2 c 218.7 -94.6 201.9 -322.4 201.9 -398.2 c -62.1 -23.6 -201.9 -81.4 -201.9 -81.4 z`}}].slice()},stickers:{items:o_},import:{validImgExtensions:[`png`,`jpg`,`jpeg`,`svg`,`gif`],fitOverlayToScreen:!0,openDroppedImageAsBackground:!1},export:{defaultFormat:`png`,defaultQuality:.8,defaultName:`image`},frame:{items:[{name:`basic`,mode:`basic`,size:{min:1,max:35,default:10}},{name:`pine`,mode:`stretch`,size:{min:1,max:35,default:15}},{name:`oak`,mode:`stretch`,size:{min:1,max:35,default:15}},{name:`rainbow`,mode:`stretch`,size:{min:1,max:35,default:15}},{name:`grunge1`,display_name:`grunge #1`,mode:`stretch`,size:{min:1,max:35,default:15}},{name:`grunge2`,display_name:`grunge #2`,mode:`stretch`,size:{min:1,max:35,default:20}},{name:`ebony`,mode:`stretch`,size:{min:1,max:35,default:15}},{name:`art1`,display_name:`Art #1`,mode:`repeat`,size:{min:10,max:70,default:55}},{name:`art2`,display_name:`Art #2`,mode:`repeat`,size:{min:10,max:70,default:55}}]}}},z_=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},B_={exports:{}},V_={},H_={exports:{}},U_={},W_=s.default,G_=typeof Object.is==`function`?Object.is:function(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t},K_=W_.useState,q_=W_.useEffect,J_=W_.useLayoutEffect,Y_=W_.useDebugValue;function X_(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!G_(e,n)}catch{return!0}}var Z_=typeof window>`u`||typeof window.document>`u`||typeof window.document.createElement>`u`?function(e,t){return t()}:function(e,t){var n=t(),r=K_({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return J_(function(){i.value=n,i.getSnapshot=t,X_(i)&&a({inst:i})},[e,n,t]),q_(function(){return X_(i)&&a({inst:i}),e(function(){X_(i)&&a({inst:i})})},[e]),Y_(n),n};U_.useSyncExternalStore=W_.useSyncExternalStore===void 0?Z_:W_.useSyncExternalStore,H_.exports=U_;var Q_=H_.exports,$_=s.default,ev=Q_,tv=typeof Object.is==`function`?Object.is:function(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t},nv=ev.useSyncExternalStore,rv=$_.useRef,iv=$_.useEffect,av=$_.useMemo,ov=$_.useDebugValue;V_.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=rv(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=av(function(){function e(e){if(!c){if(c=!0,a=e,e=r(e),i!==void 0&&o.hasValue){var t=o.value;if(i(t,e))return s=t}return s=e}if(t=s,tv(a,e))return t;var n=r(e);return i!==void 0&&i(t,n)?t:(a=e,s=n)}var a,s,c=!1,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var s=nv(e,a[0],a[1]);return iv(function(){o.hasValue=!0,o.value=s},[s]),ov(s),s},B_.exports=V_;var sv=n_(B_.exports),{useDebugValue:cv}=s.default,{useSyncExternalStoreWithSelector:lv}=sv,uv=e=>e,dv=e=>{let t=typeof e==`function`?(e=>e?z_(e):z_)(e):e,n=(e,n)=>function(e,t=uv,n){let r=lv(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return cv(r),r}(t,e,n);return Object.assign(n,t),n},fv=e=>dv,pv=e=>(t,n,r)=>{let i=r.subscribe;return r.subscribe=(e,t,n)=>{let a=e;if(t){let i=n?.equalityFn||Object.is,o=e(r.getState());a=n=>{let r=e(n);if(!i(o,r)){let e=o;t(o=r,e)}},n!=null&&n.fireImmediately&&t(o,o)}return i(a)},e(t,n,r)},mv=Symbol.for(`immer-nothing`),hv=Symbol.for(`immer-draftable`),gv=Symbol.for(`immer-state`);function _v(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var vv=Object.getPrototypeOf;function yv(e){return!!e&&!!e[gv]}function bv(e){var t;return!!e&&(Sv(e)||Array.isArray(e)||!!e[hv]||!((t=e.constructor)==null||!t[hv])||Dv(e)||Ov(e))}var xv=Object.prototype.constructor.toString();function Sv(e){if(!e||typeof e!=`object`)return!1;let t=vv(e);if(t===null)return!0;let n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;return n===Object||typeof n==`function`&&Function.toString.call(n)===xv}function Cv(e,t){wv(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function wv(e){let t=e[gv];return t?t.type_:Array.isArray(e)?1:Dv(e)?2:Ov(e)?3:0}function Tv(e,t){return wv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ev(e,t,n){let r=wv(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Dv(e){return e instanceof Map}function Ov(e){return e instanceof Set}function kv(e){return e.copy_||e.base_}function Av(e,t){if(Dv(e))return new Map(e);if(Ov(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=Sv(e);if(!0===t||t===`class_only`&&!n){let t=Object.getOwnPropertyDescriptors(e);delete t[gv];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(vv(e),t)}{let t=vv(e);return t!==null&&n?{...e}:Object.assign(Object.create(t),e)}}function jv(e,t=!1){return Nv(e)||yv(e)||!bv(e)||(wv(e)>1&&(e.set=e.add=e.clear=e.delete=Mv),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>jv(t,!0))),e}function Mv(){_v(2)}function Nv(e){return Object.isFrozen(e)}var Pv,Fv={};function Iv(e){let t=Fv[e];return t||_v(0),t}function Lv(){return Pv}function Rv(e,t){t&&(Iv(`Patches`),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function zv(e){Bv(e),e.drafts_.forEach(Hv),e.drafts_=null}function Bv(e){e===Pv&&(Pv=e.parent_)}function Vv(e){return Pv=function(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}(Pv,e)}function Hv(e){let t=e[gv];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Uv(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[gv].modified_&&(zv(t),_v(4)),bv(e)&&(e=Wv(t,e),t.parent_||Kv(t,e)),t.patches_&&Iv(`Patches`).generateReplacementPatches_(n[gv].base_,e,t.patches_,t.inversePatches_)):e=Wv(t,n,[]),zv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===mv?void 0:e}function Wv(e,t,n){if(Nv(t))return t;let r=t[gv];if(!r)return Cv(t,(i,a)=>Gv(e,r,t,i,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Kv(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;let t=r.copy_,i=t,a=!1;r.type_===3&&(i=new Set(t),t.clear(),a=!0),Cv(i,(i,o)=>Gv(e,r,t,i,o,n,a)),Kv(e,t,!1),n&&e.patches_&&Iv(`Patches`).generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Gv(e,t,n,r,i,a,o){if(yv(i)){let o=Wv(e,i,a&&t&&t.type_!==3&&!Tv(t.assigned_,r)?a.concat(r):void 0);if(Ev(n,r,o),!yv(o))return;e.canAutoFreeze_=!1}else o&&n.add(i);if(bv(i)&&!Nv(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Wv(e,i),(!t||!t.scope_.parent_)&&typeof r!=`symbol`&&Object.prototype.propertyIsEnumerable.call(n,r)&&Kv(e,i)}}function Kv(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&jv(t,n)}var qv={get(e,t){if(t===gv)return e;let n=kv(e);if(!Tv(n,t))return function(e,t,n){let r=Xv(t,n);return r?`value`in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);let r=n[t];return e.finalized_||!bv(r)?r:r===Yv(e.base_,t)?(Qv(e),e.copy_[t]=$v(r,e)):r},has:(e,t)=>t in kv(e),ownKeys:e=>Reflect.ownKeys(kv(e)),set(e,t,n){let r=Xv(kv(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=Yv(kv(e),t),i=r?.[gv];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}(n,r)&&(n!==void 0||Tv(e.base_,t)))return!0;Qv(e),Zv(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(Yv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Qv(e),Zv(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let n=kv(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty(){_v(11)},getPrototypeOf:e=>vv(e.base_),setPrototypeOf(){_v(12)}},Jv={};function Yv(e,t){let n=e[gv];return(n?kv(n):e)[t]}function Xv(e,t){if(!(t in e))return;let n=vv(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=vv(n)}}function Zv(e){e.modified_||(e.modified_=!0,e.parent_&&Zv(e.parent_))}function Qv(e){e.copy_||=Av(e.base_,e.scope_.immer_.useStrictShallowCopy_)}Cv(qv,(e,t)=>{Jv[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Jv.deleteProperty=function(e,t){return Jv.set.call(this,e,t,void 0)},Jv.set=function(e,t,n){return qv.set.call(this,e[0],t,n,e[0])};function $v(e,t){let n=Dv(e)?Iv(`MapSet`).proxyMap_(e,t):Ov(e)?Iv(`MapSet`).proxySet_(e,t):function(e,t){let n=Array.isArray(e),r={type_:+!!n,scope_:t?t.scope_:Lv(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=r,a=qv;n&&(i=[r],a=Jv);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}(e,t);return(t?t.scope_:Lv()).drafts_.push(n),n}function ey(e){if(!bv(e)||Nv(e))return e;let t=e[gv],n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Av(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Av(e,!0);return Cv(n,(e,t)=>{Ev(n,e,ey(t))}),t&&(t.finalized_=!1),n}var ty=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if(typeof e==`function`&&typeof t!=`function`){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}let r;if(typeof t!=`function`&&_v(6),n!==void 0&&typeof n!=`function`&&_v(7),bv(e)){let i=Vv(this),a=$v(e,void 0),o=!0;try{r=t(a),o=!1}finally{o?zv(i):Bv(i)}return Rv(i,n),Uv(r,i)}if(!e||typeof e!=`object`){if(r=t(e),r===void 0&&(r=e),r===mv&&(r=void 0),this.autoFreeze_&&jv(r,!0),n){let t=[],i=[];Iv(`Patches`).generateReplacementPatches_(e,r,t,i),n(t,i)}return r}_v(1)},this.produceWithPatches=(e,t)=>{if(typeof e==`function`)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy==`boolean`&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){bv(e)||_v(8),yv(e)&&(e=function(e){return yv(e)||_v(10),ey(e)}(e));let t=Vv(this),n=$v(e,void 0);return n[gv].isManual_=!0,Bv(t),n}finishDraft(e,t){let n=e&&e[gv];(!n||!n.isManual_)&&_v(9);let{scope_:r}=n;return Rv(r,t),Uv(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Iv(`Patches`).applyPatches_;return yv(e)?r(e,t):this.produce(e,e=>r(e,t))}},ny=ty.produce;ty.produceWithPatches.bind(ty),ty.setAutoFreeze.bind(ty),ty.setUseStrictShallowCopy.bind(ty),ty.applyPatches.bind(ty),ty.createDraft.bind(ty),ty.finishDraft.bind(ty);var ry=function(e){return function(e){return!!e&&typeof e==`object`}(e)&&!function(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||function(e){return e.$$typeof===iy}(e)}(e)},iy=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function ay(e,t){return!1!==t.clone&&t.isMergeableObject(e)?uy(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function oy(e,t,n){return e.concat(t).map(function(e){return ay(e,n)})}function sy(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function cy(e,t){try{return t in e}catch{return!1}}function ly(e,t,n){var r={};return n.isMergeableObject(e)&&sy(e).forEach(function(t){r[t]=ay(e[t],n)}),sy(t).forEach(function(i){(function(e,t){return cy(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(cy(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return uy;var n=t.customMerge(e);return typeof n==`function`?n:uy}(i,n)(e[i],t[i],n):r[i]=ay(t[i],n))}),r}function uy(e,t,n){(n||={}).arrayMerge=n.arrayMerge||oy,n.isMergeableObject=n.isMergeableObject||ry,n.cloneUnlessOtherwiseSpecified=ay;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):ly(e,t,n):ay(t,n)}uy.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return uy(e,n,t)},{})};var dy=n_(uy);function fy(e,t){return py(dy(t,e),e)}function py(e,t){return Object.keys(e).forEach(n=>{if(n.startsWith(`replaceDefault`)&&e[n]){let r=function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(n.replace(`replaceDefault`,``)||`items`);e[r]=t?t[r]:[],delete e[n]}else typeof e[n]==`object`&&e[n]!==null&&py(e[n],t?.[n])}),e}var my=(e,t)=>({history:{...hy,updatePointerById:e=>{let n=t().history.items.findIndex(t=>t.id===e);t().history.update(n)},update:(t,n)=>{e(e=>{e.history.pointer=t,n&&(e.history.items=n),e.history.canUndo=e.history.pointer>0,e.history.canRedo=e.history.items.length>e.history.pointer+1})},reset:n=>{e({history:{...t().history,...n??hy}})}}}),hy={items:[],pointer:0,canUndo:!1,canRedo:!1},gy=(e=>(e.Filter=`filter`,e.Frame=`frame`,e.ActiveObject=`activeObj`,e.Text=`text`,e))(gy||{}),_y=(e,t)=>({filter:{...vy,select(t,n=!1){e(e=>{e.filter.selected=t,e.activeToolOverlay=n?gy.Filter:null,e.dirty=!0})},deselect(n){t().filter.selected===n&&e(e=>{e.filter.selected=null,e.activeToolOverlay=null,e.dirty=!0})},reset(){e({filter:{...t().filter,...vy}})}}}),vy={selected:null,applied:[]},yy=(e,t)=>({crop:{...by,setCropzoneRect:t=>{e(e=>{e.crop.zoneRect=t})},setAspectRatio:t=>{e(e=>{e.crop.selectedAspectRatio=t})},setTransformAngle:t=>{e(e=>{e.crop.straightenAngle=t})},apply:async()=>{let e=t().crop.zoneRect;if(e){let n={width:Math.ceil(e.width/t().zoom),height:Math.ceil(e.height/t().zoom),left:Math.ceil(e.left/t().zoom),top:Math.ceil(e.top/t().zoom)};await t().editor.tools.crop.apply(n)}},reset:()=>{e({crop:{...t().crop,...by}})}}}),by={zoneRect:null,selectedAspectRatio:null,straightenAngle:0};function xy(e){return e?.type===`i-text`}var Sy=(e=>(e.Text=`text`,e.Shape=`shape`,e.Sticker=`sticker`,e.Drawing=`drawing`,e.Image=`image`,e.MainImage=`mainImage`,e.StraightenAnchor=`straightenHelper`,e))(Sy||{}),Cy={text:{name:G(`Text`),icon:N_.text.icon},shape:{name:G(`Shape`),icon:N_.shapes.icon},sticker:{name:G(`Sticker`),icon:N_.stickers.icon},drawing:{name:G(`Drawing`),icon:N_.draw.icon},image:{name:G(`Image`),icon:N_.overlayImage.icon},mainImage:{name:G(`Background Image`),icon:N_.bgImage.icon}},wy={isMoving:!1,editableProps:{},id:null,isText:!1,isImage:!1,name:null},Ty=(e,t)=>({objects:{...Ey,setActiveIsMoving:t=>{e(e=>{e.objects.active.isMoving=t})},setIsEditingText:t=>{e(e=>{e.objects.isEditingText=t})},setActive:n=>{e(n?e=>{e.objects.active.editableProps=function(e){if(!e)return{};let t={fill:e.fill,opacity:e.opacity,backgroundColor:e.backgroundColor,stroke:e.stroke,strokeWidth:e.strokeWidth},n=e.shadow;return n&&(t.shadow={color:n.color,blur:n.blur,offsetX:n.offsetX,offsetY:n.offsetY}),xy(e)&&(t.textAlign=e.textAlign,t.underline=e.underline,t.linethrough=e.linethrough,t.fontStyle=e.fontStyle,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize),t}(n),e.objects.active.id=n.data.id,e.objects.active.name=n.name??null,e.objects.active.isText=xy(n),e.objects.active.isImage=function(e){return e.name===Sy.Image}(n)}:e=>{let n={...t().config.objectDefaults?.global,fontFamily:t().config.objectDefaults?.text?.fontFamily,fontSize:t().config.objectDefaults?.text?.fontSize};e.objects.active={...wy,editableProps:n}})},reset(){e({objects:{...t().objects,...Ey}})}}}),Ey={all:[],isEditingText:!1,active:wy},Dy=(e,t)=>({frame:{...Oy,select:n=>{e(e=>{e.frame.active=n}),t().frame.showOptionsPanel()},deselect:()=>{e(e=>{e.frame.active=null,e.activeToolOverlay=null})},showOptionsPanel:()=>{t().activeTool===f_.FRAME&&e(e=>{e.activeToolOverlay=gy.Frame})},reset(){e({frame:{...t().frame,...Oy}})}}}),Oy={active:null},ky=(e,t)=>({resize:{...Ay,setFormValue:t=>{e(e=>{Object.entries(t).forEach(([t,n])=>{e.resize.formValue[t]=n})})},apply(){let e=t().resize.formValue,n=t().original;if(e.width===n.width&&e.height===n.height)return!1;t().editor.tools.resize.apply(e)},reset(){e({resize:{...t().resize,...Ay}})}}}),Ay={formValue:{width:1,height:1,maintainAspect:!0,usePercentages:!1}},jy=(e,t)=>({corners:{...My,setRadius:t=>{e(e=>{e.corners.radius=t})},apply:()=>t().editor.tools.corners.apply(t().corners.radius),reset(){e({corners:{...t().corners,...My}})}}}),My={radius:50},Ny=e=>(t,n,r)=>(r.setState=(e,n,...r)=>t(typeof e==`function`?ny(e):e,n,...r),e(r.setState,n,r)),Py={exports:{}},Fy={exports:{}},Iy=function(e){return!(!e||typeof e==`string`)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!==`String`))},Ly=Array.prototype.concat,Ry=Array.prototype.slice,zy=Fy.exports=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];Iy(i)?t=Ly.call(t,Ry.call(i)):t.push(i)}return t};zy.wrap=function(e){return function(){return e(zy(arguments))}};var By=Fy.exports,Vy={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Hy=By,Uy=Object.hasOwnProperty,Wy=Object.create(null);for(var Gy in Vy)Uy.call(Vy,Gy)&&(Wy[Vy[Gy]]=Gy);var Ky=Py.exports={to:{},get:{}};function qy(e,t,n){return Math.min(Math.max(t,e),n)}function Jy(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?`0`+t:t}Ky.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case`hsl`:t=Ky.get.hsl(e),n=`hsl`;break;case`hwb`:t=Ky.get.hwb(e),n=`hwb`;break;default:t=Ky.get.rgb(e),n=`rgb`}return t?{model:n,value:t}:null},Ky.get.rgb=function(e){if(!e)return null;var t,n,r,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=t[2],t=t[1],n=0;n<3;n++){var a=2*n;i[n]=parseInt(t.slice(a,a+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(r=(t=t[1])[3],n=0;n<3;n++)i[n]=parseInt(t[n]+t[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(t[n+1],0);t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?t[1]===`transparent`?[0,0,0,0]:Uy.call(Vy,t[1])?((i=Vy[t[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}for(n=0;n<3;n++)i[n]=qy(i[n],0,255);return i[3]=qy(i[3],0,1),i},Ky.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,qy(parseFloat(t[2]),0,100),qy(parseFloat(t[3]),0,100),qy(isNaN(n)?1:n,0,1)]}return null},Ky.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,qy(parseFloat(t[2]),0,100),qy(parseFloat(t[3]),0,100),qy(isNaN(n)?1:n,0,1)]}return null},Ky.to.hex=function(){var e=Hy(arguments);return`#`+Jy(e[0])+Jy(e[1])+Jy(e[2])+(e[3]<1?Jy(Math.round(255*e[3])):``)},Ky.to.rgb=function(){var e=Hy(arguments);return e.length<4||e[3]===1?`rgb(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`)`:`rgba(`+Math.round(e[0])+`, `+Math.round(e[1])+`, `+Math.round(e[2])+`, `+e[3]+`)`},Ky.to.rgb.percent=function(){var e=Hy(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?`rgb(`+t+`%, `+n+`%, `+r+`%)`:`rgba(`+t+`%, `+n+`%, `+r+`%, `+e[3]+`)`},Ky.to.hsl=function(){var e=Hy(arguments);return e.length<4||e[3]===1?`hsl(`+e[0]+`, `+e[1]+`%, `+e[2]+`%)`:`hsla(`+e[0]+`, `+e[1]+`%, `+e[2]+`%, `+e[3]+`)`},Ky.to.hwb=function(){var e=Hy(arguments),t=``;return e.length>=4&&e[3]!==1&&(t=`, `+e[3]),`hwb(`+e[0]+`, `+e[1]+`%, `+e[2]+`%`+t+`)`},Ky.to.keyword=function(e){return Wy[e.slice(0,3)]};var Yy=Py.exports,Xy={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Zy={};for(let e of Object.keys(Xy))Zy[Xy[e]]=e;var J={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}},Qy=J;for(let e of Object.keys(J)){if(!(`channels`in J[e]))throw Error(`missing channels property: `+e);if(!(`labels`in J[e]))throw Error(`missing channel labels property: `+e);if(J[e].labels.length!==J[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=J[e];delete J[e].channels,delete J[e].labels,Object.defineProperty(J[e],"channels",{value:t}),Object.defineProperty(J[e],"labels",{value:n})}function $y(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}J.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(60*s,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,100*c,100*l]},J.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+.5};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[360*i,100*a,100*l]},J.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],i=J.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*a,100*r]},J.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},J.rgb.keyword=function(e){let t=Zy[e];if(t)return t;let n,r=1/0;for(let t of Object.keys(Xy)){let i=$y(e,Xy[t]);i<r&&(r=i,n=t)}return n},J.keyword.rgb=function(e){return Xy[e]},J.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},J.rgb.lab=function(e){let t=J.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},J.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=255*r,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+6*(i-s)*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=255*o;return c},J.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);return r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a,[t,100*(r===0?2*i/(a+i):2*n/(r+n)),100*((r+n)/2)]},J.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},J.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,100*a,100*o]},J.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,1&o&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c}return[255*l,255*u,255*d]},J.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},J.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=3.2406*t+-1.5372*n+-.4986*r,a=-.9689*t+1.8758*n+.0415*r,o=.0557*t+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[255*i,255*a,255*o]},J.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},J.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;let i=n**3,a=t**3,o=r**3;return n=i>.008856?i:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},J.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},J.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},J.rgb.ansi16=function(e,t=null){let[n,r,i]=e,a=t===null?J.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(o+=60),o},J.hsv.ansi16=function(e){return J.rgb.ansi16(J.hsv.rgb(e),e[2])},J.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},J.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},J.ansi256.rgb=function(e){if(e>=232){let t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},J.rgb.hex=function(e){let t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return`000000`.substring(t.length)+t},J.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},J.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[360*c,100*o,100*s]},J.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},J.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},J.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[255*r,255*r,255*r];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[255*(n*i[0]+c),255*(n*i[1]+c),255*(n*i[2]+c)]},J.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},J.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},J.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},J.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},J.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},J.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},J.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},J.gray.hsl=function(e){return[0,0,e[0]]},J.gray.hsv=J.gray.hsl,J.gray.hwb=function(e){return[0,100,e[0]]},J.gray.cmyk=function(e){return[0,0,0,e[0]]},J.gray.lab=function(e){return[e[0],0,0]},J.gray.hex=function(e){let t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},J.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var eb=Qy;function tb(e){let t=function(){let e={},t=Object.keys(eb);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){let e=n.pop(),r=Object.keys(eb[e]);for(let i=r.length,a=0;a<i;a++){let i=r[a],o=t[i];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,n.unshift(i))}}return t}function nb(e,t){return function(n){return t(e(n))}}function rb(e,t){let n=[t[e].parent,e],r=eb[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=nb(eb[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}var ib=Qy,ab=function(e){let t=tb(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=rb(e,t))}return n},ob={};Object.keys(ib).forEach(e=>{ob[e]={},Object.defineProperty(ob[e],"channels",{value:ib[e].channels}),Object.defineProperty(ob[e],"labels",{value:ib[e].labels});let t=ab(e);Object.keys(t).forEach(n=>{let r=t[n];ob[e][n]=function(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}(r),ob[e][n].raw=function(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}(r)})});var sb=Yy,cb=ob,lb=[`keyword`,`gray`,`hex`],ub={};for(let e of Object.keys(cb))ub[[...cb[e].labels].sort().join(``)]=e;var db={};function fb(e,t){if(!(this instanceof fb))return new fb(e,t);if(t&&t in lb&&(t=null),t&&!(t in cb))throw Error(`Unknown model: `+t);let n,r;if(e==null)this.model=`rgb`,this.color=[0,0,0],this.valpha=1;else if(e instanceof fb)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==`string`){let t=sb.get(e);if(t===null)throw Error(`Unable to parse color from string: `+e);this.model=t.model,r=cb[this.model].channels,this.color=t.value.slice(0,r),this.valpha=typeof t.value[r]==`number`?t.value[r]:1}else if(e.length>0){this.model=t||`rgb`,r=cb[this.model].channels;let n=Array.prototype.slice.call(e,0,r);this.color=_b(n,r),this.valpha=typeof e[r]==`number`?e[r]:1}else if(typeof e==`number`)this.model=`rgb`,this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;let t=Object.keys(e);`alpha`in e&&(t.splice(t.indexOf(`alpha`),1),this.valpha=typeof e.alpha==`number`?e.alpha:0);let r=t.sort().join(``);if(!(r in ub))throw Error(`Unable to parse color from object: `+JSON.stringify(e));this.model=ub[r];let{labels:i}=cb[this.model],a=[];for(n=0;n<i.length;n++)a.push(e[i[n]]);this.color=_b(a)}if(db[this.model])for(r=cb[this.model].channels,n=0;n<r;n++){let e=db[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}fb.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in sb.to?this:this.rgb();t=t.round(typeof e==`number`?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return sb.to[t.model](n)},percentString(e){let t=this.rgb().round(typeof e==`number`?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return sb.to.rgb.percent(n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=cb[this.model],{labels:n}=cb[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new fb([...this.color.map(pb(e)),this.valpha],this.model)},alpha(e){return e===void 0?this.valpha:new fb([...this.color,Math.max(0,Math.min(1,e))],this.model)},red:mb(`rgb`,0,hb(255)),green:mb(`rgb`,1,hb(255)),blue:mb(`rgb`,2,hb(255)),hue:mb([`hsl`,`hsv`,`hsl`,`hwb`,`hcg`],0,e=>(e%360+360)%360),saturationl:mb(`hsl`,1,hb(100)),lightness:mb(`hsl`,2,hb(100)),saturationv:mb(`hsv`,1,hb(100)),value:mb(`hsv`,2,hb(100)),chroma:mb(`hcg`,1,hb(100)),gray:mb(`hcg`,2,hb(100)),white:mb(`hwb`,1,hb(100)),wblack:mb(`hwb`,2,hb(100)),cyan:mb(`cmyk`,0,hb(100)),magenta:mb(`cmyk`,1,hb(100)),yellow:mb(`cmyk`,2,hb(100)),black:mb(`cmyk`,3,hb(100)),x:mb(`xyz`,0,hb(95.047)),y:mb(`xyz`,1,hb(100)),z:mb(`xyz`,2,hb(108.833)),l:mb(`lab`,0,hb(100)),a:mb(`lab`,1),b:mb(`lab`,2),keyword(e){return e===void 0?cb[this.model].keyword(this.color):new fb(e)},hex(e){return e===void 0?sb.to.hex(this.rgb().round().color):new fb(e)},hexa(e){if(e!==void 0)return new fb(e);let t=this.rgb().round().color,n=Math.round(255*this.valpha).toString(16).toUpperCase();return n.length===1&&(n=`0`+n),sb.to.hex(t)+n},rgbNumber(){let e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){let e=this.rgb().color,t=[];for(let[n,r]of e.entries()){let e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?`AAA`:t>=4.5?`AA`:``},isDark(){let e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return fb.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw Error(`Argument to "mix" was not a Color instance, but rather an instance of `+typeof e);let n=e.rgb(),r=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,c=1-s;return fb.rgb(s*n.red()+c*r.red(),s*n.green()+c*r.green(),s*n.blue()+c*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(let e of Object.keys(cb)){if(lb.includes(e))continue;let{channels:t}=cb[e];fb.prototype[e]=function(...t){return this.model===e?new fb(this):t.length>0?new fb(t,e):new fb([...gb(cb[this.model][e].raw(this.color)),this.valpha],e)},fb[e]=function(...n){let r=n[0];return typeof r==`number`&&(r=_b(n,t)),new fb(r,e)}}function pb(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function mb(e,t,n){e=Array.isArray(e)?e:[e];for(let r of e)(db[r]||(db[r]=[]))[t]=n;return e=e[0],function(r){let i;return r===void 0?(i=this[e]().color[t],n&&(i=n(i)),i):(n&&(r=n(r)),i=this[e](),i.color[t]=r,i)}}function hb(e){return function(t){return Math.max(0,Math.min(e,t))}}function gb(e){return Array.isArray(e)?e:[e]}function _b(e,t){for(let n=0;n<t;n++)typeof e[n]!=`number`&&(e[n]=0);return e}var vb=n_(fb);function yb(e){return e.endsWith(`%`)||e.split(` `).length===3?e:vb(e).rgb().array().slice(0,3).join(` `)}var bb=typeof document<`u`?document.getElementById(`root`)??document.body:void 0,xb=typeof document<`u`?document.documentElement:void 0;function Sb(e){Object.entries(e.values).forEach(([e,t])=>{(function(e,t){xb?.style.setProperty(e,t)})(e,t)}),e.is_dark?xb.classList.add(`dark`):xb.classList.remove(`dark`)}var Cb=fv()(e=>({data:typeof window<`u`&&window.bootstrapData?Tb(window.bootstrapData):null,setData:t=>{e({data:typeof t==`string`?Tb(t):t})},mergeData:t=>{e(e=>({data:{...e.data,...t}}))}}));Cb.getState().setData;var wb=Cb.getState().mergeData;function Tb(e){return typeof e==`string`?JSON.parse(e):e}var Eb={top:0,right:0,bottom:0,left:0,width:0,height:0},Y=fv()(pv(Ny((e,t)=>({editor:null,fabric:null,config:R_,zoom:1,dirty:!1,original:{width:1,height:1},stageSize:Eb,canvasSize:Eb,canvasRef:null,activeTool:null,activeToolOverlay:null,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1},...my(e,t),...Ty(e,t),..._y(e,t),...yy(e,t),...Dy(e,t),...ky(e,t),...jy(e,t),setZoom:t=>e(e=>{e.zoom=t}),setOriginal:(t,n)=>e(e=>{e.original={width:t,height:n}}),setDirty:t=>e(e=>{e.dirty=t}),toggleLoading:t=>e(e=>{e.loading=t}),setStageSize:t=>e(e=>{e.stageSize=t}),setCanvasSize:t=>e(e=>{e.canvasSize=t}),setActiveTool:(t,n)=>{e(e=>{e.activeTool=t,e.activeToolOverlay=n})},setConfig:n=>e(e=>{let r=fy(n,t().config);e.config=r;let i=r.activeLanguage||`en`,a=r.languages?.[i],o=(r.ui?.themes||[]).map(e=>function(e){let t=e.isDark?d_.find(e=>e.isDark):d_.find(e=>!e.isDark),n={...t,...e,colors:{...t?.colors,...e.colors}},r=Object.entries(n.colors).map(([e,t])=>[e,yb(t)]);return{id:n.name,name:n.name,values:Object.fromEntries(r),is_dark:n.isDark}}(e)),s=o.find(e=>e.id===r.ui?.activeTheme);s&&Sb(s),wb({i18n:{language:i,name:i,id:0,lines:a},themes:{all:o}})}),togglePanel:(t,n)=>e(e=>{e.openPanels[t]=n??!e.openPanels[t]}),applyChanges:async()=>{let n=t().activeTool;if(!n)return;let r=t()[n],i=await(r?.apply)?.call(r);e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),!1!==i&&t().editor.tools.history.addHistoryItem({name:n}),r?.reset()},cancelChanges:async()=>{let n=t().activeTool;if(!n)return;let r=t().dirty;e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),r&&await t().editor.tools.history.reload(),t()[n]?.reset()},reset:()=>{t().editor.tools.transform.resetStraightenAnchor(),e({activeTool:null,activeToolOverlay:null,zoom:1,dirty:!1,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1}}),t().history.reset(),t().objects.reset(),t().filter.reset(),t().crop.reset(),t().frame.reset(),t().resize.reset(),t().corners.reset()}}))));function X(){return Y.getState()}function Z(){return X().editor.tools}function Q(){return X().fabric}function Db(e){var t,n,r,i;Z().canvas.clear(),Z().frame.remove();let a=!((t=X().config.ui)!=null&&t.visible);return X().setConfig({image:void 0,blankCanvasSize:void 0,...e}),X().reset(),(n=X().config.ui)!=null&&n.defaultTool&&X().setActiveTool(X().config.ui?.defaultTool,null),a&&((i=(r=X().config).onOpen)==null||i.call(r)),new Promise(e=>setTimeout(e))}async function Ob(e){return(await fetch(e)).json()}var kb={selectable:!1,evented:!1,lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0,hasControls:!1,hasBorders:!1,hasRotatingPoint:!1,strokeWidth:0};function Ab(e=[]){e=[...Object.keys(kb),`crossOrigin`,`name`,`displayName`,`data`,...e];let t=Q().toJSON(e);return t.objects=t.objects.filter(e=>!e.data.pixieInternal).map(e=>(e.type===`image`&&X().config.crossOrigin&&(e.crossOrigin=`anonymous`),xy(e)&&(e.selectable=!0,e.lockMovementX=!1,e.lockMovementY=!1,e.lockUniScaling=!1),{...e,data:e.data?{...e.data}:{}})),{canvas:t,editor:{frame:Z().frame.active.config?{name:Z().frame.active.config.name,sizePercent:Z().frame.active.currentSizeInPercent}:null,zoom:X().zoom,activeObjectId:X().objects.active?.id||null},canvasWidth:X().original.width,canvasHeight:X().original.height}}function jb(e=null){if(X().dirty)return;Z().zoom.fitToScreen();let[t,n]=Mb(Q().getActiveObject());e?X().setActiveTool(e,t===e?n:null):X().setActiveTool(t,n)}function Mb(e){switch(e?.name){case Sy.Text:return[f_.TEXT,gy.Text];case Sy.Sticker:return[f_.STICKERS,gy.ActiveObject];case Sy.Image:return[null,gy.ActiveObject];case Sy.Shape:return[f_.SHAPES,gy.ActiveObject];default:return[null,null]}}var Nb=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[63&n[e]];return t},Pb=class{constructor(e,t){kf(this,`timerId`),kf(this,`createdAt`,0),this.callback=e,this.remaining=t,this.resume()}pause(){clearTimeout(this.timerId),this.remaining-=Date.now()-this.createdAt}resume(){this.createdAt=Date.now(),this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remaining)}clear(){clearTimeout(this.timerId)}},Fb=fv()(Ny((e,t)=>({toasts:[],add:(n,r)=>{let i=t().toasts.length+1-1;i>0&&e(e=>{e.toasts.splice(0,i)});let a=r?.id||Nb(6),o=r?.type||`positive`,s=r?.duration??function(e){switch(e){case`danger`:return 8e3;case`loading`:return 0;default:return 3e3}}(o),c={timer:s>0?new Pb(()=>t().remove(a),s):null,message:n,...r,id:a,type:o,position:r?.position||`bottom-center`,duration:s,disableExitAnimation:r?.disableExitAnimation,disableEnterAnimation:r?.disableEnterAnimation},l=t().toasts.findIndex(e=>e.id===c.id);e(l>-1?e=>{e.toasts[l]=c}:e=>{e.toasts.push(c)})},remove:n=>{let r=t().toasts.filter(e=>{var t;return n!==e.id||((t=e.timer)==null||t.clear(),!1)});e(e=>{e.toasts=r})}})));function Ib(){return Fb.getState()}function Lb(e,t){Ib().add(e,t)}Lb.danger=(e,t)=>{Ib().add(e,{...t,type:`danger`})},Lb.positive=(e,t)=>{Ib().add(e,{...t,type:`positive`})},Lb.loading=(e,t)=>{Ib().add(e,{...t,type:`loading`})};var Rb=(0,s.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`}),zb=(0,s.createContext)({}),Bb=(0,s.createContext)(null),Vb=typeof document<`u`,Hb=Vb?s.useLayoutEffect:s.useEffect,Ub=(0,s.createContext)({strict:!1}),Wb=e=>e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase(),Gb=`data-`+Wb(`framerAppearId`);function Kb(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function qb(e){return typeof e==`string`||Array.isArray(e)}function Jb(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}var Yb=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Xb=[`initial`,...Yb];function Zb(e){return Jb(e.animate)||Xb.some(t=>qb(e[t]))}function Qb(e){return!(!Zb(e)&&!e.variants)}function $b(e){let{initial:t,animate:n}=function(e,t){if(Zb(e)){let{initial:t,animate:n}=e;return{initial:!1===t||qb(t)?t:void 0,animate:qb(n)?n:void 0}}return!1===e.inherit?{}:t}(e,(0,s.useContext)(zb));return(0,s.useMemo)(()=>({initial:t,animate:n}),[ex(t),ex(n)])}function ex(e){return Array.isArray(e)?e.join(` `):e}var tx={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},nx={};for(let e in tx)nx[e]={isEnabled:t=>tx[e].some(e=>!!t[e])};function rx(e){for(let t in e)nx[t]={...nx[t],...e[t]}}var ix=(0,s.createContext)({}),ax=(0,s.createContext)({}),ox=Symbol.for(`motionComponentSymbol`);function sx({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&rx(e);let a=(0,s.forwardRef)(function(a,o){let c,l={...(0,s.useContext)(Rb),...a,layoutId:cx(a)},{isStatic:u}=l,d=$b(a),f=r(a,u);if(!u&&Vb){d.visualElement=function(e,t,n,r){let{visualElement:i}=(0,s.useContext)(zb),a=(0,s.useContext)(Ub),o=(0,s.useContext)(Bb),c=(0,s.useContext)(Rb).reducedMotion,l=(0,s.useRef)();r||=a.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:o,blockInitialAnimation:!!o&&!1===o.initial,reducedMotionConfig:c}));let u=l.current;(0,s.useInsertionEffect)(()=>{u&&u.update(n,o)});let d=(0,s.useRef)(!(!n[Gb]||window.HandoffComplete));return Hb(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,s.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,f,l,t);let n=(0,s.useContext)(ax),r=(0,s.useContext)(Ub).strict;d.visualElement&&(c=d.visualElement.loadFeatures(l,r,e,n))}return s.createElement(zb.Provider,{value:d},c&&d.visualElement?s.createElement(c,{visualElement:d.visualElement,...l}):null,n(i,a,function(e,t,n){return(0,s.useCallback)(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):Kb(n)&&(n.current=r))},[t])}(f,d.visualElement,o),f,u,d.visualElement))});return a[ox]=i,a}function cx({layoutId:e}){let t=(0,s.useContext)(ix).id;return t&&e!==void 0?t+`-`+e:e}var lx=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function ux(e){return typeof e==`string`&&!e.includes(`-`)&&!!(lx.indexOf(e)>-1||/[A-Z]/.test(e))}var dx={},fx=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],px=new Set(fx);function mx(e,{layout:t,layoutId:n}){return px.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!dx[e]||e===`opacity`)}var hx=e=>!(!e||!e.getVelocity),gx={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},_x=fx.length,vx=e=>t=>typeof t==`string`&&t.startsWith(e),yx=vx(`--`),bx=vx(`var(--`),xx=(e,t)=>t&&typeof e==`number`?t.transform(e):e,Sx=(e,t,n)=>Math.min(Math.max(n,e),t),Cx={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},wx={...Cx,transform:e=>Sx(0,1,e)},Tx={...Cx,default:1},Ex=e=>Math.round(1e5*e)/1e5,Dx=/(-)?([\d]*\.?[\d])+/g,Ox=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,kx=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Ax(e){return typeof e==`string`}var jx=e=>({test:t=>Ax(t)&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Mx=jx(`deg`),Nx=jx(`%`),Px=jx(`px`),Fx=jx(`vh`),Ix=jx(`vw`),Lx={...Nx,parse:e=>Nx.parse(e)/100,transform:e=>Nx.transform(100*e)},Rx={...Cx,transform:Math.round},zx={borderWidth:Px,borderTopWidth:Px,borderRightWidth:Px,borderBottomWidth:Px,borderLeftWidth:Px,borderRadius:Px,radius:Px,borderTopLeftRadius:Px,borderTopRightRadius:Px,borderBottomRightRadius:Px,borderBottomLeftRadius:Px,width:Px,maxWidth:Px,height:Px,maxHeight:Px,size:Px,top:Px,right:Px,bottom:Px,left:Px,padding:Px,paddingTop:Px,paddingRight:Px,paddingBottom:Px,paddingLeft:Px,margin:Px,marginTop:Px,marginRight:Px,marginBottom:Px,marginLeft:Px,rotate:Mx,rotateX:Mx,rotateY:Mx,rotateZ:Mx,scale:Tx,scaleX:Tx,scaleY:Tx,scaleZ:Tx,skew:Mx,skewX:Mx,skewY:Mx,distance:Px,translateX:Px,translateY:Px,translateZ:Px,x:Px,y:Px,z:Px,perspective:Px,transformPerspective:Px,opacity:wx,originX:Lx,originY:Lx,originZ:Px,zIndex:Rx,fillOpacity:wx,strokeOpacity:wx,numOctaves:Rx};function Bx(e,t,n,r){let{style:i,vars:a,transform:o,transformOrigin:s}=e,c=!1,l=!1,u=!0;for(let e in t){let n=t[e];if(yx(e)){a[e]=n;continue}let r=zx[e],d=xx(n,r);if(px.has(e)){if(c=!0,o[e]=d,!u)continue;n!==(r.default||0)&&(u=!1)}else e.startsWith(`origin`)?(l=!0,s[e]=d):i[e]=d}if(t.transform||(c||r?i.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let a=``;for(let t=0;t<_x;t++){let n=fx[t];e[n]!==void 0&&(a+=`${gx[n]||n}(${e[n]}) `)}return t&&!e.z&&(a+=`translateZ(0)`),a=a.trim(),i?a=i(e,r?``:a):n&&r&&(a=`none`),a}(e.transform,n,u,r):i.transform&&=`none`),l){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=s;i.transformOrigin=`${e} ${t} ${n}`}}var Vx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hx(e,t,n){for(let r in t)!hx(t[r])&&!mx(r,n)&&(e[r]=t[r])}function Ux(e,t,n){let r={};return Hx(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return(0,s.useMemo)(()=>{let r={style:{},transform:{},transformOrigin:{},vars:{}};return Bx(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}function Wx(e,t,n){let r={},i=Ux(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout=`none`,i.touchAction=!0===e.drag?`none`:`pan-`+(e.drag===`x`?`y`:`x`)),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}var Gx=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.transformValues.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.ignoreStrict.viewport`.split(`.`));function Kx(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Gx.has(e)}var qx=e=>!Kx(e);try{(function(e){e&&(qx=t=>t.startsWith(`on`)?!Kx(t):e(t))})((Ti(),r.c(Si)).default)}catch{}function Jx(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||(qx(i)||!0===n&&Kx(i)||!t&&!Kx(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}function Yx(e,t,n){return typeof e==`string`?e:Px.transform(t+n*e)}var Xx={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Zx={offset:`strokeDashoffset`,array:`strokeDasharray`};function Qx(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:c=0,...l},u,d,f){if(Bx(e,l,u,f),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};let{attrs:p,style:m,dimensions:h}=e;p.transform&&(h&&(m.transform=p.transform),delete p.transform),h&&(i!==void 0||a!==void 0||m.transform)&&(m.transformOrigin=function(e,t,n){return`${Yx(t,e.x,e.width)} ${Yx(n,e.y,e.height)}`}(h,i===void 0?.5:i,a===void 0?.5:a)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&function(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Xx:Zx;e[a.offset]=Px.transform(-r);let o=Px.transform(t),s=Px.transform(n);e[a.array]=`${o} ${s}`}(p,o,s,c,!1)}var $x=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),eS=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function tS(e,t,n,r){let i=(0,s.useMemo)(()=>{let n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Qx(n,t,{enableHardwareAcceleration:!1},eS(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Hx(t,e.style,e),i.style={...t,...i.style}}return i}function nS(e=!1){return(t,n,r,{latestValues:i},a)=>{let o=(ux(t)?tS:Wx)(n,i,a,t),c={...Jx(n,typeof t==`string`,e),...o,ref:r},{children:l}=n,u=(0,s.useMemo)(()=>hx(l)?l.get():l,[l]);return(0,s.createElement)(t,{...c,children:u})}}function rS(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(let t in n)e.style.setProperty(t,n[t])}var iS=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]);function aS(e,t,n,r){rS(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(iS.has(n)?n:Wb(n),t.attrs[n])}function oS(e,t){let{style:n}=e,r={};for(let i in n)(hx(n[i])||t.style&&hx(t.style[i])||mx(i,e))&&(r[i]=n[i]);return r}function sS(e,t){let n=oS(e,t);for(let r in e)(hx(e[r])||hx(t[r]))&&(n[fx.indexOf(r)===-1?r:`attr`+r.charAt(0).toUpperCase()+r.substring(1)]=e[r]);return n}function cS(e,t,n,r={},i={}){return typeof t==`function`&&(t=t(n===void 0?e.custom:n,r,i)),typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`&&(t=t(n===void 0?e.custom:n,r,i)),t}function lS(e){let t=(0,s.useRef)(null);return t.current===null&&(t.current=e()),t.current}var uS=e=>Array.isArray(e),dS=e=>uS(e)?e[e.length-1]||0:e;function fS(e){let t=hx(e)?e.get():e;return(e=>!!(e&&typeof e==`object`&&e.mix&&e.toValue))(t)?t.toValue():t}var pS=e=>(t,n)=>{let r=(0,s.useContext)(zb),i=(0,s.useContext)(Bb),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,a){let o={latestValues:mS(r,i,a,e),renderState:t()};return n&&(o.mount=e=>n(r,e,o)),o}(e,t,r,i);return n?a():lS(a)};function mS(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=fS(a[e]);let{initial:o,animate:s}=e,c=Zb(e),l=Qb(e);t&&l&&!c&&!1!==e.inherit&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=!!n&&!1===n.initial;u||=!1===o;let d=u?s:o;return d&&typeof d!=`boolean`&&!Jb(d)&&(Array.isArray(d)?d:[d]).forEach(t=>{let n=cS(e,t);if(!n)return;let{transitionEnd:r,transition:a,...o}=n;for(let e in o){let t=o[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),t!==null&&(i[e]=t)}for(let e in r)i[e]=r[e]}),i}var hS=e=>e,gS=class{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){let t=this.order.indexOf(e);t!==-1&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}},_S=[`prepare`,`read`,`update`,`preRender`,`render`,`postRender`],{schedule:vS,cancel:yS,state:bS}=function(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=_S.reduce((e,t)=>(e[t]=function(e){let t=new gS,n=new gS,r=0,i=!1,a=!1,o=new WeakSet,s={schedule:(e,a=!1,s=!1)=>{let c=s&&i,l=c?t:n;return a&&o.add(e),l.add(e)&&c&&i&&(r=t.order.length),e},cancel:e=>{n.remove(e),o.delete(e)},process:c=>{if(i)a=!0;else{if(i=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;n<r;n++){let r=t.order[n];r(c),o.has(r)&&(s.schedule(r),e())}i=!1,a&&(a=!1,s.process(c))}}};return s}(()=>n=!0),e),{}),o=e=>a[e].process(i),s=()=>{let a=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(a-i.timestamp,40),1),i.timestamp=a,i.isProcessing=!0,_S.forEach(o),i.isProcessing=!1,n&&t&&(r=!1,e(s))};return{schedule:_S.reduce((t,o)=>{let c=a[o];return t[o]=(t,a=!1,o=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(s)),c.schedule(t,a,o)),t},{}),cancel:e=>_S.forEach(t=>a[t].cancel(e)),state:i,steps:a}}(typeof requestAnimationFrame<`u`?requestAnimationFrame:hS,!0),xS={useVisualState:pS({scrapeMotionValuesFromProps:sS,createRenderState:$x,onMount:(e,t,{renderState:n,latestValues:r})=>{vS.read(()=>{try{n.dimensions=typeof t.getBBox==`function`?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),vS.render(()=>{Qx(n,r,{enableHardwareAcceleration:!1},eS(t.tagName),e.transformTemplate),aS(t,n)})}})},SS={useVisualState:pS({scrapeMotionValuesFromProps:oS,createRenderState:Vx})};function CS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function wS(e,t=`page`){return{point:{x:e[t+`X`],y:e[t+`Y`]}}}function TS(e,t,n,r){return CS(e,t,(e=>t=>(e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:!1!==e.isPrimary)(t)&&e(t,wS(t)))(n),r)}var ES=(e,t)=>n=>t(e(n)),DS=(...e)=>e.reduce(ES);function OS(e){let t=null;return()=>t===null&&(t=e,()=>{t=null})}var kS=OS(`dragHorizontal`),AS=OS(`dragVertical`);function jS(){let e=function(){let e=!1;{let t=kS(),n=AS();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}();return!e||(e(),!1)}var MS=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function NS(e,t){let n=`pointer`+(t?`enter`:`leave`),r=`onHover`+(t?`Start`:`End`);return TS(e.current,n,(n,i)=>{if(n.pointerType===`touch`||jS())return;let a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive(`whileHover`,t),a[r]&&vS.update(()=>a[r](n,i))},{passive:!e.getProps()[r]})}var PS=(e,t)=>!!t&&(e===t||PS(e,t.parentElement));function FS(e,t){if(!t)return;let n=new PointerEvent(`pointer`+e);t(n,wS(n))}var IS=new WeakMap,LS=new WeakMap,RS=e=>{let t=IS.get(e.target);t&&t(e)},zS=e=>{e.forEach(RS)};function BS(e,t,n){let r=function({root:e,...t}){let n=e||document;LS.has(n)||LS.set(n,{});let r=LS.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(zS,{root:e,...t})),r[i]}(t);return IS.set(e,n),r.observe(e),()=>{IS.delete(e),r.unobserve(e)}}var VS={some:0,all:1},HS={inView:{Feature:class extends MS{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:VS[r]};return BS(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends MS{constructor(){super(...arguments),this.removeStartListeners=hS,this.removeEndListeners=hS,this.removeAccessibleListeners=hS,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();let n=this.node.getProps(),r=TS(window,`pointerup`,(e,t)=>{if(!this.checkPressEnd())return;let{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps();vS.update(()=>{i||PS(this.node.current,e.target)?n&&n(e,t):r&&r(e,t)})},{passive:!(n.onTap||n.onPointerUp)}),i=TS(window,`pointercancel`,(e,t)=>this.cancelPress(e,t),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=DS(r,i),this.startPress(e,t)},this.startAccessiblePress=()=>{let e=CS(this.node.current,`keydown`,e=>{e.key!==`Enter`||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=CS(this.node.current,`keyup`,e=>{e.key!==`Enter`||!this.checkPressEnd()||FS(`up`,(e,t)=>{let{onTap:n}=this.node.getProps();n&&vS.update(()=>n(e,t))})}),FS(`down`,(e,t)=>{this.startPress(e,t)}))}),t=CS(this.node.current,`blur`,()=>{this.isPressing&&FS(`cancel`,(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=DS(e,t)}}startPress(e,t){this.isPressing=!0;let{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive(`whileTap`,!0),n&&vS.update(()=>n(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive(`whileTap`,!1),!jS()}cancelPress(e,t){if(!this.checkPressEnd())return;let{onTapCancel:n}=this.node.getProps();n&&vS.update(()=>n(e,t))}mount(){let e=this.node.getProps(),t=TS(e.globalTapTarget?window:this.node.current,`pointerdown`,this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=CS(this.node.current,`focus`,this.startAccessiblePress);this.removeStartListeners=DS(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends MS{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=DS(CS(this.node.current,`focus`,()=>this.onFocus()),CS(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends MS{mount(){this.unmount=DS(NS(this.node,!0),NS(this.node,!1))}unmount(){}}}};function US(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function WS(e,t,n){let r=e.getProps();return cS(r,t,n===void 0?r.custom:n,function(e){let t={};return e.values.forEach((e,n)=>t[n]=e.get()),t}(e),function(e){let t={};return e.values.forEach((e,n)=>t[n]=e.getVelocity()),t}(e))}var GS=hS,KS=e=>1e3*e,qS=e=>e/1e3,JS=e=>Array.isArray(e)&&typeof e[0]==`number`;function YS(e){return!!(!e||typeof e==`string`&&ZS[e]||JS(e)||Array.isArray(e)&&e.every(YS))}var XS=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ZS={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:XS([0,.65,.55,1]),circOut:XS([.55,0,1,.45]),backIn:XS([.31,.01,.66,-.59]),backOut:XS([.33,1.53,.69,.99])};function QS(e){if(e)return JS(e)?XS(e):Array.isArray(e)?e.map(QS):ZS[e]}var $S=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function eC(e,t,n,r){if(e===t&&n===r)return hS;let i=t=>function(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=$S(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}(t,0,1,e,n);return e=>e===0||e===1?e:$S(i(e),t,r)}var tC=eC(.42,0,1,1),nC=eC(0,0,.58,1),rC=eC(.42,0,.58,1),iC=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,aC=e=>t=>1-e(1-t),oC=e=>1-Math.sin(Math.acos(e)),sC=aC(oC),cC=iC(oC),lC=eC(.33,1.53,.69,.99),uC=aC(lC),dC={linear:hS,easeIn:tC,easeInOut:rC,easeOut:nC,circIn:oC,circInOut:cC,circOut:sC,backIn:uC,backInOut:iC(uC),backOut:lC,anticipate:e=>(e*=2)<1?.5*uC(e):.5*(2-2**(-10*(e-1)))},fC=e=>{if(Array.isArray(e)){GS(e.length===4);let[t,n,r,i]=e;return eC(t,n,r,i)}return typeof e==`string`?dC[e]:e},pC=(e,t)=>n=>!!(Ax(n)&&kx.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),mC=(e,t,n)=>r=>{if(!Ax(r))return r;let[i,a,o,s]=r.match(Dx);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},hC={...Cx,transform:e=>Math.round((e=>Sx(0,255,e))(e))},gC={test:pC(`rgb`,`red`),parse:mC(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+hC.transform(e)+`, `+hC.transform(t)+`, `+hC.transform(n)+`, `+Ex(wx.transform(r))+`)`},_C={test:pC(`#`),parse:function(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:gC.transform},vC={test:pC(`hsl`,`hue`),parse:mC(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Nx.transform(Ex(t))+`, `+Nx.transform(Ex(n))+`, `+Ex(wx.transform(r))+`)`},yC={test:e=>gC.test(e)||_C.test(e)||vC.test(e),parse:e=>gC.test(e)?gC.parse(e):vC.test(e)?vC.parse(e):_C.parse(e),transform:e=>Ax(e)?e:e.hasOwnProperty(`red`)?gC.transform(e):vC.transform(e)},bC=(e,t,n)=>-n*e+n*t+e;function xC(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var SC=(e,t,n)=>{let r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},CC=[_C,gC,vC];function wC(e){let t=(e=>CC.find(t=>t.test(e)))(e),n=t.parse(e);return t===vC&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,a=0,o=0;if(t/=100){let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=xC(s,r,e+1/3),a=xC(s,r,e),o=xC(s,r,e-1/3)}else i=a=o=n;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*o),alpha:r}}(n)),n}var TC=(e,t)=>{let n=wC(e),r=wC(t),i={...n};return e=>(i.red=SC(n.red,r.red,e),i.green=SC(n.green,r.green,e),i.blue=SC(n.blue,r.blue,e),i.alpha=bC(n.alpha,r.alpha,e),gC.transform(i))},EC={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:`Vars`,token:"${v}",parse:hS},DC={regex:Ox,countKey:`Colors`,token:"${c}",parse:yC.parse},OC={regex:Dx,countKey:`Numbers`,token:"${n}",parse:Cx.parse};function kC(e,{regex:t,countKey:n,token:r,parse:i}){let a=e.tokenised.match(t);a&&(e[`num`+n]=a.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...a.map(i)))}function AC(e){let t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes(`var(--`)&&kC(n,EC),kC(n,DC),kC(n,OC),n}function jC(e){return AC(e).values}function MC(e){let{values:t,numColors:n,numVars:r,tokenised:i}=AC(e),a=t.length;return e=>{let t=i;for(let i=0;i<a;i++)t=i<r?t.replace(EC.token,e[i]):i<r+n?t.replace(DC.token,yC.transform(e[i])):t.replace(OC.token,Ex(e[i]));return t}}var NC=e=>typeof e==`number`?0:e,PC={test:function(e){return isNaN(e)&&Ax(e)&&(e.match(Dx)?.length||0)+(e.match(Ox)?.length||0)>0},parse:jC,createTransformer:MC,getAnimatableNone:function(e){let t=jC(e);return MC(e)(t.map(NC))}},FC=(e,t)=>n=>`${n>0?t:e}`;function IC(e,t){return typeof e==`number`?n=>bC(e,t,n):yC.test(e)?TC(e,t):e.startsWith(`var(`)?FC(e,t):zC(e,t)}var LC=(e,t)=>{let n=[...e],r=n.length,i=e.map((e,n)=>IC(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}},RC=(e,t)=>{let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=IC(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}},zC=(e,t)=>{let n=PC.createTransformer(t),r=AC(e),i=AC(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?DS(LC(r.values,i.values),n):FC(e,t)},BC=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},VC=(e,t)=>n=>bC(e,t,n);function HC(e,t,n){let r=[],i=n||function(e){return typeof e==`number`?VC:typeof e==`string`?yC.test(e)?TC:zC:Array.isArray(e)?LC:typeof e==`object`?RC:VC}(e[0]),a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=DS(Array.isArray(t)?t[n]||hS:t,a)),r.push(a)}return r}function UC(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(GS(a===t.length),a===1)return()=>t[0];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=HC(t,r,i),s=o.length,c=t=>{let n=0;if(s>1)for(;n<e.length-2&&!(t<e[n+1]);n++);let r=BC(e[n],e[n+1],t);return o[n](r)};return n?t=>c(Sx(e[0],e[a-1],t)):c}function WC(e){let t=[0];return function(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=BC(0,t,r);e.push(bC(n,1,i))}}(t,e.length-1),t}function GC(e,t){return e.map(()=>t||rC).splice(0,e.length-1)}function KC({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=(e=>Array.isArray(e)&&typeof e[0]!=`number`)(r)?r.map(fC):fC(r),a={done:!1,value:t[0]},o=UC(function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:WC(t),e),t,{ease:Array.isArray(i)?i:GC(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}function qC(e,t){return t?1e3/t*e:0}function JC(e,t,n){let r=Math.max(t-5,0);return qC(n-e(r),t-r)}var YC=.001;function XC({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a,o=1-t;o=Sx(.05,1,o),e=Sx(.01,10,qS(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=QC(t,o),c=Math.exp(-i);return YC-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=QC(t**2,o);return(-i(t)+YC>0?-1:1)*((a-s)*c)/l}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-YC,a=t=>Math.exp(-t*e)*(e*e*(n-t)));let s=function(e,t,n){let r=n;for(let n=1;n<ZC;n++)r-=e(r)/t(r);return r}(i,a,5/e);if(e=KS(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{let t=s**2*r;return{stiffness:t,damping:2*o*Math.sqrt(r*t),duration:e}}}var ZC=12;function QC(e,t){return e*Math.sqrt(1-t*t)}var $C=[`duration`,`bounce`],ew=[`stiffness`,`damping`,`mass`];function tw(e,t){return t.some(t=>e[t]!==void 0)}function nw({keyframes:e,restDelta:t,restSpeed:n,...r}){let i=e[0],a=e[e.length-1],o={done:!1,value:i},{stiffness:s,damping:c,mass:l,duration:u,velocity:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!tw(e,ew)&&tw(e,$C)){let n=XC(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-qS(r.velocity||0)}),p=d||0,m=c/(2*Math.sqrt(s*l)),h=a-i,g=qS(Math.sqrt(s/l)),_=Math.abs(h)<5,v;if(n||=_?.01:2,t||=_?.005:.5,m<1){let e=QC(g,m);v=t=>a-Math.exp(-m*g*t)*((p+m*g*h)/e*Math.sin(e*t)+h*Math.cos(e*t))}else if(m===1)v=e=>a-Math.exp(-g*e)*(h+(p+g*h)*e);else{let e=g*Math.sqrt(m*m-1);v=t=>{let n=Math.exp(-m*g*t),r=Math.min(e*t,300);return a-n*((p+m*g*h)*Math.sinh(r)+e*h*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{let r=v(e);if(f)o.done=e>=u;else{let i=p;e!==0&&(i=m<1?JC(v,e,r):0);let s=Math.abs(i)<=n,c=Math.abs(a-r)<=t;o.done=s&&c}return o.value=o.done?a:r,o}}}function rw({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,m=n*t,h=d+m,g=o===void 0?h:o(h);g!==h&&(m=g-d);let _=e=>-m*Math.exp(-e/r),v=e=>g+_(e),y=e=>{let t=_(e),n=v(e);f.done=Math.abs(t)<=l,f.value=f.done?g:n},b,x,S=e=>{(e=>s!==void 0&&e<s||c!==void 0&&e>c)(f.value)&&(b=e,x=nw({keyframes:[f.value,p(f.value)],velocity:JC(v,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>b?x.next(e-b):(!t&&y(e),f)}}}var iw=e=>{let t=({timestamp:t})=>e(t);return{start:()=>vS.update(t,!0),stop:()=>yS(t),now:()=>bS.isProcessing?bS.timestamp:performance.now()}};function aw(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}var ow={decay:rw,inertia:rw,tween:KC,keyframes:KC,spring:nw};function sw({autoplay:e=!0,delay:t=0,driver:n=iw,keyframes:r,type:i=`keyframes`,repeat:a=0,repeatDelay:o=0,repeatType:s=`loop`,onPlay:c,onStop:l,onComplete:u,onUpdate:d,...f}){let p,m,h=1,g=!1,_=()=>{m=new Promise(e=>{p=e})},v;_();let y=ow[i]||KC,b;y!==KC&&typeof r[0]!=`number`&&(b=UC([0,100],r,{clamp:!1}),r=[0,100]);let x=y({...f,keyframes:r}),S;s===`mirror`&&(S=y({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let C=`idle`,w=null,T=null,E=null;x.calculatedDuration===null&&a&&(x.calculatedDuration=aw(x));let{calculatedDuration:D}=x,O=1/0,k=1/0;D!==null&&(O=D+o,k=O*(a+1)-o);let A=0,j=e=>{if(T===null)return;h>0&&(T=Math.min(T,e)),h<0&&(T=Math.min(e-k/h,T)),A=w===null?Math.round(e-T)*h:w;let n=A-t*(h>=0?1:-1),i=h>=0?n<0:n>k;A=Math.max(n,0),C===`finished`&&w===null&&(A=k);let c=A,l=x;if(a){let e=Math.min(A,k)/O,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,a+1),t%2&&(s===`reverse`?(n=1-n,o&&(n-=o/O)):s===`mirror`&&(l=S)),c=Sx(0,1,n)*O}let u=i?{done:!1,value:r[0]}:l.next(c);b&&(u.value=b(u.value));let{done:f}=u;!i&&D!==null&&(f=h>=0?A>=k:A<=0);let p=w===null&&(C===`finished`||C===`running`&&f);return d&&d(u.value),p&&P(),u},M=()=>{v&&v.stop(),v=void 0},N=()=>{C=`idle`,M(),p(),_(),T=E=null},P=()=>{C=`finished`,u&&u(),M(),p()},F=()=>{if(g)return;v||=n(j);let e=v.now();c&&c(),w===null?(!T||C===`finished`)&&(T=e):T=e-w,C===`finished`&&_(),E=T,w=null,C=`running`,v.start()};e&&F();let I={then:(e,t)=>m.then(e,t),get time(){return qS(A)},set time(e){e=KS(e),A=e,w===null&&v&&h!==0?T=v.now()-e/h:w=e},get duration(){return qS(x.calculatedDuration===null?aw(x):x.calculatedDuration)},get speed(){return h},set speed(e){e===h||!v||(h=e,I.time=qS(A))},get state(){return C},play:F,pause:()=>{C=`paused`,w=A},stop:()=>{g=!0,C!==`idle`&&(C=`idle`,l&&l(),N())},cancel:()=>{E!==null&&j(E),N()},complete:()=>{C=`finished`},sample:e=>(T=0,j(e))};return I}var cw=function(e){let t;return()=>(t===void 0&&(t=e()),t)}(()=>Object.hasOwnProperty.call(Element.prototype,`animate`)),lw=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]);function uw(e,t,{onUpdate:n,onComplete:r,...i}){if(!cw()||!lw.has(t)||i.repeatDelay||i.repeatType===`mirror`||i.damping===0||i.type===`inertia`)return!1;let a,o,s=!1,c=!1,l=()=>{o=new Promise(e=>{a=e})};l();let{keyframes:u,duration:d=300,ease:f,times:p}=i;if(((e,t)=>t.type===`spring`||e===`backgroundColor`||!YS(t.ease))(t,i)){let e=sw({...i,repeat:0,delay:0}),t={done:!1,value:u[0]},n=[],r=0;for(;!t.done&&r<2e4;)t=e.sample(r),n.push(t.value),r+=10;p=void 0,u=n,d=r-10,f=`linear`}let m=function(e,t,n,{delay:r=0,duration:i,repeat:a=0,repeatType:o=`loop`,ease:s,times:c}={}){let l={[t]:n};c&&(l.offset=c);let u=QS(s);return Array.isArray(u)&&(l.easing=u),e.animate(l,{delay:r,duration:i,easing:Array.isArray(u)?`linear`:u,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`})}(e.owner.current,t,u,{...i,duration:d,ease:f,times:p}),h=()=>{c=!1,m.cancel()},g=()=>{c=!0,vS.update(h),a(),l()};return m.onfinish=()=>{c||(e.set(function(e,{repeat:t,repeatType:n=`loop`}){return e[t&&n!==`loop`&&t%2==1?0:e.length-1]}(u,i)),r&&r(),g())},{then:(e,t)=>o.then(e,t),attachTimeline:e=>(m.timeline=e,m.onfinish=null,hS),get time(){return qS(m.currentTime||0)},set time(e){m.currentTime=KS(e)},get speed(){return m.playbackRate},set speed(e){m.playbackRate=e},get duration(){return qS(d)},play:()=>{s||(m.play(),yS(h))},pause:()=>m.pause(),stop:()=>{if(s=!0,m.playState===`idle`)return;let{currentTime:t}=m;if(t){let n=sw({...i,autoplay:!1});e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}g()},complete:()=>{c||m.finish()},cancel:g}}var dw={type:`spring`,stiffness:500,damping:25,restSpeed:10},fw={type:`keyframes`,duration:.8},pw={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},mw=(e,{keyframes:t})=>t.length>2?fw:px.has(e)?e.startsWith(`scale`)?(e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):dw:pw,hw=(e,t)=>e!==`zIndex`&&!(typeof t!=`number`&&!Array.isArray(t)&&(typeof t!=`string`||!PC.test(t)&&t!==`0`||t.startsWith(`url(`))),gw=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function _w(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Dx)||[];if(!r)return e;let i=n.replace(r,``),a=+!!gw.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var vw=/([a-z-]*)\(.*?\)/g,yw={...PC,getAnimatableNone:e=>{let t=e.match(vw);return t?t.map(_w).join(` `):e}},bw={...zx,color:yC,backgroundColor:yC,outlineColor:yC,fill:yC,stroke:yC,borderColor:yC,borderTopColor:yC,borderRightColor:yC,borderBottomColor:yC,borderLeftColor:yC,filter:yw,WebkitFilter:yw},xw=e=>bw[e];function Sw(e,t){let n=xw(e);return n!==yw&&(n=PC),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Cw=e=>/^0[^.\s]+$/.test(e);function ww(e){return typeof e==`number`?e===0:e===null?void 0:e===`none`||e===`0`||Cw(e)}function Tw(e,t){return e[t]||e.default||e}var Ew=!1,Dw=(e,t,n,r={})=>i=>{let a=Tw(r,e)||{},o=a.delay||r.delay||0,{elapsed:s=0}=r;s-=KS(o);let c=function(e,t,n,r){let i=hw(t,n),a;a=Array.isArray(n)?[...n]:[null,n];let o=r.from===void 0?e.get():r.from,s,c=[];for(let e=0;e<a.length;e++)a[e]===null&&(a[e]=e===0?o:a[e-1]),ww(a[e])&&c.push(e),typeof a[e]==`string`&&a[e]!==`none`&&a[e]!==`0`&&(s=a[e]);if(i&&c.length&&s)for(let e=0;e<c.length;e++)a[c[e]]=Sw(t,s);return a}(t,e,n,a),l=c[0],u=c[c.length-1],d=hw(e,l),f=hw(e,u),p={keyframes:c,velocity:t.getVelocity(),ease:`easeOut`,...a,delay:-s,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{i(),a.onComplete&&a.onComplete()}};if(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}(a)||(p={...p,...mw(e,p)}),p.duration&&=KS(p.duration),p.repeatDelay&&=KS(p.repeatDelay),!d||!f||!1===a.type||Ew)return function({keyframes:e,delay:t,onUpdate:n,onComplete:r}){let i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:hS,pause:hS,stop:hS,then:e=>(e(),Promise.resolve()),cancel:hS,complete:hS});return t?sw({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}(p);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){let n=uw(t,e,p);if(n)return n}return sw(p)};function Ow(e){return!(!hx(e)||!e.add)}var kw=e=>/^\-?\d*\.?\d+$/.test(e),Aw=class{constructor(){this.subscriptions=[]}add(e){return function(e,t){e.indexOf(t)===-1&&e.push(t)}(this.subscriptions,e),()=>function(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},jw=class{constructor(e,t={}){this.version=`10.18.0`,this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{this.prev=this.current,this.current=e;let{delta:n,timestamp:r}=bS;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,vS.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>vS.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current),this.owner=t.owner}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Aw);let n=this.events[e].add(t);return e===`change`?()=>{n(),vS.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?qC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Mw(e,t){return new jw(e,t)}var Nw=e=>t=>t.test(e),Pw=[Cx,Px,Nx,Mx,Ix,Fx,{test:e=>e===`auto`,parse:e=>e}],Fw=e=>Pw.find(Nw(e)),Iw=[...Pw,yC,PC],Lw=e=>Iw.find(Nw(e));function Rw(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Mw(n))}function zw(e,t){return t?(t[e]||t.default||t).from:void 0}function Bw({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Vw(e,t){let n=e.get();if(!Array.isArray(t))return n!==t;for(let e=0;e<t.length;e++)if(t[e]!==n)return!0}function Hw(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=e.makeTargetAnimatable(t),c=e.getValue(`willChange`);r&&(a=r);let l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t),i=s[t];if(!r||i===void 0||u&&Bw(u,t))continue;let o={delay:n,elapsed:0,...Tw(a||{},t)};if(window.HandoffAppearAnimations){let n=e.getProps()[Gb];if(n){let e=window.HandoffAppearAnimations(n,t,r,vS);e!==null&&(o.elapsed=e,o.isHandoff=!0)}}let d=!o.isHandoff&&!Vw(r,i);if(o.type===`spring`&&(r.getVelocity()||o.velocity)&&(d=!1),r.animation&&(d=!1),d)continue;r.start(Dw(t,r,i,e.shouldReduceMotion&&px.has(t)?{type:!1}:o));let f=r.animation;Ow(c)&&(c.add(t),f.then(()=>c.remove(t))),l.push(f)}return o&&Promise.all(l).then(()=>{o&&function(e,t){let n=WS(e,t),{transitionEnd:r={},transition:i={},...a}=n?e.makeTargetAnimatable(n,!1):{};a={...a,...r};for(let t in a)Rw(e,t,dS(a[t]))}(e,o)}),l}function Uw(e,t,n={}){let r=WS(e,t,n.custom),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Hw(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return function(e,t,n=0,r=0,i=1,a){let o=[],s=(e.variantChildren.size-1)*r,c=i===1?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(Ww).forEach((e,r)=>{e.notify(`AnimationStart`,t),o.push(Uw(e,t,{...a,delay:n+c(r)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(o)}(e,t,a+r,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Ww(e,t){return e.sortNodePosition(t)}var Gw=[...Yb].reverse(),Kw=Yb.length;function qw(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify(`AnimationStart`,t),Array.isArray(t)){let i=t.map(t=>Uw(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Uw(e,t,n);else{let i=typeof t==`function`?WS(e,t,n.custom):t;r=Promise.all(Hw(e,i,n))}return r.then(()=>e.notify(`AnimationComplete`,t))}(e,t,n)))}function Jw(e){let t=qw(e),n={animate:Xw(!0),whileInView:Xw(),whileHover:Xw(),whileTap:Xw(),whileDrag:Xw(),whileFocus:Xw(),exit:Xw()},r=!0,i=(t,n)=>{let r=WS(e,n);if(r){let{transition:e,transitionEnd:n,...i}=r;t={...t,...i,...n}}return t};function a(a,o){let s=e.getProps(),c=e.getVariantContext(!0)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Kw;t++){let p=Gw[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=qb(h),_=p===o?m.isActive:null;!1===_&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Jb(h)||typeof h==`boolean`)continue;let y=Yw(m.prevProp,h)||p===o&&m.isActive&&!v&&g||t>f&&g,b=!1,x=Array.isArray(h)?h:[h],S=x.reduce(i,{});!1===_&&(S={});let{prevResolvedValues:C={}}=m,w={...C,...S},T=e=>{y=!0,u.has(e)&&(b=!0,u.delete(e)),m.needsAnimating[e]=!0};for(let e in w){let t=S[e],n=C[e];if(d.hasOwnProperty(e))continue;let r=!1;r=uS(t)&&uS(n)?!US(t,n):t!==n,r?t===void 0?u.add(e):T(e):t!==void 0&&u.has(e)?T(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=S,m.isActive&&(d={...d,...S}),r&&e.blockInitialAnimation&&(y=!1),y&&(!v||b)&&l.push(...x.map(e=>({animation:e,options:{type:p,...a}})))}if(u.size){let t={};u.forEach(n=>{let r=e.getBaseTarget(n);r!==void 0&&(t[n]=r)}),l.push({animation:t})}let p=!!l.length;return r&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,r,i){var o;if(n[t].isActive===r)return Promise.resolve();(o=e.variantChildren)==null||o.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let s=a(i,t);for(let e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Yw(e,t){return typeof t==`string`?t!==e:!!Array.isArray(t)&&!US(t,e)}function Xw(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var Zw=0,Qw={animation:{Feature:class extends MS{constructor(e){super(e),e.animationState||=Jw(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();this.unmount(),Jb(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends MS{constructor(){super(...arguments),this.id=Zw++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;let i=this.node.animationState.setActive(`exit`,!e,{custom:n??this.node.getProps().custom});t&&!e&&i.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},$w=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function eT(e,t,n=1){let[r,i]=function(e){let t=$w.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]}(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return kw(e)?parseFloat(e):e}return bx(i)?eT(i,t,n+1):i}var tT=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,`x`,`y`,`translateX`,`translateY`]),nT=e=>tT.has(e),rT=e=>e===Cx||e===Px,iT=(e,t)=>parseFloat(e.split(`, `)[t]),aT=(e,t)=>(n,{transform:r})=>{if(r===`none`||!r)return 0;let i=r.match(/^matrix3d\((.+)\)$/);if(i)return iT(i[1],t);{let t=r.match(/^matrix\((.+)\)$/);return t?iT(t[1],e):0}},oT=new Set([`x`,`y`,`z`]),sT=fx.filter(e=>!oT.has(e)),cT={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:aT(4,13),y:aT(5,14)};cT.translateX=cT.x,cT.translateY=cT.y;var lT=(e,t,n={},r={})=>{t={...t},r={...r};let i=Object.keys(t).filter(nT),a=[],o=!1,s=[];if(i.forEach(i=>{let c=e.getValue(i);if(!e.hasValue(i))return;let l=n[i],u=Fw(l),d=t[i],f;if(uS(d)){let e=d.length,t=+(d[0]===null);l=d[t],u=Fw(l);for(let n=t;n<e&&d[n]!==null;n++)f?GS(Fw(d[n])===f):f=Fw(d[n])}else f=Fw(d);if(u!==f)if(rT(u)&&rT(f)){let e=c.get();typeof e==`string`&&c.set(parseFloat(e)),typeof d==`string`?t[i]=parseFloat(d):Array.isArray(d)&&f===Px&&(t[i]=d.map(parseFloat))}else u!=null&&u.transform&&f!=null&&f.transform&&(l===0||d===0)?l===0?c.set(f.transform(l)):t[i]=u.transform(d):(o||=(a=function(e){let t=[];return sT.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t.length&&e.render(),t}(e),!0),s.push(i),r[i]=r[i]===void 0?t[i]:r[i],c.jump(d))}),s.length){let n=s.indexOf(`height`)>=0?window.pageYOffset:null,i=((e,t,n)=>{let r=t.measureViewportBox(),i=t.current,a=getComputedStyle(i),{display:o}=a,s={};o===`none`&&t.setStaticValue(`display`,e.display||`block`),n.forEach(e=>{s[e]=cT[e](r,a)}),t.render();let c=t.measureViewportBox();return n.forEach(n=>{let r=t.getValue(n);r&&r.jump(s[n]),e[n]=cT[n](c,a)}),e})(t,e,s);return a.length&&a.forEach(([t,n])=>{e.getValue(t).set(n)}),e.render(),Vb&&n!==null&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}return{target:t,transitionEnd:r}};function uT(e,t,n,r){return(e=>Object.keys(e).some(nT))(t)?lT(e,t,n,r):{target:t,transitionEnd:r}}var dT=(e,t,n,r)=>{let i=function(e,{...t},n){let r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&={...n},e.values.forEach(e=>{let t=e.get();if(!bx(t))return;let n=eT(t,r);n&&e.set(n)});for(let e in t){let i=t[e];if(!bx(i))continue;let a=eT(i,r);a&&(t[e]=a,n||={},n[e]===void 0&&(n[e]=i))}return{target:t,transitionEnd:n}}(e,t,r);return uT(e,t=i.target,n,r=i.transitionEnd)},fT={current:null},pT={current:!1},mT=new WeakMap,hT=Object.keys(nx),gT=hT.length,_T=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],vT=Xb.length,yT=class{constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>vS.render(this.render,!1,!0);let{latestValues:o,renderState:s}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=s,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.isControllingVariants=Zb(t),this.isVariantNode=Qb(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);let{willChange:c,...l}=this.scrapeMotionValuesFromProps(t,{});for(let e in l){let t=l[e];o[e]!==void 0&&hx(t)&&(t.set(o[e],!1),Ow(c)&&c.add(e))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,mT.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),pT.current||function(){if(pT.current=!0,Vb)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>fT.current=e.matches;e.addListener(t),t()}else fT.current=!1}(),this.shouldReduceMotion=this.reducedMotionConfig!==`never`&&(this.reducedMotionConfig===`always`||fT.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){mT.delete(this.current),this.projection&&this.projection.unmount(),yS(this.notifyUpdate),yS(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let e in this.events)this.events[e].clear();for(let e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){let n=px.has(e),r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&vS.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on(`renderRequest`,this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),i()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},n,r,i){let a,o;for(let e=0;e<gT;e++){let n=hT[e],{isEnabled:r,Feature:i,ProjectionNode:s,MeasureLayout:c}=nx[n];s&&(a=s),r(t)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),c&&(o=c))}if((this.type===`html`||this.type===`svg`)&&!this.projection&&a){this.projection=new a(this.latestValues,this.parent&&this.parent.projection);let{layoutId:e,layout:n,drag:r,dragConstraints:o,layoutScroll:s,layoutRoot:c}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:!!r||o&&Kb(o),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof n==`string`?n:`both`,initialPromotionConfig:i,layoutScroll:s,layoutRoot:c})}return o}updateFeatures(){for(let e in this.features){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<_T.length;t++){let n=_T[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(e,t,n){let{willChange:r}=t;for(let i in t){let a=t[i],o=n[i];if(hx(a))e.addValue(i,a),Ow(r)&&r.add(i);else if(hx(o))e.addValue(i,Mw(a,{owner:e})),Ow(r)&&r.remove(i);else if(o!==a)if(e.hasValue(i)){let t=e.getValue(i);!t.hasAnimated&&t.set(a)}else{let t=e.getStaticValue(i);e.addValue(i,Mw(t===void 0?a:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){let e=this.parent&&this.parent.getVariantContext()||{};return this.props.initial!==void 0&&(e.initial=this.props.initial),e}let t={};for(let e=0;e<vT;e++){let n=Xb[e],r=this.props[n];(qb(r)||!1===r)&&(t[n]=r)}return t}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Mw(t,{owner:this}),this.addValue(e,n)),n}readValue(e){return this.latestValues[e]===void 0&&this.current?this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n=typeof t==`string`||typeof t==`object`?cS(this.props,t)?.[e]:void 0;if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r===void 0||hx(r)?this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new Aw),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}},bT=class extends yT{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...n},{transformValues:r},i){let a=function(e,t,n){let r={};for(let i in e){let e=zw(i,t);if(e!==void 0)r[i]=e;else{let e=n.getValue(i);e&&(r[i]=e.get())}}return r}(n,e||{},this);if(r&&(t&&=r(t),n&&=r(n),a&&=r(a)),i){(function(e,t,n){let r=Object.keys(t).filter(t=>!e.hasValue(t)),i=r.length;if(i)for(let a=0;a<i;a++){let i=r[a],o=t[i],s=null;Array.isArray(o)&&(s=o[0]),s===null&&(s=n[i]??e.readValue(i)??t[i]),s!=null&&(typeof s==`string`&&(kw(s)||Cw(s))?s=parseFloat(s):!Lw(s)&&PC.test(o)&&(s=Sw(i,o)),e.addValue(i,Mw(s,{owner:e})),n[i]===void 0&&(n[i]=s),s!==null&&e.setBaseTarget(i,s))}})(this,n,a);let e=dT(this,n,a,t);t=e.transitionEnd,n=e.target}return{transition:e,transitionEnd:t,...n}}},xT=class extends bT{constructor(){super(...arguments),this.type=`html`}readValueFromInstance(e,t){if(px.has(t)){let e=xw(t);return e&&e.default||0}{let n=function(e){return window.getComputedStyle(e)}(e),r=(yx(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return function(e,t){return function({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}(function(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}(e,t)}build(e,t,n,r){Bx(e,t,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return oS(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;hx(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,n,r){rS(e,t,n,r)}},ST=class extends bT{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(px.has(t)){let e=xw(t);return e&&e.default||0}return t=iS.has(t)?t:Wb(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t){return sS(e,t)}build(e,t,n,r){Qx(e,t,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,n,r){aS(e,t,0,r)}mount(e){this.isSVGTag=eS(e.tagName),super.mount(e)}},CT=function(e){function t(t,n={}){return sx(e(t,n))}if(typeof Proxy>`u`)return t;let n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}(function(e,{forwardMotionProps:t=!1},n,r){return{...ux(e)?xS:SS,preloadedFeatures:n,useRender:nS(t),createVisualElement:r,Component:e}});function wT(){let e=(0,s.useRef)(!1);return Hb(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var TT=class extends s.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function ET({children:e,isPresent:t}){let n=(0,s.useId)(),r=(0,s.useRef)(null),i=(0,s.useRef)({width:0,height:0,top:0,left:0});return(0,s.useInsertionEffect)(()=>{let{width:e,height:a,top:o,left:s}=i.current;if(t||!r.current||!e||!a)return;r.current.dataset.motionPopId=n;let c=document.createElement(`style`);return document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${a}px !important;\n top: ${o}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[t]),s.createElement(TT,{isPresent:t,childRef:r,sizeRef:i},s.cloneElement(e,{ref:r}))}var DT=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o})=>{let c=lS(OT),l=(0,s.useId)(),u=(0,s.useMemo)(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:e=>{c.set(e,!0);for(let e of c.values())if(!e)return;r&&r()},register:e=>(c.set(e,!1),()=>c.delete(e))}),a?void 0:[n]);return(0,s.useMemo)(()=>{c.forEach((e,t)=>c.set(t,!1))},[n]),s.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),o===`popLayout`&&(e=s.createElement(ET,{isPresent:n},e)),s.createElement(Bb.Provider,{value:u},e)};function OT(){return new Map}var kT=e=>e.key||``,AT=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:a=!0,mode:o=`sync`})=>{let c=(0,s.useContext)(ix).forceRender||function(){let e=wT(),[t,n]=(0,s.useState)(0),r=(0,s.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,s.useCallback)(()=>vS.postRender(r),[r]),t]}()[0],l=wT(),u=function(e){let t=[];return s.Children.forEach(e,e=>{(0,s.isValidElement)(e)&&t.push(e)}),t}(e),d=u,f=(0,s.useRef)(new Map).current,p=(0,s.useRef)(d),m=(0,s.useRef)(new Map).current,h=(0,s.useRef)(!0);if(Hb(()=>{h.current=!1,function(e,t){e.forEach(e=>{let n=kT(e);t.set(n,e)})}(u,m),p.current=d}),function(e){(0,s.useEffect)(()=>()=>e(),[])}(()=>{h.current=!0,m.clear(),f.clear()}),h.current)return s.createElement(s.Fragment,null,d.map(e=>s.createElement(DT,{key:kT(e),isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:a,mode:o},e)));d=[...d];let g=p.current.map(kT),_=u.map(kT),v=g.length;for(let e=0;e<v;e++){let t=g[e];_.indexOf(t)===-1&&!f.has(t)&&f.set(t,void 0)}return o===`wait`&&f.size&&(d=[]),f.forEach((e,n)=>{if(_.indexOf(n)!==-1)return;let i=m.get(n);if(!i)return;let h=g.indexOf(n),v=e;v||(v=s.createElement(DT,{key:kT(i),isPresent:!1,onExitComplete:()=>{f.delete(n);let e=Array.from(m.keys()).filter(e=>!_.includes(e));if(e.forEach(e=>m.delete(e)),p.current=u.filter(t=>{let r=kT(t);return r===n||e.includes(r)}),!f.size){if(!1===l.current)return;c(),r&&r()}},custom:t,presenceAffectsLayout:a,mode:o},i),f.set(n,v)),d.splice(h,0,v)}),d=d.map(e=>{let t=e.key;return f.has(t)?e:s.createElement(DT,{key:kT(e),isPresent:!0,presenceAffectsLayout:a,mode:o},e)}),s.createElement(s.Fragment,null,f.size?d:d.map(e=>(0,s.cloneElement)(e)))};function jT({children:e,features:t,strict:n=!1}){let[,r]=(0,s.useState)(!MT(t)),i=(0,s.useRef)(void 0);if(!MT(t)){let{renderer:e,...n}=t;i.current=e,rx(n)}return(0,s.useEffect)(()=>{MT(t)&&t().then(({renderer:e,...t})=>{rx(t),i.current=e,r(!0)})},[]),s.createElement(Ub.Provider,{value:{renderer:i.current,strict:n}},e)}function MT(e){return typeof e==`function`}var NT={renderer:(e,t)=>ux(e)?new ST(t,{enableHardwareAcceleration:!1}):new xT(t,{enableHardwareAcceleration:!0}),...Qw,...HS},PT=typeof document<`u`?s.default.useLayoutEffect:()=>{},FT=s.default.createContext(!1);function IT(){return!1}function LT(){return!0}function RT(e){return()=>{}}function zT(){return typeof s.default.useSyncExternalStore==`function`?s.default.useSyncExternalStore(RT,IT,LT):(0,s.useContext)(FT)}s.default.useId;var BT=new Map;function VT(e,t){if(e===t)return e;let n=BT.get(e);if(n)return n(t),t;let r=BT.get(t);return r?(r(e),e):t}function HT(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var UT=e=>e?.ownerDocument??document,WT=e=>e&&`window`in e&&e.window===e?e:UT(e).defaultView||window;function GT(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],i=r[e];typeof n==`function`&&typeof i==`function`&&e[0]===`o`&&e[1]===`n`&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=HT(n,i):e!==`className`&&e!==`UNSAFE_className`||typeof n!=`string`||typeof i!=`string`?e===`id`&&n&&i?t.id=VT(n,i):t[e]=i===void 0?n:i:t[e]=K(n,i)}}return t}function KT(e){if(function(){if(qT==null){qT=!1;try{document.createElement(`div`).focus({get preventScroll(){return qT=!0,!0}})}catch{}}return qT}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}var qT=null;function JT(){return function(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}(/^Mac/i)}function YT(){return function(e){return!(typeof window>`u`||window.navigator==null)&&(window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent))}(/Android/i)}var XT=new Map,ZT=new Set;function QT(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=n=>{if(!e(n)||!n.target)return;let r=XT.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener(`transitioncancel`,t),XT.delete(n.target)),XT.size===0)){for(let e of ZT)e();ZT.clear()}};document.body.addEventListener(`transitionrun`,n=>{if(!e(n)||!n.target)return;let r=XT.get(n.target);r||(r=new Set,XT.set(n.target,r),n.target.addEventListener(`transitioncancel`,t,{once:!0})),r.add(n.propertyName)}),document.body.addEventListener(`transitionend`,t)}function $T(){let e=(0,s.useRef)(new Map),t=(0,s.useCallback)((t,n,r,i)=>{let a=i!=null&&i.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:a,options:i}),t.addEventListener(n,r,i)},[]),n=(0,s.useCallback)((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=(0,s.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,s.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function eE(e){let t=(0,s.useRef)(null);return(0,s.useMemo)(()=>({get current(){return t.current},set current(n){t.current=n,typeof e==`function`?e(n):e&&(e.current=n)}}),[e])}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,QT):QT());var tE=typeof document<`u`&&window.visualViewport;function nE(){return{width:tE&&tE?.width||window.innerWidth,height:tE&&tE?.height||window.innerHeight}}function rE(e,t,n){let[r,i]=(0,s.useState)(e||t),a=(0,s.useRef)(e!==void 0),o=e!==void 0;(0,s.useEffect)(()=>{a.current,a.current=o},[o]);let c=o?e:r,l=(0,s.useCallback)((e,...t)=>{let r=(e,...t)=>{n&&(Object.is(c,e)||n(e,...t)),o||(c=e)};typeof e==`function`?i((n,...i)=>{let a=e(o?c:n,...i);return r(a,...t),o?n:a}):(o||i(e),r(e,...t))},[o,c,n]);return[c,l]}function iE(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}function aE(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function oE(e,t,n=10){let r=n**+t;return Math.round(e*r)/r}var $={},sE=r_(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`})));(function(e){var t=t||{version:`5.3.0`};if(e.fabric=t,typeof document<`u`&&typeof window<`u`)document instanceof(typeof HTMLDocument<`u`?HTMLDocument:Document)?t.document=document:t.document=document.implementation.createHTMLDocument(``),t.window=window;else{var n=new sE.JSDOM(`<!DOCTYPE html><html><head></head><body></body></html>`,{features:{FetchExternalResources:[`img`]},resources:`usable`}).window;t.document=n.document,t.jsdomImplForWrapper=sE.implForWrapper,t.nodeCanvas=sE.Canvas,t.window=n,DOMParser=t.window.DOMParser}function i(e,t){var n=e.canvas,r=t.targetCanvas,i=r.getContext(`2d`);i.translate(0,r.height),i.scale(1,-1);var a=n.height-r.height;i.drawImage(n,0,a,r.width,r.height,0,0,r.width,r.height)}function a(e,t){var n=t.targetCanvas.getContext(`2d`),r=t.destinationWidth,i=t.destinationHeight,a=r*i*4,o=new Uint8Array(this.imageBuffer,0,a),s=new Uint8ClampedArray(this.imageBuffer,0,a);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,o);var c=new ImageData(s,r,i);n.putImageData(c,0,0)}t.isTouchSupported=`ontouchstart`in t.window||`ontouchstart`in t.document||t.window&&t.window.navigator&&t.window.navigator.maxTouchPoints>0,t.isLikelyNode=typeof r.t<`u`&&typeof window>`u`,t.SHARED_ATTRIBUTES=[`display`,`transform`,`fill`,`fill-opacity`,`fill-rule`,`opacity`,`stroke`,`stroke-dasharray`,`stroke-linecap`,`stroke-dashoffset`,`stroke-linejoin`,`stroke-miterlimit`,`stroke-opacity`,`stroke-width`,`id`,`paint-order`,`vector-effect`,`instantiated_by_use`,`clip-path`],t.DPI=96,t.reNum=`(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)`,t.commaWsp=`(?:\\s+,?\\s*|,\\s*)`,t.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,t.reNonWord=/[ \n\.,;!\?\-]/,t.fontPaths={},t.iMatrix=[1,0,0,1,0,0],t.svgNS=`http://www.w3.org/2000/svg`,t.perfLimitSizeTotal=2097152,t.maxCacheSideLimit=4096,t.minCacheSideLimit=256,t.charWidthsCache={},t.textureSize=2048,t.disableStyleCopyPaste=!1,t.enableGLFiltering=!0,t.devicePixelRatio=t.window.devicePixelRatio||t.window.webkitDevicePixelRatio||t.window.mozDevicePixelRatio||1,t.browserShadowBlurConstant=1,t.arcToSegmentsCache={},t.boundsOfCurveCache={},t.cachesBoundsOfCurve=!0,t.forceGLPutImageData=!1,t.initFilterBackend=function(){return t.enableGLFiltering&&t.isWebglSupported&&t.isWebglSupported(t.textureSize)?new t.WebglFilterBackend({tileSize:t.textureSize}):t.Canvas2dFilterBackend?new t.Canvas2dFilterBackend:void 0},typeof document<`u`&&typeof window<`u`&&(window.fabric=t),function(){function e(e,n){if(this.__eventListeners[e]){var r=this.__eventListeners[e];n?r[r.indexOf(n)]=!1:t.util.array.fill(r,!1)}}function n(e,t){var n=function(){t.apply(this,arguments),this.off(e,n)}.bind(this);this.on(e,n)}t.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var n=this.__eventListeners[e];if(!n)return this;for(var r=0,i=n.length;r<i;r++)n[r]&&n[r].call(this,t||{});return this.__eventListeners[e]=n.filter(function(e){return!1!==e}),this},on:function(e,t){if(this.__eventListeners||={},arguments.length===1)for(var n in e)this.on(n,e[n]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,t){if(arguments.length===1)for(var r in e)n.call(this,r,e[r]);else n.call(this,e,t);return this},off:function(t,n){if(!this.__eventListeners)return this;if(arguments.length===0)for(t in this.__eventListeners)e.call(this,t);else if(arguments.length===1&&typeof arguments[0]==`object`)for(var r in t)e.call(this,r,t[r]);else e.call(this,t,n);return this}}}(),t.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,n){var r=this._objects;return n?r[t]=e:r.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,n=!1,r=0,i=arguments.length;r<i;r++)(e=t.indexOf(arguments[r]))!==-1&&(n=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[r]));return this.renderOnAddRemove&&n&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var n=this.getObjects(),r=0,i=n.length;r<i;r++)e.call(t,n[r],r,n);return this},getObjects:function(e){return typeof e>`u`?this._objects.concat():this._objects.filter(function(t){return t.type===e})},item:function(e){return this._objects[e]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some(function(t){return typeof t.contains==`function`&&t.contains(e,!0)})},complexity:function(){return this._objects.reduce(function(e,t){return e+=t.complexity?t.complexity():0},0)}},t.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,n){e&&e.colorStops&&!(e instanceof t.Gradient)&&this.set(n,new t.Gradient(e))},_initPattern:function(e,n,r){!e||!e.source||e instanceof t.Pattern?r&&r():this.set(n,new t.Pattern(e,r))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return typeof e==`object`?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return typeof t==`boolean`&&this.set(e,!t),this},get:function(e){return this[e]}},function(e){var n=Math.sqrt,r=Math.atan2,i=Math.pow,a=Math.PI/180,o=Math.PI/2;t.util={cos:function(e){if(e===0)return 1;switch(e<0&&(e=-e),e/o){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(e===0)return 0;var t=1;switch(e<0&&(t=-1),e/o){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var n=e.indexOf(t);return n!==-1&&e.splice(n,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*a},radiansToDegrees:function(e){return e/a},rotatePoint:function(e,n,r){var i=new t.Point(e.x-n.x,e.y-n.y),a=t.util.rotateVector(i,r);return new t.Point(a.x,a.y).addEquals(n)},rotateVector:function(e,n){var r=t.util.sin(n),i=t.util.cos(n);return{x:e.x*i-e.y*r,y:e.x*r+e.y*i}},createVector:function(e,n){return new t.Point(n.x-e.x,n.y-e.y)},calcAngleBetweenVectors:function(e,t){return Math.acos((e.x*t.x+e.y*t.y)/(Math.hypot(e.x,e.y)*Math.hypot(t.x,t.y)))},getHatVector:function(e){return new t.Point(e.x,e.y).multiply(1/Math.hypot(e.x,e.y))},getBisector:function(e,n,r){var i=t.util.createVector(e,n),a=t.util.createVector(e,r),o=t.util.calcAngleBetweenVectors(i,a),s=o*(t.util.calcAngleBetweenVectors(t.util.rotateVector(i,o),a)===0?1:-1)/2;return{vector:t.util.getHatVector(t.util.rotateVector(i,s)),angle:o}},projectStrokeOnPoints:function(e,n,r){var i=[],a=n.strokeWidth/2,o=n.strokeUniform?new t.Point(1/n.scaleX,1/n.scaleY):new t.Point(1,1),s=function(e){var n=a/Math.hypot(e.x,e.y);return new t.Point(e.x*n*o.x,e.y*n*o.y)};return e.length<=1||e.forEach(function(c,l){var u,d,f=new t.Point(c.x,c.y);l===0?(d=e[l+1],u=r?s(t.util.createVector(d,f)).addEquals(f):e[e.length-1]):l===e.length-1?(u=e[l-1],d=r?s(t.util.createVector(u,f)).addEquals(f):e[0]):(u=e[l-1],d=e[l+1]);var p,m,h=t.util.getBisector(f,u,d),g=h.vector,_=h.angle;if(n.strokeLineJoin===`miter`&&(p=-a/Math.sin(_/2),m=new t.Point(g.x*p*o.x,g.y*p*o.y),Math.hypot(m.x,m.y)/a<=n.strokeMiterLimit))return i.push(f.add(m)),void i.push(f.subtract(m));p=-a*Math.SQRT2,m=new t.Point(g.x*p*o.x,g.y*p*o.y),i.push(f.add(m)),i.push(f.subtract(m))}),i},transformPoint:function(e,n,r){return r?new t.Point(n[0]*e.x+n[2]*e.y,n[1]*e.x+n[3]*e.y):new t.Point(n[0]*e.x+n[2]*e.y+n[4],n[1]*e.x+n[3]*e.y+n[5])},makeBoundingBoxFromPoints:function(e,n){if(n)for(var r=0;r<e.length;r++)e[r]=t.util.transformPoint(e[r],n);var i=[e[0].x,e[1].x,e[2].x,e[3].x],a=t.util.array.min(i),o=t.util.array.max(i)-a,s=[e[0].y,e[1].y,e[2].y,e[3].y],c=t.util.array.min(s);return{left:a,top:c,width:o,height:t.util.array.max(s)-c}},invertTransform:function(e){var n=1/(e[0]*e[3]-e[1]*e[2]),r=[n*e[3],-n*e[1],-n*e[2],n*e[0]],i=t.util.transformPoint({x:e[4],y:e[5]},r,!0);return r[4]=-i.x,r[5]=-i.y,r},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,n){var r=/\D{0,2}$/.exec(e),i=parseFloat(e);switch(n||=t.Text.DEFAULT_SVG_FONT_SIZE,r[0]){case`mm`:return i*t.DPI/25.4;case`cm`:return i*t.DPI/2.54;case`in`:return i*t.DPI;case`pt`:return i*t.DPI/72;case`pc`:return i*t.DPI/72*12;case`em`:return i*n;default:return i}},falseFunction:function(){return!1},getKlass:function(e,n){return e=t.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),t.util.resolveNamespace(n)[e]},getSvgAttributes:function(e){var t=[`instantiated_by_use`,`style`,`id`,`class`];switch(e){case`linearGradient`:t=t.concat([`x1`,`y1`,`x2`,`y2`,`gradientUnits`,`gradientTransform`]);break;case`radialGradient`:t=t.concat([`gradientUnits`,`gradientTransform`,`cx`,`cy`,`r`,`fx`,`fy`,`fr`]);break;case`stop`:t=t.concat([`offset`,`stop-color`,`stop-opacity`])}return t},resolveNamespace:function(n){if(!n)return t;var r,i=n.split(`.`),a=i.length,o=e||t.window;for(r=0;r<a;++r)o=o[i[r]];return o},loadImage:function(e,n,r,i){if(e){var a=t.util.createImage(),o=function(){n&&n.call(r,a,!1),a=a.onload=a.onerror=null};a.onload=o,a.onerror=function(){t.log(`Error loading `+a.src),n&&n.call(r,null,!0),a=a.onload=a.onerror=null},e.indexOf(`data`)!==0&&i!=null&&(a.crossOrigin=i),e.substring(0,14)===`data:image/svg`&&(a.onload=null,t.util.loadImageInDom(a,o)),a.src=e}else n&&n.call(r,e)},loadImageInDom:function(e,n){var r=t.document.createElement(`div`);r.style.width=r.style.height=`1px`,r.style.left=r.style.top=`-100%`,r.style.position=`absolute`,r.appendChild(e),t.document.querySelector(`body`).appendChild(r),e.onload=function(){n(),r.parentNode.removeChild(r),r=null}},enlivenObjects:function(e,n,r,i){var a=[],o=0,s=(e||=[]).length;function c(){++o===s&&n&&n(a.filter(function(e){return e}))}s?e.forEach(function(e,n){e&&e.type?t.util.getKlass(e.type,r).fromObject(e,function(t,r){r||(a[n]=t),i&&i(e,t,r),c()}):c()}):n&&n(a)},enlivenObjectEnlivables:function(e,n,r){var i=t.Object.ENLIVEN_PROPS.filter(function(t){return!!e[t]});t.util.enlivenObjects(i.map(function(t){return e[t]}),function(e){var t={};i.forEach(function(r,i){t[r]=e[i],n&&(n[r]=e[i])}),r&&r(t)})},enlivenPatterns:function(e,n){function r(){++a===o&&n&&n(i)}var i=[],a=0,o=(e||=[]).length;o?e.forEach(function(e,n){e&&e.source?new t.Pattern(e,function(e){i[n]=e,r()}):(i[n]=e,r())}):n&&n(i)},groupSVGElements:function(e,n,r){var i;return e&&e.length===1?(typeof r<`u`&&(e[0].sourcePath=r),e[0]):(n&&(n.width&&n.height?n.centerPoint={x:n.width/2,y:n.height/2}:(delete n.width,delete n.height)),i=new t.Group(e,n),typeof r<`u`&&(i.sourcePath=r),i)},populateWithProperties:function(e,t,n){if(n&&Array.isArray(n))for(var r=0,i=n.length;r<i;r++)n[r]in e&&(t[n[r]]=e[n[r]])},createCanvasElement:function(){return t.document.createElement(`canvas`)},copyCanvasElement:function(e){var n=t.util.createCanvasElement();return n.width=e.width,n.height=e.height,n.getContext(`2d`).drawImage(e,0,0),n},toDataURL:function(e,t,n){return e.toDataURL(`image/`+t,n)},createImage:function(){return t.document.createElement(`img`)},multiplyTransformMatrices:function(e,t,n){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],n?0:e[0]*t[4]+e[2]*t[5]+e[4],n?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=r(e[1],e[0]),o=i(e[0],2)+i(e[1],2),s=n(o),c=(e[0]*e[3]-e[2]*e[1])/s,l=r(e[0]*e[2]+e[1]*e[3],o);return{angle:t/a,scaleX:s,scaleY:c,skewX:l/a,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return t.iMatrix.concat();var n=t.util.degreesToRadians(e.angle),r=t.util.cos(n),i=t.util.sin(n);return[r,i,-i,r,0,0]},calcDimensionsMatrix:function(e){var n=typeof e.scaleX>`u`?1:e.scaleX,r=typeof e.scaleY>`u`?1:e.scaleY,i=[e.flipX?-n:n,0,0,e.flipY?-r:r,0,0],a=t.util.multiplyTransformMatrices,o=t.util.degreesToRadians;return e.skewX&&(i=a(i,[1,0,Math.tan(o(e.skewX)),1],!0)),e.skewY&&(i=a(i,[1,Math.tan(o(e.skewY)),0,1],!0)),i},composeMatrix:function(e){var n=[1,0,0,1,e.translateX||0,e.translateY||0],r=t.util.multiplyTransformMatrices;return e.angle&&(n=r(n,t.util.calcRotateMatrix(e))),(e.scaleX!==1||e.scaleY!==1||e.skewX||e.skewY||e.flipX||e.flipY)&&(n=r(n,t.util.calcDimensionsMatrix(e))),n},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,n,r){r>0&&(t>r?t-=r:t=0,n>r?n-=r:n=0);var i,a=!0,o=e.getImageData(t,n,2*r||1,2*r||1),s=o.data.length;for(i=3;i<s&&(a=o.data[i]<=0)!=0;i+=4);return o=null,a},parsePreserveAspectRatioAttribute:function(e){var t,n=`meet`,r=e.split(` `);return r&&r.length&&((n=r.pop())!==`meet`&&n!==`slice`?(t=n,n=`meet`):r.length&&(t=r.pop())),{meetOrSlice:n,alignX:t===`none`?`none`:t.slice(1,4),alignY:t===`none`?`none`:t.slice(5,8)}},clearFabricFontCache:function(e){(e=(e||``).toLowerCase())?t.charWidthsCache[e]&&delete t.charWidthsCache[e]:t.charWidthsCache={}},limitDimsByArea:function(e,t){var n=Math.sqrt(t*e),r=Math.floor(t/n);return{x:Math.floor(n),y:r}},capValue:function(e,t,n){return Math.max(e,Math.min(t,n))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return`matrix(`+e.map(function(e){return t.util.toFixed(e,t.Object.NUM_FRACTION_DIGITS)}).join(` `)+`)`},removeTransformFromObject:function(e,n){var r=t.util.invertTransform(n),i=t.util.multiplyTransformMatrices(r,e.calcOwnMatrix());t.util.applyTransformToObject(e,i)},addTransformToObject:function(e,n){t.util.applyTransformToObject(e,t.util.multiplyTransformMatrices(n,e.calcOwnMatrix()))},applyTransformToObject:function(e,n){var r=t.util.qrDecompose(n),i=new t.Point(r.translateX,r.translateY);e.flipX=!1,e.flipY=!1,e.set(`scaleX`,r.scaleX),e.set(`scaleY`,r.scaleY),e.skewX=r.skewX,e.skewY=r.skewY,e.angle=r.angle,e.setPositionByOrigin(i,`center`,`center`)},sizeAfterTransform:function(e,n,r){var i=e/2,a=n/2,o=[{x:-i,y:-a},{x:i,y:-a},{x:-i,y:a},{x:i,y:a}],s=t.util.calcDimensionsMatrix(r),c=t.util.makeBoundingBoxFromPoints(o,s);return{x:c.width,y:c.height}},mergeClipPaths:function(e,n){var r=e,i=n;r.inverted&&!i.inverted&&(r=n,i=e),t.util.applyTransformToObject(i,t.util.multiplyTransformMatrices(t.util.invertTransform(r.calcTransformMatrix()),i.calcTransformMatrix()));var a=r.inverted&&i.inverted;return a&&(r.inverted=i.inverted=!1),new t.Group([r],{clipPath:i,inverted:a})},hasStyleChanged:function(e,t,n){return n||=!1,e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.textBackgroundColor!==t.textBackgroundColor||e.deltaY!==t.deltaY||n&&(e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough)},stylesToArray:function(e,n){e=t.util.object.clone(e,!0);for(var r=n.split(`
156
- `),i=-1,a={},o=[],s=0;s<r.length;s++)if(e[s])for(var c=0;c<r[s].length;c++){i++;var l=e[s][c];l&&Object.keys(l).length>0&&(t.util.hasStyleChanged(a,l,!0)?o.push({start:i,end:i+1,style:l}):o[o.length-1].end++),a=l||{}}else i+=r[s].length;return o},stylesFromArray:function(e,t){if(!Array.isArray(e))return e;for(var n=t.split(`
157
- `),r=-1,i=0,a={},o=0;o<n.length;o++)for(var s=0;s<n[o].length;s++)r++,e[i]&&e[i].start<=r&&r<e[i].end&&(a[o]=a[o]||{},a[o][s]=Object.assign({},e[i].style),r===e[i].end-1&&i++);return a}}}(e),function(){var e=Array.prototype.join,n={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},r={m:`l`,M:`L`};function i(e,n,r,i,a,o,s,c,l,u,d){var f=t.util.cos(e),p=t.util.sin(e),m=t.util.cos(n),h=t.util.sin(n),g=r*a*m-i*o*h+s,_=i*a*m+r*o*h+c;return[`C`,u+l*(-r*a*p-i*o*f),d+l*(-i*a*p+r*o*f),g+l*(r*a*h+i*o*m),_+l*(i*a*h-r*o*m),g,_]}function a(e,t,n,r){var i=Math.atan2(t,e),a=Math.atan2(r,n);return a>=i?a-i:2*Math.PI-(i-a)}function o(e,n,r){for(var o=r[1],s=r[2],c=r[3],l=r[4],u=r[5],d=function(e,n,r,o,s,c,l){var u=Math.PI,d=l*u/180,f=t.util.sin(d),p=t.util.cos(d),m=0,h=0,g=-p*e*.5-f*n*.5,_=-p*n*.5+f*e*.5,v=(r=Math.abs(r))*r,y=(o=Math.abs(o))*o,b=_*_,x=g*g,S=v*y-v*b-y*x,C=0;if(S<0){var w=Math.sqrt(1-S/(v*y));r*=w,o*=w}else C=(s===c?-1:1)*Math.sqrt(S/(v*b+y*x));var T=C*r*_/o,E=-C*o*g/r,D=p*T-f*E+.5*e,O=f*T+p*E+.5*n,k=a(1,0,(g-T)/r,(_-E)/o),A=a((g-T)/r,(_-E)/o,(-g-T)/r,(-_-E)/o);c===0&&A>0?A-=2*u:c===1&&A<0&&(A+=2*u);for(var j=Math.ceil(Math.abs(A/u*2)),M=[],N=A/j,P=8/3*Math.sin(N/4)*Math.sin(N/4)/Math.sin(N/2),F=k+N,I=0;I<j;I++)M[I]=i(k,F,p,f,r,o,D,O,P,m,h),m=M[I][5],h=M[I][6],k=F,F+=N;return M}(r[6]-e,r[7]-n,o,s,l,u,c),f=0,p=d.length;f<p;f++)d[f][1]+=e,d[f][2]+=n,d[f][3]+=e,d[f][4]+=n,d[f][5]+=e,d[f][6]+=n;return d}function s(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}function c(e,t,n,r,i,a,o,s){return function(c){var l=function(e){return e*e*e}(c),u=function(e){return 3*e*e*(1-e)}(c),d=function(e){return 3*e*(1-e)*(1-e)}(c),f=function(e){return(1-e)*(1-e)*(1-e)}(c);return{x:o*l+i*u+n*d+e*f,y:s*l+a*u+r*d+t*f}}}function l(e,t,n,r,i,a,o,s){return function(c){var l=1-c,u=3*l*l*(n-e)+6*l*c*(i-n)+3*c*c*(o-i),d=3*l*l*(r-t)+6*l*c*(a-r)+3*c*c*(s-a);return Math.atan2(d,u)}}function u(e,t,n,r,i,a){return function(o){var s=function(e){return e*e}(o),c=function(e){return 2*e*(1-e)}(o),l=function(e){return(1-e)*(1-e)}(o);return{x:i*s+n*c+e*l,y:a*s+r*c+t*l}}}function d(e,t,n,r,i,a){return function(o){var s=1-o,c=2*s*(n-e)+2*o*(i-n),l=2*s*(r-t)+2*o*(a-r);return Math.atan2(l,c)}}function f(e,t,n){var r,i,a={x:t,y:n},o=0;for(i=1;i<=100;i+=1)r=e(i/100),o+=s(a.x,a.y,r.x,r.y),a=r;return o}function p(e,t){for(var n,r,i,a=0,o=0,c=e.iterator,l={x:e.x,y:e.y},u=.01,d=e.angleFinder;o<t&&u>1e-4;)n=c(a),i=a,(r=s(l.x,l.y,n.x,n.y))+o>t?(a-=u,u/=2):(l=n,a+=u,o+=r);return n.angle=d(i),n}function m(e){for(var t,n,r,i,a=0,o=e.length,p=0,m=0,h=0,g=0,_=[],v=0;v<o;v++){switch(r={x:p,y:m,command:(t=e[v])[0]},t[0]){case`M`:r.length=0,h=p=t[1],g=m=t[2];break;case`L`:r.length=s(p,m,t[1],t[2]),p=t[1],m=t[2];break;case`C`:n=c(p,m,t[1],t[2],t[3],t[4],t[5],t[6]),i=l(p,m,t[1],t[2],t[3],t[4],t[5],t[6]),r.iterator=n,r.angleFinder=i,r.length=f(n,p,m),p=t[5],m=t[6];break;case`Q`:n=u(p,m,t[1],t[2],t[3],t[4]),i=d(p,m,t[1],t[2],t[3],t[4]),r.iterator=n,r.angleFinder=i,r.length=f(n,p,m),p=t[3],m=t[4];break;case`Z`:case`z`:r.destX=h,r.destY=g,r.length=s(p,m,h,g),p=h,m=g}a+=r.length,_.push(r)}return _.push({length:a,x:p,y:m}),_}t.util.joinPath=function(e){return e.map(function(e){return e.join(` `)}).join(` `)},t.util.parsePath=function(e){var i,a,o,s,c,l=[],u=[],d=t.rePathCommand,f=`[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*`,p=`(`+f+`)`+t.commaWsp,m=`([01])`+t.commaWsp+`?`,h=RegExp(p+`?`+p+`?`+p+m+m+p+`?(`+f+`)`,`g`);if(!e||!e.match)return l;for(var g,_=0,v=(c=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;_<v;_++){s=(i=c[_]).slice(1).trim(),u.length=0;var y=i.charAt(0);if(g=[y],y.toLowerCase()===`a`)for(var b;b=h.exec(s);)for(var x=1;x<b.length;x++)u.push(b[x]);else for(;o=d.exec(s);)u.push(o[0]);x=0;for(var S=u.length;x<S;x++)a=parseFloat(u[x]),isNaN(a)||g.push(a);var C=n[y.toLowerCase()],w=r[y]||y;if(g.length-1>C)for(var T=1,E=g.length;T<E;T+=C)l.push([y].concat(g.slice(T,T+C))),y=w;else l.push(g)}return l},t.util.makePathSimpler=function(e){var t,n,r,i,a,s,c=0,l=0,u=e.length,d=0,f=0,p=[];for(n=0;n<u;++n){switch(r=!1,(t=e[n].slice(0))[0]){case`l`:t[0]=`L`,t[1]+=c,t[2]+=l;case`L`:c=t[1],l=t[2];break;case`h`:t[1]+=c;case`H`:t[0]=`L`,t[2]=l,c=t[1];break;case`v`:t[1]+=l;case`V`:t[0]=`L`,l=t[1],t[1]=c,t[2]=l;break;case`m`:t[0]=`M`,t[1]+=c,t[2]+=l;case`M`:c=t[1],l=t[2],d=t[1],f=t[2];break;case`c`:t[0]=`C`,t[1]+=c,t[2]+=l,t[3]+=c,t[4]+=l,t[5]+=c,t[6]+=l;case`C`:a=t[3],s=t[4],c=t[5],l=t[6];break;case`s`:t[0]=`S`,t[1]+=c,t[2]+=l,t[3]+=c,t[4]+=l;case`S`:i===`C`?(a=2*c-a,s=2*l-s):(a=c,s=l),c=t[3],l=t[4],t[0]=`C`,t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=a,t[2]=s,a=t[3],s=t[4];break;case`q`:t[0]=`Q`,t[1]+=c,t[2]+=l,t[3]+=c,t[4]+=l;case`Q`:a=t[1],s=t[2],c=t[3],l=t[4];break;case`t`:t[0]=`T`,t[1]+=c,t[2]+=l;case`T`:i===`Q`?(a=2*c-a,s=2*l-s):(a=c,s=l),t[0]=`Q`,c=t[1],l=t[2],t[1]=a,t[2]=s,t[3]=c,t[4]=l;break;case`a`:t[0]=`A`,t[6]+=c,t[7]+=l;case`A`:r=!0,p=p.concat(o(c,l,t)),c=t[6],l=t[7];break;case`z`:case`Z`:c=d,l=f}r||p.push(t),i=t[0]}return p},t.util.getSmoothPathFromPoints=function(e,n){var r,i=[],a=new t.Point(e[0].x,e[0].y),o=new t.Point(e[1].x,e[1].y),s=e.length,c=1,l=0,u=s>2;for(n||=0,u&&(c=e[2].x<o.x?-1:e[2].x===o.x?0:1,l=e[2].y<o.y?-1:e[2].y===o.y?0:1),i.push([`M`,a.x-c*n,a.y-l*n]),r=1;r<s;r++){if(!a.eq(o)){var d=a.midPointFrom(o);i.push([`Q`,a.x,a.y,d.x,d.y])}a=e[r],r+1<e.length&&(o=e[r+1])}return u&&(c=a.x>e[r-2].x?1:a.x===e[r-2].x?0:-1,l=a.y>e[r-2].y?1:a.y===e[r-2].y?0:-1),i.push([`L`,a.x+c*n,a.y+l*n]),i},t.util.getPathSegmentsInfo=m,t.util.getBoundsOfCurve=function(n,r,i,a,o,s,c,l){var u;if(t.cachesBoundsOfCurve&&(u=e.call(arguments),t.boundsOfCurveCache[u]))return t.boundsOfCurveCache[u];var d,f,p,m,h,g,_,v,y=Math.sqrt,b=Math.min,x=Math.max,S=Math.abs,C=[],w=[[],[]];f=6*n-12*i+6*o,d=-3*n+9*i-9*o+3*c,p=3*i-3*n;for(var T=0;T<2;++T)if(T>0&&(f=6*r-12*a+6*s,d=-3*r+9*a-9*s+3*l,p=3*a-3*r),S(d)<1e-12){if(S(f)<1e-12)continue;0<(m=-p/f)&&m<1&&C.push(m)}else !((_=f*f-4*p*d)<0)&&(0<(h=(-f+(v=y(_)))/(2*d))&&h<1&&C.push(h),0<(g=(-f-v)/(2*d))&&g<1&&C.push(g));for(var E,D,O,k=C.length,A=k;k--;)E=(O=1-(m=C[k]))*O*O*n+3*O*O*m*i+3*O*m*m*o+m*m*m*c,w[0][k]=E,D=O*O*O*r+3*O*O*m*a+3*O*m*m*s+m*m*m*l,w[1][k]=D;w[0][A]=n,w[1][A]=r,w[0][A+1]=c,w[1][A+1]=l;var j=[{x:b.apply(null,w[0]),y:b.apply(null,w[1])},{x:x.apply(null,w[0]),y:x.apply(null,w[1])}];return t.cachesBoundsOfCurve&&(t.boundsOfCurveCache[u]=j),j},t.util.getPointOnPath=function(e,n,r){r||=m(e);for(var i=0;n-r[i].length>0&&i<r.length-2;)n-=r[i].length,i++;var a,o=r[i],s=n/o.length,c=o.command,l=e[i];switch(c){case`M`:return{x:o.x,y:o.y,angle:0};case`Z`:case`z`:return(a=new t.Point(o.x,o.y).lerp(new t.Point(o.destX,o.destY),s)).angle=Math.atan2(o.destY-o.y,o.destX-o.x),a;case`L`:return(a=new t.Point(o.x,o.y).lerp(new t.Point(l[1],l[2]),s)).angle=Math.atan2(l[2]-o.y,l[1]-o.x),a;case`C`:case`Q`:return p(o,n)}},t.util.transformPath=function(e,n,r){return r&&(n=t.util.multiplyTransformMatrices(n,[1,0,0,1,-r.x,-r.y])),e.map(function(e){for(var r=e.slice(0),i={},a=1;a<e.length-1;a+=2)i.x=e[a],i.y=e[a+1],i=t.util.transformPoint(i,n),r[a]=i.x,r[a+1]=i.y;return r})}}(),function(){var e=Array.prototype.slice;function n(e,t,n){if(e&&e.length!==0){var r=e.length-1,i=t?e[r][t]:e[r];if(t)for(;r--;)n(e[r][t],i)&&(i=e[r][t]);else for(;r--;)n(e[r],i)&&(i=e[r]);return i}}t.util.array={fill:function(e,t){for(var n=e.length;n--;)e[n]=t;return e},invoke:function(t,n){for(var r=e.call(arguments,2),i=[],a=0,o=t.length;a<o;a++)i[a]=r.length?t[a][n].apply(t[a],r):t[a][n].call(t[a]);return i},min:function(e,t){return n(e,t,function(e,t){return e<t})},max:function(e,t){return n(e,t,function(e,t){return e>=t})}}}(),function(){function e(n,r,i){if(i)if(!t.isLikelyNode&&r instanceof Element)n=r;else if(r instanceof Array){n=[];for(var a=0,o=r.length;a<o;a++)n[a]=e({},r[a],i)}else if(r&&typeof r==`object`)for(var s in r)s===`canvas`||s===`group`?n[s]=null:r.hasOwnProperty(s)&&(n[s]=e({},r[s],i));else n=r;else for(var s in r)n[s]=r[s];return n}t.util.object={extend:e,clone:function(t,n){return e({},t,n)}},t.util.object.extend(t.util,t.Observable)}(),function(){function e(e,t){var n=e.charCodeAt(t);if(isNaN(n))return``;if(n<55296||n>57343)return e.charAt(t);if(55296<=n&&n<=56319){if(e.length<=t+1)throw`High surrogate without following low surrogate`;var r=e.charCodeAt(t+1);if(56320>r||r>57343)throw`High surrogate without following low surrogate`;return e.charAt(t)+e.charAt(t+1)}if(t===0)throw`Low surrogate without preceding high surrogate`;var i=e.charCodeAt(t-1);if(55296>i||i>56319)throw`Low surrogate without preceding high surrogate`;return!1}t.util.string={camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():``})},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)},graphemeSplit:function(t){var n,r=0,i=[];for(r=0;r<t.length;r++)!1!==(n=e(t,r))&&i.push(n);return i}}}(),function(){var e=Array.prototype.slice,n=function(){},r=function(){for(var e in{toString:1})if(e===`toString`)return!1;return!0}(),i=function(e,t,n){for(var i in t)i in e.prototype&&typeof e.prototype[i]==`function`&&(t[i]+``).indexOf(`callSuper`)>-1?e.prototype[i]=function(e){return function(){var r=this.constructor.superclass;this.constructor.superclass=n;var i=t[e].apply(this,arguments);if(this.constructor.superclass=r,e!==`initialize`)return i}}(i):e.prototype[i]=t[i],r&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function a(){}function o(t){for(var n=null,r=this;r.constructor.superclass;){var i=r.constructor.superclass.prototype[t];if(r[t]!==i){n=i;break}r=r.constructor.superclass.prototype}return n?arguments.length>1?n.apply(this,e.call(arguments,1)):n.call(this):void 0}t.util.createClass=function(){var t=null,r=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}typeof r[0]==`function`&&(t=r.shift()),s.superclass=t,s.subclasses=[],t&&(a.prototype=t.prototype,s.prototype=new a,t.subclasses.push(s));for(var c=0,l=r.length;c<l;c++)i(s,r[c],t);return s.prototype.initialize||(s.prototype.initialize=n),s.prototype.constructor=s,s.prototype.callSuper=o,s}}(),function(){var e=!!t.document.createElement(`div`).attachEvent,n=[`touchstart`,`touchmove`,`touchend`];t.util.addListener=function(t,n,r,i){t&&t.addEventListener(n,r,!e&&i)},t.util.removeListener=function(t,n,r,i){t&&t.removeEventListener(n,r,!e&&i)},t.util.getPointer=function(e){var n=e.target,r=t.util.getScrollLeftTop(n),i=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:i.clientX+r.left,y:i.clientY+r.top}},t.util.isTouchEvent=function(e){return n.indexOf(e.type)>-1||e.pointerType===`touch`}}(),function(){var e=t.document.createElement(`div`),n=typeof e.style.opacity==`string`,r=typeof e.style.filter==`string`,i=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,a=function(e){return e};n?a=function(e,t){return e.style.opacity=t,e}:r&&(a=function(e,t){var n=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(n.zoom=1),i.test(n.filter)?(t=t>=.9999?``:`alpha(opacity=`+100*t+`)`,n.filter=n.filter.replace(i,t)):n.filter+=` alpha(opacity=`+100*t+`)`,e}),t.util.setStyle=function(e,t){var n=e.style;if(!n)return e;if(typeof t==`string`)return e.style.cssText+=`;`+t,t.indexOf(`opacity`)>-1?a(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var r in t)if(r===`opacity`)a(e,t[r]);else{var i=r===`float`||r===`cssFloat`?typeof n.styleFloat>`u`?`cssFloat`:`styleFloat`:r;n.setProperty(i,t[r])}return e}}(),function(){var e=Array.prototype.slice,n,r,i,a,o=function(t){return e.call(t,0)};try{n=o(t.document.childNodes)instanceof Array}catch{}function s(e,n){var r=t.document.createElement(e);for(var i in n)i===`class`?r.className=n[i]:i===`for`?r.htmlFor=n[i]:r.setAttribute(i,n[i]);return r}function c(e){for(var n=0,r=0,i=t.document.documentElement,a=t.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===t.document?(n=a.scrollLeft||i.scrollLeft||0,r=a.scrollTop||i.scrollTop||0):(n+=e.scrollLeft||0,r+=e.scrollTop||0),e.nodeType!==1||e.style.position!==`fixed`););return{left:n,top:r}}n||(o=function(e){for(var t=Array(e.length),n=e.length;n--;)t[n]=e[n];return t}),r=t.document.defaultView&&t.document.defaultView.getComputedStyle?function(e,n){var r=t.document.defaultView.getComputedStyle(e,null);return r?r[n]:void 0}:function(e,t){var n=e.style[t];return!n&&e.currentStyle&&(n=e.currentStyle[t]),n},i=t.document.documentElement.style,a=`userSelect`in i?`userSelect`:`MozUserSelect`in i?`MozUserSelect`:`WebkitUserSelect`in i?`WebkitUserSelect`:`KhtmlUserSelect`in i?`KhtmlUserSelect`:``,t.util.makeElementUnselectable=function(e){return typeof e.onselectstart<`u`&&(e.onselectstart=t.util.falseFunction),a?e.style[a]=`none`:typeof e.unselectable==`string`&&(e.unselectable=`on`),e},t.util.makeElementSelectable=function(e){return typeof e.onselectstart<`u`&&(e.onselectstart=null),a?e.style[a]=``:typeof e.unselectable==`string`&&(e.unselectable=``),e},t.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},t.util.getById=function(e){return typeof e==`string`?t.document.getElementById(e):e},t.util.toArray=o,t.util.addClass=function(e,t){e&&(` `+e.className+` `).indexOf(` `+t+` `)===-1&&(e.className+=(e.className?` `:``)+t)},t.util.makeElement=s,t.util.wrapElement=function(e,t,n){return typeof t==`string`&&(t=s(t,n)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},t.util.getScrollLeftTop=c,t.util.getElementOffset=function(e){var t,n,i=e&&e.ownerDocument,a={left:0,top:0},o={left:0,top:0},s={borderLeftWidth:`left`,borderTopWidth:`top`,paddingLeft:`left`,paddingTop:`top`};if(!i)return o;for(var l in s)o[s[l]]+=parseInt(r(e,l),10)||0;return t=i.documentElement,typeof e.getBoundingClientRect<`u`&&(a=e.getBoundingClientRect()),n=c(e),{left:a.left+n.left-(t.clientLeft||0)+o.left,top:a.top+n.top-(t.clientTop||0)+o.top}},t.util.getNodeCanvas=function(e){var n=t.jsdomImplForWrapper(e);return n._canvas||n._image},t.util.cleanUpJsdomNode=function(e){if(t.isLikelyNode){var n=t.jsdomImplForWrapper(e);n&&(n._image=null,n._canvas=null,n._currentSrc=null,n._attributes=null,n._classList=null)}}}(),function(){function e(){}t.util.request=function(n,r){r||={};var i=r.method?r.method.toUpperCase():`GET`,a=r.onComplete||function(){},o=new t.window.XMLHttpRequest,s=r.body||r.parameters;return o.onreadystatechange=function(){o.readyState===4&&(a(o),o.onreadystatechange=e)},i===`GET`&&(s=null,typeof r.parameters==`string`&&(n=function(e,t){return e+(/\?/.test(e)?`&`:`?`)+t}(n,r.parameters))),o.open(i,n,!0),(i===`POST`||i===`PUT`)&&o.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),o.send(s),o}}(),t.log=console.log,t.warn=console.warn,function(){var e=t.util.object.extend,n=t.util.object.clone,r=[];function i(){return!1}function a(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}t.util.object.extend(r,{cancelAll:function(){var e=this.splice(0);return e.forEach(function(e){e.cancel()}),e},cancelByCanvas:function(e){if(!e)return[];var t=this.filter(function(t){return typeof t.target==`object`&&t.target.canvas===e});return t.forEach(function(e){e.cancel()}),t},cancelByTarget:function(e){var t=this.findAnimationsByTarget(e);return t.forEach(function(e){e.cancel()}),t},findAnimationIndex:function(e){return this.indexOf(this.findAnimation(e))},findAnimation:function(e){return this.find(function(t){return t.cancel===e})},findAnimationsByTarget:function(e){return e?this.filter(function(t){return t.target===e}):[]}});var o=t.window.requestAnimationFrame||t.window.webkitRequestAnimationFrame||t.window.mozRequestAnimationFrame||t.window.oRequestAnimationFrame||t.window.msRequestAnimationFrame||function(e){return t.window.setTimeout(e,1e3/60)},s=t.window.cancelAnimationFrame||t.window.clearTimeout;function c(){return o.apply(t.window,arguments)}t.util.animate=function(r){r||={};var o,s=!1,l=function(){var e=t.runningAnimations.indexOf(o);return e>-1&&t.runningAnimations.splice(e,1)[0]};return o=e(n(r),{cancel:function(){return s=!0,l()},currentValue:`startValue`in r?r.startValue:0,completionRate:0,durationRate:0}),t.runningAnimations.push(o),c(function(e){var t,n=e||+new Date,u=r.duration||500,d=n+u,f=r.onChange||i,p=r.abort||i,m=r.onComplete||i,h=r.easing||a,g=`startValue`in r&&r.startValue.length>0,_=`startValue`in r?r.startValue:0,v=`endValue`in r?r.endValue:100,y=r.byValue||(g?_.map(function(e,t){return v[t]-_[t]}):v-_);r.onStart&&r.onStart(),function e(r){var i=(t=r||+new Date)>d?u:t-n,a=i/u,b=g?_.map(function(e,t){return h(i,_[t],y[t],u)}):h(i,_,y,u),x=Math.abs(g?(b[0]-_[0])/y[0]:(b-_)/y);if(o.currentValue=g?b.slice():b,o.completionRate=x,o.durationRate=a,!s){if(p(b,x,a))return void l();if(t>d)return o.currentValue=g?v.slice():v,o.completionRate=1,o.durationRate=1,f(g?v.slice():v,1,1),m(v,1,1),void l();f(b,x,a),c(e)}}(n)}),o.cancel},t.util.requestAnimFrame=c,t.util.cancelAnimFrame=function(){return s.apply(t.window,arguments)},t.runningAnimations=r}(),function(){function e(e,t,n){var r=`rgba(`+parseInt(e[0]+n*(t[0]-e[0]),10)+`,`+parseInt(e[1]+n*(t[1]-e[1]),10)+`,`+parseInt(e[2]+n*(t[2]-e[2]),10);return r+=`,`+(e&&t?parseFloat(e[3]+n*(t[3]-e[3])):1),r+=`)`}t.util.animateColor=function(n,r,i,a){var o=new t.Color(n).getSource(),s=new t.Color(r).getSource(),c=a.onComplete,l=a.onChange;return a||={},t.util.animate(t.util.object.extend(a,{duration:i||500,startValue:o,endValue:s,byValue:s,easing:function(t,n,r,i){return e(n,r,a.colorEasing?a.colorEasing(t,i):1-Math.cos(t/i*(Math.PI/2)))},onComplete:function(t,n,r){if(c)return c(e(s,s,0),n,r)},onChange:function(t,n,r){if(l){if(Array.isArray(t))return l(e(t,t,0),n,r);l(t,n,r)}}}))}}(),function(){function e(e,t,n,r){return e<Math.abs(t)?(e=t,r=n/4):r=t===0&&e===0?n/(2*Math.PI)*Math.asin(1):n/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:n,s:r}}function n(e,t,n){return e.a*2**(10*--t)*Math.sin((t*n-e.s)*(2*Math.PI)/e.p)}function r(e,t,n,r){return n-i(r-e,0,n,r)+t}function i(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}t.util.ease={easeInQuad:function(e,t,n,r){return n*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){return n*(e/=r)*e*e+t},easeOutCubic:function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,r){return n*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,r){return n*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t},easeOutSine:function(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,n,r){return e===0?t:n*2**(10*(e/r-1))+t},easeOutExpo:function(e,t,n,r){return e===r?t+n:n*(1-2**(-10*e/r))+t},easeInOutExpo:function(e,t,n,r){return e===0?t:e===r?t+n:(e/=r/2)<1?n/2*2**(10*(e-1))+t:n/2*(2-2**(-10*--e))+t},easeInCirc:function(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,n,r){return(e/=r/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(t,r,i,a){var o=0;return t===0?r:(t/=a)===1?r+i:(o||=.3*a,-n(e(i,i,o,1.70158),t,a)+r)},easeOutElastic:function(t,n,r,i){var a=0;if(t===0)return n;if((t/=i)===1)return n+r;a||=.3*i;var o=e(r,r,a,1.70158);return o.a*2**(-10*t)*Math.sin((t*i-o.s)*(2*Math.PI)/o.p)+o.c+n},easeInOutElastic:function(t,r,i,a){var o=0;if(t===0)return r;if((t/=a/2)==2)return r+i;o||=.3*1.5*a;var s=e(i,i,o,1.70158);return t<1?-.5*n(s,t,a)+r:s.a*2**(-10*--t)*Math.sin((t*a-s.s)*(2*Math.PI)/s.p)*.5+s.c+r},easeInBack:function(e,t,n,r,i){return i===void 0&&(i=1.70158),n*(e/=r)*e*((i+1)*e-i)+t},easeOutBack:function(e,t,n,r,i){return i===void 0&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},easeInOutBack:function(e,t,n,r,i){return i===void 0&&(i=1.70158),(e/=r/2)<1?n/2*(e*e*((1+(i*=1.525))*e-i))+t:n/2*((e-=2)*e*((1+(i*=1.525))*e+i)+2)+t},easeInBounce:r,easeOutBounce:i,easeInOutBounce:function(e,t,n,a){return e<a/2?.5*r(2*e,0,n,a)+t:.5*i(2*e-a,0,n,a)+.5*n+t}}}(),function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,a=t.util.parseUnit,o=t.util.multiplyTransformMatrices,s={cx:`left`,x:`left`,r:`radius`,cy:`top`,y:`top`,display:`visible`,visibility:`visible`,transform:`transformMatrix`,"fill-opacity":`fillOpacity`,"fill-rule":`fillRule`,"font-family":`fontFamily`,"font-size":`fontSize`,"font-style":`fontStyle`,"font-weight":`fontWeight`,"letter-spacing":`charSpacing`,"paint-order":`paintFirst`,"stroke-dasharray":`strokeDashArray`,"stroke-dashoffset":`strokeDashOffset`,"stroke-linecap":`strokeLineCap`,"stroke-linejoin":`strokeLineJoin`,"stroke-miterlimit":`strokeMiterLimit`,"stroke-opacity":`strokeOpacity`,"stroke-width":`strokeWidth`,"text-decoration":`textDecoration`,"text-anchor":`textAnchor`,opacity:`opacity`,"clip-path":`clipPath`,"clip-rule":`clipRule`,"vector-effect":`strokeUniform`,"image-rendering":`imageSmoothing`},c={stroke:`strokeOpacity`,fill:`fillOpacity`},l=`font-size`,u=`clip-path`;function d(e){return e in s?s[e]:e}function f(e,n,r,i){var s,c=Array.isArray(n);if(e!==`fill`&&e!==`stroke`||n!==`none`){if(e===`strokeUniform`)return n===`non-scaling-stroke`;if(e===`strokeDashArray`)n=n===`none`?null:n.replace(/,/g,` `).split(/\s+/).map(parseFloat);else if(e===`transformMatrix`)n=r&&r.transformMatrix?o(r.transformMatrix,t.parseTransformAttribute(n)):t.parseTransformAttribute(n);else if(e===`visible`)n=n!==`none`&&n!==`hidden`,r&&!1===r.visible&&(n=!1);else if(e===`opacity`)n=parseFloat(n),r&&typeof r.opacity<`u`&&(n*=r.opacity);else if(e===`textAnchor`)n=n===`start`?`left`:n===`end`?`right`:`center`;else if(e===`charSpacing`)s=a(n,i)/i*1e3;else if(e===`paintFirst`){var l=n.indexOf(`fill`),u=n.indexOf(`stroke`);n=`fill`,(l>-1&&u>-1&&u<l||l===-1&&u>-1)&&(n=`stroke`)}else{if(e===`href`||e===`xlink:href`||e===`font`)return n;if(e===`imageSmoothing`)return n===`optimizeQuality`;s=c?n.map(a):a(n,i)}}else n=``;return!c&&isNaN(s)?n:s}function p(e){return RegExp(`^(`+e.join(`|`)+`)\\b`,`i`)}function m(e,t){var n,r,i,a,o=[];for(i=0,a=t.length;i<a;i++)n=t[i],r=e.getElementsByTagName(n),o=o.concat(Array.prototype.slice.call(r));return o}function h(e,t){var n,r=!0;return(n=g(e,t.pop()))&&t.length&&(r=function(e,t){for(var n,r=!0;e.parentNode&&e.parentNode.nodeType===1&&t.length;)r&&(n=t.pop()),e=e.parentNode,r=g(e,n);return t.length===0}(e,t)),n&&r&&t.length===0}function g(e,t){var n,r,i=e.nodeName,a=e.getAttribute(`class`),o=e.getAttribute(`id`);if(n=RegExp(`^`+i,`i`),t=t.replace(n,``),o&&t.length&&(n=RegExp(`#`+o+`(?![a-zA-Z\\-]+)`,`i`),t=t.replace(n,``)),a&&t.length)for(r=(a=a.split(` `)).length;r--;)n=RegExp(`\\.`+a[r]+`(?![a-zA-Z\\-]+)`,`i`),t=t.replace(n,``);return t.length===0}function _(e,t){var n;if(e.getElementById&&(n=e.getElementById(t)),n)return n;var r,i,a,o=e.getElementsByTagName(`*`);for(i=0,a=o.length;i<a;i++)if(t===(r=o[i]).getAttribute(`id`))return r}t.svgValidTagNamesRegEx=p([`path`,`circle`,`polygon`,`polyline`,`ellipse`,`rect`,`line`,`image`,`text`]),t.svgViewBoxElementsRegEx=p([`symbol`,`image`,`marker`,`pattern`,`view`,`svg`]),t.svgInvalidAncestorsRegEx=p([`pattern`,`defs`,`symbol`,`metadata`,`clipPath`,`mask`,`desc`]),t.svgValidParentsRegEx=p([`symbol`,`g`,`a`,`svg`,`clipPath`,`defs`]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,n,r){e[r]=Math.tan(t.util.degreesToRadians(n[0]))}var n=t.iMatrix,r=t.reNum,i=t.commaWsp,a=`(?:`+(`(?:(matrix)\\s*\\(\\s*(`+r+`)`+i+`(`+r+`)`+i+`(`+r+`)`+i+`(`+r+`)`+i+`(`+r+`)`+i+`(`+r+`)\\s*\\))`)+`|`+(`(?:(translate)\\s*\\(\\s*(`+r+`)(?:`+i+`(`+r+`))?\\s*\\))`)+`|`+(`(?:(scale)\\s*\\(\\s*(`+r+`)(?:`+i+`(`+r+`))?\\s*\\))`)+`|`+(`(?:(rotate)\\s*\\(\\s*(`+r+`)(?:`+i+`(`+r+`)`+i+`(`+r+`))?\\s*\\))`)+`|`+(`(?:(skewX)\\s*\\(\\s*(`+r+`)\\s*\\))`)+`|`+(`(?:(skewY)\\s*\\(\\s*(`+r+`)\\s*\\))`)+`)`,o=RegExp(`^\\s*(?:`+(`(?:`+a+`(?:`+i+`*`+a+`)*)`)+`?)\\s*$`),s=new RegExp(a,`g`);return function(r){var i=n.concat(),c=[];if(!r||r&&!o.test(r))return i;r.replace(s,function(r){var o=new RegExp(a).exec(r).filter(function(e){return!!e}),s=o[1],l=o.slice(2).map(parseFloat);switch(s){case`translate`:(function(e,t){e[4]=t[0],t.length===2&&(e[5]=t[1])})(i,l);break;case`rotate`:l[0]=t.util.degreesToRadians(l[0]),function(e,n){var r=t.util.cos(n[0]),i=t.util.sin(n[0]),a=0,o=0;n.length===3&&(a=n[1],o=n[2]),e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=a-(r*a-i*o),e[5]=o-(i*a+r*o)}(i,l);break;case`scale`:(function(e,t){var n=t[0],r=t.length===2?t[1]:t[0];e[0]=n,e[3]=r})(i,l);break;case`skewX`:e(i,l,2);break;case`skewY`:e(i,l,1);break;case`matrix`:i=l}c.push(i.concat()),i=n.concat()});for(var l=c[0];c.length>1;)c.shift(),l=t.util.multiplyTransformMatrices(l,c[0]);return l}}();var v=RegExp(`^\\s*(`+t.reNum+`+)\\s*,?\\s*(`+t.reNum+`+)\\s*,?\\s*(`+t.reNum+`+)\\s*,?\\s*(`+t.reNum+`+)\\s*$`);function y(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var n,r,i,o,s,c,l=e.getAttribute(`viewBox`),u=1,d=1,f=e.getAttribute(`width`),p=e.getAttribute(`height`),m=e.getAttribute(`x`)||0,h=e.getAttribute(`y`)||0,g=e.getAttribute(`preserveAspectRatio`)||``,_=!l||!(l=l.match(v)),y=!f||!p||f===`100%`||p===`100%`,b=_&&y,x={},S=``,C=0,w=0;if(x.width=0,x.height=0,x.toBeParsed=b,_&&(m||h)&&e.parentNode&&e.parentNode.nodeName!==`#document`&&(S=` translate(`+a(m)+` `+a(h)+`) `,s=(e.getAttribute(`transform`)||``)+S,e.setAttribute(`transform`,s),e.removeAttribute(`x`),e.removeAttribute(`y`)),b)return x;if(_)return x.width=a(f),x.height=a(p),x;if(n=-parseFloat(l[1]),r=-parseFloat(l[2]),i=parseFloat(l[3]),o=parseFloat(l[4]),x.minX=n,x.minY=r,x.viewBoxWidth=i,x.viewBoxHeight=o,y?(x.width=i,x.height=o):(x.width=a(f),x.height=a(p),u=x.width/i,d=x.height/o),(g=t.util.parsePreserveAspectRatioAttribute(g)).alignX!==`none`&&(g.meetOrSlice===`meet`&&(d=u=u>d?d:u),g.meetOrSlice===`slice`&&(d=u=u>d?u:d),C=x.width-i*u,w=x.height-o*u,g.alignX===`Mid`&&(C/=2),g.alignY===`Mid`&&(w/=2),g.alignX===`Min`&&(C=0),g.alignY===`Min`&&(w=0)),u===1&&d===1&&n===0&&r===0&&m===0&&h===0)return x;if((m||h)&&e.parentNode.nodeName!==`#document`&&(S=` translate(`+a(m)+` `+a(h)+`) `),s=S+` matrix(`+u+` 0 0 `+d+` `+(n*u+C)+` `+(r*d+w)+`) `,e.nodeName===`svg`){for(c=e.ownerDocument.createElementNS(t.svgNS,`g`);e.firstChild;)c.appendChild(e.firstChild);e.appendChild(c)}else (c=e).removeAttribute(`x`),c.removeAttribute(`y`),s=c.getAttribute(`transform`)+s;return c.setAttribute(`transform`,s),x}function b(e,t){var n=`xlink:href`,r=_(e,t.getAttribute(n).slice(1));if(r&&r.getAttribute(n)&&b(e,r),[`gradientTransform`,`x1`,`x2`,`y1`,`y2`,`gradientUnits`,`cx`,`cy`,`r`,`fx`,`fy`].forEach(function(e){r&&!t.hasAttribute(e)&&r.hasAttribute(e)&&t.setAttribute(e,r.getAttribute(e))}),!t.children.length)for(var i=r.cloneNode(!0);i.firstChild;)t.appendChild(i.firstChild);t.removeAttribute(n)}t.parseSVGDocument=function(e,n,i,a){if(e){(function(e){for(var n=m(e,[`use`,`svg:use`]),r=0;n.length&&r<n.length;){var i=n[r],a=i.getAttribute(`xlink:href`)||i.getAttribute(`href`);if(a===null)return;var o,s,c,l,u=a.slice(1),d=i.getAttribute(`x`)||0,f=i.getAttribute(`y`)||0,p=_(e,u).cloneNode(!0),h=(p.getAttribute(`transform`)||``)+` translate(`+d+`, `+f+`)`,g=n.length,v=t.svgNS;if(y(p),/^svg$/i.test(p.nodeName)){var b=p.ownerDocument.createElementNS(v,`g`);for(s=0,l=(c=p.attributes).length;s<l;s++)o=c.item(s),b.setAttributeNS(v,o.nodeName,o.nodeValue);for(;p.firstChild;)b.appendChild(p.firstChild);p=b}for(s=0,l=(c=i.attributes).length;s<l;s++)(o=c.item(s)).nodeName!==`x`&&o.nodeName!==`y`&&o.nodeName!==`xlink:href`&&o.nodeName!==`href`&&(o.nodeName===`transform`?h=o.nodeValue+` `+h:p.setAttribute(o.nodeName,o.nodeValue));p.setAttribute(`transform`,h),p.setAttribute(`instantiated_by_use`,`1`),p.removeAttribute(`id`),i.parentNode.replaceChild(p,i),n.length===g&&r++}})(e);var o,s,c=t.Object.__uid++,l=y(e),u=t.util.toArray(e.getElementsByTagName(`*`));if(l.crossOrigin=a&&a.crossOrigin,l.svgUid=c,u.length===0&&t.isLikelyNode){var d=[];for(o=0,s=(u=e.selectNodes(`//*[name(.)!="svg"]`)).length;o<s;o++)d[o]=u[o];u=d}var f=u.filter(function(e){return y(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace(`svg:`,``))&&!function(e,t){for(;e&&=e.parentNode;)if(e.nodeName&&t.test(e.nodeName.replace(`svg:`,``))&&!e.getAttribute(`instantiated_by_use`))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)});if(!f||f&&!f.length)return void(n&&n([],{}));var p={};u.filter(function(e){return e.nodeName.replace(`svg:`,``)===`clipPath`}).forEach(function(e){var n=e.getAttribute(`id`);p[n]=t.util.toArray(e.getElementsByTagName(`*`)).filter(function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace(`svg:`,``))})}),t.gradientDefs[c]=t.getGradientDefs(e),t.cssRules[c]=t.getCSSRules(e),t.clipPaths[c]=p,t.parseElements(f,function(e,r){n&&(n(e,l,r,u),delete t.gradientDefs[c],delete t.cssRules[c],delete t.clipPaths[c])},r(l),i,a)}};var x=RegExp(`(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(`+t.reNum+`(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|`+t.reNum+`))?\\s+(.*)`);n(t,{parseFontDeclaration:function(e,t){var n=e.match(x);if(n){var r=n[1],i=n[3],o=n[4],s=n[5],c=n[6];r&&(t.fontStyle=r),i&&(t.fontWeight=isNaN(parseFloat(i))?i:parseFloat(i)),o&&(t.fontSize=a(o)),c&&(t.fontFamily=c),s&&(t.lineHeight=s===`normal`?1:s)}},getGradientDefs:function(e){var t,n=m(e,[`linearGradient`,`radialGradient`,`svg:linearGradient`,`svg:radialGradient`]),r=0,i={};for(r=n.length;r--;)(t=n[r]).getAttribute(`xlink:href`)&&b(e,t),i[t.getAttribute(`id`)]=t;return i},parseAttributes:function(e,r,o){if(e){var s,p,m,g={};typeof o>`u`&&(o=e.getAttribute(`svgUid`)),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(g=t.parseAttributes(e.parentNode,r,o));var _=r.reduce(function(t,n){return(s=e.getAttribute(n))&&(t[n]=s),t},{}),v=n(function(e,n){var r={};for(var i in t.cssRules[n])if(h(e,i.split(` `)))for(var a in t.cssRules[n][i])r[a]=t.cssRules[n][i][a];return r}(e,o),t.parseStyleAttribute(e));_=n(_,v),v[u]&&e.setAttribute(u,v[u]),p=m=g.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,_[l]&&(_[l]=p=a(_[l],m));var y,b,x={};for(var S in _)b=f(y=d(S),_[S],g,p),x[y]=b;x&&x.font&&t.parseFontDeclaration(x.font,x);var C=n(g,x);return t.svgValidParentsRegEx.test(e.nodeName)?C:function(e){for(var n in c)if(!(typeof e[c[n]]>`u`||e[n]===``)){if(typeof e[n]>`u`){if(!t.Object.prototype[n])continue;e[n]=t.Object.prototype[n]}if(e[n].indexOf(`url(`)!==0){var r=new t.Color(e[n]);e[n]=r.setAlpha(i(r.getAlpha()*e[c[n]],2)).toRgba()}}return e}(C)}},parseElements:function(e,n,r,i,a){new t.ElementsParser(e,n,r,i,a).parse()},parseStyleAttribute:function(e){var t={},n=e.getAttribute(`style`);return n&&(typeof n==`string`?function(e,t){var n,r;e.replace(/;\s*$/,``).split(`;`).forEach(function(e){var i=e.split(`:`);n=i[0].trim().toLowerCase(),r=i[1].trim(),t[n]=r})}(n,t):function(e,t){var n,r;for(var i in e)typeof e[i]>`u`||(n=i.toLowerCase(),r=e[i],t[n]=r)}(n,t)),t},parsePointsAttribute:function(e){if(!e)return null;var t,n,r=[];for(t=0,n=(e=(e=e.replace(/,/g,` `).trim()).split(/\s+/)).length;t<n;t+=2)r.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return r},getCSSRules:function(e){var n,r,i=e.getElementsByTagName(`style`),a={};for(n=0,r=i.length;n<r;n++){var o=i[n].textContent;(o=o.replace(/\/\*[\s\S]*?\*\//g,``)).trim()!==``&&o.split(`}`).filter(function(e){return e.trim()}).forEach(function(e){var i=e.split(`{`),o={},s=i[1].trim().split(`;`).filter(function(e){return e.trim()});for(n=0,r=s.length;n<r;n++){var c=s[n].split(`:`),l=c[0].trim();o[l]=c[1].trim()}(e=i[0].trim()).split(`,`).forEach(function(e){(e=e.replace(/^svg/i,``).trim())!==``&&(a[e]?t.util.object.extend(a[e],o):a[e]=t.util.object.clone(o))})})}return a},loadSVGFromURL:function(e,n,r,i){e=e.replace(/^\n\s*/,``).trim(),new t.util.request(e,{method:`get`,onComplete:function(e){var a=e.responseXML;if(!a||!a.documentElement)return n&&n(null),!1;t.parseSVGDocument(a.documentElement,function(e,t,r,i){n&&n(e,t,r,i)},r,i)}})},loadSVGFromString:function(e,n,r,i){var a=new t.window.DOMParser().parseFromString(e.trim(),`text/xml`);t.parseSVGDocument(a.documentElement,function(e,t,r,i){n(e,t,r,i)},r,i)}})}(e),t.ElementsParser=function(e,t,n,r,i,a){this.elements=e,this.callback=t,this.options=n,this.reviver=r,this.svgUid=n&&n.svgUid||0,this.parsingOptions=i,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=a},function(e){e.parse=function(){this.instances=Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},e.createObjects=function(){var e=this;this.elements.forEach(function(t,n){t.setAttribute(`svgUid`,e.svgUid),e.createObject(t,n)})},e.findTag=function(e){return t[t.util.string.capitalize(e.tagName.replace(`svg:`,``))]},e.createObject=function(e,n){var r=this.findTag(e);if(r&&r.fromElement)try{r.fromElement(e,this.createCallback(n,e),this.options)}catch(e){t.log(e)}else this.checkIfDone()},e.createCallback=function(e,n){var r=this;return function(i){var a;r.resolveGradient(i,n,`fill`),r.resolveGradient(i,n,`stroke`),i instanceof t.Image&&i._originalElement&&(a=i.parsePreserveAspectRatioAttribute(n)),i._removeTransformMatrix(a),r.resolveClipPath(i,n),r.reviver&&r.reviver(n,i),r.instances[e]=i,r.checkIfDone()}},e.extractPropertyDefinition=function(e,n,r){var i=e[n],a=this.regexUrl;if(a.test(i)){a.lastIndex=0;var o=a.exec(i)[1];return a.lastIndex=0,t[r][this.svgUid][o]}},e.resolveGradient=function(e,n,r){var i=this.extractPropertyDefinition(e,r,`gradientDefs`);if(i){var a=n.getAttribute(r+`-opacity`),o=t.Gradient.fromElement(i,e,a,this.options);e.set(r,o)}},e.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},e.resolveClipPath=function(e,n){var r,i,a,o,s=this.extractPropertyDefinition(e,`clipPath`,`clipPaths`);if(s){a=[],i=t.util.invertTransform(e.calcTransformMatrix());for(var c=s[0].parentNode,l=n;l.parentNode&&l.getAttribute(`clip-path`)!==e.clipPath;)l=l.parentNode;l.parentNode.appendChild(c);for(var u=0;u<s.length;u++)r=s[u],this.findTag(r).fromElement(r,this.createClipPathCallback(e,a),this.options);s=a.length===1?a[0]:new t.Group(a),o=t.util.multiplyTransformMatrices(i,s.calcTransformMatrix()),s.clipPath&&this.resolveClipPath(s,l);var d=t.util.qrDecompose(o);s.flipX=!1,s.flipY=!1,s.set(`scaleX`,d.scaleX),s.set(`scaleY`,d.scaleY),s.angle=d.angle,s.skewX=d.skewX,s.skewY=0,s.setPositionByOrigin({x:d.translateX,y:d.translateY},`center`,`center`),e.clipPath=s}else delete e.clipPath},e.checkIfDone=function(){--this.numElements===0&&(this.instances=this.instances.filter(function(e){return e!=null}),this.callback(this.instances,this.elements))}}(t.ElementsParser.prototype),function(e){var t=e.fabric||={};function n(e,t){this.x=e,this.y=t}t.Point?t.warn(`fabric.Point is already defined`):(t.Point=n,n.prototype={type:`point`,constructor:n,add:function(e){return new n(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new n(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new n(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new n(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new n(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new n(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return typeof t>`u`&&(t=.5),t=Math.max(Math.min(1,t),0),new n(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new n(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new n(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+`,`+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,n=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=n},clone:function(){return new n(this.x,this.y)}})}(e),function(e){var t=e.fabric||={};function n(e){this.status=e,this.points=[]}t.Intersection?t.warn(`fabric.Intersection is already defined`):(t.Intersection=n,t.Intersection.prototype={constructor:n,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,r,i,a){var o,s=(a.x-i.x)*(e.y-i.y)-(a.y-i.y)*(e.x-i.x),c=(r.x-e.x)*(e.y-i.y)-(r.y-e.y)*(e.x-i.x),l=(a.y-i.y)*(r.x-e.x)-(a.x-i.x)*(r.y-e.y);if(l!==0){var u=s/l,d=c/l;0<=u&&u<=1&&0<=d&&d<=1?(o=new n(`Intersection`)).appendPoint(new t.Point(e.x+u*(r.x-e.x),e.y+u*(r.y-e.y))):o=new n}else o=new n(s===0||c===0?`Coincident`:`Parallel`);return o},t.Intersection.intersectLinePolygon=function(e,t,r){var i,a,o,s,c=new n,l=r.length;for(s=0;s<l;s++)i=r[s],a=r[(s+1)%l],o=n.intersectLineLine(e,t,i,a),c.appendPoints(o.points);return c.points.length>0&&(c.status=`Intersection`),c},t.Intersection.intersectPolygonPolygon=function(e,t){var r,i=new n,a=e.length;for(r=0;r<a;r++){var o=e[r],s=e[(r+1)%a],c=n.intersectLinePolygon(o,s,t);i.appendPoints(c.points)}return i.points.length>0&&(i.status=`Intersection`),i},t.Intersection.intersectPolygonRectangle=function(e,r,i){var a=r.min(i),o=r.max(i),s=new t.Point(o.x,a.y),c=new t.Point(a.x,o.y),l=n.intersectLinePolygon(a,s,e),u=n.intersectLinePolygon(s,o,e),d=n.intersectLinePolygon(o,c,e),f=n.intersectLinePolygon(c,a,e),p=new n;return p.appendPoints(l.points),p.appendPoints(u.points),p.appendPoints(d.points),p.appendPoints(f.points),p.points.length>0&&(p.status=`Intersection`),p})}(e),function(e){var t=e.fabric||={};function n(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function r(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}t.Color?t.warn(`fabric.Color is already defined.`):(t.Color=n,t.Color.prototype={_tryParsingColor:function(e){var t;e in n.colorNameMap&&(e=n.colorNameMap[e]),e===`transparent`&&(t=[255,255,255,0]),t||=n.sourceFromHex(e),t||=n.sourceFromRgb(e),t||=n.sourceFromHsl(e),t||=[0,0,0,1],t&&this.setSource(t)},_rgbToHsl:function(e,n,r){e/=255,n/=255,r/=255;var i,a,o,s=t.util.array.max([e,n,r]),c=t.util.array.min([e,n,r]);if(o=(s+c)/2,s===c)i=a=0;else{var l=s-c;switch(a=o>.5?l/(2-s-c):l/(s+c),s){case e:i=(n-r)/l+(n<r?6:0);break;case n:i=(r-e)/l+2;break;case r:i=(e-n)/l+4}i/=6}return[Math.round(360*i),Math.round(100*a),Math.round(100*o)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return`rgb(`+e[0]+`,`+e[1]+`,`+e[2]+`)`},toRgba:function(){var e=this.getSource();return`rgba(`+e[0]+`,`+e[1]+`,`+e[2]+`,`+e[3]+`)`},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return`hsl(`+t[0]+`,`+t[1]+`%,`+t[2]+`%)`},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return`hsla(`+t[0]+`,`+t[1]+`%,`+t[2]+`%,`+e[3]+`)`},toHex:function(){var e,t,n,r=this.getSource();return e=(e=r[0].toString(16)).length===1?`0`+e:e,t=(t=r[1].toString(16)).length===1?`0`+t:t,n=(n=r[2].toString(16)).length===1?`0`+n:n,e.toUpperCase()+t.toUpperCase()+n.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=(e=(e=Math.round(255*t[3])).toString(16)).length===1?`0`+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),n=e[3];return this.setSource([t,t,t,n]),this},toBlackWhite:function(e){var t=this.getSource(),n=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),r=t[3];return e||=127,n=Number(n)<Number(e)?0:255,this.setSource([n,n,n,r]),this},overlayWith:function(e){e instanceof n||(e=new n(e));var t,r=[],i=this.getAlpha(),a=this.getSource(),o=e.getSource();for(t=0;t<3;t++)r.push(Math.round(.5*a[t]+.5*o[t]));return r[3]=i,this.setSource(r),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={aliceblue:`#F0F8FF`,antiquewhite:`#FAEBD7`,aqua:`#00FFFF`,aquamarine:`#7FFFD4`,azure:`#F0FFFF`,beige:`#F5F5DC`,bisque:`#FFE4C4`,black:`#000000`,blanchedalmond:`#FFEBCD`,blue:`#0000FF`,blueviolet:`#8A2BE2`,brown:`#A52A2A`,burlywood:`#DEB887`,cadetblue:`#5F9EA0`,chartreuse:`#7FFF00`,chocolate:`#D2691E`,coral:`#FF7F50`,cornflowerblue:`#6495ED`,cornsilk:`#FFF8DC`,crimson:`#DC143C`,cyan:`#00FFFF`,darkblue:`#00008B`,darkcyan:`#008B8B`,darkgoldenrod:`#B8860B`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,darkgreen:`#006400`,darkkhaki:`#BDB76B`,darkmagenta:`#8B008B`,darkolivegreen:`#556B2F`,darkorange:`#FF8C00`,darkorchid:`#9932CC`,darkred:`#8B0000`,darksalmon:`#E9967A`,darkseagreen:`#8FBC8F`,darkslateblue:`#483D8B`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,darkturquoise:`#00CED1`,darkviolet:`#9400D3`,deeppink:`#FF1493`,deepskyblue:`#00BFFF`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1E90FF`,firebrick:`#B22222`,floralwhite:`#FFFAF0`,forestgreen:`#228B22`,fuchsia:`#FF00FF`,gainsboro:`#DCDCDC`,ghostwhite:`#F8F8FF`,gold:`#FFD700`,goldenrod:`#DAA520`,gray:`#808080`,grey:`#808080`,green:`#008000`,greenyellow:`#ADFF2F`,honeydew:`#F0FFF0`,hotpink:`#FF69B4`,indianred:`#CD5C5C`,indigo:`#4B0082`,ivory:`#FFFFF0`,khaki:`#F0E68C`,lavender:`#E6E6FA`,lavenderblush:`#FFF0F5`,lawngreen:`#7CFC00`,lemonchiffon:`#FFFACD`,lightblue:`#ADD8E6`,lightcoral:`#F08080`,lightcyan:`#E0FFFF`,lightgoldenrodyellow:`#FAFAD2`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,lightgreen:`#90EE90`,lightpink:`#FFB6C1`,lightsalmon:`#FFA07A`,lightseagreen:`#20B2AA`,lightskyblue:`#87CEFA`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#B0C4DE`,lightyellow:`#FFFFE0`,lime:`#00FF00`,limegreen:`#32CD32`,linen:`#FAF0E6`,magenta:`#FF00FF`,maroon:`#800000`,mediumaquamarine:`#66CDAA`,mediumblue:`#0000CD`,mediumorchid:`#BA55D3`,mediumpurple:`#9370DB`,mediumseagreen:`#3CB371`,mediumslateblue:`#7B68EE`,mediumspringgreen:`#00FA9A`,mediumturquoise:`#48D1CC`,mediumvioletred:`#C71585`,midnightblue:`#191970`,mintcream:`#F5FFFA`,mistyrose:`#FFE4E1`,moccasin:`#FFE4B5`,navajowhite:`#FFDEAD`,navy:`#000080`,oldlace:`#FDF5E6`,olive:`#808000`,olivedrab:`#6B8E23`,orange:`#FFA500`,orangered:`#FF4500`,orchid:`#DA70D6`,palegoldenrod:`#EEE8AA`,palegreen:`#98FB98`,paleturquoise:`#AFEEEE`,palevioletred:`#DB7093`,papayawhip:`#FFEFD5`,peachpuff:`#FFDAB9`,peru:`#CD853F`,pink:`#FFC0CB`,plum:`#DDA0DD`,powderblue:`#B0E0E6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#FF0000`,rosybrown:`#BC8F8F`,royalblue:`#4169E1`,saddlebrown:`#8B4513`,salmon:`#FA8072`,sandybrown:`#F4A460`,seagreen:`#2E8B57`,seashell:`#FFF5EE`,sienna:`#A0522D`,silver:`#C0C0C0`,skyblue:`#87CEEB`,slateblue:`#6A5ACD`,slategray:`#708090`,slategrey:`#708090`,snow:`#FFFAFA`,springgreen:`#00FF7F`,steelblue:`#4682B4`,tan:`#D2B48C`,teal:`#008080`,thistle:`#D8BFD8`,tomato:`#FF6347`,turquoise:`#40E0D0`,violet:`#EE82EE`,wheat:`#F5DEB3`,white:`#FFFFFF`,whitesmoke:`#F5F5F5`,yellow:`#FFFF00`,yellowgreen:`#9ACD32`},t.Color.fromRgb=function(e){return n.fromSource(n.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(n.reRGBa);if(t){var r=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),i=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),a=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(r,10),parseInt(i,10),parseInt(a,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=n.fromRgb,t.Color.fromHsl=function(e){return n.fromSource(n.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(n.reHSLa);if(t){var i,a,o,s=(parseFloat(t[1])%360+360)%360/360,c=parseFloat(t[2])/(/%$/.test(t[2])?100:1),l=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(c===0)i=a=o=l;else{var u=l<=.5?l*(c+1):l+c-l*c,d=2*l-u;i=r(d,u,s+1/3),a=r(d,u,s),o=r(d,u,s-1/3)}return[Math.round(255*i),Math.round(255*a),Math.round(255*o),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=n.fromHsl,t.Color.fromHex=function(e){return n.fromSource(n.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(n.reHex)){var t=e.slice(e.indexOf(`#`)+1),r=t.length===3||t.length===4,i=t.length===8||t.length===4,a=r?t.charAt(0)+t.charAt(0):t.substring(0,2),o=r?t.charAt(1)+t.charAt(1):t.substring(2,4),s=r?t.charAt(2)+t.charAt(2):t.substring(4,6),c=i?r?t.charAt(3)+t.charAt(3):t.substring(6,8):`FF`;return[parseInt(a,16),parseInt(o,16),parseInt(s,16),parseFloat((parseInt(c,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new n;return t.setSource(e),t})}(e),function(e){var t=e.fabric||={},n=[`e`,`se`,`s`,`sw`,`w`,`nw`,`n`,`ne`,`e`],r=[`ns`,`nesw`,`ew`,`nwse`],i={},a=`left`,o=`top`,s=`right`,c=`bottom`,l=`center`,u={top:c,bottom:o,left:s,right:a,center:l},d=t.util.radiansToDegrees,f=Math.sign||function(e){return(e>0)-(e<0)||+e};function p(e,t){var n=e.angle+d(Math.atan2(t.y,t.x))+360;return Math.round(n%360/45)}function m(e,n){var r=n.transform.target,i=r.canvas,a=t.util.object.clone(n);a.target=r,i&&i.fire(`object:`+e,a),r.fire(e,n)}function h(e,t){var n=t.canvas,r=e[n.uniScaleKey];return n.uniformScaling&&!r||!n.uniformScaling&&r}function g(e){return e.originX===l&&e.originY===l}function _(e,t,n){var r=e.lockScalingX,i=e.lockScalingY;return!!(r&&i||!t&&(r||i)&&n||r&&t===`x`||i&&t===`y`)}function v(e,t,n,r){return{e,transform:t,pointer:{x:n,y:r}}}function y(e){return function(t,n,r,i){var a=n.target,o=a.getCenterPoint(),s=a.translateToOriginPoint(o,n.originX,n.originY),c=e(t,n,r,i);return a.setPositionByOrigin(s,n.originX,n.originY),c}}function b(e,t){return function(n,r,i,a){var o=t(n,r,i,a);return o&&m(e,v(n,r,i,a)),o}}function x(e,n,r,i,a){var o=e.target,s=o.controls[e.corner],c=o.canvas.getZoom(),l=o.padding/c,u=o.toLocalPoint(new t.Point(i,a),n,r);return u.x>=l&&(u.x-=l),u.x<=-l&&(u.x+=l),u.y>=l&&(u.y-=l),u.y<=l&&(u.y+=l),u.x-=s.offsetX,u.y-=s.offsetY,u}function S(e){return e.flipX!==e.flipY}function C(e,t,n,r,i){if(e[t]!==0){var a=i/e._getTransformedDimensions()[r]*e[n];e.set(n,a)}}function w(e,t,n,r){var i,l=t.target,u=l._getTransformedDimensions(0,l.skewY),f=x(t,t.originX,t.originY,n,r),p=Math.abs(2*f.x)-u.x,m=l.skewX;p<2?i=0:(i=d(Math.atan2(p/l.scaleX,u.y/l.scaleY)),t.originX===a&&t.originY===c&&(i=-i),t.originX===s&&t.originY===o&&(i=-i),S(l)&&(i=-i));var h=m!==i;if(h){var g=l._getTransformedDimensions().y;l.set(`skewX`,i),C(l,`skewY`,`scaleY`,`y`,g)}return h}function T(e,t,n,r){var i,l=t.target,u=l._getTransformedDimensions(l.skewX,0),f=x(t,t.originX,t.originY,n,r),p=Math.abs(2*f.y)-u.y,m=l.skewY;p<2?i=0:(i=d(Math.atan2(p/l.scaleY,u.x/l.scaleX)),t.originX===a&&t.originY===c&&(i=-i),t.originX===s&&t.originY===o&&(i=-i),S(l)&&(i=-i));var h=m!==i;if(h){var g=l._getTransformedDimensions().x;l.set(`skewY`,i),C(l,`skewX`,`scaleX`,`x`,g)}return h}function E(e,t,n,r,i){i||={};var a,o,s,c,l,d,p=t.target,m=p.lockScalingX,v=p.lockScalingY,y=i.by,b=h(e,p),S=_(p,y,b),C=t.gestureScale;if(S)return!1;if(C)o=t.scaleX*C,s=t.scaleY*C;else{if(a=x(t,t.originX,t.originY,n,r),l=y===`y`?1:f(a.x),d=y===`x`?1:f(a.y),t.signX||=l,t.signY||=d,p.lockScalingFlip&&(t.signX!==l||t.signY!==d))return!1;if(c=p._getTransformedDimensions(),b&&!y){var w=Math.abs(a.x)+Math.abs(a.y),T=t.original,E=w/(Math.abs(c.x*T.scaleX/p.scaleX)+Math.abs(c.y*T.scaleY/p.scaleY));o=T.scaleX*E,s=T.scaleY*E}else o=Math.abs(a.x*p.scaleX/c.x),s=Math.abs(a.y*p.scaleY/c.y);g(t)&&(o*=2,s*=2),t.signX!==l&&y!==`y`&&(t.originX=u[t.originX],o*=-1,t.signX=l),t.signY!==d&&y!==`x`&&(t.originY=u[t.originY],s*=-1,t.signY=d)}var D=p.scaleX,O=p.scaleY;return y?(y===`x`&&p.set(`scaleX`,o),y===`y`&&p.set(`scaleY`,s)):(!m&&p.set(`scaleX`,o),!v&&p.set(`scaleY`,s)),D!==p.scaleX||O!==p.scaleY}i.scaleCursorStyleHandler=function(e,t,r){var i=h(e,r),a=``;return t.x!==0&&t.y===0?a=`x`:t.x===0&&t.y!==0&&(a=`y`),_(r,a,i)?`not-allowed`:n[p(r,t)]+`-resize`},i.skewCursorStyleHandler=function(e,t,n){return t.x!==0&&n.lockSkewingY||t.y!==0&&n.lockSkewingX?`not-allowed`:r[p(n,t)%4]+`-resize`},i.scaleSkewCursorStyleHandler=function(e,t,n){return e[n.canvas.altActionKey]?i.skewCursorStyleHandler(e,t,n):i.scaleCursorStyleHandler(e,t,n)},i.rotationWithSnapping=b(`rotating`,y(function(e,t,n,r){var i=t,a=i.target,o=a.translateToOriginPoint(a.getCenterPoint(),i.originX,i.originY);if(a.lockRotation)return!1;var s,c=Math.atan2(i.ey-o.y,i.ex-o.x),l=d(Math.atan2(r-o.y,n-o.x)-c+i.theta);if(a.snapAngle>0){var u=a.snapAngle,f=a.snapThreshold||u,p=Math.ceil(l/u)*u,m=Math.floor(l/u)*u;Math.abs(l-m)<f?l=m:Math.abs(l-p)<f&&(l=p)}return l<0&&(l=360+l),l%=360,s=a.angle!==l,a.angle=l,s})),i.scalingEqually=b(`scaling`,y(function(e,t,n,r){return E(e,t,n,r)})),i.scalingX=b(`scaling`,y(function(e,t,n,r){return E(e,t,n,r,{by:`x`})})),i.scalingY=b(`scaling`,y(function(e,t,n,r){return E(e,t,n,r,{by:`y`})})),i.scalingYOrSkewingX=function(e,t,n,r){return e[t.target.canvas.altActionKey]?i.skewHandlerX(e,t,n,r):i.scalingY(e,t,n,r)},i.scalingXOrSkewingY=function(e,t,n,r){return e[t.target.canvas.altActionKey]?i.skewHandlerY(e,t,n,r):i.scalingX(e,t,n,r)},i.changeWidth=b(`resizing`,y(function(e,t,n,r){var i=t.target,a=x(t,t.originX,t.originY,n,r),o=i.strokeWidth/(i.strokeUniform?i.scaleX:1),s=g(t)?2:1,c=i.width,l=Math.abs(a.x*s/i.scaleX)-o;return i.set(`width`,Math.max(l,0)),c!==l})),i.skewHandlerX=function(e,t,n,r){var i,c=t.target,u=c.skewX,d=t.originY;return!c.lockSkewingX&&(u===0?i=x(t,l,l,n,r).x>0?a:s:(u>0&&(i=d===o?a:s),u<0&&(i=d===o?s:a),S(c)&&(i=i===a?s:a)),t.originX=i,b(`skewing`,y(w))(e,t,n,r))},i.skewHandlerY=function(e,t,n,r){var i,s=t.target,u=s.skewY,d=t.originX;return!s.lockSkewingY&&(u===0?i=x(t,l,l,n,r).y>0?o:c:(u>0&&(i=d===a?o:c),u<0&&(i=d===a?c:o),S(s)&&(i=i===o?c:o)),t.originY=i,b(`skewing`,y(T))(e,t,n,r))},i.dragHandler=function(e,t,n,r){var i=t.target,a=n-t.offsetX,o=r-t.offsetY,s=!i.get(`lockMovementX`)&&i.left!==a,c=!i.get(`lockMovementY`)&&i.top!==o;return s&&i.set(`left`,a),c&&i.set(`top`,o),(s||c)&&m(`moving`,v(e,t,n,r)),s||c},i.scaleOrSkewActionName=function(e,t,n){var r=e[n.canvas.altActionKey];return t.x===0?r?`skewX`:`scaleY`:t.y===0?r?`skewY`:`scaleX`:void 0},i.rotationStyleHandler=function(e,t,n){return n.lockRotation?`not-allowed`:t.cursorStyle},i.fireEvent=m,i.wrapWithFixedAnchor=y,i.wrapWithFireEvent=b,i.getLocalPoint=x,t.controlsUtils=i}(e),function(e){var t=e.fabric||={},n=t.util.degreesToRadians,r=t.controlsUtils;r.renderCircleControl=function(e,t,n,r,i){r||={};var a,o=this.sizeX||r.cornerSize||i.cornerSize,s=this.sizeY||r.cornerSize||i.cornerSize,c=typeof r.transparentCorners<`u`?r.transparentCorners:i.transparentCorners,l=c?`stroke`:`fill`,u=!c&&(r.cornerStrokeColor||i.cornerStrokeColor),d=t,f=n;e.save(),e.fillStyle=r.cornerColor||i.cornerColor,e.strokeStyle=r.cornerStrokeColor||i.cornerStrokeColor,o>s?(a=o,e.scale(1,s/o),f=n*o/s):s>o?(a=s,e.scale(o/s,1),d=t*s/o):a=o,e.lineWidth=1,e.beginPath(),e.arc(d,f,a/2,0,2*Math.PI,!1),e[l](),u&&e.stroke(),e.restore()},r.renderSquareControl=function(e,t,r,i,a){i||={};var o=this.sizeX||i.cornerSize||a.cornerSize,s=this.sizeY||i.cornerSize||a.cornerSize,c=typeof i.transparentCorners<`u`?i.transparentCorners:a.transparentCorners,l=c?`stroke`:`fill`,u=!c&&(i.cornerStrokeColor||a.cornerStrokeColor),d=o/2,f=s/2;e.save(),e.fillStyle=i.cornerColor||a.cornerColor,e.strokeStyle=i.cornerStrokeColor||a.cornerStrokeColor,e.lineWidth=1,e.translate(t,r),e.rotate(n(a.angle)),e[l+`Rect`](-d,-f,o,s),u&&e.strokeRect(-d,-f,o,s),e.restore()}}(e),function(e){var t=e.fabric||={};t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:`scale`,angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:`crosshair`,withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var n=e._controlsVisibility;return n&&typeof n[t]<`u`?n[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,n){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},n)},calcCornerCoords:function(e,n,r,i,a){var o,s,c,l,u=a?this.touchSizeX:this.sizeX,d=a?this.touchSizeY:this.sizeY;if(u&&d&&u!==d){var f=Math.atan2(d,u),p=Math.sqrt(u*u+d*d)/2,m=f-t.util.degreesToRadians(e),h=Math.PI/2-f-t.util.degreesToRadians(e);o=p*t.util.cos(m),s=p*t.util.sin(m),c=p*t.util.cos(h),l=p*t.util.sin(h)}else p=.7071067812*(u&&d?u:n),m=t.util.degreesToRadians(45-e),o=c=p*t.util.cos(m),s=l=p*t.util.sin(m);return{tl:{x:r-l,y:i-c},tr:{x:r+o,y:i-s},bl:{x:r-o,y:i+s},br:{x:r+l,y:i+c}}},render:function(e,n,r,i,a){((i||={}).cornerStyle||a.cornerStyle)===`circle`?t.controlsUtils.renderCircleControl.call(this,e,n,r,i,a):t.controlsUtils.renderSquareControl.call(this,e,n,r,i,a)}}}(e),function(){function e(e,n){var r,i,a,o,s=e.getAttribute(`style`),c=e.getAttribute(`offset`)||0;if(c=(c=parseFloat(c)/(/%$/.test(c)?100:1))<0?0:c>1?1:c,s){var l=s.split(/\s*;\s*/);for(l[l.length-1]===``&&l.pop(),o=l.length;o--;){var u=l[o].split(/\s*:\s*/),d=u[0].trim(),f=u[1].trim();d===`stop-color`?r=f:d===`stop-opacity`&&(a=f)}}return r||=e.getAttribute(`stop-color`)||`rgb(0,0,0)`,a||=e.getAttribute(`stop-opacity`),i=(r=new t.Color(r)).getAlpha(),a=isNaN(parseFloat(a))?1:parseFloat(a),a*=i*n,{offset:c,color:r.toRgb(),opacity:a}}var n=t.util.object.clone;t.Gradient=t.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:`pixels`,type:`linear`,initialize:function(e){e||={},e.coords||={};var n,r=this;Object.keys(e).forEach(function(t){r[t]=e[t]}),this.id?this.id+=`_`+ t.Object.__uid++:this.id=t.Object.__uid++,n={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},this.type===`radial`&&(n.r1=e.coords.r1||0,n.r2=e.coords.r2||0),this.coords=n,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var n in e){var r=new t.Color(e[n]);this.colorStops.push({offset:parseFloat(n),color:r.toRgb(),opacity:r.getAlpha()})}return this},toObject:function(e){var n={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return t.util.populateWithProperties(this,n,e),n},toSVG:function(e,r){var i,a,o,s,c=n(this.coords,!0),l=(r||={},n(this.colorStops,!0)),u=c.r1>c.r2,d=this.gradientTransform?this.gradientTransform.concat():t.iMatrix.concat(),f=-this.offsetX,p=-this.offsetY,m=!!r.additionalTransform,h=this.gradientUnits===`pixels`?`userSpaceOnUse`:`objectBoundingBox`;if(l.sort(function(e,t){return e.offset-t.offset}),h===`objectBoundingBox`?(f/=e.width,p/=e.height):(f+=e.width/2,p+=e.height/2),e.type===`path`&&this.gradientUnits!==`percentage`&&(f-=e.pathOffset.x,p-=e.pathOffset.y),d[4]-=f,d[5]-=p,s=`id="SVGID_`+this.id+`" gradientUnits="`+h+`"`,s+=` gradientTransform="`+(m?r.additionalTransform+` `:``)+t.util.matrixToSVG(d)+`" `,this.type===`linear`?o=[`<linearGradient `,s,` x1="`,c.x1,`" y1="`,c.y1,`" x2="`,c.x2,`" y2="`,c.y2,`">
158
- `]:this.type===`radial`&&(o=[`<radialGradient `,s,` cx="`,u?c.x1:c.x2,`" cy="`,u?c.y1:c.y2,`" r="`,u?c.r1:c.r2,`" fx="`,u?c.x2:c.x1,`" fy="`,u?c.y2:c.y1,`">
159
- `]),this.type===`radial`){if(u)for((l=l.concat()).reverse(),i=0,a=l.length;i<a;i++)l[i].offset=1-l[i].offset;var g=Math.min(c.r1,c.r2);if(g>0){var _=g/Math.max(c.r1,c.r2);for(i=0,a=l.length;i<a;i++)l[i].offset+=_*(1-l[i].offset)}}for(i=0,a=l.length;i<a;i++){var v=l[i];o.push(`<stop `,`offset="`,100*v.offset+`%`,`" style="stop-color:`,v.color,typeof v.opacity<`u`?`;stop-opacity: `+v.opacity:`;`,`"/>
160
- `)}return o.push(this.type===`linear`?`</linearGradient>
161
- `:`</radialGradient>
162
- `),o.join(``)},toLive:function(e){var n,r,i,a=t.util.object.clone(this.coords);if(this.type){for(this.type===`linear`?n=e.createLinearGradient(a.x1,a.y1,a.x2,a.y2):this.type===`radial`&&(n=e.createRadialGradient(a.x1,a.y1,a.r1,a.x2,a.y2,a.r2)),r=0,i=this.colorStops.length;r<i;r++){var o=this.colorStops[r].color,s=this.colorStops[r].opacity,c=this.colorStops[r].offset;typeof s<`u`&&(o=new t.Color(o).setAlpha(s).toRgba()),n.addColorStop(c,o)}return n}}}),t.util.object.extend(t.Gradient,{fromElement:function(n,r,i,a){var o=parseFloat(i)/(/%$/.test(i)?100:1);o=o<0?0:o>1?1:o,isNaN(o)&&(o=1);var s,c,l,u,d=n.getElementsByTagName(`stop`),f=n.getAttribute(`gradientUnits`)===`userSpaceOnUse`?`pixels`:`percentage`,p=n.getAttribute(`gradientTransform`)||``,m=[],h=0,g=0;for(n.nodeName===`linearGradient`||n.nodeName===`LINEARGRADIENT`?(s=`linear`,c=function(e){return{x1:e.getAttribute(`x1`)||0,y1:e.getAttribute(`y1`)||0,x2:e.getAttribute(`x2`)||`100%`,y2:e.getAttribute(`y2`)||0}}(n)):(s=`radial`,c=function(e){return{x1:e.getAttribute(`fx`)||e.getAttribute(`cx`)||`50%`,y1:e.getAttribute(`fy`)||e.getAttribute(`cy`)||`50%`,r1:0,x2:e.getAttribute(`cx`)||`50%`,y2:e.getAttribute(`cy`)||`50%`,r2:e.getAttribute(`r`)||`50%`}}(n)),l=d.length;l--;)m.push(e(d[l],o));return u=t.parseTransformAttribute(p),function(e,t,n,r){var i,a;Object.keys(t).forEach(function(e){(i=t[e])===`Infinity`?a=1:i===`-Infinity`?a=0:(a=parseFloat(t[e],10),typeof i==`string`&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(a*=.01,r===`pixels`&&((e===`x1`||e===`x2`||e===`r2`)&&(a*=n.viewBoxWidth||n.width),(e===`y1`||e===`y2`)&&(a*=n.viewBoxHeight||n.height)))),t[e]=a})}(0,c,a,f),f===`pixels`&&(h=-r.left,g=-r.top),new t.Gradient({id:n.getAttribute(`id`),type:s,coords:c,colorStops:m,gradientUnits:f,gradientTransform:u,offsetX:h,offsetY:g})}})}(),function(){var e=t.util.toFixed;t.Pattern=t.util.createClass({repeat:`repeat`,offsetX:0,offsetY:0,crossOrigin:``,patternTransform:null,initialize:function(e,n){if(e||={},this.id=t.Object.__uid++,this.setOptions(e),!e.source||e.source&&typeof e.source!=`string`)n&&n(this);else{var r=this;this.source=t.util.createImage(),t.util.loadImage(e.source,function(e,t){r.source=e,n&&n(r,t)},null,this.crossOrigin)}},toObject:function(n){var r,i,a=t.Object.NUM_FRACTION_DIGITS;return typeof this.source.src==`string`?r=this.source.src:typeof this.source==`object`&&this.source.toDataURL&&(r=this.source.toDataURL()),i={type:`pattern`,source:r,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,a),offsetY:e(this.offsetY,a),patternTransform:this.patternTransform?this.patternTransform.concat():null},t.util.populateWithProperties(this,i,n),i},toSVG:function(e){var t=typeof this.source==`function`?this.source():this.source,n=t.width/e.width,r=t.height/e.height,i=this.offsetX/e.width,a=this.offsetY/e.height,o=``;return(this.repeat===`repeat-x`||this.repeat===`no-repeat`)&&(r=1,a&&(r+=Math.abs(a))),(this.repeat===`repeat-y`||this.repeat===`no-repeat`)&&(n=1,i&&(n+=Math.abs(i))),t.src?o=t.src:t.toDataURL&&(o=t.toDataURL()),`<pattern id="SVGID_`+this.id+`" x="`+i+`" y="`+a+`" width="`+n+`" height="`+r+`">
163
- <image x="0" y="0" width="`+t.width+`" height="`+t.height+`" xlink:href="`+o+`"></image>
164
- </pattern>
165
- `},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;return!t||typeof t.src<`u`&&(!t.complete||t.naturalWidth===0||t.naturalHeight===0)?``:e.createPattern(t,this.repeat)}})}(),function(e){var t=e.fabric||={},n=t.util.toFixed;t.Shadow?t.warn(`fabric.Shadow is already defined.`):(t.Shadow=t.util.createClass({color:`rgb(0,0,0)`,blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var n in typeof e==`string`&&(e=this._parseShadow(e)),e)this[n]=e[n];this.id=t.Object.__uid++},_parseShadow:function(e){var n=e.trim(),r=t.Shadow.reOffsetsAndBlur.exec(n)||[];return{color:(n.replace(t.Shadow.reOffsetsAndBlur,``)||`rgb(0,0,0)`).trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join(`px `)},toSVG:function(e){var r=40,i=40,a=t.Object.NUM_FRACTION_DIGITS,o=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(r=100*n((Math.abs(o.x)+this.blur)/e.width,a)+20,i=100*n((Math.abs(o.y)+this.blur)/e.height,a)+20),e.flipX&&(o.x*=-1),e.flipY&&(o.y*=-1),`<filter id="SVGID_`+this.id+`" y="-`+i+`%" height="`+(100+2*i)+`%" x="-`+r+`%" width="`+(100+2*r)+`%" >
166
- <feGaussianBlur in="SourceAlpha" stdDeviation="`+n(this.blur?this.blur/2:0,a)+`"></feGaussianBlur>
167
- <feOffset dx="`+n(o.x,a)+`" dy="`+n(o.y,a)+`" result="oBlur" ></feOffset>
168
- <feFlood flood-color="`+s.toRgb()+`" flood-opacity="`+s.getAlpha()+`"/>
169
- <feComposite in2="oBlur" operator="in" />
170
- <feMerge>
171
- <feMergeNode></feMergeNode>
172
- <feMergeNode in="SourceGraphic"></feMergeNode>
173
- </feMerge>
174
- </filter>
175
- `},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},n=t.Shadow.prototype;return[`color`,`blur`,`offsetX`,`offsetY`,`affectStroke`,`nonScaling`].forEach(function(t){this[t]!==n[t]&&(e[t]=this[t])},this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(e),function(){if(t.StaticCanvas)t.warn(`fabric.StaticCanvas is already defined.`);else{var e=t.util.object.extend,n=t.util.getElementOffset,r=t.util.removeFromArray,i=t.util.toFixed,a=t.util.transformPoint,o=t.util.invertTransform,s=t.util.getNodeCanvas,c=t.util.createCanvasElement,l=Error("Could not initialize `canvas` element");t.StaticCanvas=t.util.createClass(t.CommonMethods,{initialize:function(e,t){t||={},this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:``,backgroundImage:null,overlayColor:``,overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:t.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var n=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,n),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,n),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,n),t.overlayColor&&this.setOverlayColor(t.overlayColor,n),this.calcOffset()},_isRetinaScaling:function(){return t.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,t.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=t.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,n){t.setAttribute(`width`,this.width*e),t.setAttribute(`height`,this.height*e),n.scale(e,e)},calcOffset:function(){return this._offset=n(this.lowerCanvasEl),this},setOverlayImage:function(e,t,n){return this.__setBgOverlayImage(`overlayImage`,e,t,n)},setBackgroundImage:function(e,t,n){return this.__setBgOverlayImage(`backgroundImage`,e,t,n)},setOverlayColor:function(e,t){return this.__setBgOverlayColor(`overlayColor`,e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor(`backgroundColor`,e,t)},__setBgOverlayImage:function(e,n,r,i){return typeof n==`string`?t.util.loadImage(n,function(n,a){if(n){var o=new t.Image(n,i);this[e]=o,o.canvas=this}r&&r(n,a)},this,i&&i.crossOrigin):(i&&n.setOptions(i),this[e]=n,n&&(n.canvas=this),r&&r(n,!1)),this},__setBgOverlayColor:function(e,t,n){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,n),this},_createCanvasElement:function(){var e=c();if(!e||(e.style||={},typeof e.getContext>`u`))throw l;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+`px`,t.style.height=this.height+`px`,this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=t.util.getById(e)||this._createCanvasElement(),t.util.addClass(this.lowerCanvasEl,`lower-canvas`),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext(`2d`)},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var n;for(var r in t||={},e)n=e[r],t.cssOnly||(this._setBackstoreDimension(r,e[r]),n+=`px`,this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(r,n);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,n,r,i=this._activeObject,a=this.backgroundImage,o=this.overlayImage;for(this.viewportTransform=e,n=0,r=this._objects.length;n<r;n++)(t=this._objects[n]).group||t.setCoords(!0);return i&&i.setCoords(),a&&a.setCoords(!0),o&&o.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var n=e,r=this.viewportTransform.slice(0);e=a(e,o(this.viewportTransform)),r[0]=t,r[3]=t;var i=a(e,r);return r[4]+=n.x-i.x,r[5]+=n.y-i.y,this.setViewportTransform(r)},setZoom:function(e){return this.zoomToPoint(new t.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new t.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set(`canvas`,this),e.setCoords(),this.fire(`object:added`,{target:e}),e.fire(`added`)},_onObjectRemoved:function(e){this.fire(`object:removed`,{target:e}),e.fire(`removed`),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor=``,this.overlayColor=``,this._hasITextHandlers&&=(this.off(`mouse:up`,this._mouseUpITextHandler),this._iTextInstances=null,!1),this.clearContext(this.contextContainer),this.fire(`canvas:cleared`),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||=t.util.requestAnimFrame(this.renderAndResetBound),this},calcViewportBoundaries:function(){var e={},n=this.width,r=this.height,i=o(this.viewportTransform);return e.tl=a({x:0,y:0},i),e.br=a({x:n,y:r},i),e.tr=new t.Point(e.br.x,e.tl.y),e.bl=new t.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&=(t.util.cancelAnimFrame(this.isRendering),0)},renderCanvas:function(e,n){var r=this.viewportTransform,i=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),t.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire(`before:render`,{ctx:e}),this._renderBackground(e),e.save(),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._renderObjects(e,n),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),i&&(i.canvas=this,i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire(`after:render`,{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,n=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation=`destination-in`,n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)t[n]&&t[n].render(e)},_renderBackgroundOrOverlay:function(e,t){var n=this[t+`Color`],r=this[t+`Image`],i=this.viewportTransform,a=this[t+`Vpt`];if(n||r){if(n){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=n.toLive?n.toLive(e,this):n,a&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.transform(1,0,0,1,n.offsetX||0,n.offsetY||0);var o=n.gradientTransform||n.patternTransform;o&&e.transform(o[0],o[1],o[2],o[3],o[4],o[5]),e.fill(),e.restore()}r&&(e.save(),a&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),r.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,`background`)},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,`overlay`)},getCenter:function(){return{top:this.height/2,left:this.width/2}},getCenterPoint:function(){return new t.Point(this.width/2,this.height/2)},centerObjectH:function(e){return this._centerObject(e,new t.Point(this.getCenterPoint().x,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new t.Point(e.getCenterPoint().x,this.getCenterPoint().y))},centerObject:function(e){var t=this.getCenterPoint();return this._centerObject(e,t)},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var n=this.getVpCenter();return this._centerObject(e,new t.Point(n.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var n=this.getVpCenter();return this._centerObject(e,new t.Point(e.getCenterPoint().x,n.y))},getVpCenter:function(){return a(this.getCenterPoint(),o(this.viewportTransform))},_centerObject:function(e,t){return e.setPositionByOrigin(t,`center`,`center`),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod(`toObject`,e)},toDatalessObject:function(e){return this._toObjectMethod(`toDatalessObject`,e)},_toObjectMethod:function(n,r){var i=this.clipPath,a={version:t.version,objects:this._toObjects(n,r)};return i&&!i.excludeFromExport&&(a.clipPath=this._toObject(this.clipPath,n,r)),e(a,this.__serializeBgOverlay(n,r)),t.util.populateWithProperties(this,a,r),a},_toObjects:function(e,t){return this._objects.filter(function(e){return!e.excludeFromExport}).map(function(n){return this._toObject(n,e,t)},this)},_toObject:function(e,t,n){var r;this.includeDefaultValues||(r=e.includeDefaultValues,e.includeDefaultValues=!1);var i=e[t](n);return this.includeDefaultValues||(e.includeDefaultValues=r),i},__serializeBgOverlay:function(e,t){var n={},r=this.backgroundImage,i=this.overlayImage,a=this.backgroundColor,o=this.overlayColor;return a&&a.toObject?a.excludeFromExport||(n.background=a.toObject(t)):a&&(n.background=a),o&&o.toObject?o.excludeFromExport||(n.overlay=o.toObject(t)):o&&(n.overlay=o),r&&!r.excludeFromExport&&(n.backgroundImage=this._toObject(r,e,t)),i&&!i.excludeFromExport&&(n.overlayImage=this._toObject(i,e,t)),n},svgViewportTransformation:!0,toSVG:function(e,t){e||={},e.reviver=t;var n=[];return this._setSVGPreamble(n,e),this._setSVGHeader(n,e),this.clipPath&&n.push(`<g clip-path="url(#`+this.clipPath.clipPathId+`)" >
176
- `),this._setSVGBgOverlayColor(n,`background`),this._setSVGBgOverlayImage(n,`backgroundImage`,t),this._setSVGObjects(n,t),this.clipPath&&n.push(`</g>
177
- `),this._setSVGBgOverlayColor(n,`overlay`),this._setSVGBgOverlayImage(n,`overlayImage`,t),n.push(`</svg>`),n.join(``)},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push(`<?xml version="1.0" encoding="`,t.encoding||`UTF-8`,`" standalone="no" ?>
178
- `,`<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" `,`"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
179
- `)},_setSVGHeader:function(e,n){var r,a=n.width||this.width,o=n.height||this.height,s=`viewBox="0 0 `+this.width+` `+this.height+`" `,c=t.Object.NUM_FRACTION_DIGITS;n.viewBox?s=`viewBox="`+n.viewBox.x+` `+n.viewBox.y+` `+n.viewBox.width+` `+n.viewBox.height+`" `:this.svgViewportTransformation&&(r=this.viewportTransform,s=`viewBox="`+i(-r[4]/r[0],c)+` `+i(-r[5]/r[3],c)+` `+i(this.width/r[0],c)+` `+i(this.height/r[3],c)+`" `),e.push(`<svg `,`xmlns="http://www.w3.org/2000/svg" `,`xmlns:xlink="http://www.w3.org/1999/xlink" `,`version="1.1" `,`width="`,a,`" `,`height="`,o,`" `,s,`xml:space="preserve">
180
- `,`<desc>Created with Fabric.js `,t.version,`</desc>
181
- `,`<defs>
182
- `,this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(n),`</defs>
183
- `)},createSVGClipPathMarkup:function(e){var n=this.clipPath;return n?(n.clipPathId=`CLIPPATH_`+ t.Object.__uid++,`<clipPath id="`+n.clipPathId+`" >
184
- `+this.clipPath.toClipPathSVG(e.reviver)+`</clipPath>
185
- `):``},createSVGRefElementsMarkup:function(){var e=this;return[`background`,`overlay`].map(function(n){var r=e[n+`Color`];if(r&&r.toLive){var i=e[n+`Vpt`],a=e.viewportTransform,o={width:e.width/(i?a[0]:1),height:e.height/(i?a[3]:1)};return r.toSVG(o,{additionalTransform:i?t.util.matrixToSVG(a):``})}}).join(``)},createSVGFontFacesMarkup:function(){var e,n,r,i,a,o,s,c,l=``,u={},d=t.fontPaths,f=[];for(this._objects.forEach(function e(t){f.push(t),t._objects&&t._objects.forEach(e)}),s=0,c=f.length;s<c;s++)if(n=(e=f[s]).fontFamily,e.type.indexOf(`text`)!==-1&&!u[n]&&d[n]&&(u[n]=!0,e.styles))for(a in r=e.styles)for(o in i=r[a])!u[n=i[o].fontFamily]&&d[n]&&(u[n]=!0);for(var p in u)l+=[` @font-face {
186
- `,` font-family: '`,p,`';
187
- `,` src: url('`,d[p],`');
188
- `,` }
189
- `].join(``);return l&&=[` <style type="text/css">`,`<![CDATA[
190
- `,l,`]]>`,`</style>
191
- `].join(``),l},_setSVGObjects:function(e,t){var n,r,i,a=this._objects;for(r=0,i=a.length;r<i;r++)!(n=a[r]).excludeFromExport&&this._setSVGObject(e,n,t)},_setSVGObject:function(e,t,n){e.push(t.toSVG(n))},_setSVGBgOverlayImage:function(e,t,n){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(n))},_setSVGBgOverlayColor:function(e,n){var r=this[n+`Color`],i=this.viewportTransform,a=this.width,o=this.height;if(r)if(r.toLive){var s=r.repeat,c=t.util.invertTransform(i),l=this[n+`Vpt`]?t.util.matrixToSVG(c):``;e.push(`<rect transform="`+l+` translate(`,a/2,`,`,o/2,`)"`,` x="`,r.offsetX-a/2,`" y="`,r.offsetY-o/2,`" `,`width="`,s===`repeat-y`||s===`no-repeat`?r.source.width:a,`" height="`,s===`repeat-x`||s===`no-repeat`?r.source.height:o,`" fill="url(#SVGID_`+r.id+`)"`,`></rect>
192
- `)}else e.push(`<rect x="0" y="0" width="100%" height="100%" `,`fill="`,r,`"`,`></rect>
193
- `)},sendToBack:function(e){if(!e)return this;var t,n,i,a=this._activeObject;if(e===a&&e.type===`activeSelection`)for(t=(i=a._objects).length;t--;)n=i[t],r(this._objects,n),this._objects.unshift(n);else r(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,n,i,a=this._activeObject;if(e===a&&e.type===`activeSelection`)for(i=a._objects,t=0;t<i.length;t++)n=i[t],r(this._objects,n),this._objects.push(n);else r(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var n,i,a,o,s,c=this._activeObject,l=0;if(e===c&&e.type===`activeSelection`)for(s=c._objects,n=0;n<s.length;n++)i=s[n],(a=this._objects.indexOf(i))>0+l&&(o=a-1,r(this._objects,i),this._objects.splice(o,0,i)),l++;else (a=this._objects.indexOf(e))!==0&&(o=this._findNewLowerIndex(e,a,t),r(this._objects,e),this._objects.splice(o,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,n){var r,i;if(n){for(r=t,i=t-1;i>=0;--i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t-1;return r},bringForward:function(e,t){if(!e)return this;var n,i,a,o,s,c=this._activeObject,l=0;if(e===c&&e.type===`activeSelection`)for(n=(s=c._objects).length;n--;)i=s[n],(a=this._objects.indexOf(i))<this._objects.length-1-l&&(o=a+1,r(this._objects,i),this._objects.splice(o,0,i)),l++;else (a=this._objects.indexOf(e))!==this._objects.length-1&&(o=this._findNewUpperIndex(e,a,t),r(this._objects,e),this._objects.splice(o,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,n){var r,i,a;if(n){for(r=t,i=t+1,a=this._objects.length;i<a;++i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t+1;return r},moveTo:function(e,t){return r(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&=(t.util.cancelAnimFrame(this.isRendering),0),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove(`lower-canvas`),t.util.setStyle(this.lowerCanvasEl,this._originalCanvasStyle),delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute(`width`,this.width),this.lowerCanvasEl.setAttribute(`height`,this.height),t.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return`#<fabric.Canvas (`+this.complexity()+`): { objects: `+this._objects.length+` }>`}}),e(t.StaticCanvas.prototype,t.Observable),e(t.StaticCanvas.prototype,t.Collection),e(t.StaticCanvas.prototype,t.DataURLExporter),e(t.StaticCanvas,{EMPTY_JSON:`{"objects": [], "background": "white"}`,supports:function(e){var t=c();if(!t||!t.getContext)return null;var n=t.getContext(`2d`);return n&&e===`setLineDash`?typeof n.setLineDash<`u`:null}}),t.StaticCanvas.prototype.toJSON=t.StaticCanvas.prototype.toObject,t.isLikelyNode&&(t.StaticCanvas.prototype.createPNGStream=function(){var e=s(this.lowerCanvasEl);return e&&e.createPNGStream()},t.StaticCanvas.prototype.createJPEGStream=function(e){var t=s(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),t.BaseBrush=t.util.createClass({color:`rgb(0, 0, 0)`,width:1,shadow:null,strokeLineCap:`round`,strokeLineJoin:`round`,strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(e){e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,n=this.shadow,r=e.contextTop,i=e.getZoom();e&&e._isRetinaScaling()&&(i*=t.devicePixelRatio),r.shadowColor=n.color,r.shadowBlur=n.blur*i,r.shadowOffsetX=n.offsetX*i,r.shadowOffsetY=n.offsetY*i}},needsFullRender:function(){return new t.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor=``,e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),t.PencilBrush=t.util.createClass(t.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:`shiftKey`,initialize:function(e){this.canvas=e,this._points=[]},needsFullRender:function(){return this.callSuper(`needsFullRender`)||this._hasStraightLine},_drawSegment:function(e,t,n){var r=t.midPointFrom(n);return e.quadraticCurveTo(t.x,t.y,r.x,r.y),r},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var n=this._points,r=n.length,i=this.canvas.contextTop;this._saveAndTransform(i),this.oldEnd&&(i.beginPath(),i.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(i,n[r-2],n[r-1],!0),i.stroke(),i.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var n=new t.Point(e.x,e.y);this._reset(),this._addPoint(n),this.canvas.contextTop.moveTo(n.x,n.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(e){var n=new t.Point(e.x,e.y);return this._addPoint(n)},_render:function(e){var n,r,i=this._points[0],a=this._points[1];if(e||=this.canvas.contextTop,this._saveAndTransform(e),e.beginPath(),this._points.length===2&&i.x===a.x&&i.y===a.y){var o=this.width/1e3;i=new t.Point(i.x,i.y),a=new t.Point(a.x,a.y),i.x-=o,a.x+=o}for(e.moveTo(i.x,i.y),n=1,r=this._points.length;n<r;n++)this._drawSegment(e,i,a),i=this._points[n],a=this._points[n+1];e.lineTo(i.x,i.y),e.stroke(),e.restore()},convertPointsToSVGPath:function(e){var n=this.width/1e3;return t.util.getSmoothPathFromPoints(e,n)},_isEmptySVGPath:function(e){return t.util.joinPath(e)===`M 0 0 Q 0 0 0 0 L 0 0`},createPath:function(e){var n=new t.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,n.shadow=new t.Shadow(this.shadow)),n},decimatePoints:function(e,t){if(e.length<=2)return e;var n,r=(t/this.canvas.getZoom())**2,i=e.length-1,a=e[0],o=[a];for(n=1;n<i-1;n++)(a.x-e[n].x)**2+(a.y-e[n].y)**2>=r&&(a=e[n],o.push(a));return o.push(e[i]),o},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire(`before:path:created`,{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire(`path:created`,{path:t})}}}),t.CircleBrush=t.util.createClass(t.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),n=this.canvas.contextTop;this._saveAndTransform(n),this.dot(n,t),n.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,n=this.canvas.contextTop,r=this.points;for(this._saveAndTransform(n),e=0,t=r.length;e<t;e++)this.dot(n,r[e]);n.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,n,r=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var i=[];for(e=0,n=this.points.length;e<n;e++){var a=this.points[e],o=new t.Circle({radius:a.radius,left:a.x,top:a.y,originX:`center`,originY:`center`,fill:a.fill});this.shadow&&(o.shadow=new t.Shadow(this.shadow)),i.push(o)}var s=new t.Group(i);s.canvas=this.canvas,this.canvas.fire(`before:path:created`,{path:s}),this.canvas.add(s),this.canvas.fire(`path:created`,{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=r,this.canvas.requestRenderAll()},addPoint:function(e){var n=new t.Point(e.x,e.y),r=t.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,i=new t.Color(this.color).setAlpha(t.util.getRandomInt(0,100)/100).toRgba();return n.radius=r,n.fill=i,this.points.push(n),n}}),t.SprayBrush=t.util.createClass(t.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var n=[],r=0,i=this.sprayChunks.length;r<i;r++)for(var a=this.sprayChunks[r],o=0,s=a.length;o<s;o++){var c=new t.Rect({width:a[o].width,height:a[o].width,left:a[o].x+1,top:a[o].y+1,originX:`center`,originY:`center`,fill:this.color});n.push(c)}this.optimizeOverlapping&&(n=this._getOptimizedRects(n));var l=new t.Group(n);this.shadow&&l.set(`shadow`,new t.Shadow(this.shadow)),this.canvas.fire(`before:path:created`,{path:l}),this.canvas.add(l),this.canvas.fire(`path:created`,{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,n,r,i={};for(n=0,r=e.length;n<r;n++)i[t=e[n].left+``+e[n].top]||(i[t]=e[n]);var a=[];for(t in i)a.push(i[t]);return a},render:function(e){var t,n,r=this.canvas.contextTop;for(r.fillStyle=this.color,this._saveAndTransform(r),t=0,n=e.length;t<n;t++){var i=e[t];typeof i.opacity<`u`&&(r.globalAlpha=i.opacity),r.fillRect(i.x,i.y,i.width,i.width)}r.restore()},_render:function(){var e,t,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);n.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var n,r,i,a,o=this.width/2;for(a=0;a<this.density;a++){n=t.util.getRandomInt(e.x-o,e.x+o),r=t.util.getRandomInt(e.y-o,e.y+o),i=this.dotWidthVariance?t.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new t.Point(n,r);s.width=i,this.randomOpacity&&(s.opacity=t.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),t.PatternBrush=t.util.createClass(t.PencilBrush,{getPatternSrc:function(){var e=t.util.createCanvasElement(),n=e.getContext(`2d`);return e.width=e.height=25,n.fillStyle=this.color,n.beginPath(),n.arc(10,10,10,0,2*Math.PI,!1),n.closePath(),n.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace(`this.color`,`"`+this.color+`"`)},getPattern:function(e){return e.createPattern(this.source||this.getPatternSrc(),`repeat`)},_setBrushStyles:function(e){this.callSuper(`_setBrushStyles`,e),e.strokeStyle=this.getPattern(e)},createPath:function(e){var n=this.callSuper(`createPath`,e),r=n._getLeftTopCoords().scalarAdd(n.strokeWidth/2);return n.stroke=new t.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-r.x,offsetY:-r.y}),n}}),function(){var e=t.util.getPointer,n=t.util.degreesToRadians,r=t.util.isTouchEvent;for(var i in t.Canvas=t.util.createClass(t.StaticCanvas,{initialize:function(e,t){t||={},this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:`shiftKey`,centeredScaling:!1,centeredRotation:!1,centeredKey:`altKey`,altActionKey:`shiftKey`,interactive:!0,selection:!0,selectionKey:`shiftKey`,altSelectionKey:null,selectionColor:`rgba(100, 100, 255, 0.3)`,selectionDashArray:[],selectionBorderColor:`rgba(255, 255, 255, 0.3)`,selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:`move`,moveCursor:`move`,defaultCursor:`default`,freeDrawingCursor:`crosshair`,notAllowedCursor:`not-allowed`,containerClass:`canvas-container`,perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],enablePointerEvents:!1,_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=t.PencilBrush&&new t.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,n,r=this.getActiveObjects();if(r.length>0&&!this.preserveObjectStacking){t=[],n=[];for(var i=0,a=this._objects.length;i<a;i++)e=this._objects[i],r.indexOf(e)===-1?t.push(e):n.push(e);r.length>1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&=(this.renderTopLayer(this.contextTop),!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire(`after:render`),this},_normalizePointer:function(e,n){var r=e.calcTransformMatrix(),i=t.util.invertTransform(r),a=this.restorePointerVpt(n);return t.util.transformPoint(a,i)},isTargetTransparent:function(e,n,r){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var i=this._normalizePointer(e,{x:n,y:r}),a=Math.max(e.cacheTranslationX+i.x*e.zoomX,0),o=Math.max(e.cacheTranslationY+i.y*e.zoomY,0);return t.util.isTransparent(e._cacheContext,Math.round(a),Math.round(o),this.targetFindTolerance)}var s=this.contextCache,c=e.selectionBackgroundColor,l=this.viewportTransform;return e.selectionBackgroundColor=``,this.clearContext(s),s.save(),s.transform(l[0],l[1],l[2],l[3],l[4],l[5]),e.render(s),s.restore(),e.selectionBackgroundColor=c,t.util.isTransparent(s,n,r,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){var t=!1;return t=Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(t){return!0===e[t]}):e[this.selectionKey],t},_shouldClearSelection:function(e,t){var n=this.getActiveObjects(),r=this._activeObject;return!t||t&&r&&n.length>1&&n.indexOf(t)===-1&&r!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&r&&r!==t},_shouldCenterTransform:function(e,t,n){var r;if(e)return t===`scale`||t===`scaleX`||t===`scaleY`||t===`resizing`?r=this.centeredScaling||e.centeredScaling:t===`rotate`&&(r=this.centeredRotation||e.centeredRotation),r?!n:n},_getOriginFromCorner:function(e,t){var n={x:e.originX,y:e.originY};return t===`ml`||t===`tl`||t===`bl`?n.x=`right`:(t===`mr`||t===`tr`||t===`br`)&&(n.x=`left`),t===`tl`||t===`mt`||t===`tr`?n.y=`bottom`:(t===`bl`||t===`mb`||t===`br`)&&(n.y=`top`),n},_getActionFromCorner:function(e,t,n,r){if(!t||!e)return`drag`;var i=r.controls[t];return i.getActionName(n,i,r)},_setupCurrentTransform:function(e,r,i){if(r){var a=this.getPointer(e),o=r.__corner,s=r.controls[o],c=i&&o?s.getActionHandler(e,r,s):t.controlsUtils.dragHandler,l=this._getActionFromCorner(i,o,e,r),u=this._getOriginFromCorner(r,o),d=e[this.centeredKey],f={target:r,action:l,actionHandler:c,corner:o,scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,offsetX:a.x-r.left,offsetY:a.y-r.top,originX:u.x,originY:u.y,ex:a.x,ey:a.y,lastX:a.x,lastY:a.y,theta:n(r.angle),width:r.width*r.scaleX,shiftKey:e.shiftKey,altKey:d,original:t.util.saveObjectTransform(r)};this._shouldCenterTransform(r,l,d)&&(f.originX=`center`,f.originY=`center`),f.original.originX=u.x,f.original.originY=u.y,this._currentTransform=f,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var n=this._groupSelector,r=new t.Point(n.ex,n.ey),i=t.util.transformPoint(r,this.viewportTransform),a=new t.Point(n.ex+n.left,n.ey+n.top),o=t.util.transformPoint(a,this.viewportTransform),s=Math.min(i.x,o.x),c=Math.min(i.y,o.y),l=Math.max(i.x,o.x),u=Math.max(i.y,o.y),d=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(s,c,l-s,u-c)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,s+=d,c+=d,l-=d,u-=d,t.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(s,c,l-s,u-c))},findTarget:function(e,t){if(!this.skipTargetFind){var n,i,a=this.getPointer(e,!0),o=this._activeObject,s=this.getActiveObjects(),c=r(e),l=s.length>1&&!t||s.length===1;if(this.targets=[],l&&o._findTargetCorner(a,c)||s.length>1&&!t&&o===this._searchPossibleTargets([o],a))return o;if(s.length===1&&o===this._searchPossibleTargets([o],a)){if(!this.preserveObjectStacking)return o;n=o,i=this.targets,this.targets=[]}var u=this._searchPossibleTargets(this._objects,a);return e[this.altSelectionKey]&&u&&n&&u!==n&&(u=n,this.targets=i),u}},_checkTarget:function(e,t,n){if(t&&t.visible&&t.evented&&t.containsPoint(e)&&(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing||!this.isTargetTransparent(t,n.x,n.y)))return!0},_searchPossibleTargets:function(e,n){for(var r,i,a=e.length;a--;){var o=e[a],s=o.group?this._normalizePointer(o.group,n):n;if(this._checkTarget(s,o,n)){(r=e[a]).subTargetCheck&&r instanceof t.Group&&(i=this._searchPossibleTargets(r._objects,n))&&this.targets.push(i);break}}return r},restorePointerVpt:function(e){return t.util.transformPoint(e,t.util.invertTransform(this.viewportTransform))},getPointer:function(t,n){if(this._absolutePointer&&!n)return this._absolutePointer;if(this._pointer&&n)return this._pointer;var r,i=e(t),a=this.upperCanvasEl,o=a.getBoundingClientRect(),s=o.width||0,c=o.height||0;(!s||!c)&&(`top`in o&&`bottom`in o&&(c=Math.abs(o.top-o.bottom)),`right`in o&&`left`in o&&(s=Math.abs(o.right-o.left))),this.calcOffset(),i.x-=this._offset.left,i.y-=this._offset.top,n||(i=this.restorePointerVpt(i));var l=this.getRetinaScaling();return l!==1&&(i.x/=l,i.y/=l),r=s===0||c===0?{width:1,height:1}:{width:a.width/s,height:a.height/c},{x:i.x*r.width,y:i.y*r.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,``),n=this.lowerCanvasEl,r=this.upperCanvasEl;r?r.className=``:(r=this._createCanvasElement(),this.upperCanvasEl=r),t.util.addClass(r,`upper-canvas `+e),this.wrapperEl.appendChild(r),this._copyCanvasStyle(n,r),this._applyCanvasStyle(r),this.contextTop=r.getContext(`2d`)},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute(`width`,this.width),this.cacheCanvasEl.setAttribute(`height`,this.height),this.contextCache=this.cacheCanvasEl.getContext(`2d`)},_initWrapperElement:function(){this.wrapperEl=t.util.wrapElement(this.lowerCanvasEl,`div`,{class:this.containerClass}),t.util.setStyle(this.wrapperEl,{width:this.width+`px`,height:this.height+`px`,position:`relative`}),t.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var n=this.width||e.width,r=this.height||e.height;t.util.setStyle(e,{position:`absolute`,width:n+`px`,height:r+`px`,left:0,top:0,"touch-action":this.allowTouchScrolling?`manipulation`:`none`,"-ms-touch-action":this.allowTouchScrolling?`manipulation`:`none`}),e.width=n,e.height=r,t.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?e.type===`activeSelection`&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire(`before:selection:cleared`,{target:e}),this._discardActiveObject(),this.fire(`selection:cleared`,{target:e}),e.fire(`deselected`)),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper(`_onObjectRemoved`,e)},_fireSelectionEvents:function(e,t){var n=!1,r=this.getActiveObjects(),i=[],a=[];e.forEach(function(e){r.indexOf(e)===-1&&(n=!0,e.fire(`deselected`,{e:t,target:e}),a.push(e))}),r.forEach(function(r){e.indexOf(r)===-1&&(n=!0,r.fire(`selected`,{e:t,target:r}),i.push(r))}),e.length>0&&r.length>0?n&&this.fire(`selection:updated`,{e:t,selected:i,deselected:a}):r.length>0?this.fire(`selection:created`,{e:t,selected:i}):e.length>0&&this.fire(`selection:cleared`,{e:t,deselected:a})},setActiveObject:function(e,t){var n=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(n,t),this},_setActiveObject:function(e,t){return!(this._activeObject===e||!this._discardActiveObject(t,e)||e.onSelect({e:t}))&&(this._activeObject=e,!0)},_discardActiveObject:function(e,t){var n=this._activeObject;if(n){if(n.onDeselect({e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),n=this.getActiveObject();return t.length&&this.fire(`before:selection:cleared`,{target:n,e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,[`upperCanvasEl`,`cacheCanvasEl`].forEach(function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,t.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper(`clear`)},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(e),i=this.callSuper(`_toObject`,e,t,n);return this._unwindGroupTransformOnObject(e,r),i},_realizeGroupTransformOnObject:function(e){if(e.group&&e.group.type===`activeSelection`&&this._activeObject===e.group){var n={};return[`angle`,`flipX`,`flipY`,`left`,`scaleX`,`scaleY`,`skewX`,`skewY`,`top`].forEach(function(t){n[t]=e[t]}),t.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),n}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(t);this.callSuper(`_setSVGObject`,e,t,n),this._unwindGroupTransformOnObject(t,r)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),t.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),t.StaticCanvas)i!==`prototype`&&(t.Canvas[i]=t.StaticCanvas[i])}(),function(){var e=t.util.addListener,n=t.util.removeListener,r={passive:!1};function i(e,t){return e.button&&e.button===t-1}t.util.object.extend(t.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,`add`)},_getEventPrefix:function(){return this.enablePointerEvents?`pointer`:`mouse`},addOrRemove:function(e,n){var i=this.upperCanvasEl,a=this._getEventPrefix();e(t.window,`resize`,this._onResize),e(i,a+`down`,this._onMouseDown),e(i,a+`move`,this._onMouseMove,r),e(i,a+`out`,this._onMouseOut),e(i,a+`enter`,this._onMouseEnter),e(i,`wheel`,this._onMouseWheel),e(i,`contextmenu`,this._onContextMenu),e(i,`dblclick`,this._onDoubleClick),e(i,`dragover`,this._onDragOver),e(i,`dragenter`,this._onDragEnter),e(i,`dragleave`,this._onDragLeave),e(i,`drop`,this._onDrop),this.enablePointerEvents||e(i,`touchstart`,this._onTouchStart,r),typeof eventjs<`u`&&n in eventjs&&(eventjs[n](i,`gesture`,this._onGesture),eventjs[n](i,`drag`,this._onDrag),eventjs[n](i,`orientation`,this._onOrientationChange),eventjs[n](i,`shake`,this._onShake),eventjs[n](i,`longpress`,this._onLongPress))},removeListeners:function(){this.addOrRemove(n,`remove`);var e=this._getEventPrefix();n(t.document,e+`up`,this._onMouseUp),n(t.document,`touchend`,this._onTouchEnd,r),n(t.document,e+`move`,this._onMouseMove,r),n(t.document,`touchmove`,this._onMouseMove,r)},_bindEvents:function(){this.eventsBound||=(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,`dragenter`),this._onDragLeave=this._simpleEventHandler.bind(this,`dragleave`),this._onDrop=this._onDrop.bind(this),!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire(`mouse:out`,{target:t,e}),this._hoveredTarget=null,t&&t.fire(`mouseout`,{e});var n=this;this._hoveredTargets.forEach(function(r){n.fire(`mouse:out`,{target:t,e}),r&&t.fire(`mouseout`,{e})}),this._hoveredTargets=[]},_onMouseEnter:function(e){!this._currentTransform&&!this.findTarget(e)&&(this.fire(`mouse:over`,{target:null,e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler(`dragover`,e);this._fireEnterLeaveEvents(t,e)},_onDrop:function(e){return this._simpleEventHandler(`drop:before`,e),this._simpleEventHandler(`drop`,e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,`dblclick`),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&(e.type===`touchend`&&e.touches.length===0||!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId)},_onTouchStart:function(i){i.preventDefault(),this.mainTouchId===null&&(this.mainTouchId=this.getPointerId(i)),this.__onMouseDown(i),this._resetTransformEventData();var a=this.upperCanvasEl,o=this._getEventPrefix();e(t.document,`touchend`,this._onTouchEnd,r),e(t.document,`touchmove`,this._onMouseMove,r),n(a,o+`down`,this._onMouseDown)},_onMouseDown:function(i){this.__onMouseDown(i),this._resetTransformEventData();var a=this.upperCanvasEl,o=this._getEventPrefix();n(a,o+`move`,this._onMouseMove,r),e(t.document,o+`up`,this._onMouseUp),e(t.document,o+`move`,this._onMouseMove,r)},_onTouchEnd:function(i){if(!(i.touches.length>0)){this.__onMouseUp(i),this._resetTransformEventData(),this.mainTouchId=null;var a=this._getEventPrefix();n(t.document,`touchend`,this._onTouchEnd,r),n(t.document,`touchmove`,this._onMouseMove,r);var o=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){e(o.upperCanvasEl,a+`down`,o._onMouseDown),o._willAddMouseDown=0},400)}},_onMouseUp:function(i){this.__onMouseUp(i),this._resetTransformEventData();var a=this.upperCanvasEl,o=this._getEventPrefix();this._isMainEvent(i)&&(n(t.document,o+`up`,this._onMouseUp),n(t.document,o+`move`,this._onMouseMove,r),e(a,o+`move`,this._onMouseMove,r))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var n,r=this._currentTransform,a=this._groupSelector,o=!1,s=!a||a.left===0&&a.top===0;if(this._cacheTransformEventData(e),n=this._target,this._handleEvent(e,`up:before`),i(e,3))this.fireRightClick&&this._handleEvent(e,`up`,3,s);else{if(i(e,2))return this.fireMiddleClick&&this._handleEvent(e,`up`,2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(r&&(this._finalizeCurrentTransform(e),o=r.actionPerformed),!s){var c=n===this._activeObject;this._maybeGroupObjects(e),o||=this._shouldRender(n)||!c&&n===this._activeObject}var l,u;if(n){if(l=n._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e)),n.selectable&&n!==this._activeObject&&n.activeOn===`up`)this.setActiveObject(n,e),o=!0;else{var d=n.controls[l],f=d&&d.getMouseUpHandler(e,n,d);f&&f(e,r,(u=this.getPointer(e)).x,u.y)}n.isMoving=!1}if(r&&(r.target!==n||r.corner!==l)){var p=r.target&&r.target.controls[r.corner],m=p&&p.getMouseUpHandler(e,n,d);u||=this.getPointer(e),m&&m(e,r,u.x,u.y)}this._setCursorFromEvent(e,n),this._handleEvent(e,`up`,1,s),this._groupSelector=null,this._currentTransform=null,n&&(n.__corner=0),o?this.requestRenderAll():s||this.renderTop()}}},_simpleEventHandler:function(e,t){var n=this.findTarget(t),r=this.targets,i={e:t,target:n,subTargets:r};if(this.fire(e,i),n&&n.fire(e,i),!r)return n;for(var a=0;a<r.length;a++)r[a].fire(e,i);return n},_handleEvent:function(e,t,n,r){var i=this._target,a=this.targets||[],o={e,target:i,subTargets:a,button:n||1,isClick:r||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};t===`up`&&(o.currentTarget=this.findTarget(e),o.currentSubTargets=this.targets),this.fire(`mouse:`+t,o),i&&i.fire(`mouse`+t,o);for(var s=0;s<a.length;s++)a[s].fire(`mouse`+t,o)},_finalizeCurrentTransform:function(e){var t=this._currentTransform,n=t.target,r={e,target:n,transform:t,action:t.action};n._scaling&&=!1,n.setCoords(),(t.actionPerformed||this.stateful&&n.hasStateChanged())&&this._fire(`modified`,r)},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e,pointer:t}),this._handleEvent(e,`down`)},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,`move`)},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e,pointer:t}),this._handleEvent(e,`up`)},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,`down:before`);var n=this._target;if(i(e,3))this.fireRightClick&&this._handleEvent(e,`down`,3);else if(i(e,2))this.fireMiddleClick&&this._handleEvent(e,`down`,2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var r=this._pointer;this._previousPointer=r;var a=this._shouldRender(n),o=this._shouldGroup(e,n);if(this._shouldClearSelection(e,n)?this.discardActiveObject(e):o&&(this._handleGrouping(e,n),n=this._activeObject),this.selection&&(!n||!n.selectable&&!n.isEditing&&n!==this._activeObject)&&(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),n){var s=n===this._activeObject;n.selectable&&n.activeOn===`down`&&this.setActiveObject(n,e);var c=n._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e));if(n.__corner=c,n===this._activeObject&&(c||!o)){this._setupCurrentTransform(e,n,s);var l=n.controls[c],u=(r=this.getPointer(e),l&&l.getMouseDownHandler(e,n,l));u&&u(e,this._currentTransform,r.x,r.y)}}this._handleEvent(e,`down`),(a||o)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire(`before:transform`,{e,transform:t})},__onMouseMove:function(e){var t,n;if(this._handleEvent(e,`move:before`),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var r=this._groupSelector;r?(n=this._absolutePointer,r.left=n.x-r.ex,r.top=n.y-r.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,`move`),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var n=this._hoveredTarget,r=this._hoveredTargets,i=this.targets,a=Math.max(r.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:`mouseout`,canvasEvtOut:`mouse:out`,evtIn:`mouseover`,canvasEvtIn:`mouse:over`});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(i[o],t,{oldTarget:r[o],evtOut:`mouseout`,evtIn:`mouseover`});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var n=this._draggedoverTarget,r=this._hoveredTargets,i=this.targets,a=Math.max(r.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:`dragleave`,evtIn:`dragenter`});for(var o=0;o<a;o++)this.fireSyntheticInOutEvents(i[o],t,{oldTarget:r[o],evtOut:`dragleave`,evtIn:`dragenter`});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,n){var r,i,a,o=n.oldTarget,s=o!==e,c=n.canvasEvtIn,l=n.canvasEvtOut;s&&(r={e:t,target:e,previousTarget:o},i={e:t,target:o,nextTarget:e}),a=e&&s,o&&s&&(l&&this.fire(l,i),o.fire(n.evtOut,i)),a&&(c&&this.fire(c,r),e.fire(n.evtIn,r))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,`wheel`),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),n=this._currentTransform;n.reset=!1,n.shiftKey=e.shiftKey,n.altKey=e[this.centeredKey],this._performTransformAction(e,n,t),n.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,n){var r=n.x,i=n.y,a=t.action,o=!1,s=t.actionHandler;s&&(o=s(e,t,r,i)),a===`drag`&&o&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||o},_fire:t.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var n=t.hoverCursor||this.hoverCursor,r=this._activeObject&&this._activeObject.type===`activeSelection`?this._activeObject:null,i=(!r||!r.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));i?this.setCursor(this.getCornerCursor(i,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map(function(e){n=e.hoverCursor||n}),this.setCursor(n))},getCornerCursor:function(e,t,n){var r=t.controls[e];return r.cursorStyleHandler(n,r,t)}})}(),function(){var e=Math.min,n=Math.max;t.util.object.extend(t.Canvas.prototype,{_shouldGroup:function(e,t){var n=this._activeObject;return n&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(n!==t||n.type===`activeSelection`)&&!t.onSelect({e})},_handleGrouping:function(e,t){var n=this._activeObject;n.__corner||t===n&&(!(t=this.findTarget(e,!0))||!t.selectable)||(n&&n.type===`activeSelection`?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var n=this._activeObject,r=n._objects.slice(0);n.contains(e)?(n.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),n.size()===1&&this._setActiveObject(n.item(0),t)):(n.addWithUpdate(e),this._hoveredTarget=n,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(r,t)},_createActiveSelection:function(e,t){var n=this.getActiveObjects(),r=this._createGroup(e);this._hoveredTarget=r,this._setActiveObject(r,t),this._fireSelectionEvents(n,t)},_createGroup:function(e){var n=this._objects,r=n.indexOf(this._activeObject)<n.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new t.ActiveSelection(r,{canvas:this})},_groupSelectedObjects:function(e){var n,r=this._collectObjects(e);r.length===1?this.setActiveObject(r[0],e):r.length>1&&(n=new t.ActiveSelection(r.reverse(),{canvas:this}),this.setActiveObject(n,e))},_collectObjects:function(r){for(var i,a=[],o=this._groupSelector.ex,s=this._groupSelector.ey,c=o+this._groupSelector.left,l=s+this._groupSelector.top,u=new t.Point(e(o,c),e(s,l)),d=new t.Point(n(o,c),n(s,l)),f=!this.selectionFullyContained,p=o===c&&s===l,m=this._objects.length;m--&&!((i=this._objects[m])&&i.selectable&&i.visible&&(f&&i.intersectsWithRect(u,d,!0)||i.isContainedWithinRect(u,d,!0)||f&&i.containsPoint(u,null,!0)||f&&i.containsPoint(d,null,!0))&&(a.push(i),p)););return a.length>1&&(a=a.filter(function(e){return!e.onSelect({e:r})})),a},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),t.util.object.extend(t.StaticCanvas.prototype,{toDataURL:function(e){e||={};var n=e.format||`png`,r=e.quality||1,i=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),a=this.toCanvasElement(i,e);return t.util.toDataURL(a,n,r)},toCanvasElement:function(e,n){e||=1;var r=((n||={}).width||this.width)*e,i=(n.height||this.height)*e,a=this.getZoom(),o=this.width,s=this.height,c=a*e,l=this.viewportTransform,u=(l[4]-(n.left||0))*e,d=(l[5]-(n.top||0))*e,f=this.interactive,p=[c,0,0,c,u,d],m=this.enableRetinaScaling,h=t.util.createCanvasElement(),g=this.contextTop;return h.width=r,h.height=i,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=p,this.width=r,this.height=i,this.calcViewportBoundaries(),this.renderCanvas(h.getContext(`2d`),this._objects),this.viewportTransform=l,this.width=o,this.height=s,this.calcViewportBoundaries(),this.interactive=f,this.enableRetinaScaling=m,this.contextTop=g,h}}),t.util.object.extend(t.StaticCanvas.prototype,{loadFromJSON:function(e,n,r){if(e){var i=typeof e==`string`?JSON.parse(e):t.util.object.clone(e),a=this,o=i.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete i.clipPath,this._enlivenObjects(i.objects,function(e){a.clear(),a._setBgOverlay(i,function(){o?a._enlivenObjects([o],function(t){a.clipPath=t[0],a.__setupCanvas.call(a,i,e,s,n)}):a.__setupCanvas.call(a,i,e,s,n)})},r),this}},__setupCanvas:function(e,t,n,r){var i=this;t.forEach(function(e,t){i.insertAt(e,t)}),this.renderOnAddRemove=n,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),r&&r()},_setBgOverlay:function(e,t){var n={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var r=function(){n.backgroundImage&&n.overlayImage&&n.backgroundColor&&n.overlayColor&&t&&t()};this.__setBgOverlay(`backgroundImage`,e.backgroundImage,n,r),this.__setBgOverlay(`overlayImage`,e.overlayImage,n,r),this.__setBgOverlay(`backgroundColor`,e.background,n,r),this.__setBgOverlay(`overlayColor`,e.overlay,n,r)}else t&&t()},__setBgOverlay:function(e,n,r,i){var a=this;if(!n)return r[e]=!0,void(i&&i());e===`backgroundImage`||e===`overlayImage`?t.util.enlivenObjects([n],function(t){a[e]=t[0],r[e]=!0,i&&i()}):this[`set`+t.util.string.capitalize(e,!0)](n,function(){r[e]=!0,i&&i()})},_enlivenObjects:function(e,n,r){e&&e.length!==0?t.util.enlivenObjects(e,function(e){n&&n(e)},null,r):n&&n([])},_toDataURL:function(e,t){this.clone(function(n){t(n.toDataURL(e))})},_toDataURLWithMultiplier:function(e,t,n){this.clone(function(r){n(r.toDataURLWithMultiplier(e,t))})},clone:function(e,t){var n=JSON.stringify(this.toJSON(t));this.cloneWithoutData(function(t){t.loadFromJSON(n,function(){e&&e(t)})})},cloneWithoutData:function(e){var n=t.util.createCanvasElement();n.width=this.width,n.height=this.height;var r=new t.Canvas(n);this.backgroundImage?(r.setBackgroundImage(this.backgroundImage.src,function(){r.renderAll(),e&&e(r)}),r.backgroundImageOpacity=this.backgroundImageOpacity,r.backgroundImageStretch=this.backgroundImageStretch):e&&e(r)}}),function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,a=t.util.string.capitalize,o=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:`object`,originX:`left`,originY:`top`,top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:`rgb(178,204,255)`,borderDashArray:null,cornerColor:`rgb(178,204,255)`,cornerStrokeColor:null,cornerStyle:`rect`,cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:`rgb(0,0,0)`,fillRule:`nonzero`,globalCompositeOperation:`source-over`,backgroundColor:``,selectionBackgroundColor:``,stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:`butt`,strokeLineJoin:`miter`,strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:`fill`,activeOn:`down`,stateProperties:`top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform`.split(` `),cacheProperties:`fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath`.split(` `),colorProperties:`fill stroke backgroundColor`.split(` `),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext(`2d`),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var n=t.perfLimitSizeTotal,r=e.width,i=e.height,a=t.maxCacheSideLimit,o=t.minCacheSideLimit;if(r<=a&&i<=a&&r*i<=n)return r<o&&(e.width=o),i<o&&(e.height=o),e;var s=r/i,c=t.util.limitDimsByArea(s,n),l=t.util.capValue,u=l(o,c.x,a),d=l(o,c.y,a);return r>u&&(e.zoomX/=r/u,e.width=u,e.capped=!0),i>d&&(e.zoomY/=i/d,e.height=d,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),n=t.x*e.scaleX/this.scaleX,r=t.y*e.scaleY/this.scaleY;return{width:n+2,height:r+2,zoomX:e.scaleX,zoomY:e.scaleY,x:n,y:r}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var n=e._currentTransform.target,r=e._currentTransform.action;if(this===n&&r.slice&&r.slice(0,5)===`scale`)return!1}var i,a,o=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),c=t.minCacheSideLimit,l=s.width,u=s.height,d=s.zoomX,f=s.zoomY,p=l!==this.cacheWidth||u!==this.cacheHeight,m=this.zoomX!==d||this.zoomY!==f,h=p||m,g=0,_=0,v=!1;if(p){var y=this._cacheCanvas.width,b=this._cacheCanvas.height,x=l>y||u>b;v=x||(l<.9*y||u<.9*b)&&y>c&&b>c,x&&!s.capped&&(l>c||u>c)&&(g=.1*l,_=.1*u)}return this instanceof t.Text&&this.path&&(h=!0,v=!0,g+=this.getHeightOfLine(0)*this.zoomX,_+=this.getHeightOfLine(0)*this.zoomY),!!h&&(v?(o.width=Math.ceil(l+g),o.height=Math.ceil(u+_)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,o.width,o.height)),i=s.x/2,a=s.y/2,this.cacheTranslationX=Math.round(o.width/2-i)+i,this.cacheTranslationY=Math.round(o.height/2-a)+a,this.cacheWidth=l,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(d,f),this.zoomX=d,this.zoomY=f,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,`fill`),this._initGradient(e.stroke,`stroke`),this._initPattern(e.fill,`fill`),this._initPattern(e.stroke,`stroke`)},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,n=this.calcTransformMatrix(!t);e.transform(n[0],n[1],n[2],n[3],n[4],n[5])},toObject:function(e){var n=t.Object.NUM_FRACTION_DIGITS,r={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:i(this.left,n),top:i(this.top,n),width:i(this.width,n),height:i(this.height,n),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:i(this.strokeWidth,n),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,n),scaleX:i(this.scaleX,n),scaleY:i(this.scaleY,n),angle:i(this.angle,n),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,n),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:i(this.skewX,n),skewY:i(this.skewY,n)};return this.clipPath&&!this.clipPath.excludeFromExport&&(r.clipPath=this.clipPath.toObject(e),r.clipPath.inverted=this.clipPath.inverted,r.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,r,e),this.includeDefaultValues||(r=this._removeDefaultValues(r)),r},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var n=t.util.getKlass(e.type).prototype;return n.stateProperties.forEach(function(t){t===`left`||t===`top`||(e[t]===n[t]&&delete e[t],Array.isArray(e[t])&&Array.isArray(n[t])&&e[t].length===0&&n[t].length===0&&delete e[t])}),e},toString:function(){return`#<fabric.`+a(this.type)+`>`},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,n=e.scaleY;if(this.canvas){var r=this.canvas.getZoom(),i=this.canvas.getRetinaScaling();t*=r*i,n*=r*i}return{scaleX:t,scaleY:n}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,n){var r=e===`scaleX`||e===`scaleY`,i=this[e]!==n,a=!1;return r&&(n=this._constrainScale(n)),e===`scaleX`&&n<0?(this.flipX=!this.flipX,n*=-1):e===`scaleY`&&n<0?(this.flipY=!this.flipY,n*=-1):e!==`shadow`||!n||n instanceof t.Shadow?e===`dirty`&&this.group&&this.group.set(`dirty`,n):n=new t.Shadow(n),this[e]=n,i&&(a=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,a&&this.group.set(`dirty`,!0)):a&&this.stateProperties.indexOf(e)>-1&&this.group.set(`dirty`,!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return this.opacity===0||!this.width&&!this.height&&this.strokeWidth===0||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:`cacheProperties`})),e.restore())},renderCache:function(e){e||={},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:`cacheProperties`}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&this.stroke!==`transparent`&&this.strokeWidth!==0},hasFill:function(){return this.fill&&this.fill!==`transparent`},needsItsOwnCache:function(){return!!(this.paintFirst===`stroke`&&this.hasFill()&&this.hasStroke()&&typeof this.shadow==`object`||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(this.shadow.offsetX!==0||this.shadow.offsetY!==0)},drawClipPathOnCache:function(e,n){if(e.save(),n.inverted?e.globalCompositeOperation=`destination-out`:e.globalCompositeOperation=`destination-in`,n.absolutePositioned){var r=t.util.invertTransform(this.calcTransformMatrix());e.transform(r[0],r[1],r[2],r[3],r[4],r[5])}n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},drawObject:function(e,t){var n=this.fill,r=this.stroke;t?(this.fill=`black`,this.stroke=``,this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e,this.clipPath),this.fill=n,this.stroke=r},_drawClipPath:function(e,t){t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e,t))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged(`cacheProperties`)){if(this._cacheCanvas&&this._cacheContext&&!e){var t=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-n/2,t,n)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var n=t.stroke;n&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,n.toLive?n.gradientUnits===`percentage`||n.gradientTransform||n.patternTransform?this._applyPatternForTransformedGradient(e,n):(e.strokeStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var n=t.fill;n&&(n.toLive?(e.fillStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=n)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle=`transparent`,e.fillStyle=`#000000`},_setLineDash:function(e,t){!t||t.length===0||(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,n){var r,i,a,s=this.getViewportTransform(),c=this.calcTransformMatrix();i=typeof(n||={}).hasBorders<`u`?n.hasBorders:this.hasBorders,a=typeof n.hasControls<`u`?n.hasControls:this.hasControls,c=t.util.multiplyTransformMatrices(s,c),r=t.util.qrDecompose(c),e.save(),e.translate(r.translateX,r.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(r.angle-=180),e.rotate(o(this.group?r.angle:this.angle)),n.forActiveSelection||this.group?i&&this.drawBordersInGroup(e,r,n):i&&this.drawBorders(e,n),a&&this.drawControls(e,n),e.restore()},_setShadow:function(e){if(this.shadow){var n,r=this.shadow,i=this.canvas,a=i&&i.viewportTransform[0]||1,o=i&&i.viewportTransform[3]||1;n=r.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),i&&i._isRetinaScaling()&&(a*=t.devicePixelRatio,o*=t.devicePixelRatio),e.shadowColor=r.color,e.shadowBlur=r.blur*t.browserShadowBlurConstant*(a+o)*(n.scaleX+n.scaleY)/4,e.shadowOffsetX=r.offsetX*a*n.scaleX,e.shadowOffsetY=r.offsetY*o*n.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor=``,e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var n=t.gradientTransform||t.patternTransform,r=-this.width/2+t.offsetX||0,i=-this.height/2+t.offsetY||0;return t.gradientUnits===`percentage`?e.transform(this.width,0,0,this.height,r,i):e.transform(1,0,0,1,r,i),n&&e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),{offsetX:r,offsetY:i}},_renderPaintInOrder:function(e){this.paintFirst===`stroke`?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),this.fillRule===`evenodd`?e.fill(`evenodd`):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&this.strokeWidth!==0){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,n){var r,i=this._limitCacheSize(this._getCacheCanvasDimensions()),a=t.util.createCanvasElement(),o=this.canvas.getRetinaScaling(),s=i.x/this.scaleX/o,c=i.y/this.scaleY/o;a.width=s,a.height=c,(r=a.getContext(`2d`)).beginPath(),r.moveTo(0,0),r.lineTo(s,0),r.lineTo(s,c),r.lineTo(0,c),r.closePath(),r.translate(s/2,c/2),r.scale(i.zoomX/this.scaleX/o,i.zoomY/this.scaleY/o),this._applyPatternGradientTransform(r,n),r.fillStyle=n.toLive(e),r.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(o*this.scaleX/i.zoomX,o*this.scaleY/i.zoomY),e.strokeStyle=r.createPattern(a,`no-repeat`)},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set(`scaleX`,e.scaleX),this.set(`scaleY`,e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var n=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),n=t.util.transformPoint(n,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,n.x+=e.offsetLeft,n.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(n,`center`,`center`)},clone:function(e,n){var r=this.toObject(n);this.constructor.fromObject?this.constructor.fromObject(r,e):t.Object._fromObject(`Object`,r,e)},cloneAsImage:function(e,n){var r=this.toCanvasElement(n);return e&&e(new t.Image(r)),this},toCanvasElement:function(e){e||={};var n=t.util,r=n.saveObjectTransform(this),i=this.group,a=this.shadow,o=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&n.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var c,l,u,d,f=t.util.createCanvasElement(),p=this.getBoundingRect(!0,!0),m=this.shadow,h={x:0,y:0};m&&(l=m.blur,c=m.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),h.x=2*Math.round(o(m.offsetX)+l)*o(c.scaleX),h.y=2*Math.round(o(m.offsetY)+l)*o(c.scaleY)),u=p.width+h.x,d=p.height+h.y,f.width=Math.ceil(u),f.height=Math.ceil(d);var g=new t.StaticCanvas(f,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});e.format===`jpeg`&&(g.backgroundColor=`#fff`),this.setPositionByOrigin(new t.Point(g.width/2,g.height/2),`center`,`center`);var _=this.canvas;g.add(this);var v=g.toCanvasElement(s||1,e);return this.shadow=a,this.set(`canvas`,_),i&&(this.group=i),this.set(r).setCoords(),g._objects=[],g.dispose(),g=null,v},toDataURL:function(e){return e||={},t.util.toDataURL(this.toCanvasElement(e),e.format||`png`,e.quality||1)},isType:function(e){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=(this.originX!==`center`||this.originY!==`center`)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set(`angle`,e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,n){n||=this.canvas.getPointer(e);var r=new t.Point(n.x,n.y),i=this._getLeftTopCoords();return this.angle&&(r=t.util.rotatePoint(r,i,o(-this.angle))),{x:r.x-i.x,y:r.y-i.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){t.runningAnimations&&t.runningAnimations.cancelByTarget(this)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),n(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object.ENLIVEN_PROPS=[`clipPath`],t.Object._fromObject=function(e,n,i,a){var o=t[e];n=r(n,!0),t.util.enlivenPatterns([n.fill,n.stroke],function(e){typeof e[0]<`u`&&(n.fill=e[0]),typeof e[1]<`u`&&(n.stroke=e[1]),t.util.enlivenObjectEnlivables(n,n,function(){var e=a?new o(n[a],n):new o(n);i&&i(e)})})},t.Object.__uid=0)}(e),function(){var e=t.util.degreesToRadians,n={left:-.5,center:0,right:.5},r={top:-.5,center:0,bottom:.5};t.util.object.extend(t.Object.prototype,{translateToGivenOrigin:function(e,i,a,o,s){var c,l,u,d=e.x,f=e.y;return typeof i==`string`?i=n[i]:i-=.5,typeof o==`string`?o=n[o]:o-=.5,typeof a==`string`?a=r[a]:a-=.5,typeof s==`string`?s=r[s]:s-=.5,l=s-a,((c=o-i)||l)&&(u=this._getTransformedDimensions(),d=e.x+c*u.x,f=e.y+l*u.y),new t.Point(d,f)},translateToCenterPoint:function(n,r,i){var a=this.translateToGivenOrigin(n,r,i,`center`,`center`);return this.angle?t.util.rotatePoint(a,n,e(this.angle)):a},translateToOriginPoint:function(n,r,i){var a=this.translateToGivenOrigin(n,`center`,`center`,r,i);return this.angle?t.util.rotatePoint(a,n,e(this.angle)):a},getCenterPoint:function(){var e=new t.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var n=this.getCenterPoint();return this.translateToOriginPoint(n,e,t)},toLocalPoint:function(n,r,i){var a,o,s=this.getCenterPoint();return a=typeof r<`u`&&typeof i<`u`?this.translateToGivenOrigin(s,`center`,`center`,r,i):new t.Point(this.left,this.top),o=new t.Point(n.x,n.y),this.angle&&(o=t.util.rotatePoint(o,s,-e(this.angle))),o.subtractEquals(a)},setPositionByOrigin:function(e,t,n){var r=this.translateToCenterPoint(e,t,n),i=this.translateToOriginPoint(r,this.originX,this.originY);this.set(`left`,i.x),this.set(`top`,i.y)},adjustPosition:function(r){var i,a,o=e(this.angle),s=this.getScaledWidth(),c=t.util.cos(o)*s,l=t.util.sin(o)*s;i=typeof this.originX==`string`?n[this.originX]:this.originX-.5,a=typeof r==`string`?n[r]:r-.5,this.left+=c*(a-i),this.top+=l*(a-i),this.setCoords(),this.originX=r},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX=`center`,this.originY=`center`,this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),`left`,`top`)}})}(),function(){var e=t.util,n=e.degreesToRadians,r=e.multiplyTransformMatrices,i=e.transformPoint;e.object.extend(t.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,n){return function(e){return[new t.Point(e.tl.x,e.tl.y),new t.Point(e.tr.x,e.tr.y),new t.Point(e.br.x,e.br.y),new t.Point(e.bl.x,e.bl.y)]}(this._getCoords(e,n))},intersectsWithRect:function(e,n,r,i){var a=this.getCoords(r,i);return t.Intersection.intersectPolygonRectangle(a,e,n).status===`Intersection`},intersectsWithObject:function(e,n,r){return t.Intersection.intersectPolygonPolygon(this.getCoords(n,r),e.getCoords(n,r)).status===`Intersection`||e.isContainedWithinObject(this,n,r)||this.isContainedWithinObject(e,n,r)},isContainedWithinObject:function(e,t,n){for(var r=this.getCoords(t,n),i=t?e.aCoords:e.lineCoords,a=0,o=e._getImageLines(i);a<4;a++)if(!e.containsPoint(r[a],o))return!1;return!0},isContainedWithinRect:function(e,t,n,r){var i=this.getBoundingRect(n,r);return i.left>=e.x&&i.left+i.width<=t.x&&i.top>=e.y&&i.top+i.height<=t.y},containsPoint:function(e,t,n,r){var i=this._getCoords(n,r),a=(t||=this._getImageLines(i),this._findCrossPoints(e,t));return a!==0&&a%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!(!this.getCoords(!0,e).some(function(e){return e.x<=n.x&&e.x>=t.x&&e.y<=n.y&&e.y>=t.y})&&!this.intersectsWithRect(t,n,!0,e))||this._containsCenterOfCanvas(t,n,e)},_containsCenterOfCanvas:function(e,t,n){var r={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(r,null,!0,n)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,n,!0,e)||this.getCoords(!0,e).every(function(e){return(e.x>=n.x||e.x<=t.x)&&(e.y>=n.y||e.y<=t.y)})&&this._containsCenterOfCanvas(t,n,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var n,r,i,a,o,s=0;for(var c in t)if(!((o=t[c]).o.y<e.y&&o.d.y<e.y||o.o.y>=e.y&&o.d.y>=e.y||(o.o.x===o.d.x&&o.o.x>=e.x?a=o.o.x:(n=(o.d.y-o.o.y)/(o.d.x-o.o.x),r=e.y-0*e.x,i=o.o.y-n*o.o.x,a=-(r-i)/(0-n)),a>=e.x&&(s+=1),s!==2)))break;return s},getBoundingRect:function(t,n){var r=this.getCoords(t,n);return e.makeBoundingBoxFromPoints(r)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:e===0?1e-4:e},scale:function(e){return this._set(`scaleX`,e),this._set(`scaleY`,e),this.setCoords()},scaleToWidth:function(e,t){var n=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/n)},scaleToHeight:function(e,t){var n=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/n)},calcLineCoords:function(){var t=this.getViewportTransform(),r=this.padding,a=n(this.angle),o=e.cos(a)*r,s=e.sin(a)*r,c=o+s,l=o-s,u=this.calcACoords(),d={tl:i(u.tl,t),tr:i(u.tr,t),bl:i(u.bl,t),br:i(u.br,t)};return r&&(d.tl.x-=l,d.tl.y-=c,d.tr.x+=c,d.tr.y-=l,d.bl.x-=c,d.bl.y+=l,d.br.x+=l,d.br.y+=c),d},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=this.getViewportTransform(),i=r(r(n,t),e),a=(i=r(i,[1/n[0],0,0,1/n[3],0,0]),this._calculateCurrentDimensions()),o={};return this.forEachControl(function(e,t,n){o[t]=e.positionHandler(a,i,n)}),o},calcACoords:function(){var e=this._calcRotateMatrix(),t=r(this._calcTranslateMatrix(),e),n=this._getTransformedDimensions(),a=n.x/2,o=n.y/2;return{tl:i({x:-a,y:-o},t),tr:i({x:a,y:-o},t),bl:i({x:-a,y:o},t),br:i({x:a,y:o},t)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t=`_`,n=``;return!e&&this.group&&(n=this.group.transformMatrixKey(e)+t),n+this.top+t+this.left+t+this.scaleX+t+this.scaleY+t+this.skewX+t+this.skewY+t+this.angle+t+this.originX+t+this.originY+t+this.width+t+this.height+t+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var n=this.transformMatrixKey(e),i=this.matrixCache||={};return i.key===n?i.value:(this.group&&(t=r(this.group.calcTransformMatrix(!1),t)),i.key=n,i.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),n=this.ownMatrixCache||={};if(n.key===t)return n.value;var r=this._calcTranslateMatrix(),i={angle:this.angle,translateX:r[4],translateY:r[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return n.key=t,n.value=e.composeMatrix(i),n.value},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,n){typeof t>`u`&&(t=this.skewX),typeof n>`u`&&(n=this.skewY);var r,i,a,o=t===0&&n===0;if(this.strokeUniform?(i=this.width,a=this.height):(i=(r=this._getNonTransformedDimensions()).x,a=r.y),o)return this._finalizeDimensions(i*this.scaleX,a*this.scaleY);var s=e.sizeAfterTransform(i,a,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:n});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform();return i(this._getTransformedDimensions(),e,!0).scalarAdd(2*this.padding)}})}(),t.util.object.extend(t.Object.prototype,{sendToBack:function(){return this.group?t.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?t.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?t.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?t.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&this.group.type!==`activeSelection`?t.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,n){if(n){if(n.toLive)return e+`: url(#SVGID_`+n.id+`); `;var r=new t.Color(n),i=e+`: `+r.toRgb()+`; `,a=r.getAlpha();return a!==1&&(i+=e+`-opacity: `+a.toString()+`; `),i}return e+`: none; `}var n=t.util.toFixed;t.util.object.extend(t.Object.prototype,{getSvgStyles:function(t){var n=this.fillRule?this.fillRule:`nonzero`,r=this.strokeWidth?this.strokeWidth:`0`,i=this.strokeDashArray?this.strokeDashArray.join(` `):`none`,a=this.strokeDashOffset?this.strokeDashOffset:`0`,o=this.strokeLineCap?this.strokeLineCap:`butt`,s=this.strokeLineJoin?this.strokeLineJoin:`miter`,c=this.strokeMiterLimit?this.strokeMiterLimit:`4`,l=typeof this.opacity<`u`?this.opacity:`1`,u=this.visible?``:` visibility: hidden;`,d=t?``:this.getSvgFilter(),f=e(`fill`,this.fill);return[e(`stroke`,this.stroke),`stroke-width: `,r,`; `,`stroke-dasharray: `,i,`; `,`stroke-linecap: `,o,`; `,`stroke-dashoffset: `,a,`; `,`stroke-linejoin: `,s,`; `,`stroke-miterlimit: `,c,`; `,f,`fill-rule: `,n,`; `,`opacity: `,l,`;`,d,u].join(``)},getSvgSpanStyles:function(t,n){var r=`; `,i=t.fontFamily?`font-family: `+(t.fontFamily.indexOf(`'`)===-1&&t.fontFamily.indexOf(`"`)===-1?`'`+t.fontFamily+`'`:t.fontFamily)+r:``,a=t.strokeWidth?`stroke-width: `+t.strokeWidth+r:``,o=(i=i,t.fontSize?`font-size: `+t.fontSize+`px`+r:``),s=t.fontStyle?`font-style: `+t.fontStyle+r:``,c=t.fontWeight?`font-weight: `+t.fontWeight+r:``,l=t.fill?e(`fill`,t.fill):``,u=t.stroke?e(`stroke`,t.stroke):``,d=this.getSvgTextDecoration(t);return d&&=`text-decoration: `+d+r,[u,a,i,o,s,c,d,l,t.deltaY?`baseline-shift: `+-t.deltaY+`; `:``,n?`white-space: pre; `:``].join(``)},getSvgTextDecoration:function(e){return[`overline`,`underline`,`line-through`].filter(function(t){return e[t.replace(`-`,``)]}).join(` `)},getSvgFilter:function(){return this.shadow?`filter: url(#SVGID_`+this.shadow.id+`);`:``},getSvgCommons:function(){return[this.id?`id="`+this.id+`" `:``,this.clipPath?`clip-path="url(#`+this.clipPath.clipPathId+`)" `:``].join(``)},getSvgTransform:function(e,n){var r=e?this.calcTransformMatrix():this.calcOwnMatrix();return`transform="`+t.util.matrixToSVG(r)+(n||``)+`" `},_setSVGBg:function(e){if(this.backgroundColor){var r=t.Object.NUM_FRACTION_DIGITS;e.push(` <rect `,this._getFillAttributes(this.backgroundColor),` x="`,n(-this.width/2,r),`" y="`,n(-this.height/2,r),`" width="`,n(this.width,r),`" height="`,n(this.height,r),`"></rect>
194
- `)}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return` `+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var n=(t||={}).reviver,r=t.additionalTransform||``,i=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(``),a=e.indexOf(`COMMON_PARTS`);return e[a]=i,n?n(e.join(``)):e.join(``)},_createBaseSVGMarkup:function(e,n){var r,i,a=(n||={}).noStyle,o=n.reviver,s=a?``:`style="`+this.getSvgStyles()+`" `,c=n.withShadow?`style="`+this.getSvgFilter()+`" `:``,l=this.clipPath,u=this.strokeUniform?`vector-effect="non-scaling-stroke" `:``,d=l&&l.absolutePositioned,f=this.stroke,p=this.fill,m=this.shadow,h=[],g=e.indexOf(`COMMON_PARTS`),_=n.additionalTransform;return l&&(l.clipPathId=`CLIPPATH_`+ t.Object.__uid++,i=`<clipPath id="`+l.clipPathId+`" >
195
- `+l.toClipPathSVG(o)+`</clipPath>
196
- `),d&&h.push(`<g `,c,this.getSvgCommons(),` >
197
- `),h.push(`<g `,this.getSvgTransform(!1),d?``:c+this.getSvgCommons(),` >
198
- `),r=[s,u,a?``:this.addPaintOrder(),` `,_?`transform="`+_+`" `:``].join(``),e[g]=r,p&&p.toLive&&h.push(p.toSVG(this)),f&&f.toLive&&h.push(f.toSVG(this)),m&&h.push(m.toSVG(this)),l&&h.push(i),h.push(e.join(``)),h.push(`</g>
199
- `),d&&h.push(`</g>
200
- `),o?o(h.join(``)):h.join(``)},addPaintOrder:function(){return this.paintFirst===`fill`?``:` paint-order="`+this.paintFirst+`" `}})}(),function(){var e=t.util.object.extend,n=`stateProperties`;function r(t,n,r){var i={};r.forEach(function(e){i[e]=t[e]}),e(t[n],i,!0)}function i(e,t,n){if(e===t)return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0,a=e.length;r<a;r++)if(!i(e[r],t[r]))return!1;return!0}if(e&&typeof e==`object`){var o,s=Object.keys(e);if(!t||typeof t!=`object`||!n&&s.length!==Object.keys(t).length)return!1;for(r=0,a=s.length;r<a;r++)if((o=s[r])!==`canvas`&&o!==`group`&&!i(e[o],t[o]))return!1;return!0}}t.util.object.extend(t.Object.prototype,{hasStateChanged:function(e){var t=`_`+(e||=n);return Object.keys(this[t]).length<this[e].length||!i(this[t],this,!0)},saveState:function(e){var t=e&&e.propertySet||n,i=`_`+t;return this[i]?(r(this,i,this[t]),e&&e.stateProperties&&r(this,i,e.stateProperties),this):this.setupState(e)},setupState:function(e){var t=(e||={}).propertySet||n;return e.propertySet=t,this[`_`+t]={},this.saveState(e),this}})}(),function(){var e=t.util.degreesToRadians;t.util.object.extend(t.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var n,r,i,a=e.x,o=e.y,s=Object.keys(this.oCoords),c=s.length-1;for(this.__corner=0;c>=0;c--)if(i=s[c],this.isControlVisible(i)&&(r=this._getImageLines(t?this.oCoords[i].touchCorner:this.oCoords[i].corner),(n=this._findCrossPoints({x:a,y:o},r))!==0&&n%2==1))return this.__corner=i,i;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var n=this.controls[t];e[t].corner=n.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=n.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var n=this.getCenterPoint(),r=this._calculateCurrentDimensions(),i=this.canvas.viewportTransform;return t.translate(n.x,n.y),t.scale(1/i[0],1/i[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-r.x/2,-r.y/2,r.x,r.y),t.restore(),this},drawBorders:function(e,t){t||={};var n=this._calculateCurrentDimensions(),r=this.borderScaleFactor,i=n.x+r,a=n.y+r,o=typeof t.hasControls<`u`?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-i/2,-a/2,i,a),o&&(e.beginPath(),this.forEachControl(function(t,n,r){t.withConnection&&t.getVisibility(r,n)&&(s=!0,e.moveTo(t.x*i,t.y*a),e.lineTo(t.x*i+t.offsetX,t.y*a+t.offsetY))}),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,n,r){r||={};var i=t.util.sizeAfterTransform(this.width,this.height,n),a=this.strokeWidth,o=this.strokeUniform,s=this.borderScaleFactor,c=i.x+a*(o?this.canvas.getZoom():n.scaleX)+s,l=i.y+a*(o?this.canvas.getZoom():n.scaleY)+s;return e.save(),this._setLineDash(e,r.borderDashArray||this.borderDashArray),e.strokeStyle=r.borderColor||this.borderColor,e.strokeRect(-c/2,-l/2,c,l),e.restore(),this},drawControls:function(e,n){n||={},e.save();var r,i,a=this.canvas.getRetinaScaling();return e.setTransform(a,0,0,a,0,0),e.strokeStyle=e.fillStyle=n.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=n.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,n.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(r=this.group.calcTransformMatrix()),this.forEachControl(function(a,o,s){i=s.oCoords[o],a.getVisibility(s,o)&&(r&&(i=t.util.transformPoint(i,r)),a.render(e,i.x,i.y,n,s))}),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||={},this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||={},e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),t.util.object.extend(t.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,n){var r=function(){},i=(n||={}).onComplete||r,a=n.onChange||r,o=this;return t.util.animate({target:this,startValue:e.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){e.set(`left`,t),o.requestRenderAll(),a()},onComplete:function(){e.setCoords(),i()}})},fxCenterObjectV:function(e,n){var r=function(){},i=(n||={}).onComplete||r,a=n.onChange||r,o=this;return t.util.animate({target:this,startValue:e.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){e.set(`top`,t),o.requestRenderAll(),a()},onComplete:function(){e.setCoords(),i()}})},fxRemove:function(e,n){var r=function(){},i=(n||={}).onComplete||r,a=n.onChange||r,o=this;return t.util.animate({target:this,startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set(`opacity`,t),o.requestRenderAll(),a()},onComplete:function(){o.remove(e),i()}})}}),t.util.object.extend(t.Object.prototype,{animate:function(){if(arguments[0]&&typeof arguments[0]==`object`){var e,t,n=[],r=[];for(e in arguments[0])n.push(e);for(var i=0,a=n.length;i<a;i++)e=n[i],t=i!==a-1,r.push(this._animate(e,arguments[0][e],arguments[1],t));return r}return this._animate.apply(this,arguments)},_animate:function(e,n,r,i){var a,o=this;n=n.toString(),r=r?t.util.object.clone(r):{},~e.indexOf(`.`)&&(a=e.split(`.`));var s=o.colorProperties.indexOf(e)>-1||a&&o.colorProperties.indexOf(a[1])>-1,c=a?this.get(a[0])[a[1]]:this.get(e);`from`in r||(r.from=c),s||(n=~n.indexOf(`=`)?c+parseFloat(n.replace(`=`,``)):parseFloat(n));var l={target:this,startValue:r.from,endValue:n,byValue:r.by,easing:r.easing,duration:r.duration,abort:r.abort&&function(e,t,n){return r.abort.call(o,e,t,n)},onChange:function(t,n,s){a?o[a[0]][a[1]]=t:o.set(e,t),!i&&r.onChange&&r.onChange(t,n,s)},onComplete:function(e,t,n){i||(o.setCoords(),r.onComplete&&r.onComplete(e,t,n))}};return s?t.util.animateColor(l.startValue,l.endValue,l.duration,l):t.util.animate(l)}}),function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};function a(e,t){var n=e.origin,r=e.axis1,i=e.axis2,a=e.dimension,o=t.nearest,s=t.center,c=t.farthest;return function(){switch(this.get(n)){case o:return Math.min(this.get(r),this.get(i));case s:return Math.min(this.get(r),this.get(i))+.5*this.get(a);case c:return Math.max(this.get(r),this.get(i))}}}t.Line?t.warn(`fabric.Line is already defined`):(t.Line=t.util.createClass(t.Object,{type:`line`,x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat(`x1`,`x2`,`y1`,`y2`),initialize:function(e,t){e||=[0,0,0,0],this.callSuper(`initialize`,t),this.set(`x1`,e[0]),this.set(`y1`,e[1]),this.set(`x2`,e[2]),this.set(`y2`,e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||={},this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left=`left`in e?e.left:this._getLeftToOriginX(),this.top=`top`in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper(`_set`,e,t),typeof i[e]<`u`&&this._setWidthHeight(),this},_getLeftToOriginX:a({origin:`originX`,axis1:`x1`,axis2:`x2`,dimension:`width`},{nearest:`left`,center:`center`,farthest:`right`}),_getTopToOriginY:a({origin:`originY`,axis1:`y1`,axis2:`y2`,dimension:`height`},{nearest:`top`,center:`center`,farthest:`bottom`}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var n=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=n},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return n(this.callSuper(`toObject`,e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper(`_getNonTransformedDimensions`);return this.strokeLineCap===`butt`&&(this.width===0&&(e.y-=this.strokeWidth),this.height===0&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,n=e*this.width*.5,r=t*this.height*.5;return{x1:n,x2:e*this.width*-.5,y1:r,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return[`<line `,`COMMON_PARTS`,`x1="`,e.x1,`" y1="`,e.y1,`" x2="`,e.x2,`" y2="`,e.y2,`" />
201
- `]}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`x1 y1 x2 y2`.split(` `)),t.Line.fromElement=function(e,r,i){i||={};var a=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),o=[a.x1||0,a.y1||0,a.x2||0,a.y2||0];r(new t.Line(o,n(a,i)))},t.Line.fromObject=function(e,n){var i=r(e,!0);i.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject(`Line`,i,function(e){delete e.points,n&&n(e)},`points`)})}(e),function(e){var t=e.fabric||={},n=t.util.degreesToRadians;t.Circle?t.warn(`fabric.Circle is already defined.`):(t.Circle=t.util.createClass(t.Object,{type:`circle`,radius:0,startAngle:0,endAngle:360,cacheProperties:t.Object.prototype.cacheProperties.concat(`radius`,`startAngle`,`endAngle`),_set:function(e,t){return this.callSuper(`_set`,e,t),e===`radius`&&this.setRadius(t),this},toObject:function(e){return this.callSuper(`toObject`,[`radius`,`startAngle`,`endAngle`].concat(e))},_toSVG:function(){var e,r=(this.endAngle-this.startAngle)%360;if(r===0)e=[`<circle `,`COMMON_PARTS`,`cx="0" cy="0" `,`r="`,this.radius,`" />
202
- `];else{var i=n(this.startAngle),a=n(this.endAngle),o=this.radius;e=[`<path d="M `+t.util.cos(i)*o+` `+t.util.sin(i)*o,` A `+o+` `+o,` 0 `,+(r>180?`1`:`0`)+` 1`,` `+t.util.cos(a)*o+` `+t.util.sin(a)*o,`" `,`COMMON_PARTS`,` />
203
- `]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,n(this.startAngle),n(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get(`radius`)*this.get(`scaleX`)},getRadiusY:function(){return this.get(`radius`)*this.get(`scaleY`)},setRadius:function(e){return this.radius=e,this.set(`width`,2*e).set(`height`,2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`cx cy r`.split(` `)),t.Circle.fromElement=function(e,n){var r=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!function(e){return`radius`in e&&e.radius>=0}(r))throw Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,n(new t.Circle(r))},t.Circle.fromObject=function(e,n){t.Object._fromObject(`Circle`,e,n)})}(e),function(e){var t=e.fabric||={};t.Triangle?t.warn(`fabric.Triangle is already defined`):(t.Triangle=t.util.createClass(t.Object,{type:`triangle`,width:100,height:100,_render:function(e){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return[`<polygon `,`COMMON_PARTS`,`points="`,[-e+` `+t,`0 `+-t,e+` `+t].join(`,`),`" />`]}}),t.Triangle.fromObject=function(e,n){return t.Object._fromObject(`Triangle`,e,n)})}(e),function(e){var t=e.fabric||={},n=2*Math.PI;t.Ellipse?t.warn(`fabric.Ellipse is already defined.`):(t.Ellipse=t.util.createClass(t.Object,{type:`ellipse`,rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat(`rx`,`ry`),initialize:function(e){this.callSuper(`initialize`,e),this.set(`rx`,e&&e.rx||0),this.set(`ry`,e&&e.ry||0)},_set:function(e,t){switch(this.callSuper(`_set`,e,t),e){case`rx`:this.rx=t,this.set(`width`,2*t);break;case`ry`:this.ry=t,this.set(`height`,2*t)}return this},getRx:function(){return this.get(`rx`)*this.get(`scaleX`)},getRy:function(){return this.get(`ry`)*this.get(`scaleY`)},toObject:function(e){return this.callSuper(`toObject`,[`rx`,`ry`].concat(e))},_toSVG:function(){return[`<ellipse `,`COMMON_PARTS`,`cx="0" cy="0" `,`rx="`,this.rx,`" ry="`,this.ry,`" />
204
- `]},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,n,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`cx cy rx ry`.split(` `)),t.Ellipse.fromElement=function(e,n){var r=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,n(new t.Ellipse(r))},t.Ellipse.fromObject=function(e,n){t.Object._fromObject(`Ellipse`,e,n)})}(e),function(e){var t=e.fabric||={},n=t.util.object.extend;t.Rect?t.warn(`fabric.Rect is already defined`):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat(`rx`,`ry`),type:`rect`,rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat(`rx`,`ry`),initialize:function(e){this.callSuper(`initialize`,e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,n=this.ry?Math.min(this.ry,this.height/2):0,r=this.width,i=this.height,a=-this.width/2,o=-this.height/2,s=t!==0||n!==0,c=.4477152502;e.beginPath(),e.moveTo(a+t,o),e.lineTo(a+r-t,o),s&&e.bezierCurveTo(a+r-c*t,o,a+r,o+c*n,a+r,o+n),e.lineTo(a+r,o+i-n),s&&e.bezierCurveTo(a+r,o+i-c*n,a+r-c*t,o+i,a+r-t,o+i),e.lineTo(a+t,o+i),s&&e.bezierCurveTo(a+c*t,o+i,a,o+i-c*n,a,o+i-n),e.lineTo(a,o+n),s&&e.bezierCurveTo(a,o+c*n,a+c*t,o,a+t,o),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper(`toObject`,[`rx`,`ry`].concat(e))},_toSVG:function(){return[`<rect `,`COMMON_PARTS`,`x="`,-this.width/2,`" y="`,-this.height/2,`" rx="`,this.rx,`" ry="`,this.ry,`" width="`,this.width,`" height="`,this.height,`" />
205
- `]}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`x y rx ry width height`.split(` `)),t.Rect.fromElement=function(e,r,i){if(!e)return r(null);i||={};var a=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);a.left=a.left||0,a.top=a.top||0,a.height=a.height||0,a.width=a.width||0;var o=new t.Rect(n(i?t.util.object.clone(i):{},a));o.visible=o.visible&&o.width>0&&o.height>0,r(o)},t.Rect.fromObject=function(e,n){return t.Object._fromObject(`Rect`,e,n)})}(e),function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.util.array.min,i=t.util.array.max,a=t.util.toFixed,o=t.util.projectStrokeOnPoints;t.Polyline?t.warn(`fabric.Polyline is already defined`):(t.Polyline=t.util.createClass(t.Object,{type:`polyline`,points:null,exactBoundingBox:!1,cacheProperties:t.Object.prototype.cacheProperties.concat(`points`),initialize:function(e,t){t||={},this.points=e||[],this.callSuper(`initialize`,t),this._setPositionDimensions(t)},_projectStrokeOnPoints:function(){return o(this.points,this,!0)},_setPositionDimensions:function(e){var t,n=this._calcDimensions(e),r=this.exactBoundingBox?this.strokeWidth:0;this.width=n.width-r,this.height=n.height-r,e.fromSVG||(t=this.translateToGivenOrigin({x:n.left-this.strokeWidth/2+r/2,y:n.top-this.strokeWidth/2+r/2},`left`,`top`,this.originX,this.originY)),typeof e.left>`u`&&(this.left=e.fromSVG?n.left:t.x),typeof e.top>`u`&&(this.top=e.fromSVG?n.top:t.y),this.pathOffset={x:n.left+this.width/2+r/2,y:n.top+this.height/2+r/2}},_calcDimensions:function(){var e=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,t=r(e,`x`)||0,n=r(e,`y`)||0;return{left:t,top:n,width:(i(e,`x`)||0)-t,height:(i(e,`y`)||0)-n}},toObject:function(e){return n(this.callSuper(`toObject`,e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],n=this.pathOffset.x,r=this.pathOffset.y,i=t.Object.NUM_FRACTION_DIGITS,o=0,s=this.points.length;o<s;o++)e.push(a(this.points[o].x-n,i),`,`,a(this.points[o].y-r,i),` `);return[`<`+this.type+` `,`COMMON_PARTS`,`points="`,e.join(``),`" />
206
- `]},commonRender:function(e){var t,n=this.points.length,r=this.pathOffset.x,i=this.pathOffset.y;if(!n||isNaN(this.points[n-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-r,this.points[0].y-i);for(var a=0;a<n;a++)t=this.points[a],e.lineTo(t.x-r,t.y-i);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get(`points`).length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(r,i,a){if(!r)return i(null);a||={};var o=t.parsePointsAttribute(r.getAttribute(`points`)),s=t.parseAttributes(r,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,i(new t[e](o,n(s,a)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator(`Polyline`),t.Polyline.fromObject=function(e,n){return t.Object._fromObject(`Polyline`,e,n,`points`)})}(e),function(e){var t=e.fabric||={},n=t.util.projectStrokeOnPoints;t.Polygon?t.warn(`fabric.Polygon is already defined`):(t.Polygon=t.util.createClass(t.Polyline,{type:`polygon`,_projectStrokeOnPoints:function(){return n(this.points,this)},_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator(`Polygon`),t.Polygon.fromObject=function(e,n){t.Object._fromObject(`Polygon`,e,n,`points`)})}(e),function(e){var t=e.fabric||={},n=t.util.array.min,r=t.util.array.max,i=t.util.object.extend,a=t.util.object.clone,o=t.util.toFixed;t.Path?t.warn(`fabric.Path is already defined`):(t.Path=t.util.createClass(t.Object,{type:`path`,path:null,cacheProperties:t.Object.prototype.cacheProperties.concat(`path`,`fillRule`),stateProperties:t.Object.prototype.stateProperties.concat(`path`),initialize:function(e,t){delete(t=a(t||{})).path,this.callSuper(`initialize`,t),this._setPath(e||[],t)},_setPath:function(e,n){this.path=t.util.makePathSimpler(Array.isArray(e)?e:t.util.parsePath(e)),t.Polyline.prototype._setPositionDimensions.call(this,n||{})},_renderPathCommands:function(e){var t,n=0,r=0,i=0,a=0,o=0,s=0,c=-this.pathOffset.x,l=-this.pathOffset.y;e.beginPath();for(var u=0,d=this.path.length;u<d;++u)switch(t=this.path[u],t[0]){case`L`:i=t[1],a=t[2],e.lineTo(i+c,a+l);break;case`M`:n=i=t[1],r=a=t[2],e.moveTo(i+c,a+l);break;case`C`:i=t[5],a=t[6],o=t[3],s=t[4],e.bezierCurveTo(t[1]+c,t[2]+l,o+c,s+l,i+c,a+l);break;case`Q`:e.quadraticCurveTo(t[1]+c,t[2]+l,t[3]+c,t[4]+l),i=t[3],a=t[4],o=t[1],s=t[2];break;case`z`:case`Z`:i=n,a=r,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return`#<fabric.Path (`+this.complexity()+`): { "top": `+this.top+`, "left": `+this.left+` }>`},toObject:function(e){return i(this.callSuper(`toObject`,e),{path:this.path.map(function(e){return e.slice()})})},toDatalessObject:function(e){var t=this.toObject([`sourcePath`].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return[`<path `,`COMMON_PARTS`,`d="`,t.util.joinPath(this.path),`" stroke-linecap="round" `,`/>
207
- `]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return` translate(`+o(-this.pathOffset.x,e)+`, `+o(-this.pathOffset.y,e)+`)`},toClipPathSVG:function(e){var t=this._getOffsetTransform();return` `+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,i,a=[],o=[],s=0,c=0,l=0,u=0,d=0,f=this.path.length;d<f;++d){switch((e=this.path[d])[0]){case`L`:l=e[1],u=e[2],i=[];break;case`M`:s=l=e[1],c=u=e[2],i=[];break;case`C`:i=t.util.getBoundsOfCurve(l,u,e[1],e[2],e[3],e[4],e[5],e[6]),l=e[5],u=e[6];break;case`Q`:i=t.util.getBoundsOfCurve(l,u,e[1],e[2],e[1],e[2],e[3],e[4]),l=e[3],u=e[4];break;case`z`:case`Z`:l=s,u=c}i.forEach(function(e){a.push(e.x),o.push(e.y)}),a.push(l),o.push(u)}var p=n(a)||0,m=n(o)||0;return{left:p,top:m,width:(r(a)||0)-p,height:(r(o)||0)-m}}}),t.Path.fromObject=function(e,n){if(typeof e.sourcePath==`string`){var r=e.sourcePath;t.loadSVGFromURL(r,function(r){var i=r[0];i.setOptions(e),e.clipPath?t.util.enlivenObjects([e.clipPath],function(e){i.clipPath=e[0],n&&n(i)}):n&&n(i)})}else t.Object._fromObject(`Path`,e,n,`path`)},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat([`d`]),t.Path.fromElement=function(e,n,r){var a=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);a.fromSVG=!0,n(new t.Path(a.d,i(a,r)))})}(e),function(e){var t=e.fabric||={},n=t.util.array.min,r=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:`group`,strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,n){t||={},this._objects=[],n&&this.callSuper(`initialize`,t),this._objects=e||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;if(n)this._updateObjectsACoords();else{var i=t&&t.centerPoint;t.originX!==void 0&&(this.originX=t.originX),t.originY!==void 0&&(this.originY=t.originY),i||this._calcBounds(),this._updateObjectsCoords(i),delete t.centerPoint,this.callSuper(`initialize`,t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(!0)},_updateObjectsCoords:function(e){e||=this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var n=e.left,r=e.top;e.set({left:n-t.x,top:r-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return`#<fabric.Group: (`+this.complexity()+`)>`},addWithUpdate:function(e){var n=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(n&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set(`canvas`,this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,n?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set(`canvas`,this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,n){var r=this._objects.length;if(this.useSetOnGroup)for(;r--;)this._objects[r].setOnGroup(e,n);if(e===`canvas`)for(;r--;)this._objects[r]._set(e,n);t.Object.prototype._set.call(this,e,n)},toObject:function(e){var n=this.includeDefaultValues,r=this._objects.filter(function(e){return!e.excludeFromExport}).map(function(t){var r=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toObject(e);return t.includeDefaultValues=r,i}),i=t.Object.prototype.toObject.call(this,e);return i.objects=r,i},toDatalessObject:function(e){var n,r=this.sourcePath;if(r)n=r;else{var i=this.includeDefaultValues;n=this._objects.map(function(t){var n=t.includeDefaultValues;t.includeDefaultValues=i;var r=t.toDatalessObject(e);return t.includeDefaultValues=n,r})}var a=t.Object.prototype.toDatalessObject.call(this,e);return a.objects=n,a},render:function(e){this._transformDone=!0,this.callSuper(`render`,e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e){for(var n=0,r=this._objects.length;n<r;n++)if(this._objects[n].willDrawShadow())return this.ownCaching=!1,!1}return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,n=this._objects.length;e<n;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,n=this._objects.length;t<n;t++)this._objects[t].render(e);this._drawClipPath(e,this.clipPath)},isCacheDirty:function(e){if(this.callSuper(`isCacheDirty`,e))return!0;if(!this.statefullCache)return!1;for(var t=0,n=this._objects.length;t<n;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var r=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-r/2,-i/2,r,i)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach(function(n){t.util.addTransformToObject(n,e),delete n.group,n.setCoords()}),this},destroy:function(){return this._objects.forEach(function(e){e.set(`dirty`,!0)}),this._restoreObjectsState()},dispose:function(){this.callSuper(`dispose`),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[]},toActiveSelection:function(){if(this.canvas){var e=this._objects,n=this.canvas;this._objects=[];var r=this.toObject();delete r.objects;var i=new t.ActiveSelection([]);return i.set(r),i.type=`activeSelection`,n.remove(this),e.forEach(function(e){e.group=i,e.dirty=!0,n.add(e)}),i.canvas=n,i._objects=e,n._activeObject=i,i.setCoords(),i}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(e){e.setCoords(!0)}),this},_calcBounds:function(e){for(var t,n,r,i,a=[],o=[],s=[`tr`,`br`,`bl`,`tl`],c=0,l=this._objects.length,u=s.length;c<l;++c){for(r=(t=this._objects[c]).calcACoords(),i=0;i<u;i++)n=s[i],a.push(r[n].x),o.push(r[n].y);t.aCoords=r}this._getBounds(a,o,e)},_getBounds:function(e,i,a){var o=new t.Point(n(e),n(i)),s=new t.Point(r(e),r(i)),c=o.y||0,l=o.x||0,u=s.x-o.x||0,d=s.y-o.y||0;this.width=u,this.height=d,a||this.setPositionByOrigin({x:l,y:c},`left`,`top`)},_toSVG:function(e){for(var t=[`<g `,`COMMON_PARTS`,` >
208
- `],n=0,r=this._objects.length;n<r;n++)t.push(` `,this._objects[n].toSVG(e));return t.push(`</g>
209
- `),t},getSvgStyles:function(){var e=typeof this.opacity<`u`&&this.opacity!==1?`opacity: `+this.opacity+`;`:``,t=this.visible?``:` visibility: hidden;`;return[e,this.getSvgFilter(),t].join(``)},toClipPathSVG:function(e){for(var t=[],n=0,r=this._objects.length;n<r;n++)t.push(` `,this._objects[n].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,n){var r=e.objects,i=t.util.object.clone(e,!0);delete i.objects,typeof r==`string`?t.loadSVGFromURL(r,function(a){var o=t.util.groupSVGElements(a,e,r),s=i.clipPath;delete i.clipPath,o.set(i),s?t.util.enlivenObjects([s],function(e){o.clipPath=e[0],n&&n(o)}):n&&n(o)}):t.util.enlivenObjects(r,function(r){t.util.enlivenObjectEnlivables(e,i,function(){n&&n(new t.Group(r,i,!0))})})})}(e),function(e){var t=e.fabric||={};t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:`activeSelection`,initialize:function(e,n){n||={},this._objects=e||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;n.originX&&(this.originX=n.originX),n.originY&&(this.originY=n.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,n),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var n=t.Object.prototype.toObject.call(this),r=new t.Group([]);if(delete n.type,r.set(n),e.forEach(function(e){e.canvas.remove(e),e.group=r}),r._objects=e,!this.canvas)return r;var i=this.canvas;return i.add(r),i._activeObject=r,r.setCoords(),r},onDeselect:function(){return this.destroy(),!1},toString:function(){return`#<fabric.ActiveSelection: (`+this.complexity()+`)>`},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,n){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper(`_renderControls`,e,t),typeof(n||={}).hasControls>`u`&&(n.hasControls=!1),n.forActiveSelection=!0;for(var r=0,i=this._objects.length;r<i;r++)this._objects[r]._renderControls(e,n);e.restore()}}),t.ActiveSelection.fromObject=function(e,n){t.util.enlivenObjects(e.objects,function(r){delete e.objects,n&&n(new t.ActiveSelection(r,e,!0))})})}(e),function(e){var n=t.util.object.extend;e.fabric||={},e.fabric.Image?t.warn(`fabric.Image is already defined.`):(t.Image=t.util.createClass(t.Object,{type:`image`,strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:t.Object.prototype.stateProperties.concat(`cropX`,`cropY`),cacheProperties:t.Object.prototype.cacheProperties.concat(`cropX`,`cropY`),cacheKey:``,cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,n){n||={},this.filters=[],this.cacheKey=`texture`+ t.Object.__uid++,this.callSuper(`initialize`,n),this._initElement(e,n)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+`_filtered`),this._element=e,this._originalElement=e,this._initConfig(t),this.filters.length!==0&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var n=t.filterBackend;n&&n.evictCachesForKey&&n.evictCachesForKey(e)},dispose:function(){this.callSuper(`dispose`),this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+`_filtered`),this._cacheContext=void 0,[`_originalElement`,`_element`,`_filteredEl`,`_cacheCanvas`].forEach(function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&this.strokeWidth!==0){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,-n),e.lineTo(t,-n),e.lineTo(t,n),e.lineTo(-t,n),e.lineTo(-t,-n),e.closePath()}},toObject:function(e){var t=[];this.filters.forEach(function(e){e&&t.push(e.toObject())});var r=n(this.callSuper(`toObject`,[`cropX`,`cropY`].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:t});return this.resizeFilter&&(r.resizeFilter=this.resizeFilter.toObject()),r},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,n=[],r=[],i=this._element,a=-this.width/2,o=-this.height/2,s=``,c=``;if(!i)return[];if(this.hasCrop()){var l=t.Object.__uid++;n.push(`<clipPath id="imageCrop_`+l+`">
210
- `,` <rect x="`+a+`" y="`+o+`" width="`+this.width+`" height="`+this.height+`" />
211
- `,`</clipPath>
212
- `),s=` clip-path="url(#imageCrop_`+l+`)" `}if(this.imageSmoothing||(c=`" image-rendering="optimizeSpeed`),r.push(` <image `,`COMMON_PARTS`,`xlink:href="`,this.getSvgSrc(!0),`" x="`,a-this.cropX,`" y="`,o-this.cropY,`" width="`,i.width||i.naturalWidth,`" height="`,i.height||i.height,c,`"`,s,`></image>
213
- `),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=[` <rect `,`x="`,a,`" y="`,o,`" width="`,this.width,`" height="`,this.height,`" style="`,this.getSvgStyles(),`"/>
214
- `],this.fill=u}return n=this.paintFirst===`fill`?n.concat(r,e):n.concat(e,r)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute(`src`):t.src:this.src||``},setSrc:function(e,n,r){return t.util.loadImage(e,function(e,t){this.setElement(e,r),this._setWidthHeight(),n&&n(this,t)},this,r&&r.crossOrigin),this},toString:function(){return`#<fabric.Image: { src: "`+this.getSrc()+`" }>`},applyResizeFilters:function(){var e=this.resizeFilter,n=this.minimumScaleTrigger,r=this.getTotalObjectScaling(),i=r.scaleX,a=r.scaleY,o=this._filteredEl||this._originalElement;if(this.group&&this.set(`dirty`,!0),!e||i>n&&a>n)return this._element=o,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=a);t.filterBackend||=t.initFilterBackend();var s=t.util.createCanvasElement(),c=this._filteredEl?this.cacheKey+`_filtered`:this.cacheKey,l=o.width,u=o.height;s.width=l,s.height=u,this._element=s,this._lastScaleX=e.scaleX=i,this._lastScaleY=e.scaleY=a,t.filterBackend.applyFilters([e],o,l,u,this._element,c),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter(function(e){return e&&!e.isNeutralState()}),this.set(`dirty`,!0),this.removeTexture(this.cacheKey+`_filtered`),e.length===0)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var n=this._originalElement,r=n.naturalWidth||n.width,i=n.naturalHeight||n.height;if(this._element===this._originalElement){var a=t.util.createCanvasElement();a.width=r,a.height=i,this._element=a,this._filteredEl=a}else this._element=this._filteredEl,this._filteredEl.getContext(`2d`).clearRect(0,0,r,i),this._lastScaleX=1,this._lastScaleY=1;return t.filterBackend||=t.initFilterBackend(),t.filterBackend.applyFilters(e,this._originalElement,r,i,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),t.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var n=this._filterScalingX,r=this._filterScalingY,i=this.width,a=this.height,o=Math.min,s=Math.max,c=s(this.cropX,0),l=s(this.cropY,0),u=t.naturalWidth||t.width,d=t.naturalHeight||t.height,f=c*n,p=l*r,m=o(i*n,u-f),h=o(a*r,d-p),g=-i/2,_=-a/2,v=o(i,u/n-c),y=o(a,d/r-l);t&&e.drawImage(t,f,p,m,h,g,_,v,y)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,n){this.setElement(t.util.getById(e),n),t.util.addClass(this.getElement(),t.Image.CSS_CANVAS)},_initConfig:function(e){e||={},this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,n){e&&e.length?t.util.enlivenObjects(e,function(e){n&&n(e)},`fabric.Image.filters`):n&&n()},_setWidthHeight:function(e){e||={};var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,n=t.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||``),r=this._element.width,i=this._element.height,a=1,o=1,s=0,c=0,l=0,u=0,d=this.width,f=this.height,p={width:d,height:f};return!n||n.alignX===`none`&&n.alignY===`none`?(a=d/r,o=f/i):(n.meetOrSlice===`meet`&&(e=(d-r*(a=o=t.util.findScaleToFit(this._element,p)))/2,n.alignX===`Min`&&(s=-e),n.alignX===`Max`&&(s=e),e=(f-i*o)/2,n.alignY===`Min`&&(c=-e),n.alignY===`Max`&&(c=e)),n.meetOrSlice===`slice`&&(e=r-d/(a=o=t.util.findScaleToCover(this._element,p)),n.alignX===`Mid`&&(l=e/2),n.alignX===`Max`&&(l=e),e=i-f/o,n.alignY===`Mid`&&(u=e/2),n.alignY===`Max`&&(u=e),r=d/a,i=f/o)),{width:r,height:i,scaleX:a,scaleY:o,offsetLeft:s,offsetTop:c,cropX:l,cropY:u}}}),t.Image.CSS_CANVAS=`canvas-img`,t.Image.prototype.getSvgSrc=t.Image.prototype.getSrc,t.Image.fromObject=function(e,n){var r=t.util.object.clone(e);t.util.loadImage(r.src,function(e,i){i?n&&n(null,!0):t.Image.prototype._initFilters.call(r,r.filters,function(i){r.filters=i||[],t.Image.prototype._initFilters.call(r,[r.resizeFilter],function(i){r.resizeFilter=i[0],t.util.enlivenObjectEnlivables(r,r,function(){n(new t.Image(e,r),!1)})})})},null,r.crossOrigin)},t.Image.fromURL=function(e,n,r){t.util.loadImage(e,function(e,i){n&&n(new t.Image(e,r),i)},null,r&&r.crossOrigin)},t.Image.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`x y width height preserveAspectRatio xlink:href crossOrigin image-rendering`.split(` `)),t.Image.fromElement=function(e,r,i){var a=t.parseAttributes(e,t.Image.ATTRIBUTE_NAMES);t.Image.fromURL(a[`xlink:href`],r,n(i?t.util.object.clone(i):{},a))})}(e),t.util.object.extend(t.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(e){var n=function(){},r=(e||={}).onComplete||n,i=e.onChange||n,a=this;return t.util.animate({target:this,startValue:this.get(`angle`),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){a.rotate(e),i()},onComplete:function(){a.setCoords(),r()}})}}),t.util.object.extend(t.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function e(e,t){var n=`precision `+t+` float;
215
- void main(){}`,r=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(r,n),e.compileShader(r),!!e.getShaderParameter(r,e.COMPILE_STATUS)}function n(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}t.isWebglSupported=function(n){if(t.isLikelyNode)return!1;n||=t.WebglFilterBackend.prototype.tileSize;var r=document.createElement(`canvas`),i=r.getContext(`webgl`)||r.getContext(`experimental-webgl`),a=!1;if(i){t.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),a=t.maxTextureSize>=n;for(var o=[`highp`,`mediump`,`lowp`],s=0;s<3;s++)if(e(i,o[s])){t.webGlPrecision=o[s];break}}return this.isSupported=a,a},t.WebglFilterBackend=n,n.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,n){var r,o=typeof window.performance<`u`;try{new ImageData(1,1),r=!0}catch{r=!1}if(o&&r&&typeof ArrayBuffer<`u`&&typeof Uint8ClampedArray<`u`){var s=t.util.createCanvasElement(),c=new ArrayBuffer(e*n*4);if(t.forceGLPutImageData)return this.imageBuffer=c,void(this.copyGLTo2D=a);var l,u,d={imageBuffer:c,destinationWidth:e,destinationHeight:n,targetCanvas:s};s.width=e,s.height=n,l=window.performance.now(),i.call(d,this.gl,d),u=window.performance.now()-l,l=window.performance.now(),a.call(d,this.gl,d),u>window.performance.now()-l?(this.imageBuffer=c,this.copyGLTo2D=a):this.copyGLTo2D=i}},createWebGLCanvas:function(e,n){var r=t.util.createCanvasElement();r.width=e,r.height=n;var i={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},a=r.getContext(`webgl`,i);a||=r.getContext(`experimental-webgl`,i),a&&(a.clearColor(0,0,0,0),this.canvas=r,this.gl=a)},applyFilters:function(e,t,n,r,i,a){var o,s=this.gl;a&&(o=this.getCachedTexture(a,t));var c={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:n,sourceHeight:r,destinationWidth:n,destinationHeight:r,context:s,sourceTexture:this.createTexture(s,n,r,!o&&t),targetTexture:this.createTexture(s,n,r),originalTexture:o||this.createTexture(s,n,r,!o&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:i},l=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,l),e.forEach(function(e){e&&e.applyTo(c)}),function(e){var t=e.targetCanvas,n=t.width,r=t.height,i=e.destinationWidth,a=e.destinationHeight;(n!==i||r!==a)&&(t.width=i,t.height=a)}(c),this.copyGLTo2D(s,c),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(c.sourceTexture),s.deleteTexture(c.targetTexture),s.deleteFramebuffer(l),i.getContext(`2d`).setTransform(1,0,0,1,0,0),c},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,n,r,i){var a=e.createTexture();return e.bindTexture(e.TEXTURE_2D,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),a},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var n=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=n,n},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:i,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:``,vendor:``};if(!e)return t;var n=e.getExtension(`WEBGL_debug_renderer_info`);if(n){var r=e.getParameter(n.UNMASKED_RENDERER_WEBGL),i=e.getParameter(n.UNMASKED_VENDOR_WEBGL);r&&(t.renderer=r.toLowerCase()),i&&(t.vendor=i.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){var e=function(){};function n(){}t.Canvas2dFilterBackend=n,n.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,n,r,i){var a=i.getContext(`2d`);a.drawImage(t,0,0,n,r);var o={sourceWidth:n,sourceHeight:r,imageData:a.getImageData(0,0,n,r),originalEl:t,originalImageData:a.getImageData(0,0,n,r),canvasEl:i,ctx:a,filterBackend:this};return e.forEach(function(e){e.applyTo(o)}),(o.imageData.width!==n||o.imageData.height!==r)&&(i.width=o.imageData.width,i.height=o.imageData.height),a.putImageData(o.imageData,0,0),o}}}(),t.Image=t.Image||{},t.Image.filters=t.Image.filters||{},t.Image.filters.BaseFilter=t.util.createClass({type:`BaseFilter`,vertexSource:`attribute vec2 aPosition;
216
- varying vec2 vTexCoord;
217
- void main() {
218
- vTexCoord = aPosition;
219
- gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
220
- }`,fragmentSource:`precision highp float;
221
- varying vec2 vTexCoord;
222
- uniform sampler2D uTexture;
223
- void main() {
224
- gl_FragColor = texture2D(uTexture, vTexCoord);
225
- }`,initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,n,r){n||=this.fragmentSource,r||=this.vertexSource,t.webGlPrecision!==`highp`&&(n=n.replace(/precision highp float/g,`precision `+t.webGlPrecision+` float`));var i=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw Error(`Vertex shader compile error for `+this.type+`: `+e.getShaderInfoLog(i));var a=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(a,n),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS))throw Error(`Fragment shader compile error for `+this.type+`: `+e.getShaderInfoLog(a));var o=e.createProgram();if(e.attachShader(o,i),e.attachShader(o,a),e.linkProgram(o),!e.getProgramParameter(o,e.LINK_STATUS))throw Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(o));var s=this.getAttributeLocations(e,o),c=this.getUniformLocations(e,o)||{};return c.uStepW=e.getUniformLocation(o,`uStepW`),c.uStepH=e.getUniformLocation(o,`uStepH`),{program:o,attributeLocations:s,uniformLocations:c}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,`aPosition`)}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,n){var r=t.aPosition,i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,n,r=e.context;e.passes>1?(t=e.destinationWidth,n=e.destinationHeight,(e.sourceWidth!==t||e.sourceHeight!==n)&&(r.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(r,t,n)),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.targetTexture,0)):(r.bindFramebuffer(r.FRAMEBUFFER,null),r.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,n=t.Image.filters[this.type].prototype;if(e){if(Array.isArray(n[e])){for(var r=n[e].length;r--;)if(this[e][r]!==n[e][r])return!1;return!0}return n[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,n=this.retrieveShader(e);e.pass===0&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(n.program),this.sendAttributeData(t,n.attributeLocations,e.aPosition),t.uniform1f(n.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(n.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,n.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,n){e.activeTexture(n),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement(`canvas`);t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),t.Image.filters.BaseFilter.fromObject=function(e,n){var r=new t.Image.filters[e.type](e);return n&&n(r),r},function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.ColorMatrix=r(n.BaseFilter,{type:`ColorMatrix`,fragmentSource:`precision highp float;
226
- uniform sampler2D uTexture;
227
- varying vec2 vTexCoord;
228
- uniform mat4 uColorMatrix;
229
- uniform vec4 uConstants;
230
- void main() {
231
- vec4 color = texture2D(uTexture, vTexCoord);
232
- color *= uColorMatrix;
233
- color += uConstants;
234
- gl_FragColor = color;
235
- }`,matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:`matrix`,colorsOnly:!0,initialize:function(e){this.callSuper(`initialize`,e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,n,r,i,a,o=e.imageData.data,s=o.length,c=this.matrix,l=this.colorsOnly;for(a=0;a<s;a+=4)t=o[a],n=o[a+1],r=o[a+2],l?(o[a]=t*c[0]+n*c[1]+r*c[2]+255*c[4],o[a+1]=t*c[5]+n*c[6]+r*c[7]+255*c[9],o[a+2]=t*c[10]+n*c[11]+r*c[12]+255*c[14]):(i=o[a+3],o[a]=t*c[0]+n*c[1]+r*c[2]+i*c[3]+255*c[4],o[a+1]=t*c[5]+n*c[6]+r*c[7]+i*c[8]+255*c[9],o[a+2]=t*c[10]+n*c[11]+r*c[12]+i*c[13]+255*c[14],o[a+3]=t*c[15]+n*c[16]+r*c[17]+i*c[18]+255*c[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,`uColorMatrix`),uConstants:e.getUniformLocation(t,`uConstants`)}},sendUniformData:function(e,t){var n=this.matrix,r=[n[0],n[1],n[2],n[3],n[5],n[6],n[7],n[8],n[10],n[11],n[12],n[13],n[15],n[16],n[17],n[18]],i=[n[4],n[9],n[14],n[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,r),e.uniform4fv(t.uConstants,i)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Brightness=r(n.BaseFilter,{type:`Brightness`,fragmentSource:`precision highp float;
236
- uniform sampler2D uTexture;
237
- uniform float uBrightness;
238
- varying vec2 vTexCoord;
239
- void main() {
240
- vec4 color = texture2D(uTexture, vTexCoord);
241
- color.rgb += uBrightness;
242
- gl_FragColor = color;
243
- }`,brightness:0,mainParameter:`brightness`,applyTo2d:function(e){if(this.brightness!==0){var t,n=e.imageData.data,r=n.length,i=Math.round(255*this.brightness);for(t=0;t<r;t+=4)n[t]=n[t]+i,n[t+1]=n[t+1]+i,n[t+2]=n[t+2]+i}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,`uBrightness`)}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.Convolute=i(r.BaseFilter,{type:`Convolute`,opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:`precision highp float;
244
- uniform sampler2D uTexture;
245
- uniform float uMatrix[9];
246
- uniform float uStepW;
247
- uniform float uStepH;
248
- varying vec2 vTexCoord;
249
- void main() {
250
- vec4 color = vec4(0, 0, 0, 0);
251
- for (float h = 0.0; h < 3.0; h+=1.0) {
252
- for (float w = 0.0; w < 3.0; w+=1.0) {
253
- vec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));
254
- color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];
255
- }
256
- }
257
- gl_FragColor = color;
258
- }`,Convolute_3_0:`precision highp float;
259
- uniform sampler2D uTexture;
260
- uniform float uMatrix[9];
261
- uniform float uStepW;
262
- uniform float uStepH;
263
- varying vec2 vTexCoord;
264
- void main() {
265
- vec4 color = vec4(0, 0, 0, 1);
266
- for (float h = 0.0; h < 3.0; h+=1.0) {
267
- for (float w = 0.0; w < 3.0; w+=1.0) {
268
- vec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));
269
- color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];
270
- }
271
- }
272
- float alpha = texture2D(uTexture, vTexCoord).a;
273
- gl_FragColor = color;
274
- gl_FragColor.a = alpha;
275
- }`,Convolute_5_1:`precision highp float;
276
- uniform sampler2D uTexture;
277
- uniform float uMatrix[25];
278
- uniform float uStepW;
279
- uniform float uStepH;
280
- varying vec2 vTexCoord;
281
- void main() {
282
- vec4 color = vec4(0, 0, 0, 0);
283
- for (float h = 0.0; h < 5.0; h+=1.0) {
284
- for (float w = 0.0; w < 5.0; w+=1.0) {
285
- vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
286
- color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];
287
- }
288
- }
289
- gl_FragColor = color;
290
- }`,Convolute_5_0:`precision highp float;
291
- uniform sampler2D uTexture;
292
- uniform float uMatrix[25];
293
- uniform float uStepW;
294
- uniform float uStepH;
295
- varying vec2 vTexCoord;
296
- void main() {
297
- vec4 color = vec4(0, 0, 0, 1);
298
- for (float h = 0.0; h < 5.0; h+=1.0) {
299
- for (float w = 0.0; w < 5.0; w+=1.0) {
300
- vec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));
301
- color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];
302
- }
303
- }
304
- float alpha = texture2D(uTexture, vTexCoord).a;
305
- gl_FragColor = color;
306
- gl_FragColor.a = alpha;
307
- }`,Convolute_7_1:`precision highp float;
308
- uniform sampler2D uTexture;
309
- uniform float uMatrix[49];
310
- uniform float uStepW;
311
- uniform float uStepH;
312
- varying vec2 vTexCoord;
313
- void main() {
314
- vec4 color = vec4(0, 0, 0, 0);
315
- for (float h = 0.0; h < 7.0; h+=1.0) {
316
- for (float w = 0.0; w < 7.0; w+=1.0) {
317
- vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
318
- color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];
319
- }
320
- }
321
- gl_FragColor = color;
322
- }`,Convolute_7_0:`precision highp float;
323
- uniform sampler2D uTexture;
324
- uniform float uMatrix[49];
325
- uniform float uStepW;
326
- uniform float uStepH;
327
- varying vec2 vTexCoord;
328
- void main() {
329
- vec4 color = vec4(0, 0, 0, 1);
330
- for (float h = 0.0; h < 7.0; h+=1.0) {
331
- for (float w = 0.0; w < 7.0; w+=1.0) {
332
- vec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));
333
- color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];
334
- }
335
- }
336
- float alpha = texture2D(uTexture, vTexCoord).a;
337
- gl_FragColor = color;
338
- gl_FragColor.a = alpha;
339
- }`,Convolute_9_1:`precision highp float;
340
- uniform sampler2D uTexture;
341
- uniform float uMatrix[81];
342
- uniform float uStepW;
343
- uniform float uStepH;
344
- varying vec2 vTexCoord;
345
- void main() {
346
- vec4 color = vec4(0, 0, 0, 0);
347
- for (float h = 0.0; h < 9.0; h+=1.0) {
348
- for (float w = 0.0; w < 9.0; w+=1.0) {
349
- vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
350
- color += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];
351
- }
352
- }
353
- gl_FragColor = color;
354
- }`,Convolute_9_0:`precision highp float;
355
- uniform sampler2D uTexture;
356
- uniform float uMatrix[81];
357
- uniform float uStepW;
358
- uniform float uStepH;
359
- varying vec2 vTexCoord;
360
- void main() {
361
- vec4 color = vec4(0, 0, 0, 1);
362
- for (float h = 0.0; h < 9.0; h+=1.0) {
363
- for (float w = 0.0; w < 9.0; w+=1.0) {
364
- vec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));
365
- color.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];
366
- }
367
- }
368
- float alpha = texture2D(uTexture, vTexCoord).a;
369
- gl_FragColor = color;
370
- gl_FragColor.a = alpha;
371
- }`},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),n=this.type+`_`+t+`_`+ +!!this.opaque,r=this.fragmentSource[n];return e.programCache.hasOwnProperty(n)||(e.programCache[n]=this.createProgram(e.context,r)),e.programCache[n]},applyTo2d:function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m=e.imageData,h=m.data,g=this.matrix,_=Math.round(Math.sqrt(g.length)),v=Math.floor(_/2),y=m.width,b=m.height,x=e.ctx.createImageData(y,b),S=x.data,C=+!!this.opaque;for(d=0;d<b;d++)for(u=0;u<y;u++){for(a=4*(d*y+u),t=0,n=0,r=0,i=0,p=0;p<_;p++)for(f=0;f<_;f++)o=u+f-v,!((s=d+p-v)<0||s>=b||o<0||o>=y)&&(c=4*(s*y+o),l=g[p*_+f],t+=h[c]*l,n+=h[c+1]*l,r+=h[c+2]*l,C||(i+=h[c+3]*l));S[a]=t,S[a+1]=n,S[a+2]=r,S[a+3]=C?h[a+3]:i}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,`uMatrix`),uOpaque:e.getUniformLocation(t,`uOpaque`),uHalfSize:e.getUniformLocation(t,`uHalfSize`),uSize:e.getUniformLocation(t,`uSize`)}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return n(this.callSuper(`toObject`),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Grayscale=r(n.BaseFilter,{type:`Grayscale`,fragmentSource:{average:`precision highp float;
372
- uniform sampler2D uTexture;
373
- varying vec2 vTexCoord;
374
- void main() {
375
- vec4 color = texture2D(uTexture, vTexCoord);
376
- float average = (color.r + color.b + color.g) / 3.0;
377
- gl_FragColor = vec4(average, average, average, color.a);
378
- }`,lightness:`precision highp float;
379
- uniform sampler2D uTexture;
380
- uniform int uMode;
381
- varying vec2 vTexCoord;
382
- void main() {
383
- vec4 col = texture2D(uTexture, vTexCoord);
384
- float average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;
385
- gl_FragColor = vec4(average, average, average, col.a);
386
- }`,luminosity:`precision highp float;
387
- uniform sampler2D uTexture;
388
- uniform int uMode;
389
- varying vec2 vTexCoord;
390
- void main() {
391
- vec4 col = texture2D(uTexture, vTexCoord);
392
- float average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;
393
- gl_FragColor = vec4(average, average, average, col.a);
394
- }`},mode:`average`,mainParameter:`mode`,applyTo2d:function(e){var t,n,r=e.imageData.data,i=r.length,a=this.mode;for(t=0;t<i;t+=4)a===`average`?n=(r[t]+r[t+1]+r[t+2])/3:a===`lightness`?n=(Math.min(r[t],r[t+1],r[t+2])+Math.max(r[t],r[t+1],r[t+2]))/2:a===`luminosity`&&(n=.21*r[t]+.72*r[t+1]+.07*r[t+2]),r[t]=n,r[t+1]=n,r[t+2]=n},retrieveShader:function(e){var t=this.type+`_`+this.mode;if(!e.programCache.hasOwnProperty(t)){var n=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,n)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,`uMode`)}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Invert=r(n.BaseFilter,{type:`Invert`,fragmentSource:`precision highp float;
395
- uniform sampler2D uTexture;
396
- uniform int uInvert;
397
- varying vec2 vTexCoord;
398
- void main() {
399
- vec4 color = texture2D(uTexture, vTexCoord);
400
- if (uInvert == 1) {
401
- gl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);
402
- } else {
403
- gl_FragColor = color;
404
- }
405
- }`,invert:!0,mainParameter:`invert`,applyTo2d:function(e){var t,n=e.imageData.data,r=n.length;for(t=0;t<r;t+=4)n[t]=255-n[t],n[t+1]=255-n[t+1],n[t+2]=255-n[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,`uInvert`)}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.Noise=i(r.BaseFilter,{type:`Noise`,fragmentSource:`precision highp float;
406
- uniform sampler2D uTexture;
407
- uniform float uStepH;
408
- uniform float uNoise;
409
- uniform float uSeed;
410
- varying vec2 vTexCoord;
411
- float rand(vec2 co, float seed, float vScale) {
412
- return fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);
413
- }
414
- void main() {
415
- vec4 color = texture2D(uTexture, vTexCoord);
416
- color.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;
417
- gl_FragColor = color;
418
- }`,mainParameter:`noise`,noise:0,applyTo2d:function(e){if(this.noise!==0){var t,n,r=e.imageData.data,i=r.length,a=this.noise;for(t=0,i=r.length;t<i;t+=4)n=(.5-Math.random())*a,r[t]+=n,r[t+1]+=n,r[t+2]+=n}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,`uNoise`),uSeed:e.getUniformLocation(t,`uSeed`)}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return n(this.callSuper(`toObject`),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Pixelate=r(n.BaseFilter,{type:`Pixelate`,blocksize:4,mainParameter:`blocksize`,fragmentSource:`precision highp float;
419
- uniform sampler2D uTexture;
420
- uniform float uBlocksize;
421
- uniform float uStepW;
422
- uniform float uStepH;
423
- varying vec2 vTexCoord;
424
- void main() {
425
- float blockW = uBlocksize * uStepW;
426
- float blockH = uBlocksize * uStepW;
427
- int posX = int(vTexCoord.x / blockW);
428
- int posY = int(vTexCoord.y / blockH);
429
- float fposX = float(posX);
430
- float fposY = float(posY);
431
- vec2 squareCoords = vec2(fposX * blockW, fposY * blockH);
432
- vec4 color = texture2D(uTexture, squareCoords);
433
- gl_FragColor = color;
434
- }`,applyTo2d:function(e){var t,n,r,i,a,o,s,c,l,u,d,f=e.imageData,p=f.data,m=f.height,h=f.width;for(n=0;n<m;n+=this.blocksize)for(r=0;r<h;r+=this.blocksize)for(i=p[t=4*n*h+4*r],a=p[t+1],o=p[t+2],s=p[t+3],u=Math.min(n+this.blocksize,m),d=Math.min(r+this.blocksize,h),c=n;c<u;c++)for(l=r;l<d;l++)p[t=4*c*h+4*l]=i,p[t+1]=a,p[t+2]=o,p[t+3]=s},isNeutralState:function(){return this.blocksize===1},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,`uBlocksize`),uStepW:e.getUniformLocation(t,`uStepW`),uStepH:e.getUniformLocation(t,`uStepH`)}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.RemoveColor=i(r.BaseFilter,{type:`RemoveColor`,color:`#FFFFFF`,fragmentSource:`precision highp float;
435
- uniform sampler2D uTexture;
436
- uniform vec4 uLow;
437
- uniform vec4 uHigh;
438
- varying vec2 vTexCoord;
439
- void main() {
440
- gl_FragColor = texture2D(uTexture, vTexCoord);
441
- if(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {
442
- gl_FragColor.a = 0.0;
443
- }
444
- }`,distance:.02,useAlpha:!1,applyTo2d:function(e){var n,r,i,a,o=e.imageData.data,s=255*this.distance,c=new t.Color(this.color).getSource(),l=[c[0]-s,c[1]-s,c[2]-s],u=[c[0]+s,c[1]+s,c[2]+s];for(n=0;n<o.length;n+=4)r=o[n],i=o[n+1],a=o[n+2],r>l[0]&&i>l[1]&&a>l[2]&&r<u[0]&&i<u[1]&&a<u[2]&&(o[n+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,`uLow`),uHigh:e.getUniformLocation(t,`uHigh`)}},sendUniformData:function(e,n){var r=new t.Color(this.color).getSource(),i=parseFloat(this.distance),a=[0+r[0]/255-i,0+r[1]/255-i,0+r[2]/255-i,1],o=[r[0]/255+i,r[1]/255+i,r[2]/255+i,1];e.uniform4fv(n.uLow,a),e.uniform4fv(n.uHigh,o)},toObject:function(){return n(this.callSuper(`toObject`),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass,i={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var a in i)n[a]=r(n.ColorMatrix,{type:a,matrix:i[a],mainParameter:!1,colorsOnly:!0}),t.Image.filters[a].fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,n=t.Image.filters,r=t.util.createClass;n.BlendColor=r(n.BaseFilter,{type:`BlendColor`,color:`#F95C63`,mode:`multiply`,alpha:1,fragmentSource:{multiply:`gl_FragColor.rgb *= uColor.rgb;
445
- `,screen:`gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
446
- `,add:`gl_FragColor.rgb += uColor.rgb;
447
- `,diff:`gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);
448
- `,subtract:`gl_FragColor.rgb -= uColor.rgb;
449
- `,lighten:`gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);
450
- `,darken:`gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);
451
- `,exclusion:`gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);
452
- `,overlay:`if (uColor.r < 0.5) {
453
- gl_FragColor.r *= 2.0 * uColor.r;
454
- } else {
455
- gl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);
456
- }
457
- if (uColor.g < 0.5) {
458
- gl_FragColor.g *= 2.0 * uColor.g;
459
- } else {
460
- gl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);
461
- }
462
- if (uColor.b < 0.5) {
463
- gl_FragColor.b *= 2.0 * uColor.b;
464
- } else {
465
- gl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);
466
- }
467
- `,tint:`gl_FragColor.rgb *= (1.0 - uColor.a);
468
- gl_FragColor.rgb += uColor.rgb;
469
- `},buildSource:function(e){return`precision highp float;
470
- uniform sampler2D uTexture;
471
- uniform vec4 uColor;
472
- varying vec2 vTexCoord;
473
- void main() {
474
- vec4 color = texture2D(uTexture, vTexCoord);
475
- gl_FragColor = color;
476
- if (color.a > 0.0) {
477
- `+this.fragmentSource[e]+`}
478
- }`},retrieveShader:function(e){var t,n=this.type+`_`+this.mode;return e.programCache.hasOwnProperty(n)||(t=this.buildSource(this.mode),e.programCache[n]=this.createProgram(e.context,t)),e.programCache[n]},applyTo2d:function(e){var n,r,i,a,o,s,c,l=e.imageData.data,u=l.length,d=1-this.alpha;n=(c=new t.Color(this.color).getSource())[0]*this.alpha,r=c[1]*this.alpha,i=c[2]*this.alpha;for(var f=0;f<u;f+=4)switch(a=l[f],o=l[f+1],s=l[f+2],this.mode){case`multiply`:l[f]=a*n/255,l[f+1]=o*r/255,l[f+2]=s*i/255;break;case`screen`:l[f]=255-(255-a)*(255-n)/255,l[f+1]=255-(255-o)*(255-r)/255,l[f+2]=255-(255-s)*(255-i)/255;break;case`add`:l[f]=a+n,l[f+1]=o+r,l[f+2]=s+i;break;case`diff`:case`difference`:l[f]=Math.abs(a-n),l[f+1]=Math.abs(o-r),l[f+2]=Math.abs(s-i);break;case`subtract`:l[f]=a-n,l[f+1]=o-r,l[f+2]=s-i;break;case`darken`:l[f]=Math.min(a,n),l[f+1]=Math.min(o,r),l[f+2]=Math.min(s,i);break;case`lighten`:l[f]=Math.max(a,n),l[f+1]=Math.max(o,r),l[f+2]=Math.max(s,i);break;case`overlay`:l[f]=n<128?2*a*n/255:255-2*(255-a)*(255-n)/255,l[f+1]=r<128?2*o*r/255:255-2*(255-o)*(255-r)/255,l[f+2]=i<128?2*s*i/255:255-2*(255-s)*(255-i)/255;break;case`exclusion`:l[f]=n+a-2*n*a/255,l[f+1]=r+o-2*r*o/255,l[f+2]=i+s-2*i*s/255;break;case`tint`:l[f]=n+a*d,l[f+1]=r+o*d,l[f+2]=i+s*d}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,`uColor`)}},sendUniformData:function(e,n){var r=new t.Color(this.color).getSource();r[0]=this.alpha*r[0]/255,r[1]=this.alpha*r[1]/255,r[2]=this.alpha*r[2]/255,r[3]=this.alpha,e.uniform4fv(n.uColor,r)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,n=t.Image.filters,r=t.util.createClass;n.BlendImage=r(n.BaseFilter,{type:`BlendImage`,image:null,mode:`multiply`,alpha:1,vertexSource:`attribute vec2 aPosition;
479
- varying vec2 vTexCoord;
480
- varying vec2 vTexCoord2;
481
- uniform mat3 uTransformMatrix;
482
- void main() {
483
- vTexCoord = aPosition;
484
- vTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;
485
- gl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);
486
- }`,fragmentSource:{multiply:`precision highp float;
487
- uniform sampler2D uTexture;
488
- uniform sampler2D uImage;
489
- uniform vec4 uColor;
490
- varying vec2 vTexCoord;
491
- varying vec2 vTexCoord2;
492
- void main() {
493
- vec4 color = texture2D(uTexture, vTexCoord);
494
- vec4 color2 = texture2D(uImage, vTexCoord2);
495
- color.rgba *= color2.rgba;
496
- gl_FragColor = color;
497
- }`,mask:`precision highp float;
498
- uniform sampler2D uTexture;
499
- uniform sampler2D uImage;
500
- uniform vec4 uColor;
501
- varying vec2 vTexCoord;
502
- varying vec2 vTexCoord2;
503
- void main() {
504
- vec4 color = texture2D(uTexture, vTexCoord);
505
- vec4 color2 = texture2D(uImage, vTexCoord2);
506
- color.a = color2.a;
507
- gl_FragColor = color;
508
- }`},retrieveShader:function(e){var t=this.type+`_`+this.mode,n=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,n)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,n=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,n,t.TEXTURE1),this.callSuper(`applyToWebGL`,e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,n=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/n,1]},applyTo2d:function(e){var n,r,i,a,o,s,c,l,u,d,f,p=e.imageData,m=e.filterBackend.resources,h=p.data,g=h.length,_=p.width,v=p.height,y=this.image;m.blendImage||=t.util.createCanvasElement(),d=(u=m.blendImage).getContext(`2d`),u.width!==_||u.height!==v?(u.width=_,u.height=v):d.clearRect(0,0,_,v),d.setTransform(y.scaleX,0,0,y.scaleY,y.left,y.top),d.drawImage(y._element,0,0,_,v),f=d.getImageData(0,0,_,v).data;for(var b=0;b<g;b+=4)switch(o=h[b],s=h[b+1],c=h[b+2],l=h[b+3],n=f[b],r=f[b+1],i=f[b+2],a=f[b+3],this.mode){case`multiply`:h[b]=o*n/255,h[b+1]=s*r/255,h[b+2]=c*i/255,h[b+3]=l*a/255;break;case`mask`:h[b+3]=a}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,`uTransformMatrix`),uImage:e.getUniformLocation(t,`uImage`)}},sendUniformData:function(e,t){var n=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,n)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,n){t.Image.fromObject(e.image,function(r){var i=t.util.object.clone(e);i.image=r,n(new t.Image.filters.BlendImage(i))})}}(e),function(e){var t=e.fabric||={},n=Math.pow,r=Math.floor,i=Math.sqrt,a=Math.abs,o=Math.round,s=Math.sin,c=Math.ceil,l=t.Image.filters,u=t.util.createClass;l.Resize=u(l.BaseFilter,{type:`Resize`,resizeType:`hermite`,scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,`uDelta`),uTaps:e.getUniformLocation(t,`uTaps`)}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),n=this.type+`_`+t;if(!e.programCache.hasOwnProperty(n)){var r=this.generateShader(t);e.programCache[n]=this.createProgram(e.context,r)}return e.programCache[n]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,n=this.getFilterWindow(),r=Array(n),i=1;i<=n;i++)r[i-1]=e(i*t);return r},generateShader:function(e){for(var t=Array(e),n=this.fragmentSourceTOP,r=1;r<=e;r++)t[r-1]=r+`.0 * uDelta`;return n+=`uniform float uTaps[`+e+`];
509
- `,n+=`void main() {
510
- `,n+=` vec4 color = texture2D(uTexture, vTexCoord);
511
- `,n+=` float sum = 1.0;
512
- `,t.forEach(function(e,t){n+=` color += texture2D(uTexture, vTexCoord + `+e+`) * uTaps[`+t+`];
513
- `,n+=` color += texture2D(uTexture, vTexCoord - `+e+`) * uTaps[`+t+`];
514
- `,n+=` sum += 2.0 * uTaps[`+t+`];
515
- `}),n+=` gl_FragColor = color / sum;
516
- `,n+=`}`},fragmentSourceTOP:`precision highp float;
517
- uniform sampler2D uTexture;
518
- uniform vec2 uDelta;
519
- varying vec2 vTexCoord;
520
- `,applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return this.scaleX===1&&this.scaleY===1},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var n=(t*=Math.PI)/e;return s(t)/t*s(n)/n}},applyTo2d:function(e){var t=e.imageData,n=this.scaleX,r=this.scaleY;this.rcpScaleX=1/n,this.rcpScaleY=1/r;var i,a=t.width,s=t.height,c=o(a*n),l=o(s*r);this.resizeType===`sliceHack`?i=this.sliceByTwo(e,a,s,c,l):this.resizeType===`hermite`?i=this.hermiteFastResize(e,a,s,c,l):this.resizeType===`bilinear`?i=this.bilinearFiltering(e,a,s,c,l):this.resizeType===`lanczos`&&(i=this.lanczosResize(e,a,s,c,l)),e.imageData=i},sliceByTwo:function(e,n,i,a,o){var s,c,l=e.imageData,u=.5,d=!1,f=!1,p=n*u,m=i*u,h=t.filterBackend.resources,g=0,_=0,v=n,y=0;for(h.sliceByTwo||=document.createElement(`canvas`),((s=h.sliceByTwo).width<1.5*n||s.height<i)&&(s.width=1.5*n,s.height=i),(c=s.getContext(`2d`)).clearRect(0,0,1.5*n,i),c.putImageData(l,0,0),a=r(a),o=r(o);!d||!f;)n=p,i=m,a<r(p*u)?p=r(p*u):(p=a,d=!0),o<r(m*u)?m=r(m*u):(m=o,f=!0),c.drawImage(s,g,_,n,i,v,y,p,m),g=v,_=y,y+=m;return c.getImageData(g,_,a,o)},lanczosResize:function(e,t,o,s,l){var u=e.imageData.data,d=e.ctx.createImageData(s,l),f=d.data,p=this.lanczosCreate(this.lanczosLobes),m=this.rcpScaleX,h=this.rcpScaleY,g=2/this.rcpScaleX,_=2/this.rcpScaleY,v=c(m*this.lanczosLobes/2),y=c(h*this.lanczosLobes/2),b={},x={},S={};return function e(c){var C,w,T,E,D,O,k,A,j,M,N;for(x.x=(c+.5)*m,S.x=r(x.x),C=0;C<l;C++){for(x.y=(C+.5)*h,S.y=r(x.y),D=0,O=0,k=0,A=0,j=0,w=S.x-v;w<=S.x+v;w++)if(!(w<0||w>=t)){M=r(1e3*a(w-x.x)),b[M]||(b[M]={});for(var P=S.y-y;P<=S.y+y;P++)P<0||P>=o||(N=r(1e3*a(P-x.y)),b[M][N]||(b[M][N]=p(i(n(M*g,2)+n(N*_,2))/1e3)),(T=b[M][N])>0&&(D+=T,O+=T*u[E=4*(P*t+w)],k+=T*u[E+1],A+=T*u[E+2],j+=T*u[E+3]))}f[E=4*(C*s+c)]=O/D,f[E+1]=k/D,f[E+2]=A/D,f[E+3]=j/D}return++c<s?e(c):d}(0)},bilinearFiltering:function(e,t,n,i,a){var o,s,c,l,u,d,f,p,m,h=0,g=this.rcpScaleX,_=this.rcpScaleY,v=4*(t-1),y=e.imageData.data,b=e.ctx.createImageData(i,a),x=b.data;for(c=0;c<a;c++)for(l=0;l<i;l++)for(u=g*l-(o=r(g*l)),d=_*c-(s=r(_*c)),m=4*(s*t+o),f=0;f<4;f++)p=y[m+f]*(1-u)*(1-d)+y[m+4+f]*u*(1-d)+y[m+v+f]*d*(1-u)+y[m+v+4+f]*u*d,x[h++]=p;return b},hermiteFastResize:function(e,t,n,o,s){for(var l=this.rcpScaleX,u=this.rcpScaleY,d=c(l/2),f=c(u/2),p=e.imageData.data,m=e.ctx.createImageData(o,s),h=m.data,g=0;g<s;g++)for(var _=0;_<o;_++){for(var v=4*(_+g*o),y=0,b=0,x=0,S=0,C=0,w=0,T=0,E=(g+.5)*u,D=r(g*u);D<(g+1)*u;D++)for(var O=a(E-(D+.5))/f,k=(_+.5)*l,A=O*O,j=r(_*l);j<(_+1)*l;j++){var M=a(k-(j+.5))/d,N=i(A+M*M);N>1&&N<-1||(y=2*N*N*N-3*N*N+1)>0&&(T+=y*p[(M=4*(j+D*t))+3],x+=y,p[M+3]<255&&(y=y*p[M+3]/250),S+=y*p[M],C+=y*p[M+1],w+=y*p[M+2],b+=y)}h[v]=S/b,h[v+1]=C/b,h[v+2]=w/b,h[v+3]=T/x}return m},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Contrast=r(n.BaseFilter,{type:`Contrast`,fragmentSource:`precision highp float;
521
- uniform sampler2D uTexture;
522
- uniform float uContrast;
523
- varying vec2 vTexCoord;
524
- void main() {
525
- vec4 color = texture2D(uTexture, vTexCoord);
526
- float contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));
527
- color.rgb = contrastF * (color.rgb - 0.5) + 0.5;
528
- gl_FragColor = color;
529
- }`,contrast:0,mainParameter:`contrast`,applyTo2d:function(e){if(this.contrast!==0){var t,n=e.imageData.data,r=n.length,i=Math.floor(255*this.contrast),a=259*(i+255)/(255*(259-i));for(t=0;t<r;t+=4)n[t]=a*(n[t]-128)+128,n[t+1]=a*(n[t+1]-128)+128,n[t+2]=a*(n[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,`uContrast`)}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Saturation=r(n.BaseFilter,{type:`Saturation`,fragmentSource:`precision highp float;
530
- uniform sampler2D uTexture;
531
- uniform float uSaturation;
532
- varying vec2 vTexCoord;
533
- void main() {
534
- vec4 color = texture2D(uTexture, vTexCoord);
535
- float rgMax = max(color.r, color.g);
536
- float rgbMax = max(rgMax, color.b);
537
- color.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;
538
- color.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;
539
- color.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;
540
- gl_FragColor = color;
541
- }`,saturation:0,mainParameter:`saturation`,applyTo2d:function(e){if(this.saturation!==0){var t,n,r=e.imageData.data,i=r.length,a=-this.saturation;for(t=0;t<i;t+=4)n=Math.max(r[t],r[t+1],r[t+2]),r[t]+=n===r[t]?0:(n-r[t])*a,r[t+1]+=n===r[t+1]?0:(n-r[t+1])*a,r[t+2]+=n===r[t+2]?0:(n-r[t+2])*a}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,`uSaturation`)}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Vibrance=r(n.BaseFilter,{type:`Vibrance`,fragmentSource:`precision highp float;
542
- uniform sampler2D uTexture;
543
- uniform float uVibrance;
544
- varying vec2 vTexCoord;
545
- void main() {
546
- vec4 color = texture2D(uTexture, vTexCoord);
547
- float max = max(color.r, max(color.g, color.b));
548
- float avg = (color.r + color.g + color.b) / 3.0;
549
- float amt = (abs(max - avg) * 2.0) * uVibrance;
550
- color.r += max != color.r ? (max - color.r) * amt : 0.00;
551
- color.g += max != color.g ? (max - color.g) * amt : 0.00;
552
- color.b += max != color.b ? (max - color.b) * amt : 0.00;
553
- gl_FragColor = color;
554
- }`,vibrance:0,mainParameter:`vibrance`,applyTo2d:function(e){if(this.vibrance!==0){var t,n,r,i,a=e.imageData.data,o=a.length,s=-this.vibrance;for(t=0;t<o;t+=4)n=Math.max(a[t],a[t+1],a[t+2]),r=(a[t]+a[t+1]+a[t+2])/3,i=2*Math.abs(n-r)/255*s,a[t]+=n===a[t]?0:(n-a[t])*i,a[t+1]+=n===a[t+1]?0:(n-a[t+1])*i,a[t+2]+=n===a[t+2]?0:(n-a[t+2])*i}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,`uVibrance`)}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Blur=r(n.BaseFilter,{type:`Blur`,fragmentSource:`precision highp float;
555
- uniform sampler2D uTexture;
556
- uniform vec2 uDelta;
557
- varying vec2 vTexCoord;
558
- const float nSamples = 15.0;
559
- vec3 v3offset = vec3(12.9898, 78.233, 151.7182);
560
- float random(vec3 scale) {
561
- return fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);
562
- }
563
- void main() {
564
- vec4 color = vec4(0.0);
565
- float total = 0.0;
566
- float offset = random(v3offset);
567
- for (float t = -nSamples; t <= nSamples; t++) {
568
- float percent = (t + offset - 0.5) / nSamples;
569
- float weight = 1.0 - abs(percent);
570
- color += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;
571
- total += weight;
572
- }
573
- gl_FragColor = color / total;
574
- }`,blur:0,mainParameter:`blur`,applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var n,r,i=e.filterBackend.resources,a=e.imageData.width,o=e.imageData.height;i.blurLayer1||(i.blurLayer1=t.util.createCanvasElement(),i.blurLayer2=t.util.createCanvasElement()),n=i.blurLayer1,r=i.blurLayer2,(n.width!==a||n.height!==o)&&(r.width=n.width=a,r.height=n.height=o);var s,c,l,u,d=n.getContext(`2d`),f=r.getContext(`2d`),p=15,m=.06*this.blur*.5;for(d.putImageData(e.imageData,0,0),f.clearRect(0,0,a,o),u=-p;u<=p;u++)l=m*(c=u/p)*a+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(c),f.drawImage(n,l,s),d.drawImage(r,0,0),f.globalAlpha=1,f.clearRect(0,0,r.width,r.height);for(u=-p;u<=p;u++)l=m*(c=u/p)*o+(s=(Math.random()-.5)/4),f.globalAlpha=1-Math.abs(c),f.drawImage(n,s,l),d.drawImage(r,0,0),f.globalAlpha=1,f.clearRect(0,0,r.width,r.height);e.ctx.drawImage(n,0,0);var h=e.ctx.getImageData(0,0,n.width,n.height);return d.globalAlpha=1,d.clearRect(0,0,n.width,n.height),h},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,`uDelta`)}},sendUniformData:function(e,t){var n=this.chooseRightDelta();e.uniform2fv(t.delta,n)},chooseRightDelta:function(){var e,t=1,n=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?n[0]=e:n[1]=e,n}}),n.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Gamma=r(n.BaseFilter,{type:`Gamma`,fragmentSource:`precision highp float;
575
- uniform sampler2D uTexture;
576
- uniform vec3 uGamma;
577
- varying vec2 vTexCoord;
578
- void main() {
579
- vec4 color = texture2D(uTexture, vTexCoord);
580
- vec3 correction = (1.0 / uGamma);
581
- color.r = pow(color.r, correction.r);
582
- color.g = pow(color.g, correction.g);
583
- color.b = pow(color.b, correction.b);
584
- gl_FragColor = color;
585
- gl_FragColor.rgb *= color.a;
586
- }`,gamma:[1,1,1],mainParameter:`gamma`,initialize:function(e){this.gamma=[1,1,1],n.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,n=e.imageData.data,r=this.gamma,i=n.length,a=1/r[0],o=1/r[1],s=1/r[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,i=256;t<i;t++)this.rVals[t]=255*(t/255)**a,this.gVals[t]=255*(t/255)**o,this.bVals[t]=255*(t/255)**s;for(t=0,i=n.length;t<i;t+=4)n[t]=this.rVals[n[t]],n[t+1]=this.gVals[n[t+1]],n[t+2]=this.bVals[n[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,`uGamma`)}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.Composed=r(n.BaseFilter,{type:`Composed`,subFilters:[],initialize:function(e){this.callSuper(`initialize`,e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach(function(t){t.applyTo(e)})},toObject:function(){return t.util.object.extend(this.callSuper(`toObject`),{subFilters:this.subFilters.map(function(e){return e.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(e){return!e.isNeutralState()})}}),t.Image.filters.Composed.fromObject=function(e,n){var r=(e.subFilters||[]).map(function(e){return new t.Image.filters[e.type](e)}),i=new t.Image.filters.Composed({subFilters:r});return n&&n(i),i}}(e),function(e){var t=e.fabric||={},n=t.Image.filters,r=t.util.createClass;n.HueRotation=r(n.ColorMatrix,{type:`HueRotation`,rotation:0,mainParameter:`rotation`,calculateMatrix:function(){var e=this.rotation*Math.PI,n=t.util.cos(e),r=t.util.sin(e),i=1/3,a=Math.sqrt(i)*r,o=1-n;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=n+o/3,this.matrix[1]=i*o-a,this.matrix[2]=i*o+a,this.matrix[5]=i*o+a,this.matrix[6]=n+i*o,this.matrix[7]=i*o-a,this.matrix[10]=i*o-a,this.matrix[11]=i*o+a,this.matrix[12]=n+i*o},isNeutralState:function(e){return this.calculateMatrix(),n.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),n.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||={},n=t.util.object.clone;if(t.Text)t.warn(`fabric.Text is already defined`);else{var r=`fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide pathAlign`.split(` `);t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:[`fontSize`,`fontWeight`,`fontFamily`,`fontStyle`,`lineHeight`,`text`,`charSpacing`,`textAlign`,`styles`,`path`,`pathStartOffset`,`pathSide`,`pathAlign`],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:`text`,fontSize:40,fontWeight:`normal`,fontFamily:`Times New Roman`,underline:!1,overline:!1,linethrough:!1,textAlign:`left`,fontStyle:`normal`,lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:``,stateProperties:t.Object.prototype.stateProperties.concat(r),cacheProperties:t.Object.prototype.cacheProperties.concat(r),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:`left`,pathAlign:`baseline`,_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:`ltr`,_styleProperties:[`stroke`,`strokeWidth`,`fill`,`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`underline`,`overline`,`linethrough`,`deltaY`,`textBackgroundColor`],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper(`initialize`,t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:`_dimensionAffectingProps`})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext(`2d`),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),this.textAlign.indexOf(`justify`)!==-1&&this.enlargeSpaces(),this.saveState({propertySet:`_dimensionAffectingProps`}))},enlargeSpaces:function(){for(var e,t,n,r,i,a,o,s=0,c=this._textLines.length;s<c;s++)if((this.textAlign===`justify`||s!==c-1&&!this.isEndOfWrapping(s))&&(r=0,i=this._textLines[s],(t=this.getLineWidth(s))<this.width&&(o=this.textLines[s].match(this._reSpacesAndTabs)))){n=o.length,e=(this.width-t)/n;for(var l=0,u=i.length;l<=u;l++)a=this.__charBounds[s][l],this._reSpaceAndTab.test(i[l])?(a.width+=e,a.kernedWidth+=e,a.left+=r,r+=e):a.left+=r}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return`#<fabric.Text (`+this.complexity()+`): { "text": "`+this.text+`", "fontFamily": "`+this.fontFamily+`" }>`},_getCacheCanvasDimensions:function(){var e=this.callSuper(`_getCacheCanvasDimensions`),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,`underline`),this._renderText(e),this._renderTextDecoration(e,`overline`),this._renderTextDecoration(e,`linethrough`)},_renderText:function(e){this.paintFirst===`stroke`?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,n){if(e.textBaseline=`alphabetical`,this.path)switch(this.pathAlign){case`center`:e.textBaseline=`middle`;break;case`ascender`:e.textBaseline=`top`;break;case`descender`:e.textBaseline=`bottom`}e.font=this._getFontDeclaration(t,n)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,n=this._textLines.length;t<n;t++){var r=this.getLineWidth(t);r>e&&(e=r)}return e},_renderTextLine:function(e,t,n,r,i,a){this._renderChars(e,t,n,r,i,a)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas(`textBackgroundColor`)){for(var t,n,r,i,a,o,s,c=e.fillStyle,l=this._getLeftOffset(),u=this._getTopOffset(),d=0,f=0,p=this.path,m=0,h=this._textLines.length;m<h;m++)if(t=this.getHeightOfLine(m),this.textBackgroundColor||this.styleHas(`textBackgroundColor`,m)){r=this._textLines[m],n=this._getLineLeftOffset(m),f=0,d=0,i=this.getValueOfPropertyAt(m,0,`textBackgroundColor`);for(var g=0,_=r.length;g<_;g++)a=this.__charBounds[m][g],o=this.getValueOfPropertyAt(m,g,`textBackgroundColor`),p?(e.save(),e.translate(a.renderLeft,a.renderTop),e.rotate(a.angle),e.fillStyle=o,o&&e.fillRect(-a.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),a.width,t/this.lineHeight),e.restore()):o===i?f+=a.kernedWidth:(s=l+n+d,this.direction===`rtl`&&(s=this.width-s-f),e.fillStyle=i,i&&e.fillRect(s,u,f,t/this.lineHeight),d=a.left,f=a.width,i=o);o&&!p&&(s=l+n+d,this.direction===`rtl`&&(s=this.width-s-f),e.fillStyle=o,e.fillRect(s,u,f,t/this.lineHeight)),u+=t}else u+=t;e.fillStyle=c,this._removeShadow(e)}},getFontCache:function(e){var n=e.fontFamily.toLowerCase();t.charWidthsCache[n]||(t.charWidthsCache[n]={});var r=t.charWidthsCache[n],i=e.fontStyle.toLowerCase()+`_`+(e.fontWeight+``).toLowerCase();return r[i]||(r[i]={}),r[i]},_measureChar:function(e,t,n,r){var i,a,o,s,c=this.getFontCache(t),l=n+e,u=this._getFontDeclaration(t)===this._getFontDeclaration(r),d=t.fontSize/this.CACHE_FONT_SIZE;if(n&&c[n]!==void 0&&(o=c[n]),c[e]!==void 0&&(s=i=c[e]),u&&c[l]!==void 0&&(s=(a=c[l])-o),i===void 0||o===void 0||a===void 0){var f=this.getMeasuringContext();this._setTextStyles(f,t,!0)}return i===void 0&&(s=i=f.measureText(e).width,c[e]=i),o===void 0&&u&&n&&(o=f.measureText(n).width,c[n]=o),u&&a===void 0&&(a=f.measureText(l).width,c[l]=a,s=a-o),{width:i*d,kernedWidth:s*d}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,`fontSize`)},measureLine:function(e){var t=this._measureLine(e);return this.charSpacing!==0&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var n,r,i,a,o,s,c=0,l=this._textLines[e],u=Array(l.length),d=0,f=this.path,p=this.pathSide===`right`;for(this.__charBounds[e]=u,n=0;n<l.length;n++)r=l[n],a=this._getGraphemeBox(r,e,n,i),u[n]=a,c+=a.kernedWidth,i=r;if(u[n]={left:a?a.left+a.width:0,width:0,kernedWidth:0,height:this.fontSize},f){switch(s=f.segmentsInfo[f.segmentsInfo.length-1].length,(o=t.util.getPointOnPath(f.path,0,f.segmentsInfo)).x+=f.pathOffset.x,o.y+=f.pathOffset.y,this.textAlign){case`left`:d=p?s-c:0;break;case`center`:d=(s-c)/2;break;case`right`:d=p?0:s-c}for(d+=this.pathStartOffset*(p?-1:1),n=p?l.length-1:0;p?n>=0:n<l.length;p?n--:n++)a=u[n],d>s?d%=s:d<0&&(d+=s),this._setGraphemeOnPath(d,a,o),d+=a.kernedWidth}return{width:c,numOfSpaces:0}},_setGraphemeOnPath:function(e,n,r){var i=e+n.kernedWidth/2,a=this.path,o=t.util.getPointOnPath(a.path,i,a.segmentsInfo);n.renderLeft=o.x-r.x,n.renderTop=o.y-r.y,n.angle=o.angle+(this.pathSide===`right`?Math.PI:0)},_getGraphemeBox:function(e,t,n,r,i){var a,o=this.getCompleteStyleDeclaration(t,n),s=r?this.getCompleteStyleDeclaration(t,n-1):{},c=this._measureChar(e,o,r,s),l=c.kernedWidth,u=c.width;this.charSpacing!==0&&(u+=a=this._getWidthOfCharSpacing(),l+=a);var d={width:u,left:0,height:o.fontSize,kernedWidth:l,deltaY:o.deltaY};if(n>0&&!i){var f=this.__charBounds[t][n-1];d.left=f.left+f.width+c.kernedWidth-c.width}return d},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],n=this.getHeightOfChar(e,0),r=1,i=t.length;r<i;r++)n=Math.max(this.getHeightOfChar(e,r),n);return this.__lineHeights[e]=n*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,n=0,r=this._textLines.length;n<r;n++)e=this.getHeightOfLine(n),t+=n===r-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return this.direction===`ltr`?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var n=0,r=this._getLeftOffset(),i=this._getTopOffset(),a=0,o=this._textLines.length;a<o;a++){var s=this.getHeightOfLine(a),c=s/this.lineHeight,l=this._getLineLeftOffset(a);this._renderTextLine(t,e,this._textLines[a],r+l,i+n+c,a),n+=s}e.restore()},_renderTextFill:function(e){!this.fill&&!this.styleHas(`fill`)||this._renderTextCommon(e,`fillText`)},_renderTextStroke:function(e){(!this.stroke||this.strokeWidth===0)&&this.isEmptyStyles()||(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,`strokeText`),e.closePath(),e.restore())},_renderChars:function(e,n,r,i,a,o){var s,c,l,u,d,f=this.getHeightOfLine(o),p=this.textAlign.indexOf(`justify`)!==-1,m=``,h=0,g=this.path,_=!p&&this.charSpacing===0&&this.isEmptyStyles(o)&&!g,v=this.direction===`ltr`,y=this.direction===`ltr`?1:-1,b=n.canvas.getAttribute(`dir`);if(n.save(),b!==this.direction&&(n.canvas.setAttribute(`dir`,v?`ltr`:`rtl`),n.direction=v?`ltr`:`rtl`,n.textAlign=v?`left`:`right`),a-=f*this._fontSizeFraction/this.lineHeight,_)return this._renderChar(e,n,o,0,r.join(``),i,a,f),void n.restore();for(var x=0,S=r.length-1;x<=S;x++)u=x===S||this.charSpacing||g,m+=r[x],l=this.__charBounds[o][x],h===0?(i+=y*(l.kernedWidth-l.width),h+=l.width):h+=l.kernedWidth,p&&!u&&this._reSpaceAndTab.test(r[x])&&(u=!0),u||=(s||=this.getCompleteStyleDeclaration(o,x),c=this.getCompleteStyleDeclaration(o,x+1),t.util.hasStyleChanged(s,c,!1)),u&&(g?(n.save(),n.translate(l.renderLeft,l.renderTop),n.rotate(l.angle),this._renderChar(e,n,o,x,m,-h/2,0,f),n.restore()):(d=i,this._renderChar(e,n,o,x,m,d,a,f)),m=``,s=c,i+=y*h,h=0);n.restore()},_applyPatternGradientTransformText:function(e){var n,r=t.util.createCanvasElement(),i=this.width+this.strokeWidth,a=this.height+this.strokeWidth;return r.width=i,r.height=a,(n=r.getContext(`2d`)).beginPath(),n.moveTo(0,0),n.lineTo(i,0),n.lineTo(i,a),n.lineTo(0,a),n.closePath(),n.translate(i/2,a/2),n.fillStyle=e.toLive(n),this._applyPatternGradientTransform(n,e),n.fill(),n.createPattern(r,`no-repeat`)},handleFiller:function(e,t,n){var r,i;return n.toLive?n.gradientUnits===`percentage`||n.gradientTransform||n.patternTransform?(r=-this.width/2,i=-this.height/2,e.translate(r,i),e[t]=this._applyPatternGradientTransformText(n),{offsetX:r,offsetY:i}):(e[t]=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):(e[t]=n,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,`strokeStyle`,t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,`fillStyle`,t.fill)},_renderChar:function(e,t,n,r,i,a,o){var s,c,l=this._getStyleDeclaration(n,r),u=this.getCompleteStyleDeclaration(n,r),d=e===`fillText`&&u.fill,f=e===`strokeText`&&u.stroke&&u.strokeWidth;!f&&!d||(t.save(),d&&(s=this._setFillStyles(t,u)),f&&(c=this._setStrokeStyles(t,u)),t.font=this._getFontDeclaration(u),l&&l.textBackgroundColor&&this._removeShadow(t),l&&l.deltaY&&(o+=l.deltaY),d&&t.fillText(i,a-s.offsetX,o-s.offsetY),f&&t.strokeText(i,a-c.offsetX,o-c.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,n){var r=this.get2DCursorLocation(e,!0),i=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,`fontSize`),a=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,`deltaY`),o={fontSize:i*n.size,deltaY:a+i*n.baseline};return this.setSelectionStyles(o,e,t),this},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),n=this.width-t,r=this.textAlign,i=this.direction,a=0,o=this.isEndOfWrapping(e);return r===`justify`||r===`justify-center`&&!o||r===`justify-right`&&!o||r===`justify-left`&&!o?0:(r===`center`&&(a=n/2),r===`right`&&(a=n),r===`justify-center`&&(a=n/2),r===`justify-right`&&(a=n),i===`rtl`&&(a-=n),a)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||=this.hasStateChanged(`_dimensionAffectingProps`),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){if(this.__lineWidths[e]!==void 0)return this.__lineWidths[e];var t=this.measureLine(e).width;return this.__lineWidths[e]=t,t},_getWidthOfCharSpacing:function(){return this.charSpacing===0?0:this.fontSize*this.charSpacing/1e3},getValueOfPropertyAt:function(e,t,n){var r=this._getStyleDeclaration(e,t);return r&&typeof r[n]<`u`?r[n]:this[n]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v=this._getLeftOffset(),y=this._getTopOffset(),b=this.path,x=this._getWidthOfCharSpacing(),S=this.offsets[t],C=0,w=this._textLines.length;C<w;C++)if(n=this.getHeightOfLine(C),this[t]||this.styleHas(t,C)){c=this._textLines[C],h=n/this.lineHeight,a=this._getLineLeftOffset(C),d=0,f=0,l=this.getValueOfPropertyAt(C,0,t),_=this.getValueOfPropertyAt(C,0,`fill`),u=y+h*(1-this._fontSizeFraction),r=this.getHeightOfChar(C,0),o=this.getValueOfPropertyAt(C,0,`deltaY`);for(var T=0,E=c.length;T<E;T++)if(p=this.__charBounds[C][T],m=this.getValueOfPropertyAt(C,T,t),g=this.getValueOfPropertyAt(C,T,`fill`),i=this.getHeightOfChar(C,T),s=this.getValueOfPropertyAt(C,T,`deltaY`),b&&m&&g)e.save(),e.fillStyle=_,e.translate(p.renderLeft,p.renderTop),e.rotate(p.angle),e.fillRect(-p.kernedWidth/2,S*i+s,p.kernedWidth,this.fontSize/15),e.restore();else if((m!==l||g!==_||i!==r||s!==o)&&f>0){var D=v+a+d;this.direction===`rtl`&&(D=this.width-D-f),l&&_&&(e.fillStyle=_,e.fillRect(D,u+S*r+o,f,this.fontSize/15)),d=p.left,f=p.width,l=m,_=g,r=i,o=s}else f+=p.kernedWidth;D=v+a+d,this.direction===`rtl`&&(D=this.width-D-f),e.fillStyle=g,m&&g&&e.fillRect(D,u+S*r+o,f-x,this.fontSize/15),y+=n}else y+=n;this._removeShadow(e)}},_getFontDeclaration:function(e,n){var r=e||this,i=this.fontFamily,a=t.Text.genericFonts.indexOf(i.toLowerCase())>-1,o=i===void 0||i.indexOf(`'`)>-1||i.indexOf(`,`)>-1||i.indexOf(`"`)>-1||a?r.fontFamily:`"`+r.fontFamily+`"`;return[t.isLikelyNode?r.fontWeight:r.fontStyle,t.isLikelyNode?r.fontStyle:r.fontWeight,n?this.CACHE_FONT_SIZE+`px`:r.fontSize+`px`,o].join(` `)},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper(`render`,e)))},_splitTextIntoLines:function(e){for(var n=e.split(this._reNewline),r=Array(n.length),i=[`
587
- `],a=[],o=0;o<n.length;o++)r[o]=t.util.string.graphemeSplit(n[o]),a=a.concat(r[o],i);return a.pop(),{_unwrappedLines:r,lines:n,graphemeText:a,graphemeLines:r}},toObject:function(e){var n=r.concat(e),i=this.callSuper(`toObject`,n);return i.styles=t.util.stylesToArray(this.styles,this.text),i.path&&=this.path.toObject(),i},set:function(e,t){this.callSuper(`set`,e,t);var n=!1,r=!1;if(typeof e==`object`)for(var i in e)i===`path`&&this.setPathInfo(),n||=this._dimensionAffectingProps.indexOf(i)!==-1,r||=i===`path`;else n=this._dimensionAffectingProps.indexOf(e)!==-1,r=e===`path`;return r&&this.setPathInfo(),n&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(`x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor`.split(` `)),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,r,i){if(!e)return r(null);var a=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),o=a.textAnchor||`left`;if((i=t.util.object.extend(i?n(i):{},a)).top=i.top||0,i.left=i.left||0,a.textDecoration){var s=a.textDecoration;s.indexOf(`underline`)!==-1&&(i.underline=!0),s.indexOf(`overline`)!==-1&&(i.overline=!0),s.indexOf(`line-through`)!==-1&&(i.linethrough=!0),delete i.textDecoration}`dx`in a&&(i.left+=a.dx),`dy`in a&&(i.top+=a.dy),`fontSize`in i||(i.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var c=``;`textContent`in e?c=e.textContent:`firstChild`in e&&e.firstChild!==null&&`data`in e.firstChild&&e.firstChild.data!==null&&(c=e.firstChild.data),c=c.replace(/^\s+|\s+$|\n+/g,``).replace(/\s+/g,` `);var l=i.strokeWidth;i.strokeWidth=0;var u=new t.Text(c,i),d=u.getScaledHeight()/u.height,f=((u.height+u.strokeWidth)*u.lineHeight-u.height)*d,p=u.getScaledHeight()+f,m=0;o===`center`&&(m=u.getScaledWidth()/2),o===`right`&&(m=u.getScaledWidth()),u.set({left:u.left-m,top:u.top-(p-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:typeof l<`u`?l:1}),r(u)},t.Text.fromObject=function(e,r){var i=n(e),a=e.path;return delete i.path,t.Object._fromObject(`Text`,i,function(n){n.styles=t.util.stylesFromArray(e.styles,e.text),a?t.Object._fromObject(`Path`,a,function(e){n.set(`path`,e),r(n)},`path`):r(n)},`text`)},t.Text.genericFonts=[`sans-serif`,`serif`,`cursive`,`fantasy`,`monospace`],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(e),t.util.object.extend(t.Text.prototype,{isEmptyStyles:function(e){if(!this.styles||typeof e<`u`&&!this.styles[e])return!0;var t=typeof e>`u`?this.styles:{line:this.styles[e]};for(var n in t)for(var r in t[n])for(var i in t[n][r])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||e===``||typeof t<`u`&&!this.styles[t])return!1;var n=typeof t>`u`?this.styles:{0:this.styles[t]};for(var r in n)for(var i in n[r])if(typeof n[r][i][e]<`u`)return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||e===``)return!1;var t,n,r=this.styles,i=0,a=!0,o=0;for(var s in r){for(var c in t=0,r[s]){var l;i++,(l=r[s][c]).hasOwnProperty(e)?(n?l[e]!==n&&(a=!1):n=l[e],l[e]===this[e]&&delete l[e]):a=!1,Object.keys(l).length===0?delete r[s][c]:t++}t===0&&delete r[s]}for(var u=0;u<this._textLines.length;u++)o+=this._textLines[u].length;a&&i===o&&(this[e]=n,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&e!==``){var t,n,r,i=this.styles;for(n in i){for(r in t=i[n])delete t[r][e],Object.keys(t[r]).length===0&&delete t[r];Object.keys(t).length===0&&delete i[n]}}},_extendStyles:function(e,n){var r=this.get2DCursorLocation(e);this._getLineStyle(r.lineIndex)||this._setLineStyle(r.lineIndex),this._getStyleDeclaration(r.lineIndex,r.charIndex)||this._setStyleDeclaration(r.lineIndex,r.charIndex,{}),t.util.object.extend(this._getStyleDeclaration(r.lineIndex,r.charIndex),n)},get2DCursorLocation:function(e,t){typeof e>`u`&&(e=this.selectionStart);for(var n=t?this._unwrappedTextLines:this._textLines,r=n.length,i=0;i<r;i++){if(e<=n[i].length)return{lineIndex:i,charIndex:e};e-=n[i].length+this.missingNewlineOffset(i)}return{lineIndex:i-1,charIndex:n[i-1].length<e?n[i-1].length:e}},getSelectionStyles:function(e,t,n){typeof e>`u`&&(e=this.selectionStart||0),typeof t>`u`&&(t=this.selectionEnd||e);for(var r=[],i=e;i<t;i++)r.push(this.getStyleAtPosition(i,n));return r},getStyleAtPosition:function(e,t){var n=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(n.lineIndex,n.charIndex):this._getStyleDeclaration(n.lineIndex,n.charIndex))||{}},setSelectionStyles:function(e,t,n){typeof t>`u`&&(t=this.selectionStart||0),typeof n>`u`&&(n=this.selectionEnd||t);for(var r=t;r<n;r++)this._extendStyles(r,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var n=this.styles&&this.styles[e];return n?n[t]:null},getCompleteStyleDeclaration:function(e,t){for(var n,r=this._getStyleDeclaration(e,t)||{},i={},a=0;a<this._styleProperties.length;a++)i[n=this._styleProperties[a]]=typeof r[n]>`u`?this[n]:r[n];return i},_setStyleDeclaration:function(e,t,n){this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf(`underline`)>-1&&(e.underline=!0),e.textDecoration.indexOf(`line-through`)>-1&&(e.linethrough=!0),e.textDecoration.indexOf(`overline`)>-1&&(e.overline=!0),delete e.textDecoration)}t.IText=t.util.createClass(t.Text,t.Observable,{type:`i-text`,selectionStart:0,selectionEnd:0,selectionColor:`rgba(17,119,255,0.3)`,isEditing:!1,editable:!0,editingBorderColor:`rgba(102,153,255,0.25)`,cursorWidth:2,cursorColor:``,cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper(`initialize`,e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire(`selectionStart`,e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire(`selectionEnd`,e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire(`selection:changed`),this.canvas&&this.canvas.fire(`text:selection:changed`,{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper(`initDimensions`)},render:function(e){this.clearContextTop(),this.callSuper(`render`,e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper(`_render`,e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,n=this.canvas.viewportTransform;t.save(),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,n=this.height+4;e.clearRect(-t/2,-n/2,t,n)},_getCursorBoundaries:function(e){typeof e>`u`&&(e=this.selectionStart);var t=this._getLeftOffset(),n=this._getTopOffset(),r=this._getCursorBoundariesOffsets(e);return{left:t,top:n,leftOffset:r.left,topOffset:r.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&`top`in this.cursorOffsetCache)return this.cursorOffsetCache;var t,n,r,i,a=0,o=0,s=this.get2DCursorLocation(e);r=s.charIndex,n=s.lineIndex;for(var c=0;c<n;c++)a+=this.getHeightOfLine(c);t=this._getLineLeftOffset(n);var l=this.__charBounds[n][r];return l&&(o=l.left),this.charSpacing!==0&&r===this._textLines[n].length&&(o-=this._getWidthOfCharSpacing()),i={top:a,left:t+(o>0?o:0)},this.direction===`rtl`&&(i.left*=-1),this.cursorOffsetCache=i,this.cursorOffsetCache},renderCursor:function(e,t){var n=this.get2DCursorLocation(),r=n.lineIndex,i=n.charIndex>0?n.charIndex-1:0,a=this.getValueOfPropertyAt(r,i,`fontSize`),o=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/o,c=e.topOffset,l=this.getValueOfPropertyAt(r,i,`deltaY`);c+=(1-this._fontSizeFraction)*this.getHeightOfLine(r)/this.lineHeight-a*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(r,i,`fill`),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,c+e.top+l,s,a)},renderSelection:function(e,t){for(var n=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,r=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,i=this.textAlign.indexOf(`justify`)!==-1,a=this.get2DCursorLocation(n),o=this.get2DCursorLocation(r),s=a.lineIndex,c=o.lineIndex,l=a.charIndex<0?0:a.charIndex,u=o.charIndex<0?0:o.charIndex,d=s;d<=c;d++){var f,p=this._getLineLeftOffset(d)||0,m=this.getHeightOfLine(d),h=0,g=0;if(d===s&&(h=this.__charBounds[s][l].left),d>=s&&d<c)g=i&&!this.isEndOfWrapping(d)?this.width:this.getLineWidth(d)||5;else if(d===c)if(u===0)g=this.__charBounds[c][u].left;else{var _=this._getWidthOfCharSpacing();g=this.__charBounds[c][u-1].left+this.__charBounds[c][u-1].width-_}f=m,(this.lineHeight<1||d===c&&this.lineHeight>1)&&(m/=this.lineHeight);var v=e.left+p+h,y=g-h,b=m,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||`black`,b=1,x=m):t.fillStyle=this.selectionColor,this.direction===`rtl`&&(v=this.width-v-y),t.fillRect(v,e.top+e.topOffset+x,y,b),e.topOffset+=f}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,`fontSize`)},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,`fill`)},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),t.IText.fromObject=function(n,r){var i=t.util.stylesFromArray(n.styles,n.text),a=Object.assign({},n,{styles:i});if(e(a),a.styles)for(var o in a.styles)for(var s in a.styles[o])e(a.styles[o][s]);t.Object._fromObject(`IText`,a,r,`text`)}}(),function(){var e=t.util.object.clone;t.util.object.extend(t.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on(`added`,function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))})},initRemovedHandler:function(){var e=this;this.on(`removed`,function(){var n=e.canvas;n&&(n._iTextInstances=n._iTextInstances||[],t.util.removeFromArray(n._iTextInstances,e),n._iTextInstances.length===0&&(n._hasITextHandlers=!1,e._removeCanvasHandlers(n)))})},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.__isMousedown=!1})},e.on(`mouse:up`,e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off(`mouse:up`,e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,`_onTickComplete`)},_animateCursor:function(e,t,n,r){var i;return i={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate(`_currentCursorOpacity`,t,{duration:n,onComplete:function(){i.isAborted||e[r]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return i.isAborted}}),i},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,`_tick`)},100)},initDelayedCursor:function(e){var t=this,n=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){t._tick()},n)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join(``)},findWordBoundaryLeft:function(e){var t=0,n=e-1;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n--;for(;/\S/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findWordBoundaryRight:function(e){var t=0,n=e;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n++;for(;/\S/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,n=e-1;!/\n/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findLineBoundaryRight:function(e){for(var t=0,n=e;!/\n/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},searchWordBoundary:function(e,n){for(var r=this._text,i=this._reSpace.test(r[e])?e-1:e,a=r[i],o=t.reNonWord;!o.test(a)&&i>0&&i<r.length;)a=r[i+=n];return o.test(a)&&(i+=n===1?0:1),i},selectWord:function(e){e||=this.selectionStart;var t=this.searchWordBoundary(e,-1),n=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e||=this.selectionStart;var t=this.findLineBoundaryLeft(e),n=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire(`editing:entered`),this._fireSelectionChanged(),this.canvas?(this.canvas.fire(`text:editing:entered`,{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.selected=!1,e.isEditing&&e.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on(`mouse:move`,this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){document.activeElement!==this.hiddenTextarea&&this.hiddenTextarea.focus();var t=this.getSelectionStartFromPointer(e.e),n=this.selectionStart,r=this.selectionEnd;(t!==this.__selectionStartOnMouseDown||n===r)&&(n===t||r===t)||(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==n||this.selectionEnd!==r)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor=`text`,this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor=`text`),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,n,r){var i=r.slice(0,e),a=t.util.string.graphemeSplit(i).length;if(e===n)return{selectionStart:a,selectionEnd:a};var o=r.slice(e,n);return{selectionStart:a,selectionEnd:a+t.util.string.graphemeSplit(o).length}},fromGraphemeToStringSelection:function(e,t,n){var r=n.slice(0,e).join(``).length;return e===t?{selectionStart:r,selectionEnd:r}:{selectionStart:r,selectionEnd:r+n.slice(e,t).join(``).length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,n=this._getCursorBoundaries(e),r=this.get2DCursorLocation(e),i=r.lineIndex,a=r.charIndex,o=this.getValueOfPropertyAt(i,a,`fontSize`)*this.lineHeight,s=n.leftOffset,c=this.calcTransformMatrix(),l={x:n.left+s,y:n.top+n.topOffset+o},u=this.canvas.getRetinaScaling(),d=this.canvas.upperCanvasEl,f=d.width/u,p=d.height/u,m=f-o,h=p-o,g=d.clientWidth/f,_=d.clientHeight/p;return l=t.util.transformPoint(l,c),(l=t.util.transformPoint(l,this.canvas.viewportTransform)).x*=g,l.y*=_,l.x<0&&(l.x=0),l.x>m&&(l.x=m),l.y<0&&(l.y=0),l.y>h&&(l.y=h),l.x+=this.canvas._offset.left,l.y+=this.canvas._offset.top,{left:l.x+`px`,top:l.y+`px`,fontSize:o+`px`,charHeight:o}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire(`editing:exited`),e&&this.fire(`modified`),this.canvas&&(this.canvas.off(`mouse:move`,this.mouseMoveHandler),this.canvas.fire(`text:editing:exited`,{target:this}),e&&this.canvas.fire(`object:modified`,{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var n,r,i=this.get2DCursorLocation(e,!0),a=this.get2DCursorLocation(t,!0),o=i.lineIndex,s=i.charIndex,c=a.lineIndex,l=a.charIndex;if(o!==c){if(this.styles[o])for(n=s;n<this._unwrappedTextLines[o].length;n++)delete this.styles[o][n];if(this.styles[c])for(n=l;n<this._unwrappedTextLines[c].length;n++)(r=this.styles[c][n])&&(this.styles[o]||(this.styles[o]={}),this.styles[o][s+n-l]=r);for(n=o+1;n<=c;n++)delete this.styles[n];this.shiftLineStyles(c,o-c)}else if(this.styles[o]){r=this.styles[o];var u,d,f=l-s;for(n=s;n<l;n++)delete r[n];for(d in this.styles[o])(u=parseInt(d,10))>=l&&(r[u-f]=r[d],delete r[d])}},shiftLineStyles:function(t,n){var r=e(this.styles);for(var i in this.styles){var a=parseInt(i,10);a>t&&(this.styles[a+n]=r[a],r[a-n]||delete this.styles[a])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(t,n,r,i){var a,o={},s=!1,c=this._unwrappedTextLines[t].length===n;for(var l in r||=1,this.shiftLineStyles(t,r),this.styles[t]&&(a=this.styles[t][n===0?n:n-1]),this.styles[t]){var u=parseInt(l,10);u>=n&&(s=!0,o[u-n]=this.styles[t][l],c&&n===0||delete this.styles[t][l])}var d=!1;for(s&&!c&&(this.styles[t+r]=o,d=!0),d&&r--;r>0;)i&&i[r-1]?this.styles[t+r]={0:e(i[r-1])}:a?this.styles[t+r]={0:e(a)}:delete this.styles[t+r],r--;this._forceClearCache=!0},insertCharStyleObject:function(t,n,r,i){this.styles||={};var a=this.styles[t],o=a?e(a):{};for(var s in r||=1,o){var c=parseInt(s,10);c>=n&&(a[c+r]=o[c],o[c-r]||delete a[c])}if(this._forceClearCache=!0,i)for(;r--;)Object.keys(i[r]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][n+r]=e(i[r]));else if(a)for(var l=a[n?n-1:1];l&&r--;)this.styles[t][n+r]=e(l)},insertNewStyleBlock:function(e,t,n){for(var r=this.get2DCursorLocation(t,!0),i=[0],a=0,o=0;o<e.length;o++)e[o]===`
588
- `?i[++a]=0:i[a]++;for(i[0]>0&&(this.insertCharStyleObject(r.lineIndex,r.charIndex,i[0],n),n&&=n.slice(i[0]+1)),a&&this.insertNewlineStyleObject(r.lineIndex,r.charIndex+i[0],a),o=1;o<a;o++)i[o]>0?this.insertCharStyleObject(r.lineIndex+o,0,i[o],n):n&&this.styles[r.lineIndex+o]&&n[0]&&(this.styles[r.lineIndex+o][0]=n[0]),n&&=n.slice(i[o]+1);i[o]>0&&this.insertCharStyleObject(r.lineIndex+o,0,i[o],n)},setSelectionStartEndWithShift:function(e,t,n){n<=e?(t===e?this._selectionDirection=`left`:this._selectionDirection===`right`&&(this._selectionDirection=`left`,this.selectionEnd=e),this.selectionStart=n):n>e&&n<t?this._selectionDirection===`right`?this.selectionEnd=n:this.selectionStart=n:(t===e?this._selectionDirection=`right`:this._selectionDirection===`left`&&(this._selectionDirection=`right`,this.selectionStart=t),this.selectionEnd=n)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),t.util.object.extend(t.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on(`mousedown`,this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire(`tripleclick`,e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on(`mousedblclick`,this.doubleClickHandler),this.on(`tripleclick`,this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&e.e.button!==1||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&e.e.button!==1||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on(`mousedown`,this._mouseDownHandler),this.on(`mousedown:before`,this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on(`mouseup`,this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&e.e.button!==1)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),n=this.selectionStart,r=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(n,r,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,n=this.getLocalPointer(e),r=0,i=0,a=0,o=0,s=0,c=0,l=this._textLines.length;c<l&&a<=n.y;c++)a+=this.getHeightOfLine(c)*this.scaleY,s=c,c>0&&(o+=this._textLines[c-1].length+this.missingNewlineOffset(c-1));i=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],this.direction===`rtl`&&(n.x=this.width*this.scaleX-n.x+i);for(var u=0,d=t.length;u<d&&(r=i,(i+=this.__charBounds[s][u].kernedWidth*this.scaleX)<=n.x);u++)o++;return this._getNewSelectionStartFromOffset(n,r,i,o,d)},_getNewSelectionStartFromOffset:function(e,t,n,r,i){var a=e.x-t,o=n-e.x,s=r+(o>a||o<0?0:1);return this.flipX&&(s=i-s),s>this._text.length&&(s=this._text.length),s}}),t.util.object.extend(t.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=t.document.createElement(`textarea`),this.hiddenTextarea.setAttribute(`autocapitalize`,`off`),this.hiddenTextarea.setAttribute(`autocorrect`,`off`),this.hiddenTextarea.setAttribute(`autocomplete`,`off`),this.hiddenTextarea.setAttribute(`spellcheck`,`false`),this.hiddenTextarea.setAttribute(`data-fabric-hiddentextarea`,``),this.hiddenTextarea.setAttribute(`wrap`,`off`);var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText=`position: absolute; top: `+e.top+`; left: `+e.left+`; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: `+e.fontSize+`;`,this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):t.document.body.appendChild(this.hiddenTextarea),t.util.addListener(this.hiddenTextarea,`keydown`,this.onKeyDown.bind(this)),t.util.addListener(this.hiddenTextarea,`keyup`,this.onKeyUp.bind(this)),t.util.addListener(this.hiddenTextarea,`input`,this.onInput.bind(this)),t.util.addListener(this.hiddenTextarea,`copy`,this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,`cut`,this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,`paste`,this.paste.bind(this)),t.util.addListener(this.hiddenTextarea,`compositionstart`,this.onCompositionStart.bind(this)),t.util.addListener(this.hiddenTextarea,`compositionupdate`,this.onCompositionUpdate.bind(this)),t.util.addListener(this.hiddenTextarea,`compositionend`,this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(t.util.addListener(this.canvas.upperCanvasEl,`click`,this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:`exitEditing`,27:`exitEditing`,33:`moveCursorUp`,34:`moveCursorDown`,35:`moveCursorRight`,36:`moveCursorLeft`,37:`moveCursorLeft`,38:`moveCursorUp`,39:`moveCursorRight`,40:`moveCursorDown`},keysMapRtl:{9:`exitEditing`,27:`exitEditing`,33:`moveCursorUp`,34:`moveCursorDown`,35:`moveCursorLeft`,36:`moveCursorRight`,37:`moveCursorRight`,38:`moveCursorUp`,39:`moveCursorLeft`,40:`moveCursorDown`},ctrlKeysMapUp:{67:`copy`,88:`cut`},ctrlKeysMapDown:{65:`selectAll`},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t=this.direction===`rtl`?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var n=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var r,i,a,o,s,c=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,l=this._text.length,u=c.length,d=u-l,f=this.selectionStart,p=this.selectionEnd,m=f!==p;if(this.hiddenTextarea.value===``)return this.styles={},this.updateFromTextArea(),this.fire(`changed`),void(this.canvas&&(this.canvas.fire(`text:changed`,{target:this}),this.canvas.requestRenderAll()));var h=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),g=f>h.selectionStart;m?(r=this._text.slice(f,p),d+=p-f):u<l&&(r=g?this._text.slice(p+d,p):this._text.slice(f,f-d)),i=c.slice(h.selectionEnd-d,h.selectionEnd),r&&r.length&&(i.length&&(a=this.getSelectionStyles(f,f+1,!1),a=i.map(function(){return a[0]})),m?(o=f,s=p):g?(o=p-r.length,s=p):(o=p,s=p+r.length),this.removeStyleFromTo(o,s)),i.length&&(n&&i.join(``)===t.copiedText&&!t.disableStyleCopyPaste&&(a=t.copiedTextStyle),this.insertNewStyleBlock(i,f,a)),this.updateFromTextArea(),this.fire(`changed`),this.canvas&&(this.canvas.fire(`text:changed`,{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(t.copiedText=this.getSelectedText(),t.disableStyleCopyPaste?t.copiedTextStyle=null:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||t.window.clipboardData},_getWidthBeforeCursor:function(e,t){var n,r=this._getLineLeftOffset(e);return t>0&&(r+=(n=this.__charBounds[e][t-1]).left+n.width),r},getDownCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(i===this._textLines.length-1||e.metaKey||e.keyCode===34)return this._text.length-n;var a=r.charIndex,o=this._getWidthBeforeCursor(i,a),s=this._getIndexOnLine(i+1,o);return this._textLines[i].slice(a).length+s+1+this.missingNewlineOffset(i)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(i===0||e.metaKey||e.keyCode===33)return-n;var a=r.charIndex,o=this._getWidthBeforeCursor(i,a),s=this._getIndexOnLine(i-1,o),c=this._textLines[i].slice(0,a),l=this.missingNewlineOffset(i-1);return-this._textLines[i-1].length+s-c.length+(1-l)},_getIndexOnLine:function(e,t){for(var n,r,i=this._textLines[e],a=this._getLineLeftOffset(e),o=0,s=0,c=i.length;s<c;s++)if((a+=n=this.__charBounds[e][s].width)>t){r=!0;var l=a-n,u=a,d=Math.abs(l-t);o=Math.abs(u-t)<d?s:s-1;break}return r||(o=i.length-1),o},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown(`Down`,e)},moveCursorUp:function(e){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorUpOrDown(`Up`,e)},_moveCursorUpOrDown:function(e,t){var n=this[`get`+e+`CursorOffset`](t,this._selectionDirection===`right`);t.shiftKey?this.moveCursorWithShift(n):this.moveCursorWithoutShift(n),n!==0&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t=this._selectionDirection===`left`?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),e!==0},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),e!==0},moveCursorLeft:function(e){this.selectionStart===0&&this.selectionEnd===0||this._moveCursorLeftOrRight(`Left`,e)},_move:function(e,t,n){var r;if(e.altKey)r=this[`findWordBoundary`+n](this[t]);else{if(!e.metaKey&&e.keyCode!==35&&e.keyCode!==36)return this[t]+=n===`Left`?-1:1,!0;r=this[`findLineBoundary`+n](this[t])}if(typeof r<`u`&&this[t]!==r)return this[t]=r,!0},_moveLeft:function(e,t){return this._move(e,t,`Left`)},_moveRight:function(e,t){return this._move(e,t,`Right`)},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection=`left`,this.selectionEnd===this.selectionStart&&this.selectionStart!==0&&(t=this._moveLeft(e,`selectionStart`)),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return this._selectionDirection===`right`&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,`selectionEnd`):this.selectionStart===0?void 0:(this._selectionDirection=`left`,this._moveLeft(e,`selectionStart`))},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight(`Right`,e)},_moveCursorLeftOrRight:function(e,t){var n=`moveCursor`+e+`With`;this._currentCursorOpacity=1,t.shiftKey?n+=`Shift`:n+=`outShift`,this[n](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return this._selectionDirection===`left`&&this.selectionStart!==this.selectionEnd?this._moveRight(e,`selectionStart`):this.selectionEnd===this._text.length?void 0:(this._selectionDirection=`right`,this._moveRight(e,`selectionEnd`))},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection=`right`,this.selectionStart===this.selectionEnd?(t=this._moveRight(e,`selectionStart`),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){typeof t>`u`&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(``),this.set(`dirty`,!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,n,r,i){typeof i>`u`&&(i=r),i>r&&this.removeStyleFromTo(r,i);var a=t.util.string.graphemeSplit(e);this.insertNewStyleBlock(a,r,n),this._text=[].concat(this._text.slice(0,r),a,this._text.slice(i)),this.text=this._text.join(``),this.set(`dirty`,!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var e=t.util.toFixed,n=/ +/g;t.util.object.extend(t.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(``),` <text xml:space="preserve" `,this.fontFamily?`font-family="`+this.fontFamily.replace(/"/g,`'`)+`" `:``,this.fontSize?`font-size="`+this.fontSize+`" `:``,this.fontStyle?`font-style="`+this.fontStyle+`" `:``,this.fontWeight?`font-weight="`+this.fontWeight+`" `:``,t?`text-decoration="`+t+`" `:``,`style="`,this.getSvgStyles(!0),`"`,this.addPaintOrder(),` >`,e.textSpans.join(``),`</text>
589
- `]},_getSVGTextAndBg:function(e,t){var n,r=[],i=[],a=e;this._setSVGBg(i);for(var o=0,s=this._textLines.length;o<s;o++)n=this._getLineLeftOffset(o),(this.textBackgroundColor||this.styleHas(`textBackgroundColor`,o))&&this._setSVGTextLineBg(i,o,t+n,a),this._setSVGTextLineText(r,o,t+n,a),a+=this.getHeightOfLine(o);return{textSpans:r,textBgRects:i}},_createTextCharSpan:function(r,i,a,o){var s=r!==r.trim()||r.match(n),c=this.getSvgSpanStyles(i,s),l=c?`style="`+c+`"`:``,u=i.deltaY,d=``,f=t.Object.NUM_FRACTION_DIGITS;return u&&(d=` dy="`+e(u,f)+`" `),[`<tspan x="`,e(a,f),`" y="`,e(o,f),`" `,d,l,`>`,t.util.string.escapeXml(r),`</tspan>`].join(``)},_setSVGTextLineText:function(e,n,r,i){var a,o,s,c,l,u=this.getHeightOfLine(n),d=this.textAlign.indexOf(`justify`)!==-1,f=``,p=0,m=this._textLines[n];i+=u*(1-this._fontSizeFraction)/this.lineHeight;for(var h=0,g=m.length-1;h<=g;h++)l=h===g||this.charSpacing,f+=m[h],s=this.__charBounds[n][h],p===0?(r+=s.kernedWidth-s.width,p+=s.width):p+=s.kernedWidth,d&&!l&&this._reSpaceAndTab.test(m[h])&&(l=!0),l||=(a||=this.getCompleteStyleDeclaration(n,h),o=this.getCompleteStyleDeclaration(n,h+1),t.util.hasStyleChanged(a,o,!0)),l&&(c=this._getStyleDeclaration(n,h)||{},e.push(this._createTextCharSpan(f,c,r,i)),f=``,a=o,r+=p,p=0)},_pushTextBgRect:function(n,r,i,a,o,s){var c=t.Object.NUM_FRACTION_DIGITS;n.push(` <rect `,this._getFillAttributes(r),` x="`,e(i,c),`" y="`,e(a,c),`" width="`,e(o,c),`" height="`,e(s,c),`"></rect>
590
- `)},_setSVGTextLineBg:function(e,t,n,r){for(var i,a,o=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,c=0,l=0,u=this.getValueOfPropertyAt(t,0,`textBackgroundColor`),d=0,f=o.length;d<f;d++)i=this.__charBounds[t][d],(a=this.getValueOfPropertyAt(t,d,`textBackgroundColor`))===u?c+=i.kernedWidth:(u&&this._pushTextBgRect(e,u,n+l,r,c,s),l=i.left,c=i.width,u=a);a&&this._pushTextBgRect(e,a,n+l,r,c,s)},_getFillAttributes:function(e){var n=e&&typeof e==`string`?new t.Color(e):``;return n&&n.getSource()&&n.getAlpha()!==1?`opacity="`+n.getAlpha()+`" fill="`+n.setAlpha(1).toRgb()+`"`:`fill="`+e+`"`},_getSVGLineTopOffset:function(e){for(var t,n=0,r=0;r<e;r++)n+=this.getHeightOfLine(r);return t=this.getHeightOfLine(r),{lineTop:n,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return t.Object.prototype.getSvgStyles.call(this,e)+` white-space: pre;`}})}(),function(e){var t=e.fabric||={};t.Textbox=t.util.createClass(t.IText,t.Observable,{type:`textbox`,minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat(`width`),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set(`width`,this.dynamicMinWidth),this.textAlign.indexOf(`justify`)!==-1&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:`_dimensionAffectingProps`}))},_generateStyleMap:function(e){for(var t=0,n=0,r=0,i={},a=0;a<e.graphemeLines.length;a++)e.graphemeText[r]===`
591
- `&&a>0?(n=0,r++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[r])&&a>0&&(n++,r++),i[a]={line:t,offset:n},r+=e.graphemeLines[a].length,n+=e.graphemeLines[a].length;return i},styleHas:function(e,n){if(this._styleMap&&!this.isWrapping){var r=this._styleMap[n];r&&(n=r.line)}return t.Text.prototype.styleHas.call(this,e,n)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,n,r=0,i=!1,a=this._styleMap[e],o=this._styleMap[e+1];for(var s in a&&(e=a.line,r=a.offset),o&&(i=o.line===e,t=o.offset),n=typeof e>`u`?this.styles:{line:this.styles[e]})for(var c in n[s])if(c>=r&&(!i||c<t))for(var l in n[s][c])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[e];if(!n)return null;e=n.line,t=n.offset+t}return this.callSuper(`_getStyleDeclaration`,e,t)},_setStyleDeclaration:function(e,t,n){var r=this._styleMap[e];e=r.line,t=r.offset+t,this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){var n=this._styleMap[e];e=n.line,t=n.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var n,r=[];for(this.isWrapping=!0,n=0;n<e.length;n++)r=r.concat(this._wrapLine(e[n],n,t));return this.isWrapping=!1,r},_measureWord:function(e,t,n){var r,i=0;n||=0;for(var a=0,o=e.length;a<o;a++)i+=this._getGraphemeBox(e[a],t,a+n,r,!0).kernedWidth,r=e[a];return i},_wrapLine:function(e,n,r,i){var a=0,o=this.splitByGrapheme,s=[],c=[],l=o?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),u=``,d=0,f=o?``:` `,p=0,m=0,h=0,g=!0,_=this._getWidthOfCharSpacing();i||=0,l.length===0&&l.push([]),r-=i;for(var v=0;v<l.length;v++)u=o?l[v]:t.util.string.graphemeSplit(l[v]),p=this._measureWord(u,n,d),d+=u.length,(a+=m+p-_)>r&&!g?(s.push(c),c=[],a=p,g=!0):a+=_,!g&&!o&&c.push(f),c=c.concat(u),m=o?0:this._measureWord([f],n,d),d++,g=!1,p>h&&(h=p);return v&&s.push(c),h+i>this.dynamicMinWidth&&(this.dynamicMinWidth=h-_+i),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?+!!this.isEndOfWrapping(e):1},_splitTextIntoLines:function(e){for(var n=t.Text.prototype._splitTextIntoLines.call(this,e),r=this._wrapText(n.lines,this.width),i=Array(r.length),a=0;a<r.length;a++)i[a]=r[a].join(``);return n.lines=i,n.graphemeLines=r,n},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper(`toObject`,[`minWidth`,`splitByGrapheme`].concat(e))}}),t.Textbox.fromObject=function(e,n){var r=t.util.stylesFromArray(e.styles,e.text),i=Object.assign({},e,{styles:r});return t.Object._fromObject(`Textbox`,i,n,`text`)}}(e),function(){var e=t.controlsUtils,n=e.scaleSkewCursorStyleHandler,r=e.scaleCursorStyleHandler,i=e.scalingEqually,a=e.scalingYOrSkewingX,o=e.scalingXOrSkewingY,s=e.scaleOrSkewActionName,c=t.Object.prototype.controls;if(c.ml=new t.Control({x:-.5,y:0,cursorStyleHandler:n,actionHandler:o,getActionName:s}),c.mr=new t.Control({x:.5,y:0,cursorStyleHandler:n,actionHandler:o,getActionName:s}),c.mb=new t.Control({x:0,y:.5,cursorStyleHandler:n,actionHandler:a,getActionName:s}),c.mt=new t.Control({x:0,y:-.5,cursorStyleHandler:n,actionHandler:a,getActionName:s}),c.tl=new t.Control({x:-.5,y:-.5,cursorStyleHandler:r,actionHandler:i}),c.tr=new t.Control({x:.5,y:-.5,cursorStyleHandler:r,actionHandler:i}),c.bl=new t.Control({x:-.5,y:.5,cursorStyleHandler:r,actionHandler:i}),c.br=new t.Control({x:.5,y:.5,cursorStyleHandler:r,actionHandler:i}),c.mtr=new t.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:`rotate`}),t.Textbox){var l=t.Textbox.prototype.controls={};l.mtr=c.mtr,l.tr=c.tr,l.br=c.br,l.tl=c.tl,l.bl=c.bl,l.mt=c.mt,l.mb=c.mb,l.mr=new t.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:n,actionName:`resizing`}),l.ml=new t.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:n,actionName:`resizing`})}}()})($);var cE={lockScalingFlip:!0,originY:`center`,originX:`center`,lockMovementX:!0,lockMovementY:!0,borderColor:`transparent`};function lE(e=36){let t=``;for(let n=0;n<e;n+=1)t+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`.charAt(Math.floor(62*Math.random()));return t}var uE=null;function dE(e){uE=e}var fE=class{constructor(){kf(this,`maxZoom`,2),kf(this,`minZoom`,1),kf(this,`step`,.05),this.allowUserZoom&&this.bindMouseWheel(),Y.subscribe(e=>e.stageSize,()=>{setTimeout(()=>{this.fitToScreen()},1)})}get allowUserZoom(){return X().config?.tools?.zoom?.allowUserZoom??!0}get currentZoom(){return X().zoom}zoomIn(e=this.step){this.set(this.currentZoom+e)}canZoomIn(e=this.step){return this.currentZoom+e<=this.maxZoom}canZoomOut(e=this.step){return this.currentZoom-e>=this.minZoom}zoomOut(e=this.step){this.set(this.currentZoom-e)}set(e,t=!0){if(e<this.minZoom||e>this.maxZoom)return;let n=Rf.round(X().original.width*e,0),r=Rf.round(X().original.height*e,0);Q().setZoom(e),t&&Q().setDimensions({width:n,height:r}),X().setZoom(e)}fitToScreen(){var e;if((e=X().config.tools?.zoom)==null||!e.fitImageToScreen)return;let{width:t,height:n}=X().stageSize,r=Math.max(n,1),i=Math.max(t,1);if(X().original.height>r||X().original.width>i){let e=Math.min(r/X().original.height,i/X().original.width);this.minZoom=Math.min(e,1)}else this.minZoom=1;this.set(this.minZoom)}bindMouseWheel(){Q().on(`mouse:wheel`,e=>{e.e.preventDefault(),e.e.stopPropagation(),uE??(e.e.deltaY<0?this.zoomIn():this.zoomOut())})}};function pE(e){return new Promise(t=>{$.fabric.util.loadImage(e,e=>t(new $.fabric.Image(e)),null,X().config.crossOrigin?`anonymous`:void 0)})}function mE(){return!(X().config.image||X().config.blankCanvasSize||Q()&&Q().getObjects().length!==0)}var hE=class{constructor(){kf(this,`minWidth`,50),kf(this,`minHeight`,50)}resize(e,t,{applyZoom:n=!1,resizeHelper:r=!0}={}){let i=X().zoom;Q().setWidth(e*(n?i:1)),Q().setHeight(t*(n?i:1)),X().setOriginal(e,t),r&&Z().transform.resetStraightenAnchor()}async addMainImage(e,t=`mainImage`){var n,r;X().toggleLoading(t);let i=await pE(e);if(i)return this.clear(),i.set(kb),i.name=Sy.MainImage,Q().add(i),this.resize(i.width,i.height),i.center(),i.setCoords(),Z().zoom.fitToScreen(),X().toggleLoading(!1),(r=(n=X().config).onMainImageLoaded)==null||r.call(n,i),i}openNew(e,t,n){return e=Math.max(this.minWidth,e),t=Math.max(this.minHeight,t),this.clear(),this.resize(e,t),Q().backgroundColor=n,Z().zoom.fitToScreen(),X().toggleLoading(`newCanvas`),requestAnimationFrame(()=>{X().toggleLoading(!1)}),Promise.resolve({width:e,height:t})}getMainImage(){return Q().getObjects().find(e=>e.name===Sy.MainImage)}render(){Q().requestRenderAll()}async loadInitialContent(){var e;let t=X().config.image,n=X().config.blankCanvasSize,r=X().config.state;if(t&&t.endsWith(`json`)){let e=await Ob(t);await Z().import.loadState(e)}else t&&t.startsWith(`{"canvas`)?await Z().import.loadState(t):t?await this.addMainImage(t):r?await Z().import.loadState(r):n&&await this.openNew(n.width,n.height);return mE()&&(e=X().config.ui?.openImageDialog)!=null&&e.show&&X().togglePanel(`newImage`,!0),new Promise(e=>{setTimeout(()=>{Z().history.addInitial(),e()},10)})}clear(){Q().clear(),Z().frame.remove(),Z().transform.resetStraightenAnchor()}},gE=[`fontSize`,`fontFamily`,`left`,`top`,`width`,`height`,`scaleX`,`scaleY`,`flipX`,`flipY`,`angle`,`src`,`strokeWidth`];function _E(e={}){Q().fire(`object:modified`,function(e){return{values:e,sizeOrPositionChanged:vE(e)}}(e))}function vE(e){return Object.keys(e).some(e=>gE.includes(e))}function yE(e){var t;let[n]=Mb(e.selected?.[0]),r=n===X().activeTool;return!(!X().dirty||(t=e.selected)!=null&&t[0]&&r)&&(e.deselected&&Z().objects.select(e.deselected[0]),!0)}function bE(e){e?.data.id!==X().objects.active.id&&(X().objects.setActive(e??null),X().activeTool!==f_.DRAW&&jb())}var xE=class{constructor(){this.syncObjects(),X().fabric.on(`selection:created`,e=>{var t;(t=e.selected)!=null&&t[0]&&!yE(e)&&bE(e.selected[0])}),X().fabric.on(`selection:updated`,e=>{yE(e)||bE(e.selected?.[0])}),X().fabric.on(`selection:cleared`,()=>{bE()}),X().fabric.on(`text:editing:entered`,()=>{X().objects.setIsEditingText(!0)}),X().fabric.on(`text:editing:exited`,()=>{X().objects.setIsEditingText(!1)}),X().fabric.on(`object:added`,()=>{this.syncObjects()}),X().fabric.on(`object:removed`,()=>{this.syncObjects()})}getAll(){return Q().getObjects().filter(e=>{var t;return!((t=e?.data)!=null&&t.pixieInternal)})}get(e){return this.getAll().find(t=>t.name===e)}getById(e){return this.getAll().find(t=>t.data.id===e)}isActive(e){let t=typeof e==`string`?e:e.data.id;return X().objects.active?.id===t}getActive(){return Q().getActiveObject()}has(e){return this.getAll().findIndex(t=>t.name===e)>-1}select(e){let t=typeof e==`string`?this.getById(e):e;t&&(Q().setActiveObject(t),Q().requestRenderAll())}deselectActive(){Q().discardActiveObject(),Q().requestRenderAll()}setValues(e,t){if(!(t||=this.getActive()))return;let n=!1;(function(e){return e.name===Sy.Sticker&&`forEachObject`in e})(t)&&e.fill&&e.fill!==t.fill&&t.forEachObject(t=>t.set(`fill`,e.fill)),xy(t)?((e.fontFamily!==t.fontFamily||e.fontSize!==t.fontSize)&&(n=!0),t.selectionStart===t.selectionEnd?t.set(e):t.setSelectionStyles(e)):t.set(e),n?setTimeout(()=>{Q().requestRenderAll()},50):Q().requestRenderAll(),X().objects.setActive(t),_E(e)}move(e,t=1,n){(n||=this.getActive())&&(e===`up`?this.setValues({top:n.top-t}):e===`down`?this.setValues({top:n.top+t}):e===`left`?this.setValues({left:n.left-t}):e===`right`&&this.setValues({left:n.left+t}),Z().canvas.render())}bringToFront(e){(e||=this.getActive())&&(e.bringToFront(),Z().canvas.render())}sendToBack(e){(e||=this.getActive())&&(e.sendToBack(),Z().canvas.render())}flipHorizontally(e){(e||=this.getActive())&&(this.setValues({flipX:!e.flipX}),Z().canvas.render())}duplicate(e){let t=e||this.getActive();t&&(this.deselectActive(),t.clone(e=>{e.set({left:t.left+40,top:t.top+40,data:{...t.data,id:lE(10)},name:t.name}),Q().add(e),this.select(e),Z().canvas.render()}))}delete(e){(e||=this.getActive())&&(this.deselectActive(),Q().remove(e),Q().requestRenderAll(),Z().history.addHistoryItem({name:`deletedObject`}))}syncObjects(){let e=this.getAll().map(e=>({name:e.name,selectable:e.selectable??!1,id:e.data.id}));Y.setState({objects:{...X().objects,all:e}})}},SE={frame:null,fonts:[]};function CE(e){return e.state||=Ab(),{...e.state||Ab(),name:e.name,id:lE(15)}}function wE(e){return!!e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e)}function TE(e){return e?wE(e)?e:`${X().config.baseUrl?`${X().config.baseUrl}/`:``}${e}`:``}function EE(e,t){return t||btoa(e.split(`/`).pop())}var DE=new class{constructor(){kf(this,`loadedAssets`,{})}loadAsset(e,t={type:`js`}){e=e.startsWith(`//`)?`${window.location.protocol}${e}`:e;let n=this.loadedAssets[e]?.state;return n!==`loaded`||t.force?((!n||this.loadedAssets[e].doc!==t.document||t.force&&n===`loaded`)&&(this.loadedAssets[e]={state:new Promise(n=>{let r={url:wE(e)?e:`assets/${e}`,id:EE(e,t.id),resolve:n,parentEl:t.parentEl,document:t.document};t.type===`css`?this.loadStyleAsset(r):this.loadScriptAsset(r)}),doc:t.document}),this.loadedAssets[e].state):new Promise(e=>e())}isLoadingOrLoaded(e){return this.loadedAssets[e]!=null}loadStyleAsset(e){var t;let n=e.document||document,r=e.parentEl||n.head,i=n.createElement(`link`),a=EE(e.url,e.id);i.rel=`stylesheet`,i.id=a,i.href=e.url;try{r.querySelector(`#${a}`)&&((t=r.querySelector(`#${a}`))==null||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state=`loaded`,e.resolve()},r.appendChild(i)}loadScriptAsset(e){var t;let n=e.document||document,r=e.parentEl||n.body,i=n.createElement(`script`),a=EE(e.url,e.id);i.async=!0,i.id=a,i.src=e.url;try{r.querySelector(`#${a}`)&&((t=r.querySelector(`#${a}`))==null||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state=`loaded`,e.resolve()},(r||r).appendChild(i)}};function OE(e){return`be-fonts-${e}`}function kE(e,t){let n=t.document||document,r=[],i=[],a=[];if(e.forEach(e=>{`google`in e&&e.google?r.push(e):`src`in e&&i.push(e)}),r!=null&&r.length){let r=t.weights||[400],i=e.map(e=>`${e.family}:${r.join(`,`)}`).join(`|`),o=DE.loadAsset(`https://fonts.googleapis.com/css?family=${i}&display=swap`,{type:`css`,id:OE(t.id),force:t.forceAssetLoad,document:n});a.push(o)}if(i!=null&&i.length){let e=i.map(async e=>{let r=Array.from(n.fonts.values()).find(t=>t.family===e.family);if(r)return r.loaded;let i=new FontFace(e.family,`url(${t!=null&&t.prefixSrc?t.prefixSrc(e.src):e.src})`,e.descriptors);return n.fonts.add(i),i.load()});a=a.concat(e)}return Promise.all(a)}var AE=class{async undo(){if(this.canUndo()){let e=X().history.items[X().history.pointer-1];await this.load(e)}}async redo(){if(this.canRedo()){let e=X().history.items[X().history.pointer+1];await this.load(e)}}canUndo(){return X().history.canUndo}canRedo(){return X().history.canRedo}reload(){return this.load(X().history.items[X().history.pointer])}replaceCurrent(){let e=X().history.items[X().history.pointer];[...X().history.items][X().history.pointer]=CE({name:e.name,state:e})}addHistoryItem(e){let t=CE(e),n=[...X().history.items.slice(0,X().history.pointer+1),t];X().history.update(n.length-1,n)}load(e){return e={...e,editor:e.editor||SE},new Promise(t=>{kE(function(e){let t=[];return e.forEach(e=>{if(!xy(e))return;let n=(X().config.tools?.text?.items)?.find(t=>t.family===e.fontFamily);n&&t.push(n)}),t}(e.canvas.objects),{prefixSrc:TE,id:`pixie-fonts`}).finally(()=>{Q().loadFromJSON(e.canvas,()=>{Z().zoom.set(1),e.canvasWidth&&e.canvasHeight&&Z().canvas.resize(e.canvasWidth,e.canvasHeight,{resizeHelper:!1,applyZoom:!1}),Z().frame.remove(),e.editor.frame&&Z().frame.add(e.editor.frame.name,e.editor.frame.sizePercent),Z().objects.syncObjects(),Z().objects.getAll().forEach(e=>{if(!e.data.pixieInternal&&e.originX===`left`&&e.originY===`top`){let t=e.getPointByOrigin(`center`,`center`);e.set(`left`,t.x),e.set(`top`,t.y)}e.set({...cE}),e.type===`i-text`&&(e.padding=X().config.tools?.text?.controlsPadding)}),Z().canvas.render(),Q().calcOffset(),Z().zoom.fitToScreen(),X().history.updatePointerById(e.id),Z().transform.resetStraightenAnchor(),t()})})})}addInitial(e){!X().history.items.find(e=>e.name===`initial`)&&(e||!mE())&&this.addHistoryItem({name:`initial`,state:e})}},jE=class{canMerge(){return Z().objects.getAll().filter(e=>e.name!==Sy.MainImage).length>0}async apply(){X().toggleLoading(`merge`);let e=Z().export.getDataUrl();e&&await Z().canvas.addMainImage(e,`merge`)}},ME=[{name:`grayscale`},{name:`blackWhite`,fabricType:`blackwhite`},{name:`sharpen`,uses:`Convolute`,matrix:[0,-1,0,-1,5,-1,0,-1,0]},{name:`invert`},{name:`vintage`},{name:`polaroid`},{name:`kodachrome`},{name:`technicolor`},{name:`brownie`},{name:`sepia`},{name:`removeColor`,fabricType:`removecolor`,options:{distance:{type:`slider`,current:.1,min:0,max:1,step:.01},color:{current:`#fff`,type:`colorPicker`}}},{name:`brightness`,options:{brightness:{type:`slider`,current:.1,min:-1,max:1,step:.1}}},{name:`gamma`,options:{red:{type:`slider`,current:.1,min:.2,max:2.2,step:.003921},green:{type:`slider`,current:.1,min:.2,max:2.2,step:.003921},blue:{type:`slider`,current:.1,min:.2,max:2.2,step:.003921}},apply:e=>{e.gamma=[e.red,e.green,e.blue]}},{name:`noise`,options:{noise:{type:`slider`,current:40,min:1,max:600}}},{name:`pixelate`,options:{blocksize:{type:`slider`,min:1,max:40,current:6}}},{name:`blur`,uses:`Convolute`,matrix:[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9]},{name:`emboss`,uses:`Convolute`,matrix:[1,1,1,1,.7,-1,-1,-1,-1]},{name:`blendColor`,fabricType:`blendcolor`,options:{alpha:{type:`slider`,current:.5,min:.1,max:1,step:.1},mode:{current:`add`,type:`select`,available:[{key:`add`},{key:`multiply`},{key:`subtract`},{key:`diff`},{key:`screen`},{key:`lighten`},{key:`darken`}]},color:{type:`colorPicker`,current:`#FF4081`}}}],NE={grayscale:G(`grayscale`),blackWhite:G(`Black & White`),sharpen:G(`Sharpen`),invert:G(`Invert`),vintage:G(`Vintage`),polaroid:G(`Polaroid`),kodachrome:G(`Kodachrome`),technicolor:G(`Technicolor`),brownie:G(`Brownie`),sepia:G(`Sepia`),removeColor:G(`Remove Color`),brightness:G(`Brightness`),gamma:G(`Gamma`),noise:G(`Noise`),pixelate:G(`Pixelate`),blur:G(`Blur`),emboss:G(`Emboss`),blendColor:G(`Blend Color`)},PE={distance:G(`distance`),color:G(`color`),brightness:G(`brightness`),red:G(`red`),green:G(`green`),blue:G(`blue`),noise:G(`noise`),blocksize:G(`blocksize`),mode:G(`mode`),alpha:G(`alpha`)};function FE(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}var IE=class{constructor(){Y.subscribe(e=>e.history.pointer,()=>{this.syncState()})}apply(e){X().filter.select(e,this.hasOptions(e));let t=this.getByName(e);if(this.isApplied(t.name))return void this.remove(t.name);let n=this.create(t);this.getImages().forEach(e=>{var t;(t=e.filters)==null||t.push(n),e.applyFilters()}),this.syncState(),Z().canvas.render()}remove(e){X().filter.deselect(e);let t=this.getByName(e);this.getImages().forEach(e=>{var n;let r=this.findFilterIndex(t.name,e.filters);(n=e.filters)==null||n.splice(r,1),e.applyFilters()}),this.syncState(),Z().canvas.render()}getAll(){return ME}getByName(e){return ME.find(t=>t.name===e)}isApplied(e){let t=Z().canvas.getMainImage();return!!t&&this.findFilterIndex(e,t.filters)>-1}applyValue(e,t,n){let r=this.getByName(e);this.getImages().forEach(e=>{let i=(e.filters||[]).find(e=>e.type.toLowerCase()===r.name.toLowerCase());i&&(i[t]=n,r.apply&&r.apply(i,t,n),e.applyFilters())}),Z().canvas.render()}addCustom(e,t,n,r){let i=$.fabric.Image.filters;i[FE(e)]=$.fabric.util.createClass(i.BaseFilter,t),i[FE(e)].fromObject=i.BaseFilter.fromObject,ME.push({name:e,options:n,initialConfig:r})}create(e){let t=e.initialConfig||{},n;return e.uses?(t.matrix=e.matrix,n=new $.fabric.Image.filters[FE(e.uses)](t)):(Object.entries(e.options||{}).forEach(([e,n])=>{t[e]=n.current}),n=new $.fabric.Image.filters[FE(e.name)](t)),n.name=e.name,n}hasOptions(e){return!!this.getByName(e).options}findFilterIndex(e,t){if(t==null||!t.length)return-1;let n=this.getByName(e);return t.findIndex(e=>this.configMatchesFabricFilter(n,e))}syncState(){let e=[];(this.getImages()[0]?.filters||[]).forEach(t=>{let n=this.getByFabricFilter(t);n&&e.push(n.name)}),Y.setState({filter:{...X().filter,applied:e}})}getByFabricFilter(e){return ME.find(t=>this.configMatchesFabricFilter(t,e))}configMatchesFabricFilter(e,t){let n=t.type.toLowerCase().replace(` `,``);return n===e.fabricType||n===e.name||n===`convolute`&&this.matrixAreEqual(e.matrix,t.matrix)}matrixAreEqual(e,t){if(!e||!t||e.length!==t.length)return!1;for(let n=e.length;n--;)if(e[n]!==t[n])return!1;return!0}getImages(){return Z().objects.getAll().filter(e=>e.name===Sy.Image||e.name===Sy.MainImage)}};function LE(e){let t=X().config.tools?.resize?.minWidth||50;return e?Math.ceil(100*t/X().original.width):t}function RE(e){let t=X().config.tools?.resize?.maxWidth||2400;return e?Math.ceil(100*t/X().original.width):t}function zE(e){let t=X().config.tools?.resize?.minHeight||50;return e?Math.ceil(100*t/X().original.height):t}function BE(e){let t=X().config.tools?.resize?.maxHeight||2400;return e?Math.ceil(100*t/X().original.height):t}function VE(e,t){if(t)return e;let n=X().original.height/e;return Math.floor(X().original.width/n)}function HE(e,t){if(t)return e;let n=X().original.width/e;return Math.floor(X().original.height/n)}var UE=class{apply(e){let{width:t,height:n,usePercentages:r}=function(e){return e.width<LE(e.usePercentages)&&(e.width=LE(e.usePercentages),e.maintainAspect&&(e.height=HE(e.width,e.usePercentages))),e.width>RE(e.usePercentages)&&(e.width=RE(e.usePercentages),e.maintainAspect&&(e.height=HE(e.width,e.usePercentages))),e.height<zE(e.usePercentages)&&(e.height=zE(e.usePercentages),e.maintainAspect&&(e.width=VE(e.height,e.usePercentages))),e.height>BE(e.usePercentages)&&(e.height=BE(e.usePercentages),e.maintainAspect&&(e.width=VE(e.height,e.usePercentages))),e}(e),i=Math.ceil(X().original.width),a=Math.ceil(X().original.height),o=Math.ceil(t),s=Math.ceil(n),c,l;r?(c=t/100,l=n/100):(c=t/X().original.width,l=n/X().original.height),(i!==o||a!==s)&&this.resize(c,l)}resize(e,t){Z().zoom.set(1,!1);let n=Math.round(X().original.height*t),r=Math.round(X().original.width*e);Z().canvas.resize(r,n,{applyZoom:!1,resizeHelper:!0}),Z().objects.getAll().forEach(n=>{let r=n.scaleX||1,i=n.scaleY||1,a=n.left||0,o=n.top||0,s=r*e,c=i*t,l=a*e,u=o*t;n.scaleX=s,n.scaleY=c,n.left=l,n.top=u,n.setCoords()}),Z().zoom.fitToScreen(),Q().requestRenderAll()}};function WE(e,t){t.innerZone!==null&&(function(e,t){t.innerZone.style.width=`${e.width}px`,t.innerZone.style.height=`${e.height}px`,t.innerZone.style.transform=`translate(${e.left}px, ${e.top}px)`}(e,t),function(e,t){let n=X().canvasSize.width,r=X().canvasSize.height;t.maskTop.style.height=`${e.top}px`,t.maskTop.style.width=`${n}px`,t.maskLeft.style.top=`${e.top}px`,t.maskLeft.style.height=`${e.height}px`,t.maskLeft.style.width=`${e.left}px`;let i=e.left+e.width;t.maskRight.style.left=`${i}px`,t.maskRight.style.top=`${e.top}px`,t.maskRight.style.height=`${e.height}px`,t.maskRight.style.width=n-i+`px`,t.maskBottom.style.height=r-(e.top+e.height)+`px`,t.maskBottom.style.width=`${n}px`}(e,t),function(e,t){let n=(e.width-2)/3;t.lineVer1.style.height=`${e.height}px`,t.lineVer1.style.transform=`translate(${n}px, 0)`,t.lineVer2.style.height=`${e.height}px`,t.lineVer2.style.transform=`translate(${2*n}px, 0)`;let r=(e.height-2)/3;t.lineHor1.style.width=`${e.width}px`,t.lineHor1.style.transform=`translate(0, ${r}px)`,t.lineHor2.style.width=`${e.width}px`,t.lineHor2.style.transform=`translate(0, ${2*r}px)`}(e,t))}function GE(e,t,n){let r=t,i=n;return e&&(n*e>t?i=t/e:r=n*e),{width:Math.floor(r),height:Math.floor(i)}}function KE(e){if(!e)return null;let t=e.split(`:`);return parseInt(t[0])/parseInt(t[1])}var qE=class{constructor(){kf(this,`refs`,null)}apply(e){let t=Z().frame.active.config?.name,n=Z().frame.active.currentSizeInPercent;return Z().frame.active.hide(),Z().merge.apply().then(()=>{Z().canvas.resize(Math.round(e.width),Math.round(e.height),{applyZoom:!0,resizeHelper:!0});let r=Z().canvas.getMainImage();r.cropX=Math.round(e.left),r.cropY=Math.round(e.top),r.width=Math.round(e.width),r.height=Math.round(e.height),r.viewportCenter(),t&&Z().frame.add(t,n),Z().zoom.fitToScreen(),Z().canvas.render()})}drawZone(e){var t;(t=this.refs)!=null&&t.current&&(X().crop.setCropzoneRect(e),WE(e,this.refs.current))}resetCropzone(e){let t=X().canvasSize,n=KE(e);if(!t)return;X().crop.setAspectRatio(e);let r=function(e,t=null){let n={width:e.width,height:e.height,top:0,left:0,angle:0};if(t){let e=GE(t,n.width,n.height);n.width=e.width,n.height=e.height}return n.left=(e.width-n.width)/2,n.top=(e.height-n.height)/2,n}(t,n);this.drawZone(r)}registerRefs(e){this.refs=e}},JE=class{getShapeByName(e){return(X().config.tools?.shapes?.items)?.find(t=>t.name===e)||null}addBasicShape(e){let t=this.getShapeByName(e);if(!t)return null;let{width:n,height:r,...i}=X().config.objectDefaults?.shape||{},a={...i,...t.options},o;if(t.name===`circle`)o=new $.fabric.Circle({...a,radius:100});else if(t.name===`ellipse`)o=new $.fabric.Ellipse({...a,rx:100,ry:50});else if(t.type===`Path`)o=new $.fabric.Path(a.path,{displayName:t.name,...a});else{let e=t.type;o=new $.fabric[e]({...a,width:150,height:150})}return this.addAndPositionShape(o,Sy.Shape,{width:n,height:r}),o}addSticker(e,t){let n=(X().config.tools?.stickers?.items)?.find(t=>t.name===e);if(!n)return Promise.resolve();if(n.type===`svg`){let e=YE(n,t);return this.addSvgSticker(e)}return this.addRegularSticker(n,t)}addRegularSticker(e,t){return new Promise(n=>{$.fabric.util.loadImage(YE(e,t),e=>{let{width:t,height:r,...i}=X().config.objectDefaults?.sticker||{},a=new $.fabric.Image(e,i);this.addAndPositionShape(a,Sy.Sticker,{width:t,height:r}),n()})})}addSvgSticker(e,t=Sy.Sticker){return new Promise(n=>{$.fabric.loadSVGFromURL(e,(e,r)=>{let{width:i,height:a,...o}=X().config.objectDefaults?.sticker||{},s=$.fabric.util.groupSVGElements(e,r);s.set(o),this.addAndPositionShape(s,t,{width:i,height:a}),n()})})}addAndPositionShape(e,t,{width:n}){e.name=t,e.scaleX=1,e.scaleY=1,Q().add(e);let r=n||X().original.width*X().zoom/4;e.scaleToWidth(Math.min(150,r)),e.viewportCenter(),e.setCoords(),Z().canvas.render(),Q().setActiveObject(e)}};function YE(e,t){return TE(`images/stickers/${e.name}/${t}.${e.type}`)}var XE=class{constructor(e){kf(this,`patternCache`,[]),this.activeFrame=e}fillParts(e){this.patternCache.forEach(t=>{this.fillPartWithPattern(t,e)})}fillPartWithPattern(e,t){if(!this.activeFrame.parts)return;e.canvas=new $.fabric.StaticCanvas(null),e.canvas.add(e.img);let n=new $.fabric.Pattern({source:e.canvas.getElement(),repeat:t===`repeat`?`repeat`:`no-repeat`});this.activeFrame.parts[e.name]&&this.activeFrame.parts[e.name].set(`fill`,n)}scale(e){if(!this.activeFrame.config||!this.patternCache)return;let t=this.activeFrame.config.mode;e/=Q().getRetinaScaling(),this.patternCache.forEach(n=>{this.activeFrame.parts&&(n.name===`top`||n.name===`bottom`?t===`stretch`?(this.scalePatternToWidth(n.img,this.activeFrame.parts.top.getScaledWidth()),this.scalePatternToHeight(n.img,e)):n.img.scaleToHeight(e):n.name===`left`||n.name===`right`?t===`stretch`?(this.scalePatternToWidth(n.img,e),this.scalePatternToHeight(n.img,this.activeFrame.parts.left.getScaledHeight())):n.img.scaleToWidth(e):t===`stretch`?(this.scalePatternToWidth(n.img,e),this.scalePatternToHeight(n.img,e)):n.img.scaleToWidth(e),n.canvas.setDimensions({width:n.img.getScaledWidth(),height:n.img.getScaledHeight()}))}),Z().canvas.render()}scalePatternToWidth(e,t){if(!e.width)return;let n=e.getBoundingRect().width/e.getScaledWidth();e.set(`scaleX`,t/e.width/n),e.setCoords()}scalePatternToHeight(e,t){if(!e.height)return;let n=e.getBoundingRect().height/e.getScaledHeight();e.set(`scaleY`,t/e.height/n),e.setCoords()}load(e){let t=this.activeFrame.getPartNames().map(t=>new Promise(n=>{let r={...kb,originX:`left`,originY:`top`};X().config.crossOrigin&&(r.crossOrigin=`anonymous`),$.fabric.Image.fromURL(this.getPartUrl(e,t),e=>{n({name:t,img:e})},r)}));return Promise.all(t).then(t=>{this.patternCache=t,this.fillParts(e.mode)})}getPartUrl(e,t){return TE(`images/frames/${e.name}/${t}.png`)}},ZE=class{constructor(e,t){this.activeFrame=e,this.patterns=t}get defaultColor(){return X().config.objectDefaults?.global?.fill}build(e,t){this.createParts(e),this.resize(t),this.activeFrame.config=e,e.mode===`basic`?Z().canvas.render():this.patterns.load(e).then(()=>{this.patterns.scale(t),Z().canvas.render()})}createParts(e){let t={};this.activeFrame.getPartNames().forEach(n=>{let r=e.mode===`basic`?this.defaultColor:void 0;t[n]=new $.fabric.Rect({...kb,fill:r,originX:`left`,originY:`top`,name:`frame.rect.${n}`,objectCaching:!1,data:{pixieInternal:!0}}),Q().add(t[n])}),this.activeFrame.parts=t}resize(e){let t=X().original.width,n=X().original.height,r=this.activeFrame,i=e;r.parts&&(r.parts.topLeft.set({width:i,height:i}),r.parts.topRight.set({left:t-r.parts.topLeft.getScaledWidth(),width:i,height:i}),r.parts.top.set({left:r.parts.topLeft.getScaledWidth()-1,width:t-r.parts.topLeft.getScaledWidth()-r.parts.topRight.getScaledWidth()+3,height:i}),r.parts.bottomLeft.set({top:n-r.parts.topLeft.getScaledHeight(),width:i,height:i}),r.parts.left.set({top:r.parts.topLeft.getScaledHeight()-1,width:i,height:n-r.parts.topLeft.getScaledHeight()-r.parts.bottomLeft.getScaledHeight()+3}),r.parts.bottomRight.set({left:t-r.parts.bottomLeft.getScaledWidth(),top:n-r.parts.topRight.getScaledWidth(),width:i,height:i}),r.parts.bottom.set({left:r.parts.top.left,top:n-r.parts.top.getScaledHeight(),width:r.parts.top.getScaledWidth(),height:i}),r.parts.right.set({left:t-r.parts.left.getScaledWidth(),top:r.parts.left.top,width:r.parts.left.width,height:r.parts.left.getScaledHeight()}))}},QE=class{constructor(){kf(this,`corners`,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`]),kf(this,`sides`,[`top`,`right`,`bottom`,`left`]),kf(this,`parts`,null),kf(this,`config`,null),kf(this,`currentSizeInPercent`,100)}getPartNames(){return[...this.corners,...this.sides]}hide(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!1})),Z().canvas.render())}show(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!0})),Z().canvas.render())}remove(){this.parts&&(this.config=null,Object.values(this.parts).forEach(e=>{Q().remove(e)}),this.parts=null,Z().canvas.render())}is(e){return!!this.config&&this.config.name===e.name}changeColor(e){this.config?.mode!==`basic`||!this.parts||(Object.values(this.parts).forEach(t=>{t.set(`fill`,e)}),Z().canvas.render())}getMinSize(){return this.config?.size.min??1}getMaxSize(){return this.config?.size.max??35}},$E=class{constructor(){kf(this,`patterns`),kf(this,`builder`),kf(this,`active`),this.active=new QE,this.patterns=new XE(this.active),this.builder=new ZE(this.active,this.patterns),Q().on(`object:added`,()=>{Object.values(this.active.parts||[]).forEach(e=>e.moveTo(98))})}add(e,t){let n=this.getByName(e);if(!n||this.active.is(n))return;this.active.remove(),this.active.currentSizeInPercent=t??n.size.default;let r=this.calcFrameSizeInPixels(this.active.currentSizeInPercent);this.builder.build(n,r),X().frame.select(n)}resize(e){if(!this.active.parts||!this.active.config)return;e?this.active.currentSizeInPercent=e:e=this.active.currentSizeInPercent;let t=this.calcFrameSizeInPixels(e);this.builder.resize(t),this.patterns.scale(t),Z().canvas.render()}changeColor(e){this.active.changeColor(e)}remove(){this.active.remove(),X().frame.deselect()}getByName(e){let t=X().config.tools?.frame?.items;if(t)return t.find(t=>t.name===e)}getActiveFrameConfig(){return this.active.config}calcFrameSizeInPixels(e){let t=Math.min(X().original.width,X().original.height);return Math.ceil(e/100*t)}},eD=class{constructor(){kf(this,`minWidth`,250)}add(e,t={}){if(!(e||=X().config.tools?.text?.defaultText))return;let n={...X().config.objectDefaults?.text,...t,name:Sy.Text,padding:X().config.tools?.text?.controlsPadding,editingBorderColor:c_.fill},r=new $.fabric.IText(e,n);Q().add(r),t.left==null&&t.top==null&&this.autoPositionText(r),Z().objects.select(r)}autoPositionText(e){let t=Q().getWidth(),n=Q().getHeight(),r=Math.min(Q().getWidth(),this.minWidth);e.scaleToWidth(Math.max(t/3,r)),e.getScaledHeight()>n&&e.scaleToHeight(n-e.getScaledHeight()-20),e.viewportCenter(),Q().getObjects(`i-text`).forEach(t=>{if(t!==e&&t.intersectsWithObject(e)){let n=t.top-e.top+t.getScaledHeight(),r=e.top+n;r>X().original.height-t.getScaledHeight()&&(r=0),e.set(`top`,r),e.setCoords()}})}selectOrAddText(e,t={}){if(X().objects.active.isText)return!1;let n=Z().objects.getAll().find(e=>xy(e));return n?(Z().objects.select(n),!1):(this.add(e,t),!0)}},tD=e=>{let t=new $.fabric.PatternBrush(e);return t.getPatternSrc=function(){let e=$.fabric.document.createElement(`canvas`);e.width=10,e.height=10;let t=e.getContext(`2d`);return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(0,5),t.lineTo(10,5),t.closePath(),t.stroke(),e},t},nD=e=>{let t=new $.fabric.PatternBrush(e);return t.getPatternSrc=function(){let e=document.createElement(`canvas`);e.width=10,e.height=10;let t=e.getContext(`2d`);return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(5,0),t.lineTo(5,10),t.closePath(),t.stroke(),e},t},rD=e=>{let t=new $.fabric.PatternBrush(e);return t.getPatternSrc=function(){let e=this.width/2,t=document.createElement(`canvas`),n=new $.fabric.Rect({width:e,height:e,angle:45,fill:this.color}),r=n.getBoundingRect().width;t.width=r+5,t.height=r+5,n.set({left:r/2,top:r/2});let i=t.getContext(`2d`);return n.render(i),t},t},iD=e=>{let t=new $.fabric.PatternBrush(e);return t.getPatternSrc=function(){let e=document.createElement(`canvas`);e.width=12,e.height=12;let t=e.getContext(`2d`);return t.fillStyle=this.color,t.fillRect(0,0,10,10),e},t},aD=class{constructor(){kf(this,`customBrushes`,{VLineBrush:tD,HLineBrush:nD,DiamondBrush:rD,SquareBrush:iD}),kf(this,`currentBrush`,{type:`PencilBrush`,color:X().config.objectDefaults?.global?.fill,width:l_[1]}),kf(this,`onPathCreated`,e=>{e.path.name=Sy.Drawing,e.path.set(function(){let e={...kb};return delete e.strokeWidth,e}()),X().setDirty(!0)})}enable(){Q().on(`path:created`,this.onPathCreated),Q().isDrawingMode=!0,this.setBrushType(this.currentBrush.type),this.setBrushSize(this.currentBrush.width)}disable(){Q().off(`path:created`,this.onPathCreated),Q().isDrawingMode=!1}getBrushType(){return this.currentBrush.type}setBrushType(e){this.currentBrush.type=e,Q().freeDrawingBrush=e in $.fabric?new $.fabric[e](Q()):this.customBrushes[e](Q()),this.applyBrushStyles()}applyBrushStyles(){Object.keys(this.currentBrush).forEach(e=>{Q().freeDrawingBrush[e]=this.currentBrush[e]});let e=Q().freeDrawingBrush;e.getPatternSrc&&(e.source=e.getPatternSrc.call(e))}setBrushSize(e){this.currentBrush.width=e,this.applyBrushStyles()}getBrushSize(){return this.currentBrush.width}setBrushColor(e){this.currentBrush.color=e,this.applyBrushStyles()}getBrushColor(){return this.currentBrush.color}};async function oD(e,t=!0,n=!0){let r=await pE(e);if(r)return new Promise(e=>{r.name=Sy.Image,r.opacity=0;let i=X().original.width,a=X().original.height;if(t&&(r.width>=i||r.height>=a)){let e=i-.1*i,t=a-.1*a,n=1/Math.min(t/r.getScaledHeight(),e/r.getScaledWidth());r.scaleX*=1/n,r.scaleY*=1/n}X().fabric.add(r),n&&X().fabric.setActiveObject(r),r.viewportCenter(),r.setCoords(),X().fabric.requestRenderAll(),Z().zoom.fitToScreen(),r.animate(`opacity`,`1`,{duration:425,onChange:()=>{X().fabric.requestRenderAll()},onComplete:()=>{e(r)}})})}function sD(e){return/(?:\.([^.]+))?$/.exec(e)?.[1]||``}var cD=class{constructor(e,t){kf(this,`id`),kf(this,`fingerprint`),kf(this,`name`),kf(this,`relativePath`,``),kf(this,`size`),kf(this,`mime`,``),kf(this,`extension`,``),kf(this,`native`),kf(this,`lastModified`),kf(this,`cachedData`),this.id=Nb(),this.name=e.name,this.size=e.size,this.mime=function(e){let t={md:`text/markdown`,markdown:`text/markdown`,mp4:`video/mp4`,mp3:`audio/mp3`,svg:`image/svg+xml`,jpg:`image/jpeg`,png:`image/png`,gif:`image/gif`,yaml:`text/yaml`,yml:`text/yaml`,log:`text/plain`},n=e.name?sD(e.name):null;return e.type?e.type:n&&n in t?t[n]:`application/octet-stream`}(e),this.lastModified=e.lastModified,this.extension=sD(e.name)||`bin`,this.native=e,(t=(t=t||e.webkitRelativePath||``).replace(/^\/+/g,``))&&t.split(`/`).length>1&&(this.relativePath=t),this.fingerprint=function({name:e,mime:t,size:n,relativePath:r,lastModified:i}){let a=`be`;return typeof e==`string`&&(a+=`-${lD(e.toLowerCase())}`),t&&(a+=`-${t}`),typeof r==`string`&&(a+=`-${lD(r.toLowerCase())}`),n!==void 0&&(a+=`-${n}`),i!==void 0&&(a+=`-${i}`),a}({name:this.name,size:this.size,mime:this.mime,lastModified:this.lastModified})}get data(){return new Promise(e=>{this.cachedData&&e(this.cachedData);let t=new FileReader;t.addEventListener(`load`,()=>{this.cachedData=t.result,e(this.cachedData)}),this.extension===`json`?t.readAsText(this.native):t.readAsDataURL(this.native)})}};function lD(e){let t=``;return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,`/`))+t}function uD(e={}){return new Promise(t=>{let n=function(e={}){let t=document.querySelector(`#hidden-file-upload-input`);t&&t.remove();let n=document.createElement(`input`);return n.type=`file`,n.multiple=e.multiple??!1,n.classList.add(`hidden`),n.style.display=`none`,n.style.visibility=`hidden`,n.id=`hidden-file-upload-input`,n.accept=function({extensions:e=[],types:t=[]}){let n=[];return e!=null&&e.length&&(e=e.map(e=>e.startsWith(`.`)?e:`.${e}`),n.push(e.join(`,`))),t!=null&&t.length&&n.push(t.join(`,`)),n.join(`,`)}(e),e.directory&&(n.webkitdirectory=!0),document.body.appendChild(n),n}(e);n.onchange=e=>{let r=e.target.files;if(!r)return t([]);t(Array.from(r).filter(e=>e.name!==`.DS_Store`).map(e=>new cD(e))),n.remove()},document.body.appendChild(n),n.click()})}var dD=(e=>(e.image=`image/*`,e.audio=`audio/*`,e.text=`text/*`,e.json=`application/json`,e.video=`video/mp4,video/mpeg,video/x-m4v,video/*`,e))(dD||{});function fD(e,t=1){if(e==null||Number.isNaN(e))return``;let n=e<0,r=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`];if(n&&(e=-e),e<1)return(n?`-`:``)+e+` B`;let i=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/1024**i);let a=r[i];return e>=10||e%1==0?`${(n?`-`:``)+e.toFixed(0)} ${a}`:`${(n?`-`:``)+e.toFixed(t)} ${a}`}function pD(e,t){this.text=e||=``,this.hasWild=~e.indexOf(`*`),this.separator=t,this.parts=e.split(t)}pD.prototype.match=function(e){var t,n,r=!0,i=this.parts,a=i.length;if(typeof e==`string`||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||``).split(this.separator),t=0;r&&t<a;t++)i[t]!==`*`&&(r=t<n.length&&i[t]===n[t]);r&&=n}else r=!1;else if(typeof e.splice==`function`)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if(typeof e==`object`)for(var o in r={},e)this.match(o)&&(r[o]=e[o]);return r};var mD=function(e,t,n){var r=new pD(e,n||/[\/\.]/);return typeof t<`u`?r.match(t):r},hD=/[\/\+\.]/,gD=n_(function(e,t){function n(t){var n=mD(t,e,hD);return n&&n.length>=2}return t?n(t.split(`;`)[0]):n});function _D(e,t){return t.map(e=>e.split(`,`)).flat().some(t=>{if(t.includes(`/`))return!!e.mime&&gD(e.mime.replace(/;.*?$/,``),t);let n=t.replace(`.`,``).toLowerCase();return!(!n||!e.extension)&&e.extension.toLowerCase()===n})}var vD=class{async uploadAndAddImage(e=!0){let t=await this.openUploadWindow();await this.openUploadedFile(t,e)}async uploadAndReplaceMainImage(){let e=await this.openUploadWindow();e&&await this.openBackgroundImage(e)}async uploadAndOpenStateFile(){let e=await this.openUploadWindow(yD);e&&await this.loadState(await e.data)}async addImageFromUrl(e,t=!0){await oD(e,X().config.tools?.import?.fitOverlayToScreen??!0,t),Z().history.addHistoryItem({name:`overlayImage`})}async addImageFromData(e,t=!0){await oD(e,X().config.tools?.import?.fitOverlayToScreen??!0,t),Z().history.addHistoryItem({name:`overlayImage`})}async openUploadedFile(e,t=!0){if(!e)return;let n=await e.data;switch(e.extension){case`json`:await this.loadState(n);break;case`svg`:await Z().shape.addSvgSticker(n,Sy.Image),Z().history.addHistoryItem({name:`overlayImage`});break;default:await this.addImageFromData(n,t)}}async loadState(e){let t;X().toggleLoading(`state`),await Db(),t=typeof e==`string`?e.endsWith(`.json`)?await Ob(e):JSON.parse(e):e,t.history?X().history.reset(t.history):await Z().history.addInitial(t),await Z().history.reload(),X().toggleLoading(!1)}async openUploadWindow(e){var t,n;e||=function(){let e=X().config.tools?.import?.validImgExtensions;return e?{extensions:e}:{types:[dD.image]}}();let r=(await uD(e))[0];return this.fileIsValid(r)?((n=(t=X().config).onFileOpen)==null||n.call(t,r),r):null}async openBackgroundImage(e){let t;await Db(),t=e instanceof HTMLImageElement?e.src:e instanceof cD?await e.data:e;let n=await Z().canvas.addMainImage(t);return await Z().history.addInitial(),n}fileIsValid(e){let t=function(e,t){if(!t)return;let{maxFileSize:n,allowedFileTypes:r,blockedFileTypes:i}=t;return n&&e.size!=null&&e.size>n?G("`:file` exceeds maximum allowed size of :size",{values:{file:e.name,size:fD(n)}}):r!=null&&r.length&&!_D(e,r)||i!=null&&i.length&&_D(e,i)?G(`This file type is not allowed`):void 0}(e,{maxFileSize:X().config.tools?.import?.maxFileSize??function(e,t){switch(t){case`KB`:return 1024*e;case`MB`:return 1048576*e;case`GB`:return e*1024**3;case`TB`:return e*1024**4;case`PB`:return e*1024**5;default:return e}}(10,`MB`),allowedFileTypes:[...X().config.tools?.import?.validImgExtensions??[],`json`]});return!t||(Lb.danger(t),!1)}},yD={types:[`.json`,dD.json]},bD=class{constructor(){kf(this,`watermark`,null),kf(this,`lineStyle`,{stroke:`rgba(255,255,255,0.3)`,strokeWidth:5,strokeLineCap:`round`,strokeLineJoin:`round`})}add(e){this.createGroup(),this.addText(e),this.addLines(),Q().add(this.watermark),Z().canvas.render()}remove(){this.watermark&&(Q().remove(this.watermark),this.watermark=null,Z().canvas.render())}createGroup(){this.watermark=new $.fabric.Group(void 0,{...kb,width:X().original.width,height:X().original.height,excludeFromExport:!0,top:0,left:0,originX:`left`,originY:`top`})}addText(e){var t;let n=new $.fabric.Text(e,{fill:`rgba(255,255,255,0.3)`,strokeWidth:2,stroke:`rgba(255,255,255,0.4)`,originX:`center`,originY:`center`,fontWeight:600,fontSize:150,fontFamily:`Courier New`});n.scaleToWidth(X().original.width/2),(t=this.watermark)==null||t.add(n)}addLines(){if(!this.watermark)return;let e=this.watermark?.getObjects(`text`)[0],t=X().original.width/2,n=X().original.height/2,r=e.width/4,i=new $.fabric.Line(void 0,this.lineStyle),a=new $.fabric.Line(void 0,this.lineStyle),o=new $.fabric.Line(void 0,this.lineStyle),s=new $.fabric.Line(void 0,this.lineStyle);this.watermark.add(i,a,o,s),i.set({x1:r,y1:-100,x2:t,y2:-n}),a.set({x1:r,y1:100,x2:t,y2:n}),o.set({x1:-r,y1:-100,x2:-t,y2:-n}),s.set({x1:-r,y1:100,x2:-t,y2:n})}},xD={exports:{}};(function(e){(function(){function t(e,t){return typeof t>`u`?t={autoBom:!1}:typeof t!=`object`&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof t_==`object`&&t_.global===t_?t_:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(e,a,o){if(a=a||e.name||`download`,typeof e!=`string`)navigator.msSaveOrOpenBlob(t(e,o),a);else if(r(e))n(e,a,o);else{var s=document.createElement(`a`);s.href=e,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if((i||=open(``,`_blank`))&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,e.exports=s})()})(xD);var SD=xD.exports,CD=class{save(e,t,n){var r,i;let a=X().config.tools?.export;e||=a?.defaultName,t=this.getFormat(t),n=this.getQuality(n);let o=`${e}.${t}`;this.applyWaterMark();let s=t===`json`?this.getJsonState():this.getDataUrl(t,n);if(Z().watermark.remove(),s)if(X().config.saveUrl)fetch(X().config.saveUrl,{method:`POST`,body:JSON.stringify({data:s,filename:o,format:t})});else if(X().config.onSave)(i=(r=X().config).onSave)==null||i.call(r,s,o,t);else{let e=this.getCanvasBlob(t,s);SD.saveAs(e,o)}}getDataUrl(e,t){try{return e===`svg`?Q().toSVG():Q().toDataURL({format:this.getFormat(e),quality:this.getQuality(t),multiplier:Math.max(X().original.width/Q().width,X().original.height/Q().height)})}catch(e){e.message.toLowerCase().includes(`tainted`)&&Lb.danger(G(`Could not export canvas with external image.`))}return null}getCanvasBlob(e,t){if(e===`json`)return new Blob([t],{type:`application/json`});if(e===`svg`)return new Blob([t],{type:`image/svg+xml`});let n=`image/${e}`;return function(e,t,n){t||=``,n||=512;let r=atob(e),i=[];for(let e=0;e<r.length;e+=n){let t=r.slice(e,e+n),a=Array(t.length);for(let e=0;e<t.length;e++)a[e]=t.charCodeAt(e);let o=new Uint8Array(a);i.push(o)}return new Blob(i,{type:t})}(t=t.replace(/data:image\/([a-z]*)?;base64,/,``),n)}getJsonState(){return JSON.stringify({...Ab(),history:X().history})}applyWaterMark(){let e=X().config.watermarkText;e&&Z().watermark.add(e)}getFormat(e){let t=X().config.tools?.export;return(e=e||t?.defaultFormat||`png`)===`jpg`&&(e=`jpeg`),e}getQuality(e){let t=X().config.tools?.export;return e=e||t?.defaultQuality||.8}},wD=class{constructor(){kf(this,`previewRect`,null)}async apply(e){this.previewRect||this.showPreview(),this.updatePreview(e),Q().remove(this.previewRect),Q().clipPath=this.previewRect;let t=Z().export.getDataUrl();t&&Z().canvas.clear(),this.hidePreview(),t&&await Z().canvas.addMainImage(t),Q().clipPath=void 0}getPreviewRadius(){return this.previewRect?.rx||0}updatePreview(e){this.previewRect&&(this.previewRect.set({rx:e,ry:e}),Z().canvas.render())}showPreview(){let e=.04*X().original.width;this.previewRect=new $.fabric.Rect({width:X().original.width,height:X().original.height,rx:e,ry:e,objectCaching:!1,fill:`transparent`,name:`round.rect`,data:{pixieInternal:!0},stroke:`rgba(255,255,255,0.8)`,strokeWidth:3,strokeDashArray:[4,4],selectable:!1,evented:!1}),Q().add(this.previewRect),this.previewRect.moveTo(99),this.previewRect.viewportCenter(),Z().canvas.render()}hidePreview(){this.previewRect&&=(Q().remove(this.previewRect),Z().canvas.render(),null)}},TD=class{get straightenAnchor(){return Q().getObjects().find(e=>e.name===Sy.StraightenAnchor)}rotateLeft(){this.rotateFixed(-90)}rotateRight(){this.rotateFixed(90)}straighten(e){this.storeObjectsRelationToHelper(),Z().objects.deselectActive();let t=(this.straightenAnchor.data.rotateAngle||0)+e,n=this.getImageScale(t,this.straightenAnchor);this.straightenAnchor.angle=t,this.straightenAnchor.scaleX=n,this.straightenAnchor.scaleY=n,this.straightenAnchor.data.straightenAngle=e,this.transformObjectsBasedOnHelper()}flip(e){let t=e===`horizontal`?`flipY`:`flipX`;Z().objects.getAll().forEach(e=>{e[t]=!e[t]}),Z().canvas.render()}rotateFixed(e){Z().zoom.set(1,!1),Z().objects.deselectActive();let t=this.straightenAnchor.data.rotateAngle||0;e=90*Math.round(e/90);let n=t+(this.straightenAnchor.data.straightenAngle||0)+e;Z().canvas.resize(X().original.height,X().original.width,{applyZoom:!1,resizeHelper:!1}),this.storeObjectsRelationToHelper(),this.straightenAnchor.rotate(n),this.straightenAnchor.data.rotateAngle=t+e,this.straightenAnchor.center(),this.transformObjectsBasedOnHelper(),Z().frame.resize(Z().frame.active.currentSizeInPercent),requestAnimationFrame(()=>{Z().zoom.fitToScreen()})}getImageScale(e,t){e=$.fabric.util.degreesToRadians(e);let n=X().original.width/2,r=X().original.height/2,i=t.width/2,a=t.height/2,o=Math.sqrt(n**2+r**2),s=Math.asin(r/o),c=(e%(2*Math.PI)+4*Math.PI)%(2*Math.PI);c>Math.PI&&(c-=Math.PI),c>Math.PI/2&&c<=Math.PI&&(c=Math.PI/2-(c-Math.PI/2));let l=Math.PI/2-s-Math.abs(c),u=Math.abs(s-Math.abs(c)),d=Math.cos(l)*o,f=Math.cos(u)*o;return Math.max(f/i,d/a)}storeObjectsRelationToHelper(){Z().objects.getAll().forEach(e=>{if(e!==this.straightenAnchor){let t=$.fabric.util.multiplyTransformMatrices($.fabric.util.invertTransform(this.straightenAnchor.calcTransformMatrix()),e.calcTransformMatrix());e.data={...e.data,relationToCanvas:t}}})}transformObjectsBasedOnHelper(){Z().objects.getAll().forEach(e=>{if(e.data.relationToCanvas){let t=$.fabric.util.multiplyTransformMatrices(this.straightenAnchor.calcTransformMatrix(),e.data.relationToCanvas),n=$.fabric.util.qrDecompose(t);e.set({flipX:!1,flipY:!1}),e.setPositionByOrigin({x:n.translateX,y:n.translateY},`center`,`center`),e.set(n),e.setCoords(),e.data.relationToCanvas=null}})}resetStraightenAnchor(){let e=this.straightenAnchor;e&&Q().remove(e);let t=new $.fabric.Rect({...kb,name:Sy.StraightenAnchor,visible:!1,width:X().original.width,height:X().original.height,data:{pixieInternal:!0,straightenAngle:0,rotateAngle:0}});Q().add(t),t.viewportCenter()}};function ED(e){let t=function(e){let t=new $.fabric.Canvas(e,{width:1,height:1});t.preserveObjectStacking=!0,t.selection=!1,t.renderOnAddRemove=!1;let n=X().config.textureSize;n&&($.fabric.textureSize=n);let r={...X().config.objectDefaults?.global,...cE};Object.keys(r).forEach(e=>{$.fabric.Object.prototype[e]=r[e]}),t.on(`object:added`,e=>{var t;e.target&&((t=e.target?.data)==null||!t.id)&&(e.target.data||(e.target.data={}),e.target.data.id=lE(10))});let i=$.fabric.Object.prototype.controls;return Object.keys(i).forEach(e=>{delete i[e]}),t}(e);X().editor.fabric=t,Y.setState({fabric:t}),X().editor.tools={canvas:new hE,objects:new xE,zoom:new fE,history:new AE,filter:new IE,resize:new UE,crop:new qE,merge:new jE,shape:new JE,frame:new $E,text:new eD,draw:new aD,transform:new TD,import:new vD,watermark:new bD,export:new CD,corners:new wD}}function DD(e,t){let n=new ResizeObserver(e=>{let n=e[0].contentRect;t({width:n.width,height:n.height})});return e.current&&n.observe(e.current),()=>{e.current&&n.unobserve(e.current)}}function OD(e){let t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}var kD=`flex flex-shrink-0 items-center justify-between px-12 py-[9px] w-full h-[54px]`,AD={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:`absolute`},transition:{type:`tween`,duration:.15}};function jD(e,{padding:t,equalWidth:n,variant:r}={}){switch(e){case`2xs`:return r===`link`?`text-xs`:`text-xs h-24 ${n?`w-24`:t||`px-10`}`;case`xs`:return r===`link`?`text-xs`:`text-xs h-30 ${n?`w-30`:t||`px-14`}`;case`sm`:return r===`link`?`text-sm`:`text-sm h-36 ${n?`w-36`:t||`px-18`}`;case`md`:return r===`link`?`text-base`:`text-base h-42 ${n?`w-42`:t||`px-22`}`;case`lg`:return r===`link`?`text-lg`:`text-base h-50 ${n?`w-50`:t||`px-26`}`;case`xl`:return r===`link`?`text-xl`:`text-lg h-60 ${n?`w-60`:t||`px-32`}`;default:return e||``}}function MD(e){let{variant:t,shadow:n,whitespace:r=`whitespace-nowrap`,display:i=`inline-flex`}=e,a={...e,border:e.border||`border`},o=[];return t===`outline`?o=function({color:e,border:t}){let n=`disabled:text-disabled disabled:bg-transparent disabled:border-disabled-bg`;switch(e){case`primary`:return[`text-primary bg-transparent ${t} border-primary/50`,`hover:bg-primary/hover hover:border-primary`,n];case`danger`:return[`text-danger bg-transparent ${t} border-danger/50`,`hover:bg-danger/4 hover:border-danger`,n];case`positive`:return[`text-positive bg-transparent ${t} border-positive/50`,`hover:bg-positive/4 hover:border-positive`,n];case`paper`:return[`text bg-paper ${t}`,`hover:bg-hover`,n];case`white`:return[`text-white bg-transparent border border-white`,`hover:bg-white/20`,`disabled:text-white/70 disabled:border-white/70 disabled:bg-transparent`];default:return[`bg-transparent ${t}`,`hover:bg-hover`,n]}}(a):t===`text`?o=function({color:e}){let t=`disabled:text-disabled disabled:bg-transparent`;switch(e){case`primary`:return[`text-primary bg-transparent border-transparent`,`hover:bg-primary/4`,t];case`danger`:return[`text-danger bg-transparent border-transparent`,`hover:bg-danger/4`,t];case`positive`:return[`text-positive bg-transparent border-transparent`,`hover:bg-positive/4`,t];case`white`:return[`text-white bg-transparent border-transparent`,`hover:bg-white/20`,`disabled:text-white/70 disabled:bg-transparent`];default:return[`bg-transparent border-transparent`,`hover:bg-hover`,t]}}(a):t===`flat`||t===`raised`?o=function({color:e,border:t}){let n=`disabled:text-disabled disabled:bg-disabled disabled:border-transparent disabled:shadow-none`;switch(e){case`primary`:return[`text-on-primary bg-primary ${t} border-primary`,`hover:bg-primary-dark hover:border-primary-dark`,n];case`danger`:return[`text-white bg-danger ${t} border-danger`,`hover:bg-danger/90 hover:border-danger/90`,n];case`chip`:return[`text-main bg-chip ${t} border-chip`,`hover:bg-chip/90 hover:border-chip/90`,n];case`paper`:return[`text-main bg-paper ${t} border-paper`,`hover:bg-paper/90 hover:border-paper/90`,n];case`white`:return[`text-black bg-white ${t} border-white`,`hover:bg-white`,n];default:return[`bg ${t} border-background`,`hover:bg-hover`,n]}}(a):t===`link`&&(o=function({color:e}){switch(e){case`primary`:return[`text-primary`,`hover:underline`,`disabled:text-disabled`];case`danger`:return[`text-danger`,`hover:underline`,`disabled:text-disabled`];default:return[`text-main`,`hover:underline`,`disabled:text-disabled`]}}(a)),[...o,n||t===`raised`&&`shadow-md`,r,i,t&&`align-middle flex-shrink-0 items-center transition-button duration-200`,`select-none appearance-none no-underline outline-none disabled:pointer-events-none disabled:cursor-default`]}function ND(e){return e&&(t=>{t.currentTarget.contains(t.target)&&e(t)})}var PD=(0,s.forwardRef)((e,t)=>{let{children:n,color:r=null,variant:i,radius:a,shadow:o,whitespace:s,justify:c=`justify-center`,className:u,href:d,form:f,border:p,elementType:m,to:h,relative:g,replace:_,end:v,display:y,type:b=`button`,onClick:x,onPointerDown:S,onPointerUp:C,onKeyDown:w,...T}=e,E=m||(d?`a`:`button`),D=E===`a`;return(0,l.jsx)(E,{ref:t,form:D?void 0:f,href:d,to:h,relative:g,type:D?void 0:b,replace:_,end:v,onPointerDown:ND(S),onPointerUp:ND(C),onClick:ND(x),onKeyDown:ND(w),className:K(`focus-visible:ring`,MD({variant:i,color:r,border:p,whitespace:s,display:y}),a,c,u),...T,children:n})}),FD=s.default.forwardRef(({children:e,startIcon:t,endIcon:n,size:r=`sm`,sizeClassName:i,className:a,equalWidth:o=!1,radius:s=`rounded-button`,variant:c=`text`,disabled:u,elementType:d,to:f,replace:p,href:m,download:h,...g},_)=>(0,l.jsxs)(PD,{className:K(`font-semibold`,i||jD(r,{equalWidth:o,variant:c}),a),ref:_,radius:s,variant:c,disabled:u,to:u?void 0:f,href:u?void 0:m,download:u?void 0:h,elementType:u?void 0:d,replace:u?void 0:p,...g,children:[t&&(0,l.jsx)(ID,{position:`start`,icon:t,size:r}),e,n&&(0,l.jsx)(ID,{position:`end`,icon:n,size:r})]}));function ID({icon:e,position:t,size:n}){let r=K(`m-auto`,{"-ml-4 mr-8":t===`start`,"-mr-4 ml-8":t===`end`},e.props.className);return s.default.cloneElement(e,{className:r,size:n})}var LD=(0,s.createContext)(null);function RD(){return(0,s.useContext)(LD)}var zD=q((0,l.jsx)(`path`,{d:`M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z`}),`CheckOutlined`),BD=s.default.forwardRef((e,t)=>{let{startIcon:n,capitalizeFirst:r,children:i,description:a,endIcon:o,endSection:s,isDisabled:c,isActive:u,isSelected:d,showCheckmark:f,elementType:p=`div`,radius:m,padding:h,...g}=e;!n&&f&&(n=(0,l.jsx)(zD,{size:`sm`,className:K(`text-primary`,!d&&`invisible`)}));let _=K(`icon-sm rounded overflow-hidden flex-shrink-0`,!c&&`text-muted`),v=K(!c&&`text-muted`);return(0,l.jsxs)(p,{...g,"aria-disabled":c,className:VD(e),ref:t,children:[n&&(0,l.jsx)(`div`,{className:_,children:n}),(0,l.jsxs)(`div`,{className:K(`min-w-auto mr-auto w-full overflow-hidden overflow-ellipsis`,r&&`first-letter:capitalize`),children:[i,a&&(0,l.jsx)(`div`,{className:K(`mt-4 whitespace-normal text-xs`,c?`text-disabled`:`text-muted`),children:a})]}),(o||s)&&(0,l.jsx)(`div`,{className:o?_:v,children:o||s})]})});function VD({className:e,isSelected:t,isActive:n,isDisabled:r,showCheckmark:i,endIcon:a,endSection:o,radius:s,padding:c}){let l,u=``;return u=r?`text-disabled pointer-events-none`:t?n?`bg-primary/focus`:`bg-primary/selected hover:bg-primary/focus`:n?`hover:bg-fg-base/15 bg-focus`:`hover:bg-hover`,l=c||(i?a||o?`pl-8 pr-8 py-8`:`pl-8 pr-24 py-8`:`px-20 py-8`),K(`w-full select-none outline-none cursor-pointer`,`text-sm truncate flex items-center gap-10`,!r&&`text-main`,l,u,e,s)}function HD({children:e,value:t,startIcon:n,endIcon:r,endSection:i,description:a,capitalizeFirst:o,textLabel:s,isDisabled:c,onSelected:u,onClick:d,...f}){let{collection:p,showCheckmark:m,virtualFocus:h,listboxId:g,role:_,listItemsRef:v,handleItemSelection:y,state:{selectedValues:b,activeIndex:x,setActiveIndex:S}}=RD(),C=b.includes(t),w=p.get(t)?.index,T=x===w;return w==null?null:(0,l.jsx)(BD,{...f,onFocus:()=>{h||S(w)},onPointerEnter:e=>{S(w),h||e.currentTarget.focus()},onPointerDown:e=>{h&&e.preventDefault()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y(t),u?.())},onClick:e=>{y(t),u?.(),d?.(e)},ref:e=>v.current[w]=e,id:`${g}-${w}`,role:_===`menu`?`menuitem`:`option`,tabIndex:h?void 0:T&&!c?-1:0,"aria-selected":T&&C,showCheckmark:m,isDisabled:c,isActive:T,isSelected:C,startIcon:n,description:a,endIcon:r,endSection:i,capitalizeFirst:o,"data-value":t,children:e})}var UD={exports:{}};(function(e){(function(){var t=Object.assign;function n(e,n){n||={};var r,i,a,o=n.vargs||function(e){var t=e+``,n=t.indexOf(`...`);return n>=0&&(n<t.indexOf(`)`)||t.indexOf(`arguments`)>=0)}(e),s=Object.create(null),c=[],l=[],u=new WeakMap,d=n.maxAge>0&&n.maxAge<1/0?function(e,t,r){return setTimeout(function(){if(r)return t.splice(e,1),void r.splice(e,1);t instanceof WeakMap?t.delete(e):delete t[e]},n.maxAge)}:0,f=n.equals?n.equals:function(e,t){return e===t},p=n.maxArgs,m=n.serializer;return e.length!==1||n.equals||o?i=function(){var t=arguments.length;if(!t&&r!=null)return l[r];var n,i=p||t;for(n=c.length-1;n>=0;n--)if(p||c[n].length===i){for(var a=i-1;a>=0&&f(c[n][a],arguments[a]);a--)if(a===0)return l[n]}return n=c.length-(n+1),!t&&r==null&&(r=n),!d||d(n,l,c),l[n]=e.apply(this,c[n]=arguments)}.bind(this):(i=function(t){var n,r=typeof t;if(!m&&(r===`object`&&t||r===`function`))return u.get(t)||(!d||d(t,u),u.set(t,n=e.call(this,t)),n);var i=r===`number`||r===`boolean`||t==null?t:r===`string`?JSON.stringify(t):m(t);return s[i]||(!d||d(i,s),s[i]=e.call(this,t))}.bind(this),a=1),i.clear=function(){u=new WeakMap,s=Object.create(null),c=[],l=[],r=void 0},i.keys=function(){return a?null:c.slice()},i.values=function(){return a?null:l.slice()},i.keyValues=function(){return a?{primitives:t({},s),objects:u}:null},i}typeof t!=`function`&&(t=function(){var e=arguments,t=arguments[0];if(t==null)throw TypeError(`Cannot convert undefined or null to object`);t=Object(t);for(var n=1;n<e.length;n++)if(e[n]&&typeof e[n]==`object`)for(var r in e[n])t[r]=e[n][r];return t}),e.exports=n,typeof window<`u`&&(window.nanomemoize=n)}).call(t_)})(UD);var WD=n_(UD.exports);function GD({children:e,label:t,index:n}){let r=(0,s.useId)();return(0,l.jsxs)(`div`,{role:`group`,className:K(n!==0&&`border-t my-4`),"aria-labelledby":t?`be-select-${r}`:void 0,children:[t&&(0,l.jsx)(`div`,{className:`block uppercase text-muted text-xs px-16 py-10`,role:`presentation`,id:`be-select-${r}`,"aria-hidden":`true`,children:t}),e]})}var KD=WD(({maxItems:e,children:t,items:n,inputValue:r})=>{let i=JD({children:t,items:n}),a=qD({collection:i,inputValue:r});return e&&(i=new Map([...i.entries()].slice(0,e)),a=new Map([...a.entries()].slice(0,e))),{collection:i,filteredCollection:a}}),qD=WD(({collection:e,inputValue:t})=>{let n=new Map,r=t?`${t}`.toLowerCase().trim():``;if(r){let t=0;e.forEach((e,i)=>{(e.item?JSON.stringify(e.item):e.textLabel).toLowerCase().trim().includes(r)&&n.set(i,{...e,index:t++})})}else n=e;return n}),JD=WD(({children:e,items:t})=>{let n;n=t&&typeof e==`function`?t.map(t=>e(t)):e;let r=new Map,i=0,a=(e,n,a,o)=>{let s=i++,c=n?t?.[a].items[o]:t?.[s];r.set(e.props.value,{index:s,element:e,textLabel:YD(e),item:c,section:n,isDisabled:e.props.isDisabled,value:e.props.value})};return s.Children.forEach(n,(e,t)=>{(0,s.isValidElement)(e)&&(e.type===GD?s.Children.forEach(e.props.children,(n,r)=>{a(n,e,t,r)}):a(e))}),r});function YD(e){var t;let n=e.props.children;return e.props.textLabel?e.props.textLabel:(t=n?.props)!=null&&t.message?n.props.message:`${n}`||``}var XD=Math.min,ZD=Math.max,QD=Math.round,$D=Math.floor,eO=e=>({x:e,y:e}),tO={left:`right`,right:`left`,bottom:`top`,top:`bottom`},nO={start:`end`,end:`start`};function rO(e,t,n){return ZD(e,XD(t,n))}function iO(e,t){return typeof e==`function`?e(t):e}function aO(e){return e.split(`-`)[0]}function oO(e){return e.split(`-`)[1]}function sO(e){return e===`x`?`y`:`x`}function cO(e){return e===`y`?`height`:`width`}function lO(e){return[`top`,`bottom`].includes(aO(e))?`y`:`x`}function uO(e){return sO(lO(e))}function dO(e){return e.replace(/start|end/g,e=>nO[e])}function fO(e){return e.replace(/left|right|bottom|top/g,e=>tO[e])}function pO(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e)}function mO(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function hO(e,t,n){let{reference:r,floating:i}=e,a=lO(t),o=uO(t),s=cO(o),c=aO(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(oO(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function gO(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=iO(t,e),m=pO(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=mO(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),y=await(a.isElement==null?void 0:a.isElement(v))&&await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=mO(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}function _O(e){return bO(e)?(e.nodeName||``).toLowerCase():`#document`}function vO(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yO(e){return((bO(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function bO(e){return e instanceof Node||e instanceof vO(e).Node}function xO(e){return e instanceof Element||e instanceof vO(e).Element}function SO(e){return e instanceof HTMLElement||e instanceof vO(e).HTMLElement}function CO(e){return!(typeof ShadowRoot>`u`)&&(e instanceof ShadowRoot||e instanceof vO(e).ShadowRoot)}function wO(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=kO(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function TO(e){return[`table`,`td`,`th`].includes(_O(e))}function EO(e){let t=DO(),n=kO(e);return n.transform!==`none`||n.perspective!==`none`||!!n.containerType&&n.containerType!==`normal`||!t&&!!n.backdropFilter&&n.backdropFilter!==`none`||!t&&!!n.filter&&n.filter!==`none`||[`transform`,`perspective`,`filter`].some(e=>(n.willChange||``).includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>(n.contain||``).includes(e))}function DO(){return!(typeof CSS>`u`||!CSS.supports)&&CSS.supports(`-webkit-backdrop-filter`,`none`)}function OO(e){return[`html`,`body`,`#document`].includes(_O(e))}function kO(e){return vO(e).getComputedStyle(e)}function AO(e){return xO(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function jO(e){if(_O(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||CO(e)&&e.host||yO(e);return CO(t)?t.host:t}function MO(e){let t=jO(e);return OO(t)?e.ownerDocument?e.ownerDocument.body:e.body:SO(t)&&wO(t)?t:MO(t)}function NO(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=MO(e),i=r===e.ownerDocument?.body,a=vO(r);return i?t.concat(a,a.visualViewport||[],wO(r)?r:[],a.frameElement&&n?NO(a.frameElement):[]):t.concat(r,NO(r,[],n))}function PO(e){let t=kO(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=SO(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=QD(n)!==a||QD(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function FO(e){return xO(e)?e:e.contextElement}function IO(e){let t=FO(e);if(!SO(t))return eO(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=PO(t),o=(a?QD(n.width):n.width)/r,s=(a?QD(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var LO=eO(0);function RO(e){let t=vO(e);return DO()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:LO}function zO(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=FO(e),o=eO(1);t&&(r?xO(r)&&(o=IO(r)):o=IO(e));let s=function(e,t,n){return t===void 0&&(t=!1),!(!n||t&&n!==vO(e))&&t}(a,n,r)?RO(a):eO(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=vO(a),t=r&&xO(r)?vO(r):r,n=e,i=n.frameElement;for(;i&&r&&t!==n;){let e=IO(i),t=i.getBoundingClientRect(),r=kO(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=vO(i),i=n.frameElement}}return mO({width:u,height:d,x:c,y:l})}var BO=[`:popover-open`,`:modal`];function VO(e){return BO.some(t=>{try{return e.matches(t)}catch{return!1}})}function HO(e){return zO(yO(e)).left+AO(e).scrollLeft}function UO(e,t,n){let r;if(t===`viewport`)r=function(e,t){let n=vO(e),r=yO(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=DO();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}(e,n);else if(t===`document`)r=function(e){let t=yO(e),n=AO(e),r=e.ownerDocument.body,i=ZD(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ZD(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+HO(e),s=-n.scrollTop;return kO(r).direction===`rtl`&&(o+=ZD(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(yO(e));else if(xO(t))r=function(e,t){let n=zO(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=SO(e)?IO(e):eO(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n);else{let n=RO(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return mO(r)}function WO(e,t){let n=jO(e);return!(n===t||!xO(n)||OO(n))&&(kO(n).position===`fixed`||WO(n,t))}function GO(e,t){let n=t.get(e);if(n)return n;let r=NO(e,[],!1).filter(e=>xO(e)&&_O(e)!==`body`),i=null,a=kO(e).position===`fixed`,o=a?jO(e):e;for(;xO(o)&&!OO(o);){let t=kO(o),n=EO(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&[`absolute`,`fixed`].includes(i.position)||wO(o)&&!n&&WO(e,o))?r=r.filter(e=>e!==o):i=t,o=jO(o)}return t.set(e,r),r}function KO(e,t,n){let r=SO(t),i=yO(t),a=n===`fixed`,o=zO(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eO(0);if(r||!r&&!a)if((_O(t)!==`body`||wO(i))&&(s=AO(t)),r){let e=zO(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&(c.x=HO(i));return{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function qO(e){return kO(e).position===`static`}function JO(e,t){return SO(e)&&kO(e).position!==`fixed`?t?t(e):e.offsetParent:null}function YO(e,t){let n=vO(e);if(VO(e))return n;if(!SO(e)){let t=jO(e);for(;t&&!OO(t);){if(xO(t)&&!qO(t))return t;t=jO(t)}return n}let r=JO(e,t);for(;r&&TO(r)&&qO(r);)r=JO(r,t);return r&&OO(r)&&qO(r)&&!EO(r)?n:r||function(e){let t=jO(e);for(;SO(t)&&!OO(t);){if(EO(t))return t;t=jO(t)}return null}(e)||n}var XO={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=yO(r),s=!!t&&VO(t.floating);if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eO(1),u=eO(0),d=SO(r);if((d||!d&&!a)&&((_O(r)!==`body`||wO(o))&&(c=AO(r)),SO(r))){let e=zO(r);l=IO(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}},getDocumentElement:yO,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?VO(t)?[]:GO(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=UO(t,n,i);return e.top=ZD(r.top,e.top),e.right=XD(r.right,e.right),e.bottom=XD(r.bottom,e.bottom),e.left=ZD(r.left,e.left),e},UO(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:YO,getElementRects:async function(e){let t=this.getOffsetParent||YO,n=this.getDimensions,r=await n(e.floating);return{reference:KO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=PO(e);return{width:t,height:n}},getScale:IO,isElement:xO,isRTL:function(e){return kO(e).direction===`rtl`}};function ZO(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=FO(e),u=i||a?[...l?NO(l):[],...NO(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?function(e,t){let n,r=null,i=yO(e);function a(){var e;clearTimeout(n),(e=r)==null||e.disconnect(),r=null}return function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let{left:l,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;let p={rootMargin:-$D(u)+`px `+-$D(i.clientWidth-(l+d))+`px `+-$D(i.clientHeight-(u+f))+`px `+-$D(l)+`px`,threshold:ZD(0,XD(1,c))||1},m=!0;function h(e){let t=e[0].intersectionRatio;if(t!==c){if(!m)return o();t?o(!1,t):n=setTimeout(()=>{o(!1,1e-7)},1e3)}m=!1}try{r=new IntersectionObserver(h,{...p,root:i.ownerDocument})}catch{r=new IntersectionObserver(h,p)}r.observe(e)}(!0),a}(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?zO(e):null;return c&&function t(){let r=zO(e);h&&(r.x!==h.x||r.y!==h.y||r.width!==h.width||r.height!==h.height)&&n(),h=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var QO=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await async function(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=aO(n),s=oO(n),c=lO(n)===`y`,l=[`left`,`top`].includes(o)?-1:1,u=a&&c?-1:1,d=iO(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof m==`number`&&(p=s===`end`?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},$O=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=iO(e,t),l={x:n,y:r},u=await gO(t,c),d=lO(aO(i)),f=sO(d),p=l[f],m=l[d];if(a){let e=f===`y`?`bottom`:`right`;p=rO(p+u[f===`y`?`top`:`left`],p,p-u[e])}if(o){let e=d===`y`?`bottom`:`right`;m=rO(m+u[d===`y`?`top`:`left`],m,m-u[e])}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r}}}}},ek=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=iO(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=aO(r),_=aO(o)===o,v=await(s.isRTL==null?void 0:s.isRTL(c.floating)),y=d||(_||!m?[fO(o)]:function(e){let t=fO(e);return[dO(e),t,dO(t)]}(o));!d&&p!==`none`&&y.push(...function(e,t,n,r){let i=oO(e),a=function(e,t,n){let r=[`left`,`right`],i=[`right`,`left`],a=[`top`,`bottom`],o=[`bottom`,`top`];switch(e){case`top`:case`bottom`:return n?t?i:r:t?r:i;case`left`:case`right`:return t?a:o;default:return[]}}(aO(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(dO)))),a}(o,m,p,v));let b=[o,...y],x=await gO(t,h),S=[],C=i.flip?.overflows||[];if(l&&S.push(x[g]),u){let e=function(e,t,n){n===void 0&&(n=!1);let r=oO(e),i=uO(e),a=cO(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=fO(o)),[o,fO(o)]}(r,a,v);S.push(x[e[0]],x[e[1]])}if(C=[...C,{placement:r,overflows:S}],!S.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=b[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=C.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},tk=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=iO(e,t),c=await gO(t,s),l=aO(n),u=oO(n),d=lO(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=XD(p-c[m],g),y=XD(f-c[h],_),b=!t.middlewareData.shift,x=v,S=y;if(d?S=u||b?XD(y,_):_:x=u||b?XD(v,g):g,b&&!u){let e=ZD(c.left,0),t=ZD(c.right,0),n=ZD(c.top,0),r=ZD(c.bottom,0);d?S=f-2*(e!==0||t!==0?e+t:ZD(c.left,c.right)):x=p-2*(n!==0||r!==0?n+r:ZD(c.top,c.bottom))}await o({...t,availableWidth:S,availableHeight:x});let C=await i.getDimensions(a.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}},nk=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=iO(e,t)||{};if(l==null)return{};let d=pO(u),f={x:n,y:r},p=uO(i),m=cO(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=XD(d[_],T),D=XD(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=rO(O,A,k),M=!c.arrow&&oO(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),rk=(e,t,n)=>{let r=new Map,i={platform:XO,...n},a={...i.platform,_c:r};return(async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=hO(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=!0===y.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=hO(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}})(e,t,{...i,platform:a})},ik=typeof document<`u`?s.useLayoutEffect:s.useEffect;function ak(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ak(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof||ak(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function ok(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sk(e,t){let n=ok(e);return Math.round(t*n)/n}function ck(e){let t=s.useRef(e);return ik(()=>{t.current=e}),t}function lk({floatingWidth:e,ref:t,disablePositioning:n=!1,placement:r=`bottom`,offset:i=2,showArrow:a=!1,maxHeight:o,shiftCrossAxis:l=!0,fallbackPlacements:u}){let d=(0,s.useRef)(null),f={placement:r,strategy:`fixed`};n||(f.whileElementsMounted=ZO,f.middleware=[QO(i),$O({padding:16,crossAxis:l,mainAxis:!0}),ek({padding:16,fallbackPlacements:u}),tk({apply({rects:t,availableHeight:n,availableWidth:r,elements:i}){e===`matchTrigger`&&o!=null?Object.assign(i.floating.style,{width:`${t.reference.width}px`,maxWidth:`${r}`,maxHeight:`${Math.min(n,o)}px`}):o!=null&&Object.assign(i.floating.style,{maxHeight:`${Math.min(n,o)}px`})},padding:16})],a&&f.middleware.push((e=>({name:`arrow`,options:e,fn(t){let{element:n,padding:r}=typeof e==`function`?e(t):e;return n&&function(e){return{}.hasOwnProperty.call(e,`current`)}(n)?n.current==null?{}:nk({element:n.current,padding:r}).fn(t):n?nk({element:n,padding:r}).fn(t):{}}}))({element:d})));let p=function(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=s.useState(r);ak(m,r)||h(r);let[g,_]=s.useState(null),[v,y]=s.useState(null),b=s.useCallback(e=>{e!=w.current&&(w.current=e,_(e))},[_]),x=s.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[y]),S=a||g,C=o||v,w=s.useRef(null),T=s.useRef(null),E=s.useRef(f),D=ck(u),O=ck(i),k=s.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};O.current&&(e.platform=O.current),rk(w.current,T.current,e).then(e=>{let t={...e,isPositioned:!0};A.current&&!ak(E.current,t)&&(E.current=t,c.flushSync(()=>{p(t)}))})},[m,t,n,O]);ik(()=>{!1===d&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let A=s.useRef(!1);ik(()=>(A.current=!0,()=>{A.current=!1}),[]),ik(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(D.current)return D.current(S,C,k);k()}},[S,C,k,D]);let j=s.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),M=s.useMemo(()=>({reference:S,floating:C}),[S,C]),N=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=sk(M.floating,f.x),r=sk(M.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ok(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,M.floating,f.x,f.y]);return s.useMemo(()=>({...f,update:k,refs:j,elements:M,floatingStyles:N}),[f,k,j,M,N])}(f),m=(0,s.useMemo)(()=>function(e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}([t,p.refs.setReference]),[p.refs.setReference,t]),{x:h,y:g}=p.middlewareData.arrow||{},_={left:h,top:g,right:``,bottom:``,[{top:`bottom`,right:`left`,bottom:`top`,left:`right`}[p.placement.split(`-`)[0]]]:`-4px`};return{...p,reference:m,arrowRef:d,arrowStyle:_}}function uk(e,t){let{children:n,items:r,role:i=`listbox`,virtualFocus:a,focusLoopingMode:o=`stay`,autoFocusFirstItem:c=!0,onItemSelected:l,clearInputOnItemSelection:u,blurReferenceOnItemSelection:d,floatingWidth:f=`matchTrigger`,floatingMinWidth:p,floatingMaxHeight:m,offset:h,placement:g,showCheckmark:_,showEmptyMessage:v,maxItems:y,isAsync:b,allowCustomValue:x,clearSelectionOnInputClear:S}=e,C=e.selectionMode||`none`,w=`${(0,s.useId)()}-listbox`,[T,E]=rE(e.inputValue,e.defaultInputValue||``,e.onInputValueChange),[D,O]=(0,s.useState)(`all`),k=KD({children:n,items:r,inputValue:b?void 0:T,maxItems:y}),A=D===`all`?k.collection:k.filteredCollection,j=(0,s.useRef)([]),M=(0,s.useMemo)(()=>[...A.values()].map(e=>e.isDisabled?null:e.textLabel),[A]),{selectedValues:N,selectValues:P}=function(e){let{selectionMode:t,allowEmptySelection:n}=e,r=t===`single`||t===`multiple`,[i,a]=rE(r?e.selectedValue:void 0,r?e.defaultSelectedValue:void 0,r?e.onSelectionChange:void 0),o=(0,s.useMemo)(()=>typeof i>`u`?[]:Array.isArray(i)?i:[i],[i]);return{selectedValues:o,selectValues:(0,s.useCallback)(e=>{let r=Array.isArray(e)?e:[e];t===`single`?a(r[0]):r.forEach(e=>{let t=o.indexOf(e);t===-1?(o.push(e),a([...o])):(o.length>1||n)&&(o.splice(t,1),a([...o]))})},[n,o,t,a])}}(e),[F,I]=rE(e.isOpen,e.defaultIsOpen,e.onOpenChange),[L,R]=(0,s.useState)(null),z=lk({floatingWidth:f,ref:t,placement:g,offset:h,maxHeight:m??420,shiftCrossAxis:!a}),{refs:ee,strategy:B,x:te,y:ne}=z,re=C===`none`?void 0:A.get(N[0]),ie=C===`none`||re==null?void 0:re.index,ae=(0,s.useCallback)((e,t)=>{var n,r;let i=[...A.values()],s=!i.find(e=>!e.isDisabled),c=A.size-1;t==null||!A.size||t>c||t<0||s?R(null):(t=function(e,t,n,r){var i;let a=e.length-1;for(;(i=e[t])!=null&&i.isDisabled;)if(r===`increment`){if(++t>=a){if(n!==`loop`)return n===`stay`?t-1:null;t=0}}else if(--t<0){if(n!==`loop`)return n===`stay`?t+1:null;t=a}return t}(i,t,o,e),R(t),t!=null&&(a?(n=j.current[t])==null||n.scrollIntoView({block:`nearest`}):(r=j.current[t])==null||r.focus()))},[A,a,o]);return{handleItemSelection:e=>{let t=ee.reference.current;C===`none`?t&&`focus`in t&&t.focus():P(e),a&&(E(u?``:`${e}`),d&&t&&`blur`in t&&t.blur()),O(`all`),I(!1),l?.(e),R(null)},onInputChange:(0,s.useCallback)(e=>{E(e.target.value),O(e.target.value.trim()?`filtered`:`all`),e.target.value?I(!0):S&&P(``),c&&L==null?ae(`increment`,0):R(null)},[E,I,O,P,S,ae,c,L]),focusLoopingMode:o,floatingWidth:f,floatingMinWidth:p,floatingMaxHeight:m,showCheckmark:_,collection:A,collections:k,virtualFocus:a,focusItem:ae,showEmptyMessage:v&&!!T,allowCustomValue:x,refs:ee,reference:z.reference,floating:ee.setFloating,positionStyle:{position:B,top:ne??``,left:te??``},listContent:M,listItemsRef:j,listboxId:w,role:i,state:{activeIndex:L,setActiveIndex:R,selectedIndex:ie,setSelectedIndex:e=>{if(C!==`none`){let t=[...A.values()][e];t&&P(t.value)}},selectionMode:C,selectedValues:N,selectValues:P,inputValue:T,setInputValue:E,isOpen:F,setIsOpen:I,setActiveCollection:O}}}function dk(){return zT()||typeof window>`u`?Cb.getState().data.is_mobile_device??!1:window.screen.width<=768}var fk=null,pk=new Set,mk=new Map,hk=!1,gk=!1;function _k(e,t){for(let n of pk)n(e,t)}function vk(e){hk=!0,function(e){return!(e.metaKey||!JT()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}(e)&&(fk=`keyboard`,_k(`keyboard`,e))}function yk(e){fk=`pointer`,(e.type===`mousedown`||e.type===`pointerdown`)&&(hk=!0,_k(`pointer`,e))}function bk(e){(function(e){return!(e.mozInputSource!==0||!e.isTrusted)||(YT()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType)})(e)&&(hk=!0,fk=`virtual`)}function xk(e){e.target===window||e.target===document||(!hk&&!gk&&(fk=`virtual`,_k(`virtual`,e)),hk=!1,gk=!1)}function Sk(){hk=!1,gk=!0}function Ck(e){if(typeof window>`u`||mk.get(WT(e)))return;let t=WT(e),n=UT(e),r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){hk=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,vk,!0),n.addEventListener(`keyup`,vk,!0),n.addEventListener(`click`,bk,!0),t.addEventListener(`focus`,xk,!0),t.addEventListener(`blur`,Sk,!1),typeof PointerEvent<`u`?(n.addEventListener(`pointerdown`,yk,!0),n.addEventListener(`pointermove`,yk,!0),n.addEventListener(`pointerup`,yk,!0)):(n.addEventListener(`mousedown`,yk,!0),n.addEventListener(`mousemove`,yk,!0),n.addEventListener(`mouseup`,yk,!0)),t.addEventListener(`beforeunload`,()=>{wk(e)},{once:!0}),mk.set(t,{focus:r})}var wk=(e,t)=>{let n=WT(e),r=UT(e);t&&r.removeEventListener(`DOMContentLoaded`,t),mk.has(n)&&(n.HTMLElement.prototype.focus=mk.get(n).focus,r.removeEventListener(`keydown`,vk,!0),r.removeEventListener(`keyup`,vk,!0),r.removeEventListener(`click`,bk,!0),n.removeEventListener(`focus`,xk,!0),n.removeEventListener(`blur`,Sk,!1),typeof PointerEvent<`u`?(r.removeEventListener(`pointerdown`,yk,!0),r.removeEventListener(`pointermove`,yk,!0),r.removeEventListener(`pointerup`,yk,!0)):(r.removeEventListener(`mousedown`,yk,!0),r.removeEventListener(`mousemove`,yk,!0),r.removeEventListener(`mouseup`,yk,!0)),mk.delete(n))};function Tk(e){let t=UT(e);if(fk===`virtual`){let n=t.activeElement;(function(e){requestAnimationFrame(()=>{XT.size===0?e():ZT.add(e)})})(()=>{t.activeElement===n&&e.isConnected&&KT(e)})}else KT(e)}function Ek(e,t){return e.nodeName!==`#comment`&&function(e){let t=WT(e);if(!(e instanceof t.HTMLElement||e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!==`none`&&r!==`hidden`&&r!==`collapse`;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}(e)&&function(e,t){return!e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-react-aria-prevent-focus`)&&(e.nodeName!==`DETAILS`||!t||t.nodeName===`SUMMARY`||e.hasAttribute(`open`))}(e,t)&&(!e.parentElement||Ek(e.parentElement,e))}typeof document<`u`&&function(e){let t=UT(e),n;t.readyState===`loading`?(n=()=>{Ck(e)},t.addEventListener(`DOMContentLoaded`,n)):Ck(e)}();var Dk=s.default.createContext(null),Ok=null;function kk(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,a=(0,s.useRef)(null),o=(0,s.useRef)(null),c=(0,s.useRef)([]),{parentNode:l}=(0,s.useContext)(Dk)||{},u=(0,s.useMemo)(()=>new Uk({scopeRef:c}),[c]);PT(()=>{let e=l||Wk.root;if(Wk.getTreeNode(e.scopeRef)&&Ok&&!Rk(Ok,e.scopeRef)){let t=Wk.getTreeNode(Ok);t&&(e=t)}e.addChild(u),Wk.addNode(u)},[u,l]),PT(()=>{let e=Wk.getTreeNode(c);e&&(e.contain=!!n)},[n]),PT(()=>{let e=a.current?.nextSibling,t=[];for(;e&&e!==o.current;)t.push(e),e=e.nextSibling;c.current=t},[t]),function(e,t,n){PT(()=>{if(t||n)return;let r=e.current,i=UT(r?r[0]:void 0),a=t=>{let n=t.target;Ik(n,e.current)?Ok=e:Fk(n)||(Ok=null)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,n])}(c,r,n),function(e,t){let n=(0,s.useRef)(),r=(0,s.useRef)();PT(()=>{let i=e.current;if(!t)return void(r.current&&=(cancelAnimationFrame(r.current),void 0));let a=UT(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!Pk(e)||t.isComposing)return;let n=a.activeElement,r=e.current;if(!r||!Ik(n,r))return;let i=Vk(Nk(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let o=t.shiftKey?i.previousNode():i.nextNode();o||=(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),o&&zk(o,!0)},s=t=>{Ok&&!Rk(Ok,e)||!Ik(t.target,e.current)?Pk(e)&&!Lk(t.target,e)?n.current?n.current.focus():Ok&&Ok.current&&Bk(Ok.current):Pk(e)&&(n.current=t.target):(Ok=e,n.current=t.target)},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{if(a.activeElement&&Pk(e)&&!Lk(a.activeElement,e))if(Ok=e,a.body.contains(t.target)){var r;n.current=t.target,(r=n.current)==null||r.focus()}else Ok.current&&Bk(Ok.current)})};return a.addEventListener(`keydown`,o,!1),a.addEventListener(`focusin`,s,!1),i?.forEach(e=>e.addEventListener(`focusin`,s,!1)),i?.forEach(e=>e.addEventListener(`focusout`,c,!1)),()=>{a.removeEventListener(`keydown`,o,!1),a.removeEventListener(`focusin`,s,!1),i?.forEach(e=>e.removeEventListener(`focusin`,s,!1)),i?.forEach(e=>e.removeEventListener(`focusout`,c,!1))}},[e,t]),PT(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}(c,n),function(e,t,n){let r=(0,s.useRef)(typeof document<`u`?UT(e.current?e.current[0]:void 0).activeElement:null);PT(()=>{let r=e.current,i=UT(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!Ok||Rk(Ok,e))&&Ik(i.activeElement,e.current)&&(Ok=e)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,n]),PT(()=>{let r=UT(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!Pk(e)||t.isComposing)return;let n=r.activeElement;if(!Ik(n,e.current))return;let i=Wk.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=Vk(r.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!r.body.contains(a)||a===r.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!Ik(s,e.current))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(Ik(s,e.current));t.preventDefault(),t.stopPropagation(),s?zk(s,!0):Fk(a)?zk(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),PT(()=>{let n=UT(e.current?e.current[0]:void 0);if(!t)return;let i=Wk.getTreeNode(e);return i?(i.nodeToRestore=r.current??void 0,()=>{let r=Wk.getTreeNode(e);if(!r)return;let i=r.nodeToRestore;if(t&&i&&(Ik(n.activeElement,e.current)||n.activeElement===n.body&&function(e){let t=Wk.getTreeNode(Ok);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}(e))){let t=Wk.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected)return void zk(n.nodeToRestore);n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&Wk.getTreeNode(n.scopeRef))return void Bk(n.scopeRef.current,!0);n=n.parent}}})}}):void 0},[e,t])}(c,r,n),function(e,t){let n=s.default.useRef(t);(0,s.useEffect)(()=>{n.current&&(Ok=e,!Ik(UT(e.current?e.current[0]:void 0).activeElement,Ok.current)&&e.current&&Bk(e.current)),n.current=!1},[e])}(c,i),(0,s.useEffect)(()=>{let e=UT(c.current?c.current[0]:void 0).activeElement,t=null;if(Ik(e,c.current)){for(let n of Wk.traverse())n.scopeRef&&Ik(e,n.scopeRef.current)&&(t=n);t===Wk.getTreeNode(c)&&(Ok=t.scopeRef)}},[c]),PT(()=>()=>{var e,t;let n=((t=Wk.getTreeNode(c))==null||(e=t.parent)==null?void 0:e.scopeRef)??null;(c===Ok||Rk(c,Ok))&&(!n||Wk.getTreeNode(n))&&(Ok=n),Wk.removeTreeNode(c)},[c]);let d=(0,s.useMemo)(()=>function(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||UT(n[0]).activeElement,c=n[0].previousElementSibling,l=Vk(Nk(n),{tabbable:i,accept:o},n);l.currentNode=Ik(s,n)?s:c;let u=l.nextNode();return!u&&a&&(l.currentNode=c,u=l.nextNode()),u&&zk(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||UT(n[0]).activeElement,c=n[n.length-1].nextElementSibling,l=Vk(Nk(n),{tabbable:i,accept:o},n);l.currentNode=Ik(s,n)?s:c;let u=l.previousNode();return!u&&a&&(l.currentNode=c,u=l.previousNode()),u&&zk(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Vk(Nk(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&zk(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Vk(Nk(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&zk(o,!0),o}}}(c),[]),f=(0,s.useMemo)(()=>({focusManager:d,parentNode:u}),[u,d]);return s.default.createElement(Dk.Provider,{value:f},s.default.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,s.default.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:o}))}var Ak=[`input:not([disabled]):not([type=hidden])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]`],jk=Ak.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;Ak.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);var Mk=Ak.join(`:not([hidden]):not([tabindex="-1"]),`);function Nk(e){return e[0].parentElement}function Pk(e){let t=Wk.getTreeNode(Ok);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Fk(e){return Lk(e)}function Ik(e,t){return!(!e||!t)&&t.some(t=>t.contains(e))}function Lk(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of Wk.traverse(Wk.getTreeNode(t)))if(n&&Ik(e,n.current))return!0;return!1}function Rk(e,t){let n=Wk.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function zk(e,t=!1){if(e==null||t){if(e!=null)try{e.focus()}catch{}}else try{Tk(e)}catch{}}function Bk(e,t=!0){let n=e[0].previousElementSibling,r=Nk(e),i=Vk(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();t&&!a&&(r=Nk(e),i=Vk(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),zk(a)}function Vk(e,t,n){let r=t!=null&&t.tabbable?Mk:jk,i=UT(e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var i;return t!=null&&(i=t.from)!=null&&i.contains(e)?NodeFilter.FILTER_REJECT:!e.matches(r)||!Ek(e)||n&&!Ik(e,n)||t!=null&&t.accept&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return t!=null&&t.from&&(i.currentNode=t.from),i}var Hk=class e{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new Uk({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&Ik(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let t=new e;for(let e of this.traverse())t.addTreeNode(e.scopeRef,e.parent?.scopeRef??null,e.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new Uk({scopeRef:null}),this.fastMap.set(null,this.root)}},Uk=class{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}},Wk=new Hk;function Gk(){let{width:e,height:t}=function(){let e=zT(),[t,n]=(0,s.useState)(()=>e?{width:0,height:0}:nE());return(0,s.useEffect)(()=>{let e=()=>{n(e=>{let t=nE();return t.width===e.width&&t.height===e.height?e:t})};return tE?tE.addEventListener(`resize`,e):window.addEventListener(`resize`,e),()=>{tE?tE.removeEventListener(`resize`,e):window.removeEventListener(`resize`,e)}},[]),t}();return{"--be-viewport-height":`${t}px`,"--be-viewport-width":`${e}px`}}var Kk={initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:`tween`,duration:.125}},qk=(0,s.forwardRef)(({children:e,style:t,autoFocus:n=!1,restoreFocus:r=!0,isDismissable:i,isContextMenu:a,isOpen:o,onClose:c,triggerRef:u,arrowRef:d,arrowStyle:f,onPointerLeave:p,onPointerEnter:m},h)=>{let g=Gk(),_=eE(h),{domProps:v}=function({onClose:e,isDismissable:t=!0,triggerRef:n,isContextMenu:r=!1},i){let a=(0,s.useRef)({isPointerDown:!1,isContextMenu:r,onClose:e}),o=a.current;o.isContextMenu=r,o.onClose=e;let c=(0,s.useCallback)(e=>{let t=e.target;if(t){let e=t.ownerDocument;if(!e||!e.documentElement.contains(t))return!1}return i.current&&!i.current.contains(t)},[i]),l=(0,s.useCallback)(()=>Jk[Jk.length-1]===i,[i]),u=(0,s.useCallback)(()=>{l()&&o.onClose()},[l,o]),d=(0,s.useCallback)(e=>{var t;return!(!n.current||!(`contains`in n.current))&&(t=n.current).contains?.call(t,e)},[n]),f=(0,s.useCallback)(e=>{d(e.target)||l()&&(e.stopPropagation(),e.preventDefault())},[d,l]),p=(0,s.useCallback)(e=>{d(e.target)||(l()&&(e.stopPropagation(),e.preventDefault()),(!o.isContextMenu||e.button!==2)&&u())},[d,u,o,l]);return(0,s.useEffect)(()=>{Jk.push(i);let e=e=>{c(e)&&(f(e),a.current.isPointerDown=!0)},t=e=>{a.current.isPointerDown&&c(e)&&(a.current.isPointerDown=!1,p(e))},r=e=>{e.preventDefault(),c(e)&&u()},s=e=>{if(!n.current)return;let t=e.target,r;n.current instanceof Node?r=n.current:`contextElement`in n.current&&(r=n.current.contextElement),(!(t instanceof Node)||!r||t.contains(r))&&o.onClose()};return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`pointerup`,t,!0),document.addEventListener(`contextmenu`,r,!0),document.addEventListener(`scroll`,s,!0),()=>{let n=Jk.indexOf(i);n>=0&&Jk.splice(n,1),document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`pointerup`,t,!0),document.removeEventListener(`contextmenu`,r,!0),document.removeEventListener(`scroll`,s,!0)}},[i,c,o,p,f,n,d,u]),{domProps:{onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),e.preventDefault(),u())}}}}({isDismissable:i,onClose:c,triggerRef:u,isContextMenu:a},_);return(0,l.jsx)(CT.div,{className:`isolate z-popover`,role:`presentation`,ref:_,style:{...g,...t,position:`fixed`},...Kk,...GT(v,{onPointerLeave:p,onPointerEnter:m}),children:(0,l.jsx)(kk,{restoreFocus:r,autoFocus:n,contain:!1,children:e})})}),Jk=[],Yk={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}};function Xk({position:e=`absolute`,className:t,isTransparent:n=!1,disableInitialTransition:r,...i}){return(0,l.jsx)(CT.div,{...i,className:K(t,!n&&`bg-background/80`,`inset-0 z-10 h-full w-full`,e,`backdrop-blur-sm`),"aria-hidden":!0,initial:r?void 0:{opacity:0},animate:{opacity:1},exit:{opacity:0},...Yk,transition:{duration:.15}})}var Zk=(0,s.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:n=!0,isDismissable:r,isOpen:i,onClose:a},o)=>{let s=Gk(),c=eE(o);return(0,l.jsxs)(`div`,{className:`fixed inset-0 isolate z-tray`,style:s,children:[(0,l.jsx)(Xk,{onClick:()=>{r&&a()}},`tray-underlay`),(0,l.jsx)(CT.div,{ref:c,className:`absolute bottom-0 left-0 right-0 z-20 mx-auto max-h-tray w-full max-w-375 overflow-hidden rounded-t pb-safe-area`,role:`presentation`,initial:{opacity:0,y:`100%`},animate:{opacity:1,y:0},exit:{opacity:0,y:`100%`},transition:{type:`tween`,duration:.2},children:(0,l.jsx)(kk,{restoreFocus:n,autoFocus:t,contain:!0,children:e})})]})});function Qk(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(let r=0;r<i;r++){let i=n[r];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0}function $k(){let{i18n:e}=Cb(e=>e.data);return{locale:e,localeCode:e?.language||`en`,lines:e?.lines}}function eA(e,{message:t,values:n}){let r=t.match(/\[(.+?)]/),i=n?.count;if(r&&r[1]&&!Number.isNaN(i)){let[n,a]=r,o=a.split(`|`);if(!o.length)return t;let s=tA(e).select(i),c=o.find(e=>e.startsWith(s));c||=o[0];let l=c.substring(c.indexOf(` `)+1);return t.replace(n,l)}return t}var tA=WD(e=>new Intl.PluralRules(e));function nA(e,t){return e!=null&&(Object.hasOwn===void 0?Object.hasOwnProperty(t):Object.hasOwn(e,t))}var rA=(0,s.memo)(e=>{let{message:t,values:n}=e,{lines:r,localeCode:i}=$k(),a;if(a=nA(r,t)?r?.[t]:nA(r,t?.toLowerCase())?r?.[t?.toLowerCase()]:t,!n||!a)return(0,l.jsx)(s.Fragment,{children:a});a=eA(i,{message:a,values:n});let o=[],c=[];if(Object.entries(n).forEach(([e,t])=>{typeof t==`function`?c.push(e):(0,s.isValidElement)(t)?o.push(e):t!=null&&(a=a?.replace(`:${e}`,`${t}`))}),c.length||o.length){let e=[];if(c.length){let t=c.join(``);e.push(`(<[${t}]>.+?<\\/[${t}]>)`)}if(o.length){let t=o.join(`|`);e.push(`(:(?:${t}))`)}let t=new RegExp(e.join(`|`),`gm`);return(0,l.jsx)(s.Fragment,{children:a.split(t).filter(Boolean).map((e,t)=>{if(e.startsWith(`<`)&&e.endsWith(`>`)){let r=e.match(/<([a-z]+)>(.+?)<\/([a-z]+)>/);if(r){let[,e,i]=r,a=n?.[e];if(typeof a==`function`)return(0,s.cloneElement)(a(i),{key:t})}}if(e.startsWith(`:`)){let r=e.replace(`:`,``),i=n?.[r];if((0,s.isValidElement)(i))return(0,s.cloneElement)(i,{key:t})}return e})})}return(0,l.jsx)(s.Fragment,{children:a})},function(e,t){let{values:n,...r}=e,{values:i,...a}=t;return Qk(i,n)&&Qk(r,a)});function iA({listbox:e,children:t,isLoading:n,mobileOverlay:r=Zk,searchField:i,onClose:a,prepend:o,className:u,...d}){let f=dk(),{floatingWidth:p,floatingMinWidth:m=`min-w-180`,collection:h,showEmptyMessage:g,state:{isOpen:_,setIsOpen:v},positionStyle:y,floating:b,refs:x}=e,S=!o&&f?r:qk,C=K(`text-base sm:text-sm outline-none bg max-h-inherit flex flex-col`,!o&&`shadow-xl border py-4`,u,S===qk&&`rounded-panel`,S===qk&&p===`auto`?`max-w-288 ${m}`:``),w=(0,s.useMemo)(()=>{let e=0,t=[];return[...h.values()].reduce((n,r)=>{if(r.section){if(!t.includes(r.section)){let i=(0,s.cloneElement)(r.section,{key:r.section.key||e,index:e});n.push(i),t.push(r.section),e++}}else n.push((0,s.cloneElement)(r.element,{key:r.element.key||r.element.props.value}));return n},[])},[h]),T=w.length>0||g&&!n,E=T?(0,l.jsxs)(`div`,{className:C,role:`presentation`,children:[i,(0,l.jsx)(aA,{isLoading:n,...d,children:w})]}):null;return(0,l.jsxs)(LD.Provider,{value:e,children:[t,o?E:bb&&(0,c.createPortal)((0,l.jsx)(AT,{children:_&&T&&(0,l.jsx)(S,{triggerRef:x.reference,restoreFocus:!0,isOpen:_,onClose:()=>{a?.(),v(!1)},isDismissable:!0,style:y,ref:b,children:E})}),bb)]})}function aA({className:e,children:t,isLoading:n,...r}){let{role:i,listboxId:a,virtualFocus:o,focusItem:c,state:{activeIndex:u,setActiveIndex:d,selectedIndex:f}}=RD(),p=(0,s.useRef)(!0),m=(0,s.useRef)(null);return(0,s.useEffect)(()=>()=>d(null),[d]),(0,s.useEffect)(()=>{if(p.current){let e=u??f;e!=null||o?e!=null&&requestAnimationFrame(()=>{c(`increment`,e)}):requestAnimationFrame(()=>{var e;(e=m.current)==null||e.focus({preventScroll:!0})})}p.current=!1},[u,f,c,o]),(0,l.jsx)(`div`,{tabIndex:o?void 0:-1,role:i,id:a,className:`flex-auto overflow-y-auto overscroll-contain outline-none`,ref:m,...r,children:t.length?t:(0,l.jsx)(oA,{})})}function oA(){return(0,l.jsx)(`div`,{className:`px-8 py-4 text-sm italic text-muted`,children:(0,l.jsx)(rA,{message:`There are no items matching your query`})})}function sA({state:{isOpen:e,setIsOpen:t,selectedIndex:n,activeIndex:r,setInputValue:i,setActiveIndex:a},focusLoopingMode:o,collection:s,focusItem:c,handleItemSelection:l,allowCustomValue:u}){let d=r=>{if(!e&&r.currentTarget.contains(r.target)){if(r.key===`ArrowDown`)return r.preventDefault(),t(!0),c(`increment`,n??0),!0;if(r.key===`ArrowUp`)return r.preventDefault(),t(!0),c(`decrement`,n??s.size-1),!0;if(r.key===`Enter`||r.key===`Space`)return r.preventDefault(),t(!0),c(`increment`,n??0),!0}},f=n=>{let i=Math.max(0,s.size-1);if(e&&n.currentTarget.contains(n.target))switch(n.key){case`ArrowDown`:return n.preventDefault(),r==null?c(`increment`,0):r>=i?o===`loop`?c(`increment`,0):o===`deselect`&&a(null):c(`increment`,r+1),!0;case`ArrowUp`:return n.preventDefault(),r==null?c(`decrement`,i):r<=0?o===`loop`?c(`decrement`,i):o===`deselect`&&a(null):c(`decrement`,r-1),!0;case`Home`:return n.preventDefault(),c(`increment`,0),!0;case`End`:return n.preventDefault(),c(`decrement`,i),!0;case`Tab`:return t(!1),!0}};return{handleTriggerKeyDown:d,handleListboxKeyboardNavigation:f,handleListboxSearchFieldKeydown:n=>{var a,o;if(n.key===`Enter`&&r!=null&&s.size){n.preventDefault();let[e,t]=[...s.entries()][r];e&&(l(e),(o=(a=t.element.props).onSelected)==null||o.call(a));return}n.key===`Escape`&&e&&(t(!1),u||i(``)),d(n)||f(n)}}}var cA=new Map;function lA(){let e=function(e){let{localeCode:t}=$k(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(cA.has(n))return cA.get(n);let r=new Intl.Collator(t,e);return cA.set(n,r),r}({usage:`search`,sensitivity:`base`}),t=(0,s.useRef)({search:``,timeout:void 0}).current,n=(n,r)=>{let i=r??0;for(;i!=null;){let r=n[i]?.slice(0,t.search.length);if(r&&e.compare(r,t.search)===0)return i;if(!(i<n.length-1))return null;i++}return null};return{findMatchingItem:(e,r,i=0)=>{let a=function(e){return e.length!==1&&/^[A-Z]/i.test(e)?``:e}(e.key);if(!a||e.ctrlKey||e.metaKey)return null;a===` `&&t.search.trim().length>0&&(e.preventDefault(),e.stopPropagation()),t.search+=a;let o=n(r,i);return o??=n(r,0),clearTimeout(t.timeout),t.timeout=setTimeout(()=>{t.search=``},500),o??null}}}function uA(e){return function(e,{noSSR:t}={noSSR:!0}){let n=typeof window<`u`&&typeof window.matchMedia==`function`,[r,i]=(0,s.useState)(t?()=>!!n&&window.matchMedia(e).matches:null);return(0,s.useEffect)(()=>{if(!n)return;let r=window.matchMedia(e),a=()=>{i(r.matches)};return r.addEventListener(`change`,a),t||a(),()=>{r.removeEventListener(`change`,a)}},[n,e,t]),typeof window>`u`?null:r}(`(max-width: 768px)`,e)}var dA=q((0,l.jsx)(`path`,{d:`M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z`}),`SearchOutlined`),fA=e=>e==null,pA=e=>!fA(e)&&!Array.isArray(e)&&(e=>typeof e==`object`)(e)&&!(e=>e instanceof Date)(e),mA=e=>pA(e)&&e.target?(e=>e.type===`checkbox`)(e.target)?e.target.checked:e.target.value:e,hA=typeof window<`u`&&typeof window.HTMLElement<`u`&&typeof document<`u`;function gA(e){let t,n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(hA&&(e instanceof Blob||e instanceof FileList)||!n&&!pA(e))return e;if(t=n?[]:{},n||(e=>{let t=e.constructor&&e.constructor.prototype;return pA(t)&&t.hasOwnProperty(`isPrototypeOf`)})(e))for(let n in e)e.hasOwnProperty(n)&&(t[n]=gA(e[n]));else t=e}return t}var _A=e=>Array.isArray(e)?e.filter(Boolean):[],vA=e=>e===void 0,yA=(e,t,n)=>{if(!t||!pA(e))return n;let r=_A(t.split(/[,[\].]+?/)).reduce((e,t)=>fA(e)?e:e[t],e);return vA(r)||r===e?vA(e[t])?n:e[t]:r},bA=e=>typeof e==`boolean`,xA=(e,t,n)=>{let r=-1,i=(e=>/^\w*$/.test(e))(t)?[t]:(e=>_A(e.replace(/["|']|\]/g,``).split(/\.|\[/)))(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=pA(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(t===`__proto__`)return;e[t]=a,e=e[t]}return e},SA=`blur`,CA=`change`,wA=`all`,TA=s.default.createContext(null),EA=()=>s.default.useContext(TA),DA=(e,t,n,r)=>{n(e);let{name:i,...a}=e;return(e=>pA(e)&&!Object.keys(e).length)(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>!0===t[e])},OA=(e,t,n)=>!e||!t||e===t||(e=>Array.isArray(e)?e:[e])(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e)));function kA(e){let t=s.default.useRef(e);t.current=e,s.default.useEffect(()=>{let n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function AA(e){let t=EA(),{control:n=t.control,disabled:r,name:i,exact:a}=e||{},[o,c]=s.default.useState(n._formState),l=s.default.useRef(!0),u=s.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=s.default.useRef(i);return d.current=i,kA({disabled:r,next:e=>l.current&&OA(d.current,e.name,a)&&DA(e,u.current,n._updateFormState)&&c({...n._formState,...e}),subject:n._subjects.state}),s.default.useEffect(()=>(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),((e,t,n,r=!0)=>{let i={defaultValues:t._defaultValues};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==wA&&(t._proxyFormState[i]=!r||wA),n&&(n[i]=!0),e[i]}});return i})(o,n,u.current,!1)}function jA(e){let t=EA(),{control:n=t.control,name:r,defaultValue:i,disabled:a,exact:o}=e||{},c=s.default.useRef(r);c.current=r,kA({disabled:a,subject:n._subjects.values,next:e=>{OA(c.current,e.name,o)&&u(gA(((e,t,n,r,i)=>(e=>typeof e==`string`)(e)?yA(n,e,i):Array.isArray(e)?e.map(e=>yA(n,e)):n)(c.current,n._names,e.values||n._formValues,0,i)))}});let[l,u]=s.default.useState(n._getWatch(r,i));return s.default.useEffect(()=>n._removeUnmounted()),l}function MA(e={}){let{size:t=`md`,startAppend:n,endAppend:r,className:i,labelPosition:a,labelDisplay:o=`block`,inputClassName:s,inputWrapperClassName:c,unstyled:l,invalid:u,disabled:d,background:f=`bg-transparent`,flexibleHeight:p,inputShadow:m=`shadow-sm`,descriptionPosition:h=`bottom`,inputRing:g,inputFontSize:_,labelSuffix:v}={...e};if(l)return{label:``,input:s||``,wrapper:i||``,inputWrapper:c||``,adornment:``,append:{size:``,radius:``},size:{font:``,height:``},description:``,error:``};let y=function({size:e,flexibleHeight:t}){switch(e){case`2xs`:return{font:`text-xs`,height:t?`min-h-24`:`h-24`};case`xs`:return{font:`text-xs`,height:t?`min-h-30`:`h-30`};case`sm`:return{font:`text-sm`,height:t?`min-h-36`:`h-36`};case`lg`:return{font:`text-md md:text-lg`,height:t?`min-h-50`:`h-50`};case`xl`:return{font:`text-xl`,height:t?`min-h-60`:`h-60`};default:return{font:`text-sm`,height:t?`min-h-42`:`h-42`}}}({size:e.size,flexibleHeight:p});_&&(y.font=_);let b=n||r,x=g||`focus:ring `+(u?`focus:ring-danger/focus focus:border-danger/60`:`focus:ring-primary/focus focus:border-primary/60`),S=function(e){let{startAppend:t,endAppend:n,inputRadius:r}=e,i=t||n;return r===`rounded-full`?{input:K(!i&&`rounded-full`,t&&`rounded-r-full rounded-l-none`,n&&`rounded-l-full rounded-r-none`),append:t?`rounded-l-full`:`rounded-r-full`}:r===`rounded-none`?{input:``,append:``}:r?{input:r,append:r}:{input:K(!i&&`rounded-input`,t&&`rounded-r-input rounded-l-none`,n&&`rounded-l-input rounded-r-none`),append:t?`rounded-l-input`:`rounded-r-input`}}(e);return{label:K(o,`first-letter:capitalize text-left whitespace-nowrap`,d&&`text-disabled`,y.font,v?``:a===`side`?`mr-16`:`mb-4`),input:K(`block text-left relative w-full appearance-none transition-shadow text`,f,S.input,NA(e),!d&&`${x} focus:outline-none ${m}`,d&&`text-disabled cursor-not-allowed`,s,y.font,y.height,PA(e)),adornment:FA(t),append:{size:jD(t),radius:S.append},wrapper:K(i,y.font,{"flex items-center":a===`side`}),inputWrapper:K(`isolate relative`,c,b&&`flex items-stretch`),size:y,description:`text-muted ${h===`bottom`?`pt-10`:`pb-10`} text-xs`,error:`text-danger pt-10 text-xs`}}function NA({startAppend:e,endAppend:t,inputBorder:n,invalid:r}){if(n)return n;let i=r?`border-danger`:`border-divider`;return e||t?e?`${i} border-y border-r`:`${i} border-y border-l`:`${i} border`}function PA({startAdornment:e,endAdornment:t,inputRadius:n}){return n===`rounded-full`?K(e?`pl-54`:`pl-28`,t?`pr-54`:`pr-28`):K(e?`pl-46`:`pl-12`,t?`pr-46`:`pr-12`)}function FA(e){switch(e){case`2xs`:return`icon-2xs`;case`xs`:return`icon-xs`;case`sm`:case`md`:return`icon-sm`;case`lg`:return`icon-lg`;case`xl`:return`icon-xl`;default:return``}}function IA({children:e,direction:t,className:n,position:r=t===`start`?`left-0`:`right-0`}){return e?(0,l.jsx)(`div`,{className:K(`pointer-events-none absolute top-0 z-10 flex h-full min-w-42 items-center justify-center text-muted`,r,n),children:e}):null}function LA(e,t){let n={...e};return Object.keys(n).forEach(e=>{let t=e;(n[t]==null||n[t]===``)&&delete n[t]}),n}var RA=s.default.forwardRef((e,t)=>{let{children:n,description:r,errorMessage:i,descriptionProps:a={},errorMessageProps:o={},startAdornment:s,endAdornment:c,adornmentPosition:u,startAppend:d,endAppend:f,fieldClassNames:p,disabled:m,wrapperProps:h}=e;return(0,l.jsxs)(`div`,{className:p.wrapper,ref:t,...h,children:[(0,l.jsx)(zA,{...e}),(0,l.jsxs)(`div`,{className:p.inputWrapper,children:[(0,l.jsx)(IA,{direction:`start`,className:p.adornment,position:u,children:s}),d&&(0,l.jsx)(BA,{style:p.append,disabled:m,children:d}),n,f&&(0,l.jsx)(BA,{style:p.append,disabled:m,children:f}),(0,l.jsx)(IA,{direction:`end`,className:p.adornment,position:u,children:c})]}),r&&!i&&(0,l.jsx)(`div`,{className:p.description,...a,children:r}),i&&(0,l.jsx)(`div`,{className:p.error,...o,children:i})]})});function zA({labelElementType:e,fieldClassNames:t,labelProps:n,label:r,labelSuffix:i,labelSuffixPosition:a=`spaced`,required:o}){if(!r)return null;let s=(0,l.jsxs)(e||`label`,{className:t.label,...n,children:[r,o&&(0,l.jsx)(`span`,{className:`text-danger`,children:` *`})]});return i?(0,l.jsxs)(`div`,{className:K(`mb-4 flex w-full gap-4`,a===`spaced`?`items-end`:`items-center`),children:[s,(0,l.jsx)(`div`,{className:K(`text-xs text-muted`,a===`spaced`?`ml-auto`:``),children:i})]}):s}function BA({children:e,style:t,disabled:n}){return s.default.cloneElement(e,{...e.props,disabled:e.props.disabled||n,...LA(t)})}function VA({autoFocus:e,autoSelectText:t},n){let r=(0,s.useRef)(e);(0,s.useEffect)(()=>{r.current&&n.current&&requestAnimationFrame(()=>{var e;(e=n.current)==null||e.focus(),t&&n.current?.nodeName.toLowerCase()===`input`&&n.current.select()}),r.current=!1},[n,t])}function HA(e){let{focusRef:t,labelElementType:n=`label`,label:r,labelSuffix:i,labelSuffixPosition:a,autoFocus:o,autoSelectText:c,labelPosition:l,descriptionPosition:u,size:d,errorMessage:f,description:p,flexibleHeight:m,startAdornment:h,endAdornment:g,startAppend:_,adornmentPosition:v,endAppend:y,className:b,inputClassName:x,inputWrapperClassName:S,unstyled:C,background:w,invalid:T,disabled:E,id:D,inputRadius:O,inputBorder:k,inputShadow:A,inputRing:j,inputFontSize:M,...N}=e;VA(e,t);let P=(0,s.useId)(),F=D||P,I={id:`${F}-label`,htmlFor:n===`label`?F:void 0},L={id:`${F}-description`},R={id:`${F}-error`},z={"aria-label":e.label||e[`aria-label`]||!e.placeholder?e[`aria-label`]:e.placeholder,"aria-invalid":T||void 0,id:F,disabled:E,...N},ee=[];r&&ee.push(I.id),z[`aria-labelledby`]&&ee.push(z[`aria-labelledby`]),z[`aria-labelledby`]=ee.length?ee.join(` `):void 0;let B=[];return p&&B.push(L.id),f&&B.push(R.id),z[`aria-describedby`]&&B.push(z[`aria-describedby`]),z[`aria-describedby`]=B.length?B.join(` `):void 0,{fieldProps:{errorMessageProps:R,descriptionProps:L,labelProps:I,disabled:E,label:r,labelSuffix:i,labelSuffixPosition:a,autoFocus:o,autoSelectText:c,labelPosition:l,descriptionPosition:u,size:d,errorMessage:f,description:p,flexibleHeight:m,startAdornment:h,endAdornment:g,startAppend:_,adornmentPosition:v,endAppend:y,className:b,inputClassName:x,inputWrapperClassName:S,unstyled:C,background:w,invalid:T},inputProps:z}}var UA=(0,s.forwardRef)(({inputElementType:e=`input`,flexibleHeight:t,inputRef:n,inputTestId:r,...i},a)=>{let o=eE(n),{fieldProps:s,inputProps:c}=HA({...i,focusRef:o}),u=e===`textarea`,d=u?`textarea`:`input`,f=MA({...i,flexibleHeight:t||e===`textarea`});return e===`textarea`&&!i.unstyled&&(f.input=`${f.input} py-12`),(0,l.jsx)(RA,{ref:a,fieldClassNames:f,...s,children:(0,l.jsx)(d,{"data-testid":r,ref:o,...c,rows:u?c.rows||4:void 0,className:f.input})})});s.default.forwardRef(({name:e,...t},n)=>{let{field:{onChange:r,onBlur:i,value:a=``,ref:o},fieldState:{invalid:c,error:u}}=function(e){let t=EA(),{name:n,disabled:r,control:i=t.control,shouldUnregister:a}=e,o=((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(i._names.array,n),c=jA({control:i,name:n,defaultValue:yA(i._formValues,n,yA(i._defaultValues,n,e.defaultValue)),exact:!0}),l=AA({control:i,name:n}),u=s.default.useRef(i.register(n,{...e.rules,value:c,...bA(e.disabled)?{disabled:e.disabled}:{}}));return s.default.useEffect(()=>{let e=i._options.shouldUnregister||a,t=(e,t)=>{let n=yA(i._fields,e);n&&(n._f.mount=t)};if(t(n,!0),e){let e=gA(yA(i._options.defaultValues,n));xA(i._defaultValues,n,e),vA(yA(i._formValues,n))&&xA(i._formValues,n,e)}return()=>{(o?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,o,a]),s.default.useEffect(()=>{yA(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:yA(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:c,...bA(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:s.default.useCallback(e=>u.current.onChange({target:{value:mA(e),name:n},type:CA}),[n]),onBlur:s.default.useCallback(()=>u.current.onBlur({target:{value:yA(i._formValues,n),name:n},type:SA}),[n,i]),ref:e=>{let t=yA(i._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!yA(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!yA(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!yA(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!yA(l.validatingFields,n)},error:{enumerable:!0,get:()=>yA(l.errors,n)}})}}({name:e});return(0,l.jsx)(UA,{ref:n,...GT({onChange:r,onBlur:i,value:a??``,invalid:c,errorMessage:u?.message,inputRef:o,name:e},t)})});var WA=(0,s.forwardRef)((e,t)=>{let{searchPlaceholder:n,showSearchField:r,children:[i,a],floatingWidth:o=`auto`,isLoading:c}=e,u=(0,s.useId)(),d=uA(),f=uk({...e,clearInputOnItemSelection:!0,showEmptyMessage:r,floatingWidth:d?`auto`:o,virtualFocus:r,role:r?`listbox`:`menu`,focusLoopingMode:r?`stay`:`loop`,children:a.props.children},t),{state:{isOpen:p,setIsOpen:m,activeIndex:h,inputValue:g,setInputValue:_},listboxId:v,focusItem:y,listContent:b,reference:x,onInputChange:S}=f,{handleTriggerKeyDown:C,handleListboxKeyboardNavigation:w,handleListboxSearchFieldKeydown:T}=sA(f),{findMatchingItem:E}=lA();return(0,l.jsx)(iA,{onClick:e=>e.stopPropagation(),listbox:f,onKeyDownCapture:r?void 0:e=>{if(!p)return;let t=E(e,b,h);t!=null&&y(`increment`,t)},onKeyDown:w,onClose:r?()=>_(``):void 0,"aria-labelledby":u,isLoading:c,searchField:r?(0,l.jsx)(UA,{size:`sm`,placeholder:n,startAdornment:(0,l.jsx)(dA,{}),className:`flex-shrink-0 px-8 pb-8 pt-4`,autoFocus:!0,"aria-expanded":p?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":p?v:void 0,"aria-autocomplete":`list`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,value:g,onChange:S,onKeyDown:e=>{T(e)}}):null,children:(0,s.cloneElement)(i,{id:u,"aria-expanded":p?`true`:`false`,"aria-haspopup":`menu`,"aria-controls":p?v:void 0,ref:x,onKeyDown:C,onClick:ND(e=>{var t,n;(n=(t=i.props)?.onClick)==null||n.call(t,e),m(!p)})})})});function GA({children:e}){return e}function KA({item:e,button:t}){return(0,l.jsxs)(WA,{children:[t,(0,l.jsx)(GA,{children:(e.menuItems||[]).map(e=>(0,l.jsx)(HD,{value:e.label,onSelected:()=>{e.action(X().editor)},children:e.label},e.label))})]})}var qA=(0,s.forwardRef)(({children:e,size:t=`md`,iconSize:n=t&&t.length<=3?t:`md`,variant:r=`text`,radius:i=`rounded-button`,className:a,padding:o,equalWidth:c=!0,badge:u,...d},f)=>{let p=K(jD(t,{padding:o,equalWidth:c,variant:r}),a,u&&`relative`);return(0,l.jsxs)(PD,{...d,ref:f,radius:i,variant:r,className:p,children:[(0,s.cloneElement)(e,{size:n}),u]})}),JA=s.default.memo(function({icon:e,className:t,size:n}){let r;return r=s.default.isValidElement(e)?s.default.cloneElement(e,{className:`svg-iconEl`}):typeof e==`string`?(0,l.jsx)(`img`,{className:`w-font h-font`,src:e,alt:``}):Array.isArray(e)?s.default.createElement(g_(e),{size:n}):s.default.createElement(e,{size:n}),(0,l.jsx)(`span`,{className:K(t,`leading-none`),children:r})});function YA({value:e}){return e?(0,l.jsx)(rA,typeof e==`string`?{message:e}:{...e}):null}function XA({item:e}){let t=e.label?(0,l.jsx)(QA,{item:e}):(0,l.jsx)(ZA,{item:e});return e.menuItems?(0,l.jsx)(KA,{item:e,button:t}):s.default.cloneElement(t,{onClick:()=>{var t;(t=e.action)==null||t.call(e,X().editor)}})}var ZA=(0,s.forwardRef)(({item:e,...t},n)=>(0,l.jsx)(qA,{ref:n,radius:`rounded-full`,size:`sm`,...t,children:(0,l.jsx)(JA,{icon:e.icon})})),QA=(0,s.forwardRef)(({item:e,...t},n)=>(0,l.jsx)(FD,{ref:n,radius:`rounded-full`,size:`xs`,color:e.buttonColor||`primary`,variant:e.buttonVariant||`flat`,startIcon:e.icon&&(0,l.jsx)(JA,{icon:e.icon}),...t,children:(0,l.jsx)(YA,{value:e.label})}));function $A({children:e,color:t,variant:n,radius:r=`rounded-button`,size:i,className:a,value:o,onChange:c,multiple:u,disabled:d}){let f=s.default.Children.map(e,(a,l)=>{if(s.default.isValidElement(a)){let f=(e=>o!==void 0&&(u?o.includes(e):e===o))(a.props.value),p=f?`primary`:t;return s.default.cloneElement(a,{color:f?`primary`:t,variant:n,size:i,radius:null,disabled:a.props.disabled||d,...a.props,onClick:e=>{a.props.onClick&&a.props.onClick(e),c&&(u?c?.((e=>{let t=[...o],n=o.indexOf(e);return n>-1?t.splice(n,1):t.push(e),t})(a.props.value)):c?.(a.props.value))},className:K(a.props.className,f?`z-20`:`z-10`,ej(l,e,r,p))})}});return(0,l.jsx)(`div`,{className:K(r,`isolate inline-flex`,a),children:f})}function ej(e,t,n,r){return e===0?K(n,`rounded-tr-none rounded-br-none`,!r&&`border-r-transparent disabled:border-r-transparent`):e===t.length-1?K(n,`rounded-tl-none rounded-bl-none -ml-1`):K(`rounded-none -ml-1`,!r&&`border-r-transparent disabled:border-r-transparent`)}var tj=q((0,l.jsx)(`path`,{d:`M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z`}),`UndoOutlined`),nj=q((0,l.jsx)(`path`,{d:`M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z`}),`RedoOutlined`);function rj(){let e=Y(e=>e.history.canUndo),t=Y(e=>e.history.canRedo);return(0,l.jsxs)($A,{variant:`outline`,children:[(0,l.jsx)(qA,{equalWidth:!1,size:`xs`,padding:`pl-12 pr-10`,radius:`rounded-full`,disabled:!e,onClick:()=>{Z().history.undo()},children:(0,l.jsx)(tj,{})},`undo`),(0,l.jsx)(qA,{equalWidth:!1,padding:`pl-10 pr-12`,size:`xs`,radius:`rounded-full`,disabled:!t,onClick:()=>{Z().history.redo()},children:(0,l.jsx)(nj,{})},`redo`)]})}var ij=q((0,l.jsx)(`path`,{d:`M19 13H5v-2h14v2z`}),`RemoveOutlined`),aj=q((0,l.jsx)(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`}),`AddOutlined`);function oj(){var e,t;let n=Y(e=>e.zoom)||1;return Y(e=>e.config.tools?.zoom?.allowUserZoom)??1?(0,l.jsxs)(`div`,{className:`flex items-center select-none`,children:[(0,l.jsx)(qA,{size:`sm`,disabled:!((e=Z().zoom)!=null&&e.canZoomOut()),onClick:()=>{Z().zoom.zoomOut(Z().zoom.step)},children:(0,l.jsx)(ij,{})}),(0,l.jsxs)(`div`,{className:`w-[4ch] text-sm text-center`,children:[Math.round(100*n),`%`]}),(0,l.jsx)(qA,{size:`sm`,disabled:!((t=Z().zoom)!=null&&t.canZoomIn()),onClick:()=>{Z().zoom.zoomIn(Z().zoom.step)},children:(0,l.jsx)(aj,{})})]}):null}function sj({item:e}){switch(e.type){case`undoWidget`:return(0,l.jsx)(rj,{});case`zoomWidget`:return(0,l.jsx)(oj,{});case`button`:return(0,l.jsx)(XA,{item:e});case`image`:return(0,l.jsx)(`img`,{className:`h-30 object-cover`,src:TE(e.src),alt:``});default:return null}}var cj=q((0,l.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z`}),`CloseOutlined`);function lj(){var e;let t=Y(e=>e.config.ui?.mode===i_.OVERLAY),{width:n}=Y(e=>e.stageSize),r=n<=700;return r&&(e=X().config.ui)!=null&&e.forceOverlayModeOnMobile&&(t=!0),{isModal:t,isMobile:r}}function uj(){let{isModal:e,isMobile:t}=lj(),n=Y(e=>e.config.ui?.allowEditorClose)??!0,r=Y(e=>e.config.ui?.menubar?.items),{left:i,center:a,right:o}=(0,s.useMemo)(()=>function(e,t){let n={left:[],center:[],right:[]};(e||[]).filter(e=>!t&&!e.mobileOnly||t&&!e.desktopOnly).forEach(e=>{e.align===`left`?n.left.push({...e,position:e.position??1}):e.align===`right`?n.right.push({...e,position:e.position??1}):n.center.push({...e,position:e.position??1})});let r=Object.entries(n).map(([e,t])=>[e,t.sort((e,t)=>(e.position??0)-(t.position??0))]);return Object.fromEntries(r)}(r||[],t),[r,t]),c=e&&t&&n&&(0,l.jsx)(qA,{size:`sm`,className:`ml-10`,onClick:()=>{X().editor.close()},children:(0,l.jsx)(cj,{})});return(0,l.jsxs)(CT.div,{className:kD,...AD,children:[(0,l.jsx)(`div`,{className:`mr-auto flex items-center gap-8`,children:i.map((e,t)=>(0,l.jsx)(sj,{item:e},t))}),(0,l.jsx)(`div`,{className:`flex items-center gap-10`,children:a.map((e,t)=>(0,l.jsx)(sj,{item:e},t))}),(0,l.jsx)(`div`,{className:`ml-auto flex items-center gap-8`,children:o.map((e,t)=>(0,l.jsx)(sj,{item:e},t))}),c]})}function dj(){return(0,l.jsx)(`div`,{className:`text-sm`,children:`${Y(e=>e.crop.zoneRect?.width)||1}x${Y(e=>e.crop.zoneRect?.height)||1}`})}function fj(){let e=Y(e=>e.activeTool);return(0,l.jsxs)(CT.div,{className:kD,...AD,children:[(0,l.jsx)(pj,{}),mj(e),(0,l.jsx)(hj,{})]})}function pj(){let{isMobile:e}=lj(),t=Y(e=>e.dirty);return e?(0,l.jsx)(qA,{size:`sm`,onClick:()=>{X().cancelChanges()},children:(0,l.jsx)(cj,{})}):(0,l.jsx)(FD,{variant:`outline`,size:`xs`,startIcon:(0,l.jsx)(cj,{}),radius:`rounded-full`,className:`min-w-92`,onClick:()=>{X().cancelChanges()},children:(0,l.jsx)(rA,t?{message:`Cancel`}:{message:`Close`})})}function mj(e){if(!e)return null;let t=(0,l.jsx)(`div`,{className:`capitalize text-sm`,children:(0,l.jsx)(rA,{message:e})});return e===f_.CROP&&(X().config.tools?.crop?.allowCustomRatio??1)?(0,l.jsx)(dj,{}):t}function hj(){let{isMobile:e}=lj(),t=Y(e=>e.dirty);return e?(0,l.jsx)(qA,{size:`sm`,disabled:!t,onClick:()=>{X().applyChanges()},children:(0,l.jsx)(zD,{})}):(0,l.jsx)(FD,{variant:`flat`,color:`primary`,size:`xs`,disabled:!t,startIcon:(0,l.jsx)(zD,{}),radius:`rounded-full`,onClick:()=>{X().applyChanges()},children:(0,l.jsx)(rA,{message:`Apply`})})}function gj(){return(0,l.jsx)(AT,{initial:!1,children:Y(e=>e.activeTool)?(0,l.jsx)(fj,{},`activeToolbar`):(0,l.jsx)(uj,{},`mainToolbar`)})}var _j={newCanvas:G(`Loading Canvas`),mainImage:G(`Loading Image`),state:G(`Loading State`),merge:G(`Processing Image`)};function vj(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{Y.subscribe(e=>e.loading,e=>{e&&t(e)})},[]),(0,l.jsx)(AT,{children:e&&(0,l.jsx)(CT.div,{initial:{y:`60%`,opacity:0},animate:{y:0,opacity:1},exit:{y:`-60%`,opacity:0},transition:{type:`tween`,duration:.3},onAnimationComplete:()=>{setTimeout(()=>{t(!1)},400)},className:`absolute z-loading-indicator inset-0 m-auto p-6 w-144 h-32 text-center text-sm bg-paper rounded-full shadow-lg`,children:(0,l.jsx)(rA,{..._j[e]})})})}var yj={toVector:(e,t)=>(e===void 0&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function bj(e,t,n){return t===0||Math.abs(t)===1/0?e**(5*n):e*t*n/(t+n*e)}function xj(e,t,n,r=.15){return r===0?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-bj(t-e,n-t,r)+t:e>n?+bj(e-n,n-t,r)+n:e}function Sj(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:String(t)}function Cj(e,t,n){return(t=Sj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wj(Object(n),!0).forEach(function(t){Cj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ej={pointer:{start:`down`,change:`move`,end:`up`},mouse:{start:`down`,change:`move`,end:`up`},touch:{start:`start`,change:`move`,end:`end`},gesture:{start:`start`,change:`change`,end:`end`}};function Dj(e){return e?e[0].toUpperCase()+e.slice(1):``}var Oj=[`enter`,`leave`];function kj(e,t=``,n=!1){let r=Ej[e],i=r&&r[t]||t;return`on`+Dj(e)+Dj(i)+(function(e=!1,t){return e&&!Oj.includes(t)}(n,i)?`Capture`:``)}var Aj=[`gotpointercapture`,`lostpointercapture`];function jj(e){let t=e.substring(2).toLowerCase(),n=!!~t.indexOf(`passive`);n&&(t=t.replace(`passive`,``));let r=Aj.includes(t)?`capturecapture`:`capture`,i=!!~t.indexOf(r);return i&&(t=t.replace(`capture`,``)),{device:t,capture:i,passive:n}}function Mj(e){return`touches`in e}function Nj(e){return Mj(e)?`touch`:`pointerType`in e?e.pointerType:`mouse`}function Pj(e){return Mj(e)?function(e){return e.type===`touchend`||e.type===`touchcancel`?e.changedTouches:e.targetTouches}(e)[0]:e}function Fj(e,t){try{let n=t.clientX-e.clientX,r=t.clientY-e.clientY,i=(t.clientX+e.clientX)/2,a=(t.clientY+e.clientY)/2,o=Math.hypot(n,r);return{angle:-180*Math.atan2(n,r)/Math.PI,distance:o,origin:[i,a]}}catch{}return null}function Ij(e){return function(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)==null||(r=n.contains)==null?void 0:r.call(n,t.target))})}(e).map(e=>e.identifier)}function Lj(e,t){let[n,r]=Array.from(e.touches).filter(e=>t.includes(e.identifier));return Fj(n,r)}function Rj(e){let t=Pj(e);return Mj(e)?t.identifier:t.pointerId}function zj(e){let t=Pj(e);return[t.clientX,t.clientY]}function Bj(e){let{deltaX:t,deltaY:n,deltaMode:r}=e;return r===1?(t*=40,n*=40):r===2&&(t*=800,n*=800),[t,n]}function Vj(e,...t){return typeof e==`function`?e(...t):e}function Hj(){}function Uj(...e){return e.length===0?Hj:e.length===1?e[0]:function(){let t;for(let n of e)t=n.apply(this,arguments)||t;return t}}function Wj(e,t){return Object.assign({},t,e||{})}var Gj=class{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Vj(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:n,shared:r}=this;t.args=this.args;let i=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){let t={};if(`buttons`in e&&(t.buttons=e.buttons),`shiftKey`in e){let{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);yj.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[a,o]=t._movement,[s,c]=n.threshold,{_step:l,values:u}=t;if(n.hasCustomTransform?(!1===l[0]&&(l[0]=Math.abs(a)>=s&&u[0]),!1===l[1]&&(l[1]=Math.abs(o)>=c&&u[1])):(!1===l[0]&&(l[0]=Math.abs(a)>=s&&Math.sign(a)*s),!1===l[1]&&(l[1]=Math.abs(o)>=c&&Math.sign(o)*c)),t.intentional=!1!==l[0]||!1!==l[1],!t.intentional)return;let d=[0,0];if(n.hasCustomTransform){let[e,t]=u;d[0]=!1===l[0]?0:e-l[0],d[1]=!1===l[1]?0:t-l[1]}else d[0]=!1===l[0]?0:a-l[0],d[1]=!1===l[1]?0:o-l[1];this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);let f=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&(`bounds`in n&&(t._bounds=Vj(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));let[m,h]=t.offset,[[g,_],[v,y]]=t._bounds;t.overflow=[m<g?-1:+(m>_),h<v?-1:+(h>y)],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);let b=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,i]){let[[a,o],[s,c]]=e;return[xj(t,a,o,r),xj(n,s,c,i)]}(t._bounds,t.offset,b),t.delta=yj.sub(t.offset,f),this.computeMovement(),p&&(!t.last||i>32)){t.delta=yj.sub(t.offset,f);let e=t.delta.map(Math.abs);yj.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){let e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;let r=this.handler(Tj(Tj(Tj({},t),e),{},{[this.aliasKey]:e.values}));r!==void 0&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}},Kj=class extends Gj{constructor(...e){super(...e),Cj(this,`aliasKey`,`xy`)}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=yj.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=yj.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,n=this.config;if(!t.axis&&e){let r=typeof n.axisThreshold==`object`?n.axisThreshold[Nj(e)]:n.axisThreshold;t.axis=function([e,t],n){let r=Math.abs(e),i=Math.abs(t);return r>i&&r>n?`x`:i>r&&i>n?`y`:void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case`x`:e[1]=0;break;case`y`:e[0]=0}}},qj=e=>e,Jj={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>Tj(Tj({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return yj.toVector(e)}},from:e=>typeof e==`function`?e:e==null?void 0:yj.toVector(e),transform(e,t,n){let r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||qj},threshold:e=>yj.toVector(e,0)},Yj=Tj(Tj({},Jj),{},{axis(e,t,{axis:n}){if(this.lockDirection=n===`lock`,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if(typeof e==`function`)return t=>Yj.bounds(e(t));if(`current`in e)return()=>e.current;if(typeof HTMLElement==`function`&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=e;return[[t,n],[r,i]]}}),Xj={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},Zj=typeof window<`u`&&window.document&&window.document.createElement;function Qj(){return Zj&&`ontouchstart`in window}var $j={isBrowser:Zj,gesture:function(){try{return`constructor`in GestureEvent}catch{return!1}}(),touch:Qj(),touchscreen:Qj()||Zj&&window.navigator.maxTouchPoints>1,pointer:Zj&&`onpointerdown`in window,pointerLock:Zj&&`exitPointerLock`in window.document},eM={mouse:0,touch:0,pen:8},tM=Tj(Tj({},Yj),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&$j.pointerLock,$j.touch&&n?`touch`:this.pointerLock?`mouse`:$j.pointer&&!i?`pointer`:$j.touch?`touch`:`mouse`},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n==`number`?n:n||n===void 0&&e?250:void 0,$j.touchscreen&&!1!==n)return e||(n===void 0?void 0:`y`)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&this.device===`pointer`&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:i}){let a=yj.toVector(e,n?r:+!!i);return this.filterTaps=n,this.tapsThreshold=r,a},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(yj.toVector(e)),distance:this.transform(yj.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?Tj(Tj({},eM),e):eM,keyboardDisplacement:(e=10)=>e}),nM=Tj(Tj({},Jj),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!$j.touch&&$j.gesture)return`gesture`;if($j.touch&&r)return`touch`;if($j.touchscreen){if($j.pointer)return`pointer`;if($j.touch)return`touch`}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){let i=e=>{let t=Wj(Vj(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},a=e=>{let t=Wj(Vj(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return typeof n!=`function`&&typeof r!=`function`?[i(),a()]:e=>[i(e),a(e)]},threshold(e,t,n){return this.lockDirection=n.axis===`lock`,yj.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>e===void 0?`ctrlKey`:e,pinchOnWheel:(e=!0)=>e});Tj(Tj({},Yj),{},{mouseOnly:(e=!0)=>e}),Tj(Tj({},Yj),{},{mouseOnly:(e=!0)=>e});var rM=new Map,iM=new Map;function aM(e){rM.set(e.key,e.engine),iM.set(e.key,e.resolver)}var oM={key:`drag`,engine:class extends Kj{constructor(...e){super(...e),Cj(this,`ingKey`,`dragging`)}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Yj.bounds(r)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,n=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;let r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(r&&r.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=Rj(e),n._pointerActive=!0,this.computeValues(zj(e)),this.computeInitial(),t.preventScrollAxis&&Nj(e)!==`mouse`?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,n=this.config;if(!t._pointerActive)return;let r=Rj(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;let i=zj(e);document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=yj.sub(i,t._values),this.computeValues(i)),yj.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove(`dragDelay`),t.active=!1,this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis&&(t.axis===n.preventScrollAxis||n.preventScrollAxis===`xy`?(t._active=!1,this.clean()):(this.timeoutStore.remove(`startPointerDrag`),this.startPointerDrag(e))):this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}let t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;let r=Rj(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[i,a]=t._distance;if(t.tap=i<=n.tapsThreshold&&a<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{let[e,r]=t._delta,[i,a]=t._movement,[o,s]=n.swipe.velocity,[c,l]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTime<u){let n=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);n>o&&Math.abs(i)>c&&(t.swipe[0]=Math.sign(e)),u>s&&Math.abs(a)>l&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,`change`,this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,`end`,this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,`cancel`,this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){`persist`in e&&typeof e.persist==`function`&&e.persist()}(e);let t=this.eventStore.add(this.sharedConfig.window,`touch`,`change`,this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,`touch`,`end`,t),this.eventStore.add(this.sharedConfig.window,`touch`,`cancel`,t),this.timeoutStore.add(`startPointerDrag`,this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add(`dragDelay`,()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=Xj[e.key];if(t){let n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,yj.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Xj&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,`start`,this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,`change`,this.pointerMove.bind(this)),e(t,`end`,this.pointerUp.bind(this)),e(t,`cancel`,this.pointerUp.bind(this)),e(`lostPointerCapture`,``,this.pointerUp.bind(this))),this.config.keys&&(e(`key`,`down`,this.keyDown.bind(this)),e(`key`,`up`,this.keyUp.bind(this))),this.config.filterTaps&&e(`click`,``,this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:tM},sM={key:`pinch`,engine:class extends Gj{constructor(...e){super(...e),Cj(this,`ingKey`,`pinching`),Cj(this,`aliasKey`,`da`)}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();let e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){let{type:e,movement:t,lastOffset:n}=this.state;this.state.offset=e===`wheel`?yj.add(t,n):[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){let{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){let e=this.state,[t,n]=e._movement;if(!e.axis){let r=30*Math.abs(t)-Math.abs(n);r<0?e.axis=`angle`:r>0&&(e.axis=`scale`)}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis===`scale`?e[1]=0:this.state.axis===`angle`&&(e[0]=0))}cancel(){let e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);let t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every(e=>n.has(e))||n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);let r=Lj(e,t._touchIds);r&&this.pinchStart(e,r)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);let t=this.state,n=t._pointerEvents,r=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every(e=>r.has(e))||(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);let i=Fj(...Array.from(n.values()));i&&this.pinchStart(e,i)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;let t=Lj(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){let t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;let n=Fj(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){let n=this.state,r=n._values[1],i=t.angle-r,a=0;Math.abs(i)>270&&(a+=Math.sign(i)),this.computeValues([t.distance,t.angle-360*a]),n.origin=t.origin,n.turns=a,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(e=>!this.ctrl.touchIds.has(e))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){let t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();let t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;let t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];let n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=yj.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){let t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(t=>e[t]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add(`wheelEnd`,this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){`uv`in e||e.cancelable&&e.preventDefault();let t=this.state;t._delta=[-Bj(e)[1]/100*t.offset[0],0],yj.addTo(t._movement,t._delta),function(e){let[t,n]=e.overflow,[r,i]=e._delta,[a,o]=e._direction;(t<0&&r>0&&a<0||t>0&&r<0&&a>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&i>0&&o<0||n>0&&i<0&&o>0)&&(e._movement[1]=e._movementBound[1])}(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){let t=this.config.device;t&&(e(t,`start`,this[t+`Start`].bind(this)),e(t,`change`,this[t+`Move`].bind(this)),e(t,`end`,this[t+`End`].bind(this)),e(t,`cancel`,this[t+`End`].bind(this)),e(`lostPointerCapture`,``,this[t+`End`].bind(this))),this.config.pinchOnWheel&&e(`wheel`,``,this.wheel.bind(this),{passive:!1})}},resolver:nM};function cM(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var lM={target(e){if(e)return()=>`current`in e?e.current:e},enabled:(e=!0)=>e,window:(e=$j.isBrowser?window:void 0)=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},uM=[`target`,`eventOptions`,`window`,`enabled`,`transform`];function dM(e={},t){let n={};for(let[r,i]of Object.entries(t))switch(typeof i){case`function`:n[r]=i.call(n,e[r],r,e);break;case`object`:n[r]=dM(e[r],i);break;case`boolean`:i&&(n[r]=e[r])}return n}var fM=class{constructor(e,t){Cj(this,`_listeners`,new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,i){let a=this._listeners,o=function(e,t=``){let n=Ej[e];return e+(n&&n[t]||t)}(t,n),s=Tj(Tj({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(o,r,s);let c=()=>{e.removeEventListener(o,r,s),a.delete(c)};return a.add(c),c}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}},pM=class{constructor(){Cj(this,`_timeouts`,new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>{window.clearTimeout(e)}),this._timeouts.clear()}},mM=class{constructor(e){Cj(this,`gestures`,new Set),Cj(this,`_targetEventStore`,new fM(this)),Cj(this,`gestureEventStores`,{}),Cj(this,`gestureTimeoutStores`,{}),Cj(this,`handlers`,{}),Cj(this,`config`,{}),Cj(this,`pointerIds`,new Set),Cj(this,`touchIds`,new Set),Cj(this,`state`,{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&hM(e,`drag`),t.wheel&&hM(e,`wheel`),t.scroll&&hM(e,`scroll`),t.move&&hM(e,`move`),t.pinch&&hM(e,`pinch`),t.hover&&hM(e,`hover`)}(this,e)}setEventIds(e){return Mj(e)?(this.touchIds=new Set(Ij(e)),this.touchIds):`pointerId`in e?(e.type===`pointerup`||e.type===`pointercancel`?this.pointerIds.delete(e.pointerId):e.type===`pointerdown`&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){let r=e,{target:i,eventOptions:a,window:o,enabled:s,transform:c}=r,l=cM(r,uM);if(n.shared=dM({target:i,eventOptions:a,window:o,enabled:s,transform:c},lM),t){let e=iM.get(t);n[t]=dM(Tj({shared:n.shared},l),e)}else for(let e in l){let t=iM.get(e);t&&(n[e]=dM(Tj({shared:n.shared},l[e]),t))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(let e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t=this.config.shared,n={},r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(let t of this.gestures){let i=this.config[t],a=gM(n,i.eventOptions,!!r);i.enabled&&new(rM.get(t))(this,e,t).bind(a)}let i=gM(n,t.eventOptions,!!r);for(let t in this.nativeHandlers)i(t,``,n=>this.nativeHandlers[t](Tj(Tj({},this.state.shared),{},{event:n,args:e})),void 0,!0)}for(let e in n)n[e]=Uj(...n[e]);if(!r)return n;for(let e in n){let{device:t,capture:i,passive:a}=jj(e);this._targetEventStore.add(r,t,``,n[e],{capture:i,passive:a})}}}};function hM(e,t){e.gestures.add(t),e.gestureEventStores[t]=new fM(e,t),e.gestureTimeoutStores[t]=new pM}var gM=(e,t,n)=>(r,i,a,o={},s=!1)=>{let c=o.capture??t.capture,l=o.passive??t.passive,u=s?r:kj(r,i,c);n&&l&&(u+=`Passive`),e[u]=e[u]||[],e[u].push(a)},_M=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function vM(e,t,n,r,i,a){if(!e.has(n)||!rM.has(r))return;let o=n+`Start`,s=n+`End`;i[r]=e=>{let r;return e.first&&o in t&&t[o](e),n in t&&(r=t[n](e)),e.last&&s in t&&t[s](e),r},a[r]=a[r]||{}}function yM(e,t){let[n,r,i]=function(e){let t={},n={},r=new Set;for(let i in e)_M.test(i)?(r.add(RegExp.lastMatch),n[i]=e[i]):t[i]=e[i];return[n,t,r]}(e),a={};return vM(i,n,`onDrag`,`drag`,a,t),vM(i,n,`onWheel`,`wheel`,a,t),vM(i,n,`onScroll`,`scroll`,a,t),vM(i,n,`onPinch`,`pinch`,a,t),vM(i,n,`onMove`,`move`,a,t),vM(i,n,`onHover`,`hover`,a,t),{handlers:a,config:t,nativeHandlers:r}}function bM({e,rect:t,deltaX:n,deltaY:r}){return{rect:t,x:e.clientX,y:e.clientY,deltaX:n??0,deltaY:r??0,nativeEvent:e}}function xM({onMoveStart:e,onMove:t,onMoveEnd:n,minimumMovement:r=0,preventDefault:i,stopPropagation:a=!0,onPress:o,onLongPress:c,...l}){let u=(0,s.useRef)({lastPosition:{x:0,y:0},started:!1,longPressTriggered:!1}).current,{addGlobalListener:d,removeGlobalListener:f}=$T(),p=n=>{if(n.pointerId===u.id){let i=n.clientX-u.lastPosition.x,a=n.clientY-u.lastPosition.y;(Math.abs(i)>=r||Math.abs(a)>=r)&&!u.started&&(t=>{!u.el||!1===e?.(t,u.el)||(u.originalTouchAction=u.el.style.touchAction,u.el.style.touchAction=`none`,u.originalUserSelect=document.documentElement.style.userSelect,document.documentElement.style.userSelect=`none`,u.started=!0)})(n),u.started&&(t?.(n,i,a),u.lastPosition={x:n.clientX,y:n.clientY})}},m=e=>{var t;if(e.pointerId===u.id){u.longPressTimer&&clearTimeout(u.longPressTimer);let r=u.longPressTriggered;u.longPressTriggered=!1,u.started&&n?.(e),u.el&&(e.type!==`pointercancel`&&((t=l.onPointerUp)==null||t.call(l,e,u.el),e.target&&u.el.contains(e.target)&&(r?c?.(e,u.el):o?.(e,u.el))),document.documentElement.style.userSelect=u.originalUserSelect||``,u.el.style.touchAction=u.originalTouchAction||``),u.id=void 0,u.started=!1,f(window,`pointermove`,p,!1),f(window,`pointerup`,m,!1),f(window,`pointercancel`,m,!1)}};return{domProps:{onPointerDown:ND(n=>{if(n.button===0&&u.id==null){if(u.started=!1,!1===l.onPointerDown?.call(l,n))return;a&&n.stopPropagation(),i&&n.preventDefault(),u.id=n.pointerId,u.el=n.currentTarget,u.lastPosition={x:n.clientX,y:n.clientY},c&&(u.longPressTimer=setTimeout(()=>{c(n,u.el),u.longPressTriggered=!0},400)),(e||t)&&d(window,`pointermove`,p,!1),d(window,`pointerup`,m,!1),d(window,`pointercancel`,m,!1)}})}}}function SM(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}var CM=(e=>(e.topLeft=`topLeft`,e.topRight=`topRight`,e.bottomLeft=`bottomLeft`,e.bottomRight=`bottomRight`,e))(CM||{}),wM={},TM=(e={})=>{dE(null),wM=e};function EM({aspectRatio:e,boundaryRef:t,boundaryRect:n,restrictWithinBoundary:r=!0,minWidth:i=50,minHeight:a=50,...o}){let{domProps:s}=xM({onMoveStart:(e,r)=>{var i;let a=e.target;if(!a.dataset.resizeHandle||uE||(TM({currentRect:SM(r.getBoundingClientRect()),resizeDir:a.dataset.resizeHandle}),!wM.currentRect))return!1;dE(`resize`),n?wM.boundaryRect=n:t!=null&&t.current&&(wM.boundaryRect=SM(t.current.getBoundingClientRect())),wM.currentRect&&wM.boundaryRect&&(wM.currentRect.left-=wM.boundaryRect.left,wM.currentRect.top-=wM.boundaryRect.top),wM.initialAspectRatio=wM.currentRect.width/wM.currentRect.height,(i=o.onResizeStart)==null||i.call(o,bM({rect:wM.currentRect,e}))},onMove:(t,n,r)=>{var s;if(!wM.resizeDir||!wM.currentRect)return;let c=e===`initial`?wM.initialAspectRatio:e,l=function(e,t,n,r){let i={...e},a={...e};return wM.resizeDir===`topRight`?(a.width=Math.floor(a.width+t),a.height=Math.floor(r?a.width/r:a.height-n),a.top=Math.floor(a.top+(i.height-a.height))):wM.resizeDir===`bottomRight`?(a.width=Math.floor(a.width+t),a.height=Math.floor(r?a.width/r:a.height+n)):wM.resizeDir===`topLeft`?(a.width=Math.floor(a.width-t),a.height=Math.floor(r?a.width/r:a.height-n),a.left=Math.floor(a.left+(i.width-a.width)),a.top=Math.floor(a.top+(i.height-a.height))):wM.resizeDir===`bottomLeft`&&(a.width=Math.floor(a.width-t),a.height=Math.floor(r?a.width/r:a.height+n),a.left=Math.floor(a.left+t)),a}(wM.currentRect,n,r,c),u=function(e,t,n,r){let i=wM.resizeDir===`bottomLeft`||wM.resizeDir===`topLeft`,a=wM.resizeDir===`topRight`||wM.resizeDir===`topLeft`,o={...e};o.width=Math.max(t,e.width),o.height=Math.max(n,e.height);let s=o.width-e.width;i&&s>0&&(o.left-=s);let c=o.height-e.height;if(a&&c>0&&(o.top-=c),wM.boundaryRect&&(o=function(e,t){let n={...e};n.left=Math.max(0,n.left);let r=n.left-e.left;r>0&&(n.width-=r),n.top=Math.max(0,n.top);let i=n.top-e.top;return i>0&&(n.height-=i),n.width=Math.min(n.width,t.width-n.left),n.height=Math.min(n.height,t.height-n.top),n}(o,wM.boundaryRect)),r){let e=o.width,t=o.height,n=GE(r,o.width,o.height);o.width=n.width,o.height=n.height,a&&(o.top+=t-o.height),i&&(o.left+=e-o.width)}return o}(l,i,a,c);(s=o.onResize)==null||s.call(o,bM({rect:u,e:t,deltaX:n,deltaY:r})),wM.currentRect=l},onMoveEnd:e=>{var t;wM.currentRect&&((t=o.onResizeEnd)==null||t.call(o,bM({rect:wM.currentRect,e}))),TM()}});return{resizeProps:s}}function DM({position:e,inset:t=!1}){return(0,l.jsx)(`div`,{"data-resize-handle":e,className:`border-white absolute w-20 h-20 ${function(e,t){let n=t?`left-0`:`-left-5`,r=t?`top-0`:`-top-5`,i=t?`bottom-0`:`-bottom-5`,a=t?`right-0`:`-right-5`;switch(e){case CM.topLeft:return`${n} ${r} border-l-4 border-t-4 cursor-nwse-resize`;case CM.topRight:return`${a} ${r} border-r-4 border-t-4 cursor-nesw-resize`;case CM.bottomRight:return`${a} ${i} border-r-4 border-b-4 cursor-se-resize`;case CM.bottomLeft:return`${n} ${i} border-l-4 border-b-4 cursor-sw-resize`;default:return``}}(e,t)}`})}var OM=(e=>(e.top=`maskTop`,e.right=`maskRight`,e.bottom=`maskBottom`,e.left=`maskLeft`,e))(OM||{});function kM({position:e,refs:t}){return(0,l.jsx)(`div`,{className:`cropzone-transition bg-black/50 bottom absolute ${function(e){switch(e){case`maskTop`:return`left-0 top-0`;case`maskBottom`:return`bottom-0 left-0`;default:return``}}(e)}`,ref:n=>t.current[e]=n})}function AM({name:e,refs:t}){return(0,l.jsx)(`div`,{className:K(`cropzone-transition pointer-events-none absolute left-0 top-0 bg-white/50`,e.startsWith(`lineHor`)?`h-px`:`w-px`),ref:n=>{t.current[e]=n}})}function jM(e,t,n){return Math.min(Math.max(e,t),n)}var MM={};function NM({boundaryRef:e,boundaryRect:t,minimumMovement:n,restrictWithinBoundary:r=!0,...i}){let{domProps:a}=xM({minimumMovement:n,onMoveStart:(n,r)=>{var a;if(uE)return!1;MM={currentRect:SM(r.getBoundingClientRect())},dE(`move`),t?MM.boundaryRect=t:e!=null&&e.current&&(MM.boundaryRect=SM(e.current.getBoundingClientRect())),MM.currentRect&&MM.boundaryRect&&(MM.currentRect.left-=MM.boundaryRect.left,MM.currentRect.top-=MM.boundaryRect.top),(a=i.onMoveStart)==null||a.call(i,bM({rect:MM.currentRect,e:n}))},onMove:(e,t,n)=>{var a;if(!MM.currentRect)return;let o={...MM.currentRect,left:MM.currentRect.left+t,top:MM.currentRect.top+n},s={...o};MM.boundaryRect&&r&&(s.left=jM(o.left,0,MM.boundaryRect.width-o.width),s.top=jM(o.top,0,MM.boundaryRect.height-o.height)),(a=i.onMove)==null||a.call(i,bM({rect:s,e,deltaX:t,deltaY:n})),MM.currentRect=o},onMoveEnd:e=>{var t;MM.currentRect&&((t=i.onMoveEnd)==null||t.call(i,bM({rect:MM.currentRect,e})),dE(null),MM={})}});return{moveProps:a}}function PM(){let e=(0,s.useRef)({}),[t,n]=(0,s.useState)(!0),r=Y(e=>e.canvasSize),i=Y(e=>e.config.tools?.crop?.cropzone),a=Y(e=>e.config.tools?.crop?.defaultRatio)||null,o=Y(e=>e.crop.selectedAspectRatio)||null,{moveProps:c}=NM({boundaryRect:r,onMoveStart:()=>n(!0),onMove:e=>Z().crop.drawZone(e.rect),onMoveEnd:()=>n(!1)}),{resizeProps:u}=EM({boundaryRect:r,minHeight:50,minWidth:50,aspectRatio:KE(o),onResizeStart:()=>n(!0),onResize:e=>Z().crop.drawZone(e.rect),onResizeEnd:()=>n(!1)});return(0,s.useLayoutEffect)(()=>{Z().crop.registerRefs(e),Z().crop.resetCropzone(a)},[a,r]),(0,l.jsxs)(`div`,{className:K(`cropzone absolute z-cropzone isolate left-0 top-0 w-full h-full overflow-hidden`,t&&`moving`),onPointerDown:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,l.jsxs)(`div`,{className:`cropzone-transition border-white/50 absolute z-10 left-0 top-0 border`,...GT(u,c),ref:t=>e.current.innerZone=t,children:[!(i!=null&&i.hideTopLeft)&&(0,l.jsx)(DM,{position:CM.topLeft,inset:!0}),!(i!=null&&i.hideTopRight)&&(0,l.jsx)(DM,{position:CM.topRight,inset:!0}),!(i!=null&&i.hideBottomLeft)&&(0,l.jsx)(DM,{position:CM.bottomLeft,inset:!0}),!(i!=null&&i.hideBottomRight)&&(0,l.jsx)(DM,{position:CM.bottomRight,inset:!0}),(0,l.jsx)(AM,{name:`lineVer1`,refs:e}),(0,l.jsx)(AM,{name:`lineVer2`,refs:e}),(0,l.jsx)(AM,{name:`lineHor1`,refs:e}),(0,l.jsx)(AM,{name:`lineHor2`,refs:e})]}),(0,l.jsx)(kM,{refs:e,position:OM.top}),(0,l.jsx)(kM,{refs:e,position:OM.left}),(0,l.jsx)(kM,{refs:e,position:OM.right}),(0,l.jsx)(kM,{refs:e,position:OM.bottom})]})}var FM=q((0,l.jsx)(`path`,{d:`M 7 2 C 6.448 2 6 2.448 6 3 C 6 3.552 6.448 4 7 4 L 20 4 L 20 17 C 20 17.552 20.448 18 21 18 C 21.552 18 22 17.552 22 17 L 22 4 C 22 2.895 21.105 2 20 2 L 7 2 z M 4 6 C 2.895 6 2 6.895 2 8 L 2 20 C 2 21.105 2.895 22 4 22 L 16 22 C 17.105 22 18 21.105 18 20 L 18 8 C 18 6.895 17.105 6 16 6 L 4 6 z M 10 10 C 10.552 10 11 10.448 11 11 L 11 13 L 13 13 C 13.552 13 14 13.448 14 14 C 14 14.552 13.552 15 13 15 L 11 15 L 11 17 C 11 17.552 10.552 18 10 18 C 9.448 18 9 17.552 9 17 L 9 15 L 7 15 C 6.448 15 6 14.552 6 14 C 6 13.448 6.448 13 7 13 L 9 13 L 9 11 C 9 10.448 9.448 10 10 10 z`})),IM=q((0,l.jsx)(`path`,{d:`M 11 3 L 2 21 L 11 21 L 11 3 z M 13 3 L 13 21 L 22 21 L 13 3 z M 9 11.472656 L 9 19 L 5.2363281 19 L 9 11.472656 z`})),LM=q((0,l.jsx)(`path`,{d:`M 16.476562 2.4511719 C 16.392047 2.4657656 16.308531 2.5061719 16.238281 2.5761719 L 14.130859 4.6835938 C 13.956859 4.8575938 13.956859 5.1394531 14.130859 5.3144531 L 16.238281 7.4238281 C 16.519281 7.7048281 17 7.5054219 17 7.1074219 L 17 6 L 20 6 L 20 9 A 1.0001 1.0001 0 1 0 22 9 L 22 6 C 22 4.9069372 21.093063 4 20 4 L 17 4 L 17 2.8925781 C 17 2.5940781 16.730109 2.4073906 16.476562 2.4511719 z M 4 5 C 2.9069372 5 2 5.9069372 2 7 L 2 14 C 2 15.093063 2.9069372 16 4 16 L 7 16 L 7 19 C 7 20.105 7.895 21 9 21 L 16 21 C 17.105 21 18 20.105 18 19 L 18 12 C 18 10.895 17.105 10 16 10 L 13 10 L 13 7 C 13 5.9069372 12.093063 5 11 5 L 4 5 z M 4 7 L 11 7 L 11 14 L 4 14 L 4 7 z`})),RM=q((0,l.jsx)(`path`,{d:`M 10 2 L 9 3 L 3 3 L 3 5 L 21 5 L 21 3 L 15 3 L 14 2 L 10 2 z M 4.3652344 7 L 5.8925781 20.263672 C 6.0245781 21.253672 6.877 22 7.875 22 L 16.123047 22 C 17.121047 22 17.974422 21.254859 18.107422 20.255859 L 19.634766 7 L 4.3652344 7 z`})),zM={width:120,height:30},BM=[{name:`Duplicate`,icon:FM,onClick:()=>{Z().objects.duplicate()}},{name:`Flip`,icon:IM,onClick:()=>{Z().objects.flipHorizontally()}},{name:`Bring to front`,icon:LM,onClick:()=>{Z().objects.bringToFront()}},{name:`Delete`,icon:RM,onClick:()=>{Z().objects.delete()}}],VM=s.default.forwardRef((e,t)=>(0,l.jsx)(`div`,{ref:t,className:`${Y(e=>e.objects.active.isMoving)?`opacity-0`:`opacity-100`} absolute z-obj-box left-0 top-0 flex items-center text-white bg-controls rounded shadow transition-opacity overflow-hidden`,children:BM.map(e=>{let t=e.icon;return(0,l.jsx)(qA,{size:`sm`,className:`w-30 h-30 hover:bg-white/hover`,radius:`rounded-none`,onClick:e.onClick,children:(0,l.jsx)(t,{})},e.name)})}));function HM(e,t){let n=Z().objects.getActive();if(!n||!e.current)return;let r=e.current,i=$.fabric.util.degreesToRadians(n.angle??0),a=Math.round(n.getScaledWidth()*X().zoom),o=Math.round(n.getScaledHeight()*X().zoom),s=Math.round((n.left??0)*X().zoom),c=Math.round((n.top??0)*X().zoom),l=n.originX===`center`?a/2:0,u=n.originY===`center`?o/2:0;n.padding&&(a+=2*n.padding,o+=2*n.padding,s-=n.padding,c-=n.padding),r.style.width=`${a}px`,r.style.height=`${o}px`,r.style.transform=`translate(${s-l}px, ${c-u}px) rotate(${i}rad)`,Z().canvas.render(),function(e,t){if(!t)return;let n=e.angle||0,r=n>168&&n<188?-30:-15,i=X().canvasSize,a=X().stageSize,o=zM,s=i.top-a.top,c=i.left-a.left,l=a.width-(c+i.width),u=a.height-(s+i.height),d=-s,f=-(i.left-a.left),p=i.width-o.width+l,m=i.height-o.height+u,h=e.getBoundingRect(),g=h.top-o.height+r,_=h.left+h.width/2-o.width/2;g=Math.min(m,Math.max(d,g)),_=Math.min(p,Math.max(f,_)),t.style.transform=`translate(${_}px, ${g}px) rotate(0deg)`}(n,t.current)}function UM(){return(0,l.jsx)(`div`,{className:`absolute -bottom-20 left-1/2 w-2 h-20 bg-white cursor-default -translate-x-1/2`,children:(0,l.jsx)(`div`,{"data-rotate-handle":!0,className:`w-18 h-18 absolute -bottom-10 -left-8 bg-white rounded-full cursor-move`})})}var WM={};function GM(e){let t=WM.centerX||0,n=WM.centerY||0;return Math.atan2(n-e.pageY,t-e.pageX)-(WM.startAngle||0)}var KM=(e={})=>{dE(null),WM=e};function qM(){let e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=Y(e=>e.objects.active.id),r=Y(e=>e.objects.isEditingText),i=Y(e=>e.zoom),a=function(){let e=Z().objects.getActive();if(!e||!e.name)return{};let t=X().config.objectControls||{},n=e.name;return{...t.global,...t[n]}}(),o=(0,s.useRef)(null),c=(0,s.useCallback)(()=>{o.current?(clearTimeout(o.current),o.current=null,function(){var e;let t=Z().objects.getActive();xy(t)&&(t.enterEditing(),(e=t.hiddenTextarea)==null||e.focus())}()):o.current=setTimeout(()=>{o.current=null},300)},[]),{moveProps:u}=NM({boundaryRef:X().canvasRef,restrictWithinBoundary:!1,onMoveEnd:()=>{X().objects.setActiveIsMoving(!1)},onMove:e=>{X().objects.setActiveIsMoving(!0),function(e){let t=e.rect.width/2,n=e.rect.height/2;Z().objects.setValues({left:(e.rect.left+t)/X().zoom,top:(e.rect.top+n)/X().zoom})}(e)}});a.lockMovement&&(u={});let{resizeProps:d}=EM({minWidth:50,minHeight:50,aspectRatio:a.unlockAspectRatio?null:`initial`,boundaryRef:a.containWithinCanvas?X().canvasRef:void 0,restrictWithinBoundary:!1,onResizeEnd:()=>{X().objects.setActiveIsMoving(!1)},onResize:e=>{X().objects.setActiveIsMoving(!0),function(e){let t=Z().objects.getActive();if(!t)return;let n={};xy(t)?(e.deltaX>0||t.getScaledHeight()>=20&&t.getScaledWidth()>=20)&&(n.fontSize=(t.fontSize||1)+e.deltaX):(t.width&&(n.scaleX=e.rect.width/X().zoom/t.width),t.height&&(n.scaleY=e.rect.height/X().zoom/t.height)),Z().objects.setValues(n)}(e)}}),{rotateProps:f}=function(e){let{domProps:t}=xM({onMoveStart:(t,n)=>{var r;if(!t.target.dataset.rotateHandle||uE)return!1;let i=SM(n.getBoundingClientRect());if(!i)return!1;let a=n.style.transform.match(/rotate\((.+?)\)/)?.[1],[o=`0`]=a?a.split(`,`):[];KM({currentRect:i,centerX:i.left+i.width/2,centerY:i.top+i.height/2,startAngle:parseFloat(o)}),dE(`rotate`),WM.startAngle=GM(t),(r=e.onRotateStart)==null||r.call(e,bM({rect:i,e:t}))},onMove:(t,n,r)=>{var i;if(!WM.currentRect)return;let a={...WM.currentRect};a.angle=GM(t),a.left+=n,a.top+=r,(i=e.onRotate)==null||i.call(e,bM({rect:a,e:t,deltaX:n,deltaY:r})),WM.currentRect=a},onMoveEnd:t=>{var n;WM.currentRect&&((n=e.onRotateEnd)==null||n.call(e,bM({rect:WM.currentRect,e:t}))),KM()}});return{rotateProps:t}}({boundaryRef:X().canvasRef,onRotateEnd:()=>{X().objects.setActiveIsMoving(!1)},onRotate:e=>{X().objects.setActiveIsMoving(!0),function(e){let t=Z().objects.getActive();if(!t||!e.rect.angle)return;let n=$.fabric.util.radiansToDegrees(e.rect.angle);n!==t.angle&&Z().objects.setValues({angle:n})}(e)}});return(0,s.useEffect)(()=>{Q()&&X().editor.on(`object:modified`,n=>{n.sizeOrPositionChanged&&HM(e,t)})},[]),(0,s.useEffect)(()=>{HM(e,t)},[n,i,r]),(0,l.jsxs)(`div`,{className:n&&!r?`block`:`hidden`,children:[(0,l.jsxs)(`div`,{ref:e,...GT(f,d,u),onClick:c,className:`absolute z-obj-box border-2 border-white shadow-md cursor-move`,children:[!a.hideTopLeft&&(0,l.jsx)(DM,{position:CM.topLeft}),!a.hideTopRight&&(0,l.jsx)(DM,{position:CM.topRight}),!a.hideBottomLeft&&(0,l.jsx)(DM,{position:CM.bottomLeft}),!a.hideBottomRight&&(0,l.jsx)(DM,{position:CM.bottomRight}),!a.hideRotatingPoint&&(0,l.jsx)(UM,{})]}),(0,l.jsx)(VM,{ref:t})]})}function JM(){let e=Y(e=>e.activeTool===f_.CROP),t=Y(e=>e.objects.active.id);return(0,l.jsxs)(`div`,{children:[e&&(0,l.jsx)(PM,{}),t&&(0,l.jsx)(qM,{})]})}var YM=function(e){return e.forEach(aM),function(e,t){let{handlers:n,nativeHandlers:r,config:i}=yM(e,t||{});return function(e,t={},n,r){let i=s.default.useMemo(()=>new mM(e),[]);if(i.applyHandlers(e,r),i.applyConfig(t,n),s.default.useEffect(i.effect.bind(i)),s.default.useEffect(()=>i.clean.bind(i),[]),t.target===void 0)return i.bind.bind(i)}(n,i,void 0,r)}}([oM,sM]),XM=s.default.forwardRef((e,t)=>{let[n,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>Y.subscribe(e=>e.loading,e=>{r(!e)}),[]),(0,l.jsx)(ZM,{children:(0,l.jsxs)(CT.div,{initial:{opacity:0},variants:{visible:{opacity:1,transition:{duration:.35,delay:.5}},hidden:{opacity:0,transition:{duration:0}}},animate:n?`visible`:`hidden`,className:`relative m-auto w-max`,style:{backgroundImage:`url(${TE(`images/empty-canvas-bg.png`)})`},children:[(0,l.jsx)(JM,{}),(0,l.jsx)(`canvas`,{ref:t})]})})});function ZM({children:e}){let t=(0,s.useRef)(null);return(0,l.jsx)(`div`,{ref:t,className:`w-full h-full overflow-hidden touch-none flex`,...YM({onPinch:e=>{if(!Z().zoom.allowUserZoom||!QM(e))return e.cancel();e.direction[0]===1?Z().zoom.zoomIn(.01):Z().zoom.zoomOut(.01),e.event.stopPropagation(),e.event.preventDefault()},onDrag:e=>{if(e.pinching||!QM(e))return e.cancel();t.current.scrollLeft-=e.delta[0],t.current.scrollTop-=e.delta[1]}})(),children:e})}function QM(e){return!(Q().findTarget(e.event,!1)||Q().isDrawingMode)}function $M({actionBtn:e,children:t,className:n}){return(0,l.jsxs)(`div`,{className:K(n,`flex gap-16 items-center h-full`),children:[e&&(0,l.jsx)(`div`,{className:`flex-shrink-0`,children:e}),(0,l.jsx)(`div`,{className:`w-full flex-auto`,children:t}),e&&(0,l.jsx)(`div`,{className:`w-96`})]})}function eN(){return(eN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function tN(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function nN(e){var t=(0,s.useRef)(e),n=(0,s.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var rN=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},iN=function(e){return`touches`in e},aN=function(e){return e&&e.ownerDocument.defaultView||self},oN=function(e,t,n){var r=e.getBoundingClientRect(),i=iN(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:rN((i.pageX-(r.left+aN(e).pageXOffset))/r.width),top:rN((i.pageY-(r.top+aN(e).pageYOffset))/r.height)}},sN=function(e){!iN(e)&&e.preventDefault()},cN=s.default.memo(function(e){var t=e.onMove,n=e.onKey,r=tN(e,[`onMove`,`onKey`]),i=(0,s.useRef)(null),a=nN(t),o=nN(n),c=(0,s.useRef)(null),l=(0,s.useRef)(!1),u=(0,s.useMemo)(function(){var e=function(e){sN(e),(iN(e)?e.touches.length>0:e.buttons>0)&&i.current?a(oN(i.current,e,c.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,a=aN(i.current),o=n?a.addEventListener:a.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t,r=e.nativeEvent,o=i.current;if(o&&(sN(r),t=r,(!l.current||iN(t))&&o)){if(iN(r)){l.current=!0;var s=r.changedTouches||[];s.length&&(c.current=s[0].identifier)}o.focus(),a(oN(o,r,c.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),o({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},n]},[o,a]),d=u[0],f=u[1],p=u[2];return(0,s.useEffect)(function(){return p},[p]),s.default.createElement(`div`,eN({},r,{onTouchStart:d,onMouseDown:d,className:`react-colorful__interactive`,ref:i,onKeyDown:f,tabIndex:0,role:`slider`}))}),lN=function(e){return e.filter(Boolean).join(` `)},uN=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=lN([`react-colorful__pointer`,e.className]);return s.default.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},s.default.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},dN=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n},fN=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?dN(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?dN(parseInt(e.substring(6,8),16)/255,2):1}},pN=function(e){var t=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:dN(e.h),s:dN(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:dN(i/2),a:dN(r,2)}}(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},mN=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:dN(255*[r,s,o,o,c,r][l]),g:dN(255*[c,r,r,s,o,o][l]),b:dN(255*[o,o,c,r,r,s][l]),a:dN(i,2)}},hN=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},gN=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?hN(dN(255*i)):``;return`#`+hN(t)+hN(n)+hN(r)+a},_N=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:dN(60*(s<0?s+6:s)),s:dN(a?o/a*100:0),v:dN(a/255*100),a:i}},vN=s.default.memo(function(e){var t=e.hue,n=e.onChange,r=lN([`react-colorful__hue`,e.className]);return s.default.createElement(`div`,{className:r},s.default.createElement(cN,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:rN(t+360*e.left,0,360)})},"aria-label":`Hue`,"aria-valuenow":dN(t),"aria-valuemax":`360`,"aria-valuemin":`0`},s.default.createElement(uN,{className:`react-colorful__hue-pointer`,left:t/360,color:pN({h:t,s:100,v:100,a:1})})))}),yN=s.default.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:pN({h:t.h,s:100,v:100,a:1})};return s.default.createElement(`div`,{className:`react-colorful__saturation`,style:r},s.default.createElement(cN,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:rN(t.s+100*e.left,0,100),v:rN(t.v-100*e.top,0,100)})},"aria-label":`Color`,"aria-valuetext":`Saturation `+dN(t.s)+`%, Brightness `+dN(t.v)+`%`},s.default.createElement(uN,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:pN(t)})))}),bN=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},xN,SN=typeof window<`u`?s.useLayoutEffect:s.useEffect,CN=new Map,wN=function(e){SN(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!CN.has(t)){var n=t.createElement(`style`);n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,CN.set(t,n);var r=typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0;r&&n.setAttribute(`nonce`,r),t.head.appendChild(n)}},[])},TN=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=tN(e,[`className`,`colorModel`,`color`,`onChange`]),c=(0,s.useRef)(null);wN(c);var l=function(e,t,n){var r=nN(n),i=(0,s.useState)(function(){return e.toHsva(t)}),a=i[0],o=i[1],c=(0,s.useRef)({color:t,hsva:a});return(0,s.useEffect)(function(){if(!e.equal(t,c.current.color)){var n=e.toHsva(t);c.current={hsva:n,color:t},o(n)}},[t,e]),(0,s.useEffect)(function(){var t;bN(a,c.current.hsva)||e.equal(t=e.fromHsva(a),c.current.color)||(c.current={hsva:a,color:t},r(t))},[a,e,r]),[a,(0,s.useCallback)(function(e){o(function(t){return Object.assign({},t,e)})},[])]}(n,i,a),u=l[0],d=l[1],f=lN([`react-colorful`,t]);return s.default.createElement(`div`,eN({},o,{ref:c,className:f}),s.default.createElement(yN,{hsva:u,onChange:d}),s.default.createElement(vN,{hue:u.h,onChange:d,className:`react-colorful__last-control`}))},EN={defaultColor:`000`,toHsva:function(e){return _N(fN(e))},fromHsva:function(e){return function(e){return gN(mN(e))}({h:e.h,s:e.s,v:e.v,a:1})},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||bN(fN(e),fN(t))}},DN=function(e){return s.default.createElement(TN,eN({},e,{colorModel:EN}))},ON=/^#?([0-9A-F]{3,8})$/i,kN=function(e){var t=e.color,n=t===void 0?``:t,r=e.onChange,i=e.onBlur,a=e.escape,o=e.validate,c=e.format,l=e.process,u=tN(e,[`color`,`onChange`,`onBlur`,`escape`,`validate`,`format`,`process`]),d=(0,s.useState)(function(){return a(n)}),f=d[0],p=d[1],m=nN(r),h=nN(i),g=(0,s.useCallback)(function(e){var t=a(e.target.value);p(t),o(t)&&m(l?l(t):t)},[a,l,o,m]),_=(0,s.useCallback)(function(e){o(e.target.value)||p(a(n)),h(e)},[n,a,o,h]);return(0,s.useEffect)(function(){p(a(n))},[n,a]),s.default.createElement(`input`,eN({},u,{value:c?c(f):f,spellCheck:`false`,onChange:g,onBlur:_}))},AN=function(e){return`#`+e},jN=function(e){var t=e.prefixed,n=e.alpha,r=tN(e,[`prefixed`,`alpha`]),i=(0,s.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,``).substring(0,n?8:6)},[n]),a=(0,s.useCallback)(function(e){return function(e,t){var n=ON.exec(e),r=n?n[1].length:0;return r===3||r===6||!!t&&r===4||!!t&&r===8}(e,n)},[n]);return s.default.createElement(kN,eN({},r,{escape:i,format:t?AN:void 0,process:AN,validate:a}))};xN={alpha:`ألفا`,black:`أسود`,blue:`أزرق`,"blue purple":`أرجواني مزرق`,brightness:`السطوع`,brown:`بني`,"brown yellow":`أصفر بني`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`سماوي`,"cyan blue":`أزرق سماوي`,dark:`داكن`,gray:`رمادي`,grayish:`مائل للرمادي`,green:`أخضر`,"green cyan":`سماوي مخضر`,hue:`درجة اللون`,light:`فاتح`,lightness:`الإضاءة`,magenta:`أرجواني`,"magenta pink":`أرجواني وردي`,orange:`برتقالي`,"orange yellow":`أصفر برتقالي`,pale:`باهت`,pink:`وردي`,"pink red":`أحمر وردي`,purple:`أرجواني`,"purple magenta":`بنفسجي`,red:`أحمر`,"red orange":`برتقالي محمر`,saturation:`التشبع`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} شفاف`,"very dark":`داكن جدًا`,"very light":`فاتح جدًا`,vibrant:`ساطع`,white:`أبيض`,yellow:`أصفر`,"yellow green":`أخضر مصفر`};var MN={"ar-AE":xN,"bg-BG":{alpha:`Алфа`,black:`черно`,blue:`Синьо`,"blue purple":`синьо лилаво`,brightness:`Яркост`,brown:`кафяво`,"brown yellow":`кафяво жълто`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`циан`,"cyan blue":`циан синьо`,dark:`тъмно`,gray:`сиво`,grayish:`сивкав`,green:`Зелено`,"green cyan":`зелен циан`,hue:`Оттенък`,light:`светло`,lightness:`Лекота`,magenta:`магента`,"magenta pink":`магента розово`,orange:`оранжево`,"orange yellow":`оранжево жълто`,pale:`бледо`,pink:`розово`,"pink red":`розово червено`,purple:`лилаво`,"purple magenta":`лилаво магента`,red:`Червено`,"red orange":`червен портокал`,saturation:`Наситеност`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} прозрачен`,"very dark":`много тъмно`,"very light":`много светло`,vibrant:` ярко`,white:`бяло`,yellow:`жълто`,"yellow green":`жълто зелен`},"cs-CZ":{alpha:`Alfa`,black:`černá`,blue:`Modrá`,"blue purple":`modrofialová`,brightness:`Jas`,brown:`hnědá`,"brown yellow":`hnědožlutá`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`tyrkysová`,"cyan blue":`tyrkysovomodrá`,dark:`tmavá`,gray:`šedá`,grayish:`našedlá`,green:`Zelená`,"green cyan":`zelenotyrkysová`,hue:`Odstín`,light:`světlá`,lightness:`Světlost`,magenta:`purpurová`,"magenta pink":`purpurově růžová`,orange:`oranžová`,"orange yellow":`oranžovožlutá`,pale:`bledá`,pink:`růžová`,"pink red":`růžovočervená`,purple:`fialová`,"purple magenta":`fialově purpurová`,red:`Červená`,"red orange":`červenooranžová`,saturation:`Sytost`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} průhledné`,"very dark":`velmi tmavá`,"very light":`velmi světlá`,vibrant:`zářivá`,white:`bílá`,yellow:`žlutá`,"yellow green":`žlutozelená`},"da-DK":{alpha:`Alfa`,black:`sort`,blue:`Blå`,"blue purple":`blålilla`,brightness:`Lysstyrke`,brown:`brun`,"brown yellow":`brungul`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cyan`,"cyan blue":`cyan blå`,dark:`mørk`,gray:`grå`,grayish:`grålig`,green:`Grøn`,"green cyan":`grøn cyan`,hue:`Tone`,light:`lys`,lightness:`Lyshed`,magenta:`magenta`,"magenta pink":`magenta pink`,orange:`orange`,"orange yellow":`orangegul`,pale:`bleg`,pink:`lyserød`,"pink red":`lyserødlig rød`,purple:`lilla`,"purple magenta":`lilla magenta`,red:`Rød`,"red orange":`rødorange`,saturation:`Farvemætning`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gennemsigtig`,"very dark":`meget mørk`,"very light":`meget lys`,vibrant:`klar`,white:`hvid`,yellow:`gul`,"yellow green":`gulgrøn`},"de-DE":{alpha:`Alpha`,black:`Schwarz`,blue:`Blau`,"blue purple":`Blaulila`,brightness:`Helligkeit`,brown:`Braun`,"brown yellow":`Braungelb`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`Cyan`,"cyan blue":`Cyanblau`,dark:`dunkles`,gray:`Grau`,grayish:`gräuliches`,green:`Grün`,"green cyan":`Grüncyan`,hue:`Farbton`,light:`helles`,lightness:`Leuchtkraft`,magenta:`Magenta`,"magenta pink":`Magentarosa`,orange:`Orange`,"orange yellow":`Orangegelb`,pale:`blasses`,pink:`Rosa`,"pink red":`Rosarot`,purple:`Lila`,"purple magenta":`Lilamagenta`,red:`Rot`,"red orange":`Rotorange`,saturation:`Sättigung`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, zu ${e.percentTransparent} transparent`,"very dark":`sehr dunkles`,"very light":`sehr helles`,vibrant:`lebhaftes`,white:`Weiß`,yellow:`Gelb`,"yellow green":`Gelbgrün`},"el-GR":{alpha:`Άλφα`,black:`μαύρο`,blue:`Μπλε`,"blue purple":`μπλε μωβ`,brightness:`Φωτεινότητα`,brown:`καφέ`,"brown yellow":`καφέ κίτρινο`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`κυανό`,"cyan blue":`κυανό μπλε`,dark:`σκούρο`,gray:`γκρι`,grayish:`γκριζωπό`,green:`Πράσινο`,"green cyan":`πράσινο κυανό`,hue:`Τόνος`,light:`ανοιχτό`,lightness:`Φωτεινότητα`,magenta:`ματζέντα`,"magenta pink":`ματζέντα ροζ`,orange:`πορτοκαλί`,"orange yellow":`πορτοκαλί κίτρινο`,pale:`ανοιχτό`,pink:`ροζ`,"pink red":`ροζ κόκκινο`,purple:`μωβ`,"purple magenta":`μωβ ματζέντα`,red:`Κόκκινο`,"red orange":`κόκκινο πορτοκαλί`,saturation:`Κορεσμός`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} διαφανές`,"very dark":`πολύ σκούρο`,"very light":`πολύ ανοιχτό`,vibrant:`έντονο`,white:`λευκό`,yellow:`κίτρινο`,"yellow green":`κίτρινο πράσινο`},"en-US":{hue:`Hue`,saturation:`Saturation`,lightness:`Lightness`,brightness:`Brightness`,red:`Red`,green:`Green`,blue:`Blue`,alpha:`Alpha`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":`very dark`,dark:`dark`,light:`light`,"very light":`very light`,pale:`pale`,grayish:`grayish`,vibrant:`vibrant`,black:`black`,white:`white`,gray:`gray`,pink:`pink`,"pink red":`pink red`,"red orange":`red orange`,brown:`brown`,orange:`orange`,"orange yellow":`orange yellow`,"brown yellow":`brown yellow`,yellow:`yellow`,"yellow green":`yellow green`,"green cyan":`green cyan`,cyan:`cyan`,"cyan blue":`cyan blue`,"blue purple":`blue purple`,purple:`purple`,"purple magenta":`purple magenta`,magenta:`magenta`,"magenta pink":`magenta pink`},"es-ES":{alpha:`Alpha`,black:`negro`,blue:`Azul`,"blue purple":`púrpura azulado`,brightness:`Brillo`,brown:`marrón`,"brown yellow":`amarillo amarronado`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cian`,"cyan blue":`azul cian`,dark:`oscuro`,gray:`gris`,grayish:`grisáceo`,green:`Verde`,"green cyan":`cian verdoso`,hue:`Tono`,light:`claro`,lightness:`Luminosidad`,magenta:`magenta`,"magenta pink":`rosa magenta`,orange:`naranja`,"orange yellow":`amarillo anaranjado`,pale:`pálido`,pink:`rosa`,"pink red":`rojo rosado`,purple:`morado`,"purple magenta":`magenta violáceo`,red:`Rojo`,"red orange":`naranja rojizo`,saturation:`Saturación`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":`muy oscuro`,"very light":`muy claro`,vibrant:`intenso`,white:`blanco`,yellow:`amarillo`,"yellow green":`verde amarillento`},"et-EE":{alpha:`Alfa`,black:`must`,blue:`Sinine`,"blue purple":`sinakaslilla`,brightness:`Heledus`,brown:`pruun`,"brown yellow":`pruunikaskollane`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`tsüaan`,"cyan blue":`tsüaansinine`,dark:`tume`,gray:`hall`,grayish:`hallikas`,green:`Roheline`,"green cyan":`tsüaanroheline`,hue:`Värv`,light:`valgus`,lightness:`Valgus`,magenta:`magentapunane`,"magenta pink":`magentaroosa`,orange:`oranž`,"orange yellow":`oranžikaskollane`,pale:`kahvatu`,pink:`roosa`,"pink red":`vaarikapunane`,purple:`lilla`,"purple magenta":`purpurne magenta`,red:`Punane`,"red orange":`punakasoranž`,saturation:`Küllastus`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} läbipaistev`,"very dark":`väga tume`,"very light":`väga hele`,vibrant:`ere`,white:`valge`,yellow:`kollane`,"yellow green":`kollakasroheline`},"fi-FI":{alpha:`Alpha`,black:`musta`,blue:`Sininen`,"blue purple":`sinivioletti`,brightness:`Kirkkaus`,brown:`ruskea`,"brown yellow":`ruskeankeltainen`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`syaani`,"cyan blue":`syaaninsininen`,dark:`tumma`,gray:`harmaa`,grayish:`harmahtava`,green:`Vihreä`,"green cyan":`vihreänsyaani`,hue:`Sävy`,light:`vaalea`,lightness:`Valomäärä`,magenta:`magenta`,"magenta pink":`magentapinkki`,orange:`oranssi`,"orange yellow":`oranssinkeltainen`,pale:`vaalea`,pink:`pinkki`,"pink red":`vaaleanpunainen`,purple:`violetti`,"purple magenta":`violettimagenta`,red:`Punainen`,"red orange":`punaoranssi`,saturation:`Värikylläisyys`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} läpinäkyvä`,"very dark":`hyvin tumma`,"very light":`erittäin vaalea`,vibrant:`eloisa`,white:`valkea`,yellow:`keltainen`,"yellow green":`keltavihreä`},"fr-FR":{alpha:`Alpha`,black:`Noir`,blue:`Bleu`,"blue purple":`Violet bleu`,brightness:`Luminosité`,brown:`Brun`,"brown yellow":`Jaune brun`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`Cyan`,"cyan blue":`Bleu cyan`,dark:`Sombre`,gray:`Gris`,grayish:`Grisâtre`,green:`Vert`,"green cyan":`Cyan vert`,hue:`Teinte`,light:`Clair`,lightness:`Luminosité`,magenta:`Magenta`,"magenta pink":`Rose magenta`,orange:`Orange`,"orange yellow":`Jaune orangé`,pale:`Pâle`,pink:`Rose`,"pink red":`Rouge rosé`,purple:`Violet`,"purple magenta":`Magenta violet`,red:`Rouge`,"red orange":`Orange rouge`,saturation:`Saturation`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":`Très sombre`,"very light":`Très clair`,vibrant:`Vif`,white:`Blanc`,yellow:`Jaune`,"yellow green":`Vert jaune`},"he-IL":{alpha:`אלפא`,black:`שחור`,blue:`כחול`,"blue purple":`כחול סגול`,brightness:`בהירות`,brown:`חום`,"brown yellow":`חום צהוב`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`טורקיז`,"cyan blue":`כחול ציאן`,dark:`כהה`,gray:`אפור`,grayish:`אפרפר`,green:`ירוק`,"green cyan":`ציאן ירוק`,hue:`גוון`,light:`אור`,lightness:`כמות אור`,magenta:`מג'נטה`,"magenta pink":`ורוד מג'נטה`,orange:`כתום`,"orange yellow":`כתום צהוב`,pale:`חיוור`,pink:`ורוד`,"pink red":`ורוד אדום`,purple:`סגול`,"purple magenta":`מג'נטה סגול`,red:`אדום`,"red orange":`כתום אדום`,saturation:`רוויה`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} שקוף`,"very dark":`כהה מאוד`,"very light":`בהיר מאוד`,vibrant:`תוסס`,white:`לבן`,yellow:`צהוב`,"yellow green":`צהוב ירוק`},"hr-HR":{alpha:`Alfa`,black:`crno`,blue:`Plava`,"blue purple":`plavo ljubičasta`,brightness:`Svjetlina`,brown:`smeđa`,"brown yellow":`smeđe žuta`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cijan`,"cyan blue":`cijan plava`,dark:`tamno`,gray:`siva`,grayish:`sivkasto`,green:`Zelena`,"green cyan":`zelena cijan`,hue:`Nijansa`,light:`svjetlo`,lightness:`Osvijetljenost`,magenta:`magenta`,"magenta pink":`magentno ružičasta`,orange:`narančasta`,"orange yellow":`narančasto žuta`,pale:`blijeda`,pink:`ružičasta`,"pink red":`ružičasto crvena`,purple:`ljubičasta`,"purple magenta":`ljubičasta magenta`,red:`Crvena`,"red orange":`crveno narančasta`,saturation:`Zasićenost`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirnosti`,"very dark":`jako tamna`,"very light":`vrlo svijetlo`,vibrant:`vibrantna`,white:`bijela`,yellow:`žuto`,"yellow green":`žuto zelena`},"hu-HU":{alpha:`Alfa`,black:`fekete`,blue:`Kék`,"blue purple":`kék lila`,brightness:`Fényesség`,brown:`barna`,"brown yellow":`barna sárga`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`ciánkék`,"cyan blue":`ciánkék`,dark:`sötét`,gray:`szürke`,grayish:`szürkés`,green:`Zöld`,"green cyan":`zöld ciánkék`,hue:`Színárnyalat`,light:`világos`,lightness:`Világosság`,magenta:`bíbor`,"magenta pink":`bíbor rózsaszín`,orange:`narancs`,"orange yellow":`narancssárga`,pale:`halvány`,pink:`rózsaszín`,"pink red":`rózsaszín piros`,purple:`lila`,"purple magenta":`lila bíbor`,red:`Piros`,"red orange":`piros narancs`,saturation:`Telítettség`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} átlátszó`,"very dark":`nagyon sötét`,"very light":`nagyon világos`,vibrant:`élénk`,white:`fehér`,yellow:`sárga`,"yellow green":`sárga zöld`},"it-IT":{alpha:`Alfa`,black:`nero`,blue:`Blu`,"blue purple":`blu viola`,brightness:`Luminosità`,brown:`marrone`,"brown yellow":`giallo bruno`,colorName:e=>`${e.hue} ${e.chroma} ${e.lightness}`,cyan:`ciano`,"cyan blue":`blu ciano`,dark:`scuro`,gray:`grigio`,grayish:`grigiastro`,green:`Verde`,"green cyan":`verde ciano`,hue:`Tonalità`,light:`chiaro`,lightness:`Luminosità`,magenta:`magenta`,"magenta pink":`rosa magenta`,orange:`arancio`,"orange yellow":`giallo arancio`,pale:`tenue`,pink:`rosa`,"pink red":`rosa rosso`,purple:`viola`,"purple magenta":`viola magenta`,red:`Rosso`,"red orange":`rosso arancio`,saturation:`Saturazione`,transparentColorName:e=>`${e.hue} ${e.chroma} ${e.lightness}, trasparenza ${e.percentTransparent}`,"very dark":`molto scuro`,"very light":`molto chiaro`,vibrant:`vivace`,white:`bianco`,yellow:`giallo`,"yellow green":`giallo verde`},"ja-JP":{alpha:`アルファ`,black:`ブラック`,blue:`青`,"blue purple":`ブルーパープル`,brightness:`明るさ`,brown:`ブラウン`,"brown yellow":`ブラウンイエロー`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`シアン`,"cyan blue":`シアンブルー`,dark:`ダーク`,gray:`グレー`,grayish:`グレイッシュ`,green:`緑`,"green cyan":`グリーンシアン`,hue:`色相`,light:`ライト`,lightness:`明度`,magenta:`マゼンタ`,"magenta pink":`マゼンタピンク`,orange:`オレンジ`,"orange yellow":`オレンジイエロー`,pale:`ペール`,pink:`ピンク`,"pink red":`ピンクレッド`,purple:`パープル`,"purple magenta":`パープルマゼンタ`,red:`赤`,"red orange":`レッドオレンジ`,saturation:`彩度`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} 透明`,"very dark":`最も暗い`,"very light":`ベリーライト`,vibrant:`鮮やか`,white:`ホワイト`,yellow:`イエロー`,"yellow green":`イエローグリーン`},"ko-KR":{alpha:`알파`,black:`검은색`,blue:`파랑`,"blue purple":`청자색`,brightness:`명도`,brown:`갈색`,"brown yellow":`황갈색`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`청록색`,"cyan blue":`청록색`,dark:`다크`,gray:`회색`,grayish:`회갈색`,green:`초록`,"green cyan":`청록색`,hue:`색조`,light:`라이트`,lightness:`밝기`,magenta:`자홍색`,"magenta pink":`마젠타 핑크`,orange:`주황색`,"orange yellow":`불그스름한 노랑`,pale:`흙색`,pink:`분홍색`,"pink red":`핑크 레드`,purple:`자주색`,"purple magenta":`보라빛 자홍색`,red:`빨강`,"red orange":`붉은 주황색`,saturation:`채도`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} 투명도`,"very dark":`매우 어두운`,"very light":`매우 연함`,vibrant:`강렬한`,white:`흰색`,yellow:`노란색`,"yellow green":`연두색`},"lt-LT":{alpha:`Alfa`,black:`juoda`,blue:`Mėlyna`,"blue purple":`melsvai violetinė`,brightness:`Ryškumas`,brown:`ruda`,"brown yellow":`rusvai geltona`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`žalsvai mėlyna`,"cyan blue":`žalsvai mėlyna`,dark:`tamsi`,gray:`pilka`,grayish:`pilkšva`,green:`Žalia`,"green cyan":`žalsvai mėlyna`,hue:`Atspalvis`,light:`šviesi`,lightness:`Šviesumas`,magenta:`rausvai raudona`,"magenta pink":`purpurinė`,orange:`oranžinė`,"orange yellow":`oranžinio atspalvio geltona`,pale:`blyški`,pink:`rožinė`,"pink red":`rožinė raudona`,purple:`violetinė`,"purple magenta":`purpurinė rausvai raudona`,red:`Raudona`,"red orange":`rausvai oranžinė`,saturation:`Įsotinimas`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} skaidri`,"very dark":`labai tamsi`,"very light":`labai šviesi`,vibrant:`ryški`,white:`balta`,yellow:`geltona`,"yellow green":`gelsvai žalia`},"lv-LV":{alpha:`Alfa`,black:`melns`,blue:`Zila`,"blue purple":`zili violets`,brightness:`Spilgtums`,brown:`brūns`,"brown yellow":`brūni dzeltens`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`ciāns`,"cyan blue":`ciāna zils`,dark:`tumšs`,gray:`pelēks`,grayish:`pelēcīgs`,green:`Zaļa`,"green cyan":`zaļš ciāns`,hue:`Nokrāsa`,light:`gaišs`,lightness:`Gaišums`,magenta:`fuksiju`,"magenta pink":`fuksiju rozā`,orange:`oranžs`,"orange yellow":`oranži dzeltens`,pale:`bāls`,pink:`rozā`,"pink red":`rozīgi sarkans`,purple:`violets`,"purple magenta":`violets fuksiju`,red:`Sarkana`,"red orange":`sarkanīgi oranžs`,saturation:`Piesātinājums`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} caurspīdīgs`,"very dark":`ļoti tumšs`,"very light":`ļoti gaišs`,vibrant:`košs`,white:`balts`,yellow:`dzeltens`,"yellow green":`dzelteni zaļš`},"nb-NO":{alpha:`Alfa`,black:`svart`,blue:`Blå`,"blue purple":`blålilla`,brightness:`Lysstyrke`,brown:`brun`,"brown yellow":`brungul`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cyan`,"cyan blue":`cyanblå`,dark:`mørk`,gray:`grå`,grayish:`gråaktig`,green:`Grønn`,"green cyan":`grønncyan`,hue:`Fargetone`,light:`lys`,lightness:`Lyshet`,magenta:`magenta`,"magenta pink":`magentarosa`,orange:`oransje`,"orange yellow":`oransjegul`,pale:`blek`,pink:`rosa`,"pink red":`rosarød`,purple:`lilla`,"purple magenta":`lillamagenta`,red:`Rød`,"red orange":`rødoransje`,saturation:`Metning`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gjennomsiktig`,"very dark":`svært mørk`,"very light":`svært lys`,vibrant:`levende`,white:`hvit`,yellow:`gul`,"yellow green":`gulgrønn`},"nl-NL":{alpha:`Alfa`,black:`zwart`,blue:`Blauw`,"blue purple":`paarsblauw`,brightness:`Helderheid`,brown:`bruin`,"brown yellow":`bruingeel`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cyaan`,"cyan blue":`cyaanblauw`,dark:`donker`,gray:`grijs`,grayish:`grijsachtig`,green:`Groen`,"green cyan":`cyaangroen`,hue:`Kleurtoon`,light:`licht`,lightness:`Lichtsterkte`,magenta:`magenta`,"magenta pink":`magentaroze`,orange:`oranje`,"orange yellow":`oranjegeel`,pale:`bleek`,pink:`roze`,"pink red":`rozerood`,purple:`paars`,"purple magenta":`magentapaars`,red:`Rood`,"red orange":`roodoranje`,saturation:`Verzadiging`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparant`,"very dark":`heel donker`,"very light":`heel licht`,vibrant:`levendig`,white:`wit`,yellow:`geel`,"yellow green":`geelgroen`},"pl-PL":{alpha:`Alfa`,black:`czarny`,blue:`Niebieski`,"blue purple":`niebiesko-fioletowy`,brightness:`Jasność`,brown:`brązowy`,"brown yellow":`brązowo-żółty`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cyjanowy`,"cyan blue":`cyjanowo-niebieski`,dark:`ciemny`,gray:`szary`,grayish:`szarawy`,green:`Zielony`,"green cyan":`zielono-cyjanowy`,hue:`Odcień`,light:`jasny`,lightness:`Jaskrawość`,magenta:`purpurowy`,"magenta pink":`purpurowo-różowy`,orange:`pomarańczowy`,"orange yellow":`pomarańczowo-żółty`,pale:`blady`,pink:`różowy`,"pink red":`różowo-czerwony`,purple:`fioletowy`,"purple magenta":`fioletowo-purpurowy`,red:`Czerwony`,"red orange":`czerwono-pomarańczowy`,saturation:`Nasycenie`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} przezroczystości`,"very dark":`bardzo ciemny`,"very light":`bardzo jasny`,vibrant:`intensywny`,white:`biały`,yellow:`żółty`,"yellow green":`żółto-zielony`},"pt-BR":{alpha:`Alfa`,black:`preto`,blue:`Azul`,"blue purple":`roxo azulado`,brightness:`Brilho`,brown:`marrom`,"brown yellow":`marrom amarelado`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`ciano`,"cyan blue":`azul-ciano`,dark:`escuro`,gray:`cinza`,grayish:`acinzentado`,green:`Verde`,"green cyan":`verde-ciano`,hue:`Matiz`,light:`claro`,lightness:`Luminosidade`,magenta:`magenta`,"magenta pink":`rosa-magenta`,orange:`laranja`,"orange yellow":`amarelo alaranjado`,pale:`pálido`,pink:`rosa`,"pink red":`rosa avermelhado`,purple:`roxo`,"purple magenta":`roxo-magenta`,red:`Vermelho`,"red orange":`laranja avermelhado`,saturation:`Saturação`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":`muito escuro`,"very light":`muito claro`,vibrant:`vibrante`,white:`branco`,yellow:`amarelo`,"yellow green":`verde amarelado`},"pt-PT":{alpha:`Alfa`,black:`preto`,blue:`Azul`,"blue purple":`azul-púrpura`,brightness:`Luminosidade`,brown:`castanho`,"brown yellow":`amarelo-castanho`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`ciano`,"cyan blue":`azul-ciano`,dark:`escuro`,gray:`cinzento`,grayish:`acinzentado`,green:`Verde`,"green cyan":`verde-ciano`,hue:`Tonalidade`,light:`claro`,lightness:`Claridade`,magenta:`magenta`,"magenta pink":`rosa-magenta`,orange:`laranja`,"orange yellow":`amarelo-laranja`,pale:`pálido`,pink:`cor-de-rosa`,"pink red":`vermelho-rosa`,purple:`púrpura`,"purple magenta":`púrpura-magenta`,red:`Vermelho`,"red orange":`laranja-vermelho`,saturation:`Saturação`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":`muito escuro`,"very light":`muito claro`,vibrant:`vibrante`,white:`branco`,yellow:`amarelo`,"yellow green":`verde-amarelo`},"ro-RO":{alpha:`Alfa`,black:`negru`,blue:`Albastru`,"blue purple":`albastru-violet`,brightness:`Luminozitate`,brown:`maro`,"brown yellow":`galben maro`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`bleu`,"cyan blue":`albastru-bleu`,dark:`închis`,gray:`gri`,grayish:`cenușiu`,green:`Verde`,"green cyan":`verde bleu`,hue:`Nuanță`,light:`deschis`,lightness:`Luminozitate`,magenta:`fucsia`,"magenta pink":`roz-fucsia`,orange:`portocaliu`,"orange yellow":`galben-portocaliu`,pale:`pal`,pink:`roz`,"pink red":`roz-roșu`,purple:`violet`,"purple magenta":`violet-fucsia`,red:`Roșu`,"red orange":`portocaliu-roșu`,saturation:`Saturație`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":`foarte închis`,"very light":`foarte deschis`,vibrant:`plin de viață`,white:`alb`,yellow:`galben`,"yellow green":`galben-verde`},"ru-RU":{alpha:`Альфа`,black:`черный`,blue:`Синий`,"blue purple":`сине-фиолетовый`,brightness:`Яркость`,brown:`коричневый`,"brown yellow":`коричнево-желтый`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`голубой`,"cyan blue":`цвет морской волны`,dark:`темный`,gray:`серый`,grayish:`сероватый`,green:`Зеленый`,"green cyan":`сине-зеленый`,hue:`Оттенок`,light:`светлый`,lightness:`Освещенность`,magenta:`пурпурный`,"magenta pink":`пурпурно-розовый`,orange:`оранжевый`,"orange yellow":`оранжево-желтый`,pale:`бледный`,pink:`розовый`,"pink red":`розово-красный`,purple:`фиолетовый`,"purple magenta":`фиолетово-пурпурный`,red:`Красный`,"red orange":`красно-оранжевый`,saturation:`Насыщенность`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, прозрачный на ${e.percentTransparent}`,"very dark":`очень темный`,"very light":`очень светлый`,vibrant:`яркий`,white:`белый`,yellow:`желтый`,"yellow green":`желто-зеленый`},"sk-SK":{alpha:`Alfa`,black:`čierna`,blue:`Modrá`,"blue purple":`modrofialová`,brightness:`Jas`,brown:`hnedá`,"brown yellow":`hnedožltá`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`azúrová`,"cyan blue":`azúrová modrá`,dark:`tmavá`,gray:`sivá`,grayish:`sivastá`,green:`Zelená`,"green cyan":`zelená azúrová`,hue:`Odtieň`,light:`svetlá`,lightness:`Svetlosť`,magenta:`purpurová`,"magenta pink":`ružová purpurová`,orange:`oranžová`,"orange yellow":`oranžovožltá`,pale:`bledá`,pink:`ružová`,"pink red":`ružovočervená`,purple:`fialová`,"purple magenta":`fialová purpurová`,red:`Červená`,"red orange":`červenooranžová`,saturation:`Sýtosť`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} priehľadná`,"very dark":`veľmi tmavá`,"very light":`veľmi svetlá`,vibrant:`energická`,white:`biela`,yellow:`žltá`,"yellow green":`žltozelená`},"sl-SI":{alpha:`Alfa`,black:`črna`,blue:`Modra`,"blue purple":`modro vijolična`,brightness:`Svetlost`,brown:`rjava`,"brown yellow":`rjavo rumena`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cian`,"cyan blue":`cian modra`,dark:`temna`,gray:`siva`,grayish:`sivkasta`,green:`Zelena`,"green cyan":`zelena cian`,hue:`Barva`,light:`svetla`,lightness:`Lahkost`,magenta:`škrlatna`,"magenta pink":`škrlatno roza`,orange:`oranžna`,"orange yellow":`oranžno rumena`,pale:`bleda`,pink:`roza`,"pink red":`roza rdeča`,purple:`vijolična`,"purple magenta":`vijolično škrlatna`,red:`Rdeča`,"red orange":`rdeče oranžna`,saturation:`Nasičenost`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozorna`,"very dark":`zelo temna`,"very light":`zelo svetla`,vibrant:`živahna`,white:`bela`,yellow:`rumena`,"yellow green":`rumeno zelena`},"sr-SP":{alpha:`Alfa`,black:`crno`,blue:`Plava`,"blue purple":`plavoljubičasta`,brightness:`Osvetljenost`,brown:`smeđa`,"brown yellow":`smeđežuta`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cijan`,"cyan blue":`cijan plava`,dark:`tamno`,gray:`siva`,grayish:`sivkasta`,green:`Zelena`,"green cyan":`zeleno cijan`,hue:`Nijansa`,light:`svetla`,lightness:`Osvetljenje`,magenta:`purpurnocrvena`,"magenta pink":`magenta ružičasta`,orange:`narandžasta`,"orange yellow":`narandžastožuta`,pale:`bledo`,pink:`ružičasta`,"pink red":`ružičastocrvena`,purple:`ljubičasta`,"purple magenta":`ljubičasta magenta`,red:`Crvena`,"red orange":`crvenonarandžasta`,saturation:`Zasićenje`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirna`,"very dark":`veoma tamno`,"very light":`vrlo svetlo`,vibrant:`živopisna`,white:`bela`,yellow:`žuto`,"yellow green":`žutozelena`},"sv-SE":{alpha:`Alfa`,black:`svart`,blue:`Blått`,"blue purple":`blålila`,brightness:`Ljusstyrka`,brown:`brun`,"brown yellow":`brungul`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`cyan`,"cyan blue":`cyanblå`,dark:`mörk`,gray:`grå`,grayish:`gråaktig`,green:`Grönt`,"green cyan":`grön cyan`,hue:`Nyans`,light:`ljus`,lightness:`Ljushet`,magenta:`magenta`,"magenta pink":`magentarosa`,orange:`orange`,"orange yellow":`orangegul`,pale:`blek`,pink:`rosa`,"pink red":`rosaröd`,purple:`lila`,"purple magenta":`lila magenta`,red:`Rött`,"red orange":`rödorange`,saturation:`Mättnad`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} genomskinlig`,"very dark":`mycket mörk`,"very light":`mycket ljus`,vibrant:`livfull`,white:`vit`,yellow:`gul`,"yellow green":`gulgrön`},"tr-TR":{alpha:`Alfa`,black:`siyah`,blue:`Mavi`,"blue purple":`mavi mor`,brightness:`Parlaklık`,brown:`kahverengi`,"brown yellow":`kahverengi sarı`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`camgöbeği`,"cyan blue":`camgöbeği mavi`,dark:`koyu`,gray:`gri`,grayish:`grimsi`,green:`Yeşil`,"green cyan":`yeşil camgöbeği`,hue:`Ton`,light:`açık`,lightness:`Canlılık`,magenta:`eflatun`,"magenta pink":`eflatun pembe`,orange:`turuncu`,"orange yellow":`turuncu sarı`,pale:`solgun`,pink:`pembe`,"pink red":`pembe kırmızı`,purple:`mor`,"purple magenta":`mor eflatun`,red:`Kırmızı`,"red orange":`kırmızı portakal`,saturation:`Doygunluk`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} saydam`,"very dark":`çok koyu`,"very light":`çok açık`,vibrant:`canlı`,white:`beyaz`,yellow:`sarı`,"yellow green":`sarı yeşil`},"uk-UA":{alpha:`Альфа`,black:`чорний`,blue:`Синій`,"blue purple":`синьо-фіолетовий`,brightness:`Яскравість`,brown:`коричневий`,"brown yellow":`коричнево-жовтий`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`блакитний`,"cyan blue":`синьо-блакитний`,dark:`темний`,gray:`сірий`,grayish:`сіруватий`,green:`Зелений`,"green cyan":`зелено-блакитний`,hue:`Тон`,light:`світлий`,lightness:`Освітленість`,magenta:`пурпуровий`,"magenta pink":`пурпурово-рожевий`,orange:`помаранчевий`,"orange yellow":`помаранчево-жовтий`,pale:`блідий`,pink:`рожевий`,"pink red":`рожево-червоний`,purple:`фіолетовий`,"purple magenta":`фіолетово-пурпуровий`,red:`Червоний`,"red orange":`червоно-помаранчевий`,saturation:`Насиченість`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, прозорий на ${e.percentTransparent}`,"very dark":`дуже темний`,"very light":`дуже світлий`,vibrant:`яскравий`,white:`білий`,yellow:`жовтий`,"yellow green":`жовто-зелений`},"zh-CN":{alpha:`Alpha`,black:`黑色`,blue:`蓝色`,"blue purple":`蓝紫色`,brightness:`亮度`,brown:`棕色的`,"brown yellow":`棕黄色`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`蓝绿色`,"cyan blue":`青蓝色`,dark:`深色`,gray:`灰色`,grayish:`浅灰色的`,green:`绿色`,"green cyan":`绿青色`,hue:`色相`,light:`浅色`,lightness:`明亮度`,magenta:`紫红色`,"magenta pink":`紫粉色`,orange:`橙色`,"orange yellow":`橙黄色`,pale:`苍白的`,pink:`粉色`,"pink red":`粉红色`,purple:`紫色`,"purple magenta":`紫洋红色`,red:`红色`,"red orange":`红橙色`,saturation:`饱和度`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} 透明`,"very dark":`很暗`,"very light":`很浅`,vibrant:`生机勃勃`,white:`白色`,yellow:`黄色`,"yellow green":`黄色/绿色`},"zh-TW":{alpha:`Alpha`,black:`黑`,blue:`藍色`,"blue purple":`藍紫`,brightness:`亮度`,brown:`棕`,"brown yellow":`棕黃`,colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:`青`,"cyan blue":`青藍`,dark:`暗`,gray:`灰`,grayish:`偏灰`,green:`綠色`,"green cyan":`青綠`,hue:`色相`,light:`淺`,lightness:`明亮`,magenta:`洋紅`,"magenta pink":`淺洋紅`,orange:`橙`,"orange yellow":`橙黃`,pale:`淡`,pink:`粉紅`,"pink red":`粉紅`,purple:`紫`,"purple magenta":`紫洋紅`,red:`紅色`,"red orange":`橙紅`,saturation:`飽和度`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} 透明`,"very dark":`很暗`,"very light":`很淺`,vibrant:`鮮豔`,white:`白`,yellow:`黃`,"yellow green":`黃綠`}},NN=Symbol.for(`react-aria.i18n.locale`),PN=Symbol.for(`react-aria.i18n.strings`),FN,IN=class e{getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,n=`en-US`){if(t[e])return t[e];let r=function(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}(e);if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[NN];if(FN===void 0){let t=window[PN];if(!t)return null;FN={};for(let r in t)FN[r]=new e({[n]:t[r]},n)}let r=FN?.[t];if(!r)throw Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(e,t=`en-US`){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}},LN=new Map,RN=new Map,zN=class{format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return typeof n==`function`?n(t,this):n}plural(e,t,n=`cardinal`){let r=t[`=`+e];if(r)return typeof r==`function`?r():r;let i=this.locale+`:`+n,a=LN.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),LN.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=RN.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),RN.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}constructor(e,t){this.locale=e,this.strings=t}},BN=new Map,VN=!1;try{VN=new Intl.NumberFormat(`de-DE`,{signDisplay:`exceptZero`}).resolvedOptions().signDisplay===`exceptZero`}catch{}var HN=!1;try{HN=new Intl.NumberFormat(`de-DE`,{style:`unit`,unit:`degree`}).resolvedOptions().style===`unit`}catch{}var UN={degree:{narrow:{default:`°`,"ja-JP":` 度`,"zh-TW":`度`,"sl-SI":` °`}}},WN=class{format(e){let t=``;if(t=VN||this.options.signDisplay==null?this.numberFormatter.format(e):function(e,t,n){if(t===`auto`)return e.format(n);if(t===`never`)return e.format(Math.abs(n));{let r=!1;if(t===`always`?r=n>0||Object.is(n,0):t===`exceptZero`&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,``).replace(/\u200e|\u061C/,``);return[...i].length,t.replace(r,`!!!`).replace(i,`+`).replace(`!!!`,r)}return e.format(n)}}(this.numberFormatter,this.options.signDisplay,e),this.options.style===`unit`&&!HN){let{unit:e,unitDisplay:n=`short`,locale:r}=this.resolvedOptions();if(!e)return t;let i=UN[e]?.[n];t+=i[r]||i.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if(typeof this.numberFormatter.formatRange==`function`)return this.numberFormatter.formatRange(e,t);if(t<e)throw RangeError(`End date must be >= start date`);return`${this.format(e)} – ${this.format(t)}`}formatRangeToParts(e,t){if(typeof this.numberFormatter.formatRangeToParts==`function`)return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw RangeError(`End date must be >= start date`);let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:`startRange`})),{type:`literal`,value:` – `,source:`shared`},...r.map(e=>({...e,source:`endRange`}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!VN&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!HN&&this.options.style===`unit`&&(e={...e,style:`unit`,unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=function(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes(`-nu-`)&&(e.includes(`-u-`)||(e+=`-u-`),e+=`-nu-${n}`),t.style===`unit`&&!HN){var r;let{unit:e,unitDisplay:n=`short`}=t;if(!e)throw Error(`unit option must be provided with style: "unit"`);if((r=UN[e])==null||!r[n])throw Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:`decimal`}}let i=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():``);if(BN.has(i))return BN.get(i);let a=new Intl.NumberFormat(e,t);return BN.set(i,a),a}(e,t),this.options=t}},GN=new IN(function(e){return e&&e.__esModule?e.default:e}(MN)),KN=[[0,`pink`],[15,`red`],[48,`orange`],[94,`yellow`],[135,`green`],[175,`cyan`],[264,`blue`],[284,`purple`],[320,`magenta`],[349,`pink`]],qN=class{toHexInt(){return this.toFormat(`rgb`).toHexInt()}getChannelValue(e){if(e in this)return this[e];throw Error(`Unsupported color channel: `+e)}withChannelValue(e,t){if(e in this){let n=this.clone();return n[e]=t,n}throw Error(`Unsupported color channel: `+e)}getChannelName(e,t){return(IN.getGlobalDictionaryForPackage(`@react-stately/color`)||GN).getStringForLocale(e,t)}getColorSpaceAxes(e){let{xChannel:t,yChannel:n}=e,r=t||this.getColorChannels().find(e=>e!==n),i=n||this.getColorChannels().find(e=>e!==r);return{xChannel:r,yChannel:i,zChannel:this.getColorChannels().find(e=>e!==r&&e!==i)}}getColorName(e){let t,[n,r,i]=eP(this),a=IN.getGlobalDictionaryForPackage(`@react-stately/color`)||GN;if(n>.999)return a.getStringForLocale(`white`,e);if(n<.001)return a.getStringForLocale(`black`,e);[t,n]=this.getOklchHue(n,r,i,e);let o=``,s=``;r<=.1&&r>=.001?s=n>=.7?`pale`:`grayish`:r>=.15&&(s=`vibrant`),n<.3?o=`very dark`:n<.55?o=`dark`:n<.7||(o=n<.85?`light`:`very light`),s&&=a.getStringForLocale(s,e),o&&=a.getStringForLocale(o,e);let c=this.getChannelValue(`alpha`),l=new zN(e,a);if(c<1){let n=new WN(e,{style:`percent`}).format(1-c);return l.format(`transparentColorName`,{lightness:o,chroma:s,hue:t,percentTransparent:n}).replace(/\s+/g,` `).trim()}return l.format(`colorName`,{lightness:o,chroma:s,hue:t}).replace(/\s+/g,` `).trim()}getOklchHue(e,t,n,r){let i=IN.getGlobalDictionaryForPackage(`@react-stately/color`)||GN;if(t<.001)return[i.getStringForLocale(`gray`,r),e];for(let t=0;t<KN.length;t++){let[a,o]=KN[t],[s,c]=KN[t+1]||[360,`pink`];if(n>=a&&n<s)return o===`orange`&&(e<.68?o=`brown`:e=e-.68+.55),n>a+(s-a)/2&&o!==c?o=`${o} ${c}`:o===`yellow`&&e<.85&&(o=`yellow green`),[i.getStringForLocale(o,r).toLocaleLowerCase(r),e]}throw Error(`Unexpected hue`)}getHueName(e){let[t,n,r]=eP(this),[i]=this.getOklchHue(t,n,r,e);return i}},JN=class e extends qN{static parse(t){let n=[];if(/^#[\da-f]+$/i.test(t)&&[4,5,7,9].includes(t.length)){let e=(t.length<6?t.replace(/[^#]/gi,`$&$&`):t).slice(1).split(``);for(;e.length>0;)n.push(parseInt(e.splice(0,2).join(``),16));n[3]=n[3]===void 0?void 0:n[3]/255}let r=t.match(/^rgba?\((.*)\)$/);return r!=null&&r[1]&&(n=r[1].split(`,`).map(e=>Number(e.trim())),n=n.map((e,t)=>iE(e,0,t<3?255:1))),n.length<3?void 0:new e(n[0],n[1],n[2],n[3]??1)}toString(e=`css`){switch(e){case`hex`:return`#`+(this.red.toString(16).padStart(2,`0`)+this.green.toString(16).padStart(2,`0`)+this.blue.toString(16).padStart(2,`0`)).toUpperCase();case`hexa`:return`#`+(this.red.toString(16).padStart(2,`0`)+this.green.toString(16).padStart(2,`0`)+this.blue.toString(16).padStart(2,`0`)+Math.round(255*this.alpha).toString(16).padStart(2,`0`)).toUpperCase();case`rgb`:return`rgb(${this.red}, ${this.green}, ${this.blue})`;case`css`:case`rgba`:return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case`hex`:case`hexa`:case`rgb`:case`rgba`:return this;case`hsb`:case`hsba`:return this.toHSB();case`hsl`:case`hsla`:return this.toHSL();default:throw Error(`Unsupported color conversion: rgb -> `+e)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){let e=this.red/255,t=this.green/255,n=this.blue/255,r=Math.min(e,t,n),i=Math.max(e,t,n),a=i-r,o=i===0?0:a/i,s=0;if(a!==0){switch(i){case e:s=(t-n)/a+(t<n?6:0);break;case t:s=(n-e)/a+2;break;case n:s=(e-t)/a+4}s/=6}return new XN(oE(360*s,2),oE(100*o,2),oE(100*i,2),this.alpha)}toHSL(){let e=this.red/255,t=this.green/255,n=this.blue/255,r=Math.min(e,t,n),i=Math.max(e,t,n),a=(i+r)/2,o=i-r,s,c;if(o===0)s=c=0;else{switch(c=o/(a<.5?i+r:2-i-r),i){case e:s=(t-n)/o+(t<n?6:0);break;case t:s=(n-e)/o+2;break;case n:s=(e-t)/o+4}s/=6}return new $N(oE(360*s,2),oE(100*c,2),oE(100*a,2),this.alpha)}clone(){return new e(this.red,this.green,this.blue,this.alpha)}getChannelRange(e){switch(e){case`red`:case`green`:case`blue`:return{minValue:0,maxValue:255,step:1,pageSize:17};case`alpha`:return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw Error(`Unknown color channel: `+e)}}getChannelFormatOptions(e){switch(e){case`red`:case`green`:case`blue`:return{style:`decimal`};case`alpha`:return{style:`percent`};default:throw Error(`Unknown color channel: `+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return new WN(t,n).format(r)}getColorSpace(){return`rgb`}getColorChannels(){return e.colorChannels}constructor(e,t,n,r){super(),this.red=e,this.green=t,this.blue=n,this.alpha=r}};JN.colorChannels=[`red`,`green`,`blue`];var YN=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,XN=class e extends qN{static parse(t){let n;if(n=t.match(YN)){let[t,r,i,a]=(n[1]??n[2]).split(`,`).map(e=>Number(e.trim().replace(`%`,``)));return new e(QN(t,360),iE(r,0,100),iE(i,0,100),iE(a??1,0,1))}}toString(e=`css`){switch(e){case`css`:return this.toHSL().toString(`css`);case`hex`:return this.toRGB().toString(`hex`);case`hexa`:return this.toRGB().toString(`hexa`);case`hsb`:return`hsb(${this.hue}, ${oE(this.saturation,2)}%, ${oE(this.brightness,2)}%)`;case`hsba`:return`hsba(${this.hue}, ${oE(this.saturation,2)}%, ${oE(this.brightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case`hsb`:case`hsba`:return this;case`hsl`:case`hsla`:return this.toHSL();case`rgb`:case`rgba`:return this.toRGB();default:throw Error(`Unsupported color conversion: hsb -> `+e)}}toHSL(){let e=this.saturation/100,t=this.brightness/100,n=t*(1-e/2);return e=n===0||n===1?0:(t-n)/Math.min(n,1-n),new $N(oE(this.hue,2),oE(100*e,2),oE(100*n,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,n=this.brightness/100,r=(r,i=(r+e/60)%6)=>n-t*n*Math.max(Math.min(i,4-i,1),0);return new JN(Math.round(255*r(5)),Math.round(255*r(3)),Math.round(255*r(1)),this.alpha)}clone(){return new e(this.hue,this.saturation,this.brightness,this.alpha)}getChannelRange(e){switch(e){case`hue`:return{minValue:0,maxValue:360,step:1,pageSize:15};case`saturation`:case`brightness`:return{minValue:0,maxValue:100,step:1,pageSize:10};case`alpha`:return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw Error(`Unknown color channel: `+e)}}getChannelFormatOptions(e){switch(e){case`hue`:return{style:`unit`,unit:`degree`,unitDisplay:`narrow`};case`saturation`:case`brightness`:case`alpha`:return{style:`percent`};default:throw Error(`Unknown color channel: `+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return(e===`saturation`||e===`brightness`)&&(r/=100),new WN(t,n).format(r)}getColorSpace(){return`hsb`}getColorChannels(){return e.colorChannels}constructor(e,t,n,r){super(),this.hue=e,this.saturation=t,this.brightness=n,this.alpha=r}};XN.colorChannels=[`hue`,`saturation`,`brightness`];var ZN=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;function QN(e,t){return(e%t+t)%t}var $N=class e extends qN{static parse(t){let n;if(n=t.match(ZN)){let[t,r,i,a]=(n[1]??n[2]).split(`,`).map(e=>Number(e.trim().replace(`%`,``)));return new e(QN(t,360),iE(r,0,100),iE(i,0,100),iE(a??1,0,1))}}toString(e=`css`){switch(e){case`hex`:return this.toRGB().toString(`hex`);case`hexa`:return this.toRGB().toString(`hexa`);case`hsl`:return`hsl(${this.hue}, ${oE(this.saturation,2)}%, ${oE(this.lightness,2)}%)`;case`css`:case`hsla`:return`hsla(${this.hue}, ${oE(this.saturation,2)}%, ${oE(this.lightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case`hsl`:case`hsla`:return this;case`hsb`:case`hsba`:return this.toHSB();case`rgb`:case`rgba`:return this.toRGB();default:throw Error(`Unsupported color conversion: hsl -> `+e)}}toHSB(){let e=this.saturation/100,t=this.lightness/100,n=t+e*Math.min(t,1-t);return e=n===0?0:2*(1-t/n),new XN(oE(this.hue,2),oE(100*e,2),oE(100*n,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,n=this.lightness/100,r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return new JN(Math.round(255*i(0)),Math.round(255*i(8)),Math.round(255*i(4)),this.alpha)}clone(){return new e(this.hue,this.saturation,this.lightness,this.alpha)}getChannelRange(e){switch(e){case`hue`:return{minValue:0,maxValue:360,step:1,pageSize:15};case`saturation`:case`lightness`:return{minValue:0,maxValue:100,step:1,pageSize:10};case`alpha`:return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw Error(`Unknown color channel: `+e)}}getChannelFormatOptions(e){switch(e){case`hue`:return{style:`unit`,unit:`degree`,unitDisplay:`narrow`};case`saturation`:case`lightness`:case`alpha`:return{style:`percent`};default:throw Error(`Unknown color channel: `+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return(e===`saturation`||e===`lightness`)&&(r/=100),new WN(t,n).format(r)}getColorSpace(){return`hsl`}getColorChannels(){return e.colorChannels}constructor(e,t,n,r){super(),this.hue=e,this.saturation=t,this.lightness=n,this.alpha=r}};function eP(e){let t=e.toFormat(`rgb`),n=t.getChannelValue(`red`)/255,r=t.getChannelValue(`green`)/255,i=t.getChannelValue(`blue`)/255;[n,r,i]=function(e,t,n){return[tP(e),tP(t),tP(n)]}(n,r,i);let[a,o,s]=function(e,t,n){return nP([.4123907992659595,.35758433938387796,.1804807884018343,.21263900587151036,.7151686787677559,.07219231536073371,.01933081871559185,.11919477979462599,.9505321522496606],e,t,n)}(n,r,i),[c,l,u]=function(e,t,n){let r=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],i=[.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],[a,o,s]=nP(r,e,t,n);return nP(i,Math.cbrt(a),Math.cbrt(o),Math.cbrt(s))}(a,o,s);return function(e,t,n){var r=180*Math.atan2(n,t)/Math.PI;return[e,Math.sqrt(t**2+n**2),r>=0?r:r+360]}(c,l,u)}function tP(e){let t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}function nP(e,t,n,r){return[e[0]*t+e[1]*n+e[2]*r,e[3]*t+e[4]*n+e[5]*r,e[6]*t+e[7]*n+e[8]*r]}$N.colorChannels=[`hue`,`saturation`,`lightness`];function rP({onChange:e,value:t,colors:n}){return(0,l.jsx)(`div`,{className:`flex flex-wrap gap-6`,children:n.map(n=>{let r=t===n;return(0,l.jsx)(PD,{onClick:()=>{e?.(n)},className:K(`relative block flex-shrink-0 w-26 h-26 border rounded`,r&&`shadow-md`),style:{backgroundColor:n},children:r&&(0,l.jsx)(`span`,{className:`absolute inset-0 m-auto rounded-full w-8 h-8 bg-white`})},n)})})}var iP=[{color:`rgb(255, 255, 255)`,name:G(`White`)},{color:`rgb(239,245,245)`,name:G(`Solitude`)},{color:`rgb(245,213,174)`,name:G(`Wheat`)},{color:`rgb(253,227,167)`,name:G(`Cape Honey`)},{color:`rgb(242,222,186)`,name:G(`Milk punch`)},{color:`rgb(97,118,75)`,name:G(`Dingy`),foreground:`rgb(255, 255, 255)`},{color:`rgb(4, 147, 114)`,name:G(`Aquamarine`),foreground:`rgb(255, 255, 255)`},{color:`rgb(222,245,229)`,name:G(`Cosmic Latte`)},{color:`rgb(233,119,119)`,name:G(`Geraldine`),foreground:`rgb(90,14,14)`},{color:`rgb(247,164,164)`,name:G(`Sundown`)},{color:`rgb(30,139,195)`,name:G(`Pelorous`),foreground:`rgb(255, 255, 255)`},{color:`rgb(142,68,173)`,name:G(`Deep Lilac`),foreground:`rgb(255, 255, 255)`},{color:`rgb(108,74,182)`,name:G(`Blue marguerite`),foreground:`rgb(255, 255, 255)`},{color:`rgb(139,126,116)`,name:G(`Americano`),foreground:`rgb(255, 255, 255)`},{color:`rgb(0,0,0)`,name:G(`Black`),foreground:`rgb(255, 255, 255)`},{color:`rgb(64,66,88)`,name:G(`Blue zodiac`),foreground:`rgb(255, 255, 255)`},{color:`rgb(101,100,124)`,name:G(`Comet`),foreground:`rgb(255, 255, 255)`}].map(({color:e})=>e).slice(0,14);function aP({defaultValue:e,onChange:t,colorPresets:n,showInput:r}){let[i,a]=(0,s.useState)(e),o=n||iP,c=MA({size:`sm`});return(0,l.jsxs)(`div`,{children:[(0,l.jsx)(DN,{className:`!w-auto`,color:i,onChange:e=>{t?.(e),a(e)}}),(0,l.jsxs)(`div`,{className:`px-12 py-20`,children:[o&&(0,l.jsx)(rP,{colors:o,onChange:e=>{if(e){let n=function(e){let t=JN.parse(e)||XN.parse(e)||$N.parse(e);if(t)return t;throw Error(`Invalid color value: `+e)}(e).toString(`hex`);t?.(n),a(n)}},value:i}),r&&(0,l.jsx)(`div`,{className:`pt-20`,children:(0,l.jsx)(jN,{autoComplete:`off`,role:`textbox`,autoCorrect:`off`,spellCheck:`false`,required:!0,"aria-label":`Hex color`,prefixed:!0,className:c.input,color:i,onChange:e=>{t?.(e),a(e)}})})]})]})}var oP=s.default.createContext(null);function sP(){return(0,s.useContext)(oP)}function cP(){let{lines:e,localeCode:t}=$k();return{trans:(0,s.useCallback)(n=>lP({...n,lines:e,localeCode:t}),[e,t])}}var lP=WD(e=>{let{lines:t,message:n,values:r,localeCode:i}=e;return n==null?``:(n=t?.[n]||t?.[n.toLowerCase()]||n,r&&(n=eA(i,e),Object.entries(r).forEach(([e,t])=>{n=n.replace(`:${e}`,`${t}`)})),n)},{equals:Qk,callTimeout:0});function uP({onDismiss:e}){let{trans:t}=cP();return(0,l.jsx)(`button`,{className:`sr-only`,"aria-label":t(G(`Dismiss`)),tabIndex:-1,onClick:()=>{e&&e()}})}function dP(e){let{type:t=`modal`,dialogProps:n,...r}=(0,s.useContext)(oP),{children:i,className:a,size:o=`md`,background:c,radius:u=`rounded`,maxWidth:d=`max-w-dialog`,...f}=e,p=null;(t===`popover`||t===`tray`)&&(p=(0,l.jsx)(uP,{onDismiss:r.close}));let m=o===`fullscreenTakeover`||t===`tray`,h=K(`mx-auto pointer-events-auto outline-none flex flex-col overflow-hidden`,c||`bg`,t!==`tray`&&function(e){switch(e){case`2xs`:return`w-256`;case`xs`:return`w-320`;case`sm`:return`w-384`;case`md`:return`w-440`;case`lg`:return`w-620`;case`xl`:return`w-780`;case`2xl`:return`w-850`;case`fullscreen`:return`w-1280`;case`fullscreenTakeover`:return`w-full h-full`;default:return e}}(o),t===`tray`&&`rounded-t border-b-bg`,o!==`fullscreenTakeover`&&`shadow-2xl border max-h-dialog`,!m&&`${u} ${d}`,a);return(0,l.jsxs)(`div`,{...GT({role:`dialog`,tabIndex:-1},n,f),style:{...e.style,"--be-dialog-padding":`24px`},"aria-modal":!0,className:h,children:[s.Children.toArray(i).map(e=>(0,s.isValidElement)(e)?(0,s.cloneElement)(e,{size:e.props.size??o}):e),p]})}var fP=q((0,l.jsx)(`path`,{d:`M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z`}),`KeyboardArrowDownOutlined`),pP=(0,s.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:n=!0,isDismissable:r=!0,isOpen:i=!1,placement:a=`center`,onClose:o},s)=>{let c=Gk(),u=eE(s);return(0,l.jsxs)(`div`,{className:`fixed inset-0 isolate z-modal`,style:c,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),e.preventDefault(),o())},children:[(0,l.jsx)(Xk,{onClick:()=>{r&&o()}},`modal-underlay`),(0,l.jsx)(CT.div,{ref:u,className:K(`pointer-events-none absolute inset-0 z-20 flex h-full w-full`,a===`center`&&`items-center justify-center`,a===`top`&&`items-start justify-center pt-40`),role:`presentation`,initial:{opacity:0,scale:a===`top`?1:.7},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1},transition:{duration:.1},children:(0,l.jsx)(kk,{restoreFocus:n,autoFocus:t,contain:!0,children:e})})]})});function mP(e){let{children:t,type:n,disableInitialTransition:r,isDismissable:i=!0,moveFocusToDialog:a=!0,returnFocusToTrigger:o=!0,triggerOnHover:u=!1,triggerOnContextMenu:d=!1,usePortal:f=!0,mobileType:p,alwaysReturnCurrentValueOnClose:m}=e,h=(0,s.useRef)(null),g=d&&!e.triggerRef?h:e.triggerRef,_=(0,s.useRef)(e.value),[v,y]=rE(e.isOpen,e.defaultIsOpen,e.onOpenChange),[b,x]=rE(e.value,e.defaultValue,e.onValueChange);uA()&&n===`popover`&&(n=p||`modal`);let S=(0,s.useRef)(null),{x:C,y:w,reference:T,strategy:E,refs:D}=lk({...e,disablePositioning:n===`modal`}),O=n===`popover`?{position:E,top:w??``,left:C??``}:{},k=(0,s.useId)(),A=`${k}-label`,j=`${k}-description`,M=`${k}-form`,N=function(e){let t=(0,s.useRef)(e);return(0,s.useEffect)(()=>{t.current=e}),(0,s.useMemo)(()=>(...e)=>t.current?.call(t,...e),[])}(e.onClose),P=(0,s.useCallback)(e=>{typeof e>`u`&&m&&(e=b);let t=typeof e<`u`?e:_.current;N?.(t,{initialValue:_.current,valueChanged:t!==_.current}),y(!1)},[N,y,b,m]),F=(0,s.useCallback)(()=>{y(!0),_.current=e.value},[e.value,y]);PT(()=>{g!=null&&g.current&&D.reference.current!==g.current&&T(g.current)},[T,g?.current,D]);let I=(0,s.useMemo)(()=>({"aria-labelledby":A,"aria-describedby":j}),[A,j]),L;L=n===`modal`?pP:n===`tray`?Zk:qk;let R=(0,s.useMemo)(()=>({dialogProps:I,type:n,labelId:A,descriptionId:j,isDismissable:i,close:P,value:b,initialValue:_.current,setValue:x,formId:M}),[P,j,I,M,A,n,i,b,x]);u&&=n===`popover`;let z={onPointerEnter:ND(e=>{F()}),onPointerLeave:ND(e=>{S.current=setTimeout(()=>{P()},150)})},ee={onPointerEnter:ND(e=>{S.current&&clearTimeout(S.current)}),onPointerLeave:ND(e=>{P()})},B={onContextMenu:ND(e=>{e.preventDefault(),h.current=function({x:e,y:t},n){return{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,right:e,bottom:t,left:e}),contextElement:n}}({x:e.clientX,y:e.clientY},e.currentTarget),F()})},te={onClick:ND(e=>{e.stopPropagation(),v?P():F()})},{dialogTrigger:ne,dialog:re}=function(e,t){let n=Array.isArray(e)?e:s.Children.toArray(e),r=n.length===2?n[1]:n[0];return r=typeof r==`function`?r(t):r,n.length===2?{dialogTrigger:n[0],dialog:r}:{dialog:r}}(t,R),ie=(0,l.jsx)(AT,{initial:!r,children:v&&(0,l.jsx)(oP.Provider,{value:R,children:(0,l.jsx)(L,{...u?ee:{},ref:D.setFloating,triggerRef:D.reference,style:O,restoreFocus:o,autoFocus:a,isOpen:v,onClose:P,isDismissable:i,isContextMenu:d,placement:e.placement,children:re})})});return(0,l.jsxs)(s.Fragment,{children:[ne&&(0,s.cloneElement)(ne,GT({...g||d?{}:{ref:T},...d?{}:te,...u?z:{},...d?B:{}},{...ne.props})),f?bb&&(0,c.createPortal)(ie,bb):ie]})}function hP(e){let{label:t,className:n,value:r,onChange:i,size:a,width:o=`w-max`}=e,c=Y(e=>e.config.ui?.colorPresets?.items)||[],u=MA({size:a}),[d,f]=(0,s.useState)(r),[p,m]=(0,s.useState)(!1);return(0,l.jsxs)(`div`,{className:K(n,o),children:[t&&(0,l.jsx)(`span`,{className:u.label,children:t}),(0,l.jsxs)(mP,{type:`popover`,isOpen:p,onOpenChange:m,children:[(0,l.jsxs)(PD,{className:K(u.input,`inline-flex items-center`),"aria-label":e[`aria-label`],children:[(0,l.jsx)(`span`,{className:`block flex-shrink-0 mr-5 border rounded h-2/4 aspect-square`,style:{backgroundColor:d}}),(0,l.jsx)(gP,{isActive:p,className:u.adornment})]}),(0,l.jsx)(dP,{size:`auto`,children:(0,l.jsx)(aP,{onChange:e=>{f(e),i?.(e)},defaultValue:d,colorPresets:c})})]})]})}function gP({isActive:e,className:t}){return(0,l.jsx)(fP,{size:`sm`,className:`transition-transform ml-auto flex-shrink-0 ${e?`rotate-180`:`rotate-0`} ${t}`})}function _P(e){let{size:t=`md`,inline:n,label:r,showValueLabel:i=!!r,className:a,width:o=`w-full`,slider:s,children:c,trackColor:u=`primary`,fillColor:d=`primary`}=e,{domProps:f,trackRef:p,getThumbPercent:m,getThumbValueLabel:h,labelId:g,groupId:_,thumbIds:v,isDisabled:y,numberFormatter:b,minValue:x,maxValue:S,step:C,values:w,getValueLabel:T}=s,E=``,D=Math.max([...b.format(x)].length,[...b.format(S)].length,[...b.format(C)].length);T?E=T(w[0]):w.length===1?E=h(0):w.length===2&&(E=`${h(0)} – ${h(1)}`,D=3+2*Math.max(D,[...b.format(x)].length,[...b.format(S)].length));let O=MA({size:t,disabled:y,labelDisplay:`flex`});return(0,l.jsxs)(`div`,{className:K(`touch-none`,a,o,{"flex items-center":n}),role:`group`,id:_,children:[(r||i)&&(0,l.jsxs)(`div`,{className:K(O.label,`select-none`),children:[r&&(0,l.jsx)(`label`,{onClick:()=>{var e;(e=document.getElementById(v[0]))==null||e.focus()},id:g,htmlFor:_,children:r}),i&&(0,l.jsx)(`output`,{htmlFor:v[0],className:`ml-auto text-right`,"aria-live":`off`,style:D?{width:`${D}ch`,minWidth:`${D}ch`}:void 0,children:E})]}),(0,l.jsxs)(`div`,{ref:p,className:K(`relative`,vP(e)),...f,role:`presentation`,children:[(0,l.jsx)(`div`,{className:K(`absolute inset-0 m-auto rounded`,bP(u,y),yP(t))}),(0,l.jsx)(`div`,{className:K(`absolute inset-0 my-auto rounded`,xP(d,y),yP(t)),style:{width:`${Math.max(100*m(0),0)}%`}}),c]})]})}function vP({size:e,wrapperHeight:t}){if(t)return t;switch(e){case`xs`:return`h-14`;case`sm`:return`h-20`;default:return`h-30`}}function yP(e){switch(e){case`xs`:return`h-2`;case`sm`:return`h-3`;default:return`h-4`}}function bP(e,t){switch(t&&(e=`disabled`),e){case`disabled`:return`bg-slider-disabled/60`;case`primary`:return`bg-primary-light`;case`neutral`:return`bg-divider`;default:return e}}function xP(e,t){switch(t&&(e=`disabled`),e){case`disabled`:return`bg-slider-disabled`;case`primary`:return`bg-primary`;default:return e}}function SP(e={}){let{localeCode:t}=$k();return(0,s.useMemo)(()=>new WN(t,e),[t,e])}function CP({minValue:e=0,maxValue:t=100,isDisabled:n=!1,step:r=1,formatOptions:i,onChangeEnd:a,onPointerDown:o,label:c,getValueLabel:l,showThumbOnHoverOnly:u,thumbSize:d,onPointerMove:f,...p}){let[m,h]=(0,s.useState)(!1),g=SP(i),{addGlobalListener:_,removeGlobalListener:v}=$T(),y=(0,s.useRef)(null),[b,x]=rE(p.value?p.value:void 0,p.defaultValue??[e],p.onChange),S=(0,s.useRef)(null);S.current=b;let[C,w]=(0,s.useState)(Array(b.length).fill(!1)),T=(0,s.useRef)(null);T.current=C;let E=t=>t===0?e:b[t-1],D=e=>e===b.length-1?t:b[e+1],O=(e,t)=>{n||!F(e)||!S.current||(t=function(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(isNaN(t)?0:t))%r,a=aE(2*Math.abs(i)>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return isNaN(t)?!isNaN(n)&&a>n&&(a=Math.floor(aE(n/r,r))*r):a<t?a=t:!isNaN(n)&&a>n&&(a=t+Math.floor(aE((n-t)/r,r))*r),a=aE(a,r),a}(t,E(e),D(e),r),S.current=wP(S.current,e,t),x(S.current))},k=(e,t)=>{if(n||!F(e))return;let r=T.current?.[e];T.current=wP(T.current||[],e,t),w(T.current),a&&r&&!T.current.some(Boolean)&&a(S.current||[])},[A,j]=(0,s.useState)(void 0),M=n=>(n=>{let r=Math.min(1,(n-e)/(t-e));return isNaN(r)?0:r})(S.current[n]),N=n=>jM((t=>Math.round((t-e)/r)*r+e)(n*(t-e)+e),e,t),P=(0,s.useRef)(Array(b.length).fill(!0)),F=e=>P.current[e],I=(0,s.useRef)(null),L=(0,s.useRef)(void 0),R=(0,s.useRef)(null),{domProps:z}=xM({onPointerDown:e=>{if((e.pointerType!==`mouse`||!(e.button!==0||e.altKey||e.ctrlKey||e.metaKey))&&(o?.(),y.current&&!n&&b.every((e,t)=>!C[t]))){let t=y.current.offsetWidth,n=y.current.getBoundingClientRect().left,r=N((e.clientX-n)/t),i,a=b.findIndex(e=>r-e<0);if(a===0)i=a;else if(a===-1)i=b.length-1;else{let e=b[a-1],t=b[a];i=Math.abs(e-r)<Math.abs(t-r)?a-1:a}i>=0&&F(i)?(e.preventDefault(),I.current=i,j(i),L.current=e.pointerId,k(I.current,!0),O(i,r),_(window,`pointerup`,B,!1)):I.current=null}},onMoveStart(){R.current=null},onMove(e,t){let n=y.current?.offsetWidth||0;if(R.current??=M(I.current||0)*n,R.current+=t,I.current!=null&&y.current){let e=jM(R.current/n,0,1);((e,t)=>{O(e,N(t))})(I.current,e)}},onMoveEnd(){I.current!=null&&(k(I.current,!1),I.current=null)}}),ee=GT(z,{onPointerEnter:()=>{h(!0)},onPointerLeave:()=>{h(!1)},onPointerMove:e=>{f?.(e)}}),B=e=>{e.pointerId===L.current&&(I.current!=null&&(k(I.current,!1),I.current=null),v(window,`pointerup`,B,!1))},te=(0,s.useId)();return{domProps:ee,trackRef:y,isDisabled:n,step:r,values:b,minValue:e,maxValue:t,focusedThumb:A,labelId:c?`${te}-label`:void 0,groupId:`${te}-group`,thumbIds:[...Array(b.length)].map((e,t)=>`${te}-thumb-${t}`),numberFormatter:g,getThumbPercent:M,getThumbMinValue:E,getThumbMaxValue:D,getThumbValueLabel:e=>function(e){return g.format(e)}(b[e]),isThumbDragging:e=>T.current?.[e]||!1,setThumbValue:O,updateDraggedThumbs:k,setThumbEditable:(e,t)=>{P.current[e]=t},setFocusedThumb:j,getValueLabel:l,isPointerOver:m,showThumbOnHoverOnly:u,thumbSize:d}}function wP(e,t,n){return e[t]===n?e:[...e.slice(0,t),n,...e.slice(t+1)]}function TP({index:e,slider:t,isDisabled:n,ariaLabel:r,inputRef:i,onBlur:a,fillColor:o=`primary`}){let c=eE(i),{addGlobalListener:u,removeGlobalListener:d}=$T(),{step:f,values:p,focusedThumb:m,labelId:h,thumbIds:g,isDisabled:_,getThumbPercent:v,getThumbMinValue:y,getThumbMaxValue:b,getThumbValueLabel:x,setThumbValue:S,updateDraggedThumbs:C,isThumbDragging:w,setThumbEditable:T,setFocusedThumb:E,isPointerOver:D,showThumbOnHoverOnly:O,thumbSize:k=`w-18 h-18`}=t,A=w(e),j=p[e];T(e,!n);let M=n||_,N=(0,s.useCallback)(()=>{c.current&&c.current.focus({preventScroll:!0})},[c]),P=m===e;(0,s.useEffect)(()=>{P&&N()},[P,N]);let F=(0,s.useRef)(void 0),I=t=>{t.pointerId===F.current&&(N(),C(e,!1),d(window,`pointerup`,I,!1))};return(0,l.jsx)(`div`,{role:`presentation`,className:K(`outline-none rounded-full top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-button duration-200`,k,!M&&`shadow-md`,function({isDisabled:e,isDragging:t,fillColor:n}){return e?`bg-slider-disabled cursor-default`:n&&n!==`primary`?n:K(`hover:bg-primary-dark`,t?`bg-primary-dark`:`bg-primary`)}({fillColor:o,isDisabled:M,isDragging:A}),!O||O&&A||D?`visible`:`invisible`),style:{left:`${Math.max(100*v(e),0)}%`},onPointerDown:t=>{t.button!==0||t.altKey||t.ctrlKey||t.metaKey||(N(),F.current=t.pointerId,C(e,!0),u(window,`pointerup`,I,!1))},children:(0,l.jsx)(`input`,{id:g[e],onKeyDown:ND(()=>{C(e,!0)}),onKeyUp:ND(()=>{C(e,!1)}),ref:c,tabIndex:M?void 0:0,min:y(e),max:b(e),step:f,value:j,disabled:M,"aria-label":r,"aria-labelledby":h,"aria-orientation":`horizontal`,"aria-valuetext":x(e),onFocus:()=>{E(e)},onBlur:t=>{E(void 0),C(e,!1),a?.(t)},onChange:t=>{S(e,parseFloat(t.target.value))},type:`range`,className:`sr-only`})})}function EP({inputRef:e,onBlur:t,...n}){let{onChange:r,onChangeEnd:i,value:a,defaultValue:o,...s}=n,c={...s,value:a==null?void 0:[a],defaultValue:o==null?void 0:[o],onChange:e=>{r?.(e[0])},onChangeEnd:e=>{i?.(e[0])}},u=CP(c);return(0,l.jsx)(_P,{...c,slider:u,children:(0,l.jsx)(TP,{fillColor:n.fillColor,index:0,slider:u,inputRef:e,onBlur:t})})}var DP=s.default.forwardRef((e,t)=>{let{value:n=0,minValue:r=0,maxValue:i=100,size:a=`md`,isIndeterminate:o=!1,className:s,position:c=`relative`,trackColor:u,fillColor:d=`border-primary`,...f}=e;n=jM(n,r,i);let p=function(e){switch(e){case`xs`:return`w-20 h-20`;case`sm`:return`w-24 h-24`;case`md`:return`w-32 h-32`;case`lg`:return`w-42 h-42`;default:return e}}(a),m=(n-r)/(i-r),h=SP({style:`percent`}),g=``;!o&&!g&&(g=h.format(m));let _={},v={};if(!o){let e=(n-r)/(i-r)*100,t;e>0&&e<=50?(t=e/50*180-180,_.transform=`rotate(${t}deg)`,v.transform=`rotate(-180deg)`):e>50&&(t=(e-50)/50*180-180,_.transform=`rotate(0deg)`,v.transform=`rotate(${t}deg)`)}return(0,l.jsxs)(`div`,{...f,"aria-valuenow":o?void 0:n,"aria-valuemin":r,"aria-valuemax":i,"aria-valuetext":o?void 0:g,role:`progressbar`,ref:t,className:K(`progress-circle`,c,p,o&&`indeterminate`,s),children:[(0,l.jsx)(`div`,{className:K(p,u,`rounded-full border-4`)}),(0,l.jsxs)(`div`,{className:K(`fills absolute left-0 top-0 h-full w-full`,o&&`progress-circle-fills-animate`),children:[(0,l.jsx)(OP,{circleSize:p,subMaskStyle:_,isIndeterminate:o,className:`rotate-180`,fillColor:d,subMaskClassName:K(o&&`progress-circle-fill-submask-1-animate`)}),(0,l.jsx)(OP,{circleSize:p,subMaskStyle:v,isIndeterminate:o,fillColor:d,subMaskClassName:K(o&&`progress-circle-fill-submask-2-animate`)})]})]})});function OP({subMaskStyle:e,subMaskClassName:t,className:n,circleSize:r,isIndeterminate:i,fillColor:a}){return(0,l.jsx)(`div`,{className:K(`absolute h-full w-1/2 origin-[100%] overflow-hidden`,n),children:(0,l.jsx)(`div`,{className:K(`h-full w-full origin-[100%] rotate-180 overflow-hidden`,!i&&`transition-transform duration-100`,t),style:e,children:(0,l.jsx)(`div`,{className:K(r,a,`rounded-full border-4`)})})})}function kP({isLoading:e,icon:t}){let n=(0,s.useRef)(null),{trans:r}=cP(),[i,a]=(0,s.useState)(!1),{state:{isOpen:o,inputValue:c}}=RD(),u=(0,s.useRef)(c);return(0,s.useEffect)(()=>{e&&!i?(n.current===null&&(n.current=setTimeout(()=>{a(!0)},500)),c!==u.current&&(clearTimeout(n.current),n.current=setTimeout(()=>{a(!0)},500))):e||(a(!1),clearTimeout(n.current),n.current=null),u.current=c},[e,i,c]),i&&(o||e)?(0,l.jsx)(DP,{"aria-label":r({message:`Loading`}),size:`sm`,isIndeterminate:!0}):t||(0,l.jsx)(fP,{})}var AP=s.default.forwardRef(function(e,t){let n=uA(),{hideCaret:r,placeholder:i=(0,l.jsx)(rA,{message:`Select an option...`}),selectedValue:a,onItemSelected:o,onOpenChange:s,onInputValueChange:c,onSelectionChange:u,selectionMode:d,minWidth:f=`min-w-128`,children:p,searchPlaceholder:m,showEmptyMessage:h,showSearchField:g,defaultInputValue:_,inputValue:v,isLoading:y,isAsync:b,valueClassName:x,floatingWidth:S=n?`auto`:`matchTrigger`,...C}=e,w=uk({...e,clearInputOnItemSelection:!0,showEmptyMessage:h||g,floatingWidth:S,selectionMode:`single`,role:`listbox`,virtualFocus:g},t),{state:{selectedValues:T,isOpen:E,setIsOpen:D,activeIndex:O,setSelectedIndex:k,inputValue:A,setInputValue:j},collections:M,focusItem:N,listboxId:P,reference:F,refs:I,listContent:L,onInputChange:R}=w,{fieldProps:z,inputProps:ee}=HA({...C,focusRef:I.reference}),B=M.collection.get(T[0]),te=B?(0,l.jsxs)(`span`,{className:`flex items-center gap-10`,children:[B.element.props.startIcon,(0,l.jsx)(`span`,{className:K(`overflow-hidden overflow-ellipsis whitespace-nowrap`,x),children:B.element.props.children})]}):(0,l.jsx)(`span`,{className:`italic`,children:i}),ne=MA({...e,endAdornment:!0}),{handleTriggerKeyDown:re,handleListboxKeyboardNavigation:ie,handleListboxSearchFieldKeydown:ae}=sA(w),{findMatchingItem:oe}=lA();return(0,l.jsx)(iA,{listbox:w,onKeyDownCapture:g?void 0:e=>{if(!E)return;let t=oe(e,L,O);t!=null&&N(`increment`,t)},onKeyDown:ie,onClose:g?()=>j(``):void 0,isLoading:y,searchField:g&&(0,l.jsx)(UA,{size:e.size===`xs`||e.size===`sm`?`xs`:`sm`,placeholder:m,startAdornment:(0,l.jsx)(dA,{}),className:`flex-shrink-0 px-8 pb-8 pt-4`,autoFocus:!0,"aria-expanded":E?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":E?P:void 0,"aria-autocomplete":`list`,autoComplete:`off`,autoCorrect:`off`,spellCheck:`false`,value:A,onChange:R,onKeyDown:e=>{ae(e)}}),children:(0,l.jsx)(RA,{fieldClassNames:ne,...z,endAdornment:!r&&(0,l.jsx)(kP,{isLoading:y}),children:(0,l.jsx)(`button`,{...ee,type:`button`,"data-selected-value":B?.value,"aria-expanded":E?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":E?P:void 0,ref:F,onKeyDown:re,onKeyDownCapture:g?void 0:e=>{if(E)return;let t=oe(e,L,O);t!=null&&k(t)},disabled:C.disabled,onClick:()=>{D(!E)},className:K(ne.input,!z.unstyled&&f),children:te})})})});function jP(){let e=Y(e=>e.filter.selected);if(!e)return null;let t=Z().filter.getByName(e).options,n=(t,n)=>{var r;(r=Z().filter)==null||r.applyValue(e,t,n),X().setDirty(!0)},r=Z().canvas.getMainImage().filters,i=Z().filter.findFilterIndex(e,r),a=r?.[i];return t?(0,l.jsx)($M,{children:(0,l.jsx)(`div`,{className:`max-w-240 pt-10 mx-auto`,children:Object.entries(t).map(([e,t])=>{let r,i=a?a[e]:t.current;return t.type===`slider`?r=(0,l.jsx)(EP,{label:(0,l.jsx)(`span`,{className:`capitalize`,children:(0,l.jsx)(rA,{...PE[e]})}),minValue:t.min,maxValue:t.max,step:t.step,defaultValue:i,formatOptions:{style:`percent`},size:`sm`,onChange:t=>{n(e,t)}}):t.type===`colorPicker`?r=(0,l.jsx)(hP,{label:(0,l.jsx)(rA,{...PE[e]}),size:`sm`,width:`w-full`,value:i,onChange:t=>{n(e,t)}}):t.type===`select`&&(r=(0,l.jsx)(AP,{selectionMode:`single`,size:`sm`,label:(0,l.jsx)(rA,{...PE[e]}),defaultValue:i,onSelectionChange:t=>{n(e,t)},children:t.available.map(e=>(0,l.jsx)(HD,{value:e.key,children:(0,l.jsx)(`span`,{className:`capitalize`,children:(0,l.jsx)(rA,{message:e.key})})},e.key))})),(0,l.jsx)(`div`,{className:`pb-10`,children:r},e)})})}):null}function MP(){let e=Y(e=>e.frame.active)?.mode===`basic`,t=(0,s.useCallback)(e=>`${e}%`,[]);return(0,l.jsx)($M,{className:`pb-18 pt-6`,children:(0,l.jsxs)(`div`,{className:`max-w-288 m-auto`,children:[e&&(0,l.jsx)(hP,{className:`mb-20`,width:`w-full`,size:`sm`,label:(0,l.jsx)(rA,{message:`Color`}),value:Z().frame.builder.defaultColor,onChange:e=>{Z().frame.active.changeColor(e)}}),(0,l.jsx)(EP,{size:`sm`,label:(0,l.jsx)(rA,{message:`Size`}),step:1,minValue:Z().frame.active.getMinSize(),maxValue:Z().frame.active.getMaxSize(),defaultValue:Z().frame.active.currentSizeInPercent,getValueLabel:t,onChange:e=>{Z().frame.resize(e)}})]})})}var NP=s.default.createContext(null);function PP(){let{tabsRef:e,selectedTab:t}=(0,s.useContext)(NP),[n,r]=(0,s.useState)({width:void 0,transform:void 0,className:void 0});return PT(()=>{if(t!=null&&e.current){let n=e.current[t];if(!n)return;r(e=>({width:`${n.offsetWidth}px`,transform:`translateX(${n.offsetLeft}px)`,className:e.width===void 0?``:`transition-all`}))}},[r,t,e]),(0,l.jsx)(`div`,{className:K(`absolute bottom-0 left-0 h-2 bg-primary`,n.className),role:`presentation`,style:{width:n.width,transform:n.transform}})}function FP({children:e,center:t,expand:n,className:r}){let i=s.Children.toArray(e);return(0,l.jsx)(kk,{children:(0,l.jsxs)(`div`,{className:K(`flex relative max-w-full overflow-auto border-b max-sm:hidden-scrollbar md:compact-scrollbar`,r),role:`tablist`,"aria-orientation":`horizontal`,children:[i.map((e,r)=>(0,s.isValidElement)(e)?(0,s.cloneElement)(e,{index:r,className:K(e.props.className,n&&`flex-auto`,t&&r===0&&`ml-auto`,t&&r===i.length-1&&`mr-auto`)}):null),(0,l.jsx)(PP,{})]})})}function IP(e){let{size:t=`md`,children:n,className:r,isLazy:i,overflow:a=`overflow-hidden`}=e,o=(0,s.useRef)([]),c=(0,s.useId)(),[u,d]=rE(e.selectedTab,e.defaultSelectedTab||0,e.onTabChange),f=(0,s.useMemo)(()=>({selectedTab:u,setSelectedTab:d,tabsRef:o,size:t,isLazy:i,id:c}),[u,c,i,d,t]);return(0,l.jsx)(NP.Provider,{value:f,children:(0,l.jsx)(`div`,{className:K(r,a,`max-w-full`),children:n})})}var LP=q((0,l.jsx)(`path`,{d:`M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z`}),`FormatUnderlinedOutlined`),RP=q((0,l.jsx)(`path`,{d:`M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z`}),`FormatStrikethroughOutlined`),zP=q((0,l.jsx)(`path`,{d:`M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z`}),`FormatItalicOutlined`),BP=q((0,l.jsx)(`path`,{d:`M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z`}),`FormatAlignRightOutlined`),VP=q((0,l.jsx)(`path`,{d:`M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z`}),`FormatAlignLeftOutlined`),HP=q((0,l.jsx)(`path`,{d:`M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z`}),`FormatAlignCenterOutlined`);function UP(){return(0,l.jsxs)(`div`,{className:`flex gap-20 justify-center`,children:[(0,l.jsx)(WP,{}),(0,l.jsx)(GP,{}),(0,l.jsx)(KP,{})]})}function WP(){let e=Y(e=>e.objects.active.editableProps.fontSize)??40,{trans:t}=cP();return(0,l.jsx)(UA,{type:`number`,size:`xs`,"aria-label":t({message:`Font Size`}),min:1,max:300,className:`w-64 flex-shrink-0`,value:e,onChange:e=>{Z().objects.setValues({fontSize:e.target.valueAsNumber}),X().setDirty(!0)}})}function GP(){let e=Y(e=>e.objects.active.editableProps.fontStyle),t=Y(e=>e.objects.active.editableProps.underline),n=Y(e=>e.objects.active.editableProps.linethrough),[r,i]=(0,s.useState)([e,t&&`underline`,n&&`linethrough`]);return(0,l.jsxs)($A,{size:`xs`,variant:`outline`,radius:`rounded`,value:r,multiple:!0,onChange:e=>{i(e),Z().objects.setValues({underline:e.includes(`underline`),linethrough:e.includes(`linethrough`),fontStyle:e.includes(`italic`)?`italic`:``}),X().setDirty(!0)},children:[(0,l.jsx)(qA,{value:`underline`,children:(0,l.jsx)(LP,{})}),(0,l.jsx)(qA,{value:`linethrough`,children:(0,l.jsx)(RP,{})}),(0,l.jsx)(qA,{value:`italic`,children:(0,l.jsx)(zP,{})})]})}function KP(){return(0,l.jsxs)($A,{size:`xs`,variant:`outline`,radius:`rounded`,value:Y(e=>e.objects.active.editableProps.textAlign),onChange:e=>{Z().objects.setValues({textAlign:e}),X().setDirty(!0)},children:[(0,l.jsx)(qA,{value:`left`,children:(0,l.jsx)(VP,{})}),(0,l.jsx)(qA,{value:`center`,children:(0,l.jsx)(HP,{})}),(0,l.jsx)(qA,{value:`right`,children:(0,l.jsx)(BP,{})})]})}function qP({children:e,className:t}){let{selectedTab:n,isLazy:r}=(0,s.useContext)(NP),i=s.Children.toArray(e).filter(e=>!!e),a;if(r){let e=i[n];a=(0,s.isValidElement)(e)?(0,s.cloneElement)(i[n],{index:n}):null}else a=i.map((e,t)=>{if((0,s.isValidElement)(e)){let r=t===n;return(0,s.cloneElement)(e,{index:t,"aria-hidden":!r,className:r?e.props.className:K(e.props.className,`hidden`)})}return null});return(0,l.jsx)(`div`,{className:t,children:a})}function JP({className:e,children:t,index:n,...r}){let{id:i}=(0,s.useContext)(NP),[a,o]=(0,s.useState)(0),c=(0,s.useRef)(null);return PT(()=>{if(c!=null&&c.current){let e=()=>{o(Vk(c.current,{tabbable:!0}).nextNode()?void 0:0)};e();let t=new MutationObserver(e);return t.observe(c.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabIndex`,`disabled`]}),()=>{t.disconnect()}}},[c]),(0,l.jsx)(`div`,{tabIndex:a,ref:c,id:`${i}-${n}-tabpanel`,"aria-labelledby":`${i}-${n}-tab`,className:K(e,`focus-visible:outline-primary-light`),role:`tabpanel`,...r,children:t})}var YP=[{type:`linear`,coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{color:`#ffe47b`,offset:0},{color:`rgb(111,154,211)`,offset:1}]},{type:`linear`,coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{color:`#ff4040`,offset:0},{color:`#e6399b`,offset:1}]},{type:`linear`,coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:`rgb(166,111,213)`},{offset:.5,color:`rgba(106, 72, 215, 0.5)`},{offset:1,color:`#200772`}]},{type:`radial`,coords:{r1:100,r2:10,x1:0,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:`#FF4F4F`},{offset:1,color:`rgb(255, 239, 64)`}]},{type:`radial`,coords:{r1:100,r2:10,x1:0,y1:0,x2:20,y2:20},colorStops:[{offset:0,color:`#ffe47b`},{offset:.5,color:`rgb(111,154,211)`},{offset:1,color:`rgb(166,111,213)`}]},{type:`radial`,coords:{r1:50,r2:80,x1:45,y1:45,x2:52,y2:50},colorStops:[{offset:0,color:`rgb(155, 237, 0)`},{offset:1,color:`rgba(0, 164, 128,0.4)`}]},{type:`linear`,coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:`#9ecb2d`},{offset:.5,color:`#72aa00`},{offset:1,color:`#bfd255`}]},{type:`radial`,coords:{r1:100,r2:50,x1:30,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:`#aebcbf`},{offset:1,color:`#0a0809`}]},{type:`linear`,coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{offset:0,color:`#ffffff`},{offset:1,color:`#f6f6f6`}]},{type:`linear`,coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:`#fefcea`},{offset:1,color:`#f1da36`}]},{type:`linear`,coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:`rgb(166,111,213)`},{offset:.5,color:`rgba(106, 72, 215, 0.5)`},{offset:1,color:`#ff1a00`}]},{type:`linear`,coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:`#b7deed`},{offset:1,color:`#21b4e2`}]},{type:`linear`,coords:{x1:-80,y1:100,x2:80,y2:-100},colorStops:[{offset:0,color:`#ffe47b`},{offset:1,color:`rgb(111,154,211)`}]}],XP=q((0,l.jsx)(`path`,{d:`M19.51 3.08 3.08 19.51c.09.34.27.65.51.9.25.24.56.42.9.51L20.93 4.49c-.19-.69-.73-1.23-1.42-1.41zM11.88 3 3 11.88v2.83L14.71 3h-2.83zM5 3c-1.1 0-2 .9-2 2v2l4-4H5zm14 18c.55 0 1.05-.22 1.41-.59.37-.36.59-.86.59-1.41v-2l-4 4h2zm-9.71 0h2.83L21 12.12V9.29L9.29 21z`}),`TextureOutlined`),ZP=q((0,l.jsx)(`path`,{d:`M11 9h2v2h-2V9zm-2 2h2v2H9v-2zm4 0h2v2h-2v-2zm2-2h2v2h-2V9zM7 9h2v2H7V9zm12-6H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 18H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm2-7h-2v2h2v2h-2v-2h-2v2h-2v-2h-2v2H9v-2H7v2H5v-2h2v-2H5V5h14v6z`}),`GradientOutlined`),QP=q((0,l.jsx)(`path`,{d:`M18 20H4V6h9V4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2v9zm-7.79-3.17-1.96-2.36L5.5 18h11l-3.54-4.71zM20 4V1h-2v3h-3c.01.01 0 2 0 2h3v2.99c.01.01 2 0 2 0V6h3V4h-3z`}),`AddPhotoAlternateOutlined`);function $P({property:e}){let{trans:t}=cP(),n=Y(t=>t.objects.active.editableProps[e]);return(0,l.jsxs)(`div`,{className:`flex items-center justify-center gap-14`,children:[(0,l.jsx)(hP,{className:`flex-shrink-0`,size:`xs`,"aria-label":t({message:`Color`}),value:typeof n==`string`?n:c_.fill,onChange:t=>{Z().objects.setValues({[e]:t}),X().setDirty(!0)}}),(0,l.jsx)(eF,{type:`gradient`,property:e}),(0,l.jsx)(eF,{type:`texture`,property:e})]})}function eF({type:e,property:t}){return(0,l.jsx)(s.Fragment,{children:(0,l.jsxs)(mP,{type:`popover`,children:[(0,l.jsx)(FD,{className:`flex-shrink-0`,id:`${e}-panel-trigger`,variant:`outline`,size:`xs`,startIcon:(0,l.jsx)(e===`texture`?XP:ZP,{}),endIcon:(0,l.jsx)(fP,{}),children:(0,l.jsx)(`span`,{className:`capitalize`,children:(0,l.jsx)(rA,e===`gradient`?{message:`Gradient`}:{message:`Texture`})})}),(0,l.jsx)(dP,{size:`auto`,children:(0,l.jsx)(`div`,{className:`grid gap-8 grid-cols-5-min-content p-10 bg-paper rounded shadow-md`,children:(0,l.jsx)(tF,{property:t,type:e})})})]})})}function tF({type:e,property:t}){let{close:n}=sP(),r=Array.from(Array(e===`gradient`?YP.length:28).keys()),i=`w-56 h-56 bg border shadow-sm hover:scale-110`,a=r.map(r=>{let a=TE(`images/${e}s/${r}.png`);return(0,l.jsx)(PD,{radius:`rounded`,className:i,style:{backgroundImage:`url(${a})`},"aria-label":`Select ${e} #${r}`,onClick:async()=>{n();let i=e===`gradient`?new $.fabric.Gradient(YP[r]):await rF(a);Z().objects.setValues({[t]:i}),X().setDirty(!0)}},r)});return e===`texture`&&a.unshift((0,l.jsx)(nF,{property:t,className:i},`upload-btn`)),(0,l.jsx)(s.Fragment,{children:a})}function nF({className:e,property:t}){let{close:n}=sP();return(0,l.jsx)(PD,{radius:`rounded`,className:e,"aria-label":`Upload an image`,onClick:async()=>{let e=await Z().import.openUploadWindow();if(n(),e){let n=await rF(await e.data);Z().objects.setValues({[t]:n})}},children:(0,l.jsx)(QP,{className:`icon-md`})})}function rF(e){return new Promise(t=>{$.fabric.util.loadImage(e,e=>{t(new $.fabric.Pattern({source:e,repeat:`repeat`}))})})}function iF(){return(0,l.jsx)(EP,{className:`max-w-240 w-full mx-auto`,"aria-label":`Opacity`,value:Y(e=>e.objects.active.editableProps.opacity),minValue:.1,step:.1,maxValue:1,onChange:e=>{Z().objects.setValues({opacity:e}),X().setDirty(!0)}})}function aF(){let{trans:e}=cP(),t=Y(e=>e.objects.active.editableProps.stroke),n=Y(e=>e.objects.active.editableProps.strokeWidth);return(0,l.jsxs)(`div`,{className:`flex items-center gap-40`,children:[(0,l.jsx)(hP,{className:`ml-auto flex-shrink-0`,size:`xs`,value:t,"aria-label":e({message:`Outline Color`}),onChange:e=>{Z().objects.setValues({stroke:e}),X().setDirty(!0)}}),(0,l.jsx)(EP,{"aria-label":`Outline Width`,className:`max-w-240 mr-auto flex-shrink-0`,value:n,onChange:e=>{Z().objects.setValues({strokeWidth:e}),X().setDirty(!0)}})]})}var oF=q((0,l.jsx)(`path`,{d:`M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z`}),`ImageOutlined`);function sF(){return(0,l.jsx)(`div`,{className:`flex justify-center`,children:(0,l.jsx)(FD,{type:`button`,variant:`outline`,size:`xs`,startIcon:(0,l.jsx)(oF,{}),radius:`rounded-full`,onClick:async()=>{let e=await Z().import.openUploadWindow();if(e){let t=Z().objects.getActive();if(t&&`setSrc`in t){let n=await e.data;t.setSrc(n,()=>{_E({src:n}),Z().canvas.render()})}}},children:(0,l.jsx)(rA,{message:`Replace Image`})})})}var cF={color:`rgba(0, 0, 0, 0.6)`,blur:3,offsetX:-1,offsetY:0};function lF(){let{trans:e}=cP(),t=Y(e=>e.objects.active.editableProps.shadow)||cF;return(0,l.jsxs)(`div`,{className:`flex items-center gap-40`,children:[(0,l.jsx)(hP,{className:`ml-auto flex-shrink-0`,value:t.color,size:`xs`,"aria-label":e({message:`Shadow Color`}),onChange:e=>{Z().objects.setValues({shadow:uF({color:e})}),X().setDirty(!0)}}),(0,l.jsx)(EP,{"aria-label":`Shadow Blur`,className:`max-w-240 mr-auto flex-shrink-0`,defaultValue:t.blur,onChange:e=>{Z().objects.setValues({shadow:uF({blur:e})}),X().setDirty(!0)}})]})}function uF(e){let t=Z().objects.getActive()?.shadow;return t?(Object.entries(e).forEach(([e,n])=>{t[e]=n}),t):new $.fabric.Shadow({...cF,...e})}function dF({index:e,className:t,isDisabled:n,children:r,padding:i,elementType:a=`button`,to:o,relative:c,width:u=`min-w-min`}){let{selectedTab:d,setSelectedTab:f,tabsRef:p,size:m=`md`,id:h}=(0,s.useContext)(NP),g=e===d,_=function(){return(0,s.useContext)(Dk)?.focusManager}(),v=i||(m===`sm`?`px-12`:`px-18`),y=K(`tracking-wide overflow-hidden capitalize text-sm flex items-center justify-center outline-none transition-colors`,`focus-visible:ring focus-visible:ring-2 ring-inset rounded whitespace-nowrap cursor-pointer`,u,function({isDisabled:e,isSelected:t}){return e?`text-disabled cursor-default`:t?`text-primary`:`text-muted hover:text-main`}({isDisabled:n,isSelected:g}),t,m===`md`&&`${v} h-48`,m===`sm`&&`${v} h-32`,n&&`pointer-events-none`);return(0,l.jsx)(a,{disabled:n,id:`${h}-${e}-tab`,"aria-controls":`${h}-${e}-tabpanel`,type:`button`,role:`tab`,"aria-selected":g,tabIndex:n?void 0:g?0:-1,onKeyDown:e=>{switch(e.key){case`ArrowLeft`:_?.focusPrevious();break;case`ArrowRight`:_?.focusNext();break;case`Home`:_?.focusFirst();break;case`End`:_?.focusLast()}},onClick:()=>{f(e)},to:o,relative:c,className:y,ref:t=>{p.current&&t&&(p.current[e]=t)},children:r})}function fF(){let e=Y(e=>e.objects.active);return(0,l.jsxs)(IP,{size:`sm`,className:`pb-18 pt-6`,children:[(0,l.jsxs)(FP,{center:!0,children:[e.isText&&(0,l.jsx)(dF,{children:(0,l.jsx)(rA,{message:`Font`})}),!e.isImage&&(0,l.jsx)(dF,{children:(0,l.jsx)(rA,{message:`Color`})}),!e.isImage&&(0,l.jsx)(dF,{children:(0,l.jsx)(rA,{message:`Background`})}),e.isImage&&(0,l.jsx)(dF,{children:(0,l.jsx)(rA,{message:`Image`})}),(0,l.jsx)(dF,{children:(0,l.jsx)(rA,{message:`Opacity`})}),(0,l.jsx)(dF,{children:(0,l.jsx)(rA,{message:`Outline`})}),(0,l.jsx)(dF,{children:(0,l.jsx)(rA,{message:`Shadow`})})]}),(0,l.jsxs)(qP,{className:`pt-16 h-50`,children:[e.isText&&(0,l.jsx)(JP,{children:(0,l.jsx)(UP,{})},`font`),!e.isImage&&(0,l.jsx)(JP,{children:(0,l.jsx)($P,{property:`fill`})}),!e.isImage&&(0,l.jsx)(JP,{children:(0,l.jsx)($P,{property:`backgroundColor`})}),e.isImage&&(0,l.jsx)(JP,{children:(0,l.jsx)(sF,{})}),(0,l.jsx)(JP,{children:(0,l.jsx)(iF,{})}),(0,l.jsx)(JP,{children:(0,l.jsx)(aF,{})}),(0,l.jsx)(JP,{children:(0,l.jsx)(lF,{})})]})]})}function pF(){return(0,l.jsx)($M,{actionBtn:!uA()&&(0,l.jsx)(FD,{size:`sm`,color:`primary`,variant:`outline`,onClick:()=>{Z().text.add(),X().setDirty(!0)},children:(0,l.jsx)(rA,{message:`New Text`})}),children:(0,l.jsx)(fF,{})})}var mF=q((0,l.jsx)(`path`,{d:`m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z`}),`ArrowDownwardOutlined`),hF={},gF=!1,_F=null,vF=null,yF=e=>{var t;for(let n in hF)n!==e&&((t=hF[n])==null||t.call(hF,!0),delete hF[n])},bF=(0,s.forwardRef)(({children:e,label:t,placement:n=`top`,offset:r=10,variant:i=`neutral`,delay:a=1500,isDisabled:o,usePortal:u=!0,...d},f)=>{let{x:p,y:m,reference:h,strategy:g,arrowRef:_,arrowStyle:v,refs:y}=lk({placement:n,offset:r,ref:f,showArrow:!0}),[b,x]=(0,s.useState)(!1),S=(0,s.useId)(),C=(0,s.useRef)(),w=()=>{clearTimeout(C.current),C.current=void 0,yF(S),hF[S]=T,gF=!0,x(!0),_F&&=(clearTimeout(_F),null),vF&&=(clearTimeout(vF),null)},T=(0,s.useCallback)(e=>{e?(clearTimeout(C.current),C.current=void 0,x(!1)):C.current||=setTimeout(()=>{C.current=void 0,x(!1)},500),_F&&=(clearTimeout(_F),null),gF&&(vF&&clearTimeout(vF),vF=setTimeout(()=>{delete hF[S],vF=null,gF=!1},500))},[S]),E=e=>{!e&&a>0&&!C.current?(yF(S),hF[S]=T,b||_F||gF?b||w():_F=setTimeout(()=>{_F=null,gF=!0,w()},a)):w()};(0,s.useEffect)(()=>()=>{clearTimeout(C.current),hF[S]&&delete hF[S]},[S]),(0,s.useEffect)(()=>{let e=e=>{e.key===`Escape`&&T(!0)};if(b)return document.addEventListener(`keydown`,e,!0),()=>{document.removeEventListener(`keydown`,e,!0)}},[b,T]);let D=(0,l.jsx)(AT,{children:b&&(0,l.jsxs)(CT.div,{...Kk,ref:y.setFloating,id:S,role:`tooltip`,onPointerEnter:()=>{E(!0)},onPointerLeave:()=>{T()},className:K(`z-tooltip my-4 max-w-240 break-words rounded px-8 py-4 text-xs text-white shadow`,i===`positive`&&`bg-positive`,i===`danger`&&`bg-danger`,i===`neutral`&&`bg-toast`),style:{position:g,top:m??``,left:p??``},children:[(0,l.jsx)(`div`,{ref:_,className:`absolute h-8 w-8 rotate-45 bg-inherit`,style:v}),t]})});return(0,l.jsxs)(s.Fragment,{children:[(0,s.cloneElement)(e,GT({"aria-describedby":b?S:void 0,ref:h,onPointerEnter:e=>{e.pointerType===`mouse`&&E()},onFocus:e=>{e.target.matches(`:focus-visible`)&&E(!0)},onPointerLeave:e=>{e.pointerType===`mouse`&&T()},onPointerDown:()=>{T(!0)},onBlur:()=>{T()},"aria-label":typeof t==`string`?t:t.props.message},d)),u?bb&&(0,c.createPortal)(D,bb):D]})});function xF(){let e=function(e,t){switch(e){case gy.Filter:return(0,l.jsx)(jP,{});case gy.Frame:return(0,l.jsx)(MP,{});case gy.Text:return t&&(0,l.jsx)(pF,{});case gy.ActiveObject:return t&&(0,l.jsx)(fF,{});default:return null}}(Y(e=>e.activeToolOverlay),Y(e=>e.objects.active.id)),[t,n]=(0,s.useState)(!0);return(0,l.jsxs)(`div`,{className:`relative z-tool-overlay text-sm`,children:[e&&(0,l.jsx)(`div`,{className:K(`absolute right-16 text-muted z-50 transition-all`,!t&&`rotate-180`,t?`-top-144`:`-top-40`),children:(0,l.jsx)(bF,{label:(0,l.jsx)(rA,t?{message:`Hide options`}:{message:`Show options`}),children:(0,l.jsx)(qA,{variant:`outline`,radius:`rounded-lg`,size:`xs`,onClick:()=>{n(!t)},children:(0,l.jsx)(mF,{})})})}),(0,l.jsx)(AT,{children:e&&t&&(0,l.jsx)(CT.div,{initial:{y:0,opacity:0},animate:{y:`-100%`,opacity:1},exit:{y:0,opacity:0},transition:{type:`tween`,duration:.15},className:`absolute inset-x-0 gap-16 px-5vw bg bg-opacity-95 border-t`,children:e},`tool-controls-overlay`)})]})}var SF=q((0,l.jsx)(`path`,{d:`M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z`}),`CancelOutlined`);function CF({filter:e}){let t=Y(t=>t.filter.applied.includes(e)),n=Z().filter.hasOptions(e),r=K(`block flex-shrink-0 rounded`,{"text-primary border-primary":t}),i=NE[e],a=(0,l.jsxs)(s.Fragment,{children:[(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(wF,{filter:e}),t&&(0,l.jsx)(TF,{filter:e,hasOptions:n})]}),(0,l.jsx)(`div`,{className:`mt-4 text-center text-xs capitalize`,children:i?(0,l.jsx)(rA,{...i}):e})]});return t&&n?(0,l.jsx)(`div`,{className:r,children:a}):(0,l.jsx)(PD,{className:r,onClick:()=>{t?Z().filter.remove(e):Z().filter.apply(e)},children:a})}function wF({filter:e}){let t=K(`m-auto w-96 h-56 border rounded object-cover`,{shadow:Y(t=>t.filter.selected===e)});return(0,l.jsx)(`img`,{src:TE(`images/filter/${e}.jpg`),className:t,alt:``})}function TF({filter:e,hasOptions:t}){return(0,l.jsxs)(`div`,{className:`flex items-center justify-center bg-background/70 absolute inset-0 border-2 border-primary rounded`,children:[t?(0,l.jsx)(qA,{color:`primary`,size:`md`,onClick:()=>{Z().filter.remove(e)},children:(0,l.jsx)(SF,{})}):(0,l.jsx)(SF,{className:`svg-icon icon-md`}),t&&(0,l.jsx)(EF,{filter:e,hasOptions:t})]})}function EF({filter:e,hasOptions:t}){return(0,l.jsx)(qA,{color:`primary`,size:`md`,onClick:()=>{X().activeToolOverlay===gy.Filter&&X().filter.selected===e?X().setActiveTool(X().activeTool,null):X().filter.select(e,t)},children:(0,l.jsx)(v_,{})})}var DF=(0,s.forwardRef)(({children:e,className:t,gap:n=`gap-10`},r)=>{let i=s.default.Children.map(e,(t,n)=>s.default.isValidElement(t)?s.default.cloneElement(t,{isFirst:n===0,isLast:s.default.Children.count(e)===n+1}):t);return(0,l.jsx)(`div`,{ref:r,className:K(`tiny-scrollbar pb-4 overflow-x-auto relative flex items-center`,n,t),children:i})});function OF({isFirst:e,isLast:t,children:n,className:r}){return(0,l.jsx)(`div`,{className:K(r,`flex-shrink-0`,{"ml-auto":e,"mr-auto":t}),children:n})}function kF(){let e=Y(e=>e.config.tools?.filter?.items)||[];return(0,s.useEffect)(()=>{Z().filter.syncState()},[]),(0,l.jsx)(DF,{children:e.map(e=>(0,l.jsx)(OF,{children:(0,l.jsx)(CF,{filter:e})},e))})}var AF=q((0,l.jsx)(`path`,{d:`M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z`}),`LockOutlined`),jF=q((0,l.jsx)(`path`,{d:`M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z`}),`LockOpenOutlined`),MF=q((0,l.jsx)(`path`,{d:`M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z`}),`CheckBoxOutlineBlankOutlined`),NF=q((0,l.jsx)(`path`,{d:`M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z`}),`CheckBox`),PF=q((0,l.jsx)(`path`,{d:`M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M17,13H7v-2h10V13z`}),`CheckBox`),FF=(0,s.forwardRef)((e,t)=>{let{size:n=`md`,children:r,className:i,icon:a,checkedIcon:o,disabled:c,isIndeterminate:u,errorMessage:d,invalid:f,orientation:p=`horizontal`,onChange:m,autoFocus:h,required:g,value:_,name:v,inputTestId:y}=e,b=MA({...e,label:r}),x=a||MF,S=o||(u?PF:NF),C=eE(t);VA({autoFocus:h},C),(0,s.useEffect)(()=>{C.current&&(C.current.indeterminate=u||!1)});let[w,T]=rE(e.checked,e.defaultChecked||!1),E=(0,s.useCallback)(e=>{m?.(e),T(e.target.checked)},[m,T]),D=K(`select-none`,i,f&&`text-danger`,!f&&c&&`text-disabled`),O,k=f?`text-danger`:null;return u?(O=PF,k||=`text-primary`):w?(O=S,k||=`text-primary`):(O=x,k||=`text-muted`),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{className:D,children:(0,l.jsxs)(`div`,{className:K(`relative flex items-center`,p===`vertical`&&`flex-col flex-col-reverse`),children:[(0,l.jsx)(`input`,{className:`absolute left-0 top-0 h-24 w-24 appearance-none overflow-hidden rounded outline-none ring-inset transition-shadow focus-visible:ring`,type:`checkbox`,"aria-checked":u?`mixed`:w,"aria-invalid":f||void 0,onChange:E,ref:C,required:g,disabled:c,value:_,name:v,"data-testid":y}),(0,l.jsx)(O,{size:n,className:K(`pointer-events-none`,c?`text-disabled`:k)}),r&&(0,l.jsx)(`div`,{className:K(`first-letter:capitalize`,b.size.font,p===`vertical`?`mb-6`:`ml-6`),children:r})]})}),d&&(0,l.jsx)(`div`,{className:b.error,children:d})]})});function IF(){let{trans:e}=cP(),{minWidth:t=50,minHeight:n=50,maxHeight:r=2400,maxWidth:i=2400}=Y(e=>e.config.tools?.resize)||{},a=Y(e=>e.original),o=Y(e=>e.resize.formValue);return(0,s.useEffect)(()=>{X().resize.setFormValue({...a})},[a]),(0,s.useEffect)(()=>{X().setDirty(!0)},[]),(0,l.jsxs)(`form`,{className:`flex items-center justify-center gap-16 w-full`,onSubmit:e=>{e.preventDefault(),X().applyChanges()},children:[(0,l.jsx)(UA,{type:`number`,min:t,max:i,size:`sm`,className:`w-full max-w-112`,label:(0,l.jsx)(rA,{message:`Width`}),value:o.width,onChange:e=>{(e=>{let t={...o,width:e};o.maintainAspect&&(t.height=HE(e,o.usePercentages)),X().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,l.jsx)(`div`,{className:`mt-24`,children:(0,l.jsx)(FF,{size:`md`,checked:o.maintainAspect,onChange:e=>{(e=>{let t={...o,maintainAspect:e};e&&(t.height=HE(t.width,t.usePercentages)),X().resize.setFormValue(t)})(!o.maintainAspect)},"aria-label":e({message:`Maintain aspect ratio`}),checkedIcon:AF,icon:jF})}),(0,l.jsx)(UA,{type:`number`,min:n,max:r,size:`sm`,className:`w-full max-w-112`,label:(0,l.jsx)(rA,{message:`Height`}),value:o.height,onChange:e=>{(e=>{let t={...o,height:e};e&&o.maintainAspect&&(t.width=VE(e,o.usePercentages)),X().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,l.jsx)(`button`,{type:`submit`,className:`hidden`,children:(0,l.jsx)(rA,{message:`Resize`})})]})}function LF(){let e=Y(e=>e.config.tools?.crop?.presets)||[],t=Y(e=>e.crop.selectedAspectRatio),n=Y(e=>e.config.tools?.crop?.allowCustomRatio)??!0;return(0,l.jsx)(DF,{gap:`gap-18`,children:e.filter(e=>e.ratio||!e.ratio&&n).map(e=>(0,l.jsx)(OF,{children:(0,l.jsxs)(PD,{onClick:()=>Z().crop.resetCropzone(e.ratio),className:`flex flex-col items-center justify-between cursor-pointer h-56`,children:[(0,l.jsx)(RF,{preset:e,selectedRatio:t}),(0,l.jsx)(zF,{preset:e,selectedRatio:t})]})},e.ratio||e.name))})}function RF({preset:e,selectedRatio:t}){let n=40,r=30;if(e.ratio){let t=KE(e.ratio);({width:n,height:r}=GE(t,n,r))}let i=K(`border-2`,{"border-dotted":e.ratio===null,"border-primary":t===e.ratio});return(0,l.jsx)(`div`,{style:{width:`${n}px`,height:`${r}px`},className:i})}function zF({preset:e,selectedRatio:t}){return(0,l.jsx)(`div`,{className:K(`mt-4 text-center text-xs`,{"text-primary":t===e.ratio}),children:e.name?(0,l.jsx)(rA,{message:e.name}):e.ratio})}var BF=q((0,l.jsx)(`path`,{d:`M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z`}),`FlipOutlined`);function VF(){return(0,l.jsxs)(`div`,{children:[(0,l.jsx)(qA,{size:`sm`,onClick:()=>{Z().transform.flip(`vertical`),X().setDirty(!0)},children:(0,l.jsx)(BF,{})}),(0,l.jsx)(qA,{size:`sm`,onClick:()=>{Z().transform.flip(`horizontal`),X().setDirty(!0)},children:(0,l.jsx)(BF,{className:`rotate-90`})})]})}var HF=q((0,l.jsx)(`path`,{d:`M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z`}),`RotateLeftOutlined`),UF=q((0,l.jsx)(`path`,{d:`M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z`}),`RotateRightOutlined`);function WF(){return(0,l.jsxs)(`div`,{children:[(0,l.jsx)(qA,{size:`sm`,onClick:()=>{Z().transform.rotateLeft(),X().setDirty(!0)},children:(0,l.jsx)(HF,{})}),(0,l.jsx)(qA,{size:`sm`,onClick:()=>{Z().transform.rotateRight(),X().setDirty(!0)},children:(0,l.jsx)(UF,{})})]})}function GF(){return(0,l.jsxs)(`div`,{className:`flex items-center justify-center gap-16`,children:[(0,l.jsx)(VF,{}),(0,l.jsx)(KF,{}),(0,l.jsx)(WF,{})]})}function KF(){let e=(0,s.useRef)(null),{domProps:t,groupId:n,thumbIds:r,trackRef:i,getThumbValueLabel:a}=CP({minValue:-45,maxValue:45,step:1,defaultValue:[X().crop.straightenAngle],onChange:t=>{let n=t[0];Z().transform.straighten(n),X().crop.setTransformAngle(n),X().setDirty(!0),e.current.style.transform=`translateX(${n}px)`}});return(0,l.jsx)(`div`,{id:n,role:`group`,className:`flex-auto flex-shrink-0 max-w-320 touch-none isolate`,children:(0,l.jsxs)(`div`,{...t,ref:i,className:`h-36 relative`,children:[(0,l.jsxs)(`output`,{htmlFor:r[0],"aria-live":`off`,className:`absolute left-1/2 top-1/2 w-40 text-center bg -translate-x-1/2 -translate-y-1/2 z-10`,children:[a(0),`°`]}),(0,l.jsx)(qF,{ref:e})]})})}var qF=s.default.forwardRef((e,t)=>{let n=[...Array(80).keys()],r=n.map(e=>(0,l.jsx)(`circle`,{cx:2+10*e,cy:`20`,r:e%5?.75:2},e));return(0,l.jsx)(`div`,{className:`relative h-full cursor-pointer overflow-hidden`,children:(0,l.jsx)(`svg`,{ref:t,style:{width:10*n.length},className:`absolute -left-80 h-full fill-current`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:r})})});function JF(){return(0,s.useEffect)(()=>(X().setDirty(!0),Z().frame.active.hide(),()=>{Z().frame.active.show()}),[]),(0,l.jsxs)(`div`,{className:`pb-16`,children:[(0,l.jsx)(`div`,{className:`mb-10`,children:(0,l.jsx)(GF,{})}),(0,l.jsx)(LF,{})]})}var YF=q((0,l.jsx)(`path`,{d:`M 16 6 C 12.484375 6 9.273438 7.070313 6.90625 8.84375 C 4.539063 10.617188 3 13.15625 3 16 C 3 18.84375 4.539063 21.382813 6.90625 23.15625 C 9.273438 24.929688 12.484375 26 16 26 C 19.515625 26 22.726563 24.929688 25.09375 23.15625 C 27.460938 21.382813 29 18.84375 29 16 C 29 13.15625 27.460938 10.617188 25.09375 8.84375 C 22.726563 7.070313 19.515625 6 16 6 Z M 16 8 C 19.109375 8 21.898438 8.957031 23.875 10.4375 C 25.851563 11.917969 27 13.875 27 16 C 27 18.125 25.851563 20.082031 23.875 21.5625 C 21.898438 23.042969 19.109375 24 16 24 C 12.890625 24 10.101563 23.042969 8.125 21.5625 C 6.148438 20.082031 5 18.125 5 16 C 5 13.875 6.148438 11.917969 8.125 10.4375 C 10.101563 8.957031 12.890625 8 16 8 Z `})),XF=q((0,l.jsx)(`path`,{d:`M 16 4 C 9.382813 4 4 9.382813 4 16 C 4 22.617188 9.382813 28 16 28 C 22.617188 28 28 22.617188 28 16 C 28 9.382813 22.617188 4 16 4 Z M 16 6 C 21.535156 6 26 10.464844 26 16 C 26 21.535156 21.535156 26 16 26 C 10.464844 26 6 21.535156 6 16 C 6 10.464844 10.464844 6 16 6 Z `})),ZF=q((0,l.jsx)(`path`,{d:`M 3 6 L 3 26 L 29 26 L 29 6 Z M 5 8 L 27 8 L 27 24 L 5 24 Z `})),QF=q((0,l.jsx)(`path`,{d:`M 16 4.90625 L 15.125 6.40625 L 4.71875 24.5 L 3.875 26 L 28.125 26 L 27.28125 24.5 L 16.875 6.40625 Z M 16 8.9375 L 24.65625 24 L 7.34375 24 Z `}));function $F(){return(0,l.jsx)(DF,{children:(Y(e=>e.config.tools?.shapes?.items)||[]).map(e=>(0,l.jsx)(OF,{children:(0,l.jsx)(qA,{variant:`outline`,radius:`rounded-2xl`,size:`xl`,onClick:()=>{Z().shape.addBasicShape(e.name),X().setDirty(!0)},children:(0,l.jsx)(eI,{shape:e})})},e.name))})}function eI({shape:e}){return e.type===`Path`?(0,l.jsx)(`svg`,{className:`m-auto w-36 h-36`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 -100 512 700`,children:(0,l.jsx)(`path`,{className:`fill-transparent stroke-current`,d:e.options?.path,strokeWidth:25})}):s.default.cloneElement(tI[e.name],{className:`w-30 h-30`})}var tI={circle:(0,l.jsx)(XF,{viewBox:`0 0 32 32`}),square:(0,l.jsx)(ZF,{viewBox:`0 0 32 32`}),triangle:(0,l.jsx)(QF,{viewBox:`0 0 32 32`}),ellipse:(0,l.jsx)(YF,{viewBox:`0 0 32 32`})};function nI(e,t,n){let r,i=n.initialDeps??[];return()=>{var a,o,s,c;let l;n.key&&(a=n.debug)!=null&&a.call(n)&&(l=Date.now());let u=e();if(u.length===i.length&&!u.some((e,t)=>i[t]!==e))return r;let d;return i=u,n.key&&(o=n.debug)!=null&&o.call(n)&&(d=Date.now()),r=t(...u),n.key&&(s=n.debug)!=null&&s.call(n)&&(Math.round(100*(Date.now()-l))/100,Math.round(100*(Date.now()-d))/100/16),(c=n?.onChange)==null||c.call(n,r),r}}function rI(e,t){if(e===void 0)throw Error(`Unexpected undefined`);return e}var iI=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},aI=e=>e,oI=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},sI=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(e=>{let t=e[0];if(t!=null&&t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return void i({width:e.inlineSize,height:e.blockSize})}i(n.getBoundingClientRect())});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},cI={passive:!0},lI=typeof window>`u`||`onscrollend`in window,uI=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=lI?()=>{}:iI(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{i=n[e.options.horizontal?`scrollLeft`:`scrollTop`],a(),t(i,r)},s=o(!0),c=o(!1);return c(),n.addEventListener(`scroll`,s,cI),n.addEventListener(`scrollend`,c,cI),()=>{n.removeEventListener(`scroll`,s),n.removeEventListener(`scrollend`,c)}},dI=(e,t,n)=>{if(t!=null&&t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?`width`:`height`])},fI=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},pI=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>t()?.disconnect(),observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{typeof n>`u`&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:aI,rangeExtractor:oI,onChange:()=>{},measureElement:dI,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,...e}},this.notify=(e,t)=>{var n,r;let{startIndex:i,endIndex:a}=this.range??{startIndex:void 0,endIndex:void 0},o=this.calculateRange();(e||i!==o?.startIndex||a!==o?.endIndex)&&((r=(n=this.options).onChange)==null||r.call(n,this,t))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{let e=this.options.getScrollElement();this.scrollElement!==e&&(this.cleanup(),this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.scrollOffset<e?`forward`:`backward`:null,this.scrollOffset=e;let n=this.isScrolling;this.isScrolling=t,this.notify(n!==t,t)})))},this.getSize=()=>this.scrollRect[this.options.horizontal?`width`:`height`],this.getMeasurementOptions=nI(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(e,t,n,r)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r}),{key:!1}),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurements=nI(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r},i)=>{let a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];let o=this.measurementsCache.slice(0,a);for(let s=a;s<e;s++){let e=r(s),a=this.options.lanes===1?o[s-1]:this.getFurthestMeasurement(o,s),c=a?a.end+this.options.gap:t+n,l=i.get(e),u=typeof l==`number`?l:this.options.estimateSize(s),d=c+u,f=a?a.lane:s%this.options.lanes;o[s]={index:s,start:c,size:u,end:d,key:e,lane:f}}return this.measurementsCache=o,o},{key:!1,debug:()=>this.options.debug}),this.calculateRange=nI(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){let r=e.length-1,i=mI(0,r,t=>e[t].start,n),a=i;for(;a<r&&e[a].end<n+t;)a++;return{startIndex:i,endIndex:a}}({measurements:e,outerSize:t,scrollOffset:n}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=nI(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,n,r)=>t===null?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):-1},this._measureElement=(e,t)=>{let n=this.measurementsCache[this.indexFromElement(e)];if(!n||!e.isConnected)return void this.measureElementCache.forEach((t,n)=>{t===e&&(this.observer.unobserve(e),this.measureElementCache.delete(n))});let r=this.measureElementCache.get(n.key);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.measureElementCache.set(n.key,e));let i=this.options.measureElement(e,t,this);this.resizeItem(n,i)},this.resizeItem=(e,t)=>{let n=t-(this.itemSizeCache.get(e.key)??e.size);n!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange===void 0?e.start<this.scrollOffset+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(e,n,this))&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(e.index),this.itemSizeCache=new Map(this.itemSizeCache.set(e.key,t)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=nI(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();return rI(t[mI(0,t.length-1,e=>rI(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{let n=this.getSize();t===`auto`&&(t=e<=this.scrollOffset?`start`:e>=this.scrollOffset+n?`end`:`start`),t===`start`||(t===`end`?e-=n:t===`center`&&(e-=n/2));let r=this.options.horizontal?`scrollWidth`:`scrollHeight`,i=(this.scrollElement?`document`in this.scrollElement?this.scrollElement.document.documentElement[r]:this.scrollElement[r]:0)-this.getSize();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=rI(this.getMeasurements()[e]);if(t===`auto`)if(n.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)t=`end`;else{if(!(n.start<=this.scrollOffset+this.options.scrollPaddingStart))return[this.scrollOffset,t];t=`start`}let r=t===`end`?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,t),t]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t=`start`,behavior:n}={})=>{this.cancelScrollToIndex(),n===`smooth`&&this.isDynamicMode(),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t=`auto`,behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),n===`smooth`&&this.isDynamicMode();let[r,i]=this.getOffsetForIndex(e,t);this._scrollToOffset(r,{adjustments:void 0,behavior:n}),n!==`smooth`&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(e))){let[t]=this.getOffsetForIndex(e,i);((e,t)=>Math.abs(e-t)<1)(t,this.scrollOffset)||this.scrollToIndex(e,{align:i,behavior:n})}else this.scrollToIndex(e,{align:i,behavior:n})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),t===`smooth`&&this.isDynamicMode(),this._scrollToOffset(this.scrollOffset+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;return t=e.length===0?this.options.paddingStart:this.options.lanes===1?e[e.length-1]?.end??0:Math.max(...e.slice(-this.options.lanes).map(e=>e.end)),t-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,(t=(e=this.options).onChange)==null||t.call(e,this,!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset=typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}),this.notify(!1,!1)}},mI=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else{if(!(a>r))return i;t=i-1}}return e>0?e-1:0},hI=typeof document<`u`?s.useLayoutEffect:s.useEffect;function gI(e){return function(e){let t=s.useReducer(()=>({}),{})[1],n={...e,onChange:(n,r)=>{var i;r?(0,c.flushSync)(t):t(),(i=e.onChange)==null||i.call(e,n,r)}},[r]=s.useState(()=>new pI(n));return r.setOptions(n),s.useEffect(()=>r._didMount(),[]),hI(()=>r._willUpdate()),r}({observeElementRect:sI,observeElementOffset:uI,scrollToFn:fI,...e})}function _I(){let e=Y(e=>e.config.ui?.activeTheme);return Y(t=>(t.config.ui?.themes||[]).find(t=>t.name===e))}function vI({category:e}){let t=_I(),n=e.name,r=e.list?e.list:Array.from(Array(e.items).keys()),i=(0,s.useRef)(null),a=gI({horizontal:!0,count:r.length,getScrollElement:()=>i.current,estimateSize:(0,s.useCallback)(()=>52,[]),overscan:5});return(0,s.useEffect)(()=>{a.scrollToIndex(0)},[n]),(0,l.jsx)(s.Fragment,{children:(0,l.jsx)(`div`,{ref:i,className:`tiny-scrollbar overflow-x-auto overflow-y-hidden`,style:{height:`52px`},children:(0,l.jsx)(`div`,{className:`h-full relative mx-auto`,style:{width:`${a.getTotalSize()}px`},children:a.getVirtualItems().map(n=>{let i=`${r[n.index]}`;return(0,l.jsx)(`div`,{className:`absolute top-0 left-0 h-full`,style:{width:`${n.size}px`,transform:`translateX(${n.start}px)`},children:(0,l.jsx)(FD,{variant:`outline`,radius:`rounded-xl`,size:`md`,equalWidth:!0,onClick:async()=>{await Z().shape.addSticker(e.name,i),X().setDirty(!0)},children:(0,l.jsx)(`img`,{className:K(`m-auto m-auto w-28 h-28`,e.invertPreview&&t?.isDark&&`invert`),src:YE(e,i),alt:i})})},n.index)})})})})}function yI(){let e=Y(e=>e.config.tools?.stickers?.items)||[],[t,n]=(0,s.useState)(e[0]);return(0,l.jsxs)(`div`,{className:`h-92`,children:[(0,l.jsx)(`div`,{className:`mb-10 w-full hide-scrollbar overflow-x-auto overflow-y-hidden flex`,children:(0,l.jsx)($A,{value:t,onChange:e=>n(e),variant:`outline`,radius:`rounded-full`,className:`mx-auto`,children:e.map(e=>{let n=t===e,r=s_[e.name];return(0,l.jsx)(FD,{size:`xs`,color:n?`primary`:null,value:e,children:(0,l.jsx)(`span`,{className:`capitalize`,children:r?(0,l.jsx)(rA,{...r}):e.name})},e.name)})})}),t&&(0,l.jsx)(vI,{category:t})]})}function bI(){let e=Y(e=>e.config.tools?.frame?.items)||[],t=Y(e=>e.frame.active);return(0,s.useEffect)(()=>{X().frame.active&&X().frame.showOptionsPanel()},[]),(0,l.jsx)(DF,{children:e.map(e=>{let n=TE(`images/frames/${e.name}/thumbnail.png`),r=t?.name===e.name;return(0,l.jsx)(OF,{children:(0,l.jsxs)(`button`,{type:`button`,className:`border-2 overflow-hidden relative rounded border cursor-pointer `+(r?`border-primary`:``),onClick:()=>{X().setDirty(!0),r?Z().frame.remove():Z().frame.add(e.name)},children:[r&&(0,l.jsx)(xI,{}),(0,l.jsx)(`img`,{draggable:`false`,className:`w-64 h-64`,src:n,alt:e.name})]})},e.name)})})}function xI(){return(0,l.jsx)(`span`,{className:`bg-background/70 absolute inset-0 text-primary`,children:(0,l.jsx)(SF,{className:`svg-icon icon-md absolute inset-0 block m-auto`})})}function SI(){let e=Y(e=>e.config.tools?.text?.items);return(0,s.useEffect)(()=>{e&&kE(e,{prefixSrc:TE,id:`pixie-fonts`}).catch(()=>{})},[e]),(0,s.useEffect)(()=>{Z().text.selectOrAddText()&&X().setDirty(!0)},[]),(0,l.jsx)(DF,{className:`pt-6`,children:(e||[]).map(e=>(0,l.jsx)(OF,{children:(0,l.jsx)(CI,{fontConfig:e})},e.family))})}function CI({fontConfig:e}){let t=Y(e=>e.objects.active.editableProps.fontFamily);return(0,l.jsx)(`button`,{type:`button`,className:K(`block px-6 w-110 h-68 text-sm bg border rounded-2xl`,{"border-primary":t===e.family,"text-primary":t===e.family}),style:{fontFamily:e.family.includes(`"`)?e.family:`"${e.family}"`,fontWeight:e.descriptors?.weight||`normal`},onClick:async()=>{Z().text.selectOrAddText(),X().setDirty(!0),Z().objects.setValues({fontFamily:e.family})},children:e.family})}var wI=q((0,l.jsx)(`path`,{d:`M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7H288h9.4H512c17.7 0 32-14.3 32-32s-14.3-32-32-32H387.9L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416H288l-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z`}),`EraserFA`,`0 0 576 512`);function TI(){return(0,s.useEffect)(()=>(Z().draw.enable(),()=>{Z().draw.disable()}),[]),(0,l.jsxs)(DF,{gap:`gap-16`,children:[(0,l.jsx)(OF,{children:(0,l.jsx)(hP,{size:`sm`,label:(0,l.jsx)(rA,{message:`Brush Color`}),value:Z().draw.currentBrush.color,onChange:e=>{Z().draw.setBrushColor(e)}})}),(0,l.jsx)(OF,{children:(0,l.jsx)(DI,{})}),(0,l.jsx)(OF,{children:(0,l.jsx)(EI,{})})]})}function EI(){let e=Y(e=>e.config.tools?.draw?.brushSizes)||[],[t,n]=(0,s.useState)(Z().draw.currentBrush.width);return(0,l.jsx)(AP,{selectionMode:`single`,selectedValue:t,onSelectionChange:e=>{n(e),Z().draw.setBrushSize(e)},size:`sm`,label:(0,l.jsx)(rA,{message:`Brush Size`}),children:e.map(e=>(0,l.jsx)(HD,{value:e,children:(0,l.jsxs)(`div`,{className:`flex items-center`,children:[(0,l.jsx)(`div`,{className:`flex-shrink-0 mr-8 border-[3px] rounded-full`,style:{width:`${e}px`,height:`${e}px`}}),e]})},e))})}function DI(){let e=Y(e=>e.config.tools?.draw?.brushTypes)||[],t=_I(),[n,r]=(0,s.useState)(Z().draw.currentBrush.type);return(0,l.jsx)(AP,{selectionMode:`single`,selectedValue:n,onSelectionChange:e=>{r(e),Z().draw.setBrushType(e)},size:`sm`,label:(0,l.jsx)(rA,{message:`Brush Type`}),children:e.map(e=>(0,l.jsx)(HD,{value:e,children:(0,l.jsxs)(`div`,{className:`flex items-center`,children:[e===`EraserBrush`?(0,l.jsx)(wI,{className:`mr-8`}):(0,l.jsx)(`img`,{className:`flex-shrink-0 mr-8 w-24 h-24`,src:OI(e,t?.isDark),alt:``}),(0,l.jsx)(rA,{message:e.replace(/([A-Z])/g,` $1`).trim()})]})},e))})}function OI(e,t=!1){return TE(`images/brushes/${t?`white`:`black`}/${e.replace(`Brush`,``).toLowerCase()}.png`)}function kI(){let{trans:e}=cP(),t=Y(e=>e.corners.radius);return(0,s.useEffect)(()=>(X().setDirty(!0),Z().corners.showPreview(),()=>Z().corners.hidePreview()),[]),(0,l.jsx)(`div`,{className:`max-w-320 mx-auto`,children:(0,l.jsx)(EP,{minValue:1,maxValue:300,label:e({message:`Radius`}),getValueLabel:e=>`${e}px`,onChange:e=>{Z().corners.updatePreview(e),X().corners.setRadius(e)},value:t})})}var AI={initial:{y:`130%`,opacity:0},animate:{y:0,opacity:1},exit:{y:`130%`,opacity:0,left:0,position:`absolute`,overflowY:`hidden`},transition:{type:`tween`,duration:.15}};function jI({activeTool:e}){let t=function(e){switch(e){case f_.FILTER:return(0,l.jsx)(kF,{});case f_.RESIZE:return(0,l.jsx)(IF,{});case f_.CROP:return(0,l.jsx)(JF,{});case f_.DRAW:return(0,l.jsx)(TI,{});case f_.TEXT:return(0,l.jsx)(SI,{});case f_.SHAPES:return(0,l.jsx)($F,{});case f_.STICKERS:return(0,l.jsx)(yI,{});case f_.FRAME:return(0,l.jsx)(bI,{});case f_.CORNERS:return(0,l.jsx)(kI,{});default:return null}}(e);return(0,l.jsx)(CT.div,{className:`relative h-full w-full text-sm bg select-none overflow-hidden`,...AI,children:t})}function MI({className:e}){let t=Y(e=>e.activeTool);return(0,l.jsx)(`nav`,{className:K(`z-navbar min-h-86 flex-shrink-0 px-16 relative overflow-hidden`,e),children:(0,l.jsx)(AT,{initial:!1,children:t?(0,l.jsx)(jI,{activeTool:t},`tool-controls`):(0,l.jsx)(NI,{},`nav-items`)})})}function NI(){let e=Y(e=>e.config.ui?.nav?.items)||[];return(0,l.jsx)(CT.div,{className:`w-full h-full bg-inherit`,...AI,children:(0,l.jsx)(DF,{children:e.map(e=>(0,l.jsx)(OF,{children:(0,l.jsx)(PI,{item:e})},e.name))})})}function PI({item:e}){let t=F_[e.name];return(0,l.jsxs)(PD,{variant:`outline`,color:`paper`,className:`flex-col flex-shrink-0 w-68 h-68`,radius:`rounded-2xl`,onClick:()=>{typeof e.action==`string`?jb(e.action):typeof e.action==`function`&&e.action(X().editor)},children:[(0,l.jsx)(`div`,{className:`mb-1`,children:(0,l.jsx)(JA,{className:`icon-md`,icon:e.icon})}),(0,l.jsx)(`div`,{className:`mt-6 text-xs capitalize max-w-[90%] overflow-hidden overflow-ellipsis`,children:t?(0,l.jsx)(rA,{...t}):e.name})]})}function FI(){let e=Y(e=>e.history.items),t=Y(e=>e.history.pointer);return(0,l.jsxs)(CT.div,{...Kk,className:`absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden`,children:[(0,l.jsxs)(`div`,{className:`px-10 py-2 mb-4 font-medium text-sm border-b flex items-center`,children:[(0,l.jsx)(rA,{message:`History`}),(0,l.jsx)(qA,{size:`xs`,className:`ml-auto flex-shrink-0`,onClick:()=>{X().togglePanel(`history`,!1)},children:(0,l.jsx)(cj,{})})]}),(0,l.jsx)(`div`,{className:`p-10`,children:e.map(n=>{let r=n.id===e[t].id,i=N_[n.name],a=i.icon&&s.default.createElement(i.icon,{className:`icon-sm`});return(0,l.jsx)(FD,{onClick:()=>{r||Z().history.load(n)},variant:`outline`,color:r?`primary`:null,size:`sm`,className:K(`w-full mb-8`,r&&`pointer-events-none`),justify:`justify-start`,startIcon:a,children:(0,l.jsx)(rA,{...i.name})},n.id)})})]})}function II(e){let{children:t,className:n,color:r,onDismiss:i,leftAdornment:a,rightAdornment:o,hideDismissButton:c=!1,size:u,showDivider:d,justify:f=`justify-between`,titleFontWeight:p=`font-semibold`,titleTextSize:m=u===`xs`?`text-xs`:`text-sm`,closeButtonSize:h=u===`xs`?`xs`:`sm`,actions:g}=e,{labelId:_,isDismissable:v,close:y}=(0,s.useContext)(oP);return(0,l.jsxs)(`div`,{className:K(n,`flex flex-shrink-0 items-center gap-10`,p,d&&`border-b`,LI(e),r||`text-main`,f),children:[a,(0,l.jsx)(`h3`,{id:_,className:K(m,`mr-auto leading-5 opacity-90`),children:t}),o,g,v&&!c&&(0,l.jsx)(qA,{"aria-label":`Dismiss`,onClick:()=>{i?i():y()},size:h,className:K(`-mr-8 text-muted`,o&&`sr-only`),children:(0,l.jsx)(cj,{})})]})}function LI({size:e,padding:t}){if(t)return t;switch(e){case`2xs`:case`xs`:return`px-14 py-4`;case`sm`:return`px-18 py-4`;default:return`px-24 py-6`}}var RI=(0,s.forwardRef)((e,t)=>{let{children:n,className:r,padding:i,size:a,...o}=e;return(0,l.jsx)(`div`,{...o,ref:t,className:K(r,zI(e),`overflow-y-auto overflow-x-hidden overscroll-contain text-sm flex-auto`),children:n})});function zI({size:e,padding:t}){if(t)return t;switch(e){case`xs`:return`p-14`;case`sm`:return`p-18`;default:return`px-24 py-20`}}function BI(){return(0,l.jsx)(mP,{isOpen:Y(e=>e.openPanels.newImage),disableInitialTransition:!0,type:`modal`,isDismissable:!1,children:(0,l.jsx)(VI,{})})}function VI(){let[e,t]=(0,s.useState)(`default`);return(0,l.jsxs)(dP,{className:`text-center max-w-max text-main`,size:`auto`,children:[(0,l.jsx)(II,{padding:`px-24 pt-24 pb-12`,showDivider:!1,children:(0,l.jsx)(rA,{message:`Open a photo or design to get started`})}),(0,l.jsx)(RI,{children:(0,l.jsx)(e==="default"?HI:WI,{setActivePanel:t})})]})}function HI({setActivePanel:e}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(FD,{className:`mr-20`,size:`sm`,variant:`raised`,color:`primary`,onClick:()=>{Z().import.uploadAndReplaceMainImage()},children:(0,l.jsx)(rA,{message:`Open Photo`})}),(0,l.jsx)(FD,{variant:`outline`,size:`sm`,color:`primary`,onClick:()=>{e(`newCanvas`)},children:(0,l.jsx)(rA,{message:`Create New`})}),(0,l.jsx)(UI,{})]})}function UI(){let e=Y(e=>e.config.ui?.openImageDialog?.sampleImages);return e!=null&&e.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`relative py-20 text-main`,children:[(0,l.jsx)(`hr`,{className:`absolute h-1 border-none bg-divider w-full top inset-0 m-auto`}),(0,l.jsx)(`span`,{className:`text-sm bg px-6 relative`,children:(0,l.jsx)(rA,{message:`or use sample`})})]}),(0,l.jsx)(`ul`,{className:`flex items-center gap-16`,children:e.map(e=>(0,l.jsx)(`li`,{className:`shrink-0`,children:(0,l.jsx)(`button`,{type:`button`,onClick:async()=>{typeof e.action==`function`?e.action():e.url.endsWith(`.json`)?(await Ob(TE(e.url)),X().togglePanel(`newImage`,!1)):(await Z().import.openBackgroundImage(TE(e.url)),X().togglePanel(`newImage`,!1))},children:(0,l.jsx)(`img`,{className:`w-80 h-80 rounded overflow-hidden transition-shadow hover:shadow-md`,src:TE(e.thumbnail),alt:``})})},e.url||e.thumbnail))})]}):null}function WI({setActivePanel:e}){let[t,n]=(0,s.useState)({width:800,height:600,bgColor:`transparent`});return(0,l.jsxs)(`form`,{onSubmit:e=>{e.preventDefault();let{width:n,height:r,bgColor:i}=t;n&&r&&(X().setConfig({blankCanvasSize:{width:n,height:r}}),Z().canvas.openNew(n,r,i),X().togglePanel(`newImage`,!1),Z().history.addInitial())},children:[(0,l.jsx)(UA,{type:`number`,label:(0,l.jsx)(rA,{message:`Width`}),value:t.width,min:1,required:!0,className:`mb-16`,onChange:e=>{n({...t,width:e.target.valueAsNumber})}}),(0,l.jsx)(UA,{type:`number`,label:(0,l.jsx)(rA,{message:`Height`}),value:t.height,min:1,required:!0,className:`mb-16`,onChange:e=>{n({...t,height:e.target.valueAsNumber})}}),(0,l.jsx)(hP,{onChange:e=>{n({...t,bgColor:e})},className:`mb-16`,value:t.bgColor,label:(0,l.jsx)(rA,{message:`Background color`})}),(0,l.jsxs)(`div`,{className:`text-right`,children:[(0,l.jsx)(FD,{size:`sm`,variant:`text`,className:`mr-10`,onClick:()=>{e(`default`)},children:(0,l.jsx)(rA,{message:`Cancel`})}),(0,l.jsx)(FD,{size:`sm`,type:`submit`,variant:`raised`,color:`primary`,children:(0,l.jsx)(rA,{message:`Create`})})]})]})}var GI=(0,s.forwardRef)((e,t)=>{let n=MA(e),{label:r,children:i,size:a,className:o,orientation:c=`horizontal`,disabled:u,required:d,invalid:f,errorMessage:p,description:m}=e,h=(0,s.useId)(),g=e.name||h;return(0,l.jsxs)(`fieldset`,{"aria-describedby":m?`${h}-description`:void 0,ref:t,className:K(`text-left`,o),children:[r&&(0,l.jsx)(`legend`,{className:n.label,children:r}),(0,l.jsx)(`div`,{className:K(`flex`,r?`mt-6`:`mt-0`,c===`vertical`?`flex-col gap-10`:`flex-row gap-16`),children:s.Children.map(i,e=>{if((0,s.isValidElement)(e))return(0,s.cloneElement)(e,{name:g,size:a,invalid:e.props.invalid||f||void 0,disabled:e.props.disabled||u,required:e.props.required||d})})}),m&&!p&&(0,l.jsx)(`div`,{className:n.description,id:`${h}-description`,children:m}),p&&(0,l.jsx)(`div`,{className:n.error,children:p})]})}),KI=(0,s.forwardRef)((e,t)=>{let{children:n,autoFocus:r,size:i,invalid:a,isFirst:o,...s}=e,c=eE(t);VA({autoFocus:r},c);let u=function(e){switch(e){case`xs`:return{circle:`h-12 w-12`,label:`text-xs`};case`sm`:return{circle:`h-16 w-16`,label:`text-sm`};case`lg`:return{circle:`h-24 w-24`,label:`text-lg`};default:return{circle:`h-20 w-20`,label:`text-base`}}}(i);return(0,l.jsxs)(`label`,{className:K(`inline-flex gap-8 select-none items-center whitespace-nowrap align-middle`,u.label,e.disabled&&`text-disabled pointer-events-none`,e.invalid&&`text-danger`),children:[(0,l.jsx)(`input`,{type:`radio`,className:K(`focus-visible:ring outline-none`,`rounded-full transition-button border-2 appearance-none`,`border-text-muted disabled:border-disabled-fg checked:border-primary checked:hover:border-primary-dark`,`before:bg-primary disabled:before:bg-disabled-fg before:hover:bg-primary-dark`,`before:h-full before:w-full before:block before:rounded-full before:scale-10 before:opacity-0 before:transition before:duration-200`,`checked:before:scale-[.65] checked:before:opacity-100`,u.circle),ref:c,...s}),n&&(0,l.jsx)(`span`,{children:n})]})});function qI(){return(0,l.jsx)(mP,{isOpen:Y(e=>e.openPanels.export),onOpenChange:e=>{e||X().togglePanel(`export`,!1)},type:`modal`,children:(0,l.jsx)(JI,{})})}function JI(){let[e,t]=(0,s.useState)(()=>({filename:X().config.tools?.export?.defaultName||`image`,format:X().config.tools?.export?.defaultFormat||`jpeg`,quality:X().config.tools?.export?.defaultQuality||.8}));return(0,l.jsx)(dP,{className:`text-center max-w-max text-main`,size:`auto`,children:(0,l.jsx)(RI,{children:(0,l.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),Z().export.save(e.filename,e.format,e.quality),X().togglePanel(`export`,!1)},children:[(0,l.jsx)(UA,{required:!0,size:`sm`,label:(0,l.jsx)(rA,{message:`Save As`}),value:e.filename,onChange:n=>{t({...e,filename:n.target.value})}}),(0,l.jsxs)(GI,{size:`sm`,className:`my-20`,"aria-label":`Image format`,children:[(0,l.jsx)(KI,{value:`jpeg`,checked:e.format===`jpeg`,onChange:n=>{t({...e,format:n.target.value})},children:`JPEG`}),(0,l.jsx)(KI,{value:`png`,checked:e.format===`png`,onChange:n=>{t({...e,format:n.target.value})},children:`PNG`}),(0,l.jsx)(KI,{value:`json`,checked:e.format===`json`,onChange:n=>{t({...e,format:n.target.value})},children:`JSON`})]}),(0,l.jsx)(EP,{size:`sm`,minValue:.1,step:.1,maxValue:1,value:e.quality,onChange:n=>{t({...e,quality:n})},formatOptions:{style:`percent`},label:(0,l.jsx)(rA,{message:`Quality`})}),(0,l.jsx)(FD,{variant:`raised`,color:`primary`,type:`submit`,className:`mt-20 w-full`,size:`sm`,children:(0,l.jsx)(rA,{message:`Save`})})]})})})}function YI(){let e=Y(e=>e.objects.all),t=Y(e=>e.objects.active.id);return(0,l.jsxs)(CT.div,{...Kk,className:`absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden`,children:[(0,l.jsxs)(`div`,{className:`px-10 py-2 mb-4 font-medium text-sm border-b flex items-center`,children:[(0,l.jsx)(rA,{message:`Objects`}),(0,l.jsx)(qA,{size:`xs`,className:`ml-auto flex-shrink-0`,onClick:()=>{X().togglePanel(`objects`,!1)},children:(0,l.jsx)(cj,{})})]}),(0,l.jsx)(`div`,{className:`p-8`,children:e.map(e=>{let n=e.id===t,r=e.name;if(!r)return null;let i=Cy[r],a=i.icon&&s.default.createElement(i.icon,{className:`icon-sm`});return(0,l.jsx)(FD,{onClick:()=>{n||!e.selectable||Z().objects.select(e.id)},variant:`outline`,color:n?`primary`:null,size:`sm`,className:K(`w-full mb-8`,(n||!e.selectable)&&`pointer-events-none`),justify:`justify-start`,startIcon:a,children:(0,l.jsx)(rA,{...i.name})},e.id)})})]})}function XI(){let e=Y(e=>e.openPanels.history),t=Y(e=>e.openPanels.objects);return(0,l.jsxs)(`div`,{className:`z-modal`,children:[(0,l.jsxs)(AT,{children:[e&&(0,l.jsx)(FI,{},`historyPanel`),t&&(0,l.jsx)(YI,{},`objListPanel`)]}),(0,l.jsx)(BI,{}),(0,l.jsx)(qI,{})]})}function ZI(){return ZI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZI.apply(this,arguments)}var QI,$I;function eL(e,t){if(!1===e||e===null||typeof e>`u`)throw Error(t)}function tL(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function nL(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function rL(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function iL(e,t,n,r){return`Cannot include a '`+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function aL(e,t){let n=function(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}(e);return t?n.map((t,n)=>n===e.length-1?t.pathname:t.pathnameBase):n.map(e=>e.pathnameBase)}function oL(e,t,n,r){let i;r===void 0&&(r=!1),typeof e==`string`?i=nL(e):(i=ZI({},e),eL(!i.pathname||!i.pathname.includes(`?`),iL(`?`,`pathname`,`search`,i)),eL(!i.pathname||!i.pathname.includes(`#`),iL(`#`,`pathname`,`hash`,i)),eL(!i.search||!i.search.includes(`#`),iL(`#`,`search`,`hash`,i)));let a,o=e===``||i.pathname===``,s=o?`/`:i.pathname;if(s==null)a=n;else{let e=t.length-1;if(!r&&s.startsWith(`..`)){let t=s.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}a=e>=0?t[e]:`/`}let c=function(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?nL(e):e;return{pathname:n?n.startsWith(`/`)?n:rL(n,t):t,search:cL(r),hash:lL(i)}}(i,a),l=s&&s!==`/`&&s.endsWith(`/`),u=(o||s===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(QI||={}),function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`}($I||={});var sL=e=>e.join(`/`).replace(/\/\/+/g,`/`),cL=e=>e&&e!==`?`?e.startsWith(`?`)?e:`?`+e:``,lL=e=>e&&e!==`#`?e.startsWith(`#`)?e:`#`+e:``,uL=[`post`,`put`,`patch`,`delete`];new Set(uL);var dL=[`get`,...uL];function fL(){return fL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fL.apply(this,arguments)}new Set(dL);var pL=s.createContext(null),mL=s.createContext(null),hL=s.createContext(null),gL=s.createContext({outlet:null,matches:[],isDataRoute:!1});function _L(){return s.useContext(hL)!=null}function vL(){return _L()||eL(!1),s.useContext(hL).location}function yL(e){s.useContext(mL).static||s.useLayoutEffect(e)}function bL(){let{isDataRoute:e}=s.useContext(gL);return e?function(){let{router:e}=function(){let e=s.useContext(pL);return e||eL(!1),e}(SL.UseNavigateStable),t=function(){let e=function(){let e=s.useContext(gL);return e||eL(!1),e}(),t=e.matches[e.matches.length-1];return t.route.id||eL(!1),t.route.id}(CL.UseNavigateStable),n=s.useRef(!1);return yL(()=>{n.current=!0}),s.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,fL({fromRouteId:t},i)))},[e,t])}():function(){_L()||eL(!1);let e=s.useContext(pL),{basename:t,future:n,navigator:r}=s.useContext(mL),{matches:i}=s.useContext(gL),{pathname:a}=vL(),o=JSON.stringify(aL(i,n.v7_relativeSplatPath)),c=s.useRef(!1);return yL(()=>{c.current=!0}),s.useCallback(function(n,i){if(i===void 0&&(i={}),!c.current)return;if(typeof n==`number`)return void r.go(n);let s=oL(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(s.pathname=s.pathname===`/`?t:sL([t,s.pathname])),(i.replace?r.replace:r.push)(s,i.state,i)},[t,r,o,a,e])}()}function xL(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=s.useContext(mL),{matches:i}=s.useContext(gL),{pathname:a}=vL(),o=JSON.stringify(aL(i,r.v7_relativeSplatPath));return s.useMemo(()=>oL(e,JSON.parse(o),a,n===`path`),[e,o,a,n])}var SL=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(SL||{}),CL=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}(CL||{});function wL(){return wL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wL.apply(this,arguments)}new Promise(()=>{});var TL=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`unstable_viewTransition`];try{window.__reactRouterVersion=`6`}catch{}var EL=typeof window<`u`&&typeof window.document<`u`&&typeof window.document.createElement<`u`,DL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,OL=s.forwardRef(function(e,t){let n,{onClick:r,relative:i,reloadDocument:a,replace:o,state:c,target:l,to:u,preventScrollReset:d,unstable_viewTransition:f}=e,p=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,TL),{basename:m}=s.useContext(mL),h=!1;if(typeof u==`string`&&DL.test(u)&&(n=u,EL))try{let e=new URL(window.location.href),t=u.startsWith(`//`)?new URL(e.protocol+u):new URL(u),n=function(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}(t.pathname,m);t.origin===e.origin&&n!=null?u=n+t.search+t.hash:h=!0}catch{}let g=function(e,t){let{relative:n}=t===void 0?{}:t;_L()||eL(!1);let{basename:r,navigator:i}=s.useContext(mL),{hash:a,pathname:o,search:c}=xL(e,{relative:n}),l=o;return r!==`/`&&(l=o===`/`?r:sL([r,o])),i.createHref({pathname:l,search:c,hash:a})}(u,{relative:i}),_=function(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,unstable_viewTransition:c}=t===void 0?{}:t,l=bL(),u=vL(),d=xL(e,{relative:o});return s.useCallback(t=>{(function(e,t){return!(e.button!==0||t&&t!==`_self`||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))})(t,n)&&(t.preventDefault(),l(e,{replace:r===void 0?tL(u)===tL(d):r,state:i,preventScrollReset:a,relative:o,unstable_viewTransition:c}))},[u,l,d,r,i,n,e,a,o,c])}(u,{replace:o,state:c,target:l,preventScrollReset:d,relative:i,unstable_viewTransition:f});return s.createElement(`a`,wL({},p,{href:n||g,onClick:h||a?r:function(e){r&&r(e),e.defaultPrevented||_(e)},ref:t,target:l}))}),kL,AL;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(kL||={}),function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`}(AL||={});var jL=q((0,l.jsx)(`path`,{d:`M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z`}),`ErrorOutlineOutlined`),ML=q((0,l.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z`}),`CheckCircleOutlined`),NL={opacity:0,y:50,scale:.3},PL={opacity:1,y:0,scale:1},FL={opacity:0,scale:.5};function IL(){return(0,l.jsx)(`div`,{className:`pointer-events-none relative`,children:(0,l.jsx)(AT,{initial:!1,children:Fb(e=>e.toasts).map(e=>(0,l.jsx)(`div`,{className:K(`fixed z-toast mx-auto p-20`,e.position===`bottom-center`?`bottom-0 left-0 right-0`:`bottom-0 right-0`),children:(0,l.jsxs)(CT.div,{initial:e.disableEnterAnimation?void 0:NL,animate:e.disableEnterAnimation?void 0:PL,exit:e.disableExitAnimation?void 0:FL,className:K(`pointer-events-auto mx-auto flex max-h-100 min-h-50 w-min min-w-288 max-w-500 items-center gap-10 rounded-lg border bg-paper bg-paper py-6 pl-16 pr-6 text-sm text-main shadow-lg`),onPointerEnter:()=>e.timer?.pause(),onPointerLeave:()=>e.timer?.resume(),role:`alert`,"aria-live":e.type===`danger`?`assertive`:`polite`,children:[e.type===`danger`&&(0,l.jsx)(jL,{className:`flex-shrink-0 text-danger`,size:`md`}),e.type===`loading`&&(0,l.jsx)(DP,{size:`sm`,className:`flex-shrink-0`,isIndeterminate:!0}),e.type===`positive`&&(0,l.jsx)(ML,{className:`flex-shrink-0 text-positive`,size:`md`}),(0,l.jsx)(`div`,{className:`mr-auto w-max overflow-hidden overflow-ellipsis`,"data-testid":`toast-message`,children:(0,l.jsx)(YA,{value:e.message})}),e.action&&(0,l.jsx)(FD,{variant:`text`,color:`primary`,size:`sm`,className:`flex-shrink-0`,onFocus:()=>e.timer?.pause(),onBlur:()=>e.timer?.resume(),onClick:()=>Ib().remove(e.id),elementType:OL,to:e.action.action,children:(0,l.jsx)(YA,{value:e.action.label})}),e.type!==`loading`&&(0,l.jsx)(qA,{onFocus:()=>e.timer?.pause(),onBlur:()=>e.timer?.resume(),type:`button`,className:`flex-shrink-0`,onClick:()=>{Ib().remove(e.id)},size:`sm`,children:(0,l.jsx)(cj,{})})]})},e.id))})})}function LL(e){return JT()?e.metaKey:e.ctrlKey}function RL(e){switch(e.key){case`z`:LL(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?Z().history.redo():Z().history.undo());break;case`ArrowUp`:e.preventDefault(),e.stopPropagation(),Z().objects.move(`up`);break;case`ArrowRight`:e.preventDefault(),e.stopPropagation(),Z().objects.move(`right`);break;case`ArrowDown`:e.preventDefault(),e.stopPropagation(),Z().objects.move(`down`);break;case`ArrowLeft`:e.preventDefault(),e.stopPropagation(),Z().objects.move(`left`);break;case`Delete`:e.preventDefault(),e.stopPropagation(),Z().objects.delete();break;case`v`:LL(e)&&(e.preventDefault(),e.stopPropagation(),async function(){try{let e=await navigator.clipboard.read();for(let t of e)for(let e of t.types)if(e.startsWith(`image/`)){let n=await t.getType(e),r=new FileReader;r.onload=e=>{var t;(t=e.target)!=null&&t.result&&Z().import.addImageFromData(e.target.result)},r.readAsDataURL(n);return}}catch{}}())}}var zL=new Map,BL=new Map,VL={};async function*HL(e){let t=e.createReader(),n;do{n=await new Promise((e,n)=>{t.readEntries(e,n)});for(let e of n)if(e.isFile){if(e.name===`.DS_Store`)continue;yield new cD(await UL(e),e.fullPath)}else e.isDirectory&&(yield*HL(e))}while(n.length>0)}function UL(e){return new Promise((t,n)=>e.file(t,n))}function WL(e){return VL.dragTargetId==null?e.dataTransfer.types.includes(`Files`)?{type:`nativeFile`,el:null,ref:null,getData:()=>async function(e){let t=[];for await(let n of e)t.push(n);return t}(async function*(e){let t=[];for(let n of e.items)if(n.kind===`file`){let e=n.webkitGetAsEntry();e&&t.push(e)}for(let e of t)if(e.isFile){if(e.name===`.DS_Store`)continue;yield new cD(await UL(e),e.fullPath)}else e.isDirectory&&(yield*HL(e))}(e.dataTransfer))}:void 0:zL.get(VL.dragTargetId)}function GL(){let e=Y(e=>e.config.ui?.visible)??!0,t=Y(e=>e.config.ui?.nav?.position)??`bottom`,n=Y(e=>e.config.ui?.menubar?.position)??`top`,r=Y(e=>e.config.ui?.allowEditorClose)??!0,i=(0,s.useRef)(null),a=(0,s.useRef)(null),{isModal:o,isMobile:c}=lj(),{droppableProps:u}=function({id:e,disabled:t,ref:n,...r}){let i=(0,s.useRef)({dragOverElements:new Set,dropActivateTimer:void 0}).current,a=(0,s.useRef)(r);a.current=r,(0,s.useLayoutEffect)(()=>(BL.set(e,{...BL.get(e),disabled:t,id:e,ref:n}),()=>{BL.delete(e)}),[e,a,t,n]);let o=e=>{let t=a.current,r=t.allowDragEventsFromItself||n.current!==e.ref?.current;return!(!(e!=null&&e.type&&r&&t.types.includes(e.type))||t.acceptsDrop&&!t.acceptsDrop(e))},c=e=>{var t,n;let r=WL(e);r&&((n=(t=a.current).onDragLeave)==null||n.call(t,r))};return{droppableProps:t?{}:{onDragOver:e=>{var t,n;e.preventDefault(),e.stopPropagation();let r=WL(e);r&&o(r)&&((n=(t=a.current).onDragOver)==null||n.call(t,r,e))},onDragEnter:e=>{var t,n;if(e.stopPropagation(),i.dragOverElements.add(e.target),i.dragOverElements.size>1)return;let r=WL(e);r&&o(r)&&((n=(t=a.current).onDragEnter)==null||n.call(t,r),clearTimeout(i.dropActivateTimer),typeof a.current.onDropActivate==`function`&&(i.dropActivateTimer=setTimeout(()=>{var e,t;r&&((t=(e=a.current).onDropActivate)==null||t.call(e,r))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(let t of i.dragOverElements)e.currentTarget.contains(t)||i.dragOverElements.delete(t);if(i.dragOverElements.size>0)return;let t=WL(e);t&&o(t)&&(c(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,n,r,s;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),c(e),clearTimeout(i.dropActivateTimer);let l=WL(e);l&&((n=(t=a.current).onDragLeave)==null||n.call(t,l),o(l)&&((s=(r=a.current).onDrop)==null||s.call(r,l)))}}}}({id:`pixie-root`,ref:a,types:[`nativeFile`],onDrop:(0,s.useCallback)(async e=>{if(X().activeTool||X().dirty||e.type!==`nativeFile`)return;let t=await e.getData();Z().import.fileIsValid(t[0])&&(X().config.tools?.import?.openDroppedImageAsBackground?await Z().import.openBackgroundImage(t[0]):await Z().import.openUploadedFile(t[0]))},[])});(0,s.useEffect)(()=>{var e;X().fabric||(Y.setState({canvasRef:i}),ED(i.current),(e=X().config.ui)!=null&&e.defaultTool&&X().setActiveTool(X().config.ui?.defaultTool,null),Z().canvas.loadInitialContent().then(()=>{var e,t;(t=(e=X().config).onLoad)==null||t.call(e,X().editor)}));let t=DD(a,()=>{X().setStageSize(OD(a.current))}),n=DD(i,()=>{X().setCanvasSize(OD(i.current))});return()=>{t(),n()}},[a]);let d=K(`pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full`,{relative:!o,"fixed inset-0 w-full h-full z-20":o,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":o&&!c});return(0,l.jsxs)(jT,{features:NT,strict:!0,children:[o&&e&&!c&&r&&(0,l.jsx)(qA,{className:`z-20 fixed right-2 top-2 text-white`,size:`lg`,onClick:()=>{X().editor.close()},children:(0,l.jsx)(cj,{})}),o&&e&&(0,l.jsx)(Xk,{position:`fixed`,disableInitialTransition:!0}),(0,l.jsxs)(CT.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:`flex`},hidden:{opacity:0,transitionEnd:{display:`none`}}},animate:e?`visible`:`hidden`,className:d,children:[n===`top`&&(0,l.jsx)(gj,{}),t===`top`&&(0,l.jsx)(MI,{className:`pt-14`}),(0,l.jsxs)(`main`,{className:`relative flex-auto my-20 overflow-hidden outline-none`,tabIndex:-1,...GT(u,{onKeyDownCapture:RL}),ref:a,children:[(0,l.jsx)(vj,{}),(0,l.jsx)(XM,{ref:i})]}),(0,l.jsx)(xF,{}),t===`bottom`&&(0,l.jsx)(MI,{}),n===`bottom`&&(0,l.jsx)(gj,{}),(0,l.jsx)(XI,{}),(0,l.jsx)(IL,{})]})]})}(function(){fabric.Object.ENLIVEN_PROPS.push(`eraser`);var e=fabric.Object.prototype._drawClipPath,t=fabric.Object.prototype.needsItsOwnCache,n=fabric.Object.prototype.toObject,r=fabric.Object.prototype.getSvgCommons,i=fabric.Object.prototype._createBaseClipPathSVGMarkup,a=fabric.Object.prototype._createBaseSVGMarkup;fabric.Object.prototype.cacheProperties.push(`eraser`),fabric.Object.prototype.stateProperties.push(`eraser`),fabric.util.object.extend(fabric.Object.prototype,{erasable:!0,eraser:void 0,needsItsOwnCache:function(){return t.call(this)||!!this.eraser},_drawClipPath:function(t,n){if(e.call(this,t,n),this.eraser){var r=this._getNonTransformedDimensions();this.eraser.isType(`eraser`)&&this.eraser.set({width:r.x,height:r.y}),e.call(this,t,this.eraser)}},toObject:function(e){var t=n.call(this,[`erasable`].concat(e));return this.eraser&&!this.eraser.excludeFromExport&&(t.eraser=this.eraser.toObject(e)),t},getSvgCommons:function(){return r.call(this)+(this.eraser?`mask="url(#`+this.eraser.clipPathId+`)" `:``)},_createEraserSVGMarkup:function(e){return this.eraser?(this.eraser.clipPathId=`MASK_`+ fabric.Object.__uid++,[`<mask id="`,this.eraser.clipPathId,`" >`,this.eraser.toSVG(e),`</mask>`,`
592
- `].join(``)):``},_createBaseClipPathSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),i.call(this,e,t)].join(``)},_createBaseSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),a.call(this,e,t)].join(``)}});var o=fabric.Group.prototype._restoreObjectsState;fabric.util.object.extend(fabric.Group.prototype,{_addEraserPathToObjects:function(e){this._objects.forEach(function(t){fabric.EraserBrush.prototype._addPathToObjectEraser.call(fabric.EraserBrush.prototype,t,e)})},applyEraserToObjects:function(){var e=this,t=this.eraser;if(t){delete this.eraser;var n=e.calcTransformMatrix();t.clone(function(t){var r=e.clipPath;t.getObjects(`path`).forEach(function(t){var i=fabric.util.multiplyTransformMatrices(n,t.calcTransformMatrix());fabric.util.applyTransformToObject(t,i),r?r.clone(function(r){var i=fabric.EraserBrush.prototype.applyClipPathToPath.call(fabric.EraserBrush.prototype,t,r,n);e._addEraserPathToObjects(i)},[`absolutePositioned`,`inverted`]):e._addEraserPathToObjects(t)})})}},_restoreObjectsState:function(){return!0===this.erasable&&this.applyEraserToObjects(),o.call(this)}}),fabric.Eraser=fabric.util.createClass(fabric.Group,{type:`eraser`,originX:`center`,originY:`center`,drawObject:function(e){e.save(),e.fillStyle=`black`,e.fillRect(-this.width/2,-this.height/2,this.width,this.height),e.restore(),this.callSuper(`drawObject`,e)},_getBounds:function(){},_toSVG:function(e){var t=[`<g `,`COMMON_PARTS`,` >
593
- `],n=[`<rect `,`fill="white" `,`x="`,-this.width/2,`" y="`,-this.height/2,`" width="`,this.width,`" height="`,this.height,`" />
594
- `].join(``);t.push(` `,n);for(var r=0,i=this._objects.length;r<i;r++)t.push(` `,this._objects[r].toSVG(e));return t.push(`</g>
595
- `),t}}),fabric.Eraser.fromObject=function(e,t){var n=e.objects;fabric.util.enlivenObjects(n,function(n){var r=fabric.util.object.clone(e,!0);delete r.objects,fabric.util.enlivenObjectEnlivables(e,r,function(){t&&t(new fabric.Eraser(n,r,!0))})})};var s=fabric.Canvas.prototype._renderOverlay;fabric.util.object.extend(fabric.Canvas.prototype,{isErasing:function(){return this.isDrawingMode&&this.freeDrawingBrush&&this.freeDrawingBrush.type===`eraser`&&this.freeDrawingBrush._isErasing},_renderOverlay:function(e){s.call(this,e),this.isErasing()&&!this.freeDrawingBrush.inverted&&this.freeDrawingBrush._render()}}),fabric.EraserBrush=fabric.util.createClass(fabric.PencilBrush,{type:`eraser`,inverted:!1,_isErasing:!1,_isErasable:function(e){return!1!==e.erasable},_prepareCollectionTraversal:function(e,t,n){e.forEachObject(function(r){r.forEachObject&&r.erasable===`deep`?this._prepareCollectionTraversal(r,t,n):!this.inverted&&r.erasable&&r.visible?(r.visible=!1,e.dirty=!0,n.visibility.push(r),n.collection.push(e)):this.inverted&&r.visible&&(r.erasable&&r.eraser?(r.eraser.inverted=!0,r.dirty=!0,e.dirty=!0,n.eraser.push(r),n.collection.push(e)):(r.visible=!1,e.dirty=!0,n.visibility.push(r),n.collection.push(e)))},this)},preparePattern:function(){this._patternCanvas||=fabric.util.createCanvasElement();var e=this._patternCanvas;e.width=this.canvas.width,e.height=this.canvas.height;var t=e.getContext(`2d`);if(this.canvas._isRetinaScaling()){var n=this.canvas.getRetinaScaling();this.canvas.__initRetinaScaling(n,e,t)}var r=this.canvas.backgroundImage,i=r&&this._isErasable(r),a=this.canvas.overlayImage,o=a&&this._isErasable(a);if(!this.inverted&&(r&&!i||this.canvas.backgroundColor))i&&(this.canvas.backgroundImage=void 0),this.canvas._renderBackground(t),i&&(this.canvas.backgroundImage=r);else if(this.inverted&&r&&i){var c=this.canvas.backgroundColor;this.canvas.backgroundColor=void 0,this.canvas._renderBackground(t),this.canvas.backgroundColor=c}t.save(),t.transform.apply(t,this.canvas.viewportTransform);var l={visibility:[],eraser:[],collection:[]};this._prepareCollectionTraversal(this.canvas,t,l),this.canvas._renderObjects(t,this.canvas._objects),l.visibility.forEach(function(e){e.visible=!0}),l.eraser.forEach(function(e){e.eraser.inverted=!1,e.dirty=!0}),l.collection.forEach(function(e){e.dirty=!0}),t.restore(),!this.inverted&&(a&&!o||this.canvas.overlayColor)?(o&&(this.canvas.overlayImage=void 0),s.call(this.canvas,t),o&&(this.canvas.overlayImage=a)):this.inverted&&a&&o&&(c=this.canvas.overlayColor,this.canvas.overlayColor=void 0,s.call(this.canvas,t),this.canvas.overlayColor=c)},_setBrushStyles:function(e){this.callSuper(`_setBrushStyles`,e),e.strokeStyle=`black`},_saveAndTransform:function(e){this.callSuper(`_saveAndTransform`,e),this._setBrushStyles(e),e.globalCompositeOperation=e===this.canvas.getContext()?`destination-out`:`source-over`},needsFullRender:function(){return!0},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this.preparePattern(),this._isErasing=!0,this.canvas.fire(`erasing:start`),this._render())},_render:function(){var e;this.inverted||(e=this.canvas.getContext(),this.callSuper(`_render`,e)),e=this.canvas.contextTop,this.canvas.clearContext(e),this.callSuper(`_render`,e),e.save();var t=1/this.canvas.getRetinaScaling();e.scale(t,t),e.globalCompositeOperation=`source-in`,e.drawImage(this._patternCanvas,0,0),e.restore()},createPath:function(e){var t=this.callSuper(`createPath`,e);return t.globalCompositeOperation=this.inverted?`source-over`:`destination-out`,t.stroke=this.inverted?`white`:`black`,t},applyClipPathToPath:function(e,t,n){var r=fabric.util.invertTransform(e.calcTransformMatrix()),i=t.calcTransformMatrix(),a=t.absolutePositioned?r:fabric.util.multiplyTransformMatrices(r,n);return t.absolutePositioned=!1,fabric.util.applyTransformToObject(t,fabric.util.multiplyTransformMatrices(a,i)),e.clipPath=e.clipPath?fabric.util.mergeClipPaths(t,e.clipPath):t,e},clonePathWithClipPath:function(e,t,n){var r=t.calcTransformMatrix(),i=t.clipPath,a=this;e.clone(function(e){i.clone(function(t){n(a.applyClipPathToPath(e,t,r))},[`absolutePositioned`,`inverted`])})},_addPathToObjectEraser:function(e,t){var n=this;if(e.forEachObject&&e.erasable===`deep`){var r=e._objects.filter(function(e){return e.erasable});r.length>0&&e.clipPath?this.clonePathWithClipPath(t,e,function(e){r.forEach(function(t){n._addPathToObjectEraser(t,e)})}):r.length>0&&r.forEach(function(e){n._addPathToObjectEraser(e,t)})}else{var i=e.eraser;i||(i=new fabric.Eraser,e.eraser=i),t.clone(function(t){var r=fabric.util.multiplyTransformMatrices(fabric.util.invertTransform(e.calcTransformMatrix()),t.calcTransformMatrix());fabric.util.applyTransformToObject(t,r),i.addWithUpdate(t),e.set(`dirty`,!0),e.fire(`erasing:end`,{path:t}),e.group&&Array.isArray(n.__subTargets)&&n.__subTargets.push(e)})}},applyEraserToCanvas:function(e){var t=this.canvas,n={};return[`backgroundImage`,`overlayImage`].forEach(function(r){var i=t[r];i&&i.erasable&&(this._addPathToObjectEraser(i,e),n[r]=i)},this),n},_finalizeAndAddPath:function(){var e=this.canvas.contextTop,t=this.canvas;e.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate)),t.clearContext(t.contextTop),this._isErasing=!1;var n=this._points&&this._points.length>1?this.convertPointsToSVGPath(this._points):null;if(!n||this._isEmptySVGPath(n))return t.fire(`erasing:end`),void t.requestRenderAll();var r=this.createPath(n);r.setCoords(),t.fire(`before:path:created`,{path:r});var i=this.applyEraserToCanvas(r),a=this;this.__subTargets=[];var o=[];t.forEachObject(function(e){e.erasable&&e.intersectsWithObject(r,!0,!0)&&(a._addPathToObjectEraser(e,r),o.push(e))}),t.fire(`erasing:end`,{path:r,targets:o,subTargets:this.__subTargets,drawables:i}),delete this.__subTargets,t.requestRenderAll(),this._resetShadow(),t.fire(`path:created`,{path:r})}})})(),Rf.enableBoundaryChecking(!1);var KL=class e{constructor(e){if(kf(this,`tools`,{}),kf(this,`fabric`,null),e.sentryDsn&&function(e){let t={...e};Wh(t,`react`),e_(t)}({dsn:e.sentryDsn}),function(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(typeof document>`u`)){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(`/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/.pi *,.pi :after,.pi :before{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity));border-style:solid;border-width:0;box-sizing:border-box}.pi :after,.pi :before{--tw-content:""}.pi hr{border-top-width:1px;color:inherit;height:0}.pi abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6{font-size:inherit;font-weight:inherit}.pi a{color:inherit;text-decoration:inherit}.pi b,.pi strong{font-weight:bolder}.pi code,.pi kbd,.pi pre,.pi samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.pi small{font-size:80%}.pi sub,.pi sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.pi sub{bottom:-.25em}.pi sup{top:-.5em}.pi table{border-collapse:collapse;border-color:inherit;text-indent:0}.pi button,.pi input,.pi optgroup,.pi select,.pi textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}.pi button,.pi select{text-transform:none}.pi [type=button],.pi [type=reset],.pi [type=submit],.pi button{-webkit-appearance:button;background-color:transparent;background-image:none}.pi :-moz-focusring{outline:auto}.pi :-moz-ui-invalid{box-shadow:none}.pi progress{vertical-align:baseline}.pi ::-webkit-inner-spin-button,.pi ::-webkit-outer-spin-button{height:auto}.pi [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.pi ::-webkit-search-decoration{-webkit-appearance:none}.pi ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.pi summary{display:list-item}.pi blockquote,.pi dd,.pi dl,.pi figure,.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6,.pi hr,.pi p,.pi pre{margin:0}.pi fieldset{margin:0;padding:0}.pi legend{padding:0}.pi menu,.pi ol,.pi ul{list-style:none;margin:0;padding:0}.pi textarea{resize:vertical}.pi input::-moz-placeholder,.pi textarea::-moz-placeholder{color:#9ca3af;opacity:1}.pi input::placeholder,.pi textarea::placeholder{color:#9ca3af;opacity:1}.pi [role=button],.pi button{cursor:pointer}.pi :disabled{cursor:default}.pi audio,.pi canvas,.pi embed,.pi iframe,.pi img,.pi object,.pi svg,.pi video{display:block;vertical-align:middle}.pi img,.pi video{height:auto;max-width:100%}.pi [hidden]{display:none}.pi *,.pi :after,.pi :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi .\\!container{width:100%!important}.pi .container{width:100%}@media (min-width:640px){.pi .\\!container{max-width:640px!important}.pi .container{max-width:640px}}@media (min-width:768px){.pi .\\!container{max-width:768px!important}.pi .container{max-width:768px}}@media (min-width:1024px){.pi .\\!container{max-width:1024px!important}.pi .container{max-width:1024px}}@media (min-width:1280px){.pi .\\!container{max-width:1280px!important}.pi .container{max-width:1280px}}@media (min-width:1536px){.pi .\\!container{max-width:1536px!important}.pi .container{max-width:1536px}}.pi .sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pi .pointer-events-none{pointer-events:none}.pi .pointer-events-auto{pointer-events:auto}.pi .\\!visible{visibility:visible!important}.pi .visible{visibility:visible}.pi .invisible{visibility:hidden}.pi .collapse{visibility:collapse}.pi .static{position:static}.pi .fixed{position:fixed}.pi .absolute{position:absolute}.pi .relative{position:relative}.pi .inset-0{top:0;right:0;bottom:0;left:0}.pi .inset-x-0{left:0;right:0}.pi .-bottom-10{bottom:-10px}.pi .-bottom-20{bottom:-20px}.pi .-bottom-5{bottom:-5px}.pi .-left-5{left:-5px}.pi .-left-8{left:-8px}.pi .-left-80{left:-80px}.pi .-right-5{right:-5px}.pi .-top-144{top:-144px}.pi .-top-40{top:-40px}.pi .-top-5{top:-5px}.pi .bottom-0{bottom:0}.pi .bottom-20{bottom:20px}.pi .left-0{left:0}.pi .left-1\\/2{left:50%}.pi .left-20{left:20px}.pi .right-0{right:0}.pi .right-16{right:16px}.pi .right-2{right:2px}.pi .right-20{right:20px}.pi .right-4{right:4px}.pi .top-0{top:0}.pi .top-1\\/2{top:50%}.pi .top-2{top:2px}.pi .isolate{isolation:isolate}.pi .z-10{z-index:10}.pi .z-20{z-index:20}.pi .z-50{z-index:50}.pi .z-cropzone{z-index:10}.pi .z-loading-indicator{z-index:50}.pi .z-modal{z-index:110}.pi .z-navbar{z-index:40}.pi .z-obj-box{z-index:20}.pi .z-popover{z-index:130}.pi .z-toast{z-index:160}.pi .z-tool-overlay{z-index:30}.pi .z-tooltip{z-index:150}.pi .z-tray{z-index:120}.pi .m-auto{margin:auto}.pi .mx-20{margin-left:20px;margin-right:20px}.pi .mx-8{margin-left:8px;margin-right:8px}.pi .mx-auto{margin-left:auto;margin-right:auto}.pi .my-20{margin-bottom:20px;margin-top:20px}.pi .my-4{margin-bottom:4px;margin-top:4px}.pi .my-6{margin-bottom:6px;margin-top:6px}.pi .my-8{margin-bottom:8px;margin-top:8px}.pi .my-auto{margin-bottom:auto;margin-top:auto}.pi .-ml-1{margin-left:-1px}.pi .-ml-10{margin-left:-10px}.pi .-ml-12{margin-left:-12px}.pi .-ml-3{margin-left:-3px}.pi .-ml-4{margin-left:-4px}.pi .-ml-6{margin-left:-6px}.pi .-mr-4{margin-right:-4px}.pi .-mr-8{margin-right:-8px}.pi .mb-1{margin-bottom:1px}.pi .mb-10{margin-bottom:10px}.pi .mb-16{margin-bottom:16px}.pi .mb-2{margin-bottom:2px}.pi .mb-20{margin-bottom:20px}.pi .mb-24{margin-bottom:24px}.pi .mb-4{margin-bottom:4px}.pi .mb-6{margin-bottom:6px}.pi .mb-8{margin-bottom:8px}.pi .ml-10{margin-left:10px}.pi .ml-12{margin-left:12px}.pi .ml-4{margin-left:4px}.pi .ml-6{margin-left:6px}.pi .ml-8{margin-left:8px}.pi .ml-auto{margin-left:auto}.pi .mr-10{margin-right:10px}.pi .mr-16{margin-right:16px}.pi .mr-20{margin-right:20px}.pi .mr-4{margin-right:4px}.pi .mr-5{margin-right:5px}.pi .mr-6{margin-right:6px}.pi .mr-8{margin-right:8px}.pi .mr-auto{margin-right:auto}.pi .mt-0{margin-top:0}.pi .mt-10{margin-top:10px}.pi .mt-14{margin-top:14px}.pi .mt-20{margin-top:20px}.pi .mt-24{margin-top:24px}.pi .mt-4{margin-top:4px}.pi .mt-6{margin-top:6px}.pi .box-content{box-sizing:content-box}.pi .block{display:block}.pi .inline-block{display:inline-block}.pi .inline{display:inline}.pi .flex{display:flex}.pi .inline-flex{display:inline-flex}.pi .grid{display:grid}.pi .contents{display:contents}.pi .hidden{display:none}.pi .aspect-square{aspect-ratio:1/1}.pi .h-1{height:1px}.pi .h-12{height:12px}.pi .h-128{height:128px}.pi .h-14{height:14px}.pi .h-16{height:16px}.pi .h-18{height:18px}.pi .h-2{height:2px}.pi .h-2\\/4{height:50%}.pi .h-20{height:20px}.pi .h-22{height:22px}.pi .h-24{height:24px}.pi .h-26{height:26px}.pi .h-28{height:28px}.pi .h-3{height:3px}.pi .h-30{height:30px}.pi .h-32{height:32px}.pi .h-36{height:36px}.pi .h-38{height:2.375rem}.pi .h-4{height:4px}.pi .h-40{height:40px}.pi .h-42{height:42px}.pi .h-48{height:48px}.pi .h-50{height:50px}.pi .h-56{height:56px}.pi .h-6{height:6px}.pi .h-60{height:60px}.pi .h-64{height:64px}.pi .h-68{height:68px}.pi .h-8{height:8px}.pi .h-80{height:80px}.pi .h-84{height:84px}.pi .h-92{height:92px}.pi .h-\\[54px\\]{height:54px}.pi .h-font{height:1em}.pi .h-full{height:100%}.pi .h-px{height:1px}.pi .h-screen{height:100dvh}.pi .max-h-100{max-height:6.25rem}.pi .max-h-\\[calc\\(100\\%-40px\\)\\]{max-height:calc(100% - 40px)}.pi .max-h-\\[calc\\(100vh-90px\\)\\]{max-height:calc(100vh - 90px)}.pi .max-h-dialog{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-full{max-height:100%}.pi .max-h-inherit{max-height:inherit}.pi .max-h-tray{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .min-h-24{min-height:24px}.pi .min-h-30{min-height:30px}.pi .min-h-36{min-height:36px}.pi .min-h-42{min-height:42px}.pi .min-h-50{min-height:50px}.pi .min-h-60{min-height:60px}.pi .min-h-86{min-height:86px}.pi .\\!w-auto{width:auto!important}.pi .w-1\\/2{width:50%}.pi .w-110{width:110px}.pi .w-12{width:12px}.pi .w-1280{width:80rem}.pi .w-14{width:14px}.pi .w-144{width:144px}.pi .w-16{width:16px}.pi .w-18{width:18px}.pi .w-2{width:2px}.pi .w-20{width:20px}.pi .w-22{width:22px}.pi .w-224{width:224px}.pi .w-24{width:24px}.pi .w-256{width:256px}.pi .w-26{width:26px}.pi .w-28{width:28px}.pi .w-280{width:17.5rem}.pi .w-30{width:30px}.pi .w-32{width:32px}.pi .w-320{width:320px}.pi .w-36{width:36px}.pi .w-38{width:2.375rem}.pi .w-384{width:384px}.pi .w-40{width:40px}.pi .w-42{width:42px}.pi .w-440{width:27.5rem}.pi .w-46{width:2.875rem}.pi .w-50{width:50px}.pi .w-56{width:56px}.pi .w-60{width:60px}.pi .w-620{width:38.75rem}.pi .w-64{width:64px}.pi .w-68{width:68px}.pi .w-780{width:48.75rem}.pi .w-8{width:8px}.pi .w-80{width:80px}.pi .w-850{width:53.125rem}.pi .w-96{width:96px}.pi .w-\\[4ch\\]{width:4ch}.pi .w-auto{width:auto}.pi .w-font{width:1em}.pi .w-full{width:100%}.pi .w-max{width:-moz-max-content;width:max-content}.pi .w-min{width:-moz-min-content;width:min-content}.pi .w-px{width:1px}.pi .w-screen{width:100vw}.pi .min-w-0{min-width:0}.pi .min-w-128{min-width:128px}.pi .min-w-180{min-width:11.25rem}.pi .min-w-192{min-width:192px}.pi .min-w-288{min-width:288px}.pi .min-w-30{min-width:30px}.pi .min-w-4{min-width:4px}.pi .min-w-42{min-width:42px}.pi .min-w-92{min-width:92px}.pi .min-w-min{min-width:-moz-min-content;min-width:min-content}.pi .max-w-112{max-width:112px}.pi .max-w-240{max-width:240px}.pi .max-w-288{max-width:288px}.pi .max-w-320{max-width:320px}.pi .max-w-375{max-width:375px}.pi .max-w-500{max-width:31.25rem}.pi .max-w-\\[90\\%\\]{max-width:90%}.pi .max-w-\\[calc\\(100\\%-40px\\)\\]{max-width:calc(100% - 40px)}.pi .max-w-\\[calc\\(100vw-90px\\)\\]{max-width:calc(100vw - 90px)}.pi .max-w-dialog{max-width:calc(var(--be-viewport-width, 100vw)*.9)}.pi .max-w-full{max-width:100%}.pi .max-w-max{max-width:-moz-max-content;max-width:max-content}.pi .flex-\\[1_1_60px\\]{flex:1 1 60px}.pi .flex-auto{flex:1 1 auto}.pi .flex-shrink-0,.pi .shrink-0{flex-shrink:0}.pi .origin-\\[0_55\\%\\]{transform-origin:0 55%}.pi .origin-\\[100\\%\\]{transform-origin:100%}.pi .-translate-x-1\\/2{--tw-translate-x:-50%}.pi .-translate-x-1\\/2,.pi .-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .-translate-y-1\\/2{--tw-translate-y:-50%}.pi .rotate-0{--tw-rotate:0deg}.pi .rotate-0,.pi .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-180{--tw-rotate:180deg}.pi .rotate-45{--tw-rotate:45deg}.pi .rotate-45,.pi .rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-90{--tw-rotate:90deg}.pi .scale-y-\\[0\\.6\\]{--tw-scale-y:.6}.pi .scale-y-\\[0\\.6\\],.pi .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .cursor-default{cursor:default}.pi .cursor-move{cursor:move}.pi .cursor-nesw-resize{cursor:nesw-resize}.pi .cursor-not-allowed{cursor:not-allowed}.pi .cursor-nwse-resize{cursor:nwse-resize}.pi .cursor-pointer{cursor:pointer}.pi .cursor-se-resize{cursor:se-resize}.pi .cursor-sw-resize{cursor:sw-resize}.pi .touch-none{touch-action:none}.pi .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .resize{resize:both}.pi .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.pi .grid-cols-5-min-content{grid-template-columns:repeat(5,min-content)}.pi .flex-row{flex-direction:row}.pi .flex-col{flex-direction:column}.pi .flex-col-reverse{flex-direction:column-reverse}.pi .flex-wrap{flex-wrap:wrap}.pi .flex-nowrap{flex-wrap:nowrap}.pi .items-start{align-items:flex-start}.pi .items-end{align-items:flex-end}.pi .items-center{align-items:center}.pi .items-stretch{align-items:stretch}.pi .justify-start{justify-content:flex-start}.pi .justify-center{justify-content:center}.pi .justify-between{justify-content:space-between}.pi .gap-10{gap:10px}.pi .gap-14{gap:14px}.pi .gap-16{gap:16px}.pi .gap-18{gap:18px}.pi .gap-20{gap:20px}.pi .gap-36{gap:36px}.pi .gap-4{gap:4px}.pi .gap-40{gap:40px}.pi .gap-6{gap:6px}.pi .gap-8{gap:8px}.pi .space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(10px*var(--tw-space-y-reverse));margin-top:calc(10px*(1 - var(--tw-space-y-reverse)))}.pi .overflow-auto{overflow:auto}.pi .overflow-hidden{overflow:hidden}.pi .overflow-x-auto{overflow-x:auto}.pi .overflow-y-auto{overflow-y:auto}.pi .overflow-x-hidden{overflow-x:hidden}.pi .overflow-y-hidden{overflow-y:hidden}.pi .overscroll-contain{overscroll-behavior:contain}.pi .truncate{overflow:hidden;white-space:nowrap}.pi .overflow-ellipsis,.pi .text-ellipsis,.pi .truncate{text-overflow:ellipsis}.pi .whitespace-normal{white-space:normal}.pi .whitespace-nowrap{white-space:nowrap}.pi .break-words{overflow-wrap:break-word}.pi .rounded{border-radius:4px}.pi .rounded-2xl{border-radius:16px}.pi .rounded-3xl{border-radius:24px}.pi .rounded-button{border-radius:var(--be-button-radius,.25rem)}.pi .rounded-full{border-radius:9999px}.pi .rounded-input{border-radius:var(--be-input-radius,.25rem)}.pi .rounded-lg{border-radius:8px}.pi .rounded-md{border-radius:6px}.pi .rounded-none{border-radius:0}.pi .rounded-panel{border-radius:var(--be-panel-radius,.25rem)}.pi .rounded-xl{border-radius:12px}.pi .rounded-l{border-bottom-left-radius:4px;border-top-left-radius:4px}.pi .rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.pi .rounded-l-input{border-bottom-left-radius:var(--be-input-radius,.25rem);border-top-left-radius:var(--be-input-radius,.25rem)}.pi .rounded-l-none{border-bottom-left-radius:0;border-top-left-radius:0}.pi .rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.pi .rounded-r-input{border-bottom-right-radius:var(--be-input-radius,.25rem);border-top-right-radius:var(--be-input-radius,.25rem)}.pi .rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.pi .rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.pi .rounded-bl-none{border-bottom-left-radius:0}.pi .rounded-br-none{border-bottom-right-radius:0}.pi .rounded-tl-none{border-top-left-radius:0}.pi .rounded-tr-none{border-top-right-radius:0}.pi .border{border-width:1px}.pi .border-2{border-width:2px}.pi .border-4{border-width:4px}.pi .border-\\[3px\\]{border-width:3px}.pi .border-y{border-top-width:1px}.pi .border-b,.pi .border-y{border-bottom-width:1px}.pi .border-b-4{border-bottom-width:4px}.pi .border-l{border-left-width:1px}.pi .border-l-4{border-left-width:4px}.pi .border-r{border-right-width:1px}.pi .border-r-4{border-right-width:4px}.pi .border-t{border-top-width:1px}.pi .border-t-4{border-top-width:4px}.pi .border-dotted{border-style:dotted}.pi .border-none{border-style:none}.pi .border-background{--tw-border-opacity:1;border-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-bg-alt{--tw-border-opacity:1;border-color:rgb(var(--be-background-alt)/var(--tw-border-opacity))}.pi .border-chip{--tw-border-opacity:1;border-color:rgb(var(--be-background-chip)/var(--tw-border-opacity))}.pi .border-danger{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-danger\\/50{border-color:#ef444480}.pi .border-divider{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .border-paper{--tw-border-opacity:1;border-color:rgb(var(--be-paper)/var(--tw-border-opacity))}.pi .border-positive\\/50{border-color:#22c55e80}.pi .border-primary{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-primary\\/50{border-color:rgb(var(--be-primary)/.5)}.pi .border-text-muted{border-color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .border-transparent{border-color:transparent}.pi .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .border-white\\/50{border-color:#ffffff80}.pi .border-b-bg{--tw-border-opacity:1;border-bottom-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-b-transparent{border-bottom-color:transparent}.pi .border-r-transparent{border-right-color:transparent}.pi .bg{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .bg-background{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-background\\/70{background-color:rgb(var(--be-background)/.7)}.pi .bg-background\\/80{background-color:rgb(var(--be-background)/.8)}.pi .bg-black\\/50{background-color:#00000080}.pi .bg-black\\/80{background-color:#000c}.pi .bg-chip{--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi .bg-controls{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-danger{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .bg-danger-lighter{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.pi .bg-divider{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .bg-fg-base\\/4{background-color:rgb(var(--be-foreground-base)/4%)}.pi .bg-focus{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .bg-inherit{background-color:inherit}.pi .bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}.pi .bg-positive{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.pi .bg-positive-lighter{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.pi .bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .bg-primary-dark{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .bg-primary-light{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-light)/var(--tw-bg-opacity))}.pi .bg-primary\\/focus{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .bg-primary\\/selected{background-color:rgb(var(--be-primary)/var(--be-selected-opacity))}.pi .bg-slider-disabled{--tw-bg-opacity:1;background-color:rgb(189 189 189/var(--tw-bg-opacity))}.pi .bg-slider-disabled\\/60{background-color:#bdbdbd99}.pi .bg-toast{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-transparent{background-color:transparent}.pi .bg-warning{--tw-bg-opacity:1;background-color:rgb(243 164 50/var(--tw-bg-opacity))}.pi .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .bg-white\\/50{background-color:#ffffff80}.pi .bg-opacity-95{--tw-bg-opacity:.95}.pi .bg-no-repeat{background-repeat:no-repeat}.pi .fill-current{fill:currentColor}.pi .fill-transparent{fill:transparent}.pi .stroke-current{stroke:currentColor}.pi .object-contain{-o-object-fit:contain;object-fit:contain}.pi .object-cover{-o-object-fit:cover;object-fit:cover}.pi .p-0{padding:0}.pi .p-10{padding:10px}.pi .p-14{padding:14px}.pi .p-16{padding:16px}.pi .p-18{padding:18px}.pi .p-2{padding:2px}.pi .p-20{padding:20px}.pi .p-4{padding:4px}.pi .p-40{padding:40px}.pi .p-6{padding:6px}.pi .p-8{padding:8px}.pi .px-10{padding-left:10px;padding-right:10px}.pi .px-12{padding-left:12px;padding-right:12px}.pi .px-14{padding-left:14px;padding-right:14px}.pi .px-16{padding-left:16px;padding-right:16px}.pi .px-18{padding-left:18px;padding-right:18px}.pi .px-20{padding-left:20px;padding-right:20px}.pi .px-22{padding-left:22px;padding-right:22px}.pi .px-24{padding-left:24px;padding-right:24px}.pi .px-26{padding-left:26px;padding-right:26px}.pi .px-32{padding-left:32px;padding-right:32px}.pi .px-4{padding-left:4px;padding-right:4px}.pi .px-5vw{padding-left:5vw;padding-right:5vw}.pi .px-6{padding-left:6px;padding-right:6px}.pi .px-8{padding-left:8px;padding-right:8px}.pi .py-10{padding-bottom:10px;padding-top:10px}.pi .py-12{padding-bottom:12px;padding-top:12px}.pi .py-14{padding-bottom:14px;padding-top:14px}.pi .py-2{padding-bottom:2px;padding-top:2px}.pi .py-20{padding-bottom:20px;padding-top:20px}.pi .py-3{padding-bottom:3px;padding-top:3px}.pi .py-4{padding-bottom:4px;padding-top:4px}.pi .py-5{padding-bottom:5px;padding-top:5px}.pi .py-6{padding-bottom:6px;padding-top:6px}.pi .py-8{padding-bottom:8px;padding-top:8px}.pi .py-\\[9px\\]{padding-bottom:9px;padding-top:9px}.pi .pb-10{padding-bottom:10px}.pi .pb-12{padding-bottom:12px}.pi .pb-14{padding-bottom:14px}.pi .pb-16{padding-bottom:16px}.pi .pb-18{padding-bottom:18px}.pi .pb-20{padding-bottom:20px}.pi .pb-4{padding-bottom:4px}.pi .pb-8{padding-bottom:8px}.pi .pb-safe-area{padding-bottom:env(safe-area-inset-bottom)}.pi .pl-10{padding-left:10px}.pi .pl-12{padding-left:12px}.pi .pl-14{padding-left:14px}.pi .pl-16{padding-left:16px}.pi .pl-18{padding-left:18px}.pi .pl-28{padding-left:28px}.pi .pl-46{padding-left:2.875rem}.pi .pl-54{padding-left:3.375rem}.pi .pl-8{padding-left:8px}.pi .pr-10{padding-right:10px}.pi .pr-12{padding-right:12px}.pi .pr-18{padding-right:18px}.pi .pr-24{padding-right:24px}.pi .pr-28{padding-right:28px}.pi .pr-46{padding-right:2.875rem}.pi .pr-54{padding-right:3.375rem}.pi .pr-6{padding-right:6px}.pi .pr-8{padding-right:8px}.pi .pt-10{padding-top:10px}.pi .pt-12{padding-top:12px}.pi .pt-14{padding-top:14px}.pi .pt-16{padding-top:16px}.pi .pt-20{padding-top:20px}.pi .pt-24{padding-top:24px}.pi .pt-4{padding-top:4px}.pi .pt-40{padding-top:40px}.pi .pt-6{padding-top:6px}.pi .text-left{text-align:left}.pi .text-center{text-align:center}.pi .text-right{text-align:right}.pi .align-middle{vertical-align:middle}.pi .text-base{font-size:16px;line-height:24px}.pi .text-lg{font-size:18px;line-height:28px}.pi .text-sm{font-size:14px;line-height:20px}.pi .text-xl{font-size:20px;line-height:28px}.pi .text-xs{font-size:12px;line-height:16px}.pi .font-bold{font-weight:700}.pi .font-medium{font-weight:500}.pi .font-semibold{font-weight:600}.pi .uppercase{text-transform:uppercase}.pi .capitalize{text-transform:capitalize}.pi .italic{font-style:italic}.pi .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.pi .leading-5{line-height:1.25rem}.pi .leading-none{line-height:1}.pi .tracking-wide{letter-spacing:.025em}.pi .\\!text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))!important}.pi .text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.pi .text-black\\/30{color:#0000004d}.pi .text-danger{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.pi .text-danger-darker{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.pi .text-disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .text-link{--tw-text-opacity:1;color:rgb(var(--be-link-color,var(--be-primary))/var(--tw-text-opacity))}.pi .text-main{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-muted{color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .text-on-primary{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .text-positive{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.pi .text-positive-darker{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.pi .text-primary{--tw-text-opacity:1;color:rgb(var(--be-primary)/var(--tw-text-opacity))}.pi .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.pi .underline{text-decoration-line:underline}.pi .no-underline{text-decoration-line:none}.pi .caret-transparent{caret-color:transparent}.pi .opacity-0{opacity:0}.pi .opacity-100{opacity:1}.pi .opacity-70{opacity:.7}.pi .opacity-80{opacity:.8}.pi .opacity-90{opacity:.9}.pi .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.pi .shadow,.pi .shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.pi .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.pi .shadow-lg,.pi .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.pi .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.pi .shadow-sm,.pi .shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.pi .outline-none{outline:2px solid transparent;outline-offset:2px}.pi .outline{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .ring-inset{--tw-ring-inset:inset}.pi .blur{--tw-blur:blur(8px)}.pi .blur,.pi .grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .grayscale{--tw-grayscale:grayscale(100%)}.pi .invert{--tw-invert:invert(100%)}.pi .invert,.pi .sepia{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .sepia{--tw-sepia:sepia(100%)}.pi .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.pi .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-button{transition-duration:.15s;transition-property:background-color,box-shadow,border-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-shadow{transition-duration:.15s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-width{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .duration-100{transition-duration:.1s}.pi .duration-200{transition-duration:.2s}.pi .will-change-transform{will-change:transform}.pi .icon-2xs{font-size:.75rem}.pi .icon-xs{font-size:1rem}.pi .icon-sm{font-size:1.25rem}.pi .icon-md{font-size:1.5rem}.pi .icon-lg{font-size:2.1875rem}.pi .icon-xl{font-size:2.6875rem}.pi .no-tap-highlight{-webkit-tap-highlight-color:transparent}@media only screen and (min-device-width:768px){.pi .tiny-scrollbar{scrollbar-color:rgba(0,0,0,.2) transparent;scrollbar-width:thin}.pi .tiny-scrollbar::-webkit-scrollbar{background-color:transparent;height:6px;width:6px}.pi .tiny-scrollbar::-webkit-scrollbar-thumb{background-color:rgb(var(--be-foreground-base)/.2);border-radius:10px}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:start{background:transparent}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:end{background:transparent}}.pi .hide-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.pi .hide-scrollbar::-webkit-scrollbar{background:transparent;display:none;height:0;width:0}.pi .svg-icon{display:inline-block;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;fill:currentColor;transition-duration:.15s;transition-property:transform,fill;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .cropzone:not(.moving) .cropzone-transition{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .first-letter\\:capitalize:first-letter{text-transform:capitalize}.pi .file\\:mr-10::file-selector-button{margin-right:10px}.pi .file\\:h-24::file-selector-button{height:24px}.pi .file\\:rounded::file-selector-button{border-radius:4px}.pi .file\\:border-none::file-selector-button{border-style:none}.pi .file\\:bg-primary::file-selector-button{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .file\\:px-10::file-selector-button{padding-left:10px;padding-right:10px}.pi .file\\:text-sm::file-selector-button{font-size:14px;line-height:20px}.pi .file\\:font-semibold::file-selector-button{font-weight:600}.pi .file\\:text-on-primary::file-selector-button{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .before\\:z-10:before{content:var(--tw-content);z-index:10}.pi .before\\:block:before{content:var(--tw-content);display:block}.pi .before\\:h-12:before{content:var(--tw-content);height:12px}.pi .before\\:h-14:before{content:var(--tw-content);height:14px}.pi .before\\:h-18:before{content:var(--tw-content);height:18px}.pi .before\\:h-22:before{content:var(--tw-content);height:22px}.pi .before\\:h-28:before{content:var(--tw-content);height:28px}.pi .before\\:h-full:before{content:var(--tw-content);height:100%}.pi .before\\:w-12:before{content:var(--tw-content);width:12px}.pi .before\\:w-14:before{content:var(--tw-content);width:14px}.pi .before\\:w-18:before{content:var(--tw-content);width:18px}.pi .before\\:w-22:before{content:var(--tw-content);width:22px}.pi .before\\:w-28:before{content:var(--tw-content);width:28px}.pi .before\\:w-full:before{content:var(--tw-content);width:100%}.pi .before\\:translate-x-2:before{--tw-translate-x:2px}.pi .before\\:scale-10:before,.pi .before\\:translate-x-2:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .before\\:scale-10:before{--tw-scale-x:.1;--tw-scale-y:.1}.pi .before\\:rounded-3xl:before{border-radius:24px;content:var(--tw-content)}.pi .before\\:rounded-full:before{border-radius:9999px;content:var(--tw-content)}.pi .before\\:border:before{border-width:1px;content:var(--tw-content)}.pi .before\\:bg-primary:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .before\\:opacity-0:before{content:var(--tw-content);opacity:0}.pi .before\\:transition:before{content:var(--tw-content);transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:transition-transform:before{content:var(--tw-content);transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:duration-200:before{content:var(--tw-content);transition-duration:.2s}.pi .after\\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.pi .after\\:absolute:after{content:var(--tw-content);position:absolute}.pi .after\\:inset-0:after{content:var(--tw-content);top:0;right:0;bottom:0;left:0}.pi .checked\\:border-danger:checked{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .checked\\:border-primary:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .checked\\:bg-danger:checked{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .checked\\:bg-primary:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .checked\\:before\\:translate-x-14:checked:before{--tw-translate-x:14px}.pi .checked\\:before\\:translate-x-14:checked:before,.pi .checked\\:before\\:translate-x-20:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-20:checked:before{--tw-translate-x:20px}.pi .checked\\:before\\:translate-x-24:checked:before{--tw-translate-x:24px}.pi .checked\\:before\\:translate-x-24:checked:before,.pi .checked\\:before\\:translate-x-30:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-30:checked:before{--tw-translate-x:30px}.pi .checked\\:before\\:translate-x-36:checked:before{--tw-translate-x:36px}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before,.pi .checked\\:before\\:translate-x-36:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before{--tw-scale-x:.65;--tw-scale-y:.65}.pi .checked\\:before\\:border-white:checked:before{content:var(--tw-content);--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .checked\\:before\\:opacity-100:checked:before{content:var(--tw-content);opacity:1}.pi .focus-within\\:border-primary\\/60:focus-within{border-color:rgb(var(--be-primary)/.6)}.pi .focus-within\\:ring:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-within\\:ring-primary\\/focus:focus-within{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .hover\\:border-chip\\/90:hover{border-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:border-danger:hover{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .hover\\:border-danger\\/90:hover{border-color:#ef4444e6}.pi .hover\\:border-paper\\/90:hover{border-color:rgb(var(--be-paper)/.9)}.pi .hover\\:border-positive:hover{--tw-border-opacity:1;border-color:rgb(34 197 94/var(--tw-border-opacity))}.pi .hover\\:border-primary:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .hover\\:border-primary-dark:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .hover\\:bg-chip\\/90:hover{background-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-danger\\/4:hover{background-color:#ef44440a}.pi .hover\\:bg-danger\\/90:hover{background-color:#ef4444e6}.pi .hover\\:bg-fg-base\\/15:hover{background-color:rgb(var(--be-foreground-base)/15%)}.pi .hover\\:bg-hover:hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .hover\\:bg-paper\\/90:hover{background-color:rgb(var(--be-paper)/.9)}.pi .hover\\:bg-positive\\/4:hover{background-color:#22c55e0a}.pi .hover\\:bg-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:bg-primary\\/4:hover{background-color:rgb(var(--be-primary)/4%)}.pi .hover\\:bg-primary\\/focus:hover{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:bg-primary\\/hover:hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .hover\\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .hover\\:bg-white\\/20:hover{background-color:#fff3}.pi .hover\\:bg-white\\/hover:hover{background-color:rgb(255 255 255/var(--be-hover-opacity))}.pi .hover\\:text-main:hover{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .hover\\:text-primary-dark:hover{--tw-text-opacity:1;color:rgb(var(--be-primary-dark)/var(--tw-text-opacity))}.pi .hover\\:underline:hover{text-decoration-line:underline}.pi .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .before\\:hover\\:bg-primary-dark:hover:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:after\\:bg-black\\/5:hover:after{background-color:#0000000d;content:var(--tw-content)}.pi .checked\\:hover\\:border-primary-dark:hover:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .focus\\:border-danger\\/60:focus{border-color:#ef444499}.pi .focus\\:border-primary\\/60:focus{border-color:rgb(var(--be-primary)/.6)}.pi .focus\\:bg-primary:focus{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .focus\\:text-on-primary:focus{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.pi .focus\\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus\\:ring-danger\\/focus:focus{--tw-ring-color:rgb(239 68 68/var(--be-focus-opacity))}.pi .focus\\:ring-primary\\/focus:focus{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus\\:after\\:bg-black\\/10:focus:after{background-color:#0000001a;content:var(--tw-content)}.pi .focus-visible\\:bg-primary\\/focus:focus-visible{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus-visible\\:outline:focus-visible{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .focus-visible\\:outline-primary-light:focus-visible{outline-color:rgb(var(--be-primary-light)/1)}.pi .focus-visible\\:ring:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.pi .disabled\\:pointer-events-none:disabled{pointer-events:none}.pi .disabled\\:cursor-default:disabled{cursor:default}.pi .disabled\\:border-disabled-bg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:border-disabled-fg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:border-transparent:disabled{border-color:transparent}.pi .disabled\\:border-white\\/70:disabled{border-color:#ffffffb3}.pi .disabled\\:border-r-transparent:disabled{border-right-color:transparent}.pi .disabled\\:bg-disabled:disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:bg-transparent:disabled{background-color:transparent}.pi .disabled\\:text-disabled:disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:text-white\\/70:disabled{color:#ffffffb3}.pi .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .disabled\\:before\\:bg-disabled-fg:disabled:before{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity));content:var(--tw-content)}.pi :is(.dark .dark\\:bg-chip){--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi :is(.dark .dark\\:text-white\\/50){color:#ffffff80}.pi :is(.dark .dark\\:checked\\:border-primary-dark:checked){--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi :is(.dark .dark\\:checked\\:bg-primary-dark:checked){--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}@media (min-width:640px){.pi .sm\\:text-sm{font-size:14px;line-height:20px}}@media (min-width:768px){.pi .md\\:text-lg{font-size:18px;line-height:28px}}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-2:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-inset:focus-visible>.tree-label{--tw-ring-inset:inset}
596
- `),!e.selector)throw Error(`Pixie required "selector" option.`);let t=document.querySelector(e.selector);t&&(t.classList.add(`pi`),function(e){bb=e,xb=e}(t),this.setConfig(e),Y.setState({editor:this}),(0,d.createRoot)(t).render((0,l.jsx)(s.default.StrictMode,{children:(0,l.jsx)(GL,{})})))}get state(){return X()}get defaultConfig(){return e.defaultConfig}open(e={}){return new Promise(async t=>{var n;Object.keys(e).length?await this.resetEditor({...dy(e,{ui:{visible:!0},image:e.image||X().config.image,state:e.state||X().config.state,blankCanvasSize:e.blankCanvasSize||X().config.blankCanvasSize})}):(n=X().config.ui)!=null&&n.visible||X().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,n;(e=X().config.ui)!=null&&e.visible&&(this.setConfig({ui:{visible:!1}}),(n=(t=X().config).onClose)==null||n.call(t))}setConfig(e){X().setConfig(e)}uploadAndAddImage(){return Z().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return Z().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return Z().import.uploadAndOpenStateFile()}newCanvas(e,t,n){return Z().canvas.openNew(e,t,n)}getState(e){return JSON.stringify(Ab(e))}setState(e){return Z().import.loadState(e)}async setStateFromUrl(e){let t=await Ob(e);return Z().import.loadState(t)}openTool(e){jb(e)}applyChanges(){X().applyChanges()}cancelChanges(){X().cancelChanges()}async resetEditor(e){await Db(e),await Z().canvas.loadInitialContent()}togglePanel(e,t){e===`objects`&&X().togglePanel(`history`,!1),e===`history`&&X().togglePanel(`objects`,!1),X().togglePanel(e,t)}on(e,t){var n;(n=this.fabric)==null||n.on(e,t)}isDirty(){return X().dirty}get(e){return this.tools[e]}notify(e){return Lb(e)}static init(e){return new Promise(t=>{let n=e.onLoad;e.onLoad=e=>{n?.(e),t(e)},new this(e)})}};kf(KL,`defaultConfig`,R_),kf(KL,`version`,L_);var qL=KL;function JL(e){if(!this.backgroundColor)return;let t=this._getNonTransformedDimensions(),n=-t.x/2,r=-t.y/2,i=t.x,a=t.y,o=this.backgroundColor;if(typeof o==`string`||o instanceof CanvasGradient||o instanceof CanvasPattern)e.fillStyle=o,e.fillRect(n,r,i,a);else if(typeof o!=`object`||!(`type`in o)||o.type!==`linear`&&o.type!==`radial`){if(`source`in o&&(o.source instanceof HTMLImageElement||o.source instanceof HTMLCanvasElement))if(o.repeat){let t=e.createPattern(o.source,o.repeat);t&&(e.fillStyle=t,e.fillRect(n,r,i,a))}else e.drawImage(o.source,n,r,i,a)}else e.fillStyle=function(e,t,n,r){if(t.type===`linear`){let i=e.createLinearGradient(n+t.coords.x1,r+t.coords.y1,n+t.coords.x2,r+t.coords.y2);return t.colorStops.forEach(e=>i.addColorStop(e.offset,e.color)),i}if(t.type===`radial`){let i=e.createRadialGradient(n+t.coords.x1,r+t.coords.y1,t.coords.r1??0,n+t.coords.x2,r+t.coords.y2,t.coords.r2??0);return t.colorStops.forEach(e=>i.addColorStop(e.offset,e.color)),i}throw Error(`Unknown gradient type`)}(e,o,n,r),e.fillRect(n,r,i,a);this._removeShadow(e)}var YL=`fm-pixie-editor`,XL=new class{constructor(){this._container=document.createElement(`div`),this._instance=null,this._container.classList.add(YL),this._container.style.width=`100%`,this._container.style.height=`85vh`,this._container.style.minHeight=`400px`}get className(){return`.${YL}`}get canvas(){return this._instance?.state.canvasRef?.current}get tools(){return this._instance?.tools}isLoaded(){return!!this._instance}async _setConfig(e){var t;this._instance?await this._instance.resetEditor(e):this._instance=await qL.init(Object.assign(Object.assign({},e),{selector:this.className})),(t=this._instance).fabric&&t.fabric.on(`object:added`,e=>{let t=e.target;t&&t.name===`text`&&(t._renderBackground=JL)})}async show(e,t,n=t.firstChild){t.insertBefore(this._container,n),await this._setConfig(e),this._instance.open()}close(){var e;(e=this._container.parentNode)==null||e.removeChild(this._container)}};function ZL(e,t){return e?t?`${e.replace(/\/+$/,``)}/${t.replace(/^\/+/,``)}`:e:t}function QL(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;let n=ZL(function(e){let t=typeof __webpack_public_path__<`u`?__webpack_public_path__:``;if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let n=ZL(t,e||``);return!n||n.startsWith(`/`)||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(n)||(n=`/`+n),n}(e),t);return!n||n.startsWith(`/`)||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(n)?n:`/`+n}var $L,eR;(function(e){e.TOP=`top`,e.BOTTOM=`bottom`,e.HIDDEN=``})($L||={}),function(e){e.TOP=`top`,e.BOTTOM=`bottom`,e.HIDDEN=``}(eR||={});var tR=(e,t=`image/png`)=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());function nR(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error??Error(`Failed to convert blob to data URL`)),r.readAsDataURL(e)})}var rR=({visible:e,onClose:t,file:n,onSave:r,onSaveCopy:i})=>{let{t:a}=Ks(),o=s.default.useRef(null),c=Il(),d=ad(),{options:f,actions:p}=yl(),{i18n:h}=Ks(),{config:g}=f,{setCurrentMenuFile:_}=p,{getFileData:v,resolveFileForEditByUrl:y}=d,[b,x]=s.default.useState(!1),[S,C]=s.default.useState(null),[w,T]=s.default.useState(``),[E,D]=s.default.useState(!1),[O,k]=s.default.useState(!1),[A,j]=s.default.useState(null),M=s.default.useRef(!1),N=s.default.useRef(),P=s.default.useRef(),F=s.default.useRef(`saveCopy`),I=s.default.useRef(void 0);N.current=r,P.current=i,s.default.useEffect(()=>{n&&!M.current&&(async()=>{if(I.current!==n)if(typeof n!=`object`){I.current=n,x(!0);try{if(n.startsWith(`data:`))j({thumbnail:n,saveWithoutFolder:!0});else{let e=await y(n);I.current===n&&j(e)}}catch{I.current===n&&(I.current=null),t?.()}finally{x(!1)}}else j(n)})()},[n,t,y]);let L=s.default.useCallback(async e=>{try{if(typeof e.thumbnail==`string`&&e.thumbnail.startsWith(`data:`))return e.thumbnail;let t=await v(e.id,!0);if(!t)throw Error(a(`Error loading image`));return new Promise(e=>{let n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(t)})}catch(e){throw e}},[v,a]);s.default.useEffect(()=>{if(!S&&e&&A){let e=!1;return(async()=>{x(!0);try{let t=await L(A);if(!t||typeof t!=`string`||t.trim()===``)throw Error(`Invalid image data: empty or null`);if(!t.startsWith(`data:`))throw Error(`Invalid image data: not a valid data URL`);let n=t.match(/^data:([^;]+);base64,(.+)$/);if(!n)throw Error(`Invalid image data: malformed data URL format`);let[,r,i]=n;if(!r.startsWith(`image/`))throw Error(`Invalid image data: unsupported MIME type ${r}`);if(i.length<10)throw Error(`Invalid image data: base64 content too short`);if(!/^[A-Za-z0-9+/]+=*$/.test(i))throw Error(`Invalid image data: corrupted base64 content`);e||(C(t),T(Fu(A,`image/png`).mimeType))}catch(n){e||(c.error({id:`IMAGE_DOWNLOAD_FAILED`,innerException:n,message:a(`Error loading image`),placement:`bottomRight`,data:{itemId:A?.id??void 0,itemName:A?.name??void 0,folderId:A?.folderId??null,thumbnail:A?.thumbnail}}),t?.())}finally{x(!1)}})(),()=>{e=!0}}},[A,L,S,t,a,e]);let R=s.default.useCallback(async(e,t,n)=>{let r=await function(e,t){if(e===`json`)return new Blob([t],{type:`application/json`});if(e===`svg`)return new Blob([t],{type:`image/svg+xml`});let n=`image/${e}`;if(t.startsWith(`data:`)){let e=vo(t);return e&&e.startsWith(`image/`)&&(n=e),tR(t.replace(/data:image\/[^;]+;base64,/,``),_o(n))}return tR(t,_o(n))}(n,e),i=_o(r.type||`image/${n}`),a=g?.compessorUrl??g?.compressorUrl;if(i.startsWith(`image/`))try{let e=await Ku(new File([r],t,{type:i}),{maxSizeMB:g?.compressMaxSize,maxWidthOrHeight:g?.compressMaxWidthOrHeight,mimeType:i,fileName:t,libURL:a,enableCompression:!!g&&i!==`image/gif`});r=e,i=e.type}catch{}return{blob:r,mimeType:i,thumbnailDataUrl:await nR(r)}},[g]),z=s.default.useCallback(async(e,t,n,r)=>{let i=r===`save`?N.current:P.current;if(!A||!i)return;let o=typeof A==`object`&&A?A:null,s=null;try{x(!0);let{blob:o,mimeType:c,thumbnailDataUrl:l}=await R(e,t,n),u=Object.assign(Object.assign({},A),{thumbnail:l,size:o.size,date:new Date().toISOString().split(`T`)[0],type:c,folderId:A.folderId||``,name:A.name||t,extension:A.extension||(A.name||t).split(`.`).pop()?.toLowerCase()||``});s=u;let d=await i(u,{blob:o,mimeType:c,thumbnail:l,mode:r});if(d)return x(!1),d;throw Error(a(r===`saveCopy`?`Failed to save image copy`:`Failed to save changes`))}catch(e){let n=s??o;if(!e?.notificationShown){let i=Vl(e),o=zl(i?.code,a)??i?.message??a(r===`saveCopy`?`Failed to save image copy`:`Error saving image`);c.error({id:r===`saveCopy`?`IMAGE_SAVE_COPY_FAILED`:`IMAGE_SAVE_FAILED`,message:o,placement:`bottomRight`,data:{itemId:n?.id??void 0,itemName:n?.name??t,folderId:n?.folderId??null,thumbnail:n?.thumbnail},innerException:e})}x(!1)}},[A,c,R,a]),ee=s.default.useCallback(async e=>{if(!XL.isLoaded()||!A)return;F.current=e;let t=A.name||`edited-image`,n=Fu(A,w);try{await XL.tools?.export.save(t.replace(/\.[^/.]+$/,``),n.pixieFormat,Iu.QUALITY)}catch{try{let r=XL.canvas,i=r?r.toDataURL(n.mimeType):null;i&&await z(i,t,n.extension,e)}catch{}}},[A,w,z]),B=s.default.useCallback(async()=>{if(S&&e&&E&&!M.current)try{M.current=!0;let e=o.current,n=0;for(;n<20&&(e.clientWidth===0||e.clientHeight===0);)await new Promise(e=>setTimeout(e,50)),n++;let r=g?.locale?g?.locale.replace(`_`,`-`):`en`,i=matchMedia(ao).matches?ro:no,a=g?.theme===io?i:g?.theme,s=(g?.locale||h.language||`en`).split(`-`)[0].split(`_`)[0],c=(h.getResourceBundle(s,`translation`)||{}).pixie||{},u=e=>e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `),d={};Object.entries(c).forEach(([e,t])=>{let n=u(e);d[n]=t,d[e]=t});let f={[r]:d},p=Fu(A,w),_={selector:`#pixie-editor`,baseUrl:QL(g?.baseUrl||``,g?.assetsUrl||`assets/image-editor`),image:S,activeLanguage:r,languages:f,ui:{activeTheme:a,mode:`inline`,forceOverlayModeOnMobile:!1,visible:!0,menubar:{replaceDefaultItems:!0,position:$L.TOP,items:[{type:`undoWidget`,align:`left`},{type:`zoomWidget`,align:`center`,desktopOnly:!0},{type:`button`,align:`right`,desktopOnly:!0,icon:()=>(0,l.jsx)(m.HistoryOutlined,{style:{fontSize:20}}),action:e=>{e.togglePanel(`history`)}},{type:`button`,icon:()=>(0,l.jsx)(m.CloseOutlined,{style:{fontSize:20}}),align:`right`,desktopOnly:!0,action:t}]},nav:{position:eR.TOP}},tools:{export:{defaultFormat:p.pixieFormat,defaultQuality:Iu.QUALITY,defaultName:(A?.name)?.replace(/\.[^/.]+$/,``)||`image`},text:{replaceDefaultItems:!0,defaultText:`Handwriting`,items:[{family:`Inter`,src:`fonts/inter-v20-cyrillic_latin-regular.woff2`},{family:`Commissioner`,src:`fonts/commissioner-v24-cyrillic_latin-regular.woff2`},{family:`Montserrat Light`,src:`fonts/Montserrat-Light.woff2`},{family:`Montserrat Regular`,src:`fonts/Montserrat-Regular.woff2`},{family:`Montserrat Bold`,src:`fonts/Montserrat-Bold.woff2`},{family:`Montserrat Black`,src:`fonts/Montserrat-Black.woff2`},{family:`Roboto Light`,src:`fonts/Roboto-Light.woff2`},{family:`Roboto Regular`,src:`fonts/Roboto-Regular.woff2`},{family:`Roboto Bold`,src:`fonts/Roboto-Bold.woff2`},{family:`Roboto Black`,src:`fonts/Roboto-Black.woff2`},{family:`Lato Light`,src:`fonts/Lato-Light.woff2`},{family:`Lato Regular`,src:`fonts/Lato-Regular.woff2`},{family:`Lato Bold`,src:`fonts/Lato-Bold.woff2`},{family:`Lato Black`,src:`fonts/Lato-Black.woff2`},{family:`Rubik Light`,src:`fonts/Rubik-Light.woff2`},{family:`Rubik Regular`,src:`fonts/Rubik-Regular.woff2`},{family:`Rubik Bold`,src:`fonts/Rubik-Bold.woff2`},{family:`Rubik Black`,src:`fonts/Rubik-Black.woff2`},{family:`Bebas Neue Light`,src:`fonts/BebasNeueLight.woff2`},{family:`Bebas Neue Regular`,src:`fonts/BebasNeueRegular.woff2`},{family:`Bebas Neue Book`,src:`fonts/BebasNeueBook.woff2`},{family:`Bebas Neue Bold`,src:`fonts/BebasNeueBold.woff2`},{family:`Fira Sans`,src:`fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2`},{family:`Lobster`,src:`fonts/Lobster.woff2`},{family:`Pacifico`,src:`fonts/pacifico-v23-cyrillic_latin-regular.woff2`},{family:`Playfair Display`,src:`fonts/playfair-display-v40-cyrillic_latin-regular.woff2`},{family:`Oswald`,src:`fonts/oswald-v57-cyrillic_latin-regular.woff2`},{family:`Caveat`,src:`fonts/caveat-v23-cyrillic_latin-regular.woff2`}]}},onSave:async function(e,t,n){try{return x(!0),await z(e,t,n,F.current)}catch(e){throw x(!1),e}}};try{k(!1),await XL.show(_,o.current);let e=XL.canvas;e&&e.focus(),k(!0),x(!1)}catch{}}catch(e){c.error({id:`EDITOR_INIT_FAILED`,message:a(`Error initializing editor`),placement:`bottomRight`,innerException:e}),M.current=!1,t?.()}},[A,w,S,e,E,g?.locale,g?.theme,g?.baseUrl,g?.assetsUrl,t,z,c,h,a]);s.default.useEffect(()=>{e&&S&&E&&B()},[e,S,E,B]),s.default.useEffect(()=>{if(!e){try{XL.close()}catch{}x(!1),C(null),T(``),M.current=!1,D(!1),k(!1)}return()=>{try{XL.close()}catch{}}},[e]);let te=!!A?.id&&!1!==g?.features?.enableUpdateFile;return(0,l.jsx)(u.Modal,{title:A?.name?a(`Editing: {{name}}`,{name:A.name}):a(`Editing image`),open:e,closeIcon:null,onCancel:t,afterOpenChange:e=>D(e),forceRender:!0,width:`100vw`,style:{top:0,height:`100vh`,maxWidth:`none`,padding:10},styles:{body:{height:`85vh`,padding:0}},footer:[(0,l.jsx)(u.Button,{onClick:t,disabled:!E||b,children:a(`Cancel`)},`cancel`),(0,l.jsx)(u.Button,{type:`primary`,onClick:()=>ee(`saveCopy`),loading:b,children:a(`Save as copy and choose`)},`save-copy`),...te?[(0,l.jsx)(u.Button,{type:`primary`,onClick:()=>ee(`save`),loading:b,children:a(`Save and choose`)},`save`)]:[]],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{_&&_(``)},children:(0,l.jsxs)(`div`,{ref:o,style:{position:`relative`,width:`100%`,height:`100%`},children:[e&&!O?(0,l.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(255,255,255,0.45)`,backdropFilter:`blur(1px)`,pointerEvents:`all`,zIndex:10},children:(0,l.jsx)(`span`,{style:{fontSize:14,color:`#555`},children:a(`Loading editor...`)})}):null,b&&O&&(0,l.jsx)(bf,{style:{position:`absolute`,top:0,background:`var(--colorBgLayout)`,zIndex:100,opacity:.7}})]})})},iR=`uploadProgress`,aR=`uploadProgress__card`,oR=`uploadProgress__header`,sR=`uploadProgress__header-title`,cR=`uploadProgress__header-buttons`,lR=`uploadProgress__header-button`,uR=`uploadProgress__close-icon`,dR=`uploadProgress__body`,fR=`uploadProgress__common-error`,pR=`uploadProgress__common-error-row`,mR=`uploadProgress__common-error-hint`,hR=`uploadProgress__list-wrapper`,gR=`uploadProgress__status-icon`,_R=`uploadProgress__file-item`,vR=`uploadProgress__file-item--error`,yR=`uploadProgress__body--error`,bR=`uploadProgress__error-item`,xR=`uploadProgress__error-message`,SR=`uploadProgress__error-hint`,CR=`uploadProgress__file-avatar`,wR=`uploadProgress__file-info`,TR=`uploadProgress__file-name`,ER=`uploadProgress__file-size`,DR=`uploadProgress__progress-bar`,OR=`uploadProgress__minimized`,kR=`uploadProgress__minimized-button`,AR=`uploadProgress__file-list`,{Text:jR}=u.Typography,MR=({visible:e,files:t,totalFiles:n,completedFiles:r,onClose:i,onMinimize:a,onInsert:o,minimized:s=!1})=>{let{token:c}=u.theme.useToken(),{t:d}=Ks();if(!e)return null;let f=e=>{switch(e){case`success`:return(0,l.jsx)(`div`,{className:gR,children:(0,l.jsx)(m.CheckCircleOutlined,{style:{color:c.colorSuccess}})});case`error`:return(0,l.jsx)(m.ExclamationCircleOutlined,{style:{color:c.colorError}});default:return(0,l.jsx)(m.FileImageOutlined,{style:{color:`#1890ff`}})}},p=e=>e.status===`success`?[(0,l.jsx)(u.Button,{type:`primary`,size:`small`,onClick:()=>o(e),children:d(`Insert`)},`insert`)]:[];if(s)return(0,l.jsx)(`div`,{className:OR,children:(0,l.jsx)(u.Button,{type:`primary`,size:`small`,onClick:a,className:kR,children:d(`Upload progress`,{completed:r,total:n})})});let h=t.filter(e=>e.status===`uploading`).length,g=t.filter(e=>e.status===`success`).length,_=t.filter(e=>e.status===`error`).length,v=t.filter(e=>e.status===`error`),y=v.length>1&&v.every(e=>e.error&&e.error===v[0]?.error),b=y?v[0]?.error:null;return(0,l.jsx)(`div`,{className:iR+` fm-upload-progress`,children:(0,l.jsxs)(`div`,{className:aR,children:[(0,l.jsxs)(`div`,{className:oR,children:[(0,l.jsx)(jR,{strong:!0,className:sR,children:h>0?d(`Uploading files`,{completed:r,total:n}):g>0?d(`Uploaded files`,{success:g,total:n}):d(`Upload error files`,{errorCount:_})}),(0,l.jsx)(`div`,{className:cR,children:(0,l.jsx)(u.Button,{type:`text`,size:`small`,icon:(0,l.jsx)(m.CloseOutlined,{className:uR}),onClick:i,className:lR})})]}),(0,l.jsxs)(`div`,{className:`${dR} ${t.some(e=>e.status===`error`)?yR:``}`,children:[(0,l.jsx)(`div`,{className:hR,children:(0,l.jsx)(u.List,{className:AR,size:`small`,dataSource:t,renderItem:e=>{let t=e.status===`error`,n=t?(e=>{if(!e)return null;let t=e.toLowerCase();return t.includes(`type`)||t.includes(`format`)||t.includes(`формат`)||t.includes(`тип`)||t.includes(`not allowed`)||t.includes(`дозволен`)||t.includes(`name`)||t.includes(`invalid`)||t.includes(`назва`)||t.includes(`неприпустим`)||t.includes(`allowed characters`)?null:t.includes(`large`)||t.includes(`size`)||t.includes(`розмір`)||t.includes(`размер`)?d(`upload_error_hint_size`):t.includes(`exists`)||t.includes(`вже існує`)||t.includes(`уже существует`)?d(`upload_error_hint_exists`):null})(e.error):null;return(0,l.jsx)(u.List.Item,{className:`${_R} ${t?vR:``}`,actions:p(e),children:(0,l.jsx)(u.List.Item.Meta,{avatar:(0,l.jsx)(u.Avatar,{size:`small`,icon:f(e.status),className:CR}),title:(0,l.jsxs)(`div`,{className:wR,children:[(0,l.jsx)(jR,{ellipsis:!0,className:TR,children:e.name}),(0,l.jsx)(jR,{type:`secondary`,className:ER,children:e.size===void 0?``:hc(e.size)})]}),description:e.status===`uploading`?(0,l.jsx)(u.Progress,{percent:e.progress,size:`small`,status:`active`,showInfo:!1,className:DR}):t?y?null:(0,l.jsxs)(`div`,{className:bR,children:[(0,l.jsx)(jR,{type:`danger`,className:xR,children:e.error||d(`Error`)}),n&&(0,l.jsx)(jR,{type:`secondary`,className:SR,children:n})]}):null})})}})}),b&&(0,l.jsxs)(`div`,{className:fR,children:[(0,l.jsxs)(`div`,{className:pR,children:[(0,l.jsx)(m.ExclamationCircleOutlined,{style:{color:c.colorError,marginRight:8,flexShrink:0}}),(0,l.jsx)(jR,{type:`danger`,children:b})]}),(0,l.jsx)(jR,{type:`secondary`,className:mR,children:d(`Applies to all {{count}} files`,{count:v.length})})]})]})]})})},{Header:NR}=u.Layout,{Title:PR}=u.Typography,FR=({activeLibraryItem:e,selectedFolder:t,isTrashFolder:n,onClearTrash:r,files:i,loading:a,onRefresh:o,refreshDisabled:c,showRefresh:d=!1})=>{let{t:f}=Ks(),p=e===Ja&&(n??t===to),[m,h]=s.useState(!1),g={[Ja]:f(`My files`),[Ya]:f(`GIF`),[Xa]:f(`Stock images`),[Za]:f(`Icons`),[$a]:f(`QR & Barcode`),[Qa]:f(`AI image generation`)},_;return s.useEffect(()=>{let e=setTimeout(()=>{h(p&&i.length>0&&!a)},200);return()=>clearTimeout(e)},[p,i.length,a]),_=e===Ja?p?f(`Trash`):t:g[e],(0,l.jsx)(NR,{className:`actions-header`,children:(0,l.jsxs)(`div`,{className:`header-title-container`,children:[(0,l.jsx)(PR,{level:5,className:`header-title`,children:_}),m&&r&&(0,l.jsx)(u.Button,{type:`default`,onClick:r,className:`clear-trash-button`,"aria-label":f(`Clear Trash`),children:f(`Clear`)}),e===Ja&&d&&o&&(0,l.jsx)(u.Tooltip,{title:f(`Refresh`),children:(0,l.jsx)(u.Button,{type:`text`,className:`folder-refresh-button`,icon:(0,l.jsx)(Pc,{size:16}),onClick:o,disabled:c})})]})})};function IR(e,t){return!e||!t||e<=0||t<=0?1:e/t}var LR=1200;function RR({items:e,getId:t,getPreviewSrc:n,getAltText:r,getWidth:i,getHeight:a,layoutMode:o=`masonry`,minColumnWidth:c=240,estimatedItemHeight:l=240,gap:u=20,overscanPx:d=800,prefetchThresholdPx:f=1200,resolveColumnCount:p,virtualizationThreshold:m=40}){let[h,g]=(0,s.useState)({scrollTop:0,viewportHeight:800,viewportWidth:LR,scrollHeight:0}),_=(0,s.useMemo)(()=>function(e){return{getId:e,buildSignature:(t,n)=>{let r=n.getPreviewSrc(t)||``,i=n.getAltText(t),a=n.getWidth?.call(n,t),o=n.getHeight?.call(n,t);return[e(t),r,i,a??``,o??``].join(`::`)},buildRowModel:(e,t,n)=>{let r=t.getWidth?.call(t,e),i=t.getHeight?.call(t,e);return{id:n.id,signature:n.signature,item:e,previewSrc:t.getPreviewSrc(e),altText:t.getAltText(e),width:r,height:i,aspectRatio:IR(r,i)}}}}(t),[t]),v=(0,s.useMemo)(()=>({getPreviewSrc:n,getAltText:r,getWidth:i,getHeight:a}),[r,a,n,i]),y=(0,s.useMemo)(()=>{let e=Math.max(1,h.viewportWidth||LR);return p?Math.max(1,p(e)):Math.max(1,Math.floor((e+u)/(c+u)))},[u,c,p,h.viewportWidth]),b=(0,s.useMemo)(()=>{let e=Math.max(1,h.viewportWidth||LR);return Math.max(1,(e-u*Math.max(0,y-1))/y)},[y,u,h.viewportWidth]),x=(0,s.useMemo)(()=>{let t=Array(y).fill(0),n=[];e:for(let r=0;r<e.length;r+=1){let s=e[r],c=i?.(s),d=a?.(s),f=c&&d&&c>0&&d>0?c/d:void 0,p=f?b/f:l;if(o===`grid`){let e=Math.floor(r/y)*(p+u),t=r%y*(b+u);n.push({index:r,top:e,left:t,width:b,height:p,bottom:e+p});continue e}let m=0;for(let e=1;e<t.length;e+=1)t[e]<t[m]&&(m=e);let h=t[m],g=m*(b+u);t[m]=h+p+u,n.push({index:r,top:h,left:g,width:b,height:p,bottom:h+p})}return{positionedItems:n,containerHeight:n.length===0?0:o===`grid`?Math.max(...n.map(e=>e.bottom)):Math.max(0,...t.map(e=>e-u))}},[y,b,l,u,a,i,e,o]),{rowModels:S,renderWindow:C}=nf({items:e,context:v,adapter:_,options:(0,s.useMemo)(()=>e.length<=m?{renderStrategy:`full`}:{renderStrategy:`positioned`,positioned:{layout:x.positionedItems,viewportTop:h.scrollTop,viewportBottom:h.scrollTop+h.viewportHeight,overscanPx:d,containerHeight:x.containerHeight}},[e.length,x.containerHeight,x.positionedItems,d,h.scrollTop,h.viewportHeight,m])}),w=C.positionedItems??S.map((e,t)=>({row:e,layout:x.positionedItems[t]??{index:t,top:0,left:0,width:b,height:l,bottom:l}})),T=C.containerHeight??x.containerHeight,E=T>0&&h.scrollTop+h.viewportHeight>=T-f;return{rowModels:S,renderRows:C.rows,renderWindow:C,positionedItems:w,containerHeight:T,isNearEnd:E,viewportMetrics:h,handleViewportChange:e=>{g(t=>t.scrollTop===e.scrollTop&&t.viewportHeight===e.viewportHeight&&t.viewportWidth===e.viewportWidth&&t.scrollHeight===e.scrollHeight?t:e)}}}var zR=e=>{var{imageId:t,sourceUrl:n,shouldLoad:r=!0,loader:i,onLoad:a}=e,o=Bd(e,[`imageId`,`sourceUrl`,`shouldLoad`,`loader`,`onLoad`]);let c=wd((0,s.useMemo)(()=>[n],[n])),[u,d]=(0,s.useState)(()=>i.getSnapshot(t,n)),f=(0,s.useRef)(null);return(0,s.useEffect)(()=>(d(i.getSnapshot(t,n)),i.subscribe(t,n,d)),[t,i,n]),(0,s.useEffect)(()=>(i.setActive(t,n,r),()=>{i.setActive(t,n,!1),i.release(t)}),[t,i,r,n]),u.shouldLoad&&c.src?(0,l.jsx)(`img`,Object.assign({},o,{ref:f,src:c.src,loading:o.loading??`lazy`,onLoad:e=>{c.handleLoad(),i.markLoaded(t),a?.(e)},onError:async e=>{var n;(await c.handleError()).exhausted&&i.markError(t),(n=o.onError)==null||n.call(o,e)}})):null},BR={gifTab:`gifTab`,scrollableDiv:`scrollableDiv`,gifSearchInput:`gifSearchInput`,search:`search`,searchResults:`searchResults`,virtualCanvas:`virtualCanvas`,listItem:`listItem`,loaded:`loaded`,loadedImage:`loadedImage`,searchOutputWrapper:`searchOutputWrapper`,divider:`divider`,resultsContainer:`resultsContainer`,playButton:`playButton`,title:`title`,subtitle:`subtitle`},VR=e=>{let t=typeof window<`u`?window.innerWidth:e;return t<=700?1:t<=1100?2:t<=1600?3:4},HR=e=>e.images.downsized.url,UR=({setImageGifList:e,imageGifList:t=[],currentReqGif:n,setCurrentReqGif:r,inputRef:i,customRequest:a})=>{let{t:o}=Ks(),{GifPlayIcon:c}=xl(),{options:d}=yl(),{config:f}=d,p=xd({maxConcurrent:6}),[m,h]=(0,s.useState)(null),[g,_]=(0,s.useState)(new Set),[v,y]=(0,s.useState)(!1),[b,x]=(0,s.useState)(!1),[S,C]=(0,s.useState)(!1),[w]=u.Form.useForm(),T=(0,s.useRef)(n),E=(0,s.useRef)(null),D=(0,s.useRef)(null),O=(0,s.useRef)(null),k=(0,s.useRef)(0),A=(0,s.useRef)(0),j=(0,s.useRef)(new Set);(0,s.useEffect)(()=>{T.current=n},[n]),(0,s.useEffect)(()=>{w.setFieldsValue({keywords:n.keywords})},[]);let M=f?.handleProxyUrl,N=f?.fetchWithProxy,P=async e=>M?await Promise.resolve(M(e))??e:e,F=(0,s.useCallback)(async e=>N?Promise.resolve(N(e,void 0,{intent:`metadata`})):fetch(await P(e)),[N,P]),I=async function({query:e,page:t}){let n=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,``).replace(/[\s_-]+/g,` `);try{return{data:await(await F(`https://api.giphy.com/v1/gifs/search?api_key=${f?.REACT_APP_GIPHY_KEY??`Nh77eBlPeMn1ed9MBAvL542NUGeNO26F`}&q=${encodeURIComponent(n)}&limit=50&offset=${t}&lang=en`)).json()}}catch{}},{positionedItems:L,containerHeight:R,isNearEnd:z,viewportMetrics:ee,handleViewportChange:B}=RR({items:t,getId:e=>e.id,getPreviewSrc:HR,getAltText:e=>e.title,getWidth:e=>e.images.downsized.width?Number(e.images.downsized.width):void 0,getHeight:e=>e.images.downsized.height?Number(e.images.downsized.height):void 0,layoutMode:`masonry`,minColumnWidth:240,estimatedItemHeight:220,prefetchThresholdPx:320,resolveColumnCount:VR}),te=Nd(B,[t.length]),ne=()=>{E.current&&=(clearTimeout(E.current),null)},re=e=>!j.current.has(e)&&(j.current.add(e),!0),ie=e=>{j.current.delete(e)},ae=(0,s.useCallback)(async()=>{let t=T.current.keywords?.trim();if(!t||v||b||!S)return;let n=`gif:${t}:${A.current}`;if(!re(n))return;let r=k.current;x(!0);try{let t=await I({query:T.current,page:A.current});if(r!==k.current)return;let n=t?.data?.data??[];if(!Array.isArray(n)||n.length===0)return void C(!1);let i=n;if(r!==k.current)return;e(e=>{let t=new Set(e.map(e=>e.id)),n=i.filter(e=>!t.has(e.id));return n.length>0?[...e,...n]:e}),A.current+=n.length,C(n.length===50)}finally{ie(n),r===k.current&&x(!1)}},[S,v,b,e]),oe=async()=>{ne();let t=T.current.keywords?.trim();if(!t)return D.current=null,O.current=null,k.current+=1,A.current=0,e([]),_(new Set),C(!1),void x(!1);if(O.current===t||D.current===t||v&&D.current===t)return;let n=`gif:${t}:0`;if(!re(n))return;let r=k.current+1;k.current=r,D.current=t,A.current=0,e([]),_(new Set),C(!1),x(!1),y(!0);try{let n=await I({query:T.current,page:0});if(r!==k.current)return;let i=n?.data?.data;if(Array.isArray(i)&&i.length>0){let t=i;if(r!==k.current)return;e(t),A.current=i.length,C(i.length===50)}else e([]),C(!1);O.current=t}catch{C(!1)}finally{ie(n),D.current===t&&(D.current=null),y(!1)}};return(0,s.useEffect)(()=>()=>{ne()},[]),(0,s.useEffect)(()=>{!v&&!b&&S&&t.length>0&&z&&ae()},[S,t.length,z,ae,v,b]),(0,l.jsx)(`div`,{className:BR.gifTab,children:(0,l.jsx)(`div`,{className:BR.searchOutputWrapper,children:(0,l.jsxs)(`div`,{id:`scrollableDiv`,ref:te,className:BR.scrollableDiv,children:[(0,l.jsxs)(u.Form,{form:w,onValuesChange:e=>{if(e.keywords!==void 0){let t=Object.assign(Object.assign({},T.current),{keywords:e.keywords});r(t),T.current=t,ne(),E.current=setTimeout(oe,800)}},className:t.length>0?BR.searchResults:BR.search,children:[(0,l.jsx)(u.Form.Item,{name:`keywords`,className:BR.gifSearchInput,children:(0,l.jsx)(u.Input,{onPressEnter:()=>{oe()},allowClear:!0,placeholder:o(`Search GIFs`),ref:i,spellCheck:`false`,prefix:(0,l.jsx)(Ic,{size:16,strokeWidth:f?.iconStrokeWidth,onClick:()=>{oe()}})})}),t.length>0&&!v&&(0,l.jsx)(`div`,{className:`ant-divider ${BR.divider}`,role:`separator`})]}),!t.length&&!v&&(0,l.jsx)(l.Fragment,{children:n.keywords?(0,l.jsx)(El,{}):(0,l.jsxs)(`div`,{className:BR.resultsContainer,children:[(0,l.jsx)(`div`,{className:BR.videoIcon,children:(0,l.jsx)(c,{className:BR.playButton})}),(0,l.jsx)(`h1`,{className:BR.title,children:o(`Over 350,000 live images`)}),(0,l.jsx)(`p`,{className:BR.subtitle,children:o(`Enter a search query and we'll find the perfect image for you`)})]})}),!t.length&&v&&(0,l.jsx)(bf,{}),t.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:BR.virtualCanvas,style:{height:R},children:L.map(({row:e,layout:t})=>{let n=e.item,r=g.has(n.id),i=HR(n),o=t.bottom>=ee.scrollTop-240&&t.top<=ee.scrollTop+ee.viewportHeight+240;return(0,l.jsxs)(`div`,{className:`${BR.listItem} ${r?BR.loaded:``}`,onClick:()=>(async(e,t)=>{var n;h(t),setTimeout(()=>{h(null)},2e3);let r=e.split(`?`)[0].split(`#`)[0].split(`/`),i=r[r.length-1]||`uploaded-file`;i.includes(`.`)&&(n=i.split(`.`).pop())!=null&&n.length&&i.split(`.`).pop().length<=5||(i+=`.gif`),a(e,i)})(n.images.downsized.url,n.id,n.title),style:{position:`absolute`,top:t.top,left:t.left,width:t.width,height:t.height,minHeight:t.height,maxHeight:`none`,marginBottom:0},children:[(0,l.jsx)(zR,{imageId:n.id,sourceUrl:i,shouldLoad:o,loader:p,className:m===n.id?BR.loadedImage:``,width:`100%`,height:`100%`,alt:n.title,decoding:`async`,onLoad:()=>{_(e=>{if(e.has(n.id))return e;let t=new Set(e);return t.add(n.id),t})}}),(0,l.jsx)(`a`,{rel:`noreferrer`,href:`https://giphy.com/`,target:`_blank`,onClick:e=>e.stopPropagation()}),m===n.id&&(0,l.jsx)(u.Spin,{className:BR.antSpin})]},n.id)})}),b&&(0,l.jsx)(bf,{})]})]})})})},WR={stockTab:`stockTab`,stockSearchInput:`stockSearchInput`,searchOutputWrapper:`searchOutputWrapper`,divider:`divider`,search:`search`,searchResults:`searchResults`,virtualCanvas:`virtualCanvas`,scrollableDiv:`scrollableDiv`,listItem:`listItem`,loaded:`loaded`,loadedImage:`loadedImage`,creatorInfo:`creatorInfo`,stockColorFilter:`stockColorFilter`,allColors:`allColors`,blackColor:`blackColor`,bwColor:`bwColor`,whiteColor:`whiteColor`,orangeColor:`orangeColor`,redColor:`redColor`,purpleColor:`purpleColor`,magentaColor:`magentaColor`,greenColor:`greenColor`,tealColor:`tealColor`,blueColor:`blueColor`,resultsContainer:`resultsContainer`,playButton:`playButton`,title:`title`,subtitle:`subtitle`},GR=e=>{let t=typeof window<`u`?window.innerWidth:e;return t<=650?1:t<=1e3?2:t<=1450?3:4},KR=(e,t)=>{let n=new URL(e);return n.searchParams.set(`w`,t.toString()),n.toString()},qR=({imageStockList:e,setImageStockList:t,currentReq:n,setCurrentReq:r,inputRef:i,customRequest:a})=>{let{t:o}=Ks(),{StockBigIcon:c,MixedViewIcon:d,LandscapeViewIcon:f,PortraitViewIcon:p,SquareViewIcon:m}=xl(),{options:h}=yl(),{config:g}=h,_=xd({maxConcurrent:6}),[v,y]=(0,s.useState)(!1),[b,x]=(0,s.useState)(!1),[S,C]=(0,s.useState)(!1),[w,T]=(0,s.useState)(null),[E,D]=(0,s.useState)(new Set),[O]=u.Form.useForm(),k=g?.fetchWithProxy,A=g?.handleProxyUrl,j=g?.UNSPLASH_KEY??`HX2_qqq3F3ljmtYtfmb9P6h0dn2u9mnnOl36IdV8el0`,M=(g?.locale)?.slice(0,2)||`ru`,N=(0,s.useRef)(n),P=(0,s.useRef)(null),F=(0,s.useRef)(null),I=(0,s.useRef)(0),L=(0,s.useRef)(1),R=(0,s.useRef)(new Set),z=async e=>A?await Promise.resolve(A(e))??e:e,ee=(0,s.useCallback)(async e=>k?Promise.resolve(k(e,void 0,{intent:`metadata`})):fetch(await z(e)),[k,z]),B=()=>{P.current&&=(clearTimeout(P.current),null)},te=e=>!R.current.has(e)&&(R.current.add(e),!0),ne=e=>{R.current.delete(e)},re=e=>e.map(e=>Object.assign(Object.assign({},e),{urls:{raw:KR(e.urls.raw,1200),small:KR(e.urls.raw,540)}}));(0,s.useEffect)(()=>{N.current=n},[n]),(0,s.useEffect)(()=>{e.length===0&&O.setFieldsValue({color:``,orientation:``})},[e,O]),(0,s.useEffect)(()=>{O.setFieldsValue({keywords:n.keywords,color:n.color,orientation:n.orientation})},[]);let ie=async function({query:e,page:t}){let n=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,``).replace(/[\s_-]+/g,` `);try{let r=`https://api.unsplash.com/search/photos?client_id=${j}&lang=${M}&per_page=30&query=${encodeURIComponent(n)}&page=${t}`;return e.color!==``&&(r+=`&color=${e.color}`),e.orientation!==``&&(r+=`&orientation=${e.orientation}`),{data:await(await ee(r)).json()}}catch{}},{positionedItems:ae,containerHeight:oe,isNearEnd:se,viewportMetrics:ce,handleViewportChange:le}=RR({items:e,getId:e=>e.id,getPreviewSrc:e=>e.urls.small,getAltText:e=>e.description||e.user.name,getWidth:e=>e.width,getHeight:e=>e.height,layoutMode:`masonry`,minColumnWidth:240,estimatedItemHeight:220,prefetchThresholdPx:320,resolveColumnCount:GR}),ue=Nd(le,[e.length]),de=(0,s.useCallback)(async()=>{if(v||b||!S||!N.current.keywords.trim())return;let e=I.current,n=L.current,r=`stock:${`${N.current.keywords.trim()}|${N.current.color}|${N.current.orientation}`}:${n}`;if(te(r)){x(!0);try{let r=await ie({query:N.current,page:n});if(e!==I.current)return;let i=r?.data?.results??[];if(i.length===0)return void C(!1);let a=re(i);if(e!==I.current)return;t(e=>{let t=new Set(e.map(e=>e.id)),n=a.filter(e=>!t.has(e.id));return n.length>0?[...e,...n]:e}),L.current=n+1,C(i.length===30)}finally{ne(r),e===I.current&&x(!1)}}},[S,v,b,t]),fe=async()=>{B();let e=`${N.current.keywords.trim()}|${N.current.color}|${N.current.orientation}`;if(!N.current.keywords.trim())return void(F.current=null);if(F.current===e)return;let n=`stock:${e}:1`;if(!te(n))return;let r=I.current+1;I.current=r,y(!0),x(!1),C(!1),L.current=1,t([]),D(new Set);try{let n=await ie({query:N.current,page:1});if(r!==I.current)return;let i=n?.data?.results??[];if(i.length>0){let e=re(i);if(r!==I.current)return;t(e),L.current=2,C(i.length===30)}else C(!1);F.current=e}finally{ne(n),y(!1)}};(0,s.useEffect)(()=>()=>{B()},[]),(0,s.useEffect)(()=>{!v&&!b&&S&&e.length>0&&se&&de()},[S,e.length,se,de,v,b]);let pe=async(e,t,n,r)=>{var i;(async function(e){try{return{data:await(await ee(`${e}${e.includes(`?`)?`&`:`?`}client_id=${j}`)).json()}}catch{}})(t.download_location),T(n),setTimeout(()=>T(null),2e3);let o=e.raw,s=o.split(`?`)[0].split(`#`)[0].split(`/`),c=s[s.length-1]||`uploaded-file`;c.includes(`.`)&&(i=c.split(`.`).pop())!=null&&i.length&&c.split(`.`).pop().length<=5||(c+=`.jpg`),a(o,c)};return(0,l.jsx)(`div`,{className:WR.stockTab,children:(0,l.jsx)(`div`,{className:WR.searchOutputWrapper,children:(0,l.jsxs)(`div`,{className:WR.scrollableDiv,id:`scrollableDiv`,ref:ue,children:[(0,l.jsxs)(u.Form,{form:O,initialValues:uo,onValuesChange:(e,n)=>{let i=Object.assign(Object.assign({},uo),n);r(i),N.current=i,B(),i.keywords===``?(F.current=null,I.current+=1,L.current=1,t([]),D(new Set),C(!1),x(!1),r(Object.assign({},uo)),N.current=uo,O.resetFields()):P.current=setTimeout(fe,800)},className:e.length>0?WR.searchResults:WR.search,children:[(0,l.jsxs)(u.Row,{gutter:24,children:[(0,l.jsx)(u.Col,{span:e.length>0?void 0:24,children:(0,l.jsx)(u.Form.Item,{name:`keywords`,className:WR.stockSearchInput,children:(0,l.jsx)(u.Input,{allowClear:!0,placeholder:o(`Search image`),ref:i,spellCheck:`false`,prefix:(0,l.jsx)(Ic,{size:16,strokeWidth:g?.iconStrokeWidth})})})}),!!e.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Col,{children:(0,l.jsx)(u.Form.Item,{name:`orientation`,children:(0,l.jsxs)(u.Radio.Group,{onChange:e=>r(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[(0,l.jsx)(u.Tooltip,{title:o(`All`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{value:``,children:(0,l.jsx)(d,{})})}),(0,l.jsx)(u.Tooltip,{title:o(`Landscape`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{value:`landscape`,children:(0,l.jsx)(f,{})})}),(0,l.jsx)(u.Tooltip,{title:o(`Portrait`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{value:`portrait`,children:(0,l.jsx)(p,{})})}),(0,l.jsx)(u.Tooltip,{title:o(`Squarish`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{value:`squarish`,children:(0,l.jsx)(m,{})})})]})})}),(0,l.jsx)(u.Col,{children:(0,l.jsx)(u.Form.Item,{name:`color`,children:(0,l.jsxs)(u.Radio.Group,{className:WR.stockColorFilter,onChange:e=>r(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[(0,l.jsx)(u.Tooltip,{title:o(`All`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.allColors,value:``,children:`All`})}),(0,l.jsx)(u.Tooltip,{title:o(`Black`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.blackColor,value:`black`,children:`B`})}),(0,l.jsx)(u.Tooltip,{title:o(`Black and White`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.bwColor,value:`black_and_white`,children:`B&W`})}),(0,l.jsx)(u.Tooltip,{title:o(`White`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.whiteColor,value:`white`,children:`W`})}),(0,l.jsx)(u.Tooltip,{title:o(`Orange`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.orangeColor,value:`orange`,children:`O`})}),(0,l.jsx)(u.Tooltip,{title:o(`Red`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.redColor,value:`red`,children:`R`})}),(0,l.jsx)(u.Tooltip,{title:o(`Purple`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.purpleColor,value:`purple`,children:`P`})}),(0,l.jsx)(u.Tooltip,{title:o(`Magenta`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.magentaColor,value:`magenta`,children:`M`})}),(0,l.jsx)(u.Tooltip,{title:o(`Green`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.greenColor,value:`green`,children:`G`})}),(0,l.jsx)(u.Tooltip,{title:o(`Teal`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.tealColor,value:`teal`,children:`T`})}),(0,l.jsx)(u.Tooltip,{title:o(`Blue`),placement:`top`,children:(0,l.jsx)(u.Radio.Button,{className:WR.blueColor,value:`blue`,children:`B`})})]})})})]})]}),e.length>0&&!v&&(0,l.jsx)(`div`,{className:`ant-divider ${WR.divider}`,role:`separator`})]}),!e.length&&!v&&(0,l.jsx)(l.Fragment,{children:n.keywords?(0,l.jsx)(El,{}):(0,l.jsxs)(`div`,{className:WR.resultsContainer,children:[(0,l.jsx)(`div`,{className:WR.videoIcon,children:(0,l.jsx)(c,{className:WR.playButton})}),(0,l.jsx)(`h1`,{className:WR.title,children:o(`Millions of free stock images`)}),(0,l.jsx)(`p`,{className:WR.subtitle,children:o(`Enter a search query and we'll find the perfect image for you`)})]})}),!e.length&&v&&(0,l.jsx)(bf,{}),e.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:WR.virtualCanvas,style:{height:oe},children:ae.map(({row:e,layout:t})=>{let n=e.item,r=E.has(n.id),i=t.bottom>=ce.scrollTop-240&&t.top<=ce.scrollTop+ce.viewportHeight+240;return(0,l.jsxs)(`div`,{className:`${WR.listItem} ${r?WR.loaded:``}`,onClick:()=>pe(n.urls,n.links,n.id,n.description),style:{position:`absolute`,top:t.top,left:t.left,width:t.width,height:t.height,minHeight:t.height,maxHeight:`none`,marginBottom:0},children:[(0,l.jsx)(zR,{imageId:n.id,sourceUrl:n.urls.small,shouldLoad:i,loader:_,className:w===n.id?WR.loadedImage:``,width:`100%`,height:`100%`,alt:n.description,decoding:`async`,onLoad:()=>{D(e=>{if(e.has(n.id))return e;let t=new Set(e);return t.add(n.id),t})}}),(0,l.jsxs)(`p`,{className:WR.creatorInfo,onClick:e=>e.stopPropagation(),children:[o(`Photo by`),` `,(0,l.jsx)(`a`,{target:`_blank`,href:`${n.user.links.html}?utm_source=${g?.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:`noreferrer`,children:n.user.name}),` `,o(`on`),` `,(0,l.jsx)(`a`,{target:`_blank`,href:`https://unsplash.com/?utm_source=${g?.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:`noreferrer`,children:`Unsplash`})]}),w===n.id&&(0,l.jsx)(u.Spin,{className:WR.antSpin})]},n.id)})}),b&&(0,l.jsx)(bf,{})]})]})})})},JR=()=>{let{options:e}=yl(),t=e.config;return(0,s.useCallback)((e,n)=>{!1!==t?.pushToGTM&&((e,t)=>{let n=()=>{try{let t=Object.assign(Object.assign({},e),{appLabel:`blocks_app`});window.dataLayer&&typeof window.dataLayer.push==`function`&&window.dataLayer.push(t)}catch{}};t?setTimeout(n,t):n()})(e,n)},[t?.pushToGTM])},YR=`slideshowContainer`,XR=`slideshowImage`,ZR=({images:e,transitionDuration:t=1e3,frameHeight:n})=>{let[r,i]=(0,s.useState)([]),[a,o]=(0,s.useState)(n);(0,s.useEffect)(()=>{let e=()=>{if(typeof window>`u`)return void o(n);let e=window.innerHeight,t=Math.max(e-260,130);o(typeof n==`number`?Math.min(n,t):t)};if(e(),typeof window<`u`)return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n]);let c=()=>{i(e=>e.map((t,n)=>n===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return(0,s.useEffect)(()=>{if(e.length>0){let t=e[e.length-1];i(e=>[...e,{src:t,opacity:0}]),setTimeout(c,1e3)}else i([])},[e]),(0,l.jsx)(`div`,{className:YR,style:{height:a,minHeight:130},children:r.map((e,n)=>(0,l.jsx)(`img`,{src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${n+1}`,className:XR,style:{opacity:e.opacity,transition:`opacity ${t}ms linear`,display:`block`}},n))})},QR=e=>{var{className:t,style:n,color:r,text:i,bordered:a}=e,o=Bd(e,[`className`,`style`,`color`,`text`,`bordered`]);return(0,l.jsx)(u.Tag,Object.assign({style:n,color:r,bordered:a,className:t},o,{children:i||``}))},$R=({text:e,counter:t,limits:n,wrapperStyles:r})=>{let{t:i}=Ks(),{options:a}=yl(),o=a.config,{token:s}=u.theme.useToken(),c=+n>0,d=!c||t<+n,f=o?.billingPageUrl||`/billing`;return(0,l.jsxs)(`div`,{className:`limits-couter-wrapper`,style:r,children:[(0,l.jsx)(QR,{bordered:!1,text:t+` `+i(`of`)+` `+(c?n:`∞`)+` `+(e||i(`tests`,{count:n}))+` `+i(`was used`,{count:t}),className:`limit-counter`,style:{color:d?s.colorText:`white`},color:d?s.colorFillSecondary:`rgb(255, 77, 79)`}),c&&(0,l.jsx)(`div`,{style:{fontSize:14,textDecoration:`underline`,cursor:`pointer`},onClick:()=>window.location.assign(f),children:i(`Need more?`)})]})},ez={imageAi:`imageAi`,imageAiExample:`imageAiExample`,imageItem:`imageItem`,textAreaInputHybrid:`textAreaInputHybrid`,loading:`loading`,carousel:`carousel`,arrow:`arrow`,arrowNext:`arrowNext`,arrowPrev:`arrowPrev`,arrowBtn:`arrowBtn`,arrowBtnNext:`arrowBtnNext`,arrowBtnPrev:`arrowBtnPrev`,row:`row`,inputAffixWrapper:`inputAffixWrapper`,textarea:`textarea`,inputIcon:`inputIcon`},tz=(0,s.memo)(({className:e,onClick:t})=>(0,l.jsx)(`div`,{className:`${ez.arrow} ${ez.arrowNext} ${e||``}`,onClick:t,children:(0,l.jsx)(u.Button,{className:`${ez.arrowBtn} ${ez.arrowBtnNext}`,size:`large`,icon:(0,l.jsx)(m.ArrowRightOutlined,{})})}));tz.displayName=`SampleNextArrow`;var nz=(0,s.memo)(({className:e,onClick:t})=>(0,l.jsx)(`div`,{className:`${ez.arrow} ${ez.arrowPrev} ${e||``}`,onClick:t,children:(0,l.jsx)(u.Button,{className:`${ez.arrowBtn} ${ez.arrowBtnPrev}`,size:`large`,icon:(0,l.jsx)(m.ArrowLeftOutlined,{})})}));nz.displayName=`SamplePrevArrow`;var rz=({customRequest:e,inputAiRef:t,isImageUploaded:n,setIsImageUploaded:r,aiImageRequest:i,setAiImageRequest:a,imageAiList:o,setImageAiList:c,isLoadingAi:d,setIsLoadingAi:f})=>{let{t:p}=Ks(),{AiIcon_2:h}=xl(),g=s.default.useRef(null),[_,v]=(0,s.useState)(`auto`),{aiImageCounter:y,currentAiImgLimits:b,loadingDuringGeneration:x,requestStatus:S,handleGenerate:C,convertBase64ToFile:w,isShiftPressed:T,setIsShiftPressed:E,limitsInPlugin:D}=function({setFrameHeight:e,customRequest:t,aiTabRef:n,isImageUploaded:r,setIsImageUploaded:i,aiImageRequest:a,imageAiList:o,setImageAiList:c,isLoadingAi:l,setIsLoadingAi:u}){let{t:d}=Ks(),{options:f}=yl(),p=f.config,m=Il(),h=JR(),{messages:g}=f.config,[_,v]=(0,s.useState)([]),[y,b]=(0,s.useState)(0),[x,S]=(0,s.useState)(null),[C,w]=(0,s.useState)(!1),[T,E]=(0,s.useState)(d(`Evaluating the task`)),[D,O]=(0,s.useState)(!1),k=(0,s.useRef)(new Set),A=(0,s.useRef)(new Set),j=(0,s.useRef)(new Set);(0,s.useEffect)(()=>{v(g)},[g]),(0,s.useEffect)(()=>{o.length||x||(v([]),k.current.clear(),A.current.clear(),j.current.clear(),P.current=-1)},[o,x]);let M=(0,s.useMemo)(()=>p&&typeof p?.sendAIImageRequest==`function`?p?.sendAIImageRequest:()=>Promise.resolve({}),[p]),N=(0,s.useCallback)(e=>{let t=`${x}-${e.progress}-${JSON.stringify(e.images||e.data)}`;if(!j.current.has(t))if(j.current.add(t),e.status!==`error`&&e.status!==`Canceled`){if(e.images){if(E(String(e.status)),e.progress===100){u(!1),c(e.images);let t=x,n=Array.isArray(e.images)?e.images:[];n.length>0&&t&&!k.current.has(t)&&(k.current.add(t),m.success({id:`AI_IMAGE_GENERERATION_SUCCESS`,message:d(`Images generated successfully`),placement:`bottomRight`,data:{request:a,taskId:t,images:n}})),S(null),O(!1)}}else if(e.data&&(c([String(e.data)]),e.progress===100)){u(!1);let t=x,n=e.data?[String(e.data)]:[];n.length>0&&t&&!k.current.has(t)&&(k.current.add(t),m.success({id:`AI_IMAGE_GENERERATION_SUCCESS`,message:d(`Images generated successfully`),placement:`bottomRight`,data:{request:a,taskId:t,images:n}})),S(null),O(!1)}}else u(!1),O(!1),x&&!A.current.has(x)&&(A.current.add(x),m.error({id:`AI_RESPONSE_INVALID`,message:d(`Something went wrong, please try again`),placement:`bottomRight`,description:String(x)||void 0,data:{requestId:x,request:a,response:e},innerException:e}))},[a,c,E,d,u,x,m,O]),P=(0,s.useRef)(-1);(0,s.useEffect)(()=>{if(_.length>0){let e=_.length-1;e>P.current&&(P.current=e,N(_[e]))}},[N,_]);let F=(0,s.useMemo)(()=>{if(p&&typeof p?.sseQuery==`function`){let e=p?.sseQuery;return t=>e(t)}return e=>{}},[p]),I=(0,s.useMemo)(()=>p&&typeof p?.handleLimitUsageEmitter==`object`?p?.handleLimitUsageEmitter:{fire:()=>{}},[p]),L=p?.elementId,{projectId:R}=p,{limits:z}=p?.limits?p:{limits:{ai_img_limit:0}},{ai_img_limit:ee}=z,B=ee>0&&y>=ee,te=!(!p?.limits||!p.counters)&&oo,ne=(0,s.useCallback)(()=>{I.fire({name:`AiImgCount`,count:y+1})},[I,y]),re=(0,s.useMemo)(()=>!B&&!te,[B,te,y,ee]),ie=(0,s.useCallback)(async()=>{E(d(`Evaluating the task`)),a===``||l||(u(!0),O(!0),c([]),v([]),h({event:`submit_form`,action:`ai_image_generation`,entity_id:L,project_id:R}),M({body:{project_id:R,request:`create-image`,connection:`midjourney`,message:a}}).then(e=>{let{data:t,error:n}=e||{};if(n)throw n;let r=t;if(r?.status===401||r?.data?.status===401)throw Error(`ERROR`);let i=r?.data??r;if(i?._eventResult&&Array.isArray(i.task?.images)&&(i.task.images?.length??0)>0){let e=i.task.images;c(e),u(!1),O(!1),S(null);return}let o=r?.task||r?.data?.task,s=o?.id??x??void 0;r?.status===200||r?.data?.status===200?(o!=null&&o.id&&(E(o.message),S(o.id)),r!=null&&r.message&&m.success({id:`AI_IMAGE_GENERATION_STARTED`,message:r.message,placement:`bottomRight`,data:{request:a,taskId:s,response:r?.data}}),F({task_id:o?.id,entity_id:L})):(u(!1),O(!1),s&&!A.current.has(s)&&(A.current.add(s),m.error({id:`AI_IMAGE_GENERATION_FAILED`,message:r?.message||d(`Something went wrong, please try again`),placement:`bottomRight`,description:a,data:{request:a,taskId:s,response:r},innerException:r})))}).catch(e=>{u(!1),O(!1);let t=e;return(t!=null&&t.error||t!=null&&t.data)&&x&&!A.current.has(x)&&(A.current.add(x),m?.error({id:`AI_IMAGE_GENERATION_FAILED`,message:d(`Something went wrong, please try again`),placement:`bottomRight`,description:a,innerException:e,data:{request:a,taskId:x,response:t?.data,error:Vl(t?.error)}})),t}))},[a,l,u,O,c,h,L,R,M,m,F,d,x]),ae=(0,s.useCallback)(()=>{re&&ie()},[re,te,b,ne,ie,m,d]);(0,s.useEffect)(()=>{},[p,te]);let oe=(0,s.useCallback)(e=>{if(r)return;let n=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!n)return;let a=n[1],o=n[2],s=atob(o),c=Array(s.length);for(let e=0;e<s.length;e++)c[e]=s.charCodeAt(e);let l=new Uint8Array(c),u=new Blob([l],{type:`image/${a}`}),d=new File([u],`image.jpeg`,{type:u.type,lastModified:Date.now()});i(!0),(async()=>{try{typeof t==`function`&&await Promise.resolve(t({file:d}))}catch{}finally{i(!1)}})()},[r,i,t]);return(0,s.useEffect)(()=>{(l||o.length>0)&&setTimeout(()=>{let t=350;if(n.current){let e=n.current?.firstChild;e&&e instanceof HTMLElement&&(t=n.current.getBoundingClientRect()?.height-48-e.clientHeight)}e(t)},0)},[n,o.length,l,e]),{aiImageCounter:y,setAiImageCounter:b,currentAiImgLimits:ee,isFieldsDisabled:B,canGenerateImage:re,aiImageRequest:a,imageAiList:o,setImageAiList:c,isLoadingAi:l,setIsLoadingAi:u,loadingDuringGeneration:D,setLoadingDuringGeneration:O,requestStatus:T,setRequestStatus:E,handleGenerate:ae,handleLimitAiImgCount:ne,convertBase64ToFile:oe,isShiftPressed:C,setIsShiftPressed:w,currentReqId:x,setCurrentReqId:S,limitsInPlugin:te}}({setFrameHeight:v,customRequest:e,aiTabRef:g,isImageUploaded:n,setIsImageUploaded:r,aiImageRequest:i,imageAiList:o,setImageAiList:c,isLoadingAi:d,setIsLoadingAi:f});(0,s.useEffect)(()=>{},[n]);let[O,k]=(0,s.useState)(!1),A=(0,s.useCallback)(()=>k(!0),[]),j=(0,s.useCallback)(()=>k(!1),[]),M=(0,s.useCallback)(e=>a(e.target.value),[a]),N=(0,s.useCallback)(e=>{e.key===`Shift`?E(!0):e.key!==`Enter`||T||(e.preventDefault(),C())},[T,C,E]),P=(0,s.useCallback)(e=>{e.key===`Shift`&&E(!1)},[E]);return(0,l.jsxs)(`div`,{className:ez.imageAi,ref:g,children:[D&&(0,l.jsx)($R,{text:`images`,counter:y,limits:b,wrapperStyles:{marginTop:-25}}),(0,l.jsx)(u.Row,{gutter:24,className:ez.row,children:(0,l.jsxs)(u.Col,{span:24,children:[(0,l.jsx)(u.Form.Item,{children:(0,l.jsxs)(`span`,{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${ez.inputAffixWrapper}${O?` ant-input-affix-wrapper-focused`:``}`,children:[(0,l.jsx)(u.Input.TextArea,{ref:t,onKeyDown:N,onKeyUp:P,onFocus:A,onBlur:j,autoSize:!0,allowClear:!0,className:`${ez.textAreaInputHybrid} ${ez.textarea}`,placeholder:p(`Generate image`),value:i,onChange:M,spellCheck:`false`}),(0,l.jsx)(`span`,{className:`ant-input-suffix ${ez.inputSuffix}`,children:d||x?(0,l.jsx)(m.LoadingOutlined,{className:`${ez.inputIcon} input-icon`,spin:!0}):(0,l.jsx)(h,{className:`${ez.inputIcon} input-icon`,onClick:C})})]})}),(0,l.jsxs)(`div`,{className:ez.imageAiExample,children:[(0,l.jsx)(`span`,{children:p(`For example:`)}),` `,p(`A beautiful image of a sunset over a calm ocean.`)]})]})}),(d||o.length>0)&&(0,l.jsxs)(u.Carousel,{dotPosition:`top`,arrows:!0,nextArrow:(0,l.jsx)(tz,{}),prevArrow:(0,l.jsx)(nz,{}),className:ez.carousel,infinite:!1,children:[d&&!o.length&&(0,l.jsx)(`div`,{className:ez.loading,children:(0,l.jsxs)(`div`,{className:`spin`,children:[(0,l.jsx)(m.LoadingOutlined,{style:{fontSize:48},spin:!0}),(0,l.jsx)(`p`,{className:`status`,children:S})]})}),o.length>0&&o.map((e,t)=>(0,l.jsxs)(`div`,{className:ez.imageItem,children:[(0,l.jsx)(ZR,{images:o,frameHeight:_}),(0,l.jsx)(`div`,{className:`buttons`,children:o.length>0&&!d&&(0,l.jsx)(u.Button,{onClick:()=>w(`data:image/jpeg;base64, ${e}`),loading:n,icon:(0,l.jsx)(m.CheckOutlined,{}),children:p(`Use this variant`)})})]},t))]})]})},iz=e=>{e!=null&&e.customTheme&&((e={})=>{let t=document.querySelector(`head`);if(!t)return;let n=document.createElement(`style`);if(n.type=`text/css`,n.dataset.themeVariablesFm=`true`,n.setAttribute(`data-file-manager`,`true`),Object.entries(e).length){let r=``;Object.entries(e).forEach(([e,t])=>{typeof t!=`object`&&(r+=`\t--${e}: ${t};\n`)}),r=`.em-filemanager {\n${r}}`,n.appendChild(document.createTextNode(r));let i=t.querySelector(`[data-theme-variables-fm="true"]`);i?t.replaceChild(n,i):t.insertBefore(n,t.firstChild)}})(e?.customTheme)},{Sider:az,Content:oz}=u.Layout,sz=s.default.lazy(()=>Promise.resolve().then(()=>e("./e46bb831.js"))),cz=s.default.lazy(()=>Promise.resolve().then(()=>e("./18a6d849.js"))),lz={keywords:``},uz=()=>{let e=Xl(),t=bd(),n=(()=>{let{state:e,actions:t,options:n}=yl(),{selectedFolder:r,pathHistory:i,folders:a}=e,{t:o}=Ks(),{setSelectedFolder:c,setPathHistory:l}=t,u=(0,s.useCallback)(()=>`em_fm:lastFolder:${n?.config?.projectId||`default`}`,[n?.config?.projectId]),d=(0,s.useCallback)((e,t=new Set)=>{if(t.has(e))return[];let n=(Array.isArray(a)?a:[]).find(t=>t.id===e);if(!n)return[];let r=new Set(t);return r.add(e),n.parentId?n.parentId===n.id?[{id:n.id,name:n.name+` (ошибка)`}]:[...d(n.parentId,r),{id:n.id,name:n.name}]:[{id:n.id,name:n.name}]},[a]),f=(0,s.useCallback)(e=>{if(typeof window>`u`)return;let t=!0===n?.config?.rememberLastFolder,r=u();try{if(!t)return void localStorage.removeItem(r);e?localStorage.setItem(r,e):localStorage.removeItem(r)}catch{}},[u,n?.config?.rememberLastFolder]),p=(0,s.useCallback)(e=>{if(e===`folders`){let e=[{id:`folders`,name:o(`Folders`)}];l?.(e),n.onPathChange&&n.onPathChange([]);return}if(!(Array.isArray(a)?a:[]).find(t=>t.id===e))return;let t=d(e),r=[{id:`folders`,name:o(`Folders`)},...t];l?.(r),n.onPathChange&&n.onPathChange(r.map(e=>e.name))},[a,d,l,n,o]),m=(0,s.useCallback)(e=>{let t=e===`folders`?null:e;t!==r&&(c?.(t),f(t),p(e))},[f,r,c,p]),h=(0,s.useCallback)(e=>{if(e===-1)c?.(null),l?.([{id:`folders`,name:o(`Folders`)}]),n.onPathChange&&n.onPathChange([]);else{let t=i.slice(0,e+1),r=t[t.length-1],a=r.id===`folders`?void 0:r.id;c?.(a||null),l?.(t),n.onPathChange&&n.onPathChange(t.map(e=>e.name))}},[n,i,l,c,o]),g=(0,s.useCallback)(e=>{if(!e.isFolder)return;c?.(e.id);let t={id:e.id,name:e.name};if(l&&l([...i,t]),n.onPathChange){let t=[...i.map(e=>e.name),e.name];n.onPathChange(t)}},[n,i,l,c]);return{state:{selectedFolder:r,pathHistory:i},actions:{handleFolderSelect:m,handleBreadcrumbClick:h,handleItemClick:g},selectedFolder:r,pathHistory:i,handleFolderSelect:m,handleBreadcrumbClick:h,handleItemClick:g}})(),r=(()=>{let{state:e,actions:t}=yl(),{pagination:n}=e,{setPagination:r}=t,i=(0,s.useCallback)((e,t)=>{let i=t||n.pageSize;r?.({current:e,pageSize:i,total:n.total})},[n.pageSize,n.total,r]);return{state:{pagination:n},actions:{handlePaginationChange:i}}})(),i=(()=>{let[e,t]=(0,s.useState)([]),[n,r]=(0,s.useState)(!1),[i,a]=(0,s.useState)(!1),o=(0,s.useRef)(0),c=(0,s.useRef)(new Map),l=(0,s.useCallback)(()=>(o.current+=1,`upload_${o.current}_${Date.now()}`),[]),u=(0,s.useCallback)(e=>hc(e.size),[]),d=(0,s.useCallback)((e,n)=>{let i=n.map(t=>({id:l(),folderId:e,name:t.name,size:u(t),status:`uploading`,progress:0}));return t(i),r(!0),a(!1),i.map(e=>e.id)},[l,u]),f=(0,s.useCallback)((e,n)=>{let i={id:l(),folderId:e,name:n,size:void 0,status:`uploading`,progress:0};return t(e=>[...e,i]),r(!0),a(!1),i.id},[l]),p=(0,s.useCallback)((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,n))}):t))},[]),m=(0,s.useCallback)((e,n)=>{n&&c.current.set(e,n),t(t=>t.map(t=>{if(t.id===e){let e=Object.assign(Object.assign({},t),{status:`success`,progress:100});return n!=null&&n.name&&(e.name=n.name),n!=null&&n.size&&t.size===void 0&&(e.size=hc(n.size)),e}return t}))},[]),h=(0,s.useCallback)((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:`error`,error:n}):t))},[]),g=(0,s.useCallback)(()=>{r(!1),a(!1),setTimeout(()=>{t([]),c.current.clear()},300)},[]),_=(0,s.useCallback)(()=>{a(e=>!e)},[]),v=(0,s.useCallback)(e=>c.current.get(e),[]);return{uploadFiles:e,isUploadVisible:n,isUploadMinimized:i,totalFiles:e.length,completedFiles:e.filter(e=>e.status===`success`||e.status===`error`).length,startUpload:d,startUploadByUrl:f,updateProgress:p,markAsSuccess:m,markAsError:h,getUploadedFile:v,closeUpload:g,minimizeUpload:_}})(),a=ad(),{deleteItems:o}=Zl(),d=Il(),{t:f}=Ks(),{options:p,state:m,actions:h}=yl(),g=p,_=g?.onChangeSelection,v=m,y=g?.config,{dataProviders:b}=g,{form:x,urlForm:S,renameForm:C,moveForm:w,renameFolderForm:T,copyForm:E,isModalVisible:D,isUrlModalVisible:O,isMoveModalVisible:k,isRenameFolderModalVisible:A,isCopyModalVisible:j,isDeleteConfirmVisible:M,folderToRename:N,activeLibraryItem:P}=m,{setIsUrlModalVisible:F,setActiveLibraryItem:I}=h,{config:L}=p,{DropZoneFileIcon:R}=xl(),[z,ee]=(0,s.useState)(!1),[B,te]=(0,s.useState)(!1),[ne,re]=(0,s.useState)(!1),ie=(0,s.useRef)(0),ae=(0,s.useRef)(!1);ae.current=B;let oe=s.default.useRef(null),se=s.default.useRef([]),[ce,le]=(0,s.useState)(!1),[ue,de]=(0,s.useState)(!1),fe=ud(e=>e.selectedFiles),pe=ud(e=>e.clearSelection),me=ud(e=>e.syncVisibleFiles),{folders:he,loading:ge}=e.state,{fetchFolders:_e,fetchChildFolders:ve,handleCreateFolder:ye,handleModalOk:be,handleModalCancel:xe,generateMenuItems:Se}=e.actions,Ce=(e=>{let{state:t,actions:n,options:r}=yl(),{t:i}=Ks(),a=Il(),{folders:o,folderToRename:c,renameFolderForm:l,isRenameFolderModalVisible:u}=t,{setFolderToRename:d,setIsRenameFolderModalVisible:f}=n,{apiEndpoints:p,dataProviders:m,config:h}=r,g=(0,s.useCallback)(e=>{d?.(e),f?.(!0);let t=o?.find(t=>t.id===e);t&&l&&l.setFieldsValue({newFolderName:t.name})},[d,f,o,l]),_=(0,s.useCallback)(()=>{f?.(!1),d?.(null),l?.resetFields()},[f,d,l]),v=(0,s.useCallback)(async()=>{if(c&&l)try{let t=await l.validateFields();if(!t?.newFolderName)return void a.warning({id:`FOLDER_OPERATION_VALIDATION_FAILED`,message:i(`Folder name cannot be empty`),placement:`bottomRight`,data:{folderId:c,folderName:t?.newFolderName,reason:`emptyName`}});if(!1===h?.features?.enableRenameFolder)return void a.error({id:`FOLDER_RENAME_DISABLED_BY_CONFIG`,message:i(`Folder rename is disabled by config`),placement:`bottomRight`,data:{itemId:c??void 0,itemName:t?.newFolderName}});if(!m?.renameFolder)throw Error(i(`renameFolder is not implemented in dataProviders`));let r=await m.renameFolder(c,t.newFolderName.trim());if(!r?.id)return void a.error({id:`FOLDER_RENAME_FAILED`,message:i(`Unexpected response when renaming folder`),placement:`bottomRight`,data:{itemId:c??void 0,itemName:t.newFolderName,error:{message:`invalidResponse`}}});a.success({id:`FOLDER_RENAME_SUCCESS`,message:i(`Folder renamed`),placement:`bottomRight`,data:{itemId:r.id,itemName:r.name,folderId:r.parentId??null}}),_(),await e(),c!==r.id&&n.setSelectedFolder&&n.setSelectedFolder(r.id)}catch(e){a.error({id:`FOLDER_RENAME_FAILED`,message:i(`Failed to rename folder`),placement:`bottomRight`,innerException:e,data:{itemId:c??void 0,itemName:l?.getFieldValue(`newFolderName`),error:{message:e instanceof Error?e.message:String(e)}}})}},[c,l,p,_,e,i,h?.features?.enableRenameFolder,a]);return{state:{isRenamingFolder:u||!1,folderToRename:c},actions:{showRenameFolderModal:g,handleRenameFolderCancel:_,handleRenameFolderOk:v}}})(_e),{files:we,loading:Te,isRenamingFile:Ee,fileToRename:De}=t.state,{fetchFiles:Oe,handleDeleteFile:ke,handleDeleteFolder:Ae,handleAddFile:je,handleAddFileByUrl:Me,showRenameModal:Ne,handleRenameCancel:Pe,handleRenameOk:Fe,handleDroppedFiles:Ie,showMoveModal:Le,handleMoveCancel:Re,handleMoveOk:ze,handleCopyOk:Be,handleCopyCancel:Ve,showDeleteConfirm:He,handleDeleteConfirmCancel:Ue,handleDeleteConfirmOk:We}=t.actions,{selectedFolder:Ge,pathHistory:Ke}=n.state,{handleFolderSelect:qe,handleItemClick:Je}=n.actions,{pagination:Ye}=r.state,Xe=Nl(Oe),{searchTerm:Ze,sortBy:Qe,sortOrder:$e}=Xe.state,{handleSearch:et,handleSort:tt,handlePaginationChange:nt}=Xe.actions,rt=(0,s.useCallback)(async()=>{let e=(e=>Kl(e))(Ke||[]);try{await Yl({options:g,pathFolder:e,dataProviders:g?.dataProviders})}catch{}await _e(),await Oe({folderId:Ge||``,page:Ye.current,limit:Ye.pageSize,search:Ze,sortBy:Qe,sortOrder:$e,itemType:`all`})},[Oe,_e,g,Ye,Ke,Ze,Ge,Qe,$e]),it=(({files:e,fetchFiles:t,selectedFolder:n})=>{let{t:r}=Ks(),i=Il(),{options:a,actions:o,state:c}=s.useContext(vl),{setActiveLibraryItem:l}=o,{activeLibraryItem:u}=c,d=ad(),[f,p]=s.useState(!1),[m,h]=s.useState(null),g=s.useCallback(e=>{if(e.type&&e.type.startsWith(`image/`))return!0;if(e.extension){let t=e.extension.toLowerCase();return co.includes(t)}let t=e.name.split(`.`).pop()?.toLowerCase();return!!t&&co.includes(t)},[]),_=s.useCallback(async(e,t)=>{let{dataProviders:n}=a;if(!1===a.config?.features?.enableUpdateFile)throw new Ql(r(`Updating files is disabled by configuration`),`UnsupportedOperation`);if(!e.id||!e.thumbnail||!n?.updateFile)throw new Ql(r(`Failed to save changes`),`UnsupportedOperation`);let i=t?.mimeType||yo(e.thumbnail,e.type),o=bo(i),s=e.name.lastIndexOf(`.`),c=`${s>0?e.name.substring(0,s):e.name}.${o}`,l=t?.blob||Eo(e.thumbnail,i);return n.updateFile(e.id,{name:c,type:i,data:l})},[a,r]),v=s.useCallback(async(e,t)=>{if(!e.thumbnail)throw new Ql(r(`Failed to save changes`),`ValidationError`);let n=!0!==a.config?.saveCopyToCurrentFolder||(e.saveWithoutFolder??!e.id),i=n?void 0:e.folderId??void 0,o=t?.mimeType||yo(e.thumbnail,e.type),s=t?.blob||Eo(e.thumbnail,o),c=new File([s],e.name,{type:o,lastModified:Date.now()}),l=await d.uploadFileWithProvider(c,i,void 0,n);if(!l)throw new Ql(r(`Failed to save image copy`),`FileWriteError`);return l},[d,a.config?.saveCopyToCurrentFolder,r]),y=s.useCallback(t=>{let n;if(t)n=t;else{let t=ud.getState().selectedFiles;if(t.size!==1)return;let r=Array.from(t)[0];if(n=e.find(e=>e.id===r),!n||n.isFolder||!g(n))return}l&&l(eo),h(n),p(!0)},[e,g,p,l]),b=s.useCallback(()=>{l&&u===eo&&l(Ja),p(!1),h(null)},[u,l]);return{isPixieEditorVisible:f,editingFile:m,handleEdit:y,handlePixieEditorSave:s.useCallback(async(e,o)=>{try{let s=await _(e,o);return i.success({id:`IMAGE_UPDATE_SUCCESS`,message:r(`Success`),description:r(`Image updated successfully`),placement:`bottomRight`,data:{itemId:s?.id??void 0,itemName:s?.name,folderId:s?.folderId??null,thumbnail:s?.thumbnail}}),s&&a.onEditorOk&&a.onEditorOk(s,{mode:o.mode}),await t({folderId:n||``}),b(),s??void 0}catch(t){let n=Vl(t),a=zl(n?.code,r)??n?.message??r(`Failed to save changes`);throw i.error({id:`IMAGE_SAVE_FAILED`,message:a,innerException:t,placement:`bottomRight`,data:{itemId:e.id??void 0,itemName:e.name,folderId:e.folderId??null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[_,a,t,n,i,b,r]),handlePixieEditorSaveCopy:s.useCallback(async(e,o)=>{try{let s=await v(e,o);return i.success({id:`IMAGE_SAVE_COPY_SUCCESS`,message:r(`Success`),description:r(`Image copy saved successfully`),placement:`bottomRight`,data:{itemId:s?.id??void 0,itemName:s?.name,folderId:s?.folderId??null,thumbnail:s?.thumbnail}}),s&&a.onEditorOk&&a.onEditorOk(s,{mode:o.mode}),await t({folderId:n||``}),b(),s??void 0}catch(t){let n=Vl(t),a=zl(n?.code,r)??n?.message??r(`Failed to save image copy`);throw i.error({id:`IMAGE_SAVE_COPY_FAILED`,message:a,innerException:t,placement:`bottomRight`,data:{itemId:e.id??void 0,itemName:e.name,folderId:e.folderId??null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[v,a,t,n,i,b,r]),handlePixieEditorClose:b}})({files:we||[],fetchFiles:Oe,selectedFolder:Ge||null}),[at,ot]=(0,s.useState)(!1),st=(0,s.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!e.dataTransfer||!e.dataTransfer.types||!e.dataTransfer.types.includes(`Files`))return;e.dataTransfer.dropEffect=`copy`;let t=e.relatedTarget,n=e.currentTarget;t&&n.contains(t)||(ie.current+=1,ie.current>0&&ee(!0))},[]),ct=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=e.relatedTarget,n=e.currentTarget;if(t&&!n.contains(t))ie.current=Math.max(0,ie.current-1),ie.current<=0&&ee(!1);else if(t){let e=t.closest(`[class*="dragOverlay"]`);if(e&&n.contains(e))return}},[]),lt=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)},[]),ut=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),ee(!1),ie.current=0;let t=(()=>{let t=e.dataTransfer;if(!t)return[];if(t.files?.length)return Array.from(t.files);let n=[];if(t.items)for(let e=0;e<t.items.length;e++){let r=t.items[e].getAsFile();r&&n.push(r)}return n})();t.length&&(ot(!0),Ie(t).catch(e=>{e?.name}).finally(()=>{ot(!1)}))},[Ie]),dt=(0,s.useCallback)(()=>{ee(!1),ie.current=0,document.body.removeAttribute(`data-fm-dragging`),re(!1),te(!1)},[]);s.default.useEffect(()=>{se.current=we||[]},[we]);let ft=v?.activeLibraryItem;(0,s.useEffect)(()=>{let e=e=>{e?document.body.setAttribute(`data-fm-dragging`,`true`):document.body.removeAttribute(`data-fm-dragging`)},t=!1,n=n=>{var r;!t&&(r=n.dataTransfer?.types)!=null&&r.includes(`Files`)&&(t=!0,re(!0),e(!0),ft===Ja&&te(!0))},r=n=>{let r=n.relatedTarget;(!r||!document.documentElement.contains(r))&&t&&(t=!1,re(!1),te(!1),e(!1))};return window.addEventListener(`dragenter`,n,!0),window.addEventListener(`dragleave`,r,!0),()=>{window.removeEventListener(`dragenter`,n,!0),window.removeEventListener(`dragleave`,r,!0),document.body.removeAttribute(`data-fm-dragging`)}},[ft]),(0,s.useEffect)(()=>{let e=e=>{if(document.body.removeAttribute(`data-fm-dragging`),re(!1),!(e.dataTransfer?.types)?.includes(`Files`))return;e.preventDefault();let t=(e=>{if(!e)return[];if(e.files?.length)return Array.from(e.files);let t=[];if(e.items)for(let n=0;n<e.items.length;n++){let r=e.items[n].getAsFile();r&&t.push(r)}return t})(e.dataTransfer);if(!t.length)return;let n=e.target,r=n.closest(`.${W.filesContainer.replace(/\s+/g,`.`)}`)||n.closest(`[data-files-container]`),i=n.closest(`.em-filemanager`)||n.closest(`.file-manager__layout`)||n.closest(`[data-drop-overlay]`)||n.closest(`[data-drag-capture]`);(ae.current||z||r||i)&&(e.preventDefault(),e.stopPropagation(),te(!1),ee(!1),ie.current=0,ot(!0),Ie(t).catch(e=>{e?.name}).finally(()=>ot(!1)))},t=e=>{var t;(t=e.dataTransfer?.types)!=null&&t.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,document.body.hasAttribute(`data-fm-dragging`)||(document.body.setAttribute(`data-fm-dragging`,`true`),re(!0)),ft!==Ja||ae.current||te(!0))},n=e=>{var t;(t=e.dataTransfer?.types)!=null&&t.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,document.body.setAttribute(`data-fm-dragging`,`true`),re(!0))},r={capture:!0,passive:!1};return window.addEventListener(`drop`,e,r),window.addEventListener(`dragover`,t,r),window.addEventListener(`dragenter`,n,r),()=>{window.removeEventListener(`drop`,e,r),window.removeEventListener(`dragover`,t,r),window.removeEventListener(`dragenter`,n,r)}},[z,Ie,ft]),(0,s.useEffect)(()=>{let e=e=>{z&&dt(),te(!1),re(!1),document.body.removeAttribute(`data-fm-dragging`)};return window.addEventListener(`dragend`,e,!0),()=>window.removeEventListener(`dragend`,e,!0)},[z,dt]),(0,s.useEffect)(()=>{let e=null,t=t=>{z&&(e=setTimeout(()=>{z&&dt()},200))};return document.addEventListener(`mouseup`,t,!0),()=>{document.removeEventListener(`mouseup`,t,!0),e&&clearTimeout(e)}},[z,dt]),(0,s.useEffect)(()=>{let e=e=>{e.key===`Escape`&&z&&dt()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[z,dt]),(0,s.useEffect)(()=>{let e=e=>{z&&setTimeout(()=>{z&&dt()},100)};return document.addEventListener(`click`,e,!0),()=>{document.removeEventListener(`click`,e,!0)}},[z,dt]);let pt=s.default.useCallback(async()=>{await We(),await _e(),Ge===to&&ve&&await ve(to),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var e;return((e=oe.current)?.refreshFileCounts)?.call(e)})})},[_e,ve,We,Ge]),mt=s.default.useCallback(()=>{de(!0)},[]),ht=s.default.useCallback(async()=>{if(Ge!==to)return void de(!1);try{if(b?.cleanTrash){let e=await b.cleanTrash();await Oe({folderId:to}),await oe.current?.refreshFileCounts(),e.success?d.success({id:`TRASH_CLEARED_SUCCESS`,message:f(`Trash cleared successfully`),description:f(`{{count}} items permanently deleted`,{count:e.deletedCount||0}),placement:`bottomRight`}):d.error({id:`TRASH_CLEAR_FAILED`,message:f(`Failed to clear trash`),placement:`bottomRight`})}else{let e=se.current||[];if(e.length===0)return void de(!1);let t=await o({items:e.map(e=>({id:e.id,isFolder:e.isFolder})),selectedFolder:to,getItemNameById:t=>e.find(e=>e.id===t)?.name||t||``,showNotifications:!1});await Oe({folderId:to}),await oe.current?.refreshFileCounts();let{successCount:n,failCount:r}=t;r===0?d.success({id:`TRASH_CLEARED_SUCCESS`,message:f(`Trash cleared successfully`),description:f(`{{count}} items permanently deleted`,{count:n}),placement:`bottomRight`}):n>0?d.warning({id:`TRASH_CLEARED_PARTIAL`,message:f(`Trash partially cleared`),description:f(`{{succeeded}} items deleted, {{failed}} items failed`,{succeeded:n,failed:r}),placement:`bottomRight`}):d.error({id:`TRASH_CLEAR_FAILED`,message:f(`Failed to clear trash`),placement:`bottomRight`})}de(!1)}catch{d.error({id:`TRASH_CLEAR_ERROR`,message:f(`Error clearing trash`),placement:`bottomRight`}),de(!1)}},[Ge,b,Oe,d,f,o]),gt=s.default.useCallback(()=>{de(!1)},[]),_t=s.default.useCallback(async e=>{await ze(e),await oe.current?.refreshFileCounts()},[ze]),vt=s.default.useCallback(async e=>{await Be(e),await oe.current?.refreshFileCounts()},[Be]),yt=s.default.useCallback(async()=>{let e=[],t=new Map,n=g?.config;await je({onStartBatch:r=>{e=i.startUpload(Ge||void 0,r),t=new Map,r.forEach((r,i)=>{let a=e[i];a&&(t.set(r.name,a),t.set(Lo(r.name,n),a))})},onStart:r=>{if(e.length===0){e=i.startUpload(Ge||void 0,[r]);let a=e[0];a&&(t.set(r.name,a),t.set(Lo(r.name,n),a))}},onProgress:(e,n)=>{let r=t.get(e);r&&i.updateProgress(r,n)},onComplete:async e=>{let n=t.get(e);if(n){await new Promise(e=>setTimeout(e,100));let t=we?.find(t=>t.name===e&&!t.isFolder);i.markAsSuccess(n,t)}await oe.current?.refreshFileCounts()},onError:(n,r,a)=>{let o=t.get(n)??(a!=null&&a<e.length?e[a]:void 0);o&&i.markAsError(o,r)},onBatchComplete:async n=>{for(let r=0;r<n.successes.length;r++){let a=n.successes[r],o=n.uploadedFiles?.get(a),s=t.get(a)??(o?.originalFileName?t.get(o.originalFileName):void 0)??(o?.originalIndex!=null&&o.originalIndex<e.length?e[o.originalIndex]:void 0)??(r<e.length?e[r]:void 0);if(s){let e;if(o?.id){let t=o;e={id:t.id,name:t.name??a,folderId:t.folderId??Ge??null,isFolder:!1,size:t.size}}else await new Promise(e=>setTimeout(e,100)),e=we?.find(e=>e.name===a&&!e.isFolder);i.updateProgress(s,100),i.markAsSuccess(s,e)}}n.errors.forEach(({fileName:e,error:n})=>{let r=t.get(e);r&&i.markAsError(r,n)}),await oe.current?.refreshFileCounts()}})},[je,i,we,Ge,g?.config]),bt=s.default.useCallback(async(e,t,n,r)=>{var a;try{le(!0);let o=n||`uploaded-file`;if(!n&&e){let t=e.split(`?`)[0].split(`#`)[0].split(`/`);o=t[t.length-1]||`uploaded-file`,o.includes(`.`)&&(a=o.split(`.`).pop())!=null&&a.length&&o.split(`.`).pop().length<=5||(o+=`.jpg`)}let s=i.startUploadByUrl(Ge||void 0,o);try{let n=await Me(e,t,!0,r??`uploadByUrl`);if(i.updateProgress(s,100),n){await new Promise(e=>setTimeout(e,100));let e=we?.find(e=>e.id===n.id&&!e.isFolder)||n;i.markAsSuccess(s,e)}else i.markAsSuccess(s);await oe.current?.refreshFileCounts()}catch(e){let t=Gl(Vl(e),f);i.markAsError(s,t)}}finally{le(!1)}},[Me,i,Ge,we,f]),xt=s.default.useCallback(async({file:e})=>{let t=i.startUpload(Ge||void 0,[e])[0],n=0,r=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),i.updateProgress(t,n)},200);try{let n=await a.uploadFileWithProvider(e,void 0,!0);if(clearInterval(r),i.updateProgress(t,100),n){await new Promise(e=>setTimeout(e,100));let e=we?.find(e=>e.id===n.id&&!e.isFolder)||n;i.markAsSuccess(t,e)}else i.markAsSuccess(t);let o=n&&n.folderId||Ge||null;return qe&&qe(o&&o!==`folders`?o:`folders`),await oe.current?.refreshFileCounts(),n}catch(e){clearInterval(r);let n=e instanceof Error?e.message:String(e);throw i.markAsError(t,n),e}},[a,i,Ge,we,qe]),St=s.default.useCallback(async e=>{if(Ie){let t=i.startUpload(Ge||void 0,e);e.forEach(async(e,n)=>{let r=t[n];if(!r)return;let a=0,o=setInterval(()=>{a=Math.min(a+10+Math.floor(Date.now()%10),85),i.updateProgress(r,a)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await Ie(e),t.forEach(e=>{i.updateProgress(e,100),i.markAsSuccess(e)}),await oe.current?.refreshFileCounts()}},[Ie,i,Ge]),Ct=s.default.useCallback(async e=>{await Ae(e),await _e(),await oe.current?.refreshFileCounts()},[Ae,_e]),wt=(({files:e,clearSelection:t,showRenameModal:n,showMoveModal:r,showCopyModal:i,handleDeleteFile:a,handleDeleteFolder:o,showDeleteConfirm:c,onEdit:l})=>({handleClearSelection:s.useCallback(()=>{t()},[t]),handleRename:s.useCallback(e=>{let t=ud.getState().selectedFiles;(t&&t.size===1||e)&&n(e||Array.from(t)[0])},[n]),handleDeleteSelected:s.useCallback(t=>{let n=ud.getState().selectedFiles;if(n&&n.size>0||t?.id){if(c)return void c();(t?[t.id]:n).forEach(t=>{let n=e.find(e=>e.id===t);n&&(n.isFolder?o(t):a(t))})}},[e,a,o,c]),handleCopy:s.useCallback(()=>{i()},[i]),handleMove:s.useCallback(()=>{r()},[r]),handleEdit:s.useCallback(()=>{l()},[l])}))({files:we||[],clearSelection:pe,showRenameModal:Ne,showMoveModal:Le,showCopyModal:t.actions.showCopyModal||(()=>{}),handleDeleteFile:ke,handleDeleteFolder:Ct,showDeleteConfirm:He,onEdit:it.handleEdit}),Tt=ge||Te||at;(0,s.useEffect)(()=>{go()},[]),(0,s.useLayoutEffect)(()=>{P===Ja?me(we||[]):pe()},[P,we,me,pe]),(0,s.useEffect)(()=>{if(!(!_||P!==Ja)){if(!tn.current)return void(tn.current=!0);_((Array.isArray(we)?we:[]).filter(e=>fe.has(e.id)))}},[P,we,fe,_]),s.default.useEffect(()=>{if(!qe||he.length===0)return;let e=!1!==y?.rememberLastFolder,t=`em_fm:lastFolder:${y?.projectId||`default`}`;if(e&&typeof window<`u`)try{let e=localStorage.getItem(t);if(e&&he.some(t=>t.id===e))return void qe(e)}catch{}Ge||qe(`folders`)},[Ge,qe,he,y?.rememberLastFolder,y?.projectId]);let{handleRenameFolderCancel:Et,handleRenameFolderOk:Dt}=Ce.actions;(0,s.useEffect)(()=>{let e=async e=>{if(P!==Ja)return;let t=document.activeElement;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t?.getAttribute(`contenteditable`)===`true`)return;let n=e.clipboardData;if(!n)return;let r=Array.from(n.items),i=r.filter(e=>e.type.startsWith(`image/`));if(i.length>0){let t=i.map(e=>e.getAsFile()).filter(e=>e!==null);t.length>0&&(e.preventDefault(),await St(t));return}let a=r.find(e=>e.type===`text/plain`);a&&a.getAsString(async t=>{let n=t.trim();if(n.startsWith(`http://`)||n.startsWith(`https://`))e.preventDefault(),await bt(n);else if(n.includes(`<meta`)||n.includes(`http`)){let t=n.match(/https?:\/\/[^\s"']+/);t&&(e.preventDefault(),await bt(t[0]))}})};return document.addEventListener(`paste`,e),()=>{document.removeEventListener(`paste`,e)}},[P,bt,St]);let Ot=(0,s.useRef)(Ye);(0,s.useEffect)(()=>{Ot.current=Ye},[Ye]);let kt=(0,s.useCallback)(e=>{nt(e.current||Ot.current.current,e.pageSize||Ot.current.pageSize)},[nt]),At=(0,s.useCallback)(e=>{Je?.(e)},[Je]),jt=s.default.useCallback(e=>{let{sortBy:t,sortOrder:n}=(e=>{let[t,n]=e.split(`-`);return{sortBy:t,sortOrder:n}})(e);tt(t,n)},[tt]),[Mt,Nt]=(0,s.useState)(lz),[Pt,Ft]=(0,s.useState)([]),It=(0,s.useRef)(null),[Lt,Rt]=(0,s.useState)(uo),[zt,Bt]=(0,s.useState)([]),Vt=(0,s.useRef)(null),[Ht,Ut]=(0,s.useState)(``),Wt=(0,s.useRef)(null),[Gt,Kt]=(0,s.useState)(``),[qt,Jt]=(0,s.useState)([]),Yt=s.default.useRef(void 0),[Xt,Zt]=(0,s.useState)(!1),[Qt,$t]=(0,s.useState)(!1),en=s.default.useRef(null),tn=s.default.useRef(!1),[nn,rn]=(0,s.useState)({mode:`qr`,rawText:``,foregroundHex:`#000000`,backgroundHex:`#ffffff`,transparentBackground:!1,qrSidePx:200,barcodeBarHeightPx:60}),an=s.default.useRef(P),on=s.default.useCallback(e=>{let t=e.indexOf(`,`);if(t===-1)return null;let n=e.substring(0,t),r=n.match(/^data:([^;]+)/),i=r&&r[1]||`image/svg+xml`,a,o=`svg`;if(i.includes(`png`)?o=`png`:(i.includes(`jpeg`)||i.includes(`jpg`))&&(o=`jpg`),/;base64/i.test(n)){let n=e.substring(t+1),r=atob(n),o=new Uint8Array(r.length);for(let e=0;e<r.length;e+=1)o[e]=r.charCodeAt(e);a=new Blob([o],{type:i})}else{let n=decodeURIComponent(e.substring(t+1));a=new Blob([n],{type:i})}return new File([a],`icon_${Date.now()}.${o}`,{type:i})},[]),sn=s.default.useCallback(async e=>{let t=i.startUpload(Ge||void 0,[e])[0],n=0,r=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),i.updateProgress(t,n)},200);try{let n=await a.uploadFileWithProvider(e,void 0,!0);if(clearInterval(r),i.updateProgress(t,100),n){await new Promise(e=>setTimeout(e,100));let e=we?.find(e=>e.id===n.id&&!e.isFolder)||n;i.markAsSuccess(t,e)}else i.markAsSuccess(t);await oe.current?.refreshFileCounts()}catch(e){clearInterval(r);let n=e instanceof Error?e.message:String(e);throw i.markAsError(t,n),e}},[i,we,a,Ge]),cn=(0,s.useCallback)(async e=>{if(e&&e.startsWith(`data:`)){let t=on(e);if(!t)return;await sn(t);return}e&&await bt(e,void 0,void 0,`iconStock`)},[on,bt,sn]),ln=(0,s.useCallback)(async()=>{let e=L?.fileForEdit;if(Yt.current!==e&&P===eo&&e&&!it.editingFile){Yt.current=e;try{if(typeof e==`string`){if(e.startsWith(`data:`))return void(it==null||it.handleEdit({thumbnail:e,saveWithoutFolder:!0}));let t=await a.resolveFileForEditByUrl(e);Yt.current===e&&it?.handleEdit(t)}}catch{Yt.current===e&&(Yt.current=null),it?.handlePixieEditorClose()}}},[L?.fileForEdit,P,it,a]);(0,s.useEffect)(()=>{ln()},[ln]),(0,s.useEffect)(()=>{var e,t,n,r;let i=an.current;an.current=P,P===Ja?(Ft([]),Nt(lz),Bt([]),Rt(uo),Jt([]),Kt(``),$t(!1),Zt(!1),i===Ja||i!==Xa&&i!==Ya&&i!==Qa||et(``)):P===Qa?(e=en.current)==null||e.focus():P===Ya?(t=It.current)==null||t.focus():P===Xa?(n=Vt.current)==null||n.focus():P===Za&&((r=Wt.current)==null||r.focus())},[P,et]);let un=s.default.useCallback(async()=>{await Dt(),await oe.current?.refreshFileCounts()},[Dt]),dn=(0,s.useCallback)(e=>e?e.files?.length?Array.from(e.files):e.items?Array.from(e.items).map(e=>e.getAsFile()).filter(e=>!!e):[]:[],[]);return(0,l.jsxs)(l.Fragment,{children:[ne&&ft===Ja&&(0,c.createPortal)((0,l.jsx)(`div`,{className:W.dragCaptureLayer,"data-drag-capture":`true`,onDragOver:e=>{var t;e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),(t=e.dataTransfer?.types)!=null&&t.includes(`Files`)&&!ae.current&&te(!0)},onDragEnter:e=>{var t;e.preventDefault(),e.stopPropagation(),(t=e.dataTransfer?.types)!=null&&t.includes(`Files`)&&te(!0)},onDragLeave:e=>{let t=e.relatedTarget;t&&document.documentElement.contains(t)||(te(!1),re(!1),document.body.removeAttribute(`data-fm-dragging`))},onDrop:e=>{e.preventDefault(),e.stopPropagation(),re(!1),te(!1),document.body.removeAttribute(`data-fm-dragging`);let t=dn(e.dataTransfer);t.length&&(ot(!0),Ie(t).catch(e=>{e?.name}).finally(()=>ot(!1)))},"aria-hidden":`true`}),document.body),B&&(0,c.createPortal)((0,l.jsx)(`div`,{className:W.dragOverlayGlobal,"data-drop-overlay":`true`,onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)},onDragEnter:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),e.stopPropagation(),te(!1),re(!1),document.body.removeAttribute(`data-fm-dragging`);let t=dn(e.dataTransfer);t.length&&(ot(!0),Ie(t).catch(e=>{e?.name}).finally(()=>ot(!1)))},"aria-hidden":`true`,children:(0,l.jsxs)(`div`,{className:W.dragOverlayInner,children:[(0,l.jsx)(`div`,{className:W.uploadIcon,children:(0,l.jsx)(R,{})}),(0,l.jsx)(`div`,{className:W.textTitle,children:f(`Drop files here to upload`)}),(0,l.jsx)(`div`,{className:W.textDescription,children:f(`Supported files:`)+` .jpg, .jpeg, .svg, .png`})]})}),document.body),(0,l.jsx)(u.Layout,{className:`file-manager__layout`,children:(0,l.jsxs)(`div`,{className:W.filesContainer,"data-files-container":`true`,onDragOver:lt,onDragLeave:ct,onDragEnter:st,onDrop:ut,children:[z&&(0,l.jsx)(`div`,{className:W.dragOverlay,children:(0,l.jsxs)(`div`,{className:W.dragOverlayInner,children:[(0,l.jsx)(`div`,{className:W.uploadIcon,children:(0,l.jsx)(R,{})}),(0,l.jsx)(`div`,{className:W.textTitle,children:f(`Drop files here to upload`)}),(0,l.jsx)(`div`,{className:W.textDescription,children:f(`Supported files:`)+` .jpg, .jpeg, .svg, .png`})]})}),(0,l.jsxs)(u.Layout,{className:`file-manager__content`,children:[(0,l.jsx)(az,{width:320,theme:`light`,className:`file-manager-sider`,children:(0,l.jsx)(Df,{ref:oe,selectedFolder:Ge||`folders`,generateMenuItems:Se,onFolderSelect:e=>qe?.(e),folders:he||[],fetchFolders:_e,fetchChildFolders:ve,handleAddFile:yt,setIsUrlModalVisible:e=>F?.(e),handleDeleteFolder:Ct,handleCreateFolder:ye,activeLibraryItem:P,setActiveLibraryItem:e=>I?.(e)})}),(0,l.jsxs)(u.Layout,{className:`file-manager__main-content`,children:[at&&(0,l.jsx)(bf,{style:{position:`absolute`,width:`100%`,height:`100%`,top:0,left:0,zIndex:100,background:`var(--colorBgLayout)`}}),(0,l.jsxs)(oz,{className:`main-content`,children:[(0,l.jsx)(FR,{activeLibraryItem:P,selectedFolder:he?.find(e=>e?.id===Ge)?.name||f(`Folders`),isTrashFolder:Ge===`Trash`,onClearTrash:mt,files:we||[],loading:Tt,onRefresh:rt,refreshDisabled:Te||ge,showRefresh:!(!g?.apiEndpoints?.clearCache&&!g?.dataProviders?.clearCache)}),(0,l.jsx)(u.Divider,{className:`zero-divider`}),P===Ja&&(0,l.jsx)(lf,{searchTerm:Ze,handleAddFile:yt,files:we||[],handleSearch:et,sortBy:Qe,sortOrder:$e,handleSortOptionChange:jt,pagination:Ye,setPagination:kt,loading:Tt,handleItemClick:At,onClearSelection:wt.handleClearSelection,onRename:wt.handleRename,onCopy:wt.handleCopy,onMove:wt.handleMove,onDelete:wt.handleDeleteSelected,showRenameModal:Ne,showDeleteConfirm:He,showCopyModal:t.actions.showCopyModal||(()=>{}),showMoveModal:Le,onEdit:it.handleEdit,getFileData:a.getFileData}),P===Ya&&(0,l.jsx)(UR,{imageGifList:Pt,setImageGifList:Ft,currentReqGif:Mt,setCurrentReqGif:Nt,inputRef:It,customRequest:(e,t)=>bt(e,void 0,t,`gif`)}),P===Xa&&(0,l.jsx)(qR,{imageStockList:zt,setImageStockList:Bt,currentReq:Lt,setCurrentReq:Rt,inputRef:Vt,customRequest:(e,t)=>bt(e,void 0,t,`imageStock`)}),P===Za&&(0,l.jsx)(s.default.Suspense,{fallback:(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`48px 0`},children:(0,l.jsx)(u.Spin,{size:`large`})}),children:(0,l.jsx)(sz,{customRequest:cn,query:Ht,setQuery:Ut,inputRef:Wt})}),P===$a&&(0,l.jsx)(s.default.Suspense,{fallback:(0,l.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`48px 0`},children:(0,l.jsx)(u.Spin,{size:`large`})}),children:(0,l.jsx)(cz,{customRequest:xt,state:nn,setState:rn})}),P===Qa&&!!L?.sseQuery&&(0,l.jsx)(rz,{imageAiList:qt,setImageAiList:Jt,aiImageRequest:Gt,setAiImageRequest:Kt,inputAiRef:en,customRequest:xt,isLoadingAi:Xt,setIsLoadingAi:Zt,isImageUploaded:Qt,setIsImageUploaded:$t}),P===eo&&(0,l.jsx)(l.Fragment,{})]})]})]}),ce&&!i.isUploadVisible&&(0,l.jsx)(`div`,{style:{position:`fixed`,inset:0,zIndex:1500,backgroundColor:`rgba(255, 255, 255, 0.5)`,pointerEvents:`all`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,l.jsx)(u.Spin,{size:`large`})}),(0,l.jsx)(Tf,{isModalVisible:D,handleModalOk:be,handleModalCancel:xe,form:x,selectedFolder:Ge||null,folders:he||[],isUrlModalVisible:O,setIsUrlModalVisible:e=>F?.(e),handleAddFileByUrl:bt,urlForm:S,isRenameModalVisible:Ee,handleRenameOk:()=>Fe?.(),handleRenameCancel:()=>Pe?.(),renameForm:C,fileToRename:De,files:we||[],isMoveModalVisible:k,handleMoveOk:_t,handleMoveCancel:Re,moveForm:w,selectedFiles:fe||new Set,isRenameFolderModalVisible:A,handleRenameFolderOk:un,handleRenameFolderCancel:Et,renameFolderForm:T,folderToRename:N,isCopyModalVisible:j,handleCopyOk:vt,handleCopyCancel:Ve,copyForm:E,isDeleteConfirmVisible:M,handleDeleteConfirmOk:pt,handleDeleteConfirmCancel:()=>Ue?.(),isClearTrashConfirmVisible:ue,handleClearTrashConfirm:ht,handleClearTrashCancel:gt,fetchChildFolders:ve}),(0,l.jsx)(rR,{visible:it.isPixieEditorVisible,onClose:it.handlePixieEditorClose,file:it.editingFile,onSave:it.handlePixieEditorSave,onSaveCopy:it.handlePixieEditorSaveCopy}),(0,l.jsx)(MR,{files:i.uploadFiles,visible:i.isUploadVisible,minimized:i.isUploadMinimized,totalFiles:i.totalFiles,completedFiles:i.completedFiles,onClose:i.closeUpload,onMinimize:i.minimizeUpload,onInsert:e=>{var t;let n=i.getUploadedFile(e.id)||e;(t=p.onEditorOk)==null||t.call(p,n)}})]})})]})},dz=(0,s.memo)(({config:e={},onPathChange:t,onChangeSelection:n,onEditorOk:r,searchQuery:i=``,sortBySize:a=`name`,apiEndpoints:o={},customIcons:c,dragDropIcon:d,dataProviders:f,handleNotify:p,handleError:m,handleSuccess:h})=>{let g=s.default.useMemo(()=>Object.assign({folderTreeLoading:`lazy`,expandAllFoldersOnInit:!1,expandRootFolderOnInit:!1,iconStrokeWidth:1.4,availableImageExtensions:[`jpg`,`jpeg`,`png`,`gif`],fileNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),e.fileNameProcessing),folderNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),e.folderNameProcessing)},e),[e]);s.default.useEffect(()=>{g.theme&&(e=>{if(e===`system`){let t=matchMedia(ao).matches?ro:no;e=e===io?t:e}document.documentElement.setAttribute(`data-theme`,e)})(g.theme),iz(g)},[g]),(0,s.useEffect)(()=>{g.locale&&g.locale!==U.language&&U.changeLanguage(g.locale),g.customLocale&&g.locale&&U.addResourceBundle(g.locale,`translation`,g.customLocale,!0,!0)},[g.locale,g.customLocale]);let _=(0,s.useRef)(null);return(0,l.jsx)(u.App,{className:`em-filemanager`,children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.ConfigProvider,{getPopupContainer:()=>_.current||document.body,children:(0,l.jsx)(bl,{options:s.default.useMemo(()=>({apiEndpoints:o,searchQuery:i,sortBySize:a,onPathChange:t,onChangeSelection:n,onEditorOk:r,config:g,customIcons:c,dragDropIcon:d,dataProviders:f,handleNotify:p,handleError:m,handleSuccess:h}),[o,i,a,t,n,r,g,c,d,f,p,m,h]),children:(0,l.jsx)(uz,{})})}),(0,l.jsx)(`div`,{ref:_,className:`file-manager-modal-root`})]})})});dz.displayName=`FileManagerApp`;var fz=e=>(0,l.jsx)(qs,{i18n:U,children:(0,l.jsx)(mo,{externalTheme:e.config?.theme??`light`,customThemeToken:e.config?.customTheme,children:(0,l.jsx)(yi,{children:(0,l.jsx)(dz,Object.assign({},e))})})}),pz=e=>{let{onClose:t,onSave:n,dataProviders:r,theme:i,locale:a,hasPagination:o,disablePagination:c,paginationAvailable:d,dedupeUploadNamesOnClient:f,saveCopyToCurrentFolder:p}=e,m=s.default.useMemo(()=>({theme:i??`light`,locale:a,baseUrl:e.baseUrl,assetsUrl:e.assetsUrl,compressMaxSize:e.compressMaxSize,compressMaxWidthOrHeight:e.compressMaxWidthOrHeight,compessorUrl:e.compessorUrl??e.compressorUrl,compressorUrl:e.compressorUrl??e.compessorUrl,showNotifications:e.showNotifications,fetchWithProxy:e.fetchWithProxy,handleFileProxy:e.handleFileProxy,hasPagination:o,disablePagination:c,paginationAvailable:d,dedupeUploadNamesOnClient:f,saveCopyToCurrentFolder:p}),[i,a,e.baseUrl,e.assetsUrl,e.compressMaxSize,e.compressMaxWidthOrHeight,e.compessorUrl,e.compressorUrl,e.showNotifications,e.fetchWithProxy,e.handleFileProxy,o,c,d,f,p]),h=s.default.useCallback(async(e,t,n,i)=>{if(!e&&!t||!r?.getFiles)return null;try{let[a]=(await r.getFiles({folderId:i?void 0:n??void 0,noFolder:i,search:t||void 0,itemType:`file`,page:1,limit:1})).files;return a?e&&a.id!==e?null:a:null}catch{return null}},[r]),g=s.default.useMemo(()=>{if(e.file)return e.file;let t=e.name||`edited-image`,n=e.extension||(e.type?e.type.split(`/`)[1]:`png`),r=e.type||`image/${n}`;return{thumbnail:e.imageDataUrl||``,name:t,id:void 0,type:r,extension:n,saveWithoutFolder:!0}},[e.file,e.imageDataUrl,e.name,e.extension,e.type]),_=s.default.useCallback(async(e,t)=>{if(r?.updateFile&&e.thumbnail)try{let n=t?.mimeType||yo(e.thumbnail,e.type),i=bo(n),a=e.name.substring(0,e.name.lastIndexOf(`.`))+`.`+i,o=t?.blob||Eo(e.thumbnail,n);return await r.updateFile(e.id,{name:a,type:n,data:o})}catch{return null}return null},[r]),v=s.default.useCallback(async(e,t)=>{if(!e.thumbnail)return null;try{let n=!0!==m.saveCopyToCurrentFolder||(e.saveWithoutFolder??!e.id),i=n?``:e.folderId||``,a=t?.mimeType||yo(e.thumbnail,e.type),o=t?.blob||Eo(e.thumbnail,a),s=await _c(r,Lo(e.name,m),i,n,zo(m)),c=new File([o],s,{type:a,lastModified:Date.now()});if(r?.uploadFiles){let t=await r.uploadFiles({items:[{name:c.name,size:c.size,type:c.type,folderId:i,noFolder:n,data:c,extension:bo(a)}],folderId:i}),o=t.detailed?.[0];if(t.success&&o?.success&&o.data){let t=o.data;return t.url||t.thumbnailUrl||t.thumbnail?{id:t.id||e.id||``,name:t.name||e.name,folderId:t.folderId??i,type:t.type||c.type,size:t.size??c.size,extension:t.extension||bo(a),url:t.url,thumbnailUrl:t.thumbnailUrl,thumbnail:t.thumbnail,date:t.date,dimensions:t.dimensions,aspectRatio:t.aspectRatio,sourceUrl:t.sourceUrl,isFolder:!1,selected:!1}:await h(o.data.id,o.data.name||c.name,o.data.folderId??i,n)||{id:o.data.id||e.id||``,name:o.data.name||e.name,folderId:o.data.folderId??i,type:c.type,size:c.size,extension:bo(a),url:o.data.url,thumbnailUrl:o.data.thumbnailUrl,thumbnail:o.data.thumbnail,isFolder:!1,selected:!1}}}return r?.uploadFile?await r.uploadFile({name:c.name,size:c.size,type:c.type,folderId:i,noFolder:n,data:c,extension:bo(a)}):null}catch{return null}},[r,h,m]),y=s.default.useCallback(async(e,i)=>{if(r?.updateFile&&e.id&&e.thumbnail)try{let t=await _(e,i);t&&(e=t)}catch{}return n&&await n(e,i),t&&t(),e},[r,n,t,_]),b=s.default.useCallback(async(e,r)=>{let i=e;if(e.thumbnail)try{let t=await v(e,r);t&&(i=t)}catch{}return n&&await n(i,r),t&&t(),i},[t,n,v]),x=(0,s.useRef)(null);return(0,s.useEffect)(()=>{a&&a!==U.language&&U.changeLanguage(a)},[a]),(0,l.jsx)(u.App,{className:`em-filemanager`,children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.ConfigProvider,{getPopupContainer:()=>x.current||document.body,children:(0,l.jsx)(qs,{i18n:U,children:(0,l.jsx)(mo,{externalTheme:i??`light`,children:(0,l.jsx)(yi,{children:(0,l.jsx)(bl,{options:{dataProviders:r,handleNotify:e.handleNotify,handleError:e.handleError,handleSuccess:e.handleSuccess,config:m},children:(0,l.jsx)(rR,{visible:!0,onClose:t,file:g,onSave:y,onSaveCopy:b})})})})})}),(0,l.jsx)(`div`,{ref:x,className:`file-manager-modal-root`})]})})};Object.defineProperty(t,"C",{enumerable:!0,get:function(){return Ks}}),Object.defineProperty(t,"D",{enumerable:!0,get:function(){return ks}}),Object.defineProperty(t,"E",{enumerable:!0,get:function(){return fz}}),Object.defineProperty(t,"O",{enumerable:!0,get:function(){return v}}),Object.defineProperty(t,"S",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(t,"T",{enumerable:!0,get:function(){return Ql}}),Object.defineProperty(t,"_",{enumerable:!0,get:function(){return zu}}),Object.defineProperty(t,"a",{enumerable:!0,get:function(){return _c}}),Object.defineProperty(t,"b",{enumerable:!0,get:function(){return Xl}}),Object.defineProperty(t,"c",{enumerable:!0,get:function(){return xf}}),Object.defineProperty(t,"d",{enumerable:!0,get:function(){return bc}}),Object.defineProperty(t,"f",{enumerable:!0,get:function(){return yf}}),Object.defineProperty(t,"g",{enumerable:!0,get:function(){return Il}}),Object.defineProperty(t,"h",{enumerable:!0,get:function(){return Lo}}),Object.defineProperty(t,"i",{enumerable:!0,get:function(){return Ic}}),Object.defineProperty(t,"l",{enumerable:!0,get:function(){return xl}}),Object.defineProperty(t,"m",{enumerable:!0,get:function(){return Al}}),Object.defineProperty(t,"n",{enumerable:!0,get:function(){return El}}),Object.defineProperty(t,"o",{enumerable:!0,get:function(){return Ru}}),Object.defineProperty(t,"p",{enumerable:!0,get:function(){return yl}}),Object.defineProperty(t,"r",{enumerable:!0,get:function(){return RR}}),Object.defineProperty(t,"s",{enumerable:!0,get:function(){return Cf}}),Object.defineProperty(t,"t",{enumerable:!0,get:function(){return Nd}}),Object.defineProperty(t,"u",{enumerable:!0,get:function(){return Tc}}),Object.defineProperty(t,"v",{enumerable:!0,get:function(){return Zu}}),Object.defineProperty(t,"w",{enumerable:!0,get:function(){return Uu}}),Object.defineProperty(t,"x",{enumerable:!0,get:function(){return Fc}}),Object.defineProperty(t,"y",{enumerable:!0,get:function(){return pz}})});