diff --git a/blueprint-popover2.css.map b/blueprint-popover2.css.map new file mode 100644 index 0000000..e69de29 diff --git a/javascript/lazyload/canvas-editor.js b/javascript/lazyload/canvas-editor.js index 2de8432..7bd8425 100644 --- a/javascript/lazyload/canvas-editor.js +++ b/javascript/lazyload/canvas-editor.js @@ -1,4 +1,4 @@ -console.log('[3D Model Loader] loading...'); +console.log('[Canvas Editor] loading...'); async function _import() { if (!globalThis.canvasEditor || !globalThis.canvasEditor.import) { @@ -10,6 +10,8 @@ async function _import() { await _import(); +let _r = 0; + (async function () { const container = gradioApp().querySelector('#canvas-editor-container'); @@ -19,6 +21,21 @@ await _import(); const apiKey = gradioApp().querySelector('#canvas-editor-polotno-api-key'); const apiKeyValue = apiKey.value; + setLoadMoreFunc(py2js); + + const txt2ImgFilePaths = await py2js('getImgFilePaths', '{"type":"txt2img", "num":1, "size":15}'); + const img2ImgFilePaths = await py2js('getImgFilePaths', '{"type":"img2img", "num":1, "size":15}'); + + const txt2ImgFilePathsJsonData = JSON.parse(txt2ImgFilePaths); + const img2ImgFilePathsJsonData = JSON.parse(img2ImgFilePaths); + + function to_gradio(v) { + return [v, _r++]; + } + + setTxt2imgInfoJSON(txt2ImgFilePathsJsonData); + setImg2imgInfoJSON(img2ImgFilePathsJsonData); + createPolotnoApp({ key: apiKeyValue, container: container @@ -28,16 +45,16 @@ await _import(); function dataURLtoFile(dataurl, filename) { var arr = dataurl.split(','), - mime = arr[0].match(/:(.*?);/)[1], - bstr = atob(arr[1]), - n = bstr.length, - u8arr = new Uint8Array(n); + mime = arr[0].match(/:(.*?);/)[1], + bstr = atob(arr[1]), + n = bstr.length, + u8arr = new Uint8Array(n); - while(n--){ + while (n--) { u8arr[n] = bstr.charCodeAt(n); } - return new File([u8arr], filename, {type:mime}); + return new File([u8arr], filename, {type: mime}); } window.sendImageCanvasEditor = async function (type) { @@ -63,17 +80,17 @@ await _import(); updateGradioImage(imageElems[0], dt); } - function getCanvasEditorTabIndex(){ + function getCanvasEditorTabIndex() { const tabCanvasEditorDiv = document.getElementById('tab_canvas_editor'); const parent = tabCanvasEditorDiv.parentNode; const siblings = parent.childNodes; let index = -1; for (let i = 0; i < siblings.length; i++) { - if (siblings[i] === tabCanvasEditorDiv) { - index = i; - break; - } + if (siblings[i] === tabCanvasEditorDiv) { + index = i; + break; + } } return index / 3; @@ -88,7 +105,7 @@ await _import(); } window.sendImageToCanvasEditor = function () { - const gallerySelector = isTxt2Img()? '#txt2img_gallery': '#img2img_gallery'; + const gallerySelector = isTxt2Img() ? '#txt2img_gallery' : '#img2img_gallery'; const txt2imgGallery = gradioApp().querySelector(gallerySelector); @@ -115,8 +132,7 @@ await _import(); removable: true, resizable: true, }); - } - else { + } else { alert("No image selected"); } } @@ -198,7 +214,7 @@ await _import(); }; - function updateGradioImage (element, dt) { + function updateGradioImage(element, dt) { let clearButton = element.querySelector("button[aria-label='Clear']"); if (clearButton) { @@ -215,4 +231,51 @@ await _import(); }) ) } + + function py2js(pyname, ...args) { + // call python's function + // (1) Set args to gradio's field + // (2) Click gradio's button + // (3) JS callback will be kicked with return value from gradio + + // (1) + return (args.length === 0 ? Promise.resolve() : js2py(pyname + '_args', JSON.stringify(args))) + .then(() => { + return new Promise(resolve => { + const callback_name = `canvas-editor-${pyname}`; + // (3) + globalThis[callback_name] = value => { + delete globalThis[callback_name]; + resolve(value); + } + // (2) + gradioApp().querySelector(`#${callback_name}_get`).click(); + }); + }); + } + + + function js2py(gradio_field, value) { + return new Promise(resolve => { + const callback_name = `canvas-editor-${gradio_field}`; + + // (2) + globalThis[callback_name] = () => { + + delete globalThis[callback_name]; + + // (3) + const callback_after = callback_name + '_after'; + globalThis[callback_after] = () => { + delete globalThis[callback_after]; + resolve(); + }; + + return to_gradio(value); + }; + + // (1) + gradioApp().querySelector(`#${callback_name}_set`).click(); + }); + } })(); \ No newline at end of file diff --git a/js/photos-panel.js b/js/photos-panel.js new file mode 100644 index 0000000..2cf6d36 --- /dev/null +++ b/js/photos-panel.js @@ -0,0 +1,134 @@ +"use strict"; +var __importDefault = this && this.__importDefault || function (e) { + return e && e.__esModule ? e : {default: e} +}; +Object.defineProperty(exports, "__esModule", {value: !0}), exports.ImagesGrid = void 0; +const react_1 = __importDefault(require("react")), styled_1 = __importDefault(require("../utils/styled")), + core_1 = require("@blueprintjs/core"), l10n_1 = require("../utils/l10n"), page_1 = require("../canvas/page"), + ImagesListContainer = (0, styled_1.default)("div", react_1.default.forwardRef)` + height: 100%; + overflow: auto; +`, ImagesRow = (0, styled_1.default)("div")` + width: 33%; + float: left; +`, ImgWrapDiv = (0, styled_1.default)("div")` + padding: 5px; + width: 100%; + &:hover .credit { + opacity: 1; + } + @media screen and (max-width: 500px) { + .credit { + opacity: 1; + } + } +`, ImgContainerDiv = (0, styled_1.default)("div")` + border-radius: 5px; + position: relative; + overflow: hidden; + box-shadow: ${e => e["data-shadowenabled"] ? "0 0 5px rgba(16, 22, 26, 0.3)" : ""}; +`, Img = (0, styled_1.default)("img")` + width: 100%; + cursor: pointer; + display: block; +`, CreditWrap = (0, styled_1.default)("div")` + position: absolute; + bottom: 0px; + left: 0px; + font-size: 10px; + padding: 3px; + padding-top: 10px; + text-align: center; + background: linear-gradient( + to bottom, + rgba(0, 0, 0, 0), + rgba(0, 0, 0, 0.4), + rgba(0, 0, 0, 0.6) + ); + width: 100%; + opacity: 0; + color: white; +`, NoResults = (0, styled_1.default)("p")` + text-align: center; + padding: 30px; +`, Image = ({ + url: e, + credit: t, + onSelect: r, + crossOrigin: a, + shadowEnabled: l, + itemHeight: o, + className: i, + onLoad: n + }) => { + const d = null == l || l; + return react_1.default.createElement(ImgWrapDiv, { + onClick: () => { + r() + }, className: "polotno-close-panel" + }, react_1.default.createElement(ImgContainerDiv, {"data-shadowenabled": d}, react_1.default.createElement(Img, { + className: i, + style: {height: null != o ? o : "auto"}, + src: e, + draggable: !0, + crossOrigin: a, + onDragStart: () => { + (0, page_1.registerNextDomDrop)((({x: e, y: t}, a) => { + r({x: e, y: t}, a) + })) + }, + onDragEnd: () => { + (0, page_1.registerNextDomDrop)(null) + }, + onLoad: n + }), t && react_1.default.createElement(CreditWrap, {className: "credit"}, t))) + }, ImagesGrid = ({ + images: e, + onSelect: t, + isLoading: r, + getPreview: a, + loadMore: l, + getCredit: o, + getImageClassName: i, + rowsNumber: n, + crossOrigin: d = "anonymous", + shadowEnabled: s, + itemHeight: c, + error: u + }) => { + const g = n || 2, m = react_1.default.useRef(null), p = []; + for (var f = 0; f < g; f++) p.push((e || []).filter(((e, t) => t % g === f))); + const _ = react_1.default.useRef(null), h = () => { + var t, a, o; + const i = (null === (t = m.current) || void 0 === t ? void 0 : t.scrollHeight) > (null === (a = m.current) || void 0 === a ? void 0 : a.offsetHeight) + 5, + n = e && e.length, + d = Array.from(null === (o = m.current) || void 0 === o ? void 0 : o.querySelectorAll("img")).every((e => e.complete)); + !i && l && !r && n && d && (_.current || (_.current = window.setTimeout((() => { + _.current = null, l && l() + }), 100))) + }, v = () => { + h() + }; + return react_1.default.useEffect((() => (h(), () => { + window.clearTimeout(_.current), _.current = null + })), [e && e.length, r]), react_1.default.createElement(ImagesListContainer, { + onScroll: e => { + const t = e.target.scrollHeight - e.target.scrollTop - e.target.offsetHeight; + l && !r && t < 200 && l() + }, ref: m + }, p.map(((e, l) => react_1.default.createElement(ImagesRow, { + key: l, + style: {width: 100 / g + "%"} + }, e.map((e => react_1.default.createElement(Image, { + url: a(e), + onSelect: (r, a) => t(e, r, a), + key: a(e), + credit: o && o(e), + crossOrigin: d, + shadowEnabled: s, + itemHeight: c, + className: i && i(e), + onLoad: v + }))), r && react_1.default.createElement("div", {style: {padding: "30px"}}, react_1.default.createElement(core_1.Spinner, null))))), !r && (!e || !e.length) && !u && react_1.default.createElement(NoResults, null, (0, l10n_1.t)("sidePanel.noResults")), u && react_1.default.createElement(NoResults, null, (0, l10n_1.t)("sidePanel.error"))) + }; +exports.ImagesGrid = ImagesGrid; \ No newline at end of file diff --git a/js/polotno.bundle.js b/js/polotno.bundle.js index 4d1240e..0425f9d 100644 --- a/js/polotno.bundle.js +++ b/js/polotno.bundle.js @@ -389,4 +389,4 @@ @media screen and (max-width: 500px) { display: none; } -`,h=[.1,.25,.5,.75,1,1.5,2,3];t.ZoomGroup=(0,s.observer)((({store:e})=>{const t=Math.max(2,e.scaleToFit),n=Math.min(.5,e.scaleToFit),r=e.scalen;return o.default.createElement(a.Navbar.Group,{align:a.Alignment.LEFT,style:{height:"35px"}},o.default.createElement(a.Button,{icon:"zoom-out",minimal:!0,onClick:()=>{e.setScale(e.scale/1.2)},disabled:!l}),o.default.createElement(i.Popover2,{content:o.default.createElement(a.Menu,{style:{minWidth:"80px"}},h.map((t=>o.default.createElement(a.MenuItem,{key:t,text:Math.round(100*t)+"%",onClick:async()=>{e.setScale(t)}}))),o.default.createElement(a.MenuItem,{text:(0,c.t)("scale.reset"),onClick:async()=>{e.setScale(e.scaleToFit)}}))},o.default.createElement(a.Button,{minimal:!0},Math.round(100*e.scale)+"%")),o.default.createElement(a.Button,{icon:"zoom-in",minimal:!0,onClick:()=>{e.setScale(1.2*e.scale)},disabled:!r}))})),t.ZoomButtons=(0,s.observer)((({store:e})=>o.default.createElement(u,null,o.default.createElement(a.Navbar,{style:{height:"35px",padding:"0 5px"}},o.default.createElement(t.ZoomGroup,{store:e}))))),t.default=t.ZoomButtons},9111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setAPI=t.iconscoutDownload=t.iconscoutList=t.svgapiDownload=t.svgapiList=t.unsplashDownload=t.unsplashList=t.textTemplateList=t.templateList=t.removeBackground=t.polotnoShapesList=t.getGoogleFontImage=t.getGoogleFontsListAPI=t.URLS=t.URL=t.API=void 0;const r=n(9202);t.API="https://api.polotno.dev/api",t.URL="https://api.polotno.dev";const o={},a=(e,t)=>{o[e]||(o[e]=!0,console.error(t))},i="API for iconscout is provided as a demonstration.\nFor production usage you have to use your own API endpoint.\nhttps://iconscout.com/developers, https://iconscout.com/legal/api-license-development-agreement\nhttps://polotno.dev/docs/server-api";t.URLS={unsplashList:({query:e,page:n=1})=>`${t.API}/get-unsplash?query=${e}&per_page=20&page=${n}&KEY=${(0,r.getKey)()}`,unsplashDownload:e=>`${t.API}/download-unsplash?id=${e}&KEY=${(0,r.getKey)()}`,svgapiList:({query:e,page:n=0})=>`${t.API}/get-svgapi?query=${e}&page=${n}&per_page=20&KEY=${(0,r.getKey)()}`,svgapiDownload:e=>`${t.API}/download-svgapi?path=${e}&KEY=${(0,r.getKey)()}`,iconscoutList:({query:e,page:n=1})=>(a("iconscout",i),`${t.API}/get-iconscout?query=${e}&page=${n}&KEY=${(0,r.getKey)()}`),iconscoutDownload:e=>(a("iconscout",i),`${t.API}/download-iconscout?uuid=${e}&KEY=${(0,r.getKey)()}`),templateList:({query:e,page:n=1,sizeQuery:o})=>`${t.API}/get-templates?${o}&query=${e}&per_page=30&page=${n}&KEY=${(0,r.getKey)()}`},t.getGoogleFontsListAPI=()=>`${t.API}/get-google-fonts?KEY=${(0,r.getKey)()}`,t.getGoogleFontImage=e=>{return`${t.URL}/google-fonts-previews/black/${n=e,n.replace(new RegExp(" ","g"),"-")}.png`;var n},t.polotnoShapesList=()=>`${t.API}/get-basic-shapes?KEY=${(0,r.getKey)()}`,t.removeBackground=()=>`${t.API}/remove-image-background?KEY=${(0,r.getKey)()}`,t.templateList=e=>t.URLS.templateList(e),t.textTemplateList=()=>`${t.API}/get-text-templates?KEY=${(0,r.getKey)()}`,t.unsplashList=e=>t.URLS.unsplashList(e),t.unsplashDownload=e=>t.URLS.unsplashDownload(e),t.svgapiList=e=>t.URLS.svgapiList(e),t.svgapiDownload=e=>t.URLS.svgapiDownload(e),t.iconscoutList=e=>t.URLS.iconscoutList(e),t.iconscoutDownload=e=>t.URLS.iconscoutDownload(e),t.setAPI=(e,n)=>{t.URLS[e]=n}},3021:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCrop=void 0,t.getCrop=function(e,t,n="scale"){const r=t.width/t.height;let o,a;r>=e.width/e.height?(o=e.width,a=e.width/r):(o=e.height*r,a=e.height);let i=0,l=0;return"left-top"===n?(i=0,l=0):"left-middle"===n?(i=0,l=(e.height-a)/2):"left-bottom"===n?(i=0,l=e.height-a):"center-top"===n?(i=(e.width-o)/2,l=0):"center-middle"===n?(i=(e.width-o)/2,l=(e.height-a)/2):"center-bottom"===n?(i=(e.width-o)/2,l=e.height-a):"right-top"===n?(i=e.width-o,l=0):"right-middle"===n?(i=e.width-o,l=(e.height-a)/2):"right-bottom"===n?(i=e.width-o,l=e.height-a):"scale"===n?(i=0,l=0,o=e.width,a=e.height):console.error(new Error("Unknown clip position property - "+n)),{cropX:i,cropY:l,cropWidth:o,cropHeight:a}}},2920:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqual=void 0,t.deepEqual=function(e,n){if(e===n)return!0;if("object"==typeof e&&null!=e&&"object"==typeof n&&null!=n){if(Object.keys(e).length!=Object.keys(n).length)return!1;for(var r in e){if(!n.hasOwnProperty(r))return!1;if(!(0,t.deepEqual)(e[r],n[r]))return!1}return!0}return!1}},55:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.downloadFile=void 0,t.downloadFile=async function(e,t){const n=await(await fetch(e)).blob(),r=document.createElement("a"),o=URL.createObjectURL(n);r.href=o,r.download=t,document.body.appendChild(r),r.click(),setTimeout((function(){document.body.removeChild(r),window.URL.revokeObjectURL(o)}),0)}},9926:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.localFileToURL=void 0,t.localFileToURL=async function(e){return new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)}))}},1922:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.setTextOverflow=t.setForceTextFit=t.useDownScaling=t.setDownScalingEnabled=t.useHtmlTextRender=t.useRemoveBackground=t.setTextVerticalResizeEnabled=t.flags=void 0;const i=a(n(8949));function l(e){t.flags.imageDownScalingEnabled=e}t.flags=i.observable({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize"}),t.setTextVerticalResizeEnabled=function(e){t.flags.textVerticalResizeEnabled=e},t.useRemoveBackground=function(e){t.flags.removeBackgroundEnabled=e},t.useHtmlTextRender=function(e){t.flags.htmlRenderEnabled=e},t.setDownScalingEnabled=l,t.useDownScaling=function(e){console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),l(e)},t.setForceTextFit=function(e){console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),t.flags.textOverflow="change-font-size"},t.setTextOverflow=function(e){t.flags.textOverflow=e}},2275:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.injectCustomFont=t.injectGoogleFont=t.loadFont=t.isFontLoaded=t.replaceGlobalFonts=t.removeGlobalFont=t.addGlobalFont=t.globalFonts=t.getFontsList=t.setGoogleFonts=t.isGoogleFontChanged=void 0;const i=a(n(8949)),l=n(1284);let s=i.observable(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]),c=i.observable({value:!1});t.isGoogleFontChanged=function(){return c.value},t.setGoogleFonts=function(e){"default"!==e?(c.value=!0,s.splice(0,s.length),s.push(...e)):c.value=!1},t.getFontsList=function(){return s},t.globalFonts=i.observable([]),t.addGlobalFont=function(e){t.globalFonts.push(e)},t.removeGlobalFont=function(e){const n=t.globalFonts.findIndex((t=>t.fontFamily===e));-1!==n&&t.globalFonts.splice(n,1)},t.replaceGlobalFonts=function(e){t.globalFonts.replace(e)};var u=document.createElement("canvas");function h(e,t="Arial"){var n=u.getContext("2d");return n.font=`normal 40px '${e}', ${t}`,n.measureText("Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1").width}const d={Arial:!0};t.isFontLoaded=e=>d[e],t.loadFont=async function(e){var t;if(d[e])return;const n=!!(null===(t=document.fonts)||void 0===t?void 0:t.load),r=h("Arial");if(n)try{if(await document.fonts.load(`16px '${e}'`),r!==h(e))return void(d[e]=!0)}catch(e){}const o=h("Times","Times"),a=h(e);for(let t=0;t<100;t++){const t=h(e,"Arial"),n=h(e,"Times");if(t!==a||t!==r||n!==o)return void(d[e]=!0);await new Promise((e=>setTimeout(e,60)))}console.warn(`Timeout for loading font "${e}". Looks like polotno can't load it. Is it a correct font family?`),(0,l.triggerLoadError)(`Timeout for loading font "${e}"`)};const f={};t.injectGoogleFont=function(e){if(f[e])return;const t=`https://fonts.googleapis.com/css?family=${e.replace(/ /g,"+")}`,n=document.createElement("link");n.type="text/css",n.href=t,n.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(n),f[e]=!0};const p={};t.injectCustomFont=function(e){const t=e.fontFamily;if(p[t])return;if(!e.url&&!e.styles)return;const n=document.createElement("style");n.type="text/css";const r=e.styles||(e.url?[{src:`url("${e.url}")`}]:[]);let o="";r.forEach((e=>{o+=`\n @font-face {\n font-family: '${t}';\n src: ${e.src};\n font-style: ${e.fontStyle||"normal"};\n font-weight: ${e.fontWeight||"normal"};\n }\n `})),n.innerHTML=o,document.getElementsByTagName("head")[0].appendChild(n),p[e.fontFamily]=!0}},3889:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.styled=t.setup=t.keyframes=t.glob=t.extractCss=t.css=void 0;let n={data:""},r=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||n,o=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,i=(e,t)=>{let n="",r="",o="";for(let a in e){let l=e[a];"@"==a[0]?"i"==a[1]?n=a+" "+l+";":r+="f"==a[1]?i(l,a):a+"{"+i(l,"k"==a[1]?"":t)+"}":"object"==typeof l?r+=i(l,t?t.replace(/([^,])+/g,(e=>a.replace(/(^:.*)|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):a):null!=l&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=i.p?i.p(a,l):a+":"+l+";")}return n+(t&&o?t+"{"+o+"}":o)+r},l={},s=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+s(e[n]);return t}return e},c=(e,t,n,r,c)=>{let u=s(e),h=l[u]||(l[u]=(e=>{let t=0,n=11;for(;t>>0;return"go"+n})(u));if(!l[h]){let t=u!==e?e:(e=>{let t,n=[{}];for(;t=o.exec(e.replace(a,""));)t[4]?n.shift():t[3]?n.unshift(n[0][t[3]]=n[0][t[3]]||{}):n[0][t[1]]=t[2];return n[0]})(e);l[h]=i(c?{["@keyframes "+h]:t}:t,n?"":"."+h)}return((e,t,n)=>{-1==t.data.indexOf(e)&&(t.data=n?e+t.data:t.data+e)})(l[h],t,r),h};function u(e){let t=this||{},n=e.call?e(t.p):e;return c(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let a=t[o];if(a&&a.call){let e=a(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?"."+t:e&&"object"==typeof e?e.props?"":i(e,""):!1===e?"":e}return e+r+(null==a?"":a)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,r(t.target),t.g,t.o,t.k)}t.extractCss=e=>{let t=r(e),n=t.data;return t.data="",n},t.css=u;let h,d,f,p=u.bind({g:1}),v=u.bind({k:1});t.glob=p,t.keyframes=v,t.setup=function(e,t,n,r){i.p=t,h=e,d=n,f=r},t.styled=function(e,t){let n=this||{};return function(){let r=arguments;function o(a,i){let l=Object.assign({},a),s=l.className||o.className;n.p=Object.assign({theme:d&&d()},l),n.o=/ *go\d+/.test(s),l.className=u.apply(n,r)+(s?" "+s:""),t&&(l.ref=i);let c=e;return e[0]&&(c=l.as||e,delete l.as),f&&c[0]&&f(l),h(c,l)}return t?t(o):o}}},9190:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseColor=t.isGradient=void 0;const o=r(n(9948));t.isGradient=e=>e.indexOf("linear-gradient")>=0;const a=e=>"hex"===e.type?"#"+e.value:"literal"===e.type?e.value:`${e.type}(${e.value.join(",")})`;t.parseColor=e=>{if(!(0,t.isGradient)(e))return{rotation:0,stops:[{offset:0,color:e},{offset:1,color:e}]};const n=o.default.parse(e)[0];return{rotation:parseFloat(n.orientation.value),stops:n.colorStops.map(((e,t)=>({color:a(e),offset:e.length?parseFloat(e.length.value)/100:t/(n.colorStops.length-1)})))}}},348:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.jsonToHTML=t.jsonToDOM=t.fixRatio=void 0;const i=n(9246),l=a(n(4824));async function s(e,t){const n=await u(e),r=document.createElement("canvas");r.width=2*n.width,r.height=2*n.height,r.getContext("2d").drawImage(n,0,0,r.width,r.height);const o=document.createElement("canvas");o.width=t.width,o.height=t.height;const a=o.getContext("2d");let{cropX:i,cropY:l}=t;const s=r.width*t.cropWidth,c=r.height*t.cropHeight,h=t.width/t.height;let d,f;const p=s/c;return"svg"===t.type?(d=s,f=c):h>=p?(d=s,f=s/h):(d=c*h,f=c),a.drawImage(r,i*r.width,l*r.height,d,f,0,0,o.width,o.height),o.toDataURL("image/png")}const c=(e,t,...n)=>({type:e,props:t,children:n||[]});t.fixRatio=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");return t.documentElement.setAttribute("preserveAspectRatio","none"),(new XMLSerializer).serializeToString(t)};const u=e=>new Promise((t=>{const n=new window.Image;n.onload=()=>{t(n)},n.src=e,n.crossOrigin="anonymous"})),h=async({element:e,page:t,store:n})=>{let{src:r}=e;if("svg"===e.type){const t=await l.urlToString(r);r=l.replaceColors(t,new Map(Object.entries(e.colorsReplace)))}r=await s(r,e);let o="";return e.flipX&&(o+="scaleX(-1)"),e.flipY&&(o+="scaleY(-1)"),c("img",{src:r,width:"100%",height:"100%",style:Object.assign(Object.assign({},{}),{"border-radius":e.cornerRadius+"px",border:e.borderSize?`${e.borderSize}px solid ${e.borderColor}`:"none",transform:o})})},d=({element:e,type:t})=>{const n={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",opacity:e.opacity};return"arrow"===t||"triangle"===t?c("polyline",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},n)):"bar"===t?c("polyline",Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},n)):"circle"===t?c("circle",Object.assign({r:e.height},n)):"square"===t?c("polyline",Object.assign({points:`${-e.height},${-e.height} ${-e.height},${e.height} ${e.height},${e.height} ${e.height},${-e.height}`},n)):null},f={image:h,svg:h,text:async({element:e,page:t,store:n})=>{let r={};e.fill.indexOf("gradient")>=0&&(r=Object.assign(Object.assign({},r),{"background-color":e.fill,"background-image":e.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}));const o=e.backgroundPadding*(e.fontSize*e.lineHeight),a=c("div",{style:{position:"absolute",top:-o/2+"px",left:-o/2+"px",display:e.backgroundEnabled?"block":"none",width:e.width+o+"px",height:e.height+o+"px","background-color":e.backgroundColor,"border-radius":e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}}),i=c("div",{style:Object.assign(Object.assign({},r),{position:"absolute",top:0,left:0,width:e.width+"px",color:e.fill,"white-space":"pre-wrap","font-size":e.fontSize+"px","text-align":e.align,"font-family":e.fontFamily,"text-decoration":e.textDecoration||"none","line-height":e.lineHeight,"letter-spacing":e.letterSpacing+"em","font-style":e.fontStyle,"font-weight":e.fontWeight,"-webkit-text-stroke":`${e.strokeWidth}px ${e.stroke}`,"text-stroke":`${e.strokeWidth}px ${e.stroke}`})},e.text.split("\n").join("
"));return c("div",{style:{position:"relative"}},a,i)},line:async({element:e,page:t,store:n})=>c("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},c("rect",{x:0,y:0,width:e.width,height:e.height,fill:e.color}),c("g",{transform:`translate(0 ${e.height/2})`},d({element:e,type:e.startHead})),c("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},d({element:e,type:e.endHead}))),group:async({element:e,page:t,store:n,elementHook:r})=>{const o=await Promise.all(e.children.map((e=>p({element:e,page:t,store:n,elementHook:r})))),a=c("div",{style:{"transform-origin":"top left",opacity:e.opacity}},...o);return r&&r({dom:a,element:e})||a}};async function p({element:e,page:t,store:n,elementHook:r}){let o=await f[e.type];o||(o=()=>c("div",{}),console.error(`HTML export does not support ${e.type} type...`));const a=await o({element:e,page:t,store:n}),i=[];e.blurEnabled&&i.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&i.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&i.push("sepia()"),e.grayscaleEnabled&&i.push("grayscale()"),e.shadowEnabled&&i.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`);const l=c("div",{style:{position:"absolute",left:e.x+"px",top:e.y+"px",width:e.width+"px",height:e.height+"px",transform:`rotate(${e.rotation}deg)`,"transform-origin":"top left",opacity:e.opacity,filter:i.join(" ")}},a);return r&&r({dom:l,element:e})||l}async function v({json:e,elementHook:t}){const n=await Promise.all(e.pages.map((n=>async function({page:e,store:t,elementHook:n}){const r=await Promise.all(e.children.map((r=>p({element:r,page:e,store:t,elementHook:n}))));let o={};if(e.background.indexOf("url")>=0||e.background.indexOf("http")>=0||e.background.indexOf(".jpg")>=0||e.background.indexOf(".png")>=0||e.background.indexOf(".jpeg")>=0){const n=await u(e.background),r=await s(e.background,Object.assign({width:t.width,height:t.height,x:0,y:0},(0,i.getCrop)({width:t.width,height:t.height},{width:n.width,height:n.height})));o=Object.assign(Object.assign({},o),{"background-image":`url(${r})`})}return c("div",{className:"page",style:Object.assign(Object.assign({},o),{width:t.width+"px",height:t.height+"px",background:e.background,border:"1px solid grey",overflow:"hidden",position:"relative"})},...r)}({page:n,store:e,elementHook:t})))),r=[];e.pages.forEach((e=>{e.children.forEach((e=>{"text"===e.type&&-1===r.indexOf(e.fontFamily)&&r.push(e.fontFamily)}))}));const o=r.map((t=>e.fonts.find((e=>e.fontFamily===t))?c("style",{},""):c("link",{href:`https://fonts.googleapis.com/css?family=${t}`,rel:"stylesheet"})));return c("div",{className:"design"},...o,...n)}t.jsonToDOM=v;const m=({dom:e})=>"string"==typeof e?e:e?`<${e.type} ${Object.keys(e.props).map((t=>((e,t)=>"object"==typeof t?`${e}="${Object.keys(t).map((e=>`${e}:${t[e]};`)).join(" ")}"`:`${e}="${t}"`)(t,e.props[t]))).join(" ")}>${e.children.map((e=>m({dom:e}))).join("")}`:"";t.jsonToHTML=async function({json:e,elementHook:t}){const n=await v({json:e,elementHook:t});return m({dom:n})}},2147:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToCanvas=t.detectSize=void 0;const i=a(n(8151)),l=document.createElement("div");l.id="polotno-hidden-do-not-touch",l.style.overflow="hidden",l.style.position="relative",document.body.appendChild(l),l.innerHTML="",t.detectSize=function(e){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000",l.appendChild(t);const n=t.getBoundingClientRect();return l.removeChild(t),{width:n.width,height:n.height}},t.htmlToCanvas=async function({html:e,width:t,height:n,fontFamily:r,padding:o,font:a,pixelRatio:l}){const s=document.createElement("canvas");"Arial"===r||a||(e+=``),a&&(e+=``),e+="\n\n";const c=await i.drawHTML(`
${e}
`,s,{width:t+2*o,height:n+2*o});s.width=(t+2*o)*l,s.height=(n+2*o)*l;const u=s.getContext("2d");return null==u||u.drawImage(c.image,0,0,c.image.width*l,c.image.height*l),s}},9246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCrop=t.getImageSize=void 0;const r=n(4824);t.getImageSize=function(e){return new Promise((t=>{const n=document.createElement("img");n.onload=async()=>{0===n.width||0===n.height?t(await(0,r.getSvgSize)(e)):t({width:n.width,height:n.height})},n.src=e}))},t.getCrop=function(e,t){const{width:n,height:r}=e,o=n/r;let a,i;o>=t.width/t.height?(a=t.width,i=t.width/o):(a=t.height*o,i=t.height);const l=(t.width-a)/2,s=(t.height-i)/2;return{cropX:l/t.width,cropY:s/t.height,cropWidth:a/t.width,cropHeight:i/t.height}}},3507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.getTranslations=t.setTranslations=void 0;const r=n(8949),o=(0,r.observable)({toolbar:{opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",removeClip:"Remove clip",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size"},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"}}),a=e=>e&&"object"==typeof e;function i(e,t){Object.keys(t).forEach((n=>{const r=e[n],o=t[n];a(o)&&a(r)?i(r,o):e[n]=o}))}t.setTranslations=(0,r.action)((e=>{i(o,e)})),t.getTranslations=()=>(0,r.toJS)(o);const l={};t.t=e=>{const t=function(e,t){var n,r=t.split("."),o=e;for(n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.triggerLoadError=t.onLoadError=t.whenLoaded=t.decrementLoader=t.incrementLoader=t.setAssetLoadTimeout=void 0;const r=n(8474);let o=0,a=[],i=3e4;function l(){o-=1,0===o&&(a.forEach((e=>e())),a=[])}t.setAssetLoadTimeout=e=>{i=e},t.incrementLoader=function(e){o+=1;let t=!1;Date.now();const n=setTimeout((()=>{t||(c(`Timeout loading image ${e}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",e),t=!0,l())}),i);return()=>{t||(clearTimeout(n),l())}},t.decrementLoader=l,t.whenLoaded=function(){return new Promise((e=>function(e){0===o?e():a.push(e)}((()=>{(0,r.isAnimationUsed)()?setTimeout(e,300):e(!0)}))))};let s=[];function c(e){s.forEach((t=>t(e)))}t.onLoadError=function(e){s.push(e)},t.triggerLoadError=c},240:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getTotalClientRect=t.getClientRect=void 0;const o=r(n(2107));function a(e,t,n,r,o){const a=Math.sqrt(n*n+r*r);return o+=Math.atan2(r,n),{x:e+a*Math.cos(o),y:t+a*Math.sin(o)}}function i(e){const{x:t,y:n,width:r,height:i}=e,l=o.default.Util.degToRad(e.rotation),s=a(t,n,0,0,l),c=a(t,n,r,0,l),u=a(t,n,r,i,l),h=a(t,n,0,i,l),d=Math.min(s.x,c.x,u.x,h.x),f=Math.min(s.y,c.y,u.y,h.y),p=Math.max(s.x,c.x,u.x,h.x),v=Math.max(s.y,c.y,u.y,h.y);return{x:d,y:f,width:p-d,height:v-f,minX:d,minY:f,maxX:p,maxY:v}}t.getClientRect=i,t.getTotalClientRect=function(e){const t=e.map((e=>i(e))),n=Math.min(...t.map((e=>e.minX))),r=Math.min(...t.map((e=>e.minY))),o=Math.max(...t.map((e=>e.maxX))),a=Math.max(...t.map((e=>e.maxY)));return{x:n,y:r,width:o-n,height:a-r,minX:n,minY:r,maxX:o,maxY:a}}},9675:(e,t)=>{"use strict";let n,r;async function o(e){return new Promise((t=>{var n=document.createElement("script");n.onload=function(){t(null)},n.src=e,document.head.appendChild(n)}))}Object.defineProperty(t,"__esModule",{value:!0}),t.getPdfKit=t.getJsPDF=void 0,t.getJsPDF=function(){return n?Promise.resolve(n):new Promise((e=>{var t=document.createElement("script");t.onload=function(){n=window.jspdf.jsPDF,e(n)},t.src="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js",document.head.appendChild(t)}))},t.getPdfKit=async function(){return r?Promise.resolve(r):(await o("https://unpkg.com/pdfkit@0.13.0/js/pdfkit.standalone.js"),await o("https://github.com/devongovett/blob-stream/releases/download/v0.1.3/blob-stream.js"),r=window.PDFDocument,r)}},4077:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useMobile=t.isMobile=t.MOBILE_BREAKPOINT=void 0;const o=r(n(7294));t.MOBILE_BREAKPOINT=500,t.isMobile=()=>window.innerWidth<=t.MOBILE_BREAKPOINT,t.useMobile=()=>{const[e,n]=o.default.useState((0,t.isMobile)());return o.default.useEffect((()=>{const e=()=>{n((0,t.isMobile)())};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),e}},8165:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(7294)),a=n(3889);(0,a.setup)(o.default.createElement),t.default=a.styled},4824:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useSvgColors=t.replaceColors=t.sameColors=t.fixSize=t.getSvgSize=t.svgToURL=t.getColors=t.urlToString=t.urlToBase64=void 0;const o=r(n(2107)),a=r(n(7294)),i=n(9190);function l(e){for(;e.parentNode;){if("defs"===e.nodeName)return!0;e=e.parentNode}return!1}function s(e){const t={fill:"",stroke:""};return e.getAttribute("fill")&&"none"!==e.getAttribute("fill")&&(t.fill=e.getAttribute("fill")),!t.fill&&e.style.fill&&"none"!==e.style.fill&&(t.fill=e.style.fill),e.getAttribute("stroke")&&(t.stroke=e.getAttribute("stroke")),!t.stroke&&e.style.stroke&&(t.stroke=e.style.stroke),t.stroke||t.fill||(t.fill="black"),t}const c=["path","rect","circle"];function u(e){for(var t=[],n=e.getElementsByTagName("*"),r=0,o=n.length;r=0)&&t.push(e))}return t}async function h(e){const t=await fetch(e,{mode:"cors"});return await t.text()}function d(e){const t=u((new DOMParser).parseFromString(e,"image/svg+xml")),n=[];return t.forEach((e=>{const{fill:t,stroke:r}=s(e);[t,r].forEach((e=>{e&&o.default.Util.colorToRGBA(e)&&-1===n.indexOf(e)&&n.push(e)}))})),n}function f(e){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(e)))}t.urlToBase64=async function(e){const t=await fetch(e);return f(await t.text())},t.urlToString=h,t.getColors=d,t.svgToURL=f,t.getSvgSize=async function(e){const t=await h(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement.getAttribute("viewBox"),[r,o,a,i]=(null==n?void 0:n.split(" "))||[];return{width:parseFloat(a),height:parseFloat(i)}},t.fixSize=function(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml");const n=t.documentElement.getAttribute("viewBox"),[r,o,a,i]=(null==n?void 0:n.split(" "))||[],l=t.documentElement.getAttribute("width");!l&&t.documentElement.setAttribute("width",a+"px");const s=t.documentElement.getAttribute("height");if((!s||s.indexOf("%")>=0)&&t.documentElement.setAttribute("height",i+"px"),l&&l.indexOf("%")>=0&&s&&-1===s.indexOf("%")){const e=parseFloat(s)/parseFloat(i);t.documentElement.setAttribute("width",e*parseFloat(a)+"px")}if(s&&s.indexOf("%")>=0&&l&&-1===l.indexOf("%")){const e=parseFloat(l)/parseFloat(a);t.documentElement.setAttribute("height",e*parseFloat(i)+"px")}return(new XMLSerializer).serializeToString(t)},t.sameColors=(e,t)=>{if(!e||!t)return!1;const n=o.default.Util.colorToRGBA(e),r=o.default.Util.colorToRGBA(t);return n&&r?n.r===r.r&&n.g===r.g&&n.b===r.b&&n.a===r.a:void 0},t.replaceColors=function(e,n){var r=(new DOMParser).parseFromString(e,"image/svg+xml");const a=u(r),l=Array.from(n.keys());return a.forEach((e=>{const{fill:a,stroke:c}=s(e);[{prop:"fill",color:a},{prop:"stroke",color:c}].forEach((({prop:a,color:s})=>{const c=l.find((e=>(0,t.sameColors)(e,s)));if(c){const t=n.get(c);if((0,i.isGradient)(t)){const{rotation:n,stops:l}=(0,i.parseColor)(t),s=l.map((e=>({offset:100*e.offset+"%","stop-color":e.color}))),c="color"+Math.round(1e8*Math.random());(function(e,t,n,r){var a=e.namespaceURI,i=document.createElementNS(a,"linearGradient");const l=o.default.Util.degToRad(n+90),s=(Math.cos(l)+1)/2,c=(Math.sin(l)+1)/2,u=(Math.cos(l+Math.PI)+1)/2,h=(Math.sin(l+Math.PI)+1)/2;i.setAttribute("x1",100*s+"%"),i.setAttribute("y1",100*c+"%"),i.setAttribute("x2",100*u+"%"),i.setAttribute("y2",100*h+"%"),i.setAttribute("gradientUnits","userSpaceOnUse"),i.setAttribute("id",t);for(var d=0;d{const[t,n]=a.default.useState([]);return a.default.useEffect((()=>{let t=!1;return(async()=>{n([]);const r=d(await h(e));t||n(r)})(),()=>{t=!0}}),[e]),t}},7415:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTags=void 0,t.removeTags=function(e=""){return(e=e.replace(/<\/p>/gi,"\n")).replace(/(<([^>]+)>)/gi,"")}},6392:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pxToUnitString=t.unitToPx=t.pxToUnitRounded=t.pxToUnit=void 0,t.pxToUnit=({px:e,unit:t="px",dpi:n})=>{switch(t){case"pt":default:return e;case"mm":return e/(n/25.4);case"cm":return e/(n/2.54);case"in":return e/n}},t.pxToUnitRounded=({px:e,precious:n=2,dpi:r=72,unit:o="px"})=>parseFloat((0,t.pxToUnit)({px:e,dpi:r,unit:o}).toFixed(n)),t.unitToPx=({unitVal:e,dpi:n,unit:r})=>e/(0,t.pxToUnit)({px:1,unit:r,dpi:n}),t.pxToUnitString=e=>{const n=parseFloat((0,t.pxToUnit)(e).toFixed(1));switch(e.unit){case"pt":return`${Math.round(n)}pt`;case"mm":return`${n}mm`;case"cm":return`${n}cm`;case"in":return`${n}in`;default:return`${Math.round(n)}px`}}},5609:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useInfiniteAPI=t.fetcher=void 0;const o=r(n(7294)),a=r(n(9050));t.fetcher=e=>fetch(e).then((e=>e.json())),t.useInfiniteAPI=({defaultQuery:e="",timeout:n=100,getAPI:r,getSize:i=(e=>e.total_pages)})=>{var l;const s=o.default.useRef(e),c=o.default.useRef(),{data:u,error:h,size:d,setSize:f,mutate:p}=(0,a.default)((e=>r({query:s.current,page:e+1})),t.fetcher,{revalidateAll:!1}),v=!u&&!h||!!(d>0&&u&&void 0===u[d-1]),m=0===(null===(l=null==u?void 0:u[0])||void 0===l?void 0:l.length)||u&&u[0]&&i(u[0])===d;return{setQuery:o.default.useCallback((e=>{s.current=e,clearTimeout(c.current),c.current=setTimeout((()=>{p()}),n)}),[n]),isLoading:v,loadMore:()=>{m||f(d+1)},isReachingEnd:m,data:null==u?void 0:u.filter((e=>e)),items:null==u?void 0:u.reduce(((e,t)=>e.concat(t)),[]),hasMore:!m,reset:p,error:h}}},9202:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.validateKey=t.isKeyPaid=t.getKey=t.shouldShowCredit=void 0;const i=a(n(8949)),l=n(9111),s=n(1922);t.shouldShowCredit=i.observable({value:!1});const c=i.action((()=>{t.shouldShowCredit.value=!0}));let u="";t.getKey=()=>u||"";let h=window.location.origin;const d=navigator.userAgent.indexOf("Headless")>-1,f=navigator.userAgent.indexOf("Electron")>-1;"file://"===h&&d&&(h="headless"),"file://"===h&&f&&(h="electron");const p=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${h}" here: https://polotno.dev/cabinet`;async function v(e){for(let t=0;t<5;t++)try{const t=await fetch(l.API+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host+location.pathname})});if(!e)return console.warn("Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.dev/cabinet"),!1;if(200!==t.status){await new Promise((e=>setTimeout(e,3e3)));continue}const n=await t.json();return n.is_valid||console.warn("Polotno API key is not valid. Please get new API key here: https://polotno.dev/cabinet"),n.is_paid||console.log("%cPolotno Free Version. Development or non-commercial usage only. https://polotno.dev/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),n.is_domain_valid||console.log(p,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),(0,s.useRemoveBackground)(n.remove_background_enabled),n.is_paid||!1}catch(e){await new Promise((e=>setTimeout(e,3e3)))}return console.error("Can not validate Polotno API key. Please report to anton@polotno.dev immediately."),!0}t.isKeyPaid=v,t.validateKey=async function(e,t){u=e,await v(e)&&!t||c()}},3550:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.waitTillAvailable=void 0,t.waitTillAvailable=async function(e){for(let t=0;t<30;t++){const t=await e();if(t)return t;await new Promise((e=>setTimeout(e,50)))}}},2703:(e,t,n)=>{"use strict";var r=n(414);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2587:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,o){n=n||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var i=/\+/g;e=e.split(n);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var s=e.length;l>0&&s>l&&(s=l);for(var c=0;c=0?(u=p.substr(0,v),h=p.substr(v+1)):(u=p,h=""),d=decodeURIComponent(u),f=decodeURIComponent(h),t(a,d)?Array.isArray(a[d])?a[d].push(f):a[d]=[a[d],f]:a[d]=f}return a}},2361:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,o){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(o){var a=encodeURIComponent(t(o))+r;return Array.isArray(e[o])?e[o].map((function(e){return a+encodeURIComponent(t(e))})).join(n):a+encodeURIComponent(t(e[o]))})).join(n):o?encodeURIComponent(t(o))+r+encodeURIComponent(t(e)):""}},7673:(e,t,n)=>{"use strict";t.decode=t.parse=n(2587),t.encode=t.stringify=n(2361)},6095:function(e){var t;"undefined"!=typeof self&&self,t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=109)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17),o=n(18),a=n(19),i=n(45),l=n(46),s=n(47),c=n(48),u=n(49),h=n(12),d=n(32),f=n(33),p=n(31),v=n(1),m={Scope:v.Scope,create:v.create,find:v.find,query:v.query,register:v.register,Container:r.default,Format:o.default,Leaf:a.default,Embed:c.default,Scroll:i.default,Block:s.default,Inline:l.default,Text:u.default,Attributor:{Attribute:h.default,Class:d.default,Style:f.default,Store:p.default}};t.default=m},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){var n=this;return t="[Parchment] "+t,(n=e.call(this,t)||this).message=t,n.name=n.constructor.name,n}return o(t,e),t}(Error);t.ParchmentError=a;var i,l={},s={},c={},u={};function h(e,t){var n;if(void 0===t&&(t=i.ANY),"string"==typeof e)n=u[e]||l[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)n=u.text;else if("number"==typeof e)e&i.LEVEL&i.BLOCK?n=u.block:e&i.LEVEL&i.INLINE&&(n=u.inline);else if(e instanceof HTMLElement){var r=(e.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=s[r[o]])break;n=n||c[e.tagName]}return null==n?null:t&i.LEVEL&n.scope&&t&i.TYPE&n.scope?n:null}t.DATA_KEY="__blot",function(e){e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY"}(i=t.Scope||(t.Scope={})),t.create=function(e,t){var n=h(e);if(null==n)throw new a("Unable to create "+e+" blot");var r=n,o=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:r.create(t);return new r(o,t)},t.find=function e(n,r){return void 0===r&&(r=!1),null==n?null:null!=n[t.DATA_KEY]?n[t.DATA_KEY].blot:r?e(n.parentNode,r):null},t.query=h,t.register=function e(){for(var t=[],n=0;n1)return t.map((function(t){return e(t)}));var r=t[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new a("Invalid definition");if("abstract"===r.blotName)throw new a("Cannot register abstract class");return u[r.blotName||r.attrName]=r,"string"==typeof r.keyName?l[r.keyName]=r:(null!=r.className&&(s[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map((function(e){return e.toUpperCase()})):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach((function(e){null!=c[e]&&null!=r.className||(c[e]=r)})))),r}},function(e,t,n){var r=n(51),o=n(11),a=n(3),i=n(20),l=String.fromCharCode(0),s=function(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]};s.prototype.insert=function(e,t){var n={};return 0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},s.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},s.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},s.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=a(!0,{},e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,"object"!=typeof(n=this.ops[t-1])))return this.ops.unshift(e),this;if(o(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},s.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},s.prototype.filter=function(e){return this.ops.filter(e)},s.prototype.forEach=function(e){this.ops.forEach(e)},s.prototype.map=function(e){return this.ops.map(e)},s.prototype.partition=function(e){var t=[],n=[];return this.forEach((function(r){(e(r)?t:n).push(r)})),[t,n]},s.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},s.prototype.changeLength=function(){return this.reduce((function(e,t){return t.insert?e+i.length(t):t.delete?e-t.delete:e}),0)},s.prototype.length=function(){return this.reduce((function(e,t){return e+i.length(t)}),0)},s.prototype.slice=function(e,t){e=e||0,"number"!=typeof t&&(t=1/0);for(var n=[],r=i.iterator(this.ops),o=0;o0&&n.next(a.retain-l)}for(var c=new s(r);t.hasNext()||n.hasNext();)if("insert"===n.peekType())c.push(n.next());else if("delete"===t.peekType())c.push(t.next());else{var u=Math.min(t.peekLength(),n.peekLength()),h=t.next(u),d=n.next(u);if("number"==typeof d.retain){var f={};"number"==typeof h.retain?f.retain=u:f.insert=h.insert;var p=i.attributes.compose(h.attributes,d.attributes,"number"==typeof h.retain);if(p&&(f.attributes=p),c.push(f),!n.hasNext()&&o(c.ops[c.ops.length-1],f)){var v=new s(t.rest());return c.concat(v).chop()}}else"number"==typeof d.delete&&"number"==typeof h.retain&&c.push(d)}return c.chop()},s.prototype.concat=function(e){var t=new s(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t},s.prototype.diff=function(e,t){if(this.ops===e.ops)return new s;var n=[this,e].map((function(t){return t.map((function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:l;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")})).join("")})),a=new s,c=r(n[0],n[1],t),u=i.iterator(this.ops),h=i.iterator(e.ops);return c.forEach((function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case r.INSERT:n=Math.min(h.peekLength(),t),a.push(h.next(n));break;case r.DELETE:n=Math.min(t,u.peekLength()),u.next(n),a.delete(n);break;case r.EQUAL:n=Math.min(u.peekLength(),h.peekLength(),t);var l=u.next(n),s=h.next(n);o(l.insert,s.insert)?a.retain(n,i.attributes.diff(l.attributes,s.attributes)):a.push(s).delete(n)}t-=n}})),a.chop()},s.prototype.eachLine=function(e,t){t=t||"\n";for(var n=i.iterator(this.ops),r=new s,o=0;n.hasNext();){if("insert"!==n.peekType())return;var a=n.peek(),l=i.length(a)-n.peekLength(),c="string"==typeof a.insert?a.insert.indexOf(t,l)-l:-1;if(c<0)r.push(n.next());else if(c>0)r.push(n.next(c));else{if(!1===e(r,n.next(1).attributes||{},o))return;o+=1,r=new s}}r.length()>0&&e(r,{},o)},s.prototype.transform=function(e,t){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);for(var n=i.iterator(this.ops),r=i.iterator(e.ops),o=new s;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!t&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var a=Math.min(n.peekLength(),r.peekLength()),l=n.next(a),c=r.next(a);if(l.delete)continue;c.delete?o.push(c):o.retain(a,i.attributes.transform(l.attributes,c.attributes,t))}else o.retain(i.length(n.next()));return o.chop()},s.prototype.transformPosition=function(e,t){t=!!t;for(var n=i.iterator(this.ops),r=0;n.hasNext()&&r<=e;){var o=n.peekLength(),a=n.peekType();n.next(),"delete"!==a?("insert"===a&&(r0&&(e1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===e||e>=this.length()-1)){var r=this.clone();return 0===e?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var a=o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"split",this).call(this,e,n);return this.cache={},a}}]),t}(l.default.Block);function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==e?t:("function"==typeof e.formats&&(t=(0,a.default)(t,e.formats())),null==e.parent||"scroll"==e.parent.blotName||e.parent.statics.scope!==e.statics.scope?t:g(e.parent,t))}m.blotName="block",m.tagName="P",m.defaultChild="break",m.allowedChildren=[c.default,l.default.Embed,u.default],t.bubbleFormats=g,t.BlockEmbed=v,t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.overload=t.expandConfig=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=w(t,r),this.container=this.options.container,null==this.container)return y.error("Invalid Quill container",t);this.options.debug&&e.debug(this.options.debug);var o=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new s.default,this.scroll=u.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new l.default(this.scroll),this.selection=new d.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(s.default.events.EDITOR_CHANGE,(function(e){e===s.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())})),this.emitter.on(s.default.events.SCROLL_UPDATE,(function(e,t){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;E.call(n,(function(){return n.editor.update(null,t,o)}),e)}));var a=this.clipboard.convert("
"+o+"


");this.setContents(a),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return a(e,null,[{key:"debug",value:function(e){!0===e&&(e="log"),p.default.level(e)}},{key:"find",value:function(e){return e.__quill||u.default.find(e)}},{key:"import",value:function(e){return null==this.imports[e]&&y.error("Cannot import "+e+". Are you sure it was registered?"),this.imports[e]}},{key:"register",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e){var o=e.attrName||e.blotName;"string"==typeof o?this.register("formats/"+o,e,t):Object.keys(e).forEach((function(r){n.register(r,e[r],t)}))}else null==this.imports[e]||r||y.warn("Overwriting "+e+" with",t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&"abstract"!==t.blotName?u.default.register(t):e.startsWith("modules")&&"function"==typeof t.register&&t.register()}}]),a(e,[{key:"addContainer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e){var n=e;(e=document.createElement("div")).classList.add(n)}return this.container.insertBefore(e,t),e}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(e,t,n){var r=this,a=x(e,t,n),i=o(a,4);return e=i[0],t=i[1],n=i[3],E.call(this,(function(){return r.editor.deleteText(e,t)}),n,e,-1*t)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}},{key:"focus",value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=e,this.scrollIntoView()}},{key:"format",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;return E.call(this,(function(){var r=n.getSelection(!0),o=new i.default;if(null==r)return o;if(u.default.query(e,u.default.Scope.BLOCK))o=n.editor.formatLine(r.index,r.length,g({},e,t));else{if(0===r.length)return n.selection.format(e,t),o;o=n.editor.formatText(r.index,r.length,g({},e,t))}return n.setSelection(r,s.default.sources.SILENT),o}),r)}},{key:"formatLine",value:function(e,t,n,r,a){var i,l=this,s=x(e,t,n,r,a),c=o(s,4);return e=c[0],t=c[1],i=c[2],a=c[3],E.call(this,(function(){return l.editor.formatLine(e,t,i)}),a,e,0)}},{key:"formatText",value:function(e,t,n,r,a){var i,l=this,s=x(e,t,n,r,a),c=o(s,4);return e=c[0],t=c[1],i=c[2],a=c[3],E.call(this,(function(){return l.editor.formatText(e,t,i)}),a,e,0)}},{key:"getBounds",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t="number"==typeof e?this.selection.getBounds(e,n):this.selection.getBounds(e.index,e.length);var r=this.container.getBoundingClientRect();return{bottom:t.bottom-r.top,height:t.height,left:t.left-r.left,right:t.right-r.left,top:t.top-r.top,width:t.width}}},{key:"getContents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=x(e,t),r=o(n,2);return e=r[0],t=r[1],this.editor.getContents(e,t)}},{key:"getFormat",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}},{key:"getIndex",value:function(e){return e.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(e){return this.scroll.leaf(e)}},{key:"getLine",value:function(e){return this.scroll.line(e)}},{key:"getLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}},{key:"getModule",value:function(e){return this.theme.modules[e]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=x(e,t),r=o(n,2);return e=r[0],t=r[1],this.editor.getText(e,t)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(t,n,r){var o=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.sources.API;return E.call(this,(function(){return o.editor.insertEmbed(t,n,r)}),a,t)}},{key:"insertText",value:function(e,t,n,r,a){var i,l=this,s=x(e,0,n,r,a),c=o(s,4);return e=c[0],i=c[2],a=c[3],E.call(this,(function(){return l.editor.insertText(e,t,i)}),a,e,t.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(e,t,n){this.clipboard.dangerouslyPasteHTML(e,t,n)}},{key:"removeFormat",value:function(e,t,n){var r=this,a=x(e,t,n),i=o(a,4);return e=i[0],t=i[1],n=i[3],E.call(this,(function(){return r.editor.removeFormat(e,t)}),n,e)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API;return E.call(this,(function(){e=new i.default(e);var n=t.getLength(),r=t.editor.deleteText(0,n),o=t.editor.applyDelta(e),a=o.ops[o.ops.length-1];return null!=a&&"string"==typeof a.insert&&"\n"===a.insert[a.insert.length-1]&&(t.editor.deleteText(t.getLength()-1,1),o.delete(1)),r.compose(o)}),n)}},{key:"setSelection",value:function(t,n,r){if(null==t)this.selection.setRange(null,n||e.sources.API);else{var a=x(t,n,r),i=o(a,4);t=i[0],n=i[1],r=i[3],this.selection.setRange(new h.Range(t,n),r),r!==s.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API,n=(new i.default).insert(e);return this.setContents(n,t)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.default.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}},{key:"updateContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default.sources.API;return E.call(this,(function(){return e=new i.default(e),t.editor.applyDelta(e,n)}),n,!0)}}]),e}();function w(e,t){if((t=(0,f.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,history:!0}},t)).theme&&t.theme!==b.DEFAULTS.theme){if(t.theme=b.import("themes/"+t.theme),null==t.theme)throw new Error("Invalid theme "+t.theme+". Did you register it?")}else t.theme=v.default;var n=(0,f.default)(!0,{},t.theme.DEFAULTS);[n,t].forEach((function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach((function(t){!0===e.modules[t]&&(e.modules[t]={})}))}));var r=Object.keys(n.modules).concat(Object.keys(t.modules)).reduce((function(e,t){var n=b.import("modules/"+t);return null==n?y.error("Cannot load "+t+" module. Are you sure you registered it?"):e[t]=n.DEFAULTS||{},e}),{});return null!=t.modules&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object&&(t.modules.toolbar={container:t.modules.toolbar}),t=(0,f.default)(!0,{},b.DEFAULTS,{modules:r},n,t),["bounds","container","scrollingContainer"].forEach((function(e){"string"==typeof t[e]&&(t[e]=document.querySelector(t[e]))})),t.modules=Object.keys(t.modules).reduce((function(e,n){return t.modules[n]&&(e[n]=t.modules[n]),e}),{}),t}function E(e,t,n,r){if(this.options.strict&&!this.isEnabled()&&t===s.default.sources.USER)return new i.default;var o=null==n?null:this.getSelection(),a=this.editor.delta,l=e();if(null!=o&&(!0===n&&(n=o.index),null==r?o=_(o,l,t):0!==r&&(o=_(o,n,r,t)),this.setSelection(o,s.default.sources.SILENT)),l.length()>0){var c,u,h=[s.default.events.TEXT_CHANGE,l,a,t];(c=this.emitter).emit.apply(c,[s.default.events.EDITOR_CHANGE].concat(h)),t!==s.default.sources.SILENT&&(u=this.emitter).emit.apply(u,h)}return l}function x(e,t,n,o,a){var i={};return"number"==typeof e.index&&"number"==typeof e.length?"number"!=typeof t?(a=o,o=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!=typeof t&&(a=o,o=n,n=t,t=0),"object"===(void 0===n?"undefined":r(n))?(i=n,a=o):"string"==typeof n&&(null!=o?i[n]=o:a=n),[e,t,i,a=a||s.default.sources.API]}function _(e,t,n,r){if(null==e)return null;var a=void 0,l=void 0;if(t instanceof i.default){var c=[e.index,e.index+e.length].map((function(e){return t.transformPosition(e,r!==s.default.sources.USER)})),u=o(c,2);a=u[0],l=u[1]}else{var d=[e.index,e.index+e.length].map((function(e){return e=0?e+n:Math.max(t,e+n)})),f=o(d,2);a=f[0],l=f[1]}return new h.Range(a,l-a)}b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},b.events=s.default.events,b.sources=s.default.sources,b.version="1.3.7",b.imports={delta:i.default,parchment:u.default,"core/module":c.default,"core/theme":v.default},t.expandConfig=w,t.overload=x,t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(e,n){var r=t.order.indexOf(e),o=t.order.indexOf(n);return r>=0||o>=0?r-o:e===n?0:e1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.quill=t,this.options=n};r.DEFAULTS={},t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=["error","warn","log","info"],o="warn";function a(e){if(r.indexOf(e)<=r.indexOf(o)){for(var t,n=arguments.length,a=Array(n>1?n-1:0),i=1;i=0;c--)if(h[c]!=d[c])return!1;for(c=h.length-1;c>=0;c--)if(u=h[c],!i(e[u],t[u],n))return!1;return typeof e==typeof t}(e,t,n))};function l(e){return null==e}function s(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length||"function"!=typeof e.copy||"function"!=typeof e.slice||e.length>0&&"number"!=typeof e[0])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=function(){function e(e,t,n){void 0===n&&(n={}),this.attrName=e,this.keyName=t;var o=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|o:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return e.keys=function(e){return[].map.call(e.attributes,(function(e){return e.name}))},e.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)},e.prototype.canAdd=function(e,t){return null!=r.query(e,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1))},e.prototype.remove=function(e){e.removeAttribute(this.keyName)},e.prototype.value=function(e){var t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""},e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Code=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n=e+n)){var i=this.newlineIndex(e,!0)+1,s=a-i+1,c=this.isolate(i,s),u=c.next;c.format(r,o),u instanceof t&&u.formatAt(0,e-i+n-s,r,o)}}}},{key:"insertAt",value:function(e,t,n){if(null==n){var o=this.descendant(u.default,e),a=r(o,2),i=a[0],l=a[1];i.insertAt(l,t)}}},{key:"length",value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?e:e+1}},{key:"newlineIndex",value:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,e).lastIndexOf("\n");var t=this.domNode.textContent.slice(e).indexOf("\n");return t>-1?e+t:-1}},{key:"optimize",value:function(e){this.domNode.textContent.endsWith("\n")||this.appendChild(l.default.create("text","\n")),a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(e),n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e),[].slice.call(this.domNode.querySelectorAll("*")).forEach((function(e){var t=l.default.find(e);null==t?e.parentNode.removeChild(e):t instanceof l.default.Embed?t.remove():t.unwrap()}))}}],[{key:"create",value:function(e){var n=a(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),t}(s.default);m.blotName="code-block",m.tagName="PRE",m.TAB=" ",t.Code=v,t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){for(var n=0;n=a&&!f.endsWith("\n")&&(n=!0),t.scroll.insertAt(e,f);var p=t.scroll.line(e),v=o(p,2),g=v[0],y=v[1],b=(0,m.default)({},(0,h.bubbleFormats)(g));if(g instanceof d.default){var w=g.descendant(s.default.Leaf,y),E=o(w,1)[0];b=(0,m.default)(b,(0,h.bubbleFormats)(E))}u=l.default.attributes.diff(b,u)||{}}else if("object"===r(i.insert)){var x=Object.keys(i.insert)[0];if(null==x)return e;t.scroll.insertAt(e,x,i.insert[x])}a+=c}return Object.keys(u).forEach((function(n){t.scroll.formatAt(e,c,n,u[n])})),e+c}),0),e.reduce((function(e,n){return"number"==typeof n.delete?(t.scroll.deleteAt(e,n.delete),e):e+(n.retain||n.insert.length||1)}),0),this.scroll.batchEnd(),this.update(e)}},{key:"deleteText",value:function(e,t){return this.scroll.deleteAt(e,t),this.update((new i.default).retain(e).delete(t))}},{key:"formatLine",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach((function(o){if(null==n.scroll.whitelist||n.scroll.whitelist[o]){var a=n.scroll.lines(e,Math.max(t,1)),i=t;a.forEach((function(t){var a=t.length();if(t instanceof c.default){var l=e-t.offset(n.scroll),s=t.newlineIndex(l+i)-l+1;t.formatAt(l,s,o,r[o])}else t.format(o,r[o]);i-=a}))}})),this.scroll.optimize(),this.update((new i.default).retain(e).retain(t,(0,p.default)(r)))}},{key:"formatText",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach((function(o){n.scroll.formatAt(e,t,o,r[o])})),this.update((new i.default).retain(e).retain(t,(0,p.default)(r)))}},{key:"getContents",value:function(e,t){return this.delta.slice(e,e+t)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce((function(e,t){return e.concat(t.delta())}),new i.default)}},{key:"getFormat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach((function(e){var t=o(e,1)[0];t instanceof d.default?n.push(t):t instanceof s.default.Leaf&&r.push(t)})):(n=this.scroll.lines(e,t),r=this.scroll.descendants(s.default.Leaf,e,t));var a=[n,r].map((function(e){if(0===e.length)return{};for(var t=(0,h.bubbleFormats)(e.shift());Object.keys(t).length>0;){var n=e.shift();if(null==n)return t;t=w((0,h.bubbleFormats)(n),t)}return t}));return m.default.apply(m.default,a)}},{key:"getText",value:function(e,t){return this.getContents(e,t).filter((function(e){return"string"==typeof e.insert})).map((function(e){return e.insert})).join("")}},{key:"insertEmbed",value:function(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new i.default).retain(e).insert(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,n)))}},{key:"insertText",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(r).forEach((function(o){n.scroll.formatAt(e,t.length,o,r[o])})),this.update((new i.default).retain(e).insert(t,(0,p.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var e=this.scroll.children.head;return e.statics.blotName===d.default.blotName&&!(e.children.length>1)&&e.children.head instanceof f.default}},{key:"removeFormat",value:function(e,t){var n=this.getText(e,t),r=this.scroll.line(e+t),a=o(r,2),l=a[0],s=a[1],u=0,h=new i.default;null!=l&&(u=l instanceof c.default?l.newlineIndex(s)-s+1:l.length()-s,h=l.delta().slice(s,s+u-1).insert("\n"));var d=this.getContents(e,t+u).diff((new i.default).insert(n).concat(h)),f=(new i.default).retain(e).concat(d);return this.applyDelta(f)}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(y)&&s.default.find(t[0].target)){var o=s.default.find(t[0].target),a=(0,h.bubbleFormats)(o),l=o.offset(this.scroll),c=t[0].oldValue.replace(u.default.CONTENTS,""),d=(new i.default).insert(c),f=(new i.default).insert(o.value());e=(new i.default).retain(l).concat(d.diff(f,n)).reduce((function(e,t){return t.insert?e.insert(t.insert,a):e.push(t)}),new i.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&(0,v.default)(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}]),e}();function w(e,t){return Object.keys(t).reduce((function(n,r){return null==e[r]||(t[r]===e[r]?n[r]=t[r]:Array.isArray(t[r])?t[r].indexOf(e[r])<0&&(n[r]=t[r].concat([e[r]])):n[r]=[t[r],e[r]]),n}),{})}t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Range=void 0;var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;h(this,e),this.index=t,this.length=n},p=function(){function e(t,n){var r=this;h(this,e),this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=a.default.create("cursor",this),this.lastRange=this.savedRange=new f(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(function(){r.mouseDown||setTimeout(r.update.bind(r,s.default.sources.USER),1)})),this.emitter.on(s.default.events.EDITOR_CHANGE,(function(e,t){e===s.default.events.TEXT_CHANGE&&t.length()>0&&r.update(s.default.sources.SILENT)})),this.emitter.on(s.default.events.SCROLL_BEFORE_UPDATE,(function(){if(r.hasFocus()){var e=r.getNativeRange();null!=e&&e.start.node!==r.cursor.textNode&&r.emitter.once(s.default.events.SCROLL_UPDATE,(function(){try{r.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch(e){}}))}})),this.emitter.on(s.default.events.SCROLL_OPTIMIZE,(function(e,t){if(t.range){var n=t.range,o=n.startNode,a=n.startOffset,i=n.endNode,l=n.endOffset;r.setNativeRange(o,a,i,l)}})),this.update(s.default.sources.SILENT)}return o(e,[{key:"handleComposition",value:function(){var e=this;this.root.addEventListener("compositionstart",(function(){e.composing=!0})),this.root.addEventListener("compositionend",(function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();if(!t)return;setTimeout((function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)}),1)}}))}},{key:"handleDragging",value:function(){var e=this;this.emitter.listenDOM("mousedown",document.body,(function(){e.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(function(){e.mouseDown=!1,e.update(s.default.sources.USER)}))}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(e,t){if(null==this.scroll.whitelist||this.scroll.whitelist[e]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!a.default.query(e,a.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=a.default.find(n.start.node,!1);if(null==r)return;if(r instanceof a.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;var o=void 0,a=this.scroll.leaf(e),i=r(a,2),l=i[0],s=i[1];if(null==l)return null;var c=l.position(s,!0),u=r(c,2);o=u[0],s=u[1];var h=document.createRange();if(t>0){h.setStart(o,s);var d=this.scroll.leaf(e+t),f=r(d,2);if(l=f[0],s=f[1],null==l)return null;var p=l.position(s,!0),v=r(p,2);return o=v[0],s=v[1],h.setEnd(o,s),h.getBoundingClientRect()}var m="left",g=void 0;return o instanceof Text?(s0&&(m="right")),{bottom:g.top+g.height,height:g.height,left:g[m],right:g[m],top:g.top,width:0}}},{key:"getNativeRange",value:function(){var e=document.getSelection();if(null==e||e.rangeCount<=0)return null;var t=e.getRangeAt(0);if(null==t)return null;var n=this.normalizeNative(t);return d.info("getNativeRange",n),n}},{key:"getRange",value:function(){var e=this.getNativeRange();return null==e?[null,null]:[this.normalizedToRange(e),e]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(e){var t=this,n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var o=n.map((function(e){var n=r(e,2),o=n[0],i=n[1],l=a.default.find(o,!0),s=l.offset(t.scroll);return 0===i?s:l instanceof a.default.Container?s+l.length():s+l.index(o,i)})),i=Math.min(Math.max.apply(Math,u(o)),this.scroll.length()-1),l=Math.min.apply(Math,[i].concat(u(o)));return new f(l,i-l)}},{key:"normalizeNative",value:function(e){if(!v(this.root,e.startContainer)||!e.collapsed&&!v(this.root,e.endContainer))return null;var t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((function(e){for(var t=e.node,n=e.offset;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;n=(t=t.lastChild)instanceof Text?t.data.length:t.childNodes.length+1}e.node=t,e.offset=n})),t}},{key:"rangeToNative",value:function(e){var t=this,n=e.collapsed?[e.index]:[e.index,e.index+e.length],o=[],a=this.scroll.length();return n.forEach((function(e,n){e=Math.min(a-1,e);var i,l=t.scroll.leaf(e),s=r(l,2),c=s[0],u=s[1],h=c.position(u,0!==n),d=r(h,2);i=d[0],u=d[1],o.push(i,u)})),o.length<2&&(o=o.concat(o)),o}},{key:"scrollIntoView",value:function(e){var t=this.lastRange;if(null!=t){var n=this.getBounds(t.index,t.length);if(null!=n){var o=this.scroll.length()-1,a=this.scroll.line(Math.min(t.index,o)),i=r(a,1)[0],l=i;if(t.length>0){var s=this.scroll.line(Math.min(t.index+t.length,o));l=r(s,1)[0]}if(null!=i&&null!=l){var c=e.getBoundingClientRect();n.topc.bottom&&(e.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(d.info("setNativeRange",e,t,n,r),null==e||null!=this.root.parentNode&&null!=e.parentNode&&null!=n.parentNode){var a=document.getSelection();if(null!=a)if(null!=e){this.hasFocus()||this.root.focus();var i=(this.getNativeRange()||{}).native;if(null==i||o||e!==i.startContainer||t!==i.startOffset||n!==i.endContainer||r!==i.endOffset){"BR"==e.tagName&&(t=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var l=document.createRange();l.setStart(e,t),l.setEnd(n,r),a.removeAllRanges(),a.addRange(l)}}else a.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.default.sources.API;if("string"==typeof t&&(n=t,t=!1),d.info("setRange",e),null!=e){var r=this.rangeToNative(e);this.setNativeRange.apply(this,u(r).concat([t]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.default.sources.USER,t=this.lastRange,n=this.getRange(),o=r(n,2),a=o[0],c=o[1];if(this.lastRange=a,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,l.default)(t,this.lastRange)){var u;!this.composing&&null!=c&&c.native.collapsed&&c.start.node!==this.cursor.textNode&&this.cursor.restore();var h,d=[s.default.events.SELECTION_CHANGE,(0,i.default)(this.lastRange),(0,i.default)(t),e];(u=this.emitter).emit.apply(u,[s.default.events.EDITOR_CHANGE].concat(d)),e!==s.default.sources.SILENT&&(h=this.emitter).emit.apply(h,d)}}}]),e}();function v(e,t){try{t.parentNode}catch(e){return!1}return t instanceof Text&&(t=t.parentNode),e.contains(t)}t.Range=f,t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n0&&(n+=1),[this.parent.domNode,n]},t.prototype.value=function(){var e;return(e={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,e},t.scope=i.Scope.INLINE_BLOT,t}(a.default);t.default=l},function(e,t,n){var r=n(11),o=n(3),a={attributes:{compose:function(e,t,n){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var r=o(!0,{},t);for(var a in n||(r=Object.keys(r).reduce((function(e,t){return null!=r[t]&&(e[t]=r[t]),e}),{})),e)void 0!==e[a]&&void 0===t[a]&&(r[a]=e[a]);return Object.keys(r).length>0?r:void 0},diff:function(e,t){"object"!=typeof e&&(e={}),"object"!=typeof t&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce((function(n,o){return r(e[o],t[o])||(n[o]=void 0===t[o]?null:t[o]),n}),{});return Object.keys(n).length>0?n:void 0},transform:function(e,t,n){if("object"!=typeof e)return t;if("object"==typeof t){if(!n)return t;var r=Object.keys(t).reduce((function(n,r){return void 0===e[r]&&(n[r]=t[r]),n}),{});return Object.keys(r).length>0?r:void 0}}},iterator:function(e){return new i(e)},length:function(e){return"number"==typeof e.delete?e.delete:"number"==typeof e.retain?e.retain:"string"==typeof e.insert?e.insert.length:1}};function i(e){this.ops=e,this.index=0,this.offset=0}i.prototype.hasNext=function(){return this.peekLength()<1/0},i.prototype.next=function(e){e||(e=1/0);var t=this.ops[this.index];if(t){var n=this.offset,r=a.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"==typeof t.delete)return{delete:e};var o={};return t.attributes&&(o.attributes=t.attributes),"number"==typeof t.retain?o.retain=e:"string"==typeof t.insert?o.insert=t.insert.substr(n,e):o.insert=t.insert,o}return{retain:1/0}},i.prototype.peek=function(){return this.ops[this.index]},i.prototype.peekLength=function(){return this.ops[this.index]?a.length(this.ops[this.index])-this.offset:1/0},i.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},i.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}return[]},e.exports=a},function(e,t){var n=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,r;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{r=Promise}catch(e){r=function(){}}function o(a,l,s,c,u){"object"==typeof l&&(s=l.depth,c=l.prototype,u=l.includeNonEnumerable,l=l.circular);var h=[],d=[],f="undefined"!=typeof Buffer;return void 0===l&&(l=!0),void 0===s&&(s=1/0),function a(s,p){if(null===s)return null;if(0===p)return s;var v,m;if("object"!=typeof s)return s;if(e(s,t))v=new t;else if(e(s,n))v=new n;else if(e(s,r))v=new r((function(e,t){s.then((function(t){e(a(t,p-1))}),(function(e){t(a(e,p-1))}))}));else if(o.__isArray(s))v=[];else if(o.__isRegExp(s))v=new RegExp(s.source,i(s)),s.lastIndex&&(v.lastIndex=s.lastIndex);else if(o.__isDate(s))v=new Date(s.getTime());else{if(f&&Buffer.isBuffer(s))return v=Buffer.allocUnsafe?Buffer.allocUnsafe(s.length):new Buffer(s.length),s.copy(v),v;e(s,Error)?v=Object.create(s):void 0===c?(m=Object.getPrototypeOf(s),v=Object.create(m)):(v=Object.create(c),m=c)}if(l){var g=h.indexOf(s);if(-1!=g)return d[g];h.push(s),d.push(v)}for(var y in e(s,t)&&s.forEach((function(e,t){var n=a(t,p-1),r=a(e,p-1);v.set(n,r)})),e(s,n)&&s.forEach((function(e){var t=a(e,p-1);v.add(t)})),s){var b;m&&(b=Object.getOwnPropertyDescriptor(m,y)),b&&null==b.set||(v[y]=a(s[y],p-1))}if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(s);for(y=0;y0){if(l instanceof s.BlockEmbed||f instanceof s.BlockEmbed)return void this.optimize();if(l instanceof h.default){var p=l.newlineIndex(l.length(),!0);if(p>-1&&(l=l.split(p+1))===f)return void this.optimize()}else if(f instanceof h.default){var v=f.newlineIndex(0);v>-1&&f.split(v+1)}var m=f.children.head instanceof u.default?null:f.children.head;l.moveChildren(f,m),l.remove()}this.optimize()}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e)}},{key:"formatAt",value:function(e,n,r,o){(null==this.whitelist||this.whitelist[r])&&(a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,r,o),this.optimize())}},{key:"insertAt",value:function(e,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(e>=this.length())if(null==r||null==i.default.query(n,i.default.Scope.BLOCK)){var o=i.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var l=i.default.create(n,r);this.appendChild(l)}else a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,r);this.optimize()}}},{key:"insertBefore",value:function(e,n){if(e.statics.scope===i.default.Scope.INLINE_BLOT){var r=i.default.create(this.statics.defaultChild);r.appendChild(e),e=r}a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n)}},{key:"leaf",value:function(e){return this.path(e).pop()||[null,-1]}},{key:"line",value:function(e){return e===this.length()?this.line(e-1):this.descendant(p,e)}},{key:"lines",value:function(){return function e(t,n,r){var o=[],a=r;return t.children.forEachAt(n,r,(function(t,n,r){p(t)?o.push(t):t instanceof i.default.Container&&(o=o.concat(e(t,n,a))),a-=r})),o}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}},{key:"optimize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e,n),e.length>0&&this.emitter.emit(l.default.events.SCROLL_OPTIMIZE,e,n))}},{key:"path",value:function(e){return a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e).slice(1)}},{key:"update",value:function(e){if(!0!==this.batch){var n=l.default.sources.USER;"string"==typeof e&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e.length>0&&this.emitter.emit(l.default.events.SCROLL_BEFORE_UPDATE,n,e),a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"update",this).call(this,e.concat([])),e.length>0&&this.emitter.emit(l.default.events.SCROLL_UPDATE,n,e)}}}]),t}(i.default.Scroll);v.blotName="scroll",v.className="ql-editor",v.tagName="DIV",v.defaultChild="block",v.allowedChildren=[c.default,s.BlockEmbed,d.default],t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHORTKEY=t.default=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=z(e);if(null==r||null==r.key)return g.warn("Attempted to add invalid keyboard binding",r);"function"==typeof t&&(t={handler:t}),"function"==typeof n&&(n={handler:n}),r=(0,s.default)(r,t,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var e=this;this.quill.root.addEventListener("keydown",(function(n){if(!n.defaultPrevented){var a=n.which||n.keyCode,i=(e.bindings[a]||[]).filter((function(e){return t.match(n,e)}));if(0!==i.length){var s=e.quill.getSelection();if(null!=s&&e.quill.hasFocus()){var c=e.quill.getLine(s.index),u=o(c,2),d=u[0],f=u[1],p=e.quill.getLeaf(s.index),v=o(p,2),m=v[0],g=v[1],y=0===s.length?[m,g]:e.quill.getLeaf(s.index+s.length),b=o(y,2),w=b[0],E=b[1],x=m instanceof h.default.Text?m.value().slice(0,g):"",_=w instanceof h.default.Text?w.value().slice(E):"",S={collapsed:0===s.length,empty:0===s.length&&d.length()<=1,format:e.quill.getFormat(s),offset:f,prefix:x,suffix:_};i.some((function(t){if(null!=t.collapsed&&t.collapsed!==S.collapsed)return!1;if(null!=t.empty&&t.empty!==S.empty)return!1;if(null!=t.offset&&t.offset!==S.offset)return!1;if(Array.isArray(t.format)){if(t.format.every((function(e){return null==S.format[e]})))return!1}else if("object"===r(t.format)&&!Object.keys(t.format).every((function(e){return!0===t.format[e]?null!=S.format[e]:!1===t.format[e]?null==S.format[e]:(0,l.default)(t.format[e],S.format[e])})))return!1;return!(null!=t.prefix&&!t.prefix.test(S.prefix)||null!=t.suffix&&!t.suffix.test(S.suffix)||!0===t.handler.call(e,s,S))}))&&n.preventDefault()}}}}))}}]),t}(p.default);function w(e,t){var n,r=e===b.keys.LEFT?"prefix":"suffix";return m(n={key:e,shiftKey:t,altKey:null},r,/^$/),m(n,"handler",(function(n){var r=n.index;e===b.keys.RIGHT&&(r+=n.length+1);var a=this.quill.getLeaf(r);return!(o(a,1)[0]instanceof h.default.Embed&&(e===b.keys.LEFT?t?this.quill.setSelection(n.index-1,n.length+1,d.default.sources.USER):this.quill.setSelection(n.index-1,d.default.sources.USER):t?this.quill.setSelection(n.index,n.length+1,d.default.sources.USER):this.quill.setSelection(n.index+n.length+1,d.default.sources.USER),1))})),n}function E(e,t){if(!(0===e.index||this.quill.getLength()<=1)){var n=this.quill.getLine(e.index),r=o(n,1)[0],a={};if(0===t.offset){var i=this.quill.getLine(e.index-1),l=o(i,1)[0];if(null!=l&&l.length()>1){var s=r.formats(),c=this.quill.getFormat(e.index-1,1);a=u.default.attributes.diff(s,c)||{}}}var h=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-h,h,d.default.sources.USER),Object.keys(a).length>0&&this.quill.formatLine(e.index-h,h,a,d.default.sources.USER),this.quill.focus()}}function x(e,t){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(!(e.index>=this.quill.getLength()-n)){var r={},a=0,i=this.quill.getLine(e.index),l=o(i,1)[0];if(t.offset>=l.length()-1){var s=this.quill.getLine(e.index+1),c=o(s,1)[0];if(c){var h=l.formats(),f=this.quill.getFormat(e.index,1);r=u.default.attributes.diff(h,f)||{},a=c.length()}}this.quill.deleteText(e.index,n,d.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index+a-1,n,r,d.default.sources.USER)}}function _(e){var t=this.quill.getLines(e),n={};if(t.length>1){var r=t[0].formats(),o=t[t.length-1].formats();n=u.default.attributes.diff(o,r)||{}}this.quill.deleteText(e,d.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(e.index,1,n,d.default.sources.USER),this.quill.setSelection(e.index,d.default.sources.SILENT),this.quill.focus()}function S(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var r=Object.keys(t.format).reduce((function(e,n){return h.default.query(n,h.default.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e}),{});this.quill.insertText(e.index,"\n",r,d.default.sources.USER),this.quill.setSelection(e.index+1,d.default.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach((function(e){null==r[e]&&(Array.isArray(t.format[e])||"link"!==e&&n.quill.format(e,t.format[e],d.default.sources.USER))}))}function C(e){return{key:b.keys.TAB,shiftKey:!e,format:{"code-block":!0},handler:function(t){var n=h.default.query("code-block"),r=t.index,a=t.length,i=this.quill.scroll.descendant(n,r),l=o(i,2),s=l[0],c=l[1];if(null!=s){var u=this.quill.getIndex(s),f=s.newlineIndex(c,!0)+1,p=s.newlineIndex(u+c+a),v=s.domNode.textContent.slice(f,p).split("\n");c=0,v.forEach((function(t,o){e?(s.insertAt(f+c,n.TAB),c+=n.TAB.length,0===o?r+=n.TAB.length:a+=n.TAB.length):t.startsWith(n.TAB)&&(s.deleteAt(f+c,n.TAB.length),c-=n.TAB.length,0===o?r-=n.TAB.length:a-=n.TAB.length),c+=t.length+1})),this.quill.update(d.default.sources.USER),this.quill.setSelection(r,a,d.default.sources.SILENT)}}}}function O(e){return{key:e[0].toUpperCase(),shortKey:!0,handler:function(t,n){this.quill.format(e,!n.format[e],d.default.sources.USER)}}}function z(e){if("string"==typeof e||"number"==typeof e)return z({key:e});if("object"===(void 0===e?"undefined":r(e))&&(e=(0,i.default)(e,!1)),"string"==typeof e.key)if(null!=b.keys[e.key.toUpperCase()])e.key=b.keys[e.key.toUpperCase()];else{if(1!==e.key.length)return null;e.key=e.key.toUpperCase().charCodeAt(0)}return e.shortKey&&(e[y]=e.shortKey,delete e.shortKey),e}b.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},b.DEFAULTS={bindings:{bold:O("bold"),italic:O("italic"),underline:O("underline"),indent:{key:b.keys.TAB,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","+1",d.default.sources.USER)}},outdent:{key:b.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","-1",d.default.sources.USER)}},"outdent backspace":{key:b.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(e,t){null!=t.format.indent?this.quill.format("indent","-1",d.default.sources.USER):null!=t.format.list&&this.quill.format("list",!1,d.default.sources.USER)}},"indent code-block":C(!0),"outdent code-block":C(!1),"remove tab":{key:b.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(e){this.quill.deleteText(e.index-1,1,d.default.sources.USER)}},tab:{key:b.keys.TAB,handler:function(e){this.quill.history.cutoff();var t=(new c.default).retain(e.index).delete(e.length).insert("\t");this.quill.updateContents(t,d.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,d.default.sources.SILENT)}},"list empty enter":{key:b.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(e,t){this.quill.format("list",!1,d.default.sources.USER),t.format.indent&&this.quill.format("indent",!1,d.default.sources.USER)}},"checklist enter":{key:b.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(e){var t=this.quill.getLine(e.index),n=o(t,2),r=n[0],a=n[1],i=(0,s.default)({},r.formats(),{list:"checked"}),l=(new c.default).retain(e.index).insert("\n",i).retain(r.length()-a-1).retain(1,{list:"unchecked"});this.quill.updateContents(l,d.default.sources.USER),this.quill.setSelection(e.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:b.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(e,t){var n=this.quill.getLine(e.index),r=o(n,2),a=r[0],i=r[1],l=(new c.default).retain(e.index).insert("\n",t.format).retain(a.length()-i-1).retain(1,{header:null});this.quill.updateContents(l,d.default.sources.USER),this.quill.setSelection(e.index+1,d.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(e,t){var n=t.prefix.length,r=this.quill.getLine(e.index),a=o(r,2),i=a[0],l=a[1];if(l>n)return!0;var s=void 0;switch(t.prefix.trim()){case"[]":case"[ ]":s="unchecked";break;case"[x]":s="checked";break;case"-":case"*":s="bullet";break;default:s="ordered"}this.quill.insertText(e.index," ",d.default.sources.USER),this.quill.history.cutoff();var u=(new c.default).retain(e.index-l).delete(n+1).retain(i.length()-2-l).retain(1,{list:s});this.quill.updateContents(u,d.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,d.default.sources.SILENT)}},"code exit":{key:b.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(e){var t=this.quill.getLine(e.index),n=o(t,2),r=n[0],a=n[1],i=(new c.default).retain(e.index+r.length()-a-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(i,d.default.sources.USER)}},"embed left":w(b.keys.LEFT,!1),"embed left shift":w(b.keys.LEFT,!0),"embed right":w(b.keys.RIGHT,!1),"embed right shift":w(b.keys.RIGHT,!0)}},t.default=b,t.SHORTKEY=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in o)return o.value;var i=o.get;return void 0!==i?i.call(r):void 0},o=function(){function e(e,t){for(var n=0;n-1}i.blotName="link",i.tagName="A",i.SANITIZED_URL="about:blank",i.PROTOCOL_WHITELIST=["http","https","mailto","tel"],t.default=i,t.sanitize=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(e.parentNode.children,e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":r(Event))){var o=document.createEvent("Event");o.initEvent("change",!0,!0),this.select.dispatchEvent(o)}this.close()}}},{key:"update",value:function(){var e=void 0;if(this.select.selectedIndex>-1){var t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);var n=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=g(n(0)),o=g(n(5)),a=n(4),i=g(a),l=g(n(16)),s=g(n(25)),c=g(n(24)),u=g(n(35)),h=g(n(6)),d=g(n(22)),f=g(n(7)),p=g(n(55)),v=g(n(42)),m=g(n(23));function g(e){return e&&e.__esModule?e:{default:e}}o.default.register({"blots/block":i.default,"blots/block/embed":a.BlockEmbed,"blots/break":l.default,"blots/container":s.default,"blots/cursor":c.default,"blots/embed":u.default,"blots/inline":h.default,"blots/scroll":d.default,"blots/text":f.default,"modules/clipboard":p.default,"modules/history":v.default,"modules/keyboard":m.default}),r.default.register(i.default,l.default,c.default,h.default,d.default,f.default),t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=function(){function e(e){this.domNode=e,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(e.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),e.create=function(e){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var t;return Array.isArray(this.tagName)?("string"==typeof e&&(e=e.toUpperCase(),parseInt(e).toString()===e&&(e=parseInt(e))),t="number"==typeof e?document.createElement(this.tagName[e-1]):this.tagName.indexOf(e)>-1?document.createElement(e):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t},e.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},e.prototype.clone=function(){var e=this.domNode.cloneNode(!1);return r.create(e)},e.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},e.prototype.deleteAt=function(e,t){this.isolate(e,t).remove()},e.prototype.formatAt=function(e,t,n,o){var a=this.isolate(e,t);if(null!=r.query(n,r.Scope.BLOT)&&o)a.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var i=r.create(this.statics.scope);a.wrap(i),i.format(n,o)}},e.prototype.insertAt=function(e,t,n){var o=null==n?r.create("text",t):r.create(t,n),a=this.split(e);this.parent.insertBefore(o,a)},e.prototype.insertInto=function(e,t){void 0===t&&(t=null),null!=this.parent&&this.parent.children.remove(this);var n=null;e.children.insertBefore(this,t),null!=t&&(n=t.domNode),this.domNode.parentNode==e.domNode&&this.domNode.nextSibling==n||e.domNode.insertBefore(this.domNode,n),this.parent=e,this.attach()},e.prototype.isolate=function(e,t){var n=this.split(e);return n.split(t),n},e.prototype.length=function(){return 1},e.prototype.offset=function(e){return void 0===e&&(e=this.parent),null==this.parent||this==e?0:this.parent.children.offset(this)+this.parent.offset(e)},e.prototype.optimize=function(e){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},e.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},e.prototype.replace=function(e){null!=e.parent&&(e.parent.insertBefore(this,e.next),e.remove())},e.prototype.replaceWith=function(e,t){var n="string"==typeof e?r.create(e,t):e;return n.replace(this),n},e.prototype.split=function(e,t){return 0===e?this:this.next},e.prototype.update=function(e,t){},e.prototype.wrap=function(e,t){var n="string"==typeof e?r.create(e,t):e;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},e.blotName="abstract",e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),o=n(32),a=n(33),i=n(1),l=function(){function e(e){this.attributes={},this.domNode=e,this.build()}return e.prototype.attribute=function(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])},e.prototype.build=function(){var e=this;this.attributes={};var t=r.default.keys(this.domNode),n=o.default.keys(this.domNode),l=a.default.keys(this.domNode);t.concat(n).concat(l).forEach((function(t){var n=i.query(t,i.Scope.ATTRIBUTE);n instanceof r.default&&(e.attributes[n.attrName]=n)}))},e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach((function(n){var r=t.attributes[n].value(t.domNode);e.format(n,r)}))},e.prototype.move=function(e){var t=this;this.copy(e),Object.keys(this.attributes).forEach((function(e){t.attributes[e].remove(t.domNode)})),this.attributes={}},e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce((function(t,n){return t[n]=e.attributes[n].value(e.domNode),t}),{})},e}();t.default=l},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function a(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter((function(e){return 0===e.indexOf(t+"-")}))}Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.keys=function(e){return(e.getAttribute("class")||"").split(/\s+/).map((function(e){return e.split("-").slice(0,-1).join("-")}))},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(this.keyName+"-"+t),!0)},t.prototype.remove=function(e){a(e,this.keyName).forEach((function(t){e.classList.remove(t)})),0===e.classList.length&&e.removeAttribute("class")},t.prototype.value=function(e){var t=(a(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=i},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function a(e){var t=e.split("-"),n=t.slice(1).map((function(e){return e[0].toUpperCase()+e.slice(1)})).join("");return t[0]+n}Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.keys=function(e){return(e.getAttribute("style")||"").split(";").map((function(e){return e.split(":")[0].trim()}))},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.style[a(this.keyName)]=t,!0)},t.prototype.remove=function(e){e.style[a(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")},t.prototype.value=function(e){var t=e.style[a(this.keyName)];return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),e=o.redo.compose(e)}else this.lastRecorded=r;this.stack.undo.push({redo:e,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(e){this.stack.undo.forEach((function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})),this.stack.redo.forEach((function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}))}},{key:"undo",value:function(){this.change("undo","redo")}}]),t}(i(n(9)).default);function s(e){var t=e.reduce((function(e,t){return e+(t.delete||0)}),0),n=e.length()-t;return function(e){var t=e.ops[e.ops.length-1];return null!=t&&(null!=t.insert?"string"==typeof t.insert&&t.insert.endsWith("\n"):null!=t.attributes&&Object.keys(t.attributes).some((function(e){return null!=o.default.query(e,o.default.Scope.BLOCK)})))}(e)&&(n-=1),n}l.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},t.default=l,t.getLastChangeIndex=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BaseTooltip=void 0;var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+e)||""),this.root.setAttribute("data-mode",e)}},{key:"restoreFocus",value:function(){var e=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=e}},{key:"save",value:function(){var e,t,n=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var r=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",n,l.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",n,l.default.sources.USER)),this.quill.root.scrollTop=r;break;case"video":n=(t=(e=n).match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/))?(t[1]||"https")+"://www.youtube.com/embed/"+t[2]+"?showinfo=0":(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/":e;case"formula":if(!n)break;var o=this.quill.getSelection(!0);if(null!=o){var a=o.index+o.length;this.quill.insertEmbed(a,this.root.getAttribute("data-mode"),n,l.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(a+1," ",l.default.sources.USER),this.quill.setSelection(a+2,l.default.sources.USER)}}this.textbox.value="",this.hide()}}]),t}(f.default);function C(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach((function(t){var r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",t),e.appendChild(r)}))}t.BaseTooltip=S,t.default=_},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.head=this.tail=null,this.length=0}return e.prototype.append=function(){for(var e=[],t=0;t1&&this.append.apply(this,e.slice(1))},e.prototype.contains=function(e){for(var t,n=this.iterator();t=n();)if(t===e)return!0;return!1},e.prototype.insertBefore=function(e,t){e&&(e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)},e.prototype.offset=function(e){for(var t=0,n=this.head;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1},e.prototype.remove=function(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)},e.prototype.iterator=function(e){return void 0===e&&(e=this.head),function(){var t=e;return null!=e&&(e=e.next),t}},e.prototype.find=function(e,t){void 0===t&&(t=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ei?n(r,e-i,Math.min(t,i+s-e)):n(r,0,Math.min(s,e+t-i)),i+=s}},e.prototype.map=function(e){return this.reduce((function(t,n){return t.push(e(n)),t}),[])},e.prototype.reduce=function(e,t){for(var n,r=this.iterator();n=r();)t=e(t,n);return t},e}();t.default=r},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(17),i=n(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},s=function(e){function t(t){var n=e.call(this,t)||this;return n.scroll=n,n.observer=new MutationObserver((function(e){n.update(e)})),n.observer.observe(n.domNode,l),n.attach(),n}return o(t,e),t.prototype.detach=function(){e.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(t,n){this.update(),0===t&&n===this.length()?this.children.forEach((function(e){e.remove()})):e.prototype.deleteAt.call(this,t,n)},t.prototype.formatAt=function(t,n,r,o){this.update(),e.prototype.formatAt.call(this,t,n,r,o)},t.prototype.insertAt=function(t,n,r){this.update(),e.prototype.insertAt.call(this,t,n,r)},t.prototype.optimize=function(t,n){var r=this;void 0===t&&(t=[]),void 0===n&&(n={}),e.prototype.optimize.call(this,n);for(var o=[].slice.call(this.observer.takeRecords());o.length>0;)t.push(o.pop());for(var l=function(e,t){void 0===t&&(t=!0),null!=e&&e!==r&&null!=e.domNode.parentNode&&(null==e.domNode[i.DATA_KEY].mutations&&(e.domNode[i.DATA_KEY].mutations=[]),t&&l(e.parent))},s=function(e){null!=e.domNode[i.DATA_KEY]&&null!=e.domNode[i.DATA_KEY].mutations&&(e instanceof a.default&&e.children.forEach(s),e.optimize(n))},c=t,u=0;c.length>0;u+=1){if(u>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(c.forEach((function(e){var t=i.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(l(i.find(e.previousSibling,!1)),[].forEach.call(e.addedNodes,(function(e){var t=i.find(e,!1);l(t,!1),t instanceof a.default&&t.children.forEach((function(e){l(e,!1)}))}))):"attributes"===e.type&&l(t.prev)),l(t))})),this.children.forEach(s),o=(c=[].slice.call(this.observer.takeRecords())).slice();o.length>0;)t.push(o.pop())}},t.prototype.update=function(t,n){var r=this;void 0===n&&(n={}),(t=t||this.observer.takeRecords()).map((function(e){var t=i.find(e.target,!0);return null==t?null:null==t.domNode[i.DATA_KEY].mutations?(t.domNode[i.DATA_KEY].mutations=[e],t):(t.domNode[i.DATA_KEY].mutations.push(e),null)})).forEach((function(e){null!=e&&e!==r&&null!=e.domNode[i.DATA_KEY]&&e.update(e.domNode[i.DATA_KEY].mutations||[],n)})),null!=this.domNode[i.DATA_KEY].mutations&&e.prototype.update.call(this,this.domNode[i.DATA_KEY].mutations,n),this.optimize(t,n)},t.blotName="scroll",t.defaultChild="block",t.scope=i.Scope.BLOCK_BLOT,t.tagName="DIV",t}(a.default);t.default=s},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(18),i=n(1),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.formats=function(n){if(n.tagName!==t.tagName)return e.formats.call(this,n)},t.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?e.prototype.format.call(this,n,r):(this.children.forEach((function(e){e instanceof a.default||(e=e.wrap(t.blotName,!0)),o.attributes.copy(e)})),this.unwrap())},t.prototype.formatAt=function(t,n,r,o){null!=this.formats()[r]||i.query(r,i.Scope.ATTRIBUTE)?this.isolate(t,n).format(r,o):e.prototype.formatAt.call(this,t,n,r,o)},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var o=this.next;o instanceof t&&o.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}(r,o.formats())&&(o.moveChildren(this),o.remove())},t.blotName="inline",t.scope=i.Scope.INLINE_BLOT,t.tagName="SPAN",t}(a.default);t.default=l},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(18),i=n(1),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.formats=function(n){var r=i.query(t.blotName).tagName;if(n.tagName!==r)return e.formats.call(this,n)},t.prototype.format=function(n,r){null!=i.query(n,i.Scope.BLOCK)&&(n!==this.statics.blotName||r?e.prototype.format.call(this,n,r):this.replaceWith(t.blotName))},t.prototype.formatAt=function(t,n,r,o){null!=i.query(r,i.Scope.BLOCK)?this.format(r,o):e.prototype.formatAt.call(this,t,n,r,o)},t.prototype.insertAt=function(t,n,r){if(null==r||null!=i.query(n,i.Scope.INLINE))e.prototype.insertAt.call(this,t,n,r);else{var o=this.split(t),a=i.create(n,r);o.parent.insertBefore(a,o)}},t.prototype.update=function(t,n){navigator.userAgent.match(/Trident/)?this.build():e.prototype.update.call(this,t,n)},t.blotName="block",t.scope=i.Scope.BLOCK_BLOT,t.tagName="P",t}(a.default);t.default=l},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.formats=function(e){},t.prototype.format=function(t,n){e.prototype.formatAt.call(this,0,this.length(),t,n)},t.prototype.formatAt=function(t,n,r,o){0===t&&n===this.length()?this.format(r,o):e.prototype.formatAt.call(this,t,n,r,o)},t.prototype.formats=function(){return this.statics.formats(this.domNode)},t}(n(19).default);t.default=a},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(19),i=n(1),l=function(e){function t(t){var n=e.call(this,t)||this;return n.text=n.statics.value(n.domNode),n}return o(t,e),t.create=function(e){return document.createTextNode(e)},t.value=function(e){var t=e.data;return t.normalize&&(t=t.normalize()),t},t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)},t.prototype.index=function(e,t){return this.domNode===e?t:-1},t.prototype.insertAt=function(t,n,r){null==r?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):e.prototype.insertAt.call(this,t,n,r)},t.prototype.length=function(){return this.text.length},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},t.prototype.position=function(e,t){return void 0===t&&(t=!1),[this.domNode,e]},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=i.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},t.prototype.update=function(e,t){var n=this;e.some((function(e){return"characterData"===e.type&&e.target===n.domNode}))&&(this.text=this.statics.value(this.domNode))},t.prototype.value=function(){return this.text},t.blotName="text",t.scope=i.Scope.INLINE_BLOT,t}(a.default);t.default=l},function(e,t,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return arguments.length>1&&!this.contains(e)==!t?t:o.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return-1!==r&&r===t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var t,n=Object(this),r=n.length>>>0,o=arguments[1],a=0;at.length?e:t,h=e.length>t.length?t:e,d=u.indexOf(h);if(-1!=d)return c=[[r,u.substring(0,d)],[o,h],[r,u.substring(d+h.length)]],e.length>t.length&&(c[0][0]=c[2][0]=n),c;if(1==h.length)return[[n,e],[r,t]];var f=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,o,a,i,h]:null}var a,i,c,u,h,d=o(n,r,Math.ceil(n.length/4)),f=o(n,r,Math.ceil(n.length/2));return d||f?(a=f?d&&d[4].length>f[4].length?d:f:d,e.length>t.length?(i=a[0],c=a[1],u=a[2],h=a[3]):(u=a[0],h=a[1],i=a[2],c=a[3]),[i,c,u,h,a[4]]):null}(e,t);if(f){var p=f[0],v=f[1],m=f[2],g=f[3],y=f[4],b=a(p,m),w=a(v,g);return b.concat([[o,y]],w)}return function(e,t){for(var o=e.length,a=t.length,l=Math.ceil((o+a)/2),s=l,c=2*l,u=new Array(c),h=new Array(c),d=0;do)m+=2;else if(x>a)v+=2;else if(p&&(C=s+f-w)>=0&&C=(S=o-h[C]))return i(e,t,z,x)}for(var _=-b+g;_<=b-y;_+=2){for(var S,C=s+_,O=(S=_==-b||_!=b&&h[C-1]o)y+=2;else if(O>a)g+=2;else if(!p){var z;if((E=s+f-_)>=0&&E=(S=o-S)))return i(e,t,z,x)}}}return[[n,e],[r,t]]}(e,t)}(e=e.substring(0,e.length-d),t=t.substring(0,t.length-d));return f&&v.unshift([o,f]),p&&v.push([o,p]),c(v),null!=u&&(v=function(e,t){var r=function(e,t){if(0===t)return[o,e];for(var r=0,a=0;a0&&a.splice(i+2,0,[s[0],c]),h(a,i,3)}return e}(v,u)),function(e){for(var t=!1,a=function(e){return e.charCodeAt(0)>=56320&&e.charCodeAt(0)<=57343},i=2;i=55296&&l.charCodeAt(l.length-1)<=56319)&&e[i-1][0]===n&&a(e[i-1][1])&&e[i][0]===r&&a(e[i][1])&&(t=!0,e[i-1][1]=e[i-2][1].slice(-1)+e[i-1][1],e[i][1]=e[i-2][1].slice(-1)+e[i][1],e[i-2][1]=e[i-2][1].slice(0,-1));var l;if(!t)return e;var s=[];for(i=0;i0&&s.push(e[i]);return s}(v)}function i(e,t,n,r){var o=e.substring(0,n),i=t.substring(0,r),l=e.substring(n),s=t.substring(r),c=a(o,i),u=a(l,s);return c.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,a=0;n1?(0!==i&&0!==u&&(0!==(t=l(d,h))&&(a-i-u>0&&e[a-i-u-1][0]==o?e[a-i-u-1][1]+=d.substring(0,t):(e.splice(0,0,[o,d.substring(0,t)]),a++),d=d.substring(t),h=h.substring(t)),0!==(t=s(d,h))&&(e[a][1]=d.substring(d.length-t)+e[a][1],d=d.substring(0,d.length-t),h=h.substring(0,h.length-t))),0===i?e.splice(a-u,i+u,[r,d]):0===u?e.splice(a-i,i+u,[n,h]):e.splice(a-i-u,i+u,[n,h],[r,d]),a=a-i-u+(i?1:0)+(u?1:0)+1):0!==a&&e[a-1][0]==o?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,u=0,i=0,h="",d=""}""===e[e.length-1][1]&&e.pop();var f=!1;for(a=1;a=0&&r>=t-1;r--)if(r+1=700)&&(n.bold=!0),Object.keys(n).length>0&&(t=z(t,n)),parseFloat(r.textIndent||0)>0&&(t=(new l.default).insert("\t").concat(t)),t}],["li",function(e,t){var n=s.default.query(e);if(null==n||"list-item"!==n.blotName||!T(t,"\n"))return t;for(var r=-1,o=e.parentNode;!o.classList.contains("ql-clipboard");)"list"===(s.default.query(o)||{}).blotName&&(r+=1),o=o.parentNode;return r<=0?t:t.compose((new l.default).retain(t.length()-1).retain(1,{indent:r}))}],["b",A.bind(A,"bold")],["i",A.bind(A,"italic")],["style",function(){return new l.default}]],S=[d.AlignAttribute,m.DirectionAttribute].reduce((function(e,t){return e[t.keyName]=t,e}),{}),C=[d.AlignStyle,f.BackgroundStyle,v.ColorStyle,m.DirectionStyle,g.FontStyle,y.SizeStyle].reduce((function(e,t){return e[t.keyName]=t,e}),{}),O=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],_.concat(r.options.matchers).forEach((function(e){var t=o(e,2),a=t[0],i=t[1];(n.matchVisual||i!==H)&&r.addMatcher(a,i)})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"addMatcher",value:function(e,t){this.matchers.push([e,t])}},{key:"convert",value:function(e){if("string"==typeof e)return this.container.innerHTML=e.replace(/\>\r?\n +\<"),this.convert();var t=this.quill.getFormat(this.quill.selection.savedRange.index);if(t[p.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new l.default).insert(n,w({},p.default.blotName,t[p.default.blotName]))}var r=this.prepareMatching(),a=o(r,2),i=a[0],s=a[1],c=k(this.container,i,s);return T(c,"\n")&&null==c.ops[c.ops.length-1].attributes&&(c=c.compose((new l.default).retain(c.length()-1).delete(1))),E.log("convert",this.container.innerHTML,c),this.container.innerHTML="",c}},{key:"dangerouslyPasteHTML",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.default.sources.API;if("string"==typeof e)this.quill.setContents(this.convert(e),t),this.quill.setSelection(0,c.default.sources.SILENT);else{var r=this.convert(t);this.quill.updateContents((new l.default).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),c.default.sources.SILENT)}}},{key:"onPaste",value:function(e){var t=this;if(!e.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new l.default).retain(n.index),o=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(c.default.sources.SILENT),setTimeout((function(){r=r.concat(t.convert()).delete(n.length),t.quill.updateContents(r,c.default.sources.USER),t.quill.setSelection(r.length()-n.length,c.default.sources.SILENT),t.quill.scrollingContainer.scrollTop=o,t.quill.focus()}),1)}}},{key:"prepareMatching",value:function(){var e=this,t=[],n=[];return this.matchers.forEach((function(r){var a=o(r,2),i=a[0],l=a[1];switch(i){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:t.push(l);break;default:[].forEach.call(e.container.querySelectorAll(i),(function(e){e[x]=e[x]||[],e[x].push(l)}))}})),[t,n]}}]),t}(h.default);function z(e,t,n){return"object"===(void 0===t?"undefined":r(t))?Object.keys(t).reduce((function(e,n){return z(e,n,t[n])}),e):e.reduce((function(e,r){return r.attributes&&r.attributes[t]?e.push(r):e.insert(r.insert,(0,i.default)({},w({},t,n),r.attributes))}),new l.default)}function M(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};var t="__ql-computed-style";return e[t]||(e[t]=window.getComputedStyle(e))}function T(e,t){for(var n="",r=e.ops.length-1;r>=0&&n.length-1}function k(e,t,n){return e.nodeType===e.TEXT_NODE?n.reduce((function(t,n){return n(e,t)}),new l.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],(function(r,o){var a=k(o,t,n);return o.nodeType===e.ELEMENT_NODE&&(a=t.reduce((function(e,t){return t(o,e)}),a),a=(o[x]||[]).reduce((function(e,t){return t(o,e)}),a)),r.concat(a)}),new l.default):new l.default}function A(e,t,n){return z(n,e,!0)}function L(e,t){var n=s.default.Attributor.Attribute.keys(e),r=s.default.Attributor.Class.keys(e),o=s.default.Attributor.Style.keys(e),a={};return n.concat(r).concat(o).forEach((function(t){var n=s.default.query(t,s.default.Scope.ATTRIBUTE);null!=n&&(a[n.attrName]=n.value(e),a[n.attrName])||(null==(n=S[t])||n.attrName!==t&&n.keyName!==t||(a[n.attrName]=n.value(e)||void 0),null==(n=C[t])||n.attrName!==t&&n.keyName!==t||(n=C[t],a[n.attrName]=n.value(e)||void 0))})),Object.keys(a).length>0&&(t=z(t,a)),t}function R(e,t){var n=s.default.query(e);if(null==n)return t;if(n.prototype instanceof s.default.Embed){var r={},o=n.value(e);null!=o&&(r[n.blotName]=o,t=(new l.default).insert(r,n.formats(e)))}else"function"==typeof n.formats&&(t=z(t,n.blotName,n.formats(e)));return t}function N(e,t){return T(t,"\n")||(P(e)||t.length()>0&&e.nextSibling&&P(e.nextSibling))&&t.insert("\n"),t}function H(e,t){if(P(e)&&null!=e.nextElementSibling&&!T(t,"\n\n")){var n=e.offsetHeight+parseFloat(M(e).marginTop)+parseFloat(M(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+1.5*n&&t.insert("\n")}return t}function I(e,t){var n=e.data;if("O:P"===e.parentNode.tagName)return t.insert(n.trim());if(0===n.trim().length&&e.parentNode.classList.contains("ql-clipboard"))return t;if(!M(e.parentNode).whiteSpace.startsWith("pre")){var r=function(e,t){return(t=t.replace(/[^\u00a0]/g,"")).length<1&&e?" ":t};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,r.bind(r,!0)),(null==e.previousSibling&&P(e.parentNode)||null!=e.previousSibling&&P(e.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==e.nextSibling&&P(e.parentNode)||null!=e.nextSibling&&P(e.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return t.insert(n)}O.DEFAULTS={matchers:[],matchVisual:!0},t.default=O,t.matchAttributor=L,t.matchBlot=R,t.matchNewline=N,t.matchSpacing=H,t.matchText=I},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n '},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;nr.right&&(a=r.right-o.right,this.root.style.left=t+a+"px"),o.leftr.bottom){var i=o.bottom-o.top,l=e.bottom-e.top+i;this.root.style.top=n-l+"px",this.root.classList.add("ql-flip")}return a}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),e}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in o)return o.value;var i=o.get;return void 0!==i?i.call(r):void 0},o=function(){function e(e,t){for(var n=0;n','','',''].join(""),t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=N(n(29)),o=n(36),a=n(38),i=n(64),l=N(n(65)),s=N(n(66)),c=n(67),u=N(c),h=n(37),d=n(26),f=n(39),p=n(40),v=N(n(56)),m=N(n(68)),g=N(n(27)),y=N(n(69)),b=N(n(70)),w=N(n(71)),E=N(n(72)),x=N(n(73)),_=n(13),S=N(_),C=N(n(74)),O=N(n(75)),z=N(n(57)),M=N(n(41)),T=N(n(28)),P=N(n(59)),k=N(n(60)),A=N(n(61)),L=N(n(108)),R=N(n(62));function N(e){return e&&e.__esModule?e:{default:e}}r.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":h.BackgroundClass,"attributors/class/color":d.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":f.FontClass,"attributors/class/size":p.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":h.BackgroundStyle,"attributors/style/color":d.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":f.FontStyle,"attributors/style/size":p.SizeStyle},!0),r.default.register({"formats/align":o.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":i.IndentClass,"formats/background":h.BackgroundStyle,"formats/color":d.ColorStyle,"formats/font":f.FontClass,"formats/size":p.SizeClass,"formats/blockquote":l.default,"formats/code-block":S.default,"formats/header":s.default,"formats/list":u.default,"formats/bold":v.default,"formats/code":_.Code,"formats/italic":m.default,"formats/link":g.default,"formats/script":y.default,"formats/strike":b.default,"formats/underline":w.default,"formats/image":E.default,"formats/video":x.default,"formats/list/item":c.ListItem,"modules/formula":C.default,"modules/syntax":O.default,"modules/toolbar":z.default,"themes/bubble":L.default,"themes/snow":R.default,"ui/icons":M.default,"ui/picker":T.default,"ui/icon-picker":k.default,"ui/color-picker":P.default,"ui/tooltip":A.default},!0),t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentClass=void 0;var r,o=function(){function e(e,t){for(var n=0;n0&&this.children.tail.format(e,t)}},{key:"formats",value:function(){return e={},t=this.statics.blotName,n=this.statics.formats(this.domNode),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n}},{key:"insertBefore",value:function(e,n){if(e instanceof d)o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n);else{var r=null==n?this.length():n.offset(this),a=this.split(r);a.parent.insertBefore(e,a)}}},{key:"optimize",value:function(e){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){if(e.statics.blotName!==this.statics.blotName){var n=a.default.create(this.statics.defaultChild);e.moveChildren(n),this.appendChild(n)}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e)}}]),t}(l.default);f.blotName="list",f.scope=a.default.Scope.BLOCK_BLOT,f.tagName=["OL","UL"],f.defaultChild="list-item",f.allowedChildren=[d],t.ListItem=d,t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((r=n(56))&&r.__esModule?r:{default:r}).default);o.blotName="italic",o.tagName=["EM","I"],t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=a(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"==typeof e&&n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return s.reduce((function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t}),{})}},{key:"match",value:function(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}},{key:"sanitize",value:function(e){return(0,l.sanitize)(e,["http","https","data"])?e:"//:0"}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(i.default.Embed);c.blotName="image",c.tagName="IMG",t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=a(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return s.reduce((function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t}),{})}},{key:"sanitize",value:function(e){return l.default.sanitize(e)}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}(i.BlockEmbed);c.blotName="video",c.className="ql-video",c.tagName="IFRAME",t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FormulaBlot=void 0;var r=function(){function e(e,t){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=e(t),this.domNode.normalize(),this.attach()),this.cachedText=t)}}]),t}(s(n(13)).default);d.className="ql-syntax";var f=new a.default.Attributor.Class("token","hljs",{scope:a.default.Scope.INLINE}),p=function(e){function t(e,n){c(this,t);var r=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var o=null;return r.quill.on(i.default.events.SCROLL_OPTIMIZE,(function(){clearTimeout(o),o=setTimeout((function(){r.highlight(),o=null}),r.options.interval)})),r.highlight(),r}return h(t,e),r(t,null,[{key:"register",value:function(){i.default.register(f,!0),i.default.register(d,!0)}}]),r(t,[{key:"highlight",value:function(){var e=this;if(!this.quill.selection.composing){this.quill.update(i.default.sources.USER);var t=this.quill.getSelection();this.quill.scroll.descendants(d).forEach((function(t){t.highlight(e.options.highlight)})),this.quill.update(i.default.sources.SILENT),null!=t&&this.quill.setSelection(t,i.default.sources.SILENT)}}}]),t}(l.default);p.DEFAULTS={highlight:null==window.hljs?null:function(e){return window.hljs.highlightAuto(e).value},interval:1e3},t.CodeBlock=d,t.CodeToken=f,t.default=p},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BubbleTooltip=void 0;var r=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,r)}if("value"in o)return o.value;var i=o.get;return void 0!==i?i.call(r):void 0},o=function(){function e(e,t){for(var n=0;n0&&o===i.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var a=r.quill.getLines(t.index,t.length);if(1===a.length)r.position(r.quill.getBounds(t));else{var l=a[a.length-1],s=r.quill.getIndex(l),u=Math.min(l.length()-1,t.index+t.length-s),h=r.quill.getBounds(new c.Range(s,u));r.position(h)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()})),r}return p(t,e),o(t,[{key:"listen",value:function(){var e=this;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",(function(){e.root.classList.remove("ql-editing")})),this.quill.on(i.default.events.SCROLL_OPTIMIZE,(function(){setTimeout((function(){if(!e.root.classList.contains("ql-hidden")){var t=e.quill.getSelection();null!=t&&e.position(e.quill.getBounds(t))}}),1)}))}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(e){var n=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"position",this).call(this,e),o=this.root.querySelector(".ql-tooltip-arrow");if(o.style.marginLeft="",0===n)return n;o.style.marginLeft=-1*n-o.offsetWidth/2+"px"}}]),t}(l.BaseTooltip);g.TEMPLATE=['','
','','',"
"].join(""),t.BubbleTooltip=g,t.default=m},function(e,t,n){e.exports=n(63)}]).default},e.exports=t()},8151:function(e,t,n){var r,o,a;void 0===(a=this)&&void 0!==window&&(a=window),r=[n(8575),n(1347),n(5722),n(4854)],o=function(e,t,n,r){return a.rasterizeHTML=(o=t,i=n,l=r,s=function(e){"use strict";var t={},n=[];t.joinUrl=function(t,n){return t?e.resolve(t,n):n},t.getConstantUniqueIdFor=function(e){return n.indexOf(e)<0&&n.push(e),n.indexOf(e)},t.clone=function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n};return t.parseOptionalParameters=function(e){var n,r={canvas:null,options:{}};return null==e[0]||function(e){return"object"==typeof e&&null!==e}(n=e[0])&&Object.prototype.toString.apply(n).match(/\[object (Canvas|HTMLCanvasElement)\]/i)?(r.canvas=e[0]||null,r.options=t.clone(e[1])):r.options=t.clone(e[0]),r},t}(e),c=function(e){"use strict";var t={},n=function(e,t,n){var r=e[t];return e[t]=function(){var e=Array.prototype.slice.call(arguments);return n.apply(this,[e,r])},r};return t.baseUrlRespectingXhr=function(t,r){return function(){var o=new t;return n(o,"open",(function(t,n){var o=t.shift(),a=t.shift(),i=e.joinUrl(r,a);return n.apply(this,[o,i].concat(t))})),o}},t.finishNotifyingXhr=function(e){var t,r=0,o=0,a=!1,i=new Promise((function(e){t=function(){r-o<=0&&a&&e({totalCount:r})}})),l=function(){var a=new e;return n(a,"send",(function(e,t){return r+=1,t.apply(this,arguments)})),a.addEventListener("load",(function(){o+=1,t()})),a};return l.waitForRequestsToFinish=function(){return a=!0,t(),i},l},t}(s),u=function(){"use strict";var e={},t=function(e){return Array.prototype.slice.call(e)};e.addClassName=function(e,t){e.className+=" "+t},e.addClassNameRecursively=function(t,n){e.addClassName(t,n),t.parentNode!==t.ownerDocument&&e.addClassNameRecursively(t.parentNode,n)};var n=function(e,n){var r=e.cssText.replace(/^[^\{]+/,"");!function(e,n){var r=e.parentStyleSheet,o=t(r.cssRules).indexOf(e);r.insertRule(n,o+1),r.deleteRule(o)}(e,n+" "+r)},r=function(e){var n;e.textContent=(n=e.sheet.cssRules,t(n).reduce((function(e,t){return e+t.cssText}),""))},o=function(e,o,a){var i=function(e){return"((?:^|[^.#:\\w])|(?=\\W))("+e.join("|")+")(?=\\W|$)"}(o);t(e.querySelectorAll("style")).forEach((function(e){var o,l,s;void 0===e.sheet&&(o=e,l=document.implementation.createHTMLDocument(""),(s=document.createElement("style")).textContent=o.textContent,l.body.appendChild(s),o.sheet=s.sheet);var c=t(e.sheet.cssRules).filter((function(e){return e.selectorText&&new RegExp(i,"i").test(e.selectorText)}));c.length&&(c.forEach((function(e){var t=e.selectorText.replace(new RegExp(i,"gi"),(function(e,t,n){return t+a(n)}));t!==e.selectorText&&n(e,t)})),r(e))}))};return e.rewriteCssSelectorWith=function(e,t,n){o(e,[t],(function(){return n}))},e.lowercaseCssTypeSelectors=function(e,t){o(e,t,(function(e){return e.toLowerCase()}))},e.findHtmlOnlyNodeNames=function(e){var t,n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r={},o={};do{t=n.currentNode.tagName.toLowerCase(),"http://www.w3.org/1999/xhtml"===n.currentNode.namespaceURI?r[t]=!0:o[t]=!0}while(n.nextNode());return Object.keys(r).filter((function(e){return!o[e]}))},e}(),h=function(e){"use strict";var t={},n=function(e){return Array.prototype.slice.call(e)},r={active:!0,hover:!0,focus:!1,target:!1};return t.fakeUserAction=function(t,n,o){var a=t.querySelector(n),i=":"+o,l="rasterizehtml"+o;a&&(r[o]?e.addClassNameRecursively(a,l):e.addClassName(a,l),e.rewriteCssSelectorWith(t,i,"."+l))},t.persistInputValues=function(e){var t=e.querySelectorAll("input"),r=e.querySelectorAll("textarea"),o=function(e){return"checkbox"===e.type||"radio"===e.type};n(t).filter(o).forEach((function(e){e.checked?e.setAttribute("checked",""):e.removeAttribute("checked")})),n(t).filter((function(e){return!o(e)})).forEach((function(e){e.setAttribute("value",e.value)})),n(r).forEach((function(e){e.textContent=e.value}))},t.rewriteTagNameSelectorsToLowerCase=function(t){e.lowercaseCssTypeSelectors(t,e.findHtmlOnlyNodeNames(t))},t}(u),d=function(e,t,n,r){"use strict";var o={};o.executeJavascript=function(e,n){return new Promise((function(o){var a=function(e,t,n,r){var o=e.createElement(t);return o.style.visibility="hidden",o.style.width=n+"px",o.style.height=r+"px",o.style.position="absolute",o.style.top=-1e4-r+"px",o.style.left=-1e4-n+"px",e.getElementsByTagName("body")[0].appendChild(o),o}(r.document,"iframe",n.width,n.height),i=e.outerHTML,l=[],s=n.executeJsTimeout||0,c=function(){r.document.getElementsByTagName("body")[0].removeChild(a)},u=function(){var e=a.contentDocument;o({document:e,errors:l,cleanUp:c})},h=a.contentWindow.XMLHttpRequest,d=t.finishNotifyingXhr(h),f=t.baseUrlRespectingXhr(d,n.baseUrl);a.onload=function(){var e;(e=s,e>0?new Promise((function(t){setTimeout(t,e)})):Promise.resolve()).then(d.waitForRequestsToFinish).then(u)},a.contentDocument.open(),a.contentWindow.XMLHttpRequest=f,a.contentWindow.onerror=function(e){l.push({resourceType:"scriptExecution",msg:e})},a.contentDocument.write(""),a.contentDocument.write(i),a.contentDocument.close()}))};var a=function(e,t,n,o,a){var i,l,s,c,u,h,d,f=Math.max(e.scrollWidth,e.clientWidth),p=Math.max(e.scrollHeight,e.clientHeight);return t?(i=(h=function(e,t){var n=e.querySelector(t);if(n)return n;if(e.ownerDocument.querySelector(t)===e)return e;throw{message:"Clipping selector not found"}}(e,t).getBoundingClientRect()).top,l=h.left,s=h.width,c=h.height):(i=0,l=0,s=f,c=p),d=function(e,t,n,r){return{width:Math.max(e.width*r,t),height:Math.max(e.height*r,n)}}({width:s,height:c},n,o,a),u=r.getComputedStyle(e.ownerDocument.documentElement).fontSize,{left:l,top:i,width:d.width,height:d.height,viewportWidth:f,viewportHeight:p,rootFontSize:u}};o.calculateDocumentContentSize=function(e,t){return new Promise((function(n,o){var i,l=t.zoom||1;i=function(e,t,n){var o=Math.floor(e/n),a=Math.floor(t/n);return function(e,t,n){var r=e.createElement("iframe");return r.style.width=t+"px",r.style.height=n+"px",r.style.visibility="hidden",r.style.position="absolute",r.style.top=-1e4-n+"px",r.style.left=-1e4-t+"px",r.style.borderWidth=0,r.sandbox="allow-same-origin",r.scrolling="no",r}(r.document,o,a)}(t.width,t.height,l),r.document.getElementsByTagName("body")[0].appendChild(i),i.onload=function(){var s,c=i.contentDocument;try{s=a(function(e,t){var n=e.tagName;return t.querySelector(n)}(e,c),t.clip,t.width,t.height,l),n(s)}catch(e){o(e)}finally{r.document.getElementsByTagName("body")[0].removeChild(i)}},i.contentDocument.open(),i.contentDocument.write(""),i.contentDocument.write(function(e){var t=e.tagName.toLowerCase();return"html"===t||"body"===t?e.outerHTML:''+e.outerHTML+""}(e)),i.contentDocument.close()}))},o.parseHtmlFragment=function(e){var t=r.document.implementation.createHTMLDocument("");t.documentElement.innerHTML=e;var n=t.querySelector("body").firstChild;if(!n)throw"Invalid source";return n};o.parseHTML=function(e){var t=r.document.implementation.createHTMLDocument("");return t.documentElement.innerHTML=e,function(e,t){var n,o,a,i,l=/]*)?)>/im.exec(t),s=r.document.implementation.createHTMLDocument("");if(l)for(n="",s.documentElement.innerHTML=n,a=s.querySelector("div"),o=0;o"],{type:"text/xml"}),!0}catch(e){}return!1})()&&e.URL?(l=r(a,!0),i(l).then((function(e){return o(l),!e&&i(r(a,!1)).then((function(e){return e}))}),(function(){return!1}))).then((function(e){t(!e)}),(function(){n()})):t(!1)}))},s=function(e){return(void 0===t&&(t=l()),t).then((function(t){return r(e,t)}))};return n.renderSvg=function(e){return new Promise((function(t,n){var r,a,i=function(){r&&o(r)};(a=new Image).onload=function(){a.onload=null,a.onerror=null,i(),t(a)},a.onerror=function(){i(),n()},s(e).then((function(e){r=e,a.src=r}),n)}))},n}(window),p=function(e,t,n,r){"use strict";var o={},a=function(e){var t=Object.keys(e);return t.length?" "+t.map((function(t){return t+'="'+e[t]+'"'})).join(" "):""},i=function(e,n,o){var i=r.serializeToString(e);t.validateXHTML(i);var l,s,c=function(e){var t,n;return t=Math.round(e.viewportWidth),n=Math.round(e.viewportHeight),{x:-e.left,y:-e.top,width:t,height:n}}(n);return s=(l=c).style||"",l.style=s+"float: left;",function(e){e.externalResourcesRequired=!0}(c),'"+i+""};return o.getSvgForDocument=function(e,t,r){return n.rewriteTagNameSelectorsToLowerCase(e),i(e,t,r)},o.drawDocumentAsSvg=function(e,r){return["hover","active","focus","target"].forEach((function(t){r[t]&&n.fakeUserAction(e,r[t],t)})),t.calculateDocumentContentSize(e,r).then((function(t){return o.getSvgForDocument(e,t,r.zoom)}))},o}(0,d,h,o),v=function(e,t,n,r,o,a){"use strict";var i={},l=function(e){return{message:"Error rendering page",originalError:e}},s=function(e){return o.renderSvg(e).then((function(t){return{image:t,svg:e}}),(function(e){throw l(e)}))},c=function(e,t,n){return r.drawDocumentAsSvg(e,n).then(s).then((function(e){return t&&function(e,t){try{t.getContext("2d").drawImage(e,0,0)}catch(e){throw l(e)}}(e.image,t),e}))};return i.rasterize=function(r,o,i){var l;return(l=e.clone(i)).inlineScripts=!0===i.executeJs,a.inlineReferences(r,l).then((function(e){return i.executeJs?function(e,r){return t.executeJavascript(e,r).then((function(e){var t=e.document;return n.persistInputValues(t),{document:t,errors:e.errors,cleanUp:e.cleanUp}}))}(r,i).then((function(t){return{element:t.document.documentElement,errors:e.concat(t.errors),cleanUp:t.cleanUp}})):{element:r,errors:e,cleanUp:function(){}}})).then((function(e){return c(e.element,o,i).then((function(t){return e.cleanUp(),{image:t.image,svg:t.svg,errors:e.errors}}))}))},i}(s,d,h,p,f,l),m=function(e,t,n){"use strict";var r={};r.drawDocument=function(){var t=arguments[0],r=Array.prototype.slice.call(arguments,1),o=e.parseOptionalParameters(r),a=t.documentElement?t.documentElement:t;return n.rasterize(a,o.canvas,function(t){var n,r=function(e,t){var n=e?e.width:300,r=e?e.height:200;return{width:void 0!==t.width?t.width:n,height:void 0!==t.height?t.height:r}}(t.canvas,t.options);return(n=e.clone(t.options)).width=r.width,n.height=r.height,n}(o))};r.drawHTML=function(){var n=arguments[0],o=Array.prototype.slice.call(arguments,1),a=e.parseOptionalParameters(o);return function(e,n,o){var a=t.parseHTML(e);return r.drawDocument(a,n,o)}(n,a.canvas,a.options)};var o=function(n,o,a){return t.loadDocument(n,a).then((function(t){var i=function(t,n,r){var o=document.implementation.createHTMLDocument("");o.replaceChild(t.documentElement,o.documentElement);var a=r?e.clone(r):{};return r.baseUrl||(a.baseUrl=n),{document:o,options:a}}(t,n,a);return r.drawDocument(i.document,o,i.options)}))};return r.drawURL=function(){var t=arguments[0],n=Array.prototype.slice.call(arguments,1),r=e.parseOptionalParameters(n);return o(t,r.canvas,r.options)},r}(s,d,v),m);var o,i,l,s,c,u,h,d,f,p,v,m}.apply(t,r),void 0===o||(e.exports=o)},7830:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AlphaPicker:()=>Fn,BlockPicker:()=>Xr,ChromePicker:()=>Wa,CirclePicker:()=>Ia,CompactPicker:()=>$a,CustomPicker:()=>Ln,GithubPicker:()=>Ja,GooglePicker:()=>Hi,HuePicker:()=>ni,MaterialPicker:()=>ri,PhotoshopPicker:()=>hi,SketchPicker:()=>yi,SliderPicker:()=>xi,SwatchesPicker:()=>zi,TwitterPicker:()=>Ti,default:()=>Wa});var r=n(7294),o=n(9941),a={},i=function(e,t,n,r){var o=e+"-"+t+"-"+n+(r?"-server":"");if(a[o])return a[o];var i=function(e,t,n,r){if("undefined"==typeof document&&!r)return null;var o=r?new r:document.createElement("canvas");o.width=2*n,o.height=2*n;var a=o.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,o.width,o.height),a.fillStyle=t,a.fillRect(0,0,n,n),a.translate(n,n),a.fillRect(0,0,n,n),o.toDataURL()):null}(e,t,n,r);return a[o]=i,i},l=Object.assign||function(e){for(var t=1;ti?1:Math.round(100*u/i)/100,t.a!==h)return{h:t.h,s:t.s,l:t.l,a:h,source:"rgb"}}else{var d;if(r!==(d=c<0?0:c>a?1:Math.round(100*c/a)/100))return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}return null}(e,r.props.hsl,r.props.direction,r.props.a,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleChange),window.removeEventListener("mouseup",r.handleMouseUp)},d(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),h(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,t=this.props.rgb,n=(0,o.ZP)({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*t.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)"},pointer:{left:0,top:100*t.a+"%"}},overwrite:u({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return r.createElement("div",{style:n.alpha},r.createElement("div",{style:n.checkboard},r.createElement(c,{renderers:this.props.renderers})),r.createElement("div",{style:n.gradient}),r.createElement("div",{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},r.createElement("div",{style:n.pointer},this.props.pointer?r.createElement(this.props.pointer,this.props):r.createElement("div",{style:n.slider}))))}}]),t}(r.PureComponent||r.Component);var p=function(){function e(e,t){for(var n=0;n-1)){var o=n.getArrowOffset(),a=38===e.keyCode?r+o:r-o;n.setUpdatedValue(a,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId="rc-editable-input-"+m++,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),p(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value===this.state.value||e.value===this.props.value&&t.value===this.state.value||(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){return function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},this.props.label,e)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=(0,o.ZP)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return r.createElement("div",{style:t.wrap},r.createElement("input",{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?r.createElement("label",{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(r.PureComponent||r.Component);var y=function(){function e(e,t){for(var n=0;na?0:360*(-100*c/a+100)/100,n.h!==u)return{h:u,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var h;if(h=s<0?0:s>o?359:100*s/o*360/100,n.h!==h)return{h,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null}(e,r.props.direction,r.props.hsl,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},b(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),y(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.direction,n=void 0===t?"horizontal":t,a=(0,o.ZP)({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-100*this.props.hsl.h/360+100+"%"}}},{vertical:"vertical"===n});return r.createElement("div",{style:a.hue},r.createElement("div",{className:"hue-"+n,style:a.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},r.createElement("style",null,"\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n "),r.createElement("div",{style:a.pointer},this.props.pointer?r.createElement(this.props.pointer,this.props):r.createElement("div",{style:a.slider}))))}}]),t}(r.PureComponent||r.Component);var E=n(5697),x=n.n(E);const _=function(e,t){return e===t||e!=e&&t!=t},S=function(e,t){for(var n=e.length;n--;)if(_(e[n][0],t))return n;return-1};var C=Array.prototype.splice;function O(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},O.prototype.set=function(e,t){var n=this.__data__,r=S(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const z=O,M="object"==typeof global&&global&&global.Object===Object&&global;var T="object"==typeof self&&self&&self.Object===Object&&self;const P=M||T||Function("return this")(),k=P.Symbol;var A=Object.prototype,L=A.hasOwnProperty,R=A.toString,N=k?k.toStringTag:void 0;var H=Object.prototype.toString;var I=k?k.toStringTag:void 0;const V=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":I&&I in Object(e)?function(e){var t=L.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch(e){}var o=R.call(e);return r&&(t?e[N]=n:delete e[N]),o}(e):function(e){return H.call(e)}(e)},D=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},j=function(e){if(!D(e))return!1;var t=V(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},F=P["__core-js_shared__"];var B,U=(B=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"";var G=Function.prototype.toString;const q=function(e){if(null!=e){try{return G.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var W=/^\[object .+?Constructor\]$/,K=Function.prototype,Y=Object.prototype,Z=K.toString,$=Y.hasOwnProperty,X=RegExp("^"+Z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Q=function(e){return!(!D(e)||(t=e,U&&U in t))&&(j(e)?X:W).test(q(e));var t},J=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Q(n)?n:void 0},ee=J(P,"Map"),te=J(Object,"create");var ne=Object.prototype.hasOwnProperty;var re=Object.prototype.hasOwnProperty;function oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991},Ne=function(e){return null!=e&&Re(e.length)&&!j(e)};var He="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ie=He&&"object"==typeof module&&module&&!module.nodeType&&module,Ve=Ie&&Ie.exports===He?P.Buffer:void 0;const De=(Ve?Ve.isBuffer:void 0)||function(){return!1};var je=Function.prototype,Fe=Object.prototype,Be=je.toString,Ue=Fe.hasOwnProperty,Ge=Be.call(Object);var qe={};qe["[object Float32Array]"]=qe["[object Float64Array]"]=qe["[object Int8Array]"]=qe["[object Int16Array]"]=qe["[object Int32Array]"]=qe["[object Uint8Array]"]=qe["[object Uint8ClampedArray]"]=qe["[object Uint16Array]"]=qe["[object Uint32Array]"]=!0,qe["[object Arguments]"]=qe["[object Array]"]=qe["[object ArrayBuffer]"]=qe["[object Boolean]"]=qe["[object DataView]"]=qe["[object Date]"]=qe["[object Error]"]=qe["[object Function]"]=qe["[object Map]"]=qe["[object Number]"]=qe["[object Object]"]=qe["[object RegExp]"]=qe["[object Set]"]=qe["[object String]"]=qe["[object WeakMap]"]=!1;var We="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ke=We&&"object"==typeof module&&module&&!module.nodeType&&module,Ye=Ke&&Ke.exports===We&&M.process,Ze=function(){try{return Ke&&Ke.require&&Ke.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),$e=Ze&&Ze.isTypedArray;const Xe=$e?(Qe=$e,function(e){return Qe(e)}):function(e){return ze(e)&&Re(e.length)&&!!qe[V(e)]};var Qe;const Je=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var et=Object.prototype.hasOwnProperty;const tt=function(e,t,n){var r=e[t];et.call(e,t)&&_(r,n)&&(void 0!==n||t in e)||de(e,t,n)};var nt=/^(?:0|[1-9]\d*)$/;const rt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&nt.test(e))&&e>-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(pt),gt=function(e,t){return mt(function(e,t,n){return t=ft(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=ft(r.length-t,0),i=Array(a);++o1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=bt.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!D(n))return!1;var r=typeof t;return!!("number"==r?Ne(n)&&rt(t,n.length):"string"==r&&t in n)&&_(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++n=t||n<0||h&&e-c>=a}function v(){var e=xt();if(p(e))return m(e);l=setTimeout(v,function(e){var n=t-(e-s);return h?Lt(n,a-(e-c)):n}(e))}function m(e){return l=void 0,d&&r?f(e):(r=o=void 0,i)}function g(){var e=xt(),n=p(e);if(r=arguments,o=this,s=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(v,t),u?f(e):i}(s);if(h)return clearTimeout(l),l=setTimeout(v,t),f(s)}return void 0===l&&(l=setTimeout(v,t)),i}return t=kt(t)||0,D(n)&&(u=!!n.leading,a=(h="maxWait"in n)?At(kt(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),g.cancel=function(){void 0!==l&&clearTimeout(l),c=0,r=s=o=l=void 0},g.flush=function(){return void 0===l?i:m(xt())},g};var Nt=function(){function e(e,t){for(var n=0;no&&(s=o),c<0?c=0:c>a&&(c=a);var u=s/o,h=1-c/a;return{h:t.h,s:u,v:h,a:t.a,source:"hsv"}}(e,n.props.hsl,n.container),e)},n.handleMouseDown=function(e){n.handleChange(e);var t=n.getContainerRenderWindow();t.addEventListener("mousemove",n.handleChange),t.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return D(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Rt(e,t,{leading:r,maxWait:t,trailing:o})}((function(e,t,n){e(t,n)}),50),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),Nt(t,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:"unbindEventListeners",value:function(){var e=this.getContainerRenderWindow();e.removeEventListener("mousemove",this.handleChange),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.style||{},n=t.color,a=t.white,i=t.black,l=t.pointer,s=t.circle,c=(0,o.ZP)({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-100*this.props.hsv.v+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:a,black:i,pointer:l,circle:s}},{custom:!!this.props.style});return r.createElement("div",{style:c.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},r.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),r.createElement("div",{style:c.white,className:"saturation-white"},r.createElement("div",{style:c.black,className:"saturation-black"}),r.createElement("div",{style:c.pointer},this.props.pointer?r.createElement(this.props.pointer,this.props):r.createElement("div",{style:c.circle}))))}}]),t}(r.PureComponent||r.Component);const It=Ht,Vt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=pn(e,360),t=pn(t,100),n=pn(n,100),0===t)r=o=a=n;else{var l=n<.5?n*(1+t):n+t-n*t,s=2*n-l;r=i(s,l,e+1/3),o=i(s,l,e),a=i(s,l,e-1/3)}return{r:255*r,g:255*o,b:255*a}}(e.h,i,s),c=!0,u="hsl"),e.hasOwnProperty("a")&&(a=e.a)),a=fn(a),{ok:c,format:e.format||u,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Yt(e,t,n){e=pn(e,255),t=pn(t,255),n=pn(n,255);var r,o,a=Math.max(e,t,n),i=Math.min(e,t,n),l=(a+i)/2;if(a==i)r=o=0;else{var s=a-i;switch(o=l>.5?s/(2-a-i):s/(a+i),a){case e:r=(t-n)/s+(t>1)+720)%360;--t;)r.h=(r.h+o)%360,a.push(Kt(r));return a}function un(e,t){t=t||6;for(var n=Kt(e).toHsv(),r=n.h,o=n.s,a=n.v,i=[],l=1/t;t--;)i.push(Kt({h:r,s:o,v:a})),a=(a+l)%1;return i}Kt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=fn(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Zt(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Zt(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=Yt(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Yt(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return $t(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var a=[gn(Math.round(e).toString(16)),gn(Math.round(t).toString(16)),gn(Math.round(n).toString(16)),gn(bn(r))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*pn(this._r,255))+"%",g:Math.round(100*pn(this._g,255))+"%",b:Math.round(100*pn(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*pn(this._r,255))+"%, "+Math.round(100*pn(this._g,255))+"%, "+Math.round(100*pn(this._b,255))+"%)":"rgba("+Math.round(100*pn(this._r,255))+"%, "+Math.round(100*pn(this._g,255))+"%, "+Math.round(100*pn(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(dn[$t(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+Xt(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=Kt(e);n="#"+Xt(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Kt(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(tn,arguments)},brighten:function(){return this._applyModification(nn,arguments)},darken:function(){return this._applyModification(rn,arguments)},desaturate:function(){return this._applyModification(Qt,arguments)},saturate:function(){return this._applyModification(Jt,arguments)},greyscale:function(){return this._applyModification(en,arguments)},spin:function(){return this._applyModification(on,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(cn,arguments)},complement:function(){return this._applyCombination(an,arguments)},monochromatic:function(){return this._applyCombination(un,arguments)},splitcomplement:function(){return this._applyCombination(sn,arguments)},triad:function(){return this._applyCombination(ln,[3])},tetrad:function(){return this._applyCombination(ln,[4])}},Kt.fromRatio=function(e,t){if("object"==Gt(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:yn(e[r]));e=n}return Kt(e,t)},Kt.equals=function(e,t){return!(!e||!t)&&Kt(e).toRgbString()==Kt(t).toRgbString()},Kt.random=function(){return Kt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Kt.mix=function(e,t,n){n=0===n?0:n||50;var r=Kt(e).toRgb(),o=Kt(t).toRgb(),a=n/100;return Kt({r:(o.r-r.r)*a+r.r,g:(o.g-r.g)*a+r.g,b:(o.b-r.b)*a+r.b,a:(o.a-r.a)*a+r.a})},Kt.readability=function(e,t){var n=Kt(e),r=Kt(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Kt.isReadable=function(e,t,n){var r,o,a,i,l,s=Kt.readability(e,t);switch(o=!1,(a=n,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(l=(a.size||"small").toLowerCase())&&"large"!==l&&(l="small"),r={level:i,size:l}).level+r.size){case"AAsmall":case"AAAlarge":o=s>=4.5;break;case"AAlarge":o=s>=3;break;case"AAAsmall":o=s>=7}return o},Kt.mostReadable=function(e,t,n){var r,o,a,i,l=null,s=0;o=(n=n||{}).includeFallbackColors,a=n.level,i=n.size;for(var c=0;cs&&(s=r,l=Kt(t[c]));return Kt.isReadable(e,l,{level:a,size:i})||!o?l:(n.includeFallbackColors=!1,Kt.mostReadable(e,["#fff","#000"],n))};var hn=Kt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",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:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",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",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},dn=Kt.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(hn);function fn(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function pn(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function vn(e){return Math.min(1,Math.max(0,e))}function mn(e){return parseInt(e,16)}function gn(e){return 1==e.length?"0"+e:""+e}function yn(e){return e<=1&&(e=100*e+"%"),e}function bn(e){return Math.round(255*parseFloat(e)).toString(16)}function wn(e){return mn(e)/255}var En,xn,_n,Sn=(xn="[\\s|\\(]+("+(En="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+En+")[,|\\s]+("+En+")\\s*\\)?",_n="[\\s|\\(]+("+En+")[,|\\s]+("+En+")[,|\\s]+("+En+")[,|\\s]+("+En+")\\s*\\)?",{CSS_UNIT:new RegExp(En),rgb:new RegExp("rgb"+xn),rgba:new RegExp("rgba"+_n),hsl:new RegExp("hsl"+xn),hsla:new RegExp("hsla"+_n),hsv:new RegExp("hsv"+xn),hsva:new RegExp("hsva"+_n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Cn(e){return!!Sn.CSS_UNIT.exec(e)}var On=function(e){var t=0,n=0;return Ut(["r","g","b","a","h","s","l","v"],(function(r){e[r]&&(t+=1,isNaN(e[r])||(n+=1),"s"===r||"l"===r)&&/^\d+%$/.test(e[r])&&(n+=1)})),t===n&&e},zn=function(e,t){var n=e.hex?Kt(e.hex):Kt(e),r=n.toHsl(),o=n.toHsv(),a=n.toRgb(),i=n.toHex();return 0===r.s&&(r.h=t||0,o.h=t||0),{hsl:r,hex:"000000"===i&&0===a.a?"transparent":"#"+i,rgb:a,hsv:o,oldHue:e.h||t||r.h,source:e.source}},Mn=function(e){if("transparent"===e)return!0;var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&Kt(e).isValid()},Tn=function(e){if(!e)return"#fff";var t=zn(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"},Pn=function(e,t){return Kt(t+" ("+e.replace("°","")+")")._ok},kn=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function o(){var e,t,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);for(var r=arguments.length,a=Array(r),i=0;il))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=2&n?new Gn:void 0;for(a.set(e,t),a.set(t,e);++h1&&(e.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(100*e.a)/100,source:"rgb"},t)):(e.h||e.s||e.l)&&("string"==typeof e.s&&e.s.includes("%")&&(e.s=e.s.replace("%","")),"string"==typeof e.l&&e.l.includes("%")&&(e.l=e.l.replace("%","")),1==e.s?e.s=.01:1==e.l&&(e.l=.01),n.props.onChange({h:e.h||n.props.hsl.h,s:Number(Va(e.s)?n.props.hsl.s:e.s),l:Number(Va(e.l)?n.props.hsl.l:e.l),source:"hsl"},t))},n.showHighlight=function(e){e.currentTarget.style.background="#eee"},n.hideHighlight=function(e){e.currentTarget.style.background="transparent"},1!==e.hsl.a&&"hex"===e.view?n.state={view:"rgb"}:n.state={view:e.view},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),ja(t,[{key:"render",value:function(){var e=this,t=(0,o.ZP)({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),n=void 0;return"hex"===this.state.view?n=r.createElement("div",{style:t.fields,className:"flexbox-fix"},r.createElement("div",{style:t.field},r.createElement(g,{style:{input:t.input,label:t.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):"rgb"===this.state.view?n=r.createElement("div",{style:t.fields,className:"flexbox-fix"},r.createElement("div",{style:t.field},r.createElement(g,{style:{input:t.input,label:t.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),r.createElement("div",{style:t.field},r.createElement(g,{style:{input:t.input,label:t.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),r.createElement("div",{style:t.field},r.createElement(g,{style:{input:t.input,label:t.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),r.createElement("div",{style:t.alpha},r.createElement(g,{style:{input:t.input,label:t.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):"hsl"===this.state.view&&(n=r.createElement("div",{style:t.fields,className:"flexbox-fix"},r.createElement("div",{style:t.field},r.createElement(g,{style:{input:t.input,label:t.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),r.createElement("div",{style:t.field},r.createElement(g,{style:{input:t.input,label:t.label},label:"s",value:Math.round(100*this.props.hsl.s)+"%",onChange:this.handleChange})),r.createElement("div",{style:t.field},r.createElement(g,{style:{input:t.input,label:t.label},label:"l",value:Math.round(100*this.props.hsl.l)+"%",onChange:this.handleChange})),r.createElement("div",{style:t.alpha},r.createElement(g,{style:{input:t.input,label:t.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),r.createElement("div",{style:t.wrap,className:"flexbox-fix"},n,r.createElement("div",{style:t.toggle},r.createElement("div",{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},r.createElement(Da.Z,{style:t.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return 1!==e.hsl.a&&"hex"===t.view?{view:"rgb"}:null}}]),t}(r.Component);Fa.defaultProps={view:"hex"};const Ba=Fa,Ua=function(){var e=(0,o.ZP)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return r.createElement("div",{style:e.picker})},Ga=function(){var e=(0,o.ZP)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return r.createElement("div",{style:e.picker})};var qa=function(e){var t=e.width,n=e.onChange,a=e.disableAlpha,i=e.rgb,l=e.hsl,s=e.hsv,u=e.hex,h=e.renderers,d=e.styles,p=void 0===d?{}:d,v=e.className,m=void 0===v?"":v,g=e.defaultView,y=(0,o.ZP)(yt({default:{picker:{width:t,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},p),{disableAlpha:a});return r.createElement("div",{style:y.picker,className:"chrome-picker "+m},r.createElement("div",{style:y.saturation},r.createElement(It,{style:y.Saturation,hsl:l,hsv:s,pointer:Ga,onChange:n})),r.createElement("div",{style:y.body},r.createElement("div",{style:y.controls,className:"flexbox-fix"},r.createElement("div",{style:y.color},r.createElement("div",{style:y.swatch},r.createElement("div",{style:y.active}),r.createElement(c,{renderers:h}))),r.createElement("div",{style:y.toggles},r.createElement("div",{style:y.hue},r.createElement(w,{style:y.Hue,hsl:l,pointer:Ua,onChange:n})),r.createElement("div",{style:y.alpha},r.createElement(f,{style:y.Alpha,rgb:i,hsl:l,pointer:Ua,renderers:h,onChange:n})))),r.createElement(Ba,{rgb:i,hsl:l,hex:u,view:g,onChange:n,disableAlpha:a})))};qa.propTypes={width:x().oneOfType([x().string,x().number]),disableAlpha:x().bool,styles:x().object,defaultView:x().oneOf(["hex","rgb","hsl"])},qa.defaultProps={width:225,disableAlpha:!1,styles:{}};const Wa=Ln(qa),Ka=function(e){var t=e.color,n=e.onClick,a=void 0===n?function(){}:n,i=e.onSwatchHover,l=e.active,s=(0,o.ZP)({default:{color:{background:t,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:Tn(t),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:l,"color-#FFFFFF":"#FFFFFF"===t,transparent:"transparent"===t});return r.createElement(Vn,{style:s.color,color:t,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+t}},r.createElement("div",{style:s.dot}))},Ya=function(e){var t=e.hex,n=e.rgb,a=e.onChange,i=(0,o.ZP)({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:t},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),l=function(e,t){e.r||e.g||e.b?a({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,source:"rgb"},t):a({hex:e.hex,source:"hex"},t)};return r.createElement("div",{style:i.fields,className:"flexbox-fix"},r.createElement("div",{style:i.active}),r.createElement(g,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:t,onChange:l}),r.createElement(g,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:n.r,onChange:l}),r.createElement(g,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:n.g,onChange:l}),r.createElement(g,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:n.b,onChange:l}))};var Za=function(e){var t=e.onChange,n=e.onSwatchHover,a=e.colors,i=e.hex,l=e.rgb,s=e.styles,c=void 0===s?{}:s,u=e.className,h=void 0===u?"":u,d=(0,o.ZP)(yt({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},c)),f=function(e,n){e.hex?Mn(e.hex)&&t({hex:e.hex,source:"hex"},n):t(e,n)};return r.createElement(Et,{style:d.Compact,styles:c},r.createElement("div",{style:d.compact,className:"compact-picker "+h},r.createElement("div",null,Yr(a,(function(e){return r.createElement(Ka,{key:e,color:e,active:e.toLowerCase()===i,onClick:f,onSwatchHover:n})})),r.createElement("div",{style:d.clear})),r.createElement(Ya,{hex:i,rgb:l,onChange:f})))};Za.propTypes={colors:x().arrayOf(x().string),styles:x().object},Za.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};const $a=Ln(Za),Xa=(0,o.tz)((function(e){var t=e.hover,n=e.color,a=e.onClick,i=e.onSwatchHover,l={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=(0,o.ZP)({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:l}},{hover:t});return r.createElement("div",{style:s.swatch},r.createElement(Vn,{color:n,onClick:a,onHover:i,focusStyle:l}))}));var Qa=function(e){var t=e.width,n=e.colors,a=e.onChange,i=e.onSwatchHover,l=e.triangle,s=e.styles,c=void 0===s?{}:s,u=e.className,h=void 0===u?"":u,d=(0,o.ZP)(yt({default:{card:{width:t,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},c),{"hide-triangle":"hide"===l,"top-left-triangle":"top-left"===l,"top-right-triangle":"top-right"===l,"bottom-left-triangle":"bottom-left"===l,"bottom-right-triangle":"bottom-right"===l}),f=function(e,t){return a({hex:e,source:"hex"},t)};return r.createElement("div",{style:d.card,className:"github-picker "+h},r.createElement("div",{style:d.triangleShadow}),r.createElement("div",{style:d.triangle}),Yr(n,(function(e){return r.createElement(Xa,{color:e,key:e,onClick:f,onSwatchHover:i})})))};Qa.propTypes={width:x().oneOfType([x().string,x().number]),colors:x().arrayOf(x().string),triangle:x().oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:x().object},Qa.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};const Ja=Ln(Qa);var ei=Object.assign||function(e){for(var t=1;t.5});return r.createElement("div",{style:n.picker})},ii=function(){var e=(0,o.ZP)({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return r.createElement("div",{style:e.pointer},r.createElement("div",{style:e.left},r.createElement("div",{style:e.leftInside})),r.createElement("div",{style:e.right},r.createElement("div",{style:e.rightInside})))},li=function(e){var t=e.onClick,n=e.label,a=e.children,i=e.active,l=(0,o.ZP)({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return r.createElement("div",{style:l.button,onClick:t},n||a)},si=function(e){var t=e.rgb,n=e.currentColor,a=(0,o.ZP)({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:n,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return r.createElement("div",null,r.createElement("div",{style:a.label},"new"),r.createElement("div",{style:a.swatches},r.createElement("div",{style:a.new}),r.createElement("div",{style:a.current})),r.createElement("div",{style:a.label},"current"))};var ci=function(){function e(e,t){for(var n=0;n100&&(e.a=100),e.a/=100,t({h:a.h,s:a.s,l:a.l,a:e.a,source:"rgb"},r))};return r.createElement("div",{style:s.fields,className:"flexbox-fix"},r.createElement("div",{style:s.double},r.createElement(g,{style:{input:s.input,label:s.label},label:"hex",value:i.replace("#",""),onChange:c})),r.createElement("div",{style:s.single},r.createElement(g,{style:{input:s.input,label:s.label},label:"r",value:n.r,onChange:c,dragLabel:"true",dragMax:"255"})),r.createElement("div",{style:s.single},r.createElement(g,{style:{input:s.input,label:s.label},label:"g",value:n.g,onChange:c,dragLabel:"true",dragMax:"255"})),r.createElement("div",{style:s.single},r.createElement(g,{style:{input:s.input,label:s.label},label:"b",value:n.b,onChange:c,dragLabel:"true",dragMax:"255"})),r.createElement("div",{style:s.alpha},r.createElement(g,{style:{input:s.input,label:s.label},label:"a",value:Math.round(100*n.a),onChange:c,dragLabel:"true",dragMax:"100"})))};var fi=Object.assign||function(e){for(var t=1;t{"use strict";var r=n(7294),o=n(3840);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n