PageSourceSearch

https://draft-js-rte-evanmorrison.netlify.app/_next/static/chunks/pages/index-f2103151bbfe6ee1.js

js draft-js-rte-evanmorrison.netlify.app collected 2026-10-03 10:39:58 UTC 113,665 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{41020:function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return ro}});var r=o(67294),n=o(9008),l=o(159),i=o(91164),a=o(3905);const s=["components"],c={};function d(e){let{components:t}=e,o=(0,i.Z)(e,s);return(0,a.kt)("wrapper",(0,l.Z)({},c,o,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",null,"Rich Text Editor"),(0,a.kt)("hr",null),(0,a.kt)("p",null,"This is a rich text editor I created. It is built on the ",(0,a.kt)("a",{parentName:"p",href:"https://draftjs.org"},"Draft.js")," framework for React. The Github repo for this demo is ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/EvanMorrison/draft-js-rte"},"here"),". You can see other examples of my work at ",(0,a.kt)("a",{parentName:"p",href:"https://evmorrison.com"},"evmorrison.com"),"."),(0,a.kt)("p",null,"Notable features include:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"support for tables"),(0,a.kt)("li",{parentName:"ul"},"insert and resize images"),(0,a.kt)("li",{parentName:"ul"},"insert and edit links",(0,a.kt)("br",null),(0,a.kt)("br",null))))}d.isMDXComponent=!0;var p=o(67814),u=o(70917);const g=e=>{const t={border:e.border,color:e.color,"data-testid":e.testid,fixedWidth:e.fixedWidth,flip:e.flip,icon:function(e){const t=e.substring(0,e.length-4);return e.length-e.indexOf("reg")===3?["far",t]:e.length-e.indexOf("lgt")===3?["fal",t]:(e.length-e.indexOf("sld")===3||console.error("You have not provided a valid icon type"),["fas",t])}(e.name),inverse:e.inverse,listItem:e.listItem,onClick:t=>e.onClick(t),pulse:e.pulse,rotation:e.rotation,size:e.size,spin:e.spin,style:e.style,title:e.title,transform:e.transform};return(0,u.tZ)(p.G,t)};g.componentDescription="Icon library.",g.componentKey="icon",g.componentName="Icon",g.defaultProps={onClick:()=>{}};var f=g,h=o(82192);var m=(0,h.Z)("label",{target:"epbqw830",label:"LabelStyle"})("&.form-label{display:block;line-height:16px;font-size:14px;color:",(e=>e.theme.colors.inputLabel),";text-align:left;width:fit-content;margin:0;padding:0;overflow-y:hidden;border-radius:2px;.label-content{color:",(e=>e.theme.colors.inputLabel),";}.required-star{color:",(e=>e.theme.colors.danger),";padding-left:3px;}&.disabled{opacity:0.6;}&.error{.error-text{display:inline-block;font-weight:",(e=>e.theme.fontWeights[2]),";}.label-content{color:",(e=>e.theme.colors.danger),";.error-text{color:",(e=>e.theme.colors.danger),";}}}&.size-sm{font-size:12px;line-height:14px;}&.size-lg{font-size:16px;line-height:18px;}}"),b=o(1263),y=o(96486);const x=e=>{const t=["form-label",`size-${e.size}`,e.disabled&&"disabled",e.errors.length>0&&"error"].filter(Boolean).join(" ");return(0,u.tZ)(m,{className:t,htmlFor:e.name,onClick:()=>e.onClick()},e.children,(0,u.tZ)("div",{className:"label-content"},e.label,(0,y.isNil)(e.label)||(0,y.isEmpty)(e.label)||!e.required?null:(0,u.tZ)("span",{className:"required-star"},"*"),function(){if(0===e.errors.length)return null;const t=e.errors.map((e=>b.Z.translate(e)));return(0,u.tZ)("div",{className:"error-text"},"\xa0-\xa0",t.join(", "))}()))};x.componentDescription="Badge for emphasising important numbers.",x.componentKey="label",x.componentName="Form field label",x.defaultProps={disabled:!1,errors:[],onClick:()=>{},required:!1,size:"md"};var k=x,v=(0,h.Z)("div",{target:"e13cia7i0"})("&.checkbox{display:inline-block;vertical-align:top;cursor:pointer;input[type='checkbox']{position:absolute;left:-9999px;}svg{fill:",(e=>e.theme.colors.checkbox),";}&.disabled{cursor:not-allowed;opacity:0.5;}label.form-label.size-sm{font-size:14px;}label.form-label.size-lg{font-size:18px;.label-content{margin-left:28px;}}label.form-label{position:relative;overflow-y:visible;display:inline-block;opacity:0.8;line-height:22px;height:22px;font-size:16px;color:",(e=>e.theme.colors.textOnPageBackground),";cursor:pointer;user-select:text;span.fa-layers{position:absolute;top:0;bottom:0;margin:auto;}&:focus-within{svg:first-of-type{border-radius:15%;border-color:",(e=>e.theme.colors.info),";box-shadow:0 0 8px 0 ",(e=>e.theme.colors.info),";}}&.disabled{cursor:not-allowed;opacity:0.5;}.label-content{display:block;margin-left:20px;color:",(e=>
1e.theme.colors.textOnPageBackground),";}&.error .label-content{color:",(e=>e.theme.colors.danger),";.error-text{font-size:14px;}}}}&.checked{label.form-label{opacity:1;&.disabled{opacity:0.5;}}}"),S=o(28650);const w=["testid"],C=r.forwardRef(((e,t)=>{let{testid:o}=e,r=(0,i.Z)(e,w);const n=(0,S.u)();function a(e){r.disabled||r.onCheck(!r.checkStatus,e)}const s=r.checkStatus?"check-square-sld":"square-sld",c=["checkbox",r.checkStatus?"checked":"unchecked",r.disabled&&"disabled",r.className,`size-${r.size}`].filter(Boolean).join(" ");return r.noLabel?(0,u.tZ)(v,{className:c},(0,u.tZ)("input",{type:"checkbox",disabled:r.disabled,ref:t}),(0,u.tZ)("span",{className:"fa-layers"},(0,u.tZ)(f,(0,l.Z)({},r,{color:r.fillColor||n.colors.pageBackground,name:"square-sld",size:"md"===r.size?null:r.size})),(0,u.tZ)(f,(0,l.Z)({},r,{color:r.color||n.colors.checkbox,name:s,size:"md"===r.size?null:r.size,onClick:a,testid:o})))):(0,u.tZ)(v,{className:c},(0,u.tZ)(k,(0,l.Z)({},r,{for:r.name,errors:r.error}),(0,u.tZ)("input",{name:r.name,id:r.name,type:"checkbox",disabled:r.disabled,onClick:a,ref:t}),(0,u.tZ)("span",{className:"fa-layers"},(0,u.tZ)(f,(0,l.Z)({}
1,r,{color:r.fillColor||n.colors.pageBackground,name:"square-sld",size:"md"===r.size?null:r.size})),(0,u.tZ)(f,(0,l.Z)({},r,{color:r.color||n.colors.checkbox,name:s,size:"md"===r.size?null:r.size,testid:null!==o&&void 0!==o?o:r.name})))))}));C.componentDescription="Checkbox to toggle check/uncheck",C.componentKey="checkbox",C.componentName="Checkbox",C.displayName="Checkbox",C.defaultProps={onCheck:()=>{},size:"md"};var D=C,E=(0,h.Z)("input",{target:"e1tnvp1j0"})("&.input{width:100%;height:32px;padding:0 6px;border-radius:5px;border:1px solid ",(e=>e.theme.colors.inputBorder),";transition:border 200ms ease;color:",(e=>e.theme.colors.textOnPageBackground),";background:",(e=>e.theme.colors.pageBackground),";font-size:16px;&.size-lg{height:36px;font-size:18px;}&.size-sm{height:26px;font-size:14px;}&.currency{padding-left:18px;}&::placeholder{opacity:0.75;font-weight:",(e=>e.theme.fontWeights[0]),";}&:-ms-input-placeholder{opacity:0.75;font-weight:",(e=>e.theme.fontWeights[0]),";}&:focus{border-color:",(e=>e.theme.colors.info),";box-shadow:0 0 8px -1px ",(e=>e.theme.colors.info),";}&:disabled{cursor:not-allowed;user-select:none;background:",(e=>e.theme.colors.inputDisabled),";opacity:0.6;}&.error{border-color:",(e=>e.theme.colors.danger),";background:",(e=>
1e.theme.colors.pageBackground),";}&[type='number']{padding-right:0;}}");const O=r.forwardRef(((e,t)=>{var o;const r=["input",`input-name-${e.name}`,`size-${e.size}`,e.error&&"error","currency"===e.type&&"currency"].filter(Boolean).join(" "),n={disabled:e.disabled,hidden:"hidden"===e.type,id:e.name,maxLength:e.maxLength,name:e.name,onBlur:e.onBlur,onChange:function(t){e.onChange(t.target.value)},onFocus:e.onFocus,onKeyDown:e.onKeyDown,placeholder:e.placeholder,type:["number","password","hidden"].includes(e.type)?e.type:"text",value:null!==(o=e.value)&&void 0!==o?o:"",autoComplete:e.autoComplete};return(0,u.tZ)(E,(0,l.Z)({className:r},n,{ref:t}))}));O.componentDescription="Form input element. Used for all form inputs.",O.componentKey="Form field input",O.componentName="Form field input",O.displayName="Input",O.defaultProps={onChange:()=>{},onFocus:()=>{},onBlur:()=>{},onKeyDown:()=>{},size:"md"};var B=O,T=(0,h.Z)("div",{target:"e15avsa90"})("&.info-note{font-size:12px;color:",(e=>e.theme.colors.inputNote),";opacity:0.7;margin-bottom:3px;}");const Z=({info:e})=>!(0,y.isNil)(e)&&(0,u.tZ)(T,{className:"info-note"},e);Z.componentDescription="Information.",Z.componentKey="info",Z.componentName="Form field note";var L=Z,N=o(92809),$=(0,h.Z)("div",{target:"esf0o520"})("display:flex;.group{display:flex;flex-wrap:wrap;flex:1 1 50%;margin:8px;.heading{flex:0 0 100%;line-height:2rem;}.swatch{width:",(e=>(e.dropdownWidth/2-(e.columns+16))/e.columns),"px;height:",(e=>(e.dropdownWidth/2-(e.columns+16))/e.columns),"px;display:inline-block;margin:0;padding:0;border:0.5px solid #eeeeee;:hover{cursor:pointer;}}.reset{flex:0 0 100%;text-align:center;:hover{cursor:pointer;}}}");var K=e=>{const{list:t,dropdownWidth:o}=e,r=t.length,n={count:r,dropdownWidth:o,columns:5};return(0,u.tZ)($,n,(0,u.tZ)("div",{className:"group"},(0,u.tZ)("div",{className:"heading"},"TEXT"),t.slice(0,r/2).map((t=>(0,u.tZ)("div",{className:"swatch",key:t.type,style:{backgroundColor:t.display.name},onClick:()=>e.handleSubmit(t.type)}))),(0,u.tZ)("div",{className:"reset",onClick:()=>e.handleSubmit("color.unset")},"reset")),(0,u.tZ)("div",{className:"group"},(0,u.tZ)("div",{className:"heading"},"BACKGROUND"),t.slice(r/2).map((t=>(0,u.tZ)("div",{className:"swatch",key:t.type,style:{backgroundColor:t.display.name},onClick:()=>e.handleSubmit(t.type)}))),(0,u.tZ)("div",{className:"reset",onClick:()=>e.handleSubmit("backgroundColor.unset")},"reset")))},R=(0,h.Z)("div",{target:"eioxrwi0"})("&.tooltip{border-radius:5px;background-color:",(e=>
1e.theme.colors.pageBackground),";color:",(e=>e.theme.colors.textOnPageBackground),";border:2px solid ",(e=>e.theme.colors.border),";box-shadow:2px 2px 14px -7px ",(e=>e.theme.colors.shadowOnPage),";z-index:",(e=>e.theme.zIndexes.modalOverlayModal+100),";padding:6px 12px;white-space:pre-wrap;width:max-content;&:before,&:after{content:'';position:absolute;width:0;height:0;border-style:solid;}&:before{border-width:12px;}&:after{border-width:10px;}&.lg{font-size:14px;line-height:18px;}&.md{font-size:12px;line-height:14px;}&.sm{font-size:11px;line-height:12px;padding:4px 8px;:before{border-width:8px;}:after{border-width:6px;}}&.top{&:before{top:100%;border-color:",(e=>e.theme.colors.border)," transparent transparent transparent;border-bottom-width:0;}&:after{top:100%;border-color:",(e=>e.theme.colors.pageBackground)," transparent transparent transparent;border-bottom-width:0;}}&.right{&:before{right:100%;border-color:transparent ",(e=>e.theme.colors.border)," transparent transparent;border-left-width:0;}&:after{right:100%;border-color:transparent ",(e=>
1e.theme.colors.pageBackground)," transparent transparent;border-left-width:0;}}&.bottom{&:before{bottom:100%;border-color:transparent transparent ",(e=>e.theme.colors.border)," transparent;border-top-width:0;}&:after{bottom:100%;border-color:transparent transparent ",(e=>e.theme.colors.pageBackground)," transparent;border-top-width:0;}}&.left{&:before{left:100%;border-color:transparent transparent transparent ",(e=>e.theme.colors.border),";border-right-width:0;}&:after{left:100%;border-color:transparent transparent transparent ",(e=>e.theme.colors.pageBackground),";border-right-width:0;}}}");const F=e=>{var t,o;const n=(0,r.useRef)(null),l=(0,r.useRef)(null),i=(0,r.useRef)(null);(0,r.useEffect)((()=>{i.current=new ResizeObserver((()=>{const{x:e,y:t}=d.current,o=l.current.getBoundingClientRect();o.left<=e&&o.right>=e&&o.top<=t&&o.bottom>=t?p.current=!0:(p.current=!1,f(!1)),m(o)}))}),[]);const a=(0,r.useRef)(null),{0:s,1:c}=(0,r.useState)(0),d=(0,r.useRef)({}),p=(0,r.useRef)(!1),{0:g,1:f}=(0,r.useState)(!1),{0:h,1:m}=(0,r.useState)({x:0,y:0}),b=(0,r.useRef)(e.anchor);(0,r.useEffect)((()=>{b.current=e.anchor}),[e.anchor]),(0,r.useEffect)((()=>{var e,t,o,r,a,s;null!==(e=b.current)&&void 0!==e&&e.getBoundingClientRect?l.current=b:l.current=null!==(o=null!==(r=document.querySelector(b.current))&&void 0!==r?r:null===(a=n.current)||void 0===a?void 0:a.offsetParent)&&void 0!==o?o:null===(s=n.current)||void 0===s?void 0:s.parentNode;const c=i.current;l.current&&c.observe(l.current);const u=()=>{p.current=!0,m(l.current.getBoundingClientRect())},g=e=>{var t,o;d.current={x:e.clientX,y:e.clientY},(null===(t=l.current)||void 0===t||!t.contains(e.target)||null!==(o=n.current)&&void 0!==o&&o.contains(e.target))&&(p.current=!1,f(!1))},h=e=>{var t,o;null!==(t=l.current)&&void 0!==t&&t.contains(e.target)?m(null===(o=l.current)||void 0===o?void 0:o.getBoundingClientRect()):(p.current=!1,f(!1))};return null===(t=l.current)||void 0===t||t.addEventListener("mouseenter",u),window.addEventListener("mousemove",g),window.addEventListener("wheel",h),()=>{var e;null===(e=l.current)||void 0===e||e.removeEventListener("mouseenter",u),window.removeEventListener("mousemove",g),window.removeEventListener("wheel",h),c.disconnect()}}),[]),(0,r.useEffect)((()=>{var t,o;null!==(t=e.container)&&void 0!==t&&t.getBoundingClientRect?a.current=e.container:a.current=null!==(o=document.querySelector(e.container))&&void 0!==o?o:{getBoundingClientRect:()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight})}}),[e.container]),(0,r.useEffect)((()=>{if(h.width){const t=n.current.getBoundingClientRect(),o=a.current.getBoundingClientRect();if(/^top$|^bottom$/.test(e.orientation)){const e=o.left-(h.left+h.width/2-t.width/2),r=o.right-(h.right-h.width/2+t.width/2);c(e>0?e+6:r<0?r-6:0)}else{const e=o.top-(h.top+h.height/2-t.height/2),r=o.bottom-(h.bottom-h.height/2+t.height/2);c(e>0?e+6:r<0?r-6:0)}}p.current&&f(!0)}),[h,e.orientation,e.children]);const y=null!==(t=null===(o=n.current)||void 0===o?void 0:o.getBoundingClientRect())&&void 0!==t?t:{},x="sm"===e.size?6:10,k="sm"===e.size?8:12;return(0,u.tZ)(R,{className:`tooltip ${e.orientation} ${e.size}`,ref:n,css:[{position:l.current?"fixed":"absolute",opacity:0,visibility:"hidden",transition:"300ms ease",transitionProperty:"opacity visibility"},g&&{opacity:1,visibility:"visible",transition:"300ms 200ms ease"},/^top$|^bottom$/.test(e.orientation)&&{":before":{left:`calc(50% - ${k}px - ${s}px)`},":after":{left:`calc(50% - ${x}px - ${s}px)`}},/^left$|^right$/.test(e.orientation)&&{":before":{top:`calc(50% - ${k}px - ${s}px)`},":after":{top:`calc(50% - ${x}px - ${s}px)`}},"top"===e.orientation&&{top:h.top-y.height-k+"px",left:h.left+h.width/2+s-y.width/2+"px"},"bottom"===e.orientation&&{top:`${h.top+h.height+k}px`,left:h.left+h.width/2+s-y.width/2+"px"},"left"===e.orientation&&{top:h.top+h.height/2+s-y.height/2+"px",left:h.left-y.width-k+"px"},"right"===e.orientation&&{top:h.top+h.height/2+s-y.height/2+"px",left:`${h.left+h.width+k}px`},{maxWidth:e.maxWidth},{[`&.tooltip.${e.orientation}.${e.size}`]:e.className},";label:Tooltip;"],"data-testid":g?"tooltip-in":"tooltip-out"},e.children)};F.componentDescription="Informational tooltip.",F.componentKey="tooltip",F.componentName="Tooltip",F.defaultProps={maxWidth:380,orientation:"top",size:"md"};var A=F;var z={name:"xb2irl-Button",styles:"position:relative;label:Button;"};const P=e=>{const t=[[e.style],"rich-editor-style-button",e.active&&"rich-editor-active-button"].filter(
1Boolean).join(" ");return(0,u.tZ)("div",{css:z},(0,u.tZ)("div",{className:t,onMouseDown:t=>function(t){t.preventDefault(),e.onToggle(e.style)}(t)},e.label,e.tooltip?(0,u.tZ)(A,{key:"dropdown",size:"sm",orientation:e.tooltipOrientation},e.tooltip):null))};P.defaultProps={onToggle:()=>{},tooltip:""};var M=P,j=(0,h.Z)("button",{target:"efuuofp0"})("position:relative;border-style:solid;border-width:1px;border-radius:5px;background:none;padding:0 18px;font-size:20px;line-height:30px;min-height:32px;text-align:center;cursor:pointer;user-select:none;font-weight:",(e=>e.theme.fontWeights[1]),";display:inline-block;width:fit-content;overflow:visible;.btn-content{font-size:20px;white-space:nowrap;}svg{pointer-events:none;}&.block{display:block;width:100%;}&.size-lg{font-size:24px;line-height:34px;min-height:36px;padding:0 24px;.btn-content{font-size:24px;}}&.size-sm{font-size:16px;line-height:24px;min-height:26px;padding:0 12px;.btn-content{font-size:16px;}}&.disabled{cursor:not-allowed;}&:focus{border-color:",(e=>e.theme.colors.info),";box-shadow:0 0 8px -1px ",(e=>e.theme.colors.info),";}"),I=o(55847);var U=(0,h.Z)(j,{target:"e1vwjg60",label:"PrimarySecondaryStyle"})("&:hover:not(.disabled){transition:background-color 200ms ease,color 200ms ease,fill 200ms ease;background-color:",(e=>(0,I.offColor)(e.theme.colors.primary).selected().hex()),";color:",(e=>e.theme.colors.textOnPrimarySelected),";fill:",(e=>e.theme.colors.textOnPrimarySelected),";}&:active:not(.disabled){transition:background-color 200ms ease,color 200ms ease,fill 200ms ease;background-color:",(e=>e.theme.colors.primary),";color:",(e=>e.theme.colors.textOnPrimary),";fill:",(e=>e.theme.colors.textOnPrimary),";&.secondary{transition:background-color 200ms ease,color 200ms ease,fill 200ms ease;border-color:",(e=>e.theme.colors.primary),";color:",(e=>e.theme.colors.textOnPrimary),";fill:",(e=>e.theme.colors.textOnPrimary),";background-color:",(e=>e.theme.colors.primary),";}}&.danger{&:hover:not(.disabled){transition:background-color 200ms ease,color 200ms ease,fill 200ms ease;background-color:",(e=>(0,I.offColor)(e.theme.colors.danger).selected().hex()),";color:",(e=>e.theme.colors.textOnDanger),";fill:",(e=>e.theme.colors.textOnDanger),";border-color:",(e=>(0,I.offColor)(e.theme.colors.danger).selected().hex()),";}&:active:not(.disabled){transition:background-color 200ms ease,color 200ms ease,fill 200ms ease;background-color:",(e=>e.theme.colors.danger),";color:",(e=>e.theme.colors.textOnDanger),";fill:",(e=>e.theme.colors.textOnDanger),";&.secondary{transition:background-color 200ms ease,color 200ms ease,fill 200ms ease;border-color:",(e=>e.theme.colors.danger),";color:",(e=>e.theme.colors.textOnDanger),";fill:",(e=>e.theme.colors.textOnDanger),";background-color:",(e=>e.theme.colors.danger),";}}}");var W=(0,h.Z)(U,{target:"e13rywjg0",label:"PrimaryStyle"})("&.disabled{border-color:",(e=>
1e.theme.colors.pageBackground),";background:",(e=>(0,I.offColor)(e.theme.colors.primary).rgba(.6)),";}&.danger.disabled{border-color:",(e=>e.theme.colors.pageBackground),";background:",(e=>(0,I.offColor)(e.theme.colors.danger).rgba(.6)),";}border-color:",(e=>e.theme.colors.primary),";color:",(e=>e.theme.colors.textOnPrimary),";fill:",(e=>e.theme.colors.textOnPrimary),";background:",(e=>e.theme.colors.primary),";&.danger{border-color:",(e=>e.theme.colors.danger),";color:",(e=>e.theme.colors.textOnDanger),";fill:",(e=>e.theme.colors.textOnDanger),";background:",(e=>e.theme.colors.danger),";}");var H=(0,h.Z)(U,{target:"ew327ct0",label:"SecondaryStyle"})("&.disabled{border-color:",(e=>(0,I.offColor)(e.theme.colors.primary).rgba(.6)),";background:",(e=>(0,I.offColor)(e.theme.colors.pageBackground).rgba(.6)),";color:",(e=>(0,I.offColor)(e.theme.colors.primary).rgba(.6)),";}&.danger.disabled{border-color:",(e=>(0,I.offColor)(e.theme.colors.danger).rgba(.6)),";color:",(e=>(0,I.offColor)(e.theme.colors.danger).rgba(.6)),";}border-color:",(e=>e.theme.colors.primary),";color:",(e=>e.theme.colors.primary),";fill:",(e=>e.theme.colors.primary),";background:",(e=>
1e.theme.colors.pageBackground),";&.danger{border-color:",(e=>e.theme.colors.danger),";color:",(e=>e.theme.colors.danger),";fill:",(e=>e.theme.colors.danger),";background:",(e=>e.theme.colors.pageBackground),";}");var q=(0,h.Z)(j,{target:"e1lhmps20",label:"TertiaryStyle"})("&.disabled{color:",(e=>(0,I.offColor)(e.theme.colors.primary).rgba(.6)),";}&.danger.disabled{color:",(e=>(0,I.offColor)(e.theme.colors.danger).rgba(.6)),";}border:1px solid transparent;color:",(e=>e.theme.colors.primary),";fill:",(e=>e.theme.colors.primary),";background-color:",(e=>e.theme.colors.pageBackground),";&:hover:not(.disabled){transition:background-color 200ms ease,color 200ms ease,fill 200ms ease;background-color:",(e=>(0,I.offColor)(e.theme.colors.primary).selected().hex()),";color:",(e=>e.theme.colors.textOnPrimarySelected),";fill:",(e=>e.theme.colors.textOnPrimarySelected),";}&:active:not(.disabled){transition:background-color 200ms ease,color 200 ease,fill 200 ease;background-color:",(e=>e.theme.colors.primary),";color:",(e=>e.theme.colors.textOnPrimary),";fill:",(e=>e.theme.colors.textOnPrimary),";}&.danger{color:",(e=>e.theme.colors.danger),";fill:",(e=>e.theme.colors.danger),";&:hover:not(.disabled){transition:background-color 200ms ease,color 200ms ease,fill 200ms ease;background-color:",(e=>(0,I.offColor)(e.theme.colors.danger).selected().hex()),";color:",(e=>e.theme.colors.textOnPrimarySelected),";fill:",(e=>e.theme.colors.textOnPrimarySelected),";}&:active:not(.disabled){transition:background-color 200ms ease,color 200 ease,fill 200 ease;background-color:",(e=>e.theme.colors.danger),";color:",(e=>e.theme.colors.textOnDanger),";fill:",(e=>e.theme.colors.textOnDanger),";}}");const _=({block:e,children:t,className:o,danger:r,disabled:n,hasTooltipWhenDisabled:i,onClick:a,size:s,tooltip:c,tooltipOrientation:d,tooltipContainer:p,tooltipMaxWidth:g,tooltipSize:f,type:h})=>{const m=e=>{"undefined"!==typeof e&&(e.preventDefault(),e.stopPropagation())},b=["button",r&&"danger",n&&"disabled",h,`size-${s}`,e&&"block",o].filter(Boolean).join(" "),x={children:(()=>{const e={orientation:d,container:p,maxWidth:g,size:f};return[(0,u.tZ)("div",{key:"btn-content",className:"btn-content"},t),!(0,y.isNil)(c)&&(!n||i)&&(0,u.tZ)(A,(0,l.Z)({key:"dropdown"},e),c)]})(),onClick:e=>(e=>{m(e),n||a()})(e),type:"button"};return"primary"===h?(0,u.tZ)(W,(0,l.Z)({className:b},x)):"tertiary"===h?(0,u.tZ)(q,(0,l.Z)({className:b},x)):(0,u.tZ)(H,(0,l.Z)({className:b},x))};_.componentDescription="Standard extendable button.",_.componentKey="button",_.componentName="Button",_.defaultProps={block:!1,className:"",danger:!1,disabled:!1,onClick:()=>{},size:"md",type:"secondary",tooltipSize:"lg"};var V=_;var G=(0,h.Z)("div",{target:"e1hrvfa30",label:"DropdownStyle"})("display:block;position:absolute;border-radius:5px;background-color:",(e=>e.theme.colors.textOnPrimary),";border:2px solid ",(e=>e.theme.colors.border),";color:",(e=>e.theme.colors.primary),";z-index:",(e=>e.theme.zIndexes.dropDown),";.dropdown-content{>ul{&:first-of-type{border-top:none;>li{&:first-of-type{border-top-right-radius:5px;border-top-left-radius:5px;}}}&:last-of-type{>li{&:last-of-type{border-bottom-right-radius:5px;border-bottom-left-radius:5px;}}}}}ul{margin:0;padding:0;list-style:none;border-top:1px solid ",(e=>e.theme.colors.primarySelected),";li{padding:10px 20px;cursor:pointer;a{text-decoration:none;white-space:nowrap;color:",(e=>e.theme.colors.primary),";svg{fill:",(e=>e.theme.colors.primary),";}}&:hover{background:",(e=>e.theme.colors.primary),";color:",(e=>e.theme.colors.textOnPrimary),";svg{fill:",(e=>e.theme.colors.textOnPrimary),";}&.danger{color:",(e=>e.theme.colors.textOnDanger),";filter:saturate(150%);svg{fill:",(e=>e.theme.colors.textOnDanger),";}a{color:",(e=>e.theme.colors.textOnDanger),";}}a{color:",(e=>e.theme.colors.textOnPrimary),";}}&.danger{background:",(e=>e.theme.colors.danger),";color:",(e=>e.theme.colors.textOnDanger),";svg{fill:",(e=>e.theme.colors.textOnDanger),";}a{color:",(e=>e.theme.colors.textOnDanger),";}}}}&:before,&:after{content:'';position:absolute;top:-10px;width:0;height:0;border-style:solid;border-color:transparent transparent ",(e=>e.theme.colors.textOnPrimary)," transparent;}&:before{border-width:0 12px 12px;border-color:transparent transparent ",(e=>e.theme.colors.border)," transparent;}&:after{border-width:0 10px 10px;border-color:transparent transparent ",(e=>e.theme.colors.textOnPrimary)," transparent;}");
1const J={name:"1tvvm1l-left",styles:"left:10px;&:before{top:-12px;left:8px;}&:after{left:10px;};label:left;"},Y={name:"fb00dj-right",styles:"right:10px;&:before{top:-12px;right:8px;}&:after{right:10px;};label:right;"},X=({orientation:e,open:t,top:o,children:n,className:l})=>{var i;const a=(0,r.useRef)(),{0:s,1:c}=(0,r.useState)(0),{0:d,1:p}=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t&&a.current?c(a.current.scrollHeight-a.current.clientHeight):t||(c(0),p(!1))}),[t]),t?(0,u.tZ)(G,{className:`dropdown ${null!==l&&void 0!==l?l:""}`,css:[{top:o},"left"===e?J:Y,";label:Dropdown;"]},(0,u.tZ)("div",{ref:a,className:"dropdown-content",css:[s<=18&&{maxHeight:`${null===(i=a.current)||void 0===i?void 0:i.scrollHeight}px !important`},";label:Dropdown;"],onScroll:()=>{a.current.scrollTop+a.current.clientHeight===a.current.scrollHeight?p(!0):p(!1)}},n),s>18&&(0,u.tZ)("div",{css:["font-size:12px;padding-left:6px;background:#ffcf8f;color:#333;border-bottom-right-radius:3px;border-bottom-left-radius:3px;transition:opacity 200ms ease-in-out;",d&&{opacity:.2},";label:Dropdown;"]},"scroll for more ",(0,u.tZ)(f,{name:"arrow-down-sld"}))):null};X.componentDescription="Generic dropdown menu.",X.componentKey="dropdown",X.componentName="Dropdown menu",X.defaultProps={orientation:"right",top:"50px"};var Q=X;var ee=(0,h.Z)("div",{target:"e1e4etli0"})({name:"1z012eu",styles:"position:relative;display:inline"}),te=o(45815);const oe=["container","dropdownOpen","dropdownOrientation","onButtonClick"],re=e=>{var t;let{container:o,dropdownOpen:n,dropdownOrientation:a,onButtonClick:s}=e,c=(0,i.Z)(e,oe);const d=(0,r.useRef)();(0,te.Z)(d,(()=>{n&&s()}));const{0:p,1:g}=(0,r.useState)(a);(0,r.useLayoutEffect)((()=>{let e=o;if(n&&o){var t,r;(0,y.isElement)(o)||(e=document.getElementById(o));const n=null===(t=e)||void 0===t?void 0:t.getBoundingClientRect(),l=(null===(r=d.current)||void 0===r?void 0:r.getBoundingClientRect().left)-(null===n||void 0===n?void 0:n.left);g(l<(null===n||void 0===n?void 0:n.width)/2?"left":"right")}else n&&g(a)}),[o,n,a]);const f={disabled:c.buttonDisabled,onClick:s,size:c.buttonSize,type:c.buttonType};return(0,u.tZ)(ee,(0,l.Z)({ref:d},c,{className:`dropdown-button ${null!==(t=c.className)&&void 0!==t?t:""}`}),(0,u.tZ)(V,f,c.buttonContent),(0,u.tZ)(Q,{open:n,orientation:p,top:c.dropdownTop},c.children))};re.componentDescription="Button that opens a dropdown menu.",re.componentKey="dropdownBtn",re.componentName="Dropdown button",re.defaultProps={onButtonClick:()=>{}};var ne=re;var le=e=>(0,u.iv)(".rich-text-toolbar .editor-controls .control-row &.dropdown-button{>.button{width:",e.controlWidth,"px;.btn-content{width:calc(",e.controlWidth,"px - 15px);}}div.dropdown{width:",e.dropdownWidth,";}};label:dropdownStyle;");function ie(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function ae(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(o),!0).forEach((function(t){(0,N.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ie(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}class se extends r.Component{constructor(e){super(e),this.dropdownRef=r.createRef();const{controlWidth:t,dropdownWidth:o}=this.props;this.state={showDropdown:!1,open:!1,controlWidth:t||50,dropdownWidth:o&&o+"px"||"fit-content",orientation:"left"}}componentDidMount(){this.setState({showDropdown:!0})}componentDidUpdate(e){!e.open&&this.props.open&&this.handleButtonClick()}handleButtonClick(){this.setState((({open:e})=>({open:!e})))}handleSubmit(e){this.props.onSelect(e),this.handleButtonClick()}renderBtnContent(){const{name:e,icon:t,style:o}=this.props.activeOption.display;return(0,u.tZ)(r.Fragment,null,t?(0,u.tZ)(f,{name:t}):null,e?(0,u.tZ)("span",{style:o},e):null,(0,u.tZ)(f,{name:"chevron-down-sld"}))}render(){var e;if(!this.state.showDropdown)return null;const t=ae({buttonContent:this.renderBtnContent(),dropdownOpen:this.state.open,dropdownOrientation:this.state.orientation,dropdownTop:42,onButtonClick:()=>this.handleButtonClick(),container:null===(e=this.props.editor.current)||void 0===e?void 0:e.editorContainer,css:le(this.state)},!this.props.allowInput&&{onMouseDown:e=>e.preventDefault()}),o=ae({handleSubmit:e=>this.handleSubmit(e),open:this.state.open},this.props);return(0,u.tZ)(ne,t,this.props.render(o))}}se.defaultProps={activeOption:{display:{}},allowInput:!1,render:()=>{}};var ce=o(90758),de=o(63003);var pe=(0,h.Z)("div",{target:"e1yger3s0"})({name:"1prjajx",styles:"display:flex;justify-content:center;align-items:center;img{max-width:256px;margin-bottom:15px;}"});var ue=e=>(0,u.tZ)(pe,{width:e.previewWidth,height:e.previewHeight},(0,u.tZ)("img",{src:e.src})),ge=(0,h.Z)("div",{target:"elasndt0"})("display:flex;flex-flow:row wrap;justify-content:space-evenly;margin:15px 0;.mobile-dropzone{display:none;}.dropzone{position:relative;overflow:hidden;flex:1;max-width:400px;border:3px dashed ",(e=>(0,I.offColor)(e.theme.colors.primary).rgba(.5)),";text-align:center;cursor:pointer;padding:15px;background:linear-gradient(transparent, ",(e=>(0,I.offColor)(e.theme.colors.primary).rgba(.2)),");.icon-overlay{position:absolute;top:0;left:0;bottom:0;width:100%;background:transparent;background:linear-gradient(transparent, ",(e=>
1e.theme.colors.pageBackground),");}.icon-cloud{fill:",(e=>(0,I.offColor)(e.theme.colors.primary).rgba(.8)),";margin-top:-15px;}.upload-logo-text{color:",(e=>e.theme.colors.primaryActive),";font-weight:",(e=>e.theme.fontWeights[1]),";&.upload-sub{font-weight:",(e=>e.theme.fontWeights[0]),";}}}.buttton{margin:8px 0;}.error{margin-top:15px;color:",(e=>e.theme.colors.danger),";}@media (max-width: ",(e=>e.theme.dimensions.desktopBreakpoint),"px){.mobile-dropzone{display:block;white-space:normal;color:",(e=>(0,I.offColor)(e.theme.colors.primary).rgba(.5)),";font-style:italic;}.dropzone{display:none;}}");var fe={name:"1ry1pr7-renderContent",styles:"display:flex;width:100%;label:renderContent;"},he={name:"12p1kex-renderContent",styles:"display:flex;flex-direction:column;flex:1;label:renderContent;"};var me=e=>{const{0:t,1:o}=(0,r.useState)(!1),{0:n,1:l}=(0,r.useState)(null),i=(0,r.useRef)(e.isOpen);function a(){o(!1),l(null),e.formLinker.setValue(e.name,null)}function s(t){o(!1),e.resetError(),function(t){const o=new FileReader;o.addEventListener("load",(o=>{e.formLinker.setValue(e.name,t),l(o.target.result)})),o.readAsDataURL(t)}(t[0])}function c(e){o(!0)}return(0,r.useEffect)((()=>{i.current&&!e.isOpen&&(i.current=!1,l(null))}),[e.isOpen]),(0,u.tZ)(ge,{className:"image-editor"},null===n?(0,u.tZ)("div",null,(0,u.tZ)("div",{className:"mobile-dropzone"},b.Z.translate("Citadel.organisms.richEditor.mobileError")),(0,u.tZ)(de.Z,{multiple:!1,maxSize:5e6,accept:"image/*",style:{},className:"dropzone",onDropAccepted:s,onDropRejected:c},(0,u.tZ)("div",{className:"icon-overlay"}),(0,u.tZ)(f,{name:"cloud-upload-alt-sld"}),(0,u.tZ)("h3",{className:"upload-logo-text"},b.Z.translate("Citadel.organisms.richEditor.upload")),(0,u.tZ)("h3",{className:"upload-logo-text upload-sub"},b.Z.translate("Citadel.organisms.richEditor.uploadSub")),(0,u.tZ)("h4",{className:"file-size-limit upload-logo-text"},b.Z.translate("Citadel.organisms.richEditor.maxFileSize"),(0,u.tZ)("br",null),(0,u.tZ)("span",{className:"lighter-text"},b.Z.translate("Citadel.organisms.richEditor.imageFormats")))),t?(0,u.tZ)("div",{className:"error"},b.Z.translate("Citadel.organisms.richEditor.uploadFailed")):(0,u.tZ)("noscript",null)):(0,u.tZ)(r.Fragment,null,(0,u.tZ)("div",{css:fe},(0,u.tZ)("div",{css:he},(0,u.tZ)(ue,{src:n,previewWidth:"100%",previewHeight:256}))),(0,u.tZ)(V,{block:!0,type:"tertiary",onClick:a},"Clear")))},be=(0,h.Z)("div",{target:"ekgxhfl0"})("padding:12px;.error{color:",(e=>e.theme.colors.danger),";}.form-field{margin-bottom:16px;label.form-label div.label-content{color:",(e=>e.theme.colors.primary),";}}.image-editor{.error{white-space:normal;}}.button{margin-top:16px;}");var ye=e=>{const{0:t,1:o}=(0,r.useReducer)((e=>e+1),0),{0:n,1:l}=(0,r.useState)(!1),i=(0,r.useRef)(new ce.Z({data:{imgFile:null,imgUrl:""},schema:{imgFile:"file",imgUrl:"string"},onChange:()=>o()})).current;function a(){n&&l(!1)}return(0,u.tZ)(be,null,n?(0,u.tZ)("div",{className:"error"},b.Z.translate("Citadel.organisms.richEditor.emptyForm")):null,(0,u.tZ)(Xt,{formLinker:i,name:"imgUrl",label:"Full URL to image",onFocus:a}),(0,u.tZ)("div",null,"or add a file below"),(0,u.tZ)(me,{formLinker:i,name:"imgFile",resetError:a}),(0,u.tZ)(V,{block:!0,onClick:function(){(0,y.isEmpty)(i.getValue("imgUrl"))&&(0,y.isEmpty)(i.getValue("imgFile"))?l(!0):(e.handleSubmit((0,y.cloneDeep)(i.data)),i.setValue("imgUrl","",!1),i.setValue("imgFile",null,!1))}},"Add to Document"))},xe=(0,h.Z)("div",{target:"edbgt8x0"})("padding:12px;.form-field{margin-bottom:16px;label.form-label div.label-content{color:",(e=>e.theme.colors.primary),";}}.button{margin-top:32px;}");function ke(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}var ve=e=>{const t=(0,r.useRef)(new ce.Z({data:{entityKey:null,displayText:"",linkUrl:"",newTab:!0},schema:{entityKey:"string",displayText:"string.required",linkUrl:"string.required",newTab:"boolean"}})),o=t.current,{0:n,1:l}=(0,r.useState)(!1);function i(){o.validateAll(),(0,y.isEmpty)(o.errors)&&(e.handleSubmit(function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};
1t%2?ke(Object(o),!0).forEach((function(t){(0,N.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ke(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}({},o.data)),o.setValue("linkUrl","",!1),o.setValue("displayText","",!1),o.setValue("entityKey",null,!1))}return(0,r.useEffect)((()=>{const o=e.editorState.getCurrentContent(),r=e.editorState.getSelection(),n=r.getAnchorKey(),l=o.getBlockForKey(n);let i=l.getEntityAt(r.getAnchorOffset()),a="",s=!0,c="";if(i){const e=o.getEntity(i);"LINK"===e.getType()?(s="_blank"===e.getData().target,a=e.getData().url,l.findEntityRanges((e=>e.includes(i)),((e,t)=>{c=l.getText().slice(e,t)}))):i=null}t.current.setValuesFromParsed({linkUrl:a,displayText:c,newTab:s,entityKey:i})}),[e.editorState]),(0,u.tZ)(xe,null,(0,u.tZ)(Xt,{formLinker:o,name:"linkUrl",label:"Full URL",onChange:function(e=!o.getValue("entityKey"),t=o.getValue("linkUrl")){e&&!n&&o.setValue("displayText",t)}}),(0,u.tZ)(Xt,{formLinker:o,name:"displayText",label:"Text to display",onFocus:()=>l(!0)}),(0,u.tZ)(Xt,{formLinker:o,name:"newTab",label:"Open link in new tab",type:"checkbox"}),(0,u.tZ)(V,{block:!0,onClick:()=>i()},"Add to Document"))};var Se=e=>(0,u.tZ)("ul",null,e.list.map(((t,o)=>{const r=t.display.icon?(0,u.tZ)(f,{name:t.display.icon}):null,n=t.type||t.display.name;return(0,u.tZ)("li",{key:o,style:t.display.style,onClick:()=>e.handleSubmit(n)},r," ",t.display.name)})));const we=Array(8).fill(1),Ce=Array(8).fill([...we]);var De={name:"1dx1dry-TableGrid",styles:"margin:10px 10px 5px;label:TableGrid;"},Ee={name:"1lonvft-TableGrid",styles:"display:flex;width:136px;justify-content:space-between;padding:1px;cursor:pointer;label:TableGrid;"},Oe={name:"tujmog-TableGrid",styles:"margin:10px;font-size:12px;label:TableGrid;"};var Be=e=>{const{0:t,1:o}=(0,r.useState)({cols:0,rows:0}),n=()=>{e.handleSubmit(t)},l={border:"1px solid rgba(150, 150, 150, 1)",background:"rgba(200, 200, 200, 0.4)"},i={border:"1px solid rgba(0, 125, 250, 0.8)",background:"rgba(0, 125, 250, 0.4)"};return(0,u.tZ)("div",null,(0,u.tZ)("div",{css:De},Ce.map(((e,r)=>(0,u.tZ)("div",{key:r,css:Ee},e.map(((e,a)=>{const s=r<=t.rows-1&&a<=t.cols-1;return(0,u.tZ)("div",{key:`${r}-${a}`,css:["flex:0 0 15px;height:15px;",l,s&&i,";label:TableGrid;"],onMouseEnter:()=>((e,t)=>{o({cols:t+1,rows:e+1})})(r,a),onClick:n})})))))),(0,u.tZ)("div",{css:Oe},"Insert table size: ",t.cols," x ",t.rows))};function Te(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function Ze(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(o),!0).forEach((function(t){(0,N.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Te(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}const Le=["#000000","#FFFFFF","#888888","#AAAAAA","#EEEEEE","#880000","#CC0000","#FF0000","#FFCCCC","#FF8800","#FFCC00","#FFFF00","#CCFF00","#88FF00","#008800","#00CC00","#00CC88","#00CCCC","#CCEEFF","#00CCFF","#0088FF","#0000FF","#8800FF","#CC00CC","#CC0088"],Ne=["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],$e=[8,9,10,11,12,14,18,24,36],Ke=[["padding","9.5px"],["margin","0 0 10px"],["border","1px solid rgb(204, 204, 204)"],["background","rgb(245, 245, 245)"]],Re=[{type:"left",display:{icon:"align-left-sld"}},{type:"center",display:{icon:"align-center-sld"}},{type:"right",display:{icon:"align-right-sld"}},{type:"justify",display:{icon:"align-justify-sld"}}],Fe=[{type:"unstyled",display:{name:"normal"},tag:"div"},{type:"paragraph",display:{name:"paragraph"},tag:"p"},{type:"unordered-list-item",display:{name:" bullet list",style:{fontSize:"14px"},icon:"list-ul-sld"}},{type:"ordered-list-item",display:{name:" number list",style:{fontSize:"14px"},icon:"list-ol-sld"}},{type:"horizontal-rule",display:{name:"h-rule",style:{fontSize:"14px"}},tag:"hr"},{type:"page-break",display:{name:"page-break",style:{fontSize:"14px"}},tag:"div"},{type:"header-one",display:{name:"H1",style:{fontSize:"26px",fontWeight:"700"}},tag:"h1"},{type:"header-two",display:{name:"H2",style:{fontSize:"24px",fontWeight:"700"}},tag:"h2"},{type:"header-three",display:{name:"H3",style:{fontSize:"18.72px",fontWeight:"700"}},tag:"h3"}
1,{type:"header-four",display:{name:"H4",style:{fontSize:"16px",fontWeight:"700"}},tag:"h4"},{type:"header-five",display:{name:"H5",style:{fontSize:"13.3",fontWeight:"700"}},tag:"h5"},{type:"header-six",display:{name:"H6",style:{fontSize:"12px",fontWeight:"700"}},tag:"h6"},{type:"blockquote",display:{name:"blockquote",style:{fontFamily:"'Hoefler Text', Georgia, serif",fontStyle:"italic"}},tag:"blockquote"},{type:"code-block",display:{name:"monospace",style:{fontFamily:"monospace"}},tag:"pre"}],Ae=(()=>{const e=[];return["color","backgroundColor"].forEach((t=>{Le.forEach((o=>{e.push({type:`${t}.${o}`,display:{name:o}})}))})),e})(),ze=Ne.map((e=>({type:`fontFamily.${e}`,display:{name:e,style:{fontFamily:e}}}))),Pe=$e.map((e=>({type:`fontSize.${e}`,display:{name:e}}))),Me=Ze(Ze({},{alignment:{activeOption:(e="left")=>Re.find((t=>t.type===e)),controlWidth:40,dropdownWidth:40,list:Re,method:"listDropdown"},blockType:{activeOption:e=>Fe.find((t=>t.type===e)),controlWidth:90,dropdownWidth:135,list:Fe,method:"listDropdown"},color:{activeOption:()=>({display:{icon:"paint-brush-sld"}}),controlWidth:40,dropdownWidth:280,list:Ae,method:"listDropdown"},fontFamily:{activeOption:e=>ze.find((t=>t.display.name===e))||{display:{name:"theme default",style:{fontStyle:"italic"}}},controlWidth:130,dropdownWidth:155,list:[...ze,{type:"fontFamily.unset",display:{name:"reset",style:{fontStyle:"italic"}}}],method:"listDropdown"},fontSize:{activeOption:e=>Pe.find((t=>t.display.name===+e))||{display:{name:"--"}},controlWidth:40,dropdownWidth:65,list:[...Pe,{type:"fontSize.unset",display:{name:"reset",style:{fontStyle:"italic"}}}],method:"listDropdown"},insertImage:{activeOption:()=>({display:{icon:"image-sld"}}),controlWidth:40,dropdownWidth:400,icon:"image-sld",method:"formDropdown"},insertLink:{activeOption:()=>({display:{icon:"link-sld"}}),controlWidth:40,dropdownWidth:400,icon:"link-sld",method:"formDropdown"},insertTable:{activeOption:()=>({display:{icon:"table-sld"}}),controlWidth:40,dropdownWidth:160,icon:"table-sld",method:"tableDropdown"}}),{},{bold:{callback:"inlineToggle",icon:"bold-sld",method:"controlButton"},bulletList:{callback:"listToggle",icon:"list-ul-sld",method:"controlButton",tooltip:"Citadel.organisms.richEditor.tooltips.bulletList"},floatRight:{callback:"blockDataToggle",icon:"long-arrow-alt-right-sld",method:"controlButton",tooltip:"Citadel.organisms.richEditor.tooltips.floatRight"},indent:{callback:"indentChange",icon:"indent-sld",method:"controlButton",tooltip:"Citadel.organisms.richEditor.tooltips.indent"},italic:{callback:"inlineToggle",icon:"italic-sld",method:"controlButton"},numberList:{callback:"listToggle",icon:"list-ol-sld",method:"controlButton",tooltip:"Citadel.organisms.richEditor.tooltips.numberList"},outdent:{callback:"indentChange",icon:"outdent-sld",method:"controlButton",tooltip:"Citadel.organisms.richEditor.tooltips.outdent"},spacer:{method:"spacer"},strikethrough:{callback:"inlineToggle",icon:"strikethrough-sld",method:"controlButton"},underline:{callback:"inlineToggle",icon:"underline-sld",method:"controlButton"},viewHtml:{callback:"editModeToggle",icon:"code-sld",method:"controlButton"}}),je=["bold","italic","underline","fontFamily","fontSize","blockType","alignment","bulletList","numberList","outdent","indent","color","insertLink","insertTable"],Ie={basic:["bold","italic","underline","bulletList","numberList"],default:[...je,"viewHtml"],withImages:[...je,"insertImage","viewHtml"]},Ue=66,We=8,He=127,qe=73,_e=76,Ve=82,Ge=9,Je=85,Ye=219,Xe=221;function Qe(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function et(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(o),!0).forEach((function(t){(0,N.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Qe(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var tt=e=>{const t=e=>e.flatMap((e=>Array.isArray(e)&&Ie[e]?[Ie[e]]:Ie[e]||[e])),o=(t,l)=>{const a=t.map(((t,l)=>{if(Array.isArray(t))return(0,u.tZ)("div",{className:"control-group",key:l},o(t,l));if(Me[t])return i[Me[t].method](t,l);const{customControls:a}=e;return r.isValidElement(a[t])?r.cloneElement(a[t],{key:t}):a&&a[t]?n(t,e.customControls[t]):null}));return(0,u.tZ)("div",{key:l,className:"control-row"},a)},n=(t,o)=>{const r=et(et({activeOption:o,editor:e.editor,key:t,list:o.availableItems},o.dimensions),{},{onSelect:t=>e.customListSelect(t)});return(0,u.tZ)(se,(0,l.Z)({render:e=>(0,u.tZ)(Se,e)},r))},i={listDropdown:t=>{let o;"alignment"===t&&(o=e.blockData.get("text-align")),"blockType"===t&&(o="pasted-list-item"===e.blockType?"ordered-list-item":e.blockType),"fontFamily"===t&&(o=e.activeStyles.fontFamily||"--"),"fontSize"===t&&(o=e.activeStyles.fontSize||"--");const r={activeOption:Me[t].activeOption(o),controlWidth:Me[t].controlWidth,dropdownWidth:Me[t].dropdownWidth,editor:e.editor,key:t,list:Me[t].list,onSelect:o=>e[t+"Select"](o)};return"color"===t?(0,u.tZ)(se,(0,l.Z)({render:e=>(0,u.tZ)(K,e)},r)):(0,u.tZ)(se,(0,l.Z)({render:e=>(0,u.tZ)(Se,e)},r))},formDropdown:t=>{const o={activeOption:Me[t].activeOption(),allowInput:!0,controlWidth:Me[t].controlWidth,dropdownWidth:Me[t].dropdownWidth,editor:e.editor,editorState:e.editorState,key:t,onSelect:o=>e[t](o)};return"insertImage"===t?(0,u.tZ)(se,(0,l.Z)({render:e=>(0,u.tZ)(ye,e)},o)):(0,u.tZ)(se,(0,l.Z)({open:e.openLinkForm,render:e=>(0,u.tZ)(ve,e)},o))},tableDropdown:t=>{const o={activeOption:Me[t].activeOption(),controlWidth:Me[t].controlWidth,dropdownWidth:Me[t].dropdownWidth,editor:e.editor,key:t,onSelect:o=>e[t](o)};return(0,u.tZ)(se,(0,l.Z)({render:e=>(0,u.tZ)(Be,e)},o))},controlButton:t=>{let o=e.currentStyle?e.currentStyle.has(t.toUpperCase()):null,r=t.toUpperCase();if("floatRight"===t&&(o="right"===e.blockData.get("float"),r={float:"right"}),"bulletList"===t||"numberList"===t){const r="bulletList"===t?"unordered-list-item":["ordered-list-item","pasted-list-item"];o=r===e.blockType||"numberList"===t&&r.includes(e.blockType)}const n={active:o,key:t,label:(0,u.tZ)(f,{name:Me[t].icon}),onToggle:e[Me[t].callback],style:r,tooltip:b.Z.translate(Me[t].tooltip||""),tooltipOrientation:e.tooltipOrientation};return(0,u.tZ)(M,n)},spacer:(e,t)=>(0,u.tZ)("div",{className:"spacer",key:"spacer"+t})};
1return(0,u.tZ)("div",{className:"editor-controls"},(()=>{let r=(0,y.isNil)(e.toolbar)?["default"]:[...e.toolbar];return r=t(r),o(r)})())};var ot=(0,h.Z)("div",{target:"e17lsifi0"})({name:"nzib36",styles:".DraftEditor-editorContainer,.DraftEditor-root,.public-DraftEditor-content{height:inherit;text-align:initial;}.public-DraftEditor-content[contenteditable='true']{-webkit-user-modify:read-write-plaintext-only;}.DraftEditor-editorContainer{position:relative;z-index:1;}.public-DraftEditor-block{position:relative;}.DraftEditor-alignLeft .public-DraftStyleDefault-block{text-align:left;}.DraftEditor-alignLeft .public-DraftEditorPlaceholder-root{left:0;text-align:left;}.DraftEditor-alignCenter .public-DraftStyleDefault-block{text-align:center;}.DraftEditor-alignCenter .public-DraftEditorPlaceholder-root{margin:0 auto;text-align:center;width:100%;}.DraftEditor-alignRight .public-DraftStyleDefault-block{text-align:right;}.DraftEditor-alignRight .public-DraftEditorPlaceholder-root{right:0;text-align:right;}.public-DraftEditorPlaceholder-root{color:#9197a3;position:absolute;z-index:1;}.public-DraftEditorPlaceholder-hasFocus{color:#bdc1c9;}.DraftEditorPlaceholder-hidden{display:none;}.public-DraftStyleDefault-block{position:relative;white-space:pre-wrap;}.public-DraftStyleDefault-ltr{direction:ltr;text-align:inherit;}.public-DraftStyleDefault-rtl{direction:rtl;text-align:right;}.public-DraftStyleDefault-listLTR{direction:ltr;}.public-DraftStyleDefault-listRTL{direction:rtl;}.public-DraftStyleDefault-ol,.public-DraftStyleDefault-ul{margin:0;padding:0;}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listLTR{margin-left:2.5rem;}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-listRTL{margin-right:2.5rem;}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listLTR{margin-left:4rem;}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-listRTL{margin-right:4rem;}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listLTR{margin-left:5.5rem;}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-listRTL{margin-right:5.5rem;}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listLTR{margin-left:7rem;}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-listRTL{margin-right:7rem;}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listLTR{margin-left:8.5rem;}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-listRTL{margin-right:8.5rem;}.public-DraftStyleDefault-unorderedListItem{list-style-type:square;position:relative;}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth0{list-style-type:disc;}.public-DraftStyleDefault-unorderedListItem.public-DraftStyleDefault-depth1{list-style-type:circle;}.public-DraftStyleDefault-orderedListItem{list-style-type:none;position:relative;}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listLTR:before{left:-36px;position:absolute;text-align:right;font-family:inherit;font-size:inherit;width:30px;}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-listRTL:before{position:absolute;right:-36px;text-align:left;width:30px;}.public-DraftStyleDefault-orderedListItem:before{content:counter(ol0) '. ';counter-increment:ol0;}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth1:before{content:counter(ol1, lower-alpha) ') ';counter-increment:ol1;}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth2:before{content:counter(ol2, lower-roman) '. ';counter-increment:ol2;}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth3:before{content:counter(ol3, upper-alpha) '. ';counter-increment:ol3;}.public-DraftStyleDefault-orderedListItem.public-DraftStyleDefault-depth4:before{content:counter(ol4) '. ';counter-increment:ol4;}.public-DraftStyleDefault-depth0.public-DraftStyleDefault-reset{counter-reset:ol0;}.public-DraftStyleDefault-depth1.public-DraftStyleDefault-reset{counter-reset:ol1;}.public-DraftStyleDefault-depth2.public-DraftStyleDefault-reset{counter-reset:ol2;}.public-DraftStyleDefault-depth3.public-DraftStyleDefault-reset{counter-reset:ol3;}.public-DraftStyleDefault-depth4.public-DraftStyleDefault-reset{counter-reset:ol4;}"}),rt=(0,h.Z)("div",{target:"emdl7bc0"}
1)("&.rich-text-editor{position:relative;padding:12px;border:1px solid ",(e=>e.theme.colors.richTextBorder),";border-top:none;border-bottom:none;overflow-y:auto;resize:vertical;&.no-toolbar{border-top:1px solid ",(e=>e.theme.colors.richTextBorder),";border-top-left-radius:3px;border-top-right-radius:3px;}&.no-statusbar{border-bottom:1px solid ",(e=>e.theme.colors.richTextBorder),";border-bottom-left-radius:3px;border-bottom-right-radius:3px;}section{margin-top:1em;margin-bottom:1em;}blockquote{color:#999999;font-family:'Hoefler Text',Georgia,serif;font-style:italic;line-height:1.15rem;border-left:5px solid rgba(100, 100, 100, 0.5);margin:0 2rem;padding-left:1rem;}.text-align-center{text-align:center;}.text-align-justify{text-align:justify;}.text-align-left{text-align:left;}.text-align-right{text-align:right;}.float-left{float:left;}.float-right{float:right;}.indent0{margin-left:0;}.indent1{margin-left:2.5rem;}.indent2{margin-left:5rem;}.indent3{margin-left:7.5rem;}.indent4{margin-left:10rem;}.indent5{margin-left:12.5rem;}.indent6{margin-left:15rem;}.indent7{margin-left:17.5rem;}.indent8{margin-left:20rem;}.indent9{margin-left:22.5rem;}.indent10{margin-left:25rem;}.indent11{margin-left:27.5rem;}.indent12{margin-left:30rem;}.indent13{margin-left:32.5rem;}.indent14{margin-left:35rem;}.indent15{margin-left:37.5rem;}.indent16{margin-left:40rem;}.indent17{margin-left:42.5rem;}.indent18{margin-left:45rem;}.indent19{margin-left:47.5rem;}.indent20{margin-left:50rem;}}"),nt=o(73935);var lt={name:"1yw69j1-LinkPopover",styles:"max-width:300px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;label:LinkPopover;"},it={name:"ba2ro3-LinkPopover",styles:"margin-left:3px;label:LinkPopover;"};var at=r.forwardRef((({editorRef:e,editorState:t,editLink:o},n)=>{const l=(0,r.useRef)(e.editor.closest(".rich-text-editor")),i=(0,r.useCallback)((()=>{const e=t.getCurrentContent(),o=t.getSelection(),r=o.getAnchorKey(),n=o.getAnchorOffset(),i=e.getBlockForKey(r),a=i.getEntityAt(n);let s,c=0;i.findStyleRanges((t=>{const o=t.getEntity();return o===a&&(s=c),c++,o&&"LINK"===e.getEntity(o).get("type")}),(()=>{}));const d=l.current.querySelector(`span[data-offset-key='${r}-0-${s}']`);let{left:p,bottom:u}=d&&d.getBoundingClientRect()||{};const g=l.current.getBoundingClientRect();(u>g.bottom||u<g.top)&&(p=-1e3);const{url:f}=e.getEntity(a).getData();return{left:p,bottom:u,url:f}}),[t]),{0:a,1:s}=(0,r.useState)(i());(0,r.useEffect)((()=>{s(i())}),[t,i]),(0,r.useEffect)((()=>{document.onscroll=(0,y.throttle)((function(e){s(i())}),14);const e=document.getElementById("body");e&&(e.onscroll=(0,y.throttle)((function(e){s(i())}),14));const t=l.current;return t.onscroll=(0,y.throttle)((function(e){s(i())}),14),()=>{document.onscroll=null,t.onscroll=null,e&&(e.onscroll=null)}}),[t,i]);const c=e=>(0,u.iv)("position:fixed;left:0;top:0;padding:6px;border:1px solid ",e.colors.border,";border-radius:3px;
1background:",e.colors.pageBackground,";z-index:1;font-family:",e.fonts[0],";font-size:14px;box-shadow:2px 2px 12px -6px ",e.colors.shadowOnPage,";:before{content:'';position:absolute;border-style:solid;border-width:5px;border-color:transparent transparent ",e.colors.pageBackground," transparent;filter:drop-shadow(0 -1px 0 ",e.colors.border,");top:-10px;left:5px;};label:style;"),d=(0,r.useRef)(document.body);return(0,r.useEffect)((()=>(d.current=document.createElement("div"),document.body.appendChild(d.current),()=>{document.body.removeChild(d.current)})),[]),(0,nt.createPortal)((0,u.tZ)("div",{ref:n,css:e=>[{transform:`translate(${a.left}px, ${a.bottom+5}px)`},c(e),!a.left&&{display:"none"}]},(0,u.tZ)("a",{css:lt,href:a.url,rel:"noreferrer",target:"_blank"},a.url),(0,u.tZ)("span",{css:it},(0,u.tZ)(V,{type:"tertiary",size:"sm",onClick:o},"Edit"))),d.current)})),st=o(15660),ct=o.n(st);var dt={name:"82rj50-codeviewStyle",styles:"/**\n * prism.js default theme for JavaScript, CSS and HTML\n * Based on dabblet (http://dabblet.com)\n * @author Lea Verou\n */code[class*='language-'],pre[class*='language-']{color:black;background:none;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre-wrap;word-spacing:normal;word-break:normal;word-wrap:break-word;line-height:1.5;tab-size:2;hyphens:none;}pre[class*='language-']::selection,pre[class*='language-'] ::selection,code[class*='language-']::selection,code[class*='language-'] ::selection{text-shadow:none;background:#b3d4fc;}@media print{code[class*='language-'],pre[class*='language-']{text-shadow:none;}}pre[class*='language-']{padding:1em;overflow:auto;}:not(pre)>code[class*='language-'],pre[class*='language-']{background:#f5f2f0;}:not(pre)>code[class*='language-']{padding:0.1em;border-radius:0.3em;white-space:normal;}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:slategray;}.token.punctuation{color:#999;}.token.namespace{opacity:0.7;}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#905;}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690;}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#9a6e3a;background:hsla(0, 0%, 100%, 0.5);}.token.atrule,.token.attr-value,.token.keyword{color:#07a;}.token.function,.token.class-name{color:#dd4a68;}.token.regex,.token.important,.token.variable{color:#e90;}.token.important,.token.bold{font-weight:bold;}.token.italic{font-style:italic;};label:codeviewStyle;"},pt=(0,h.Z)("div",{target:"e1nrmk6g0"})("&.raw-html{.editor-controls{display:flex;justify-content:flex-end;align-items:center;.control-group{flex:0 0 20%;.rich-editor-style-button{padding:4px 6px;cursor:pointer;border-radius:2px;background:",(e=>(0,I.offColor)(e.theme.colors.textOnPageBackground).rgba(.2)),";svg{height:18px;width:18px;fill:",(e=>e.theme.colors.textOnPageBackground),";}}}}}");const ut=["handleShowProgress"];const gt=e=>{var t,o;let{handleShowProgress:n}=e,l=(0,i.Z)(e,ut);const a=(0,S.u)(),s=(0,r.useRef)(a.colors),{0:c,1:d}=(0,r.useState)(.2),{0:p,1:g}=(0,r.useState)(a.colors.success);return(0,r.useEffect)((()=>{var e;const t=(null===(e=l.html)||void 0===e?void 0:e.length)/l.maxLength*100;d(Math.max(.2,(null!==t&&void 0!==t?t:0)/100)),g(t>98?s.current.danger:t>90?s.current.warning:s.current.success),t>60?null===n||void 0===n||n(!0):null===n||void 0===n||n(!1)}),[n,l.html,l.maxLength]),(0,u.tZ)("div",{css:(0,u.iv)({position:"relative",width:125,height:14,border:`1px solid ${p}`,borderRadius:3,background:"#fff"},";label:ProgressBar;")},(0,u.tZ)("span",{css:(0,u.iv)({position:"absolute",display:"inline-block",background:p,opacity:c,width:(null===(t=l.html)||void 0===t?void 0:t.length)/l.maxLength*100+"%",maxWidth:"100%",height:"100%"},";label:ProgressBar;")},(0,u.tZ)("span",{css:e=>({color:e.colors.textOnDanger,lineHeight:"10px",position:"absolute",left:"10%",top:0})},(null===(o=l.html)||void 0===o?void 0:o.length)/l.maxLength*100>=100?"max length exceeded":"")))},ft=(0,h.Z)("div",{target:"e146e3j30",label:"ScrollMessageStyle"})({name:"17xt56w",styles:"&.message{flex:1;transition:all 0.2s;opacity:0;height:0;div{background:#ffcf8f;text-align:center;font-weight:bold;font-size:12px;width:100%;height:100%;border-radius:0 0 3px 3px;}}&.message.show{opacity:1;height:21px;}"}),ht=e=>{const{0:t,1:o}=(0,r.useState)(!1);(0,r.useEffect)((()=>{o(!0)}),[t]);const n=["message",t&&"show",e.scrollBottom&&"scroll-bottom"].filter(
1Boolean).join(" ");return(0,u.tZ)(ft,{className:n},(0,u.tZ)("div",null,"Scroll to see all content"," ",(0,u.tZ)("span",{className:"fa-layers"},(0,u.tZ)("span",{css:["opacity:1;transition:opacity 0.2s;",e.scrollTop&&{opacity:0},";label:ScrollMessage;"]},(0,u.tZ)(f,{name:"long-arrow-up-reg"})),(0,u.tZ)("span",{css:["opactiy:1px;transition:opacity 0.2s;",e.scrollBottom&&{opacity:0},";label:ScrollMessage;"]},(0,u.tZ)(f,{name:"long-arrow-down-reg"})))))};var mt={name:"g1t9dh-StatusBar",styles:"flex:1;label:StatusBar;"};var bt=e=>{const{0:t,1:o}=(0,r.useState)(!1),n=(0,r.useCallback)((e=>{o(e)}),[]);return(0,u.tZ)("div",{css:e=>({height:22,lineHeight:"22px",fontSize:"10px",border:`1px solid ${e.colors.richTextBorder}`,background:(0,I.offColor)(e.colors.blockSectionHeader).rgba(.2),borderRadius:"0 0 3px 3px",borderTop:"none",display:"flex"})},e.maxLength&&(0,u.tZ)("div",{css:["display:flex;align-items:center;opacity:0;width:0;padding:0;transition:all 0.3s;",t&&{opacity:1,width:150,padding:"0 12px"},";label:StatusBar;"]},(0,u.tZ)(gt,(0,l.Z)({},e,{handleShowProgress:n}))),!e.noScrollMessage&&(0,u.tZ)("div",{css:mt},e.hasScrolling&&(0,u.tZ)(ht,{scrollTop:e.scrollTop,scrollBottom:e.scrollBottom})))},yt=(0,h.Z)("div",{target:"e1az0wgl0"})("&.rich-text-toolbar{position:relative;.disabled-toolbar{position:absolute;z-index:1;top:1px;left:1px;height:calc(100% - 1px);width:calc(100% - 2px);background:rgba(255, 255, 255, 0.5);}.editor-controls{position:relative;padding:3px 6px;margin:0;background:",(e=>(0,I.offColor)(e.theme.colors.blockSectionHeader).rgba(.2)),";border:1px solid ",(e=>e.theme.colors.richTextBorder),";border-bottom:none;border-radius:3px 3px 0 0;user-select:none;.control-group{padding:3px 0;flex:1 0 100%;}.control-row{flex:1;display:flex;justify-content:flex-start;align-items:center;flex-flow:row wrap;",(e=>(e=>(0,u.iv)(".dropdown-button{margin:3px 4px;>.button{height:30px;min-height:30px;position:relative;padding:2px;line-height:1.2rem;.btn-content{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;span{margin:auto;}svg:last-of-type{font-size:10px;}.fa-chevron-down{position:absolute;top:40%;right:3px;}}}.dropdown{width:fit-content;&[class*='left']{left:0;}&[class*='right']{right:0;}.dropdown-content{text-align:left;white-space:nowrap;max-height:",e.maxDropdownHeight,"px;overflow-y:auto;li{padding:6px 12px;}}}};label:richEditorDropdown;"))(e)),";.rich-editor-style-button{color:",(e=>(0,I.offColor)(e.theme.colors.textOnPageBackground).rgba(.75)),";cursor:pointer;display:inline-block;margin:3px 0;padding:4px 6px;border:1px solid transparent;border-radius:2px;svg{width:14px;height:14px;fill:currentColor;}&.OUTDENT{padding:4px 0 4px 6px;}&.INDENT{padding:4px 6px 4px 0;margin-right:8px;}&:hover{background:",(e=>e.theme.colors.primary),";color:",(e=>e.theme.colors.textOnPrimary),";}}.rich-editor-active-button{color:",(e=>e.theme.colors.textOnPageBackground),";border:1px solid ",(e=>(0,I.offColor)(e.theme.colors.textOnPageBackground).rgba(.4)),";background:",(e=>(0,I.offColor)(e.theme.colors.textOnPageBackground).rgba(.1)),";box-shadow:inset 0 0 4px ",(e=>(0,I.offColor)(e.theme.colors.textOnPageBackground).rgba(.3)),";svg{fill:currentColor;}}.spacer{margin:0 10px;}}}}"),xt=o(58128),kt=o(49746),vt=o(43393),St=o(9041);const wt=e=>(0,u.tZ)("hr",null),Ct=e=>(0,u.tZ)("div",{style:{color:"#BBBBBB",margin:"1em 0"}},"-------------------page break-------------------"),Dt=e=>{const t=(0,r.useRef)(null),o=(0,r.useRef)(null),{block:n,contentState:l,blockProps:{editor:i,getEditorState:a,onChange:s}}=e,c=(0,r.useCallback)(((e={},t=n.getData())=>{t=t.merge(e);const o=n.set("data",t);let r=a().getCurrentContent().getBlockMap();r=r.set(n.getKey(),o);const l=a().getCurrentContent().set("blockMap",r),i=a().getSelection();let c=St.EditorState.push(a(),l,"change-block-data");c=St.EditorState.forceSelection(c,i),s(c)}),[n,a,s]),d=(0,r.useRef)(!1),{0:p,1:g}=(0,r.useState)("none");(0,r.useEffect)((()=>{const{isActive:e}=n.getData();e||d.current?d.current=!1:g("none")}),[n]);const f=n.getData();let h=f.get("imgStyle"),m=f.delete("imgStyle");h=h&&f.get("imgStyle").mapKeys((e=>
1(0,y.camelCase)(e))).toJS()||{},m=m&&m.filter((e=>"class"!==e)).mapKeys((e=>(0,y.camelCase)(e))).toJS()||{};const{height:b,width:x}=h;delete h.height,delete h.width;const{0:k,1:v}=(0,r.useState)({height:b,width:x}),{src:S}=n.getEntityAt(0)&&l.getEntity(n.getEntityAt(0)).getData()||{},w=e=>"both"===p?e.colors.textOnPageBackground:"transparent";return(0,u.tZ)("div",{ref:o,css:e=>[m,{position:"relative",zIndex:1,display:"inline-block",overflow:"hidden",padding:5,resize:p,border:`1px dashed ${w(e)}`},k.height&&k],onClick:()=>{if("false"===i.editor.getAttribute("contenteditable"))return null;n.getData().get("isActive")||(c({isActive:!0}),d.current=!0,g("both"))},onMouseUp:()=>{let{height:e,width:t}=o.current.getBoundingClientRect();e=`${e}px`,t=`${t}px`,k.height===e&&k.width===t||(c({imgStyle:(0,vt.Map)(n.getData().get("imgStyle")).merge({height:e,width:t})}),v({height:e,width:t}))}},(0,u.tZ)("img",{ref:t,src:S,width:"100%",height:"100%",css:h,onLoad:()=>{const{naturalHeight:e,naturalWidth:o}=t.current;if(!k.height||!k.width)if(e&&o){const t=`${e}px`,r=`${o}px`;c({imgStyle:(0,vt.Map)({"object-fit":"contain",height:t,width:r})}),v({height:t,width:r})}else v({height:"250px",width:"250px"})}}))},Et=e=>{var t,o;const{block:r}=e;let n=r.getData().filter(((e,t)=>"class"!==e&&!["depth","listStyles","listStart"].includes(t))).reduce(((e,t,o)=>e.set((0,y.camelCase)(o),t)),(0,vt.Map)());const i=r.getData().get("listStart")>0?"ol":"ul",a=null!==(t=r.getDepth())&&void 0!==t?t:0,s=null!==(o=n.get("listStyleType"))&&void 0!==o?o:"ol"===i?{0:"decimal",1:"lower-alpha",2:"lower-roman",3:"upper-alpha",4:"upper-roman"}[a]:"disc";n=n.set("marginLeft",2.5*a+"em").set("listStyleType",s);let c={};if(!(0,y.isNil)(r.getData().get("listStart"))){const e=(0,vt.Map)(r.getData().get("listStyles")).reduce(((e,t,o)=>e.add(`${o}: ${t}`)),(0,vt.OrderedSet)()).toArray().join("; ");c={"data-start":r.getData().get("listStart"),"data-list-style":e,"data-pasted-list":!0}}return(0,u.tZ)("ol",null,(0,u.tZ)("li",(0,l.Z)({className:"list-style-type",style:n.toJS()},c,{"data-type":"list-item"}),(0,u.tZ)(St.EditorBlock,e)))},Ot=e=>{const{block:t}=e;let o=t.getData().filter(((e,t)=>"class"!==e&&!["depth","listStyles","listStart"].includes(t))).reduce(((e,t,o)=>e.set((0,y.camelCase)(o),t)),(0,vt.Map)());
1if("code-block"===t.getType()){o=(0,vt.Map)(Ke).merge(o)}return t.getDepth()&&(o=o.set("marginLeft",2.5*t.getDepth()+"em")),(0,u.tZ)("div",{style:o.toJS()},(0,u.tZ)(St.EditorBlock,e))},Bt=e=>{const{block:t,blockProps:{editor:o}}=e;if(t.getData().get("tablePosition")&&!t.getData().get("tableShape")){const r=t.getData().get("tablePosition"),n=null===o||void 0===o?void 0:o.editor.querySelector(`[data-position='${r}']`);return n?(0,nt.createPortal)((0,u.tZ)(St.EditorBlock,e),n):null}const r=t.getData(),n=r.get("tableKey"),l=(0,vt.Map)(r.get("tableStyle")).mapKeys((e=>(0,y.camelCase)(e))).toJS(),i=r.get("tableShape"),a=r.get("tableColgroup");return Array.isArray(i)?(0,u.tZ)("table",{key:n,css:l,id:n},a&&(0,u.tZ)("colgroup",{dangerouslySetInnerHTML:{__html:a}}),(0,u.tZ)("tbody",null,i.map(((t,o)=>(0,u.tZ)("tr",{key:o,css:r.get("rowStyle")[o]&&(0,vt.Map)(r.get("rowStyle")[o]).mapKeys((e=>(0,y.camelCase)(e))).toJS()},t.map(((t,r)=>{const l=(0,vt.Map)(t.style).mapKeys((e=>(0,y.camelCase)(e))).toJS();return"th"===t.element?(0,u.tZ)("th",{key:r,css:l,colSpan:t.colspan,rowSpan:t.rowspan,"data-position":`${n}-${o}-${r}`},!!(0===o&0===r)&&(0,u.tZ)(St.EditorBlock,e)):(0,u.tZ)("td",{key:r,css:l,colSpan:t.colspan,rowSpan:t.rowspan,"data-position":`${n}-${o}-${r}`},!!(0===o&0===r)&&(0,u.tZ)(St.EditorBlock,e))}))))))):(0,u.tZ)(St.EditorBlock,e)};function Tt(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function Zt(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(o),!0).forEach((function(t){(0,N.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Tt(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}const Lt=(()=>{const e=Zt({},St.DefaultDraftInlineStyle);return["backgroundColor","color"].forEach((t=>{Le.forEach((o=>{e[`${t}.${o}`]={[t]:o}}))})),Ne.forEach((t=>{e[`fontFamily.${t}`]={fontFamily:t}})),$e.forEach((t=>{e[`fontSize.${t}`]={fontSize:`${t}pt`}})),e})(),Nt=e=>{const t=e.intersect(["BOLD","CODE","ITALIC","UNDERLINE"]).reduce(((e,t)=>e.merge(Lt[t])),(0,vt.Map)());let o=(e=e.subtract(["BOLD","CODE","ITALIC","UNDERLINE"])).filter((e=>e.includes(":")));return e=e.subtract(o),o=o.reduce(((e,t)=>(t=Rt(t),t=(0,vt.Map)(t).mapKeys((e=>(0,y.camelCase)(e))),e.merge(t))),(0,vt.Map)()),e=e.map((e=>e.split("."))).filter((e=>e.every((e=>e.length)))).reduce(((e,t)=>{const o=t.shift().trim(),r=t.join(".").trim();return e.merge({[o]:r})}),o.merge(t)).toJS(),(0,y.isEmpty)(e)?null:e};let $t;const Kt={customBlockFn:e=>{const t=e.getAttribute("style")||"",o=e.getAttribute("class")||"";let r=Rt(t)||{};if(r=o.split(" ").filter((e=>e.length)).reduce(((e,t)=>{const o=t.includes("depth")?"depth":t,r="depth"===o?+t.slice(5):"class";return e[o]=r,e}),r),"LI"===e.tagName&&(e.parentNode.getAttribute("start")||"none"!==e.style.listStyleType)&&!e.className.split(" ").find((e=>["ordered-list-item","unordered-list-item"].includes(e)))){const t="UL"===e.parentNode.tagName?"ul":"ol";if(e.parentNode.firstElementChild===e){var n,l,i;r.listStyles=Rt(null!==(n=e.parentNode.getAttribute("style"))&&void 0!==n?n:"margin-left: 36pt;"),r.listStart=null!==(l=null!==(i=e.getAttribute("start"))&&void 0!==i?i:e.parentNode.getAttribute("start"))&&void 0!==l?l:"ul"===t?0:1;let o=r.listStart;for(const r of e.parentNode.children)"ul"===t?r.setAttribute("start",0):r.setAttribute("start",o++)}else r.listStart=e.getAttribute("start");return r["list-style-type"]=e.style.listStyleType||("ul"===t?"disc":"decimal"),{type:"pasted-list-item",data:r}}if(e.firstChild&&"IMG"===e.firstChild.tagName){let t=e.firstChild.getAttribute("style");return t=Rt(t),r=Zt(Zt({},r),t&&{imgStyle:(0,vt.Map)(t)}),{type:"atomic",data:r}}if("PRE"===e.tagName)return r.background||(r=Rt(Ke.map((e=>e.join(": "))).join("; "))),{type:"code-block",data:r};if(/break-after:|break-before:/.test(e.style.cssText))return{type:"page-break",data:r};if("P"===e.tagName){var a,s,c;return(null===(a=e.style.margin)||void 0===a?void 0:a.startsWith("0"))||(null===(s=e.style.marginTop)||void 0===s?void 0:s.startsWith("0"))&&(null===(c=e.style.marginBottom)||void 0===c?void 0:c.startsWith("0"))?{type:"unstyled",data:r}:{type:"paragraph",data:r}}if((e.innerText||"").startsWith("---hr---"))return{type:"horizontal-rule",data:r};if(["TD","TH"].includes(e.tagName)){var d,p;const t=e.closest("table"),o=null!==(d=e.closest("thead"))&&void 0!==d?d:t.querySelector("thead"),n=null!==(p=e.closest("tbody"))&&void 0!==p?p:t.querySelector("tbody"),l=t.querySelectorAll("tr");if(t.querySelector("table"))return{type:"unstyled",data:r};(0,y.isEmpty)(e.textContent.replace(/\s/g,""))&&(e.innerHTML="&nbsp;");const i=e.previousElementSibling,a=e.parentNode,s=a.previousElementSibling;if(i||s||o&&[t,n].includes(a.parentNode)){let t=!1;for(let o=0,n=l,i=n.length;o<i;o++){for(let l=0,i=n[o].children,a=i.length;l<a;l++)if(i[l]===e){r.tableKey=$t,r.tablePosition=`${$t}-${o}-${l}`,r.colspan=i[l].getAttribute("colspan"),r.rowspan=i[l].getAttribute("rowspan"),t=!0;break}if(t)break}return{type:"table",data:r}}const c=t.querySelector("colgroup"),u=[];$t=(0,St.genKey)(),r.tableKey=$t,r.tablePosition=`${$t}-0-0`,r.tableStyle=Rt(t.getAttribute("style"))||{margin:"15px 0",width:"100%"},r.tableStyle["border-collapse"]="collapse";for(let d=0,p=l,g=p.length;d<g;d++){u.push([]);const t={};0===d?("TH"===e.tagName&&(t["background-color"]="rgba(240, 240, 240, 0.8)"),r.rowStyle=[Rt(p[d].getAttribute("style"))||t]):r.rowStyle.push(Rt(p[d].getAttribute("style"))||t);for(let e=0,o=p[d].children,r=o.length;e<r;e++){const t={border:"1px solid rgba(0, 0, 0, 0.2)",padding:"6px","text-align":"center"};"TH"===o[e].tagName&&(t["font-weight"]="bold");const r=Rt(o[e].getAttribute("style"))||t;u[d][e]={element:"TD"===o[e].tagName?"td":"th",style:r,colspan:o[e].getAttribute("colspan"),rowspan:o[e].getAttribute("rowspan")}}}return r.tableShape=u,r.tableColgroup=null===c||void 0===c?void 0:c.outerHTML,{type:"table",data:r}}return{data:r}},customInlineFn:(e,{Style:t,Entity:o})=>{if("IMG"===e.tagName)return null;if("A"===e.tagName){let t={};return e.hasAttribute("target")&&(t={target:e.getAttribute("target"),rel:"noreferrer"}),o("LINK",Zt(Zt({},t),{},{url:e.getAttribute("href")}))}let r=e.getAttribute("style");if(!r)return null;if(r.includes(";"))return t(r);r=r.split(":");
1const n=(0,y.camelCase)(r.shift().trim()),l=r.join(":").trim();return r=`${n}.${l}`,"textDecoration.underline"===r?null:t(r)}};function Rt(e="",t={}){return e?e.split(";").filter((e=>e.includes(":"))).map((e=>e.split(":"))).reduce(((e,t)=>{const o=t.shift().trim(),r=t.join(":").trim();return e[o]=r,e}),t):null}function Ft({block:e,blockStyles:t=(0,vt.OrderedSet)(),classes:o=(0,vt.OrderedSet)()}){e.getData().filter(((e,t)=>!["depth","listStyles","listStart"].includes(t))).forEach(((e,r)=>{"class"===e?o=o.add(r):t=t.add(`${r}: ${e}`)}));const r=e.get("depth");return r&&(t=vt.OrderedSet.of([`margin-left: ${2.5*r}em`]).union(t)),o=o.size&&` class="${o.toArray().join(" ")}"`||"",t=t.size&&` style="${t.toArray().join("; ")}"`||"",`${o}${t}`}function At(e,t,o){return t?(t.findStyleRanges((()=>!0),((r,n)=>{let l="",i=t.getInlineStyleAt(r);i=(0,vt.Map)(Nt(i)).reduce(((e,t,o)=>("font-size"===(o=(0,y.kebabCase)(o))&&/^\d*$/.test(t)&&(t+="pt"),e.add(`${o}: ${t}`))),(0,vt.OrderedSet)()).toArray().join("; "),i=i?` style="${i}"`:"";const a=t.getEntityAt(r),s=t.getEntityAt(n-1),c=a&&a===s?o.getEntity(a):null;i&&(e+=`<span${i}>`,l="</span>"+l);const d=t.getText().slice(r,n).replace(/\n/g,"<br>").replace(/\s{2,}?/g,"&nbsp;&nbsp;").replace(/^\s$/g,"&nbsp;");if(c&&"LINK"===c.get("type")){const{url:t,target:o}=c.getData();e+=`<a href="${t}" ${o?`target="${o}" rel="noreferrer"`:""}>${d}</a>`}else e+=d;e+=l})),e):"<span>&nbsp;</span>"}function zt(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function Pt(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(o),!0).forEach((function(t){(0,N.Z)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):zt(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}const{hasCommandModifier:Mt}=St.KeyBindingUtil,jt=(0,vt.Map)({unstyled:{element:"div"},paragraph:{element:"section"},"pasted-list-item":{element:"ol"},table:{element:"div"}}),It=St.DefaultDraftBlockRenderMap.merge(jt),Ut=r.forwardRef(((e,t)=>{var o;const n=(0,r.useRef)(null),i=(0,r.useRef)(null),a=(0,r.useRef)(null),s=(0,r.useRef)(null),c=(0,r.useRef)(!1),{0:d,1:p}=(0,r.useState)(St.EditorState.createEmpty()),{0:g,1:f}=(0,r.useState)({}),{0:h,1:m}=(0,r.useState)(!1),{0:b,1:x}=(0,r.useState)(!1),{0:k,1:v}=(0,r.useState)(null!==(o=e.height)&&void 0!==o?o:"auto"),{0:S,1:w}=(0,r.useState)(!1),{0:C,1:D}=(0,r.useState)(!0),{0:E,1:O}=(0,r.useState)(!1);(0,r.useEffect)((()=>{var t,o,r,n;(0,y.isNil)(null!==(t=e.value)&&void 0!==t?t:null===(o=e.formLinker)||void 0===o?void 0:o.getValue(e.name))||V(null!==(r=e.value)&&void 0!==r?r:null===(n=e.formLinker)||void 0===n?void 0:n.getValue(e.name))}),[]),(0,r.useEffect)((()=>{C&&n.current&&(i.current=n.current.editorContainer.closest(".rich-text-editor"))}),[C]),(0,r.useEffect)((()=>{i.current&&x(i.current.scrollHeight>i.current.clientHeight+24)})),(0,te.Z)(a,(e=>{var t;null!==(t=s.current)&&void 0!==t&&t.contains(e.target)||(c.current=!0)}));const B=(t,o=d)=>{if(!t)return!1;if(o.getCurrentContent().hasText()){let r=$(t);const l=r.getCurrentContent().getBlockMap(),i=St.Modifier.replaceWithFragment(o.getCurrentContent(),o.getSelection(),l);r=St.EditorState.push(o,i,"insert-fragment"),U(r);const a=n.current,s=d.getSelection().getHasFocus();return setTimeout((()=>{_(e.disabled),null===a||void 0===a||a.blur(),setTimeout((()=>{s&&(null===a||void 0===a||a.focus())}))})),!0}return V(t),!0},T=e=>{var t;let o=d.getCurrentContent(),r=d.getSelection();const n=d.getCurrentInlineStyle();"string"!==typeof e&&(e=null===(t=e.props)||void 0===t?void 0:t.children),o=St.Modifier.replaceText(o,r,e,n);let l=St.EditorState.push(d,o,"insert-characters");const i=r.getFocusOffset(),a=r.getAnchorOffset();r=r.merge({focusOffset:i+e.length,anchorOffset:a+e.length}),l=St.EditorState.forceSelection(l,r),U(l)}
1,Z=(0,r.useRef)(null),L=(0,r.useRef)(null),N=(e=d)=>{const t=e.getCurrentContent(),o=(r=t,{inlineStyles:(()=>{const e={BOLD:{style:{fontWeight:"bold"}},ITALIC:{style:{fontStyle:"italic"}},UNDERLINE:{style:{textDecoration:"underline"}},STRIKETHROUGH:{style:{textDecoration:"line-through"}}};return["backgroundColor","color"].forEach((t=>{Le.forEach((o=>{e[`${t}.${o}`]={style:{[t]:o}}}))})),Ne.forEach((t=>{e[`fontFamily.${t}`]={style:{fontFamily:t}}})),$e.forEach((t=>{e[`fontSize.${t}`]={style:{fontSize:`${t}pt`}}})),e})(),inlineStyleFn:e=>(e=Nt(e))&&{element:"span",style:e},blockRenderers:{"code-block":e=>`<pre${Ft({block:e,blockStyles:(0,vt.OrderedSet)(Ke.map((e=>e.join(": "))))})}>${At("",e,r)}</pre>`,"page-break":e=>'<div style="page-break-after: always"><br></div>',paragraph:e=>0===e.getLength()?`<p${Ft({block:e})}><br></p>`:`<p${Ft({block:e})}>${At("",e,r)}</p>`,unstyled:e=>0===e.getLength()?`<div${Ft({block:e})}><br></div>`:`<div${Ft({block:e})}>${At("",e,r)}</div>`,"horizontal-rule":e=>"<hr>",atomic:e=>{const t=e.getData();let o=[],n=[],l=[];t.forEach(((e,t)=>{"class"===e?l.push(t):"imgStyle"===t?e.forEach(((e,t)=>n.push(`${t}: ${e}`))):o.push(`${t}: ${e}`)}));const i=t.get("float");i&&!t.get("margin")&&o.push("right"===i?"margin: 0 8px 0 0":"margin: 0 0 0 8px"),e.get("depth")&&o.push(`margin-left: ${2.5*e.get("depth")}em; `),l=l.join(" ")&&` class="${l.join(" ")}"`,o=o.join("; ")&&` style="${o.join("; ")}"`,n=` style="${n.join("; ")}"`;const{src:a}=e.getEntityAt(0)&&r.getEntity(e.getEntityAt(0)).getData()||{};return`<figure${l}${o}><img src="${a}"${n}/></figure>`},"pasted-list-item":e=>{const t=r.getBlockBefore(e.getKey());if((null===t||void 0===t?void 0:t.getType())===e.getType())return"";const o=e.getData();let n=o.get("listStart");n=n&&` start="${n}"`||"";let l=(0,vt.Map)(o.get("listStyles")).reduce(((e,t,o)=>e.add(`${o}: ${t}`)),(0,vt.OrderedSet)()).toArray().join("; ");l=l&&` style="${l}"`;const i=r.getBlockMap().skipUntil((t=>t===e)).takeWhile((e=>e.getType().endsWith("list-item"))).toList(),a=e.getData().get("listStart")>0?"ol":"ul";let s=e.getDepth();return`<${a}${l}${n}>${i.map((e=>{const t=e.getDepth(),o=t>s?`<${a}><li`:t<s?`</${a}><li`:"<li";return s=t,`\n${o}${Ft({block:e})}>${At("",e,r)}</li>`})).toArray().join("")}</${a}>`},table:e=>{var t;const o=r.getBlockBefore(e.getKey());if(o&&"table"===o.getType())return"";const n=e.getData(),l=n.get("tableShape");if(!l)return"<table><tbody><tr><td>&nbsp;</td></tr></tbody></table>";let i=(0,vt.Map)(n.get("tableStyle")).reduce(((e,t,o)=>e.add(`${o}: ${t}`)),(0,vt.OrderedSet)()).toArray().join("; ");i=i&&` style="${i}"`;const a=n.get("tableKey"),s=r.getBlockMap().skipUntil((e=>"table"===e.getType()&&e.getData().get("tableKey")===a)).takeWhile((e=>"table"===e.getType())).toList(),c=null!==(t=n.get("tableColgroup"))&&void 0!==t?t:"";let d=0;return`<table${i}>${c}<tbody>${l.map(((t,o)=>{let n=(0,vt.Map)(e.getData().get("rowStyle")[o]).reduce(((e,t,o)=>e.add(`${o}: ${t}`)),(0,vt.OrderedSet)()).toArray().join("; ");return n=n&&` style="${n}"`,`<tr${n}>${t.map(((e,t)=>{var n,l;const i=e.element;let a=(0,vt.Map)(e.style).reduce(((e,t,o)=>e.add(`${o}: ${t}`)),(0,vt.OrderedSet)()).toArray().join("; ");a=a&&` style="${a}"`;let c=s.get(d),p=c.getData().get("colspan");p=p?` colspan=${p}`:"";let u=c.getData().get("rowspan");u=u?` rowspan=${u}`:"";const[,g,f]=null!==(n=null===(l=c)||void 0===l?void 0:l.getData().get("tablePosition").split("-"))&&void 0!==n?n:[];return o!==+g||t!==+f?c=null:d++,`<${i}${a}${p}${u}>${At("",c,r)}</${i}>`})).join("")}</tr>`})).join("")}</tbody></table>`}},blockStyleFn:e=>{const t=e.getType(),o=e.getDepth(),r=e.getData(),n={};let l=(0,vt.OrderedSet)(),i=(0,vt.OrderedSet)();return r.forEach(((e,t)=>{"class"===e?i=i.add(t):["depth","listStyles","listStart"].includes(t)||(l=l.add(`${t}: ${e}`))})),o>0&&!t.includes("list-item")?l=l.add(`margin-left:${2.5*o}em`):t.includes("unordered-list-item")&&o<=4?(i.remove("ordered-list-item"),i=vt.OrderedSet.of("list","unordered-list-item",`depth${o}`).union(i),l=vt.OrderedSet.of(`margin-left:${1.5+(0===o?1:0)}em`,"list-style-type: "+(0===o?"disc":1===o?"circle":"square"),"position: relative").union(l)):t.includes("ordered-list-item")&&o<=4&&(i.remove("unordered-list-item"),i=vt.OrderedSet.of("list","ordered-list-item",`depth${o}`).union(i),l=vt.OrderedSet.of(`margin-left: ${1.5+(0===o?1:0)}em`,"list-style-type: none","position: relative").union(l)),"blockquote"===t&&(l=l.add("color: #999999; font-family: 'Hoefler Text', Georgia, serif; font-style: italic; line-height: 1.15em; border: none; border-left: 5px solid rgba(100, 100, 100, 0.5); margin: 0 2em; padding-left: 1em;")),i.size&&(n.class=i.toArray().join(" ")),l.size&&(n.style=l.toArray().join(";")),{attributes:n}},defaultBlockTag:"div",entityStyleFn:e=>{if("video"===e.get("type").toLowerCase()){const{src:t}=e.getData();return{element:"video",attributes:{src:t}}}}});var r;return t.hasText()?(0,kt.E)(t,o):null},$=t=>{var o,r,n;const l=(null!==(o=null!==(r=null!==t&&void 0!==t?t:e.value)&&void 0!==r?r:null===(n=e.fl)||void 0===n?void 0:n.getValue(e.name))&&void 0!==o?o:"").replace(/<hr\/?>/g,"<div>---hr---</div>"),i=["div","p","h1","h2","h3","h4","h5","h6","table","ol","ul","hr","pre","section","header","nav","main","blockquote"],a=(new DOMParser).parseFromString(l,"text/html"),s=a.querySelector("body");let c=s.firstChild;for(1===s.children.length&&"TABLE"===c.tagName&&(c=document.createElement("br"),s.insertBefore(c,s.firstChild),s.appendChild(document.createElement("br")));c;){var d,p;if("STYLE"!==c.tagName){if(!i.includes(null===(d=c.tagName)||void 0===d?void 0:d.toLowerCase())){const e=a.createElement("div");let t=c.nextSibling;for(e.appendChild(c);t&&!i.includes(null===(u=t.tagName)||void 0===u?void 0:u.toLowerCase());){var u;const o=t;t=o.nextSibling,e.appendChild(o)}s.insertBefore(e,t),c=t}c=null===(p=c)||void 0===p?void 0:p.nextSibling}else{const e=c.nextSibling;s.removeChild(c),c=e}}const g=(e,t)=>{if(e){if(/white-space:\s*(pre|pre-wrap);?/.test(e.getAttribute("style"))){e.innerHTML=e.innerHTML.replace(/\n/g,"<br>").replace(/\s{2}/g,"&nbsp;&nbsp;").replace(/&nbsp;\s/g,"&nbsp;&nbsp;");let t=e.getAttribute("style");t=t.replace(/white-space:\s*(pre|pre-wrap);?/,""),e.setAttribute("style",t)}if(t&&["DIV","P","INPUT"].includes(e.tagName)){const t=f(e,"span");e.replaceWith(t),e=t}if(t&&"TABLE"===e.tagName&&"TBODY"===e.firstElementChild.tagName){if(1===e.firstElementChild.children.length){if(1===e.firstElementChild.firstElementChild.children.length){let t=e.firstElementChild.firstElementChild.firstElementChild;["DVI","P"].includes(t.firstElementChild.tagName)&&(t=t.firstElementChild);const o=f(t,"span");e.replaceWith(o)}}}g(e.nextElementSibling,t),t=t||"LI"===e.tagName||"TD"===e.tagName||"TH"===e.tagName,g(e.firstElementChild,t)}};function f(e,t){const o=document.createElement(t),r=e.cloneNode(!0);for(;r.firstChild;)o.appendChild(r.firstChild);for(const n of r.attributes)"value"===n.name?o.textContent=n.value:o.setAttribute(n.name,n.value);return o}g(s.firstElementChild);const h=(new XMLSerializer).serializeToString(s);let m=St.EditorState.createWithContent((0,xt.M)(h,Kt));return m=St.EditorState.moveSelectionToEnd(m),oe(m)},K=()=>{m(!0)};(0,r.useEffect)((()=>{m(!1)}),[h]);const R=(e,t)=>{switch(e){case"backspace":{let e=t.getCurrentContent(),o=t.getSelection();const r=o.getStartKey(),n=o.getStartOffset(),l=o.isCollapsed(),i=e.getBlockBefore(r),a=St.RichUtils.getCurrentBlockType(t);if(l&&0===n&&i&&"atomic"===i.getType())return t=q(t,i),t=St.EditorState.acceptSelection(t,o),U(St.RichUtils.onBackspace(t)),"handled";if("atomic"===a){const n=e.getBlockForKey(r);t=q(t,n),t=St.EditorState.acceptSelection(t,o),e=(t=St.RichUtils.onBackspace(t)).getCurrentContent(),o=t.getSelection();const l=o.getAnchorKey();let i=St.SelectionState.createEmpty(l);return i=i.set("focusOffset",1),e=St.Modifier.removeRange(e,i,"backward"),U(St.EditorState.push(t,e,"backspace-character")),"handled"}if("table"===a&&l&&0===n)return"handled";if("table"!==a&&l&&"table"===(null===i||void 0===i?void 0:i.getType())&&0===n)return z("previous",!0),"handled";if(l&&0===n&&"page-break"===(null===i||void 0===i?void 0:i.getType())){let r=St.SelectionState.createEmpty(i.getKey());return e=St.Modifier.setBlockData(e,r,(0,vt.Map)({})),e=St.Modifier.setBlockType(e,r,"unstyled"),r=r.merge({focusKey:o.getFocusKey(),focusOffset:0,hasFocus:!0}),e=St.Modifier.removeRange(e,r,"backward"),U(St.EditorState.push(t,e,"remove-range")),"handled"}if("page-break"===a){e=St.Modifier.setBlockData(e,o,(0,vt.Map)({})),e=St.Modifier.setBlockType(e,o,"unstyled");let n=o;
1return l&&e.getBlockAfter(r)&&(n=n.merge({focusKey:e.getBlockAfter(r).getKey(),focusOffset:0,hasFocus:!0})),e=St.Modifier.removeRange(e,n,"backward"),U(St.EditorState.push(t,e,"remove-range")),"handled"}return l&&0===n&&["pasted-list-item","ordered-list-item","unordered-list-item"].includes(a)?(e=St.Modifier.setBlockType(e,o,"unstyled"),U(St.EditorState.push(t,e,"change-block-type")),"handled"):l?"not-handled":F(t)}case"BOLD":return ie("BOLD"),"handled";case"bullet_list":return ae("BULLETLIST"),"handled";case"delete":return(()=>{const e=d.getSelection(),t=d.getCurrentContent(),o=t.getBlockForKey(e.getStartKey()),r=t.getBlockForKey(e.getEndKey()),n=t.getBlockAfter(r.getKey()),l=e.getEndOffset();if(e.isCollapsed())return l===o.getLength()&&"table"===n.getType()?"handled":"not-handled";return F()})();case"float_left":return re({float:"left"}),"handled";case"float_right":return re({float:"right"}),"handled";case"INDENT":return Q("INDENT"),"handled";case"ITALIC":return ie("ITALIC"),"handled";case"ordered_list":return ae("ORDEREDLIST"),"handled";case"OUTDENT":return Q("OUTDENT"),"handled";case"UNDERLINE":return ie("UNDERLINE"),"handled";case"shiftTab":case"tab":return"handled";default:return"not-handled"}},F=(e=d,t="")=>{let o=e.getSelection(),r=e.getCurrentContent();const n=o.getStartKey(),l=r.getBlockForKey(n),i=o.getEndKey(),a=r.getBlockForKey(i),s=r.getBlockBefore(n),c=r.getBlockAfter(i),p="table"===l.getType()&&0===o.getStartOffset()&&"table"!==(null===s||void 0===s?void 0:s.getType()),u=l.getData().get("tableKey"),g="table"===a.getType()&&o.getEndOffset()===a.getLength()&&"table"!==(null===c||void 0===c?void 0:c.getType()),f=a.getData().get("tableKey"),h=u===f;if(l===a||"table"!==l.getType()&&"table"!==a.getType())return"not-handled";let m=r.getBlockMap();const b=o.getStartOffset(),y=o.getEndOffset();let x=m.toSeq().skipUntil((e=>e===l)).takeUntil((e=>e===c)).map((e=>{let o;const r=e.getType();return e===l?(o=e.getText().slice(0,b)+t,e.set("text","table"===r?o||" ":o)):e===a?(o=e.getText().slice(y,e.getLength()),e.set("text","table"===r?o||" ":o)):e.set("text","table"===r?" ":"")})).toOrderedMap();switch(!0){case"table"!==l.getType()&&g:case p&&g:if(m=m.merge(x),m=m.filter(((e,t)=>!x.has(t)||"table"!==e.getType()&&e.getText())),!m.size){const e=(0,St.genKey)();m=m.merge([[e,new St.ContentBlock({key:e,type:"unstyled",text:"",data:(0,vt.Map)()})]])}break;case p&&"table"!==a.getType():{r=St.Modifier.removeRange(r,o,"backward"),m=r.getBlockMap();const e=m.first().set("type","unstyled").set("data",(0,vt.Map)());m=m.merge([[e.getKey(),e]]);break}case h:{x=x.butLast(),m=m.merge(x);let e=St.SelectionState.createEmpty(i);e=e.merge({focusOffset:o.getEndOffset()}),r=r.set("blockMap",m),r=St.Modifier.removeRange(r,e,"backward"),m=r.getBlockMap();break}case p:{const e=x.filter((e=>e.getData().get("tableKey")!==f));m=m.merge(x.butLast()),m=m.filter(((t,o)=>!e.has(o)));let t=St.SelectionState.createEmpty(i);t=t.set("focusOffset",o.getEndOffset()),r=r.set("blockMap",m),r=St.Modifier.removeRange(r,t,"backward"),m=r.getBlockMap();break}case g:{const e=x.filter((e=>e.getData().get("tableKey")!==u));m=m.merge(x),m=m.filter(((t,o)=>!e.has(o)));break}case"table"===l.getType()&&"table"===a.getType()&&!h:{const e=x.filter((e=>!e.getData().get("tableKey"))),t=e.first();m=m.merge(x.butLast()),m=m.filter(((o,r)=>!e.has(r)||r===t.getKey())),m=m.merge([[t.getKey(),t.set("text"," ")]]);let n=St.SelectionState.createEmpty(i);n=n.set("focusOffset",o.getEndOffset()),r=r.set("blockMap",m),r=St.Modifier.removeRange(r,n,"backward"),m=r.getBlockMap();break}case"table"!==l.getType()&&"table"===a.getType():{if("table"===(null===s||void 0===s?void 0:s.getType())){const e=x.first().set("text"," ");x=x.merge([[e.getKey(),e]])}m=m.merge(x.butLast()),m=m.filter((e=>e.getLength()));let e=St.SelectionState.createEmpty(i);e=e.set("focusOffset",o.getEndOffset()),r=r.set("blockMap",m),r=St.Modifier.removeRange(r,e,"backward"),m=r.getBlockMap();break}default:{const e=x.find((e=>!e.getData().get("tableKey"))).getKey(),t=x.filter((e=>e.getData().get("tableKey")===u));m=m.merge(t),r=r.set("blockMap",m);let o=St.SelectionState.createEmpty(e);o=o.merge({focusKey:i,focusOffset:y}),r=St.Modifier.removeRange(r,o,"backward"),m=r.getBlockMap()}}const k=m.has(n)?n:m.has(i)?i:(null===s||void 0===s?void 0:s.getKey())||(null===c||void 0===c?void 0:c.getKey())||m.first().getKey();return o=St.SelectionState.createEmpty(k),o=o.merge({anchorKey:k,anchorOffset:b+t.length,focusKey:k,focusOffset:b+t.length}),r=r.set("blockMap",m),e=St.EditorState.push(e,r,"remove-range"),e=St.EditorState.forceSelection(e,o),U(e),"handled"},A=(t,o,r)=>{var n;if(e.maxLength&&(null===(n=Z.current)||void 0===n?void 0:n.length)>=e.maxLength)return!0;let l=r.getCurrentContent();const i=r.getSelection();
1return"table"===l.getBlockForKey(i.getStartKey()).getType()?(l=i.isCollapsed()?St.Modifier.insertText(l,i,t):St.Modifier.replaceText(l,i,t),U(St.EditorState.push(r,l,"insert-characters")),!0):B(o,r)},z=(e="next",t=!1)=>{let o=d,r=d.getSelection(),n=d.getCurrentContent(),l=r.getAnchorKey(),i=n.getBlockForKey(l);do{i="next"===e?n.getBlockAfter(l):n.getBlockBefore(l),l=i&&i.getKey()}while(l&&["atomic","horizontal-rule"].includes(i.getType()));i||"next"!==e?i||(i=n.getBlockForKey(r.getAnchorKey())):(r=r.merge({anchorOffset:n.getBlockForKey(r.getAnchorKey()).getLength(),focusOffset:n.getBlockForKey(r.getAnchorKey()).getLength()}),n=St.Modifier.splitBlock(n,r),i=n.getLastBlock(),r=St.SelectionState.createEmpty(i.getKey()),n=St.Modifier.setBlockType(n,r,"unstyled"),i=n.getLastBlock(),o=St.EditorState.push(d,n,"split-block"));const a="table"===i.getType()&&!t,s=i.getLength();r=St.SelectionState.createEmpty(i.getKey()),r=r.merge({anchorOffset:a||"next"===e?0:s,focusOffset:a||"previous"===e?s:0}),U(St.EditorState.forceSelection(o,r))},P=(0,r.useRef)(null),M=({imgUrl:t,imgFile:o})=>{if("table"===St.RichUtils.getCurrentBlockType(d))return null;if(!t&&o)return P.current=o,void e.onUpload(P,j);P.current=null;let r=d.getCurrentContent();r=r.createEntity("IMAGE","IMMUTABLE",{src:t});const n=r.getLastCreatedEntityKey(),l=St.AtomicBlockUtils.insertAtomicBlock(d,n," ");U(l)},j=(e,t)=>{if(e)M({imgUrl:t});else{const e=new window.FileReader;e.readAsDataURL(P.current),e.onloadend=e=>{M({imgUrl:e.target.result})}}},I=(0,r.useRef)((0,y.debounce)((t=>{const o=N(t);Z.current=o,e.onChange(o)}),500,{leading:!0})),U=(0,r.useCallback)((t=>{const o=t.getSelection();let r=t.getCurrentContent();if(o.isCollapsed()&&"table"===St.RichUtils.getCurrentBlockType(t)){r.getBlockForKey(o.getAnchorKey()).getLength()||(r=St.Modifier.insertText(r,o," "),t=St.EditorState.push(t,r,"insert-characters"))}let n=r.getBlockMap();const l=n.find((e=>e.getData().get("isActive")));if(l){if(S){let e=l.getData();e=e.delete("isActive");const i=l.set("data",e);n=n.set(l.getKey(),i);const a=r.set("blockMap",n);t=St.EditorState.push(t,a,"change-block-data"),t=St.EditorState.forceSelection(t,o)}w((e=>!e))}let i=!1;if(o.isCollapsed()){const r=o.getAnchorKey(),n=o.getAnchorOffset(),l=t.getCurrentContent(),a=l.getBlockForKey(r),s=null===a||void 0===a?void 0:a.getEntityAt(n);if(s&&!c.current){"LINK"!==l.getEntity(s).get("type")||e.disabled||(i=!0)}}I.current(t);const a=t.getCurrentInlineStyle().toList(),s={};a.forEach((e=>{const[t,o]=e.split(".");s[t]=o})),O(i),f(s),L.current=t.getCurrentContent().getPlainText(),p(t)}),[S,e.disabled]);(0,r.useEffect)((()=>{if(e.disabled){let e=d.getCurrentContent().getBlockMap();const t=e.find((e=>e.getData().get("isActive")));if(t){let o=t.getData();o=o.delete("isActive");const r=t.set("data",o);e=e.set(t.getKey(),r);const n=d.getCurrentContent().set("blockMap",e),l=St.EditorState.push(d,n,"change-block-data");U(l)}w(!1)}}),[e.disabled,d,U]);const W=()=>{f({}),e.onBlur()},H=()=>{c.current=!1,e.onFocus()},q=(e,t)=>{const o=t.getData().delete("height").delete("width").delete("imgStyle");t=t.set("data",o);let r=e.getCurrentContent(),n=r.getBlockMap();return n=n.set(t.getKey(),t),r=r.set("blockMap",n),e=St.EditorState.push(e,r,"change-block-data")},_=e=>{if(e){var t,o;(null!==(t=null===(o=n.current)||void 0===o?void 0:o.editor.querySelectorAll('[contenteditable="true"]'))&&void 0!==t?t:[]).forEach((e=>{e.setAttribute("contenteditable","false"),e.setAttribute("data-editable-disabled","true")}))}else if(!e){var r,l;(null!==(r=null===(l=n.current)||void 0===l?void 0:l.editor.querySelectorAll('[data-editable-disabled="true"]'))&&void 0!==r?r:[]).forEach((e=>{e.setAttribute("contenteditable","true"),e.removeAttribute("data-editable-disabled")}))}},V=t=>{if(t===Z.current)return;let o=$(t);t?o=St.EditorState.moveFocusToEnd(o):null===t&&(o=ee(o)),U(o);const r=d.getSelection().getHasFocus(),l=n.current;setTimeout((()=>{_(e.disabled),null===l||void 0===l||l.blur(),setTimeout((()=>{r&&(null===l||void 0===l||l.focus())}))}))};(0,r.useImperativeHandle)(t,(()=>({focus:()=>Y(),blur:()=>n.current.blur(),reset:e=>V(e),getPlainText:e=>(e=>d.getCurrentContent().getPlainText(e))(e),insertCustomListItem:e=>T(e),insertText:e=>T(e),insertHtml:e=>B(e),toggleEditMode:e=>le(e),addEventListener:(e,t)=>i.current.addEventListener(e,t),removeEventListener:(e,t)=>i.current.removeEventListener(e,t),getEditorRef:()=>n.current,moveSelectionToStart:()=>{U(ee(d))}})));const G=(e,t,o)=>{let r=t.getBlockMap();const n=o.first().getData().get("tableKey");let l=r.find((e=>e.getData().get("tablePosition")===`${n}-0-0`));const i=l.getData().get("tableShape");o.forEach((t=>{const[o,r,n]=t.getData().get("tablePosition").split("-");i[r][n].style=Pt(Pt({},i[r][n].style),{},{"text-align":e})}));let a=l.getData();return a=a.set("tableShape",i),l=l.merge({data:a}),r=r.merge([[l.getKey(),l]]),t=t.merge({blockMap:r})},J=(e=d.getCurrentContent())=>{const t=d.getSelection(),o=t.getStartKey(),r=t.getEndKey(),n=e.getKeyAfter(r),l=e.getBlockMap().toSeq().skipUntil(((e,t)=>t===o)).takeUntil(((e,t)=>t===n)).filter((e=>"table"===e.getType())).toOrderedMap();return l.size?l:null},Y=()=>{n.current&&!e.disabled&&n.current.focus()},X=()=>
1{if(e.disabled)return null;d.getSelection().getHasFocus()||U(St.EditorState.moveFocusToEnd(d))},Q=(e,t=d,o=4,r=20,n)=>{const l=t.getSelection(),i=t.getCurrentContent(),a="INDENT"===e?1:-1,s=l.getStartKey(),c=l.getEndKey();let p=i.getBlockMap();const u=p.toSeq().skipUntil(((e,t)=>t===s)).takeUntil(((e,t)=>t===c)).concat([[c,p.get(c)]]).map((e=>{const t=e.getDepth(),l=e.getType().includes("list-item")?o:r,i=void 0!==n?n:Math.max(0,Math.min(t+a,l));return e.set("depth",i)}));p=p.merge(u);const g=i.merge({blockMap:p,selectionBefore:l,selectionAfter:l});t=St.EditorState.push(t,g,"adjust-depth"),U(t)},ee=e=>{let t=e.getSelection();const o=e.getCurrentContent().getFirstBlock().getKey();return t=St.SelectionState.createEmpty(o),St.EditorState.forceSelection(e,t)},oe=e=>{const t=e.getCurrentContent(),o=e.getSelection();let r=t.getBlockMap();const n=r.map((e=>{let o=e.getData().get("depth");const r=e.getData().get("margin-left");return(r&&/em$/.test(r)||o)&&(o=void 0!==o?o:parseInt(r.replace(/rem|em/,"")/2.5,10),e=e.set("depth",o)),e.findEntityRanges((e=>{const o=e.getEntity();return null!==o&&"LINK"===t.getEntity(o).getType()}),((t,o)=>{const r=e.getCharacterList().map(((e,r)=>t<=r&&r<o?(e=St.CharacterMetadata.applyStyle(e,"UNDERLINE"),e=St.CharacterMetadata.applyStyle(e,"color.#0088FF")):e));e=e.set("characterList",r)})),e}));r=r.merge(n);const l=t.merge({blockMap:r,selectionBefore:o,selectionAfter:o});return e=St.EditorState.push(e,l,"adjust-depth")},re=e=>{const t=d.getCurrentContent(),o=d.getSelection();let r=t.getBlockForKey(o.getAnchorKey()).getData();Object.keys(e).forEach((t=>{r=r.get(t)===e[t]?r.remove(t):r.merge(e)}));const n=St.Modifier.setBlockData(t,o,r);U(St.EditorState.push(d,n,"change-block-data"))},ne=(0,r.useRef)(!1),le=t=>{if(("richText"!==t||!C)&&("codeView"!==t||C))if(C){const e=i.current.getBoundingClientRect().height;D(!1),v(e),ne.current=!0}else{var o;e.onChange(null===(o=he.current)||void 0===o?void 0:o.textContent),D(!0),v(e.height?k:"auto")}};(0,r.useEffect)((()=>{C&&ne.current&&(ne.current=!1,V(e.value))}),[C]);const ie=e=>{var t;let o=(r=d).getSelection().getHasFocus()?r:ee(r);var r;/^fontSize\.\d{1,2}$/.test(e)&&(e+="pt");const n=o.getCurrentInlineStyle().filter((t=>t.includes(".")&&t.split(".")[0]===e.split(".")[0])).toList().get(0);n&&(o=St.RichUtils.toggleInlineStyle(o,n));let l=(0,y.kebabCase)(Object.keys(null!==(t=Lt[e])&&void 0!==t?t:{})[0]);!l&&e.endsWith(".unset")&&(l=(0,y.kebabCase)(e.split(".")[0])),o.getCurrentInlineStyle().filter((e=>e.includes(":"))).filter((e=>l&&e.includes(l))).forEach((e=>{const t=new RegExp(`${l}:\\s+(.*?;+\\s+|.*$)`),r=e.replace(t,"");o=St.RichUtils.toggleInlineStyle(o,e),o=St.RichUtils.toggleInlineStyle(o,r)})),e.endsWith("unset")?U(o):U(St.RichUtils.toggleInlineStyle(o,e))},ae=e=>{if("table"===St.RichUtils.getCurrentBlockType(d))return null;const t="BULLETLIST"===e?"unordered-list-item":"ordered-list-item";U(St.RichUtils.toggleBlockType(d,t))};(0,r.useEffect)((()=>{i.current.querySelectorAll("[data-start]").forEach((e=>{const t=e.closest("ol");t.setAttribute("start",e.getAttribute("data-start")),t.setAttribute("style","margin-left: 36pt; "+e.getAttribute("data-list-style")),t.setAttribute("data-list","true")}))}));const se=((e,t,o)=>r=>{switch(r.getType()){case"atomic":return{component:Dt,editable:!1,props:{editor:e,getEditorState:t,onChange:o}};case"horizontal-rule":return{component:wt};case"page-break":return{component:Ct};case"pasted-list-item":return{component:Et,editable:!0};case"unstyled":case"paragraph":case"header-one":case"header-two":case"header-three":case"header-four":case"header-five":case"header-six":case"code-block":return{component:Ot,editable:!0};case"table":return{component:Bt,editable:!0,props:{editor:e}};default:return null}})(n.current,(()=>d),U);(0,r.useEffect)((()=>{_(e.disabled)}),[e.disabled]);const ce="none"===e.toolbar||(0,y.isArray)(e.toolbar)&&"none"===e.toolbar[0],{0:de,1:pe}=(0,r.useState)(!1),{0:ue,1:ge}=(0,r.useState)(!1),fe=e=>{ge(e.target.scrollTop+e.target.clientHeight+12>=e.target.scrollHeight),pe(0===e.target.scrollTop)},he=(0,r.useRef)(null),me=()=>{if(ce)return null;{const t=d.getSelection(),o=d.getCurrentContent().getBlockForKey(t.getStartKey()),r={activeStyles:g,blockType:o.getType(),blockData:o.getData(),currentStyle:d.getSelection().getHasFocus()&&d.getCurrentInlineStyle(),editor:n,editorState:d,openLinkForm:h,alignmentSelect:e=>(e=>{const t=d.getCurrentContent(),o=d.getSelection();let r=St.Modifier.mergeBlockData(t,o,{"text-align":e});const n=J(r);
1n&&(r=G(e,r,n)),U(St.EditorState.push(d,r,"change-block-data"))})(e),blockDataToggle:e=>re(e),blockTypeSelect:e=>(e=>{let t=d.getCurrentContent();const o=d.getSelection();if(J())return null;const r=o.getAnchorKey();let n=t.getBlockForKey(r);if("page-break"===e){const e=(0,St.genKey)(),l=new St.ContentBlock({key:e,type:"page-break",text:"\n"});let i=o.getAnchorOffset();i>0&&(t=St.Modifier.splitBlock(t,o)),n=t.getBlockForKey(r),i=o.getAnchorOffset();const a=t.getBlocksAsArray(),s=a.findIndex((e=>e===n));a.splice(s+(i&&1),0,l);const c=t.getEntityMap();t=St.ContentState.createFromBlockArray(a,c);let p=St.EditorState.push(d,t,"insert-fragment"),u=St.SelectionState.createEmpty(r);u=u.merge({anchorOffset:i,focusKey:r,focusOffset:i,hasFocus:!0}),p=St.EditorState.acceptSelection(p,u),U(p)}else{const r=n.getDepth(),l=St.Modifier.setBlockType(t,o,e),i=St.EditorState.push(d,l,"change-block-type");Q(void 0,i,4,20,r)}})(e),customListSelect:e=>T(e),colorSelect:e=>ie(e),editModeToggle:()=>le(),fontFamilySelect:e=>ie(e),fontSizeSelect:e=>ie(e),indentChange:e=>Q(e),inlineToggle:e=>ie(e),insertImage:e=>M(e),insertLink:e=>(({linkUrl:e,displayText:t,newTab:o,entityKey:r})=>{const l=(0,y.isNil)(r);let i=d.getCurrentContent(),a=d.getSelection(),s=d.getCurrentInlineStyle(),c={url:e};if(o&&(c=Pt(Pt({},c),{},{target:"_blank",rel:"noreferrer"})),l)i=i.createEntity("LINK","SEGMENTED",c),r=i.getLastCreatedEntityKey();else{const e=i.getBlockForKey(a.getAnchorKey()),t=i.getBlockBefore(a.getAnchorKey());e.findEntityRanges((e=>e.includes(r)),((o,r)=>{a=a.merge({anchorOffset:o,focusOffset:r}),s=o>0?e.getInlineStyleAt(+o-1):t?t.getInlineStyleAt(+t.getLength()-1):[]})),i=i.replaceEntityData(r,c)}const p=(0,vt.OrderedSet)(["UNDERLINE","color.#0088FF"]).union(s);i=St.Modifier.replaceText(i,a,t,p,r);let u=St.EditorState.push(d,i,"insert-characters");const g=a.getFocusKey();let f=St.SelectionState.createEmpty(g);const h=+a.getAnchorOffset()+t.length;f=f.merge({focusOffset:h,anchorOffset:h}),n.current.focus(),u=St.EditorState.forceSelection(u,f),u=St.EditorState.setInlineStyleOverride(u,(0,vt.OrderedSet)(s)),U(u)})(e),insertTable:e=>(e=>{var t,o;let r=d.getSelection();if(!r.isCollapsed())return null;if("table"===d.getCurrentContent().getBlockForKey(r.getAnchorKey()).getType())return null;const n={border:"1px solid rgba(0, 0, 0, 0.2)",padding:"6px","text-align":"center"},l=Array(e.cols).fill(1),i=Array(e.rows).fill(l).map((e=>e.map((()=>({element:"td",style:Pt({},n)}))))),a=(0,St.genKey)(),s=[];i.forEach(((e,t)=>{e.forEach(((e,o)=>{let r=(0,vt.Map)({tableKey:a,tablePosition:`${a}-${t}-${o}`,"text-align":"center"});0===t&&0===o&&(r=r.set("tableShape",i).set("tableStyle",{"border-collapse":"collapse",margin:"15px 0",width:"100%"}).set("rowStyle",[]));const n=new St.ContentBlock({key:(0,St.genKey)(),type:"table",text:" ",data:r});s.push(n)}))}));const c=r.getAnchorKey();let p=d.getCurrentContent();p=St.Modifier.splitBlock(p,r);const u=p.getBlocksAsArray(),g=p.getBlockForKey(c),f=u.findIndex((e=>e===g)),h=f===u.length-1;"table"===(null===(t=u[f])||void 0===t?void 0:t.getType())&&s.unshift(new St.ContentBlock({key:(0,St.genKey)()})),"table"===(null===(o=u[f+1])||void 0===o?void 0:o.getType())&&s.push(new St.ContentBlock({key:(0,St.genKey)()})),u.splice(f+1,0,...s),h&&u.push(new St.ContentBlock({key:(0,St.genKey)()}));const m=p.getEntityMap();p=St.ContentState.createFromBlockArray(u,m);let b=St.EditorState.push(d,p,"insert-fragment");const y=s[0].getKey();r=St.SelectionState.createEmpty(y),b=St.EditorState.acceptSelection(b,r),U(b)})(e),listToggle:e=>ae(e)};return(0,u.tZ)(tt,(0,l.Z)({},r,e))}},be=["rich-text-editor",ce&&"no-toolbar",!e.maxLength&&e.noScrollMessage&&"no-statusbar"].filter(Boolean).join(" ");var ye,xe;return C?(0,u.tZ)("div",{id:e.name,ref:a,onClick:()=>c.current=!1},(0,u.tZ)(yt,{className:"rich-text-toolbar",maxDropdownHeight:Math.min((null===(ye=i.current)||void 0===ye?void 0:ye.getBoundingClientRect().height)+50||470,570)},e.disabled&&(0,u.tZ)("div",{className:"disabled-toolbar"}),me()),(0,u.tZ)(rt,{className:be,onClick:X,css:(0,u.iv)({height:k,minHeight:e.minHeight,maxHeight:e.maxHeight},";label:RichEditor;"),onScroll:fe},(0,u.tZ)(ot,null,(0,u.tZ)(St.Editor,{ref:n,editorState:d,placeholder:e.placeholder,blockRendererFn:se,blockRenderMap:It,customStyleMap:Lt,customStyleFn:Nt,blockStyleFn:e=>(e=>{const t=e.getType(),o=e.getDepth(),r=e.getData(),n=[];var l;o>
10&&!t.includes("list-item")&&n.push("indent"+o),"pasted-list-item"===t&&(null!==(l=r.get("margin-left"))&&void 0!==l?l:"00").slice(0,2)>36&&n.push("indent1");if(r.forEach(((e,t)=>{switch(t){case"text-align":case"float":n.push(`${t}-${e}`);break;default:return null}})),n.length)return n.join(" ")})(e),handleBeforeInput:(t,o)=>((t,o)=>{var r;return e.maxLength&&(null===(r=Z.current)||void 0===r?void 0:r.length)>=e.maxLength?"handled":o.getSelection().isCollapsed()?"not-handled":F(o,t)})(t,o),handleDrop:(e,t,o)=>((e,t,o)=>{const r=t.data.getData("text");let n=d.getCurrentContent();return"table"===n.getBlockForKey(e.getStartKey()).getType()?(n=St.Modifier.insertText(n,e,r),U(St.EditorState.push(d,n,"insert-characters")),!0):B(t.data.getData("text/html"))})(e,t),handleKeyCommand:(e,t)=>R(e,t),handlePastedText:(e,t,o)=>A(e,t,o),handlePastedFiles:e=>(e=>{M({imgFile:e[0]})})(e),handleReturn:(t,o)=>((t,o)=>{var r;if(e.maxLength&&(null===(r=Z.current)||void 0===r?void 0:r.length)>=e.maxLength)return"handled";if(t.shiftKey){const e=St.RichUtils.insertSoftNewline(o),t=St.Modifier.replaceText(e.getCurrentContent(),e.getSelection()," ");return U(St.EditorState.push(e,t,"insert-characters")),"handled"}if("table"===St.RichUtils.getCurrentBlockType(o))return U(St.RichUtils.insertSoftNewline(o)),"handled";if("pasted-list-item"===St.RichUtils.getCurrentBlockType(o)&&o.getSelection().isCollapsed()){let e=o.getCurrentContent(),t=o.getSelection(),r=e.getBlockForKey(t.getAnchorKey());e=St.Modifier.splitBlock(e,t);let l=St.EditorState.push(o,e,t,"split-block"),i=e.getBlockAfter(t.getAnchorKey());const a=i.getKey();for(;"pasted-list-item"===(null===(n=i)||void 0===n?void 0:n.getType());){var n;let t=r.getData();t=t.merge({listStart:+t.get("listStart")>0?t.get("listStart")+1:0}),e=St.Modifier.setBlockData(l.getCurrentContent(),St.SelectionState.createEmpty(i.getKey()),t),l=St.EditorState.push(l,e,"change-block-data"),r=e.getBlockForKey(i.getKey()),i=e.getBlockAfter(i.getKey())}return t=t.merge({anchorKey:a,focusKey:a,anchorOffset:0,focusOffset:0,hasFocus:!0}),l=St.EditorState.forceSelection(l,t),U(l),"handled"}return"not-handled"})(t,o),keyBindingFn:t=>(t=>{if(!d.getCurrentContent().hasText()&&["unstyled","paragraph"].includes(d.getCurrentContent().getFirstBlock().getType())&&(async()=>{const t=d.getCurrentInlineStyle().toArray(),o=(0,y.unionWith)(t,e.defaultStyles,((e,t)=>e.split(".")[0]===t.split(".")[0]));await U(St.EditorState.setInlineStyleOverride(d,(0,vt.OrderedSet)(o)))})(),t.keyCode===Ue&&t.shiftKey&&Mt(t))return"bullet_list";if(t.keyCode===Ue&&Mt(t))return"BOLD";if(t.keyCode===_e&&t.shiftKey&&Mt(t))return"ordered_list";if(t.keyCode===_e&&Mt(t))return"float_left";if(t.keyCode===Ve&&Mt(t))return"float_right";if(t.keyCode===qe&&Mt(t))return"ITALIC";if(t.keyCode===Xe&&Mt(t))return"INDENT";if(t.keyCode===Je&&Mt(t))return"UNDERLINE";if(t.keyCode===Ye&&Mt(t))return"OUTDENT";if(t.keyCode===We&&!Mt(t)&&!t.altKey)return"backspace";if(t.keyCode===He)return"delete";if(t.keyCode===Ge&&t.shiftKey){const e=St.RichUtils.getCurrentBlockType(d);return e.includes("list-item")?U(St.RichUtils.onTab(t,d,4)):"table"===e&&z("previous"),"shiftTab"}if(t.keyCode===Ge){const e=St.RichUtils.getCurrentBlockType(d);if(St.RichUtils.getCurrentBlockType(d).includes("list-item"))U(St.RichUtils.onTab(t,d,4));else if("table"===e)z("next");else{const e=St.Modifier.replaceText(d.getCurrentContent(),d.getSelection(),"     ");U(St.EditorState.push(d,e,"insert-characters"))}return"tab"}return(0,St.getDefaultKeyBinding)(t)})(t),onChange:e=>U(e),onFocus:H,onBlur:W,readOnly:e.disabled}))),(e.maxLength||!e.noScrollMessage)&&(0,u.tZ)(bt,(0,l.Z)({},e,{html:Z.current,text:L.current,hasScrolling:b,scrollTop:de,scrollBottom:ue})),E&&n.current&&(0,u.tZ)(at,{ref:s,editorRef:n.current,editorState:d,editLink:K})):(0,u.tZ)(pt,{className:"raw-html"},(0,u.tZ)(yt,{className:"rich-text-toolbar"},(0,u.tZ)(tt,{toolbar:["viewHtml"],editModeToggle:le,tooltipOrientation:e.tooltipOrientation})),(0,u.tZ)("div",{css:dt},(0,u.tZ)("pre",{ref:he,className:"language-html",css:e=>({margin:0,resize:"vertical",overflowY:"auto",border:`1px solid ${e.colors.richTextBorder}`,borderTop:"none",borderRadius:"0 0 3px 3px",height:k})},(0,u.tZ)("div",{onBlur:()=>e.onChange(he.current.textContent),contentEditable:"true",dangerouslySetInnerHTML:{__html:ct().highlight(null!==(xe=e.value)&&void 0!==xe?xe:"",ct().languages.html,"html")}}))))}
1));Ut.componentKey="richEditor",Ut.componentName="RichEditor",Ut.displayName="RichEditor",Ut.defaultProps={defaultStyles:[],minHeight:250,maxHeight:600,tooltipOriention:"top",onChange:()=>{},onBlur:()=>{},onFocus:()=>{},onUpload:(e,t)=>{t()}};var Wt=Ut;var Ht=(0,h.Z)("div",{target:"e1vr6skj0"})({name:"orxort",styles:"margin:6px 0;.checkbox-wrapper{.info-note{margin-left:22px;user-select:text;}}.checkbox-wrapper.size-lg .info-note{margin-left:28px;}"});var qt=(0,h.Z)("textarea",{target:"e1t7aeqg0",label:"TextareaStyle"})("&.textarea{width:100%;max-width:100%;line-height:18px;padding:6px;border-radius:5px;transition:border 200ms ease;color:",(e=>e.theme.colors.textOnPageBackground),";border-color:",(e=>e.theme.colors.textareaBorder),";background:",(e=>e.theme.colors.pageBackground),";font-size:16px;font-family:",(e=>e.theme.fonts[0]),";&:focus{border-color:",(e=>e.theme.colors.info),";box-shadow:0 0 8px -1px ",(e=>e.theme.colors.info),";}&.error{border-color:",(e=>e.theme.colors.danger),";background:",(e=>e.theme.colors.pageBackgroun
1d),";}&.disabled{cursor:not-allowed;background:",(e=>e.theme.colors.inputDisabled),";opacity:0.6;}}");const _t=r.forwardRef(((e,t)=>{var o;const r=["textarea",e.error&&"error",e.disabled&&"disabled",e.className].filter(Boolean).join(" "),n={disabled:e.disabled,id:e.name,maxLength:e.maxLength,name:e.name,placeholder:e.placeholder,onBlur:e.onBlur,onChange:t=>e.onChange(t.target.value),onFocus:e.onFocus,value:null!==(o=e.value)&&void 0!==o?o:"",rows:e.rows};return(0,u.tZ)(qt,(0,l.Z)({className:r},n,{onKeyUp:function(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault())},ref:t}))}));_t.componentDescription="Form textarea element. Used for all form text boxes.",_t.componentKey="textarea",_t.componentName="Form field text area",_t.displayName="Textarea",_t.defaultProps={disabled:!1,onChange:()=>{},onFocus:()=>{},onBlur:()=>{},rows:7};var Vt=_t;const Gt=["setRef","formLinker"],Jt=(e,t=!1)=>t?"setValues":++e>0?e:0,Yt=e=>{let{setRef:t=(()=>{}),formLinker:o}=e,n=(0,i.Z)(e,Gt);const a=(0,r.useRef)(),{0:s,1:c}=(0,r.useReducer)(Jt,0),d=e=>{if(n.inputDisabled)return null;o.setValue(n.name,e),n.onChange(e)},p=()=>{"summernote"!==n.type&&o.validate(n.name),n.onBlur()},g=()=>{o.setError(n.name,[]),n.onFocus()},f=(0,r.useCallback)((e=>{null!==e&&(a.current=e,t(e),o.setRef(n.name,{forceUpdate:c,inputRef:a}))}),[o,n.name,t]);(0,r.useEffect)((()=>(o.setRef(n.name,{forceUpdate:c,inputRef:a}),()=>{o.setRef(n.name,null)})),[o,n.name]);const h=(0,r.useRef)(!1);(0,r.useEffect)((()=>{!h.current&&"setValues"===s&&["editor","summernote"].includes(n.type)&&a.current?(h.current=!0,a.current.reset(o.getValue(n.name))):h.current&&"setValues"===s&&(h.current=!1)}),[o,n.name,n.type,s]);const m=["form-field","checkbox"===n.type&&"checkbox-type"].filter(Boolean).join(" ");return(0,y.isNil)(o)?console.error("Warning: Field requires FormLinker."):(0,y.isNil)(n.name)?console.error("Warning: Field requires name."):(0,y.get)(o.schema,n.name)||console.error(`Warning: The ${n.name} field name is not found in the schema.`),(0,u.tZ)(Ht,{className:m},(()=>{if("checkbox"===n.type)return null;const e=(0,y.get)(o.schema,n.name),t=!(0,y.isNil)(e)&&e.includes("required");return(0,u.tZ)(k,{label:n.label,errors:o.getError(n.name),name:n.name,required:t,size:n.size,disabled:n.disabled})})(),"checkbox"===n.type?null:(0,u.tZ)(L,{info:n.info}),(()=>{const e={onBlur:p,onChange:d,onFocus:g,value:o.getValue(n.name),error:o.getError(n.name)&&!(0,y.isEmpty)(o.getError(n.name))};switch(n.type){case"checkbox":{const e={checkStatus:o.getValue(n.name),hollow:!0,onCheck:d,error:o.getError(n.name)},t=["checkbox-wrapper",e.checkStatus&&"active",`size-${n.size}`].filter(Boolean).join(" ");return(0,u.tZ)("div",{className:t},(0,u.tZ)(D,(0,l.Z)({},n,e,{ref:a})),(0,u.tZ)(L,n))}case"text":return(0,u.tZ)(Vt,(0,l.Z)({},n,e,{ref:a}));case"editor":return(0,u.tZ)(Wt,(0,l.Z)({},n,e,{ref:f,formLinker:o}));default:return(0,u.tZ)(B,(0,l.Z)({},n,e,{type:n.inputType,ref:a}))}})())};Yt.componentDescription="Field is a combination of input, label, select, and error components.",Yt.componentKey="field",Yt.componentName="Form field",Yt.defaultProps={onBlur:()=>{},onChange:()=>{},onFocus:()=>{},size:"md"};var Xt=Yt;var Qt={name:"7t1xgk-Home",styles:"width:100%;display:flex;flex-wrap:wrap;justify-content:center;label:Home;"},eo={name:"1stv3gn-Home",styles:"width:1000px;padding:20px;display:flex;flex-direction:column;label:Home;"},to={name:"1av7fzi-Home",styles:"margin-top:30px;margin-bottom:0;label:Home;"},oo={name:"14lqmgg-Home",styles:"width:100%;padding:12px;border:1px solid #000;min-height:350px;label:Home;"};var ro=()=>{const{0:e,1:t}=(0,r.useReducer)((e=>e+1),0),o=(0,r.useRef)(new ce.Z({data:{editor:'<div><br></div>\n  <p style="text-align: left">This is some sample content for the <u style=\'text-decoration: underline\'>rich text editor</u>. It demonstrates paragraphs, custom block-level styling, the use of tables, and it has an image floated to the left of the next paragraph. Feel free to modify this content or delete it all and create you own.</p>\n  <figure style="text-align: left; margin: 0 0 0 8px; float: left"><img src="https://images.pexels.com/photos/414171/pexels-photo-414171.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" style="object-fit: contain; height: 140px; width: 256px; margin-right: 12px"/></figure><p>You can click on <u style=\'text-decoration: underline\'><span style=\'color:#0088FF\'><a href=\'https://github.com/EvanMorrison/draft-js-rte\' target=\'_blank\' rel=\'noreferrer\'>this link</a></span></u> or <u style=\'text-decoration: underline\'><span style=\'color:#0088FF\'><a href=\'https://draftjs.org\' target=\'_blank\' rel=\'noreferrer\'>this link</a></span></u> in the editor to see what they point to and edit them.</p>\n  <p>If you click on the image you can resize it. If you have the image selected, you can toggle float-left with cmd+L. To ensure you have the image selected rather than an adjacent paragraph, first click on the image to activate it - you\'ll see the dotted resize border appear - then click in the empty space between the dotted border and the image and the image will become selected.</p>\n  <p style="text-align: center; padding: 15px; background: #8DD; border: 1px solid #555; border-radius: 3px">You can give a paragraph some custom styling like this while in code view and it<br>will be preserved in editor view and in the html outpout.</p>\n  <hr>\n  <table style="border-collapse: collapse; margin: 15px 0; width: 80%; margin-left: 20%"><tbody><tr><td style="padding: 6px; text-align: left">&nbsp;<strong><span style=\'color:#00CC00\'>ABC Company</span></strong><br>123 Circle Rd.<br>Springfield, UT 84201<br>Phone: 801-233-3332</td><td style="padding: 6px; text-align: left"><strong><span style=\'color:#FF8800\'>XYZ Partners Ltd.</span></strong><br>789 Circuit Ave.<br>Anytown, UT 84111<br>Phone: 385-335-5555</td></tr></tbody></table> \n  <hr>\n  <div><br></div>\n  <table style="border-collapse: collapse; margin: 15px 0; width: 100%"><tbody><tr style="background-color: rgba(240, 240, 240, 0.8)"><th style="border: 1px solid rgba(0, 0, 0, 0.2); padding: 6px; text-align: center">Sample Table\xa0</th><th style="border: 1px solid rgba(0, 0, 0, 0.2); padding: 6px; text-align: center">Column A</th><th style="border: 1px solid rgba(0, 0, 0, 0.2); padding: 6px; text-align: center">Column B</th><th style="border: 1px solid rgba(0, 0, 0, 0.2); padding: 6px; text-align: center">Column C</th></tr><tr><td style="border: 1px solid rgba(0, 0, 0, 0.2); padding: 6px; text-align: center">Criteria for passing</td><td style="border: 1px solid rgba(0, 0, 0, 0.2); padding: 6px; text-align: center">50</td><td style="border: 1px solid rgba(0, 0, 0, 0.2); padding: 6px; text-align: center">37</td><td style="border: 1px solid rgba(0, 0, 0, 0.2); padding: 6px; text-align: center">44</td></tr></tbody></table>\n  <div style="text-align: left"><br></div>'},schema:{editor:"string"}}));return(0,u.tZ)("div",null,(0,u.tZ)(n.default,null,(0,u.tZ)("title",null,"Rich Text Editor"),(0,u.tZ)("link",{rel:"icon",href:"/favicon.ico"})),(0,u.tZ)("section",{css:Qt},(0,u.tZ)("div",{css:eo},(0,u.tZ)(d,null),(0,u.tZ)(Xt,{formLinker:o.current,name:"editor",type:"editor",minHeight:150,height:620,maxHeight:800,placeholder:"Enter your content here",toolbar:["withImages"],onChange:t}),(0,u.tZ)("h4",{css:to},"Output Preview - (non-contenteditable HTML generated by exporting the editor's internal 
1content state)"),(0,u.tZ)("div",{css:oo},(0,u.tZ)("div",{dangerouslySetInnerHTML:{__html:o.current.data.editor}})))))}},78581:function(e,t,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return o(41020)}])}},function(e){e.O(0,[106,888,774,179],(function(){return t=78581,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.