1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4973],{24973:(e,t,n)=>{n.r(t),n.d(t,{default:()=>W});var l=n(74848),o=n(96540),i=n(13971),r=n(98159),a=n(81036),c=n(18049),s=n(412),u=n(37594),d=n(21459),x=n(94264),h=n(18214),p=n(94341),g=n(7417),m=n(48631);let b=n(90277).YY.create({name:"fontSize",addOptions:{types:["textStyle"]},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize||null,renderHTML:e=>e.fontSize?{style:"font-size: ".concat(e.fontSize)}:{}}}}]},addCommands:()=>({setFontSize:e=>t=>{let{chain:n}=t;return n().setMark("textStyle",{fontSize:e}).run()}})});var j=n(63165),A=n(75111),f=n(56210),v=n(1865),k=n(57409),w=n(5986),C=n(38221),y=n(94589),S=n(33877),z=n(12397),N=n(72209),L=n(11583),T=n(60373),I=n(94191),H=n(46968),M=n(35820),E=n(46817),F=n(47719),U=n(39745),B=n(76835),Y=n(84061);let G=o.forwardRef(function(e,t){return(0,l.jsx)(B.A,{direction:"up",ref:t,...e})}),W=e=>{let{content:t,onChange:n}=e,[B,W]=(0,o.useState)(t),[_,q]=(0,o.useState)("16px"),[R,J]=(0,o.useState)("#000000"),[K,O]=(0,o.useState)(0),[P,V]=(0,o.useState)("paragraph"),[$,Q]=(0,o.useState)(!1),[Z,D]=(0,o.useState)(t||"<p>Start typing here...</p>"),[X,ee]=(0,o.useState)(!1),[et,en]=(0,o.useState)(null),{lang:el}=(0,F.A)(),eo=k.A.extend({addAttributes(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),backgroundColor:{default:null,parseHTML:e=>e.getAttribute("data-background-color"),renderHTML:e=>({"data-background-color":e.backgroundColor,style:"background-color: ".concat(e.backgroundColor)})}}}}),ei=(0,i.hG)({extensions:[r.A.configure({heading:!1}),a.A.configure({levels:[1,2,3,4,5]}),c.Ay,s.Ay,u.A,d.Ay,x.Ay,h.A,p.A.configure({types:["heading","paragraph"]}),g.A,m.A,b,j.Ay,A.Ay,f.Ay.configure({resizable:!0}),v.A,k.A,w.h,eo,y.Ay,C.A],content:B||"<p>Start typing here...</p>",onUpdate:e=>{let{editor:t}=e;$||(n(t.getHTML()),D(t.getHTML()))}});if((0,o.useEffect)(()=>{W(t),ei&&ei.commands.setContent(t,!1)},[t]),(0,o.useEffect)(()=>{if(!ei)return;let e=()=>{if(ei.isActive("paragraph"))V("paragraph");else for(let e=1;e<=5;e++)if(ei.isActive("heading",{level:e})){V("h".concat(e));return}};return ei.on("selectionUpdate",e),()=>{ei.off("selectionUpdate",e)}},[ei]),(0,o.useEffect)(()=>{et&&et.url&&ei.chain().focus().setImage({src:et.url}).run()},[et,ei]),!ei)return null;let er=e=>{console.log("image",e),e&&e.length>0&&en(e[0])},ea=()=>{ee(!1)},ec=e=>{console.log(e),console.log(ei.isActive("heading")),V(e),"paragraph"===e?ei.chain().focus().setParagraph().run():ei.chain().focus().toggleHeading({level:parseInt(e.replace("h",""))}).run()};return(0,l.jsxs)("div",{className:"editor-wrapper",children:[(0,l.jsxs)("div",{className:"toolbar items-center bg-gray-100 w-full dark:bg-gray-700 dark:text-white",children:[(0,l.jsx)(T.A,{title:el.undo,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().undo().run(),disabled:!ei.can().undo(),children:(0,l.jsx)(S.omt,{})})}),(0,l.jsx)(T.A,{title:el.redo,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().redo().run(),disabled:!ei.can().redo(),children:(0,l.jsx)(S.uC7,{})})}),(0,l.jsx)(I.A,{orientation:"vertical",flexItem:!0}),(0,l.jsxs)(H.A,{value:P,onChange:e=>ec(e.target.value),sx:{height:"30px",minHeight:"30px"},children:[(0,l.jsx)(M.A,{value:"paragraph",children:(0,l.jsx)("p",{style:{fontSize:"16px",margin:0},children:"Paragraph"})}),[1,2,3,4,5].map(e=>(0,l.jsx)(M.A,{value:"h".concat(e),children:(0,l.jsxs)("span",{style:{fontSize:"".concat(24-2*e,"px"),fontWeight:"bold",margin:0},children:["Heading ",e]})},e))]}),(0,l.jsx)(I.A,{orientation:"vertical",flexItem:!0}),(0,l.jsx)(T.A,{title:el.alignleft,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().setTextAlign("left").run(),className:ei.isActive({textAlign:"left"})?"active":"",children:(0,l.jsx)(S.Tpz,{})})}),(0,l.jsx)(T.A,{title:el.aligncenter,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().setTextAlign("center").run(),className:ei.isActive({textAlign:"center"})?"active":"",children:(0,l.jsx)(S.zbt,{})})}),(0,l.jsx)(T.A,{title:el.alignright,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().setTextAlign("right").run(),className:ei.isActive({textAlign:"right"})?"active":"",children:(0,l.jsx)(S.eLA,{})})}),(0,l.jsx)(I.A,{orientation:"vertical",flexItem:!0}),(0,l.jsx)(T.A,{title:el.bold,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().toggleBold().run(),className:ei.isActive("bold")?"active":"",children:(0,l.jsx)(S.uIb,{})})}),(0,l.jsx)(T.A,{title:el.italic,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().toggleItalic().run(),className:ei.isActive("italic")?"active":"",children:(0,l.jsx)(S.fIp,{})})}),(0,l.jsx)(T.A,{title:el.underline,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().toggleUnderline().run(),className:ei.isActive("underline")?"active":"",children:(0,l.jsx)(S.Vzu,{})})}),(0,l.jsx)(T.A,{title:el.fontsize,placement:"bottom",arrow:!0,children:(0,l.jsxs)("select",{className:"text-sm rounded-xl bg-white px-2 py-0.5 text-black dark:bg-gray-900 dark:text-white",onCh
1ange:e=>{q(e.target.value),ei.chain().focus().setFontSize(e.target.value).run()},value:_,children:[(0,l.jsx)("option",{value:"12px",children:"12px"}),(0,l.jsx)("option",{value:"14px",children:"14px"}),(0,l.jsx)("option",{value:"16px",children:"16px"}),(0,l.jsx)("option",{value:"18px",children:"18px"}),(0,l.jsx)("option",{value:"20px",children:"20px"}),(0,l.jsx)("option",{value:"24px",children:"24px"})]})}),(0,l.jsx)(T.A,{title:el.decreasefontsize,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>{let e="".concat(parseInt(_)-1,"px");q(e),ei.chain().focus().setFontSize(e).run()},children:"Aâ"})}),(0,l.jsx)(T.A,{title:el.increasefontsize,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>{let e="".concat(parseInt(_)+1,"px");q(e),ei.chain().focus().setFontSize(e).run()},children:"A+"})}),(0,l.jsx)(T.A,{title:el.fontcolor,placement:"bottom",arrow:!0,children:(0,l.jsx)("input",{type:"color",onChange:e=>{J(e.target.value),ei.chain().focus().setColor(e.target.value).run()},value:R,className:"color-picker"})}),(0,l.jsx)(I.A,{orientation:"vertical",flexItem:!0}),(0,l.jsx)(T.A,{title:el.bulletlist,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().toggleBulletList().run(),className:ei.isActive("bulletList")?"active":"",children:(0,l.jsx)(S.EgJ,{})})}),(0,l.jsx)(T.A,{title:el.numberlist,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().toggleOrderedList().run(),className:ei.isActive("orderedList")?"active":"",children:(0,l.jsx)(S.Bls,{})})}),(0,l.jsx)(T.A,{title:el.table,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:(0,l.jsx)(S.lKL,{})})}),(0,l.jsx)(T.A,{title:el.youtube,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>alert("Embed Youtube!"),children:(0,l.jsx)(L.Vk6,{})})}),(0,l.jsx)(T.A,{title:el.upload,placement:"bottom",arrow:!0,children:(0,l.jsx)("label",{htmlFor:"upload-image",children:(0,l.jsx)("button",{onClick:()=>{en(null),ee(!0)},children:(0,l.jsx)(S.JKf,{})})})}),(0,l.jsx)(T.A,{title:el.blockquote,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().toggleBlockquote().run(),children:(0,l.jsx)(z.$qe,{})})}),(0,l.jsx)(T.A,{title:el.codeblock,placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>ei.chain().focus().toggleCodeBlock().run(),children:(0,l.jsx)(N.W7G,{})})}),(0,l.jsx)(T.A,{title:$?"Switch to WYSIWYG Mode":"Edit HTML Code",placement:"bottom",arrow:!0,children:(0,l.jsx)("button",{onClick:()=>{$&&ei.commands.setContent(Z),Q(!$)},children:$?(0,l.jsx)(S.U3x,{}):(0,l.jsx)(S.luQ,{})})})]}),(0,l.jsx)("div",{className:"editor-container bg-white text-black",children:$?(0,l.jsx)(E.A,{className:"html-editor w-full p-2 border border-gray-300 rounded",minRows:10,value:Z,onChange:e=>D(e.target.value)}):(0,l.jsx)(i.$Z,{editor:ei,className:"tiptap w-full"})}),(0,l.jsx)(Y.A,{open:X,TransitionComponent:G,keepMounted:!0,onClose:ea,"aria-describedby":"alert-dialog-slide-description",children:(0,l.jsx)(U.A,{handleCloseForm:ea,setFiles:e=>er(e),newUpload:!et})})]})}}}]);
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.